Add symbols and uploads from the foot of the media pool
A "+ symbol" and an "upload…" button pinned to the bottom of the pool, where a list's own "add one" goes. A new symbol goes into the library only, one empty frame placed nowhere, as Flash's New Symbol, and its name opens for editing. The pane head loses its "+". Converting footage reads "make roto". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
b2b6af8f26
commit
cd02eb0477
4 changed files with 52 additions and 9 deletions
|
|
@ -697,6 +697,17 @@
|
||||||
(assoc-in % [:symbols sid :name] value)
|
(assoc-in % [:symbols sid :name] value)
|
||||||
(update-in % [:symbols sid] dissoc :name)))))))
|
(update-in % [:symbols sid] dissoc :name)))))))
|
||||||
|
|
||||||
|
(rf/reg-event-db
|
||||||
|
::add-symbol
|
||||||
|
(fn [db [_ sid]]
|
||||||
|
;; Into the library and nowhere else, as Flash's New Symbol: one empty
|
||||||
|
;; frame, placed in nothing until it is dragged somewhere. `sid` comes from
|
||||||
|
;; the caller so the pool can open the new row's name for editing.
|
||||||
|
(if (clip/symbol (:clip (store/entry (:clip/current db))) sid)
|
||||||
|
db
|
||||||
|
(edit/transaction db #(assoc-in % [:symbols sid]
|
||||||
|
{:id sid :name (name sid) :frames 1 :nodes {}})))))
|
||||||
|
|
||||||
(rf/reg-event-db
|
(rf/reg-event-db
|
||||||
::symbol-setting
|
::symbol-setting
|
||||||
(fn [db [_ sid key value]]
|
(fn [db [_ sid key value]]
|
||||||
|
|
|
||||||
|
|
@ -91,4 +91,4 @@
|
||||||
"tracing layer"]
|
"tracing layer"]
|
||||||
[:button.on {:disabled (or loading? (< n 1) (empty? name))
|
[:button.on {:disabled (or loading? (< n 1) (empty? name))
|
||||||
:on-click #(rf/dispatch [::footage/convert])}
|
:on-click #(rf/dispatch [::footage/convert])}
|
||||||
(if loading? "working…" "make symbol")]]]]))))
|
(if loading? "working…" "make roto")]]]]))))
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,10 @@
|
||||||
`events.footage/relabel`. A symbol of ANOTHER project is renameable where it
|
`events.footage/relabel`. A symbol of ANOTHER project is renameable where it
|
||||||
lives and not from here.
|
lives and not from here.
|
||||||
|
|
||||||
|
ADDING IS AT THE FOOT: a new empty symbol, which goes into the library and is
|
||||||
|
placed nowhere until it is dragged, and an upload, which is the same as a file
|
||||||
|
dropped on the pane.
|
||||||
|
|
||||||
THE WHOLE PANE IS THE DROP TARGET for a file. A video dropped anywhere in it
|
THE WHOLE PANE IS THE DROP TARGET for a file. A video dropped anywhere in it
|
||||||
uploads and lands in THIS PROJECT's media, and goes no further: which frames of
|
uploads and lands in THIS PROJECT's media, and goes no further: which frames of
|
||||||
it become a symbol, and what that symbol is called, is asked when it is dropped
|
it become a symbol, and what that symbol is called, is asked when it is dropped
|
||||||
|
|
@ -610,13 +614,7 @@
|
||||||
(reset! depth 0)
|
(reset! depth 0)
|
||||||
(when-let [file (aget (.. e -dataTransfer -files) 0)]
|
(when-let [file (aget (.. e -dataTransfer -files) 0)]
|
||||||
(rf/dispatch [::footage/upload file])))}
|
(rf/dispatch [::footage/upload file])))}
|
||||||
[:div.pane-head
|
[:div.pane-head "media pool"]
|
||||||
"media pool"
|
|
||||||
[:span.spacer]
|
|
||||||
[:button {:title "add a video, a sound or an image"
|
|
||||||
:disabled loading?
|
|
||||||
:on-click #(.click (js/document.getElementById "pool-file"))}
|
|
||||||
"+"]]
|
|
||||||
[:input {:id "pool-file" :type "file" :accept "video/*,audio/*,image/*"
|
[:input {:id "pool-file" :type "file" :accept "video/*,audio/*,image/*"
|
||||||
:style {:display "none"}
|
:style {:display "none"}
|
||||||
:on-change (fn [^js event]
|
:on-change (fn [^js event]
|
||||||
|
|
@ -646,4 +644,22 @@
|
||||||
[:span.count (get tallies k)])]))]
|
[:span.count (get tallies k)])]))]
|
||||||
[:div.pane-body
|
[:div.pane-body
|
||||||
(if (= :project @scope) [this-project ctx] [all-assets ctx])
|
(if (= :project @scope) [this-project ctx] [all-assets ctx])
|
||||||
(when status [:div.dim status])]])))
|
(when status [:div.dim status])]
|
||||||
|
;; At the foot, where a list's own "add one" goes, and pinned there so it
|
||||||
|
;; does not scroll away under a long one.
|
||||||
|
[:div.pool-foot
|
||||||
|
[:button {:title "a new empty symbol in this project's library"
|
||||||
|
:on-click (fn [_]
|
||||||
|
(let [sid (clip/fresh-id document)]
|
||||||
|
(rf/dispatch [::project/add-symbol sid])
|
||||||
|
(rf/dispatch [::ui/select [:symbol sid]])
|
||||||
|
;; Show its row and open its name, so what it
|
||||||
|
;; is called is the next thing you type.
|
||||||
|
(reset! scope :project)
|
||||||
|
(reset! query "")
|
||||||
|
(reset! editing [:symbol sid])))}
|
||||||
|
"+ symbol"]
|
||||||
|
[:button {:title "add a video, a sound or an image — or drop one on this pane"
|
||||||
|
:disabled loading?
|
||||||
|
:on-click #(.click (js/document.getElementById "pool-file"))}
|
||||||
|
"upload…"]]])))
|
||||||
|
|
|
||||||
|
|
@ -525,6 +525,22 @@ button.share-button:hover, button.share-button.on { filter: brightness(1.1); }
|
||||||
}
|
}
|
||||||
.pool-clear:hover { background: var(--hair); color: var(--fg); }
|
.pool-clear:hover { background: var(--hair); color: var(--fg); }
|
||||||
|
|
||||||
|
/* The pool's add buttons. Pushed to the bottom by the auto margin and sticky
|
||||||
|
there, so they sit at the foot of a short list and stay in view under a long
|
||||||
|
one. */
|
||||||
|
.pool-foot {
|
||||||
|
position: sticky;
|
||||||
|
bottom: 0;
|
||||||
|
z-index: 2;
|
||||||
|
margin-top: auto;
|
||||||
|
display: flex;
|
||||||
|
gap: 4px;
|
||||||
|
padding: 3px 5px;
|
||||||
|
background: var(--chrome);
|
||||||
|
border-top: 1px solid var(--line);
|
||||||
|
}
|
||||||
|
.pool-foot > button { flex: 1; }
|
||||||
|
|
||||||
/* The scope tabs, in the vocabulary `ui/tabs` already established for symbols —
|
/* The scope tabs, in the vocabulary `ui/tabs` already established for symbols —
|
||||||
the same object, so two rows of tabs on one screen read as one idea. */
|
the same object, so two rows of tabs on one screen read as one idea. */
|
||||||
.pool > .tabs { top: 45px; position: sticky; z-index: 2; }
|
.pool > .tabs { top: 45px; position: sticky; z-index: 2; }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue