A selection moves, trims and deletes together, in the timeline and the pool
Box-select clips and drag one: every selected clip moves, and in a lane they claim what they land on as one clip does, keeping their places among themselves. Drag an end and every selected end moves by as much, each its own trim; between two selected clips the cut is the end of the one before. Delete removes everything selected. The media pool picks as the timeline does: shift for a range, cmd to toggle, Delete for all of them, with one question when any is placed. Timeline rows rename symbols with a pencil. The row's buttons sit together at its end, as the pool's now do, and quick clicks on them are not a double-click on the row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
4cf279bb5a
commit
7c637576b2
10 changed files with 284 additions and 164 deletions
|
|
@ -498,7 +498,9 @@
|
||||||
(span/claim clip (:sid here) moved id :grow-symbol (random-uuid))))))
|
(span/claim clip (:sid here) moved id :grow-symbol (random-uuid))))))
|
||||||
|
|
||||||
(defn slide-many
|
(defn slide-many
|
||||||
"Move a selection simultaneously. Lane collisions refuse the entire edit."
|
"Move a selection simultaneously: `slide`, for all of it at once. What it
|
||||||
|
lands on is claimed as `slide` claims it; among themselves the moved nodes
|
||||||
|
keep their places."
|
||||||
[document open paths df]
|
[document open paths df]
|
||||||
(let [paths (vec (distinct (filter seq paths)))
|
(let [paths (vec (distinct (filter seq paths)))
|
||||||
entries (mapv (fn [path]
|
entries (mapv (fn [path]
|
||||||
|
|
@ -528,9 +530,10 @@
|
||||||
{} roots)]
|
{} roots)]
|
||||||
(reduce (fn [result [sid changed]]
|
(reduce (fn [result [sid changed]]
|
||||||
(if (:refused result) (reduced result)
|
(if (:refused result) (reduced result)
|
||||||
(span/finish (:clip result) sid
|
(span/claim-each (:clip result) sid
|
||||||
(merge (get-in (:clip result) [:symbols sid :nodes]) changed)
|
(merge (get-in (:clip result) [:symbols sid :nodes]) changed)
|
||||||
nil :grow-symbol)))
|
(update-vals changed (fn [_] (random-uuid)))
|
||||||
|
:grow-symbol)))
|
||||||
{:clip document} changes)))))
|
{:clip document} changes)))))
|
||||||
|
|
||||||
(defn resize-out
|
(defn resize-out
|
||||||
|
|
@ -566,6 +569,19 @@
|
||||||
:else
|
:else
|
||||||
(span/resize-in clip sid id (dragged here nodes id (first (node/placed-span n)) df)))))
|
(span/resize-in clip sid id (dragged here nodes id (first (node/placed-span n)) df)))))
|
||||||
|
|
||||||
|
(defn resize-many
|
||||||
|
"Move the `kind` edge, `:in` or `:out`, of every node at `paths` by `df`
|
||||||
|
frames of `open`: each one's own edit, in turn, so each claims what it claims
|
||||||
|
alone. One eaten by an earlier one has no edge left to move."
|
||||||
|
[clip open paths kind df ripple?]
|
||||||
|
(reduce (fn [result path]
|
||||||
|
(let [c (:clip result)]
|
||||||
|
(cond
|
||||||
|
(nil? (get-in c [:symbols (:sid (down c open (pop path))) :nodes (peek path)])) result
|
||||||
|
(= :out kind) (let [r (resize-out c open path df ripple?)] (if (:refused r) (reduced r) r))
|
||||||
|
:else (let [r (resize-in c open path df)] (if (:refused r) (reduced r) r)))))
|
||||||
|
{:clip clip} (distinct paths)))
|
||||||
|
|
||||||
(defn roll
|
(defn roll
|
||||||
"Move the shared boundary at `right-path` and the adjacent `left-path`."
|
"Move the shared boundary at `right-path` and the adjacent `left-path`."
|
||||||
[clip open left-path right-path df]
|
[clip open left-path right-path df]
|
||||||
|
|
@ -583,6 +599,17 @@
|
||||||
(span/roll clip sid left-id right-id
|
(span/roll clip sid left-id right-id
|
||||||
(dragged here nodes right-id (first (node/placed-span right)) df)))))
|
(dragged here nodes right-id (first (node/placed-span right)) df)))))
|
||||||
|
|
||||||
|
(defn drag
|
||||||
|
"What a timeline gesture does to `clip`: `kind` is the handle — `:slide` the
|
||||||
|
body, `:in` and `:out` an edge, `:roll` a cut — and `paths` the selection it
|
||||||
|
carries when there is one."
|
||||||
|
[clip open {:keys [path df kind ripple? other paths]}]
|
||||||
|
(case kind
|
||||||
|
:out (if (seq paths) (resize-many clip open paths :out df ripple?) (resize-out clip open path df ripple?))
|
||||||
|
:in (if (seq paths) (resize-many clip open paths :in df false) (resize-in clip open path df))
|
||||||
|
:roll (roll clip open other path df)
|
||||||
|
(if (seq paths) (slide-many clip open paths df) (slide clip open path df))))
|
||||||
|
|
||||||
(defn restack
|
(defn restack
|
||||||
"Put the node at row path `from` just in front of the one at `to` when
|
"Put the node at row path `from` just in front of the one at `to` when
|
||||||
`front?`, or just behind it — side by side in one symbol, as the timeline lists
|
`front?`, or just behind it — side by side in one symbol, as the timeline lists
|
||||||
|
|
|
||||||
|
|
@ -144,6 +144,41 @@
|
||||||
[n which f]
|
[n which f]
|
||||||
(assoc-in n [:span (case which :in 0 :out 1)] (local n f)))
|
(assoc-in n [:span (case which :in 0 :out 1)] (local n f)))
|
||||||
|
|
||||||
|
(defn- eaten
|
||||||
|
"`nodes` with lane clip `id`'s interval taken from every clip not in `keep`:
|
||||||
|
those it covers are removed and those crossing an edge trimmed. A clip crossing
|
||||||
|
both edges is split, and its remainder is `remainder-id`. Nil where that split
|
||||||
|
has no free id."
|
||||||
|
[nodes id keep remainder-id]
|
||||||
|
(let [[a b] (node/placed-span (get nodes id))
|
||||||
|
others (remove #(contains? keep (:id %)) (symbol/children nodes))
|
||||||
|
spanning (some #(let [[lo hi] (node/placed-span %)] (and (< lo a) (> hi b))) others)]
|
||||||
|
(when-not (and spanning (or (nil? remainder-id) (contains? nodes remainder-id)))
|
||||||
|
(reduce
|
||||||
|
(fn [ns other]
|
||||||
|
(let [oid (:id other)
|
||||||
|
[lo hi] (node/placed-span other)]
|
||||||
|
(cond
|
||||||
|
(or (<= hi a) (>= lo b)) ns
|
||||||
|
(and (< lo a) (> hi b))
|
||||||
|
(-> ns
|
||||||
|
(assoc oid (edged other :out a))
|
||||||
|
(assoc remainder-id
|
||||||
|
(assoc (edged other :in b) :id remainder-id
|
||||||
|
:z (str "a-" remainder-id))))
|
||||||
|
(and (>= lo a) (<= hi b)) (dissoc ns oid)
|
||||||
|
(< lo a) (assoc ns oid (edged other :out a))
|
||||||
|
:else (assoc ns oid (edged other :in b)))))
|
||||||
|
nodes others))))
|
||||||
|
|
||||||
|
(defn- lane-child? [clip sid nodes id]
|
||||||
|
(let [n (get nodes id)]
|
||||||
|
(and (symbol/lane? (clip/symbol clip sid))
|
||||||
|
n (nil? (:parent n)) (node/placed-span n))))
|
||||||
|
|
||||||
|
(def ^:private split-refusal
|
||||||
|
{:refused "claiming time inside one clip needs a free ID for its remainder"})
|
||||||
|
|
||||||
(defn claim
|
(defn claim
|
||||||
"Commit proposed `nodes`, with `id` claiming its interval in lane mode.
|
"Commit proposed `nodes`, with `id` claiming its interval in lane mode.
|
||||||
|
|
||||||
|
|
@ -153,37 +188,24 @@
|
||||||
edge are trimmed. A clip crossing both edges is split and therefore needs a
|
edge are trimmed. A clip crossing both edges is split and therefore needs a
|
||||||
caller-supplied `remainder-id`."
|
caller-supplied `remainder-id`."
|
||||||
[clip sid nodes id extent remainder-id]
|
[clip sid nodes id extent remainder-id]
|
||||||
(let [n (get nodes id)
|
(if-not (lane-child? clip sid nodes id)
|
||||||
lane-child? (and (symbol/lane? (clip/symbol clip sid))
|
(finish clip sid nodes id extent)
|
||||||
n (nil? (:parent n)) (node/placed-span n))]
|
(if-let [ns (eaten nodes id #{id} remainder-id)]
|
||||||
(if-not lane-child?
|
(finish clip sid ns id extent)
|
||||||
(finish clip sid nodes id extent)
|
split-refusal)))
|
||||||
(let [[a b] (node/placed-span n)
|
|
||||||
others (remove #(= id (:id %)) (symbol/children nodes))
|
(defn claim-each
|
||||||
spanning (first (filter #(let [[lo hi] (node/placed-span %)]
|
"`claim` for clips edited together, `remainders` mapping each one's id to a
|
||||||
(and (< lo a) (> hi b)))
|
free id for a split. Each takes its interval from the clips that are NOT among
|
||||||
others))]
|
them; among themselves they keep the places the edit gave them."
|
||||||
(if (and spanning (or (nil? remainder-id) (contains? nodes remainder-id)))
|
[clip sid nodes remainders extent]
|
||||||
{:refused "claiming time inside one clip needs a free ID for its remainder"}
|
(let [keep (set (keys remainders))
|
||||||
(finish
|
ns (reduce (fn [ns [id remainder-id]]
|
||||||
clip sid
|
(if (lane-child? clip sid ns id)
|
||||||
(reduce
|
(or (eaten ns id keep remainder-id) (reduced nil))
|
||||||
(fn [ns other]
|
ns))
|
||||||
(let [oid (:id other)
|
nodes remainders)]
|
||||||
[lo hi] (node/placed-span other)]
|
(if ns (finish clip sid ns nil extent) split-refusal)))
|
||||||
(cond
|
|
||||||
(or (<= hi a) (>= lo b)) ns
|
|
||||||
(and (< lo a) (> hi b))
|
|
||||||
(-> ns
|
|
||||||
(assoc oid (edged other :out a))
|
|
||||||
(assoc remainder-id
|
|
||||||
(assoc (edged other :in b) :id remainder-id
|
|
||||||
:z (str "a-" remainder-id))))
|
|
||||||
(and (>= lo a) (<= hi b)) (dissoc ns oid)
|
|
||||||
(< lo a) (assoc ns oid (edged other :out a))
|
|
||||||
:else (assoc ns oid (edged other :in b)))))
|
|
||||||
nodes others)
|
|
||||||
id extent))))))
|
|
||||||
|
|
||||||
(defn host-frame
|
(defn host-frame
|
||||||
"Symbol frame `f` as a frame of the space node `id` is POSITIONED in — its
|
"Symbol frame `f` as a frame of the space node `id` is POSITIONED in — its
|
||||||
|
|
|
||||||
|
|
@ -1380,11 +1380,8 @@
|
||||||
(let [db (update db :ui dissoc :sliding)
|
(let [db (update db :ui dissoc :sliding)
|
||||||
clip (:clip (store/entry (:clip/current db)))
|
clip (:clip (store/entry (:clip/current db)))
|
||||||
open (or owner (get-in db [:ui :open]))
|
open (or owner (get-in db [:ui :open]))
|
||||||
r (case kind
|
r (nest/drag clip open {:path path :df df :kind kind :ripple? ripple?
|
||||||
:out (nest/resize-out clip open path df ripple?)
|
:other other :paths paths})]
|
||||||
:in (nest/resize-in clip open path df)
|
|
||||||
:roll (nest/roll clip open other path df)
|
|
||||||
(if (seq paths) (nest/slide-many clip open paths df) (nest/slide clip open path df)))]
|
|
||||||
(cond
|
(cond
|
||||||
(zero? df) db
|
(zero? df) db
|
||||||
(:refused r) (refused db (:refused r))
|
(:refused r) (refused db (:refused r))
|
||||||
|
|
@ -1476,45 +1473,60 @@
|
||||||
(when (js/confirm message) (rf/dispatch then))))
|
(when (js/confirm message) (rf/dispatch then))))
|
||||||
|
|
||||||
(rf/reg-event-fx
|
(rf/reg-event-fx
|
||||||
::delete-symbol
|
::delete-symbols
|
||||||
;; Out of the library, with its placements; see `nest/delete-symbol`. Its tab
|
;; Out of the library, with their placements; see `nest/delete-symbol`. Their
|
||||||
;; closes, and if it was on screen the root takes its place.
|
;; tabs close, and if one was on screen the root takes its place.
|
||||||
;;
|
;;
|
||||||
;; ASKED FIRST WHEN IT IS PLACED, because then the delete reaches past the row
|
;; ASKED FIRST WHEN ANY IS PLACED, because then the delete reaches past the
|
||||||
;; you pointed at, into every symbol that uses it. One placed nowhere goes
|
;; rows you pointed at, into every symbol that uses them. Ones placed nowhere
|
||||||
;; without a question; undo is there either way.
|
;; go without a question; undo is there either way.
|
||||||
(fn [{:keys [db]} [_ sid sure?]]
|
(fn [{:keys [db]} [_ sids sure?]]
|
||||||
(let [clip (:clip (store/entry (:clip/current db)))
|
(let [clip (:clip (store/entry (:clip/current db)))
|
||||||
{gone :clip why :refused} (nest/delete-symbol clip sid)
|
sids (vec (distinct sids))
|
||||||
uses (clip/uses clip sid)]
|
{gone :clip why :refused} (reduce (fn [r sid]
|
||||||
|
(let [r (nest/delete-symbol (:clip r) sid)]
|
||||||
|
(if (:refused r) (reduced r) r)))
|
||||||
|
{:clip clip} sids)
|
||||||
|
gone? (set sids)
|
||||||
|
;; Uses from outside what is being deleted: those are what reach past.
|
||||||
|
placed (for [sid sids
|
||||||
|
:let [owners (remove gone? (clip/owners clip sid))]
|
||||||
|
:when (seq owners)]
|
||||||
|
[sid owners])]
|
||||||
(cond
|
(cond
|
||||||
why
|
why
|
||||||
{:db (refused db why)}
|
{:db (refused db why)}
|
||||||
|
|
||||||
(and (pos? uses) (not sure?))
|
(and (seq placed) (not sure?))
|
||||||
{::confirm {:message (str "Delete " (clip/symbol-name clip sid) "? It is used "
|
{::confirm {:message (str "Delete "
|
||||||
(if (= 1 uses) "once" (str uses " times")) ", in "
|
(if (= 1 (count sids))
|
||||||
(str/join ", " (map #(clip/symbol-name clip %)
|
(clip/symbol-name clip (first sids))
|
||||||
(clip/owners clip sid)))
|
(str (count sids) " symbols"))
|
||||||
", and every use of it goes too.")
|
"? "
|
||||||
:then [::delete-symbol sid true]}}
|
(str/join "; " (for [[sid owners] placed]
|
||||||
|
(str (clip/symbol-name clip sid) " is used in "
|
||||||
|
(str/join ", " (map #(clip/symbol-name clip %) owners)))))
|
||||||
|
", and every use goes too.")
|
||||||
|
:then [::delete-symbols sids true]}}
|
||||||
|
|
||||||
:else
|
:else
|
||||||
(cond-> {:db (-> db
|
(cond-> {:db (-> db
|
||||||
(edit/transaction (constantly gone))
|
(edit/transaction (constantly gone))
|
||||||
(update-in [:ui :tabs] #(vec (remove #{sid} %)))
|
(update-in [:ui :tabs] #(vec (remove gone? %)))
|
||||||
(update :ui (fn [ui]
|
(update :ui (fn [ui]
|
||||||
(cond-> ui
|
(let [left (vec (remove #(and (= :symbol (first %)) (gone? (second %)))
|
||||||
(= [:symbol sid] (:selection ui))
|
(:selections ui)))]
|
||||||
(assoc :selection nil :selections [])))))}
|
(assoc ui :selections left
|
||||||
(= sid (get-in db [:ui :open]))
|
:selection (when (some #{(:selection ui)} left)
|
||||||
|
(:selection ui)))))))}
|
||||||
|
(gone? (get-in db [:ui :open]))
|
||||||
(assoc :dispatch [::playback/open-symbol (clip/opens-on gone)]))))))
|
(assoc :dispatch [::playback/open-symbol (clip/opens-on gone)]))))))
|
||||||
|
|
||||||
(rf/reg-event-fx
|
(rf/reg-event-fx
|
||||||
::delete-selected
|
::delete-selected
|
||||||
;; Backspace while drawing takes the last point back, as in Illustrator; on
|
;; Backspace while drawing takes the last point back, as in Illustrator; on
|
||||||
;; the pen, with a point of the selected shape picked, it takes that point. A
|
;; the pen, with a point of the selected shape picked, it takes that point.
|
||||||
;; symbol picked in the pool is deleted from the library.
|
;; Symbols picked in the pool are deleted from the library.
|
||||||
(fn [{:keys [db]} _]
|
(fn [{:keys [db]} _]
|
||||||
(let [[vsid vid i] (get-in db [:ui :vertex])
|
(let [[vsid vid i] (get-in db [:ui :vertex])
|
||||||
primary (get-in db [:ui :selection])]
|
primary (get-in db [:ui :selection])]
|
||||||
|
|
@ -1526,7 +1538,8 @@
|
||||||
{:db (deleting-vertex db vsid vid i)}
|
{:db (deleting-vertex db vsid vid i)}
|
||||||
|
|
||||||
(= :symbol (first primary))
|
(= :symbol (first primary))
|
||||||
{:dispatch [::delete-symbol (second primary)]}
|
{:dispatch [::delete-symbols (keep (fn [[kind sid]] (when (= :symbol kind) sid))
|
||||||
|
(cons primary (get-in db [:ui :selections])))]}
|
||||||
|
|
||||||
:else
|
:else
|
||||||
(let [many (vec (get-in db [:ui :selections]))
|
(let [many (vec (get-in db [:ui :selections]))
|
||||||
|
|
|
||||||
|
|
@ -43,13 +43,8 @@
|
||||||
;; lets go, so the stage and the rows follow the pointer. Nothing is written
|
;; lets go, so the stage and the rows follow the pointer. Nothing is written
|
||||||
;; until then: one drag is one undo step and one write to collaborators.
|
;; until then: one drag is one undo step and one write to collaborators.
|
||||||
(let [{c :clip st :store} (footage/entry id)]
|
(let [{c :clip st :store} (footage/entry id)]
|
||||||
(or (when-let [{:keys [path df kind ripple? other owner paths]} sliding]
|
(or (when sliding
|
||||||
(let [root (or owner open)]
|
(:clip (nest/drag c (or (:owner sliding) open) sliding)))
|
||||||
(:clip (case kind
|
|
||||||
:out (nest/resize-out c root path df ripple?)
|
|
||||||
:in (nest/resize-in c root path df)
|
|
||||||
:roll (nest/roll c root other path df)
|
|
||||||
(if (seq paths) (nest/slide-many c root paths df) (nest/slide c root path df))))))
|
|
||||||
(when-let [{:keys [sid id frame values edits]} gesture]
|
(when-let [{:keys [sid id frame values edits]} gesture]
|
||||||
;; A held stage control owns the touched parameters completely. Make
|
;; A held stage control owns the touched parameters completely. Make
|
||||||
;; them temporary static channels for the preview, so their existing
|
;; them temporary static channels for the preview, so their existing
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,7 @@
|
||||||
`inside` is `{:count :open? :flip!}` for a row with rows under it; a row with
|
`inside` is `{:count :open? :flip!}` for a row with rows under it; a row with
|
||||||
none keeps the twisty's room, so names line up down a level.
|
none keeps the twisty's room, so names line up down a level.
|
||||||
|
|
||||||
`delete!` puts a cross beside the pencil, on hover as the pencil is."
|
`delete!` puts a cross beside the pencil while the row is picked."
|
||||||
[{:keys [label sub sub2 title thumb on? open? main? disabled? rename depth inside delete!]
|
[{:keys [label sub sub2 title thumb on? open? main? disabled? rename depth inside delete!]
|
||||||
:as opts}]
|
:as opts}]
|
||||||
(let [{:keys [key value begin! commit!]} rename
|
(let [{:keys [key value begin! commit!]} rename
|
||||||
|
|
@ -255,25 +255,53 @@
|
||||||
;; the browser test finds a row by the name a person reads.
|
;; the browser test finds a row by the name a person reads.
|
||||||
[:span.name label]
|
[:span.name label]
|
||||||
(when (and main? sub2) [:span.detail sub2])]
|
(when (and main? sub2) [:span.detail sub2])]
|
||||||
(when begin!
|
|
||||||
[:span.pool-rename
|
|
||||||
{:title (str "rename " label " (F2)")
|
|
||||||
;; Mouse-only by design — see the docstring. A `tabindex` here would
|
|
||||||
;; make it interactive content inside a button, which is the thing
|
|
||||||
;; being avoided, and F2 already reaches it from the keyboard.
|
|
||||||
:on-click (fn [^js e] (.stopPropagation e) (begin! key))}
|
|
||||||
"\u270E"])
|
|
||||||
(when delete!
|
|
||||||
[:span.pool-rename.pool-delete
|
|
||||||
{:title (str "delete " label " (Delete)")
|
|
||||||
:on-click (fn [^js e] (.stopPropagation e) (delete!))}
|
|
||||||
"\u00D7"])
|
|
||||||
;; The main row says both its facts under the name instead.
|
;; The main row says both its facts under the name instead.
|
||||||
(when (and sub (not main?)) [:span.sub sub])]])]))
|
(when (and sub (not main?)) [:span.sub sub])
|
||||||
|
;; At the row's end, together, as a timeline row has them: the pencil
|
||||||
|
;; on every row and the cross on what is picked. Two quick clicks on
|
||||||
|
;; either are two clicks, not a double-click that opens the row.
|
||||||
|
[:span.pool-actions {:on-double-click (fn [^js e] (.stopPropagation e))}
|
||||||
|
(when begin!
|
||||||
|
[:span.pool-rename
|
||||||
|
{:title (str "rename " label " (F2)")
|
||||||
|
;; Mouse-only by design — see the docstring. A `tabindex` here would
|
||||||
|
;; make it interactive content inside a button, which is the thing
|
||||||
|
;; being avoided, and F2 already reaches it from the keyboard.
|
||||||
|
:on-click (fn [^js e] (.stopPropagation e) (begin! key))}
|
||||||
|
"\u270E"])
|
||||||
|
(when (and delete! on?)
|
||||||
|
[:span.pool-rename.pool-delete
|
||||||
|
{:title (str "delete " label " (Delete)")
|
||||||
|
:on-click (fn [^js e] (.stopPropagation e) (delete!))}
|
||||||
|
"\u00D7"])]]])]))
|
||||||
|
|
||||||
;; ---------------------------------------------------------------------------
|
;; ---------------------------------------------------------------------------
|
||||||
;; the rows of each kind
|
;; the rows of each kind
|
||||||
|
|
||||||
|
(defonce ^:private anchor (atom nil))
|
||||||
|
|
||||||
|
(defn- pick!
|
||||||
|
"A click picks `what`, as a click on a timeline row does: with ⌘ it is added
|
||||||
|
to the picked or taken out of them, and with shift every row shown from the
|
||||||
|
last one clicked to this one is picked."
|
||||||
|
[^js e what]
|
||||||
|
(let [shown (vec (keep #(aget % "arthurPick")
|
||||||
|
(array-seq (.querySelectorAll (.closest (.-currentTarget e) ".pane.pool")
|
||||||
|
".pool-item"))))
|
||||||
|
a (.indexOf shown @anchor)
|
||||||
|
b (.indexOf shown what)]
|
||||||
|
(cond
|
||||||
|
(or (.-metaKey e) (.-ctrlKey e)) (rf/dispatch [::ui/toggle-selection what])
|
||||||
|
(and (.-shiftKey e) (<= 0 a) (<= 0 b))
|
||||||
|
(rf/dispatch [::ui/select-many (subvec shown (min a b) (inc (max a b)))])
|
||||||
|
:else (rf/dispatch [::ui/select what]))
|
||||||
|
(when-not (.-shiftKey e) (reset! anchor what))))
|
||||||
|
|
||||||
|
(defn- pickable
|
||||||
|
"The ref that tells `pick!` which rows are shown, in order."
|
||||||
|
[what]
|
||||||
|
(fn [^js el] (when el (aset el "arthurPick" what))))
|
||||||
|
|
||||||
(defn- symbol-row [document sid {:keys [clip-id store palette selection open main rename
|
(defn- symbol-row [document sid {:keys [clip-id store palette selection open main rename
|
||||||
depth inside]}]
|
depth inside]}]
|
||||||
(let [sym (clip/symbol document sid)
|
(let [sym (clip/symbol document sid)
|
||||||
|
|
@ -292,19 +320,20 @@
|
||||||
[tracing-thumb (:media sym)]
|
[tracing-thumb (:media sym)]
|
||||||
[picture (symbol-thumb document sid store palette)])
|
[picture (symbol-thumb document sid store palette)])
|
||||||
:sub2 (str (:frames sym) "f · " nodes (if (= 1 nodes) " node" " nodes"))
|
:sub2 (str (:frames sym) "f · " nodes (if (= 1 nodes) " node" " nodes"))
|
||||||
:on? (= selection [:symbol sid])
|
:on? (contains? selection [:symbol sid])
|
||||||
:open? (= sid open)
|
:open? (= sid open)
|
||||||
:main? (= sid main)
|
:main? (= sid main)
|
||||||
:depth depth
|
:depth depth
|
||||||
:inside inside
|
:inside inside
|
||||||
:delete! (when-not (= sid main) #(rf/dispatch [::ui/delete-symbol sid]))
|
:delete! (when-not (= sid main) #(rf/dispatch [::ui/delete-symbols [sid]]))
|
||||||
:rename (assoc rename
|
:rename (assoc rename
|
||||||
:key [:symbol sid]
|
:key [:symbol sid]
|
||||||
:value label
|
:value label
|
||||||
:commit! (fn [value]
|
:commit! (fn [value]
|
||||||
((:begin! rename) nil)
|
((:begin! rename) nil)
|
||||||
(rf/dispatch [::project/rename-symbol sid value])))
|
(rf/dispatch [::project/rename-symbol sid value])))
|
||||||
:on-click #(rf/dispatch [::ui/select [:symbol sid]])
|
:on-click #(pick! % [:symbol sid])
|
||||||
|
:ref (pickable [:symbol sid])
|
||||||
:on-double-click #(rf/dispatch [::pb/open-symbol sid])}
|
:on-double-click #(rf/dispatch [::pb/open-symbol sid])}
|
||||||
(carrying (str "symbol:" (subs (str sid) 1))
|
(carrying (str "symbol:" (subs (str sid) 1))
|
||||||
#(drag/symbol! clip-id sid open)))]))
|
#(drag/symbol! clip-id sid open)))]))
|
||||||
|
|
@ -316,14 +345,15 @@
|
||||||
[row {:label (clip/symbol-name document sid)
|
[row {:label (clip/symbol-name document sid)
|
||||||
:sub (str "uses " (or (:name p) (:palette-ref sym)))
|
:sub (str "uses " (or (:name p) (:palette-ref sym)))
|
||||||
:title "Palette transition definition"
|
:title "Palette transition definition"
|
||||||
:on? (= selection [:symbol sid])
|
:on? (contains? selection [:symbol sid])
|
||||||
:rename (assoc rename
|
:rename (assoc rename
|
||||||
:key [:symbol sid]
|
:key [:symbol sid]
|
||||||
:value (clip/symbol-name document sid)
|
:value (clip/symbol-name document sid)
|
||||||
:commit! (fn [value]
|
:commit! (fn [value]
|
||||||
((:begin! rename) nil)
|
((:begin! rename) nil)
|
||||||
(rf/dispatch [::project/rename-symbol sid value])))
|
(rf/dispatch [::project/rename-symbol sid value])))
|
||||||
:on-click #(rf/dispatch [::ui/select [:symbol sid]])}]))
|
:on-click #(pick! % [:symbol sid])
|
||||||
|
:ref (pickable [:symbol sid])}]))
|
||||||
|
|
||||||
(defn- footage-row [{:keys [id label frames fps video width height] :as f} chosen rename]
|
(defn- footage-row [{:keys [id label frames fps video width height] :as f} chosen rename]
|
||||||
^{:key id}
|
^{:key id}
|
||||||
|
|
@ -632,7 +662,7 @@
|
||||||
clip-id @(rf/subscribe [::render/clip-id])
|
clip-id @(rf/subscribe [::render/clip-id])
|
||||||
store @(rf/subscribe [::render/store])
|
store @(rf/subscribe [::render/store])
|
||||||
palette @(rf/subscribe [::render/palette])
|
palette @(rf/subscribe [::render/palette])
|
||||||
selection @(rf/subscribe [::sub/selection])
|
selection (set @(rf/subscribe [::sub/selections]))
|
||||||
open @(rf/subscribe [::render/open])
|
open @(rf/subscribe [::render/open])
|
||||||
media @(rf/subscribe [::sub/project-footage])
|
media @(rf/subscribe [::sub/project-footage])
|
||||||
{:keys [symbols palettes]} @(rf/subscribe [::project/assets])
|
{:keys [symbols palettes]} @(rf/subscribe [::project/assets])
|
||||||
|
|
|
||||||
|
|
@ -790,8 +790,10 @@
|
||||||
;; The palette row is the symbol's one palette lane: "palette" says all
|
;; The palette row is the symbol's one palette lane: "palette" says all
|
||||||
;; there is to say, and it has no name of its own to change.
|
;; there is to say, and it has no name of its own to change.
|
||||||
named-lane? (and lane? (not= :palette kind))
|
named-lane? (and lane? (not= :palette kind))
|
||||||
|
;; A node row renames what it shows: an instance, its symbol.
|
||||||
|
renamable? (or named-lane? (and node? (some? (nth select 2 nil))))
|
||||||
selected? (contains? selections select)
|
selected? (contains? selections select)
|
||||||
editing? (and lane? (= select @renaming))
|
editing? (and renamable? (= select @renaming))
|
||||||
begin-rename! (fn [] (reset! draft label) (reset! renaming select))
|
begin-rename! (fn [] (reset! draft label) (reset! renaming select))
|
||||||
commit-rename! (fn []
|
commit-rename! (fn []
|
||||||
(when (= select @renaming)
|
(when (= select @renaming)
|
||||||
|
|
@ -827,7 +829,7 @@
|
||||||
;; grouped with it into a new one; onto an edge of either, to be
|
;; grouped with it into a new one; onto an edge of either, to be
|
||||||
;; restacked in front of it or behind it, in whichever symbol it is
|
;; restacked in front of it or behind it, in whichever symbol it is
|
||||||
;; in. All of them keep the picture as it is, but for the stacking.
|
;; in. All of them keep the picture as it is, but for the stacking.
|
||||||
node? (merge {:draggable true
|
node? (merge {:draggable (not editing?)
|
||||||
:on-drag-start (fn [^js e]
|
:on-drag-start (fn [^js e]
|
||||||
(.stopPropagation e)
|
(.stopPropagation e)
|
||||||
(.setData (.-dataTransfer e) "text/plain" "row")
|
(.setData (.-dataTransfer e) "text/plain" "row")
|
||||||
|
|
@ -868,6 +870,7 @@
|
||||||
;; is then suppressed by the browser).
|
;; is then suppressed by the browser).
|
||||||
:draggable false
|
:draggable false
|
||||||
:on-pointer-down (fn [^js e] (.stopPropagation e))
|
:on-pointer-down (fn [^js e] (.stopPropagation e))
|
||||||
|
:on-double-click (fn [^js e] (.stopPropagation e))
|
||||||
:on-click (fn [^js e]
|
:on-click (fn [^js e]
|
||||||
(.stopPropagation e)
|
(.stopPropagation e)
|
||||||
(rf/dispatch [::ui/set-row-expanded path (not expanded?)]))}
|
(rf/dispatch [::ui/set-row-expanded path (not expanded?)]))}
|
||||||
|
|
@ -880,7 +883,7 @@
|
||||||
(when lane? [:span.tl-ico {:aria-hidden true} [icon/view :lane]])
|
(when lane? [:span.tl-ico {:aria-hidden true} [icon/view :lane]])
|
||||||
(if editing?
|
(if editing?
|
||||||
[:input.tl-name-input
|
[:input.tl-name-input
|
||||||
{:value @draft :auto-focus true :aria-label "lane name"
|
{:value @draft :auto-focus true :aria-label "name"
|
||||||
:on-click #(.stopPropagation %)
|
:on-click #(.stopPropagation %)
|
||||||
:on-double-click #(.stopPropagation %)
|
:on-double-click #(.stopPropagation %)
|
||||||
:on-change #(reset! draft (.. % -target -value))
|
:on-change #(reset! draft (.. % -target -value))
|
||||||
|
|
@ -899,40 +902,43 @@
|
||||||
(cond
|
(cond
|
||||||
named-lane? [:span.kind "·lane"]
|
named-lane? [:span.kind "·lane"]
|
||||||
node? [:span.kind (if via (str "· in " via) (str "·" (name node-kind)))])
|
node? [:span.kind (if via (str "· in " via) (str "·" (name node-kind)))])
|
||||||
(when named-lane?
|
;; The row's buttons sit together at its right end. Two quick clicks on
|
||||||
[:button.tl-rename
|
;; one of them are two clicks, not a double-click that opens the row.
|
||||||
{:title "rename lane"
|
[:span.tl-actions {:on-double-click (fn [^js e] (.stopPropagation e))}
|
||||||
:on-click (fn [^js e] (.stopPropagation e) (begin-rename!))}
|
(when (and renamable? (not editing?))
|
||||||
"✎"])
|
[:button.tl-rename
|
||||||
;; A tracing layer's row switches it on and off, next to solo because the
|
{:title (if (= :instance node-kind) "rename symbol · every placement follows" "rename")
|
||||||
;; two are the same kind of thing: what this row shows, here, now, and
|
:on-click (fn [^js e] (.stopPropagation e) (begin-rename!))}
|
||||||
;; nothing the picture keeps. A face's row switches its footage — its
|
"✎"])
|
||||||
;; plate — which is the same switch wherever the face is placed.
|
;; A tracing layer's row switches it on and off, next to solo because the
|
||||||
(when-let [layer (cond (contains? (:traces tracing) of) [(second select) (nth select 2)]
|
;; two are the same kind of thing: what this row shows, here, now, and
|
||||||
(contains? (:plated tracing) of) [of :plate])]
|
;; nothing the picture keeps. A face's row switches its footage — its
|
||||||
(let [{:keys [on? hidden]} (:state tracing)
|
;; plate — which is the same switch wherever the face is placed.
|
||||||
shown? (and on? (not (contains? hidden layer)))]
|
(when-let [layer (cond (contains? (:traces tracing) of) [(second select) (nth select 2)]
|
||||||
[:button {:class (str "tl-trace" (when shown? " on"))
|
(contains? (:plated tracing) of) [of :plate])]
|
||||||
:title (if (contains? (:traces tracing) of)
|
(let [{:keys [on? hidden]} (:state tracing)
|
||||||
"show this tracing layer · never exported"
|
shown? (and on? (not (contains? hidden layer)))]
|
||||||
"show the footage this face was traced from")
|
[:button {:class (str "tl-trace" (when shown? " on"))
|
||||||
:on-click (fn [^js e]
|
:title (if (contains? (:traces tracing) of)
|
||||||
(.stopPropagation e)
|
"show this tracing layer · never exported"
|
||||||
(rf/dispatch [::ui/show-trace layer (not shown?)]))}
|
"show the footage this face was traced from")
|
||||||
"T"]))
|
:on-click (fn [^js e]
|
||||||
(when (= :instance node-kind)
|
(.stopPropagation e)
|
||||||
[:button {:class (str "tl-solo" (when (contains? solo path) " on"))
|
(rf/dispatch [::ui/show-trace layer (not shown?)]))}
|
||||||
:title "show only this on the stage (⇧ for more than one)"
|
"T"]))
|
||||||
:on-click (fn [^js e]
|
(when (= :instance node-kind)
|
||||||
(.stopPropagation e)
|
[:button {:class (str "tl-solo" (when (contains? solo path) " on"))
|
||||||
(rf/dispatch [::ui/solo path (.-shiftKey e)]))}
|
:title "show only this on the stage (⇧ for more than one)"
|
||||||
"S"])
|
:on-click (fn [^js e]
|
||||||
(when (and node? (= select selection))
|
(.stopPropagation e)
|
||||||
[:button.tl-delete {:title "delete, with everything in it (⌫)"
|
(rf/dispatch [::ui/solo path (.-shiftKey e)]))}
|
||||||
:on-click (fn [^js e]
|
"S"])
|
||||||
(.stopPropagation e)
|
(when (and node? (= select selection))
|
||||||
(rf/dispatch [::ui/delete-selected]))}
|
[:button.tl-delete {:title "delete, with everything in it (⌫)"
|
||||||
"×"])]))
|
:on-click (fn [^js e]
|
||||||
|
(.stopPropagation e)
|
||||||
|
(rf/dispatch [::ui/delete-selected]))}
|
||||||
|
"×"])]]))
|
||||||
|
|
||||||
(defn- paint-key-selection!
|
(defn- paint-key-selection!
|
||||||
"Selection and preview are transient DOM state. Update them in one pass,
|
"Selection and preview are transient DOM state. Update them in one pass,
|
||||||
|
|
@ -1193,7 +1199,7 @@
|
||||||
;; gesture; what it meant is known on release.
|
;; gesture; what it meant is known on release.
|
||||||
(reset! sliding {:row path :path actual-path :kind gesture-kind
|
(reset! sliding {:row path :path actual-path :kind gesture-kind
|
||||||
:other other
|
:other other
|
||||||
:paths (when (and (= :slide gesture-kind) (not owner)
|
:paths (when (and (#{:slide :in :out} gesture-kind) (not owner)
|
||||||
(contains? selected-set actual-select)
|
(contains? selected-set actual-select)
|
||||||
(< 1 (count selections)))
|
(< 1 (count selections)))
|
||||||
(mapv #(nth % 3) (filter #(= :node (first %)) selections)))
|
(mapv #(nth % 3) (filter #(= :node (first %)) selections)))
|
||||||
|
|
@ -1389,8 +1395,14 @@
|
||||||
[:span.tl-junction
|
[:span.tl-junction
|
||||||
{:title "Drag the cut · the clip before it ends here and the one after it starts here"
|
{:title "Drag the cut · the clip before it ends here and the one after it starts here"
|
||||||
:on-pointer-down
|
:on-pointer-down
|
||||||
|
;; Between two clips of a selection, it is the end of the one
|
||||||
|
;; before, and every selected end moves with it.
|
||||||
(fn [^js e]
|
(fn [^js e]
|
||||||
(begin! e (nth select 3) :roll select (nth (:select prev) 3) nil))}]
|
(if (and (< 1 (count selections))
|
||||||
|
(contains? selected-set select)
|
||||||
|
(contains? selected-set (:select prev)))
|
||||||
|
(begin! e (nth (:select prev) 3) :out (:select prev) nil nil)
|
||||||
|
(begin! e (nth select 3) :roll select (nth (:select prev) 3) nil)))}]
|
||||||
[:span.tl-edge.in {:title "Drag start"
|
[:span.tl-edge.in {:title "Drag start"
|
||||||
:on-pointer-down #(begin! % (nth select 3) :in select nil nil)}]))
|
:on-pointer-down #(begin! % (nth select 3) :in select nil nil)}]))
|
||||||
(when select
|
(when select
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,8 @@
|
||||||
[arthur.domain.clip :as clip]
|
[arthur.domain.clip :as clip]
|
||||||
[arthur.domain.clipboard :as clipboard]
|
[arthur.domain.clipboard :as clipboard]
|
||||||
[arthur.domain.node :as node]
|
[arthur.domain.node :as node]
|
||||||
[arthur.domain.sequence-test :as fixture]))
|
[arthur.domain.sequence-test :as fixture]
|
||||||
|
[arthur.domain.symbol :as symbol]))
|
||||||
|
|
||||||
(defn- ids []
|
(defn- ids []
|
||||||
(let [n (atom 0)]
|
(let [n (atom 0)]
|
||||||
|
|
@ -187,15 +188,18 @@
|
||||||
(is (:refused r))
|
(is (:refused r))
|
||||||
(is (nil? (:clip r)))))
|
(is (nil? (:clip r)))))
|
||||||
|
|
||||||
(deftest reparenting-into-a-lane-refuses-collision-atomically
|
(deftest reparenting-into-a-lane-claims-what-it-lands-on
|
||||||
|
;; As one clip dropped into a lane does: the forest takes its frames from the
|
||||||
|
;; clip already there.
|
||||||
(let [doc (-> (reparent-document)
|
(let [doc (-> (reparent-document)
|
||||||
(assoc-in [:symbols :box :display] :lane)
|
(assoc-in [:symbols :box :display] :lane)
|
||||||
(assoc-in [:symbols :box :nodes :occupied] (fixture/cel :occupied :drawing-a 4 4 0)))
|
(assoc-in [:symbols :box :nodes :occupied] (fixture/cel :occupied :drawing-a 4 4 0)))
|
||||||
r (clipboard/move-many doc {} :main
|
r (clipboard/move-many doc {} :main
|
||||||
[(address :main :a [:a]) (address :main :b [:b])]
|
[(address :main :a [:a]) (address :main :b [:b])]
|
||||||
[:target] 6 0)]
|
[:target] 6 0)]
|
||||||
(is (:refused r))
|
(is (nil? (:refused r)) (str (:refused r)))
|
||||||
(is (nil? (:clip r)))))
|
(is (nil? (get-in r [:clip :symbols :box :nodes :occupied])) "covered, it is gone")
|
||||||
|
(is (empty? (symbol/overlaps (get-in r [:clip :symbols :box]))))))
|
||||||
|
|
||||||
(deftest dropping-the-forest-shifts-it-as-a-unit
|
(deftest dropping-the-forest-shifts-it-as-a-unit
|
||||||
(let [r (clipboard/move-many (reparent-document) {} :main
|
(let [r (clipboard/move-many (reparent-document) {} :main
|
||||||
|
|
|
||||||
|
|
@ -858,12 +858,34 @@
|
||||||
(is (empty? (symbol/overlaps (get-in mixed [:symbols :main]))))
|
(is (empty? (symbol/overlaps (get-in mixed [:symbols :main]))))
|
||||||
(is (empty? (clip/problems mixed))))))
|
(is (empty? (clip/problems mixed))))))
|
||||||
|
|
||||||
(deftest moving-a-selection-in-a-lane-is-simultaneous
|
(deftest moving-a-selection-in-a-lane-claims-what-it-lands-on
|
||||||
(let [doc (document)
|
;; One clip slid onto another takes its frames; a selection slid together does
|
||||||
moved (:clip (nest/slide-many doc :main [[:a] [:b]] 1))]
|
;; the same, and the clips in it keep their places among themselves.
|
||||||
(is (nil? moved))
|
(let [moved (:clip (nest/slide-many (document) :main [[:a] [:b]] 1))
|
||||||
(is (:refused (nest/slide-many doc :main [[:a] [:b]] 1))
|
spans (into {} (map (juxt :id node/placed-span))
|
||||||
"the whole group refuses collision with the unselected insert")))
|
(symbol/children (get-in moved [:symbols :main :nodes])))]
|
||||||
|
(is (= {:a [1 5] :b [5 9] :insert [9 12]} spans))
|
||||||
|
(is (empty? (clip/problems moved)))))
|
||||||
|
|
||||||
|
(defn- spans-after [result]
|
||||||
|
(is (nil? (:refused result)) (str (:refused result)))
|
||||||
|
(into {} (map (juxt :id node/placed-span))
|
||||||
|
(symbol/children (get-in result [:clip :symbols :main :nodes]))))
|
||||||
|
|
||||||
|
(deftest every-selected-clip-trims-by-the-same-drag
|
||||||
|
(let [all [[:a] [:b] [:insert]]]
|
||||||
|
(is (= {:a [0 6] :b [6 10] :insert [10 14]}
|
||||||
|
(spans-after (nest/resize-many (document) :main all :out 2 false)))
|
||||||
|
"each end moves two frames and eats the start of the clip after it")
|
||||||
|
(is (= {:a [0 6] :b [6 12] :insert [12 18]}
|
||||||
|
(spans-after (nest/resize-many (document) :main all :out 2 true)))
|
||||||
|
"rippled, every clip is two frames longer and nothing is eaten")
|
||||||
|
(is (= {:a [0 2] :b [4 6] :insert [8 10]}
|
||||||
|
(spans-after (nest/resize-many (document) :main all :out -2 false)))
|
||||||
|
"shortened, each leaves a gap")
|
||||||
|
(is (= {:a [0 9] :insert [9 17]}
|
||||||
|
(spans-after (nest/resize-many (document) :main all :out 5 false)))
|
||||||
|
"a clip eaten whole by an earlier one has no edge left to move")))
|
||||||
|
|
||||||
(deftest moving-all-lane-clips-preserves-their-spans
|
(deftest moving-all-lane-clips-preserves-their-spans
|
||||||
(let [doc (document)
|
(let [doc (document)
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ try {
|
||||||
assert.equal((await shot()).clip.symbols.main.display, undefined,
|
assert.equal((await shot()).clip.symbols.main.display, undefined,
|
||||||
'a blank document starts as an ordinary symbol');
|
'a blank document starts as an ordinary symbol');
|
||||||
|
|
||||||
await clickNew('symbol');
|
await clickNew('+ symbol');
|
||||||
let s = await shot();
|
let s = await shot();
|
||||||
let placed = mainInstances(s);
|
let placed = mainInstances(s);
|
||||||
assert.equal(placed.length, 1, 'new symbol places one instance');
|
assert.equal(placed.length, 1, 'new symbol places one instance');
|
||||||
|
|
@ -124,7 +124,7 @@ try {
|
||||||
// create the lane inside that symbol.
|
// create the lane inside that symbol.
|
||||||
await evaluate(`re_frame.core.dispatch_sync(cljs.core.vector(
|
await evaluate(`re_frame.core.dispatch_sync(cljs.core.vector(
|
||||||
cljs.core.keyword('arthur.events.ui/select'), null))`);
|
cljs.core.keyword('arthur.events.ui/select'), null))`);
|
||||||
await clickNew('lane');
|
await clickNew('+ lane');
|
||||||
s = await shot();
|
s = await shot();
|
||||||
placed = mainInstances(s);
|
placed = mainInstances(s);
|
||||||
assert.equal(placed.length, 2, 'explicit lane places a second symbol');
|
assert.equal(placed.length, 2, 'explicit lane places a second symbol');
|
||||||
|
|
@ -132,9 +132,9 @@ try {
|
||||||
assert.equal(await evaluate('[...document.querySelectorAll(".tl-track:not(.palette)")].filter(t => t.arthurLane).length'), 1,
|
assert.equal(await evaluate('[...document.querySelectorAll(".tl-track:not(.palette)")].filter(t => t.arthurLane).length'), 1,
|
||||||
'the explicit lane is drawn as one linear track');
|
'the explicit lane is drawn as one linear track');
|
||||||
|
|
||||||
assert.equal(await evaluate('document.querySelectorAll(".tl-label:not(.palette) .tl-rename").length'), 1,
|
assert.equal(await evaluate('document.querySelectorAll(".tl-label.lane:not(.palette) .tl-rename").length'), 1,
|
||||||
'the lane exposes its rename control');
|
'the lane exposes its rename control');
|
||||||
await evaluate('document.querySelector(".tl-label:not(.palette) .tl-rename").click()');
|
await evaluate('document.querySelector(".tl-label.lane:not(.palette) .tl-rename").click()');
|
||||||
await sleep(80);
|
await sleep(80);
|
||||||
assert(await evaluate(`(() => {
|
assert(await evaluate(`(() => {
|
||||||
const input = document.querySelector('.tl-name-input');
|
const input = document.querySelector('.tl-name-input');
|
||||||
|
|
@ -190,7 +190,7 @@ try {
|
||||||
// that leaving a symbol selected creates the lane inside that symbol.
|
// that leaving a symbol selected creates the lane inside that symbol.
|
||||||
await evaluate(`re_frame.core.dispatch_sync(cljs.core.vector(
|
await evaluate(`re_frame.core.dispatch_sync(cljs.core.vector(
|
||||||
cljs.core.keyword('arthur.events.ui/select'), null))`);
|
cljs.core.keyword('arthur.events.ui/select'), null))`);
|
||||||
await clickNew('lane');
|
await clickNew('+ lane');
|
||||||
s = await shot();
|
s = await shot();
|
||||||
assert.equal(laneSymbols(s).length, 2, 'a second explicit command creates a second lane');
|
assert.equal(laneSymbols(s).length, 2, 'a second explicit command creates a second lane');
|
||||||
const move = await evaluate(`(() => {
|
const move = await evaluate(`(() => {
|
||||||
|
|
@ -220,7 +220,7 @@ try {
|
||||||
await evaluate(`re_frame.core.dispatch_sync(cljs.core.vector(
|
await evaluate(`re_frame.core.dispatch_sync(cljs.core.vector(
|
||||||
cljs.core.keyword('arthur.events.project/new'))) `);
|
cljs.core.keyword('arthur.events.project/new'))) `);
|
||||||
await sleep(250);
|
await sleep(250);
|
||||||
await clickNew('symbol');
|
await clickNew('+ symbol');
|
||||||
const clipboardBaseline = (await shot()).clip;
|
const clipboardBaseline = (await shot()).clip;
|
||||||
await shortcut('d', 'KeyD');
|
await shortcut('d', 'KeyD');
|
||||||
assert.equal(mainInstances(await shot()).length, 2, 'duplicate copies the selected instance');
|
assert.equal(mainInstances(await shot()).length, 2, 'duplicate copies the selected instance');
|
||||||
|
|
|
||||||
|
|
@ -651,9 +651,8 @@ button.followable svg { width: 12px; height: 12px; display: block; }
|
||||||
cursor: grab;
|
cursor: grab;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Shrinks to the name, so the pencil sits against the end of the word rather
|
/* Shrinks to the name, and ellipses rather than pushing the number off the
|
||||||
than out at the edge of the pane — and ellipses rather than pushing the
|
row. */
|
||||||
number off the row. */
|
|
||||||
.pool-item .text { display: flex; flex-direction: column; flex: 0 1 auto; min-width: 0; }
|
.pool-item .text { display: flex; flex-direction: column; flex: 0 1 auto; min-width: 0; }
|
||||||
.pool-item .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
.pool-item .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||||
|
|
||||||
|
|
@ -721,13 +720,12 @@ button.followable svg { width: 12px; height: 12px; display: block; }
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The pencil. A span and not a button — see `ui/pool`'s `row` — so it needs its
|
/* The pencil and the cross, at the row's end as a timeline row has them. Two
|
||||||
own centring and cursor rather than inheriting a control's.
|
slots wide whether or not the cross is there, so the numbers beside them stay
|
||||||
|
in one column. Spans and not buttons — see `ui/pool`'s `row` — so they need
|
||||||
Hidden until the row is under the pointer or holds focus, because a column of
|
their own centring and cursor rather than inheriting a control's. */
|
||||||
twenty pencils is a column of twenty pencils; `visibility` rather than
|
.pool-actions { display: flex; flex: 0 0 30px; justify-content: flex-start; }
|
||||||
`display`, so it keeps its width and the name beside it does not reflow as the
|
.pool-item > .text + .pool-actions { margin-left: auto; }
|
||||||
pointer crosses the list. */
|
|
||||||
.pool-rename {
|
.pool-rename {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
@ -739,11 +737,8 @@ button.followable svg { width: 12px; height: 12px; display: block; }
|
||||||
color: var(--dim);
|
color: var(--dim);
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
visibility: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.pool-row:hover .pool-rename,
|
|
||||||
.pool-row:focus-within .pool-rename { visibility: visible; }
|
|
||||||
.pool-rename:hover { background: var(--hair); color: var(--fg); }
|
.pool-rename:hover { background: var(--hair); color: var(--fg); }
|
||||||
|
|
||||||
/* Renaming. The input REPLACES the row at the same height, so a list does not
|
/* Renaming. The input REPLACES the row at the same height, so a list does not
|
||||||
|
|
@ -1182,7 +1177,8 @@ button.followable svg { width: 12px; height: 12px; display: block; }
|
||||||
.tl-label.lane:hover:not(.on) { background: #f8f6f0; }
|
.tl-label.lane:hover:not(.on) { background: #f8f6f0; }
|
||||||
.tl-track.lane { background: rgba(0, 0, 0, 0.035); }
|
.tl-track.lane { background: rgba(0, 0, 0, 0.035); }
|
||||||
.tl-name-input { min-width: 0; flex: 1; font: inherit; }
|
.tl-name-input { min-width: 0; flex: 1; font: inherit; }
|
||||||
.tl-rename { margin-left: auto; padding: 0 3px; border: 0; background: none; color: var(--dim); }
|
.tl-actions { display: flex; align-items: center; margin-left: auto; }
|
||||||
|
.tl-rename { padding: 0 3px; border: 0; background: none; color: var(--dim); }
|
||||||
.tl-rename:hover { color: var(--fg); }
|
.tl-rename:hover { color: var(--fg); }
|
||||||
|
|
||||||
/* A fixed-width cell whether or not there is a triangle in it, so names at the
|
/* A fixed-width cell whether or not there is a triangle in it, so names at the
|
||||||
|
|
@ -1200,12 +1196,11 @@ button.followable svg { width: 12px; height: 12px; display: block; }
|
||||||
|
|
||||||
.tl-twist:hover:not(:disabled) { background: none; color: var(--fg); }
|
.tl-twist:hover:not(:disabled) { background: none; color: var(--fg); }
|
||||||
.tl-twist:disabled { opacity: 0; cursor: default; }
|
.tl-twist:disabled { opacity: 0; cursor: default; }
|
||||||
.tl-delete { margin-left: auto; padding: 0 4px; border: 0; background: none; color: var(--dim); }
|
.tl-delete { padding: 0 4px; border: 0; background: none; color: var(--dim); }
|
||||||
.tl-delete:hover { color: var(--fg); }
|
.tl-delete:hover { color: var(--fg); }
|
||||||
.tl-solo, .tl-trace { margin-left: auto; padding: 0 4px; border: 0; background: none; color: var(--dim); font-size: 10px; }
|
.tl-solo, .tl-trace { padding: 0 4px; border: 0; background: none; color: var(--dim); font-size: 10px; }
|
||||||
.tl-solo:hover, .tl-trace:hover { color: var(--fg); }
|
.tl-solo:hover, .tl-trace:hover { color: var(--fg); }
|
||||||
.tl-solo.on, .tl-trace.on { color: var(--sel); font-weight: 600; }
|
.tl-solo.on, .tl-trace.on { color: var(--sel); font-weight: 600; }
|
||||||
.tl-solo + .tl-delete, .tl-trace + .tl-solo { margin-left: 0; }
|
|
||||||
|
|
||||||
/* The ruler and the corner above the labels stay at the top of the body while
|
/* The ruler and the corner above the labels stay at the top of the body while
|
||||||
the rows scroll under them: the ruler is the scrubber, and scrolling down to
|
the rows scroll under them: the ruler is the scrubber, and scrolling down to
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue