0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-20 05:34:23 -05:00

Merge pull request #372 from tokens-studio/andrei/fix-token-context-menu-order

 Reorder token context menu
This commit is contained in:
Florian Schrödl 2024-12-03 12:47:20 +01:00 committed by GitHub
commit 1a2fb4e299
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -206,11 +206,7 @@
(defn default-actions [{:keys [token selected-token-set-path]}]
(let [{:keys [modal]} (wtty/get-token-properties token)]
[{:title "Delete Token"
:action #(st/emit! (dt/delete-token (ctob/prefixed-set-path-string->set-name-string selected-token-set-path) (:name token)))}
{:title "Duplicate Token"
:action #(st/emit! (dt/duplicate-token (:name token)))}
{:title "Edit Token"
[{:title "Edit Token"
:action (fn [event]
(let [{:keys [key fields]} modal]
(st/emit! dt/hide-token-context-menu)
@ -221,7 +217,13 @@
:fields fields
:action "edit"
:selected-token-set-path selected-token-set-path
:token token})))}]))
:token token})))}
{:title "Duplicate Token"
:action #(st/emit! (dt/duplicate-token (:name token)))}
{:title "Delete Token"
:action #(st/emit! (-> selected-token-set-path
ctob/prefixed-set-path-string->set-name-string
(dt/delete-token (:name token))))}]))
(defn selection-actions [{:keys [type token] :as context-data}]
(let [with-actions (get shape-attribute-actions-map (or type (:type token)))