🎉 Avoid setting token to group shapes (#6055)

* 🎉 Avoid setting token to group shapes

* 📎 Fix on update shape when double click
This commit is contained in:
Eva Marco 2025-03-12 14:18:59 +01:00 committed by GitHub
parent 2aee2ea79e
commit 0efbebd94f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 28 additions and 3 deletions

View file

@ -49,6 +49,13 @@
(rx/mapcat
(fn [resolved-tokens]
(let [undo-id (js/Symbol)
objects (dsh/lookup-page-objects state)
shape-ids (or (->> (select-keys objects shape-ids)
(filter (fn [[_ shape]] (not= (:type shape) :group)))
(keys))
[])
resolved-value (get-in resolved-tokens [(wtt/token-identifier token) :resolved-value])
tokenized-attributes (wtt/attributes-map attributes token)]
(rx/of

View file

@ -371,8 +371,10 @@
(mf/defc menu-tree
[{:keys [selected-shapes submenu-offset type errors] :as context-data}]
(let [entries (if (and (not (some? errors))
(seq selected-shapes))
(let [shape-types (into #{} (map :type selected-shapes))
entries (if (and (not (some? errors))
(seq selected-shapes)
(not= shape-types #{:group}))
(if (some? type)
(submenu-actions-selection-actions context-data)
(selection-actions context-data))