Merge remote-tracking branch 'origin/staging' into develop

This commit is contained in:
Alejandro Alonso 2025-04-11 14:05:00 +02:00
commit 1c5c51907a
7 changed files with 66 additions and 9 deletions

View file

@ -55,6 +55,7 @@
.custom-select-dropdown {
@extend .dropdown-wrapper;
margin-top: $s-2;
max-height: 70vh;
width: $s-252;
.dropdown-element {
@extend .dropdown-element-base;

View file

@ -191,6 +191,7 @@
border: $s-1 solid color-mix(in hsl, var(--color-foreground-secondary) 30%, transparent);
border-radius: $s-8;
overflow-y: auto;
max-height: $s-452;
}
.sets-count-empty-button {

View file

@ -65,6 +65,11 @@
(st/emit! (ptk/data-event ::ev/event {::ev/name "create-token-set" :name name})
(dt/create-token-set name))))
(defn group-edition-id
"Prefix editing groups `edition-id` so it can be differentiated from sets with the same id."
[edition-id]
(str "group-" edition-id))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; COMPONENTS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -166,16 +171,18 @@
{:position (dom/get-client-position event)
:is-group true
:id id
:edition-id (group-edition-id id)
:path tree-path})))))
on-collapse-click
(mf/use-fn
(fn [event]
(dom/prevent-default event)
(dom/stop-propagation event)
(on-toggle-collapse tree-path)))
on-double-click
(mf/use-fn (mf/deps id) #(on-start-edition id))
(mf/use-fn (mf/deps id) #(on-start-edition (group-edition-id id)))
on-checkbox-click
(mf/use-fn
@ -267,6 +274,7 @@
{:position (dom/get-client-position event)
:is-group false
:id id
:edition-id id
:path tree-path})))))
on-double-click
@ -398,7 +406,7 @@
:is-active (is-token-set-group-active path)
:is-selected false
:is-draggable is-draggable
:is-editing (= edition-id id)
:is-editing (= edition-id (group-edition-id id))
:is-collapsed (collapsed? path)
:on-select on-select

View file

@ -34,7 +34,7 @@
(mf/defc menu*
{::mf/private true}
[{:keys [is-group id path]}]
[{:keys [is-group id edition-id path]}]
(let [create-set-at-path
(mf/use-fn (mf/deps path) #(st/emit! (dt/start-token-set-creation path)))
@ -42,7 +42,7 @@
(mf/use-fn
(mf/deps id)
(fn []
(st/emit! (dt/start-token-set-edition id))))
(st/emit! (dt/start-token-set-edition edition-id))))
on-delete
(mf/use-fn
@ -57,7 +57,7 @@
(mf/defc token-set-context-menu*
[]
(let [{:keys [position is-group id path]}
(let [{:keys [position is-group id edition-id path]}
(mf/deref ref:token-sets-context-menu)
position-top
@ -78,4 +78,5 @@
:on-context-menu prevent-default}
[:> menu* {:is-group is-group
:id id
:edition-id edition-id
:path path}]]]))