mirror of
https://github.com/penpot/penpot.git
synced 2025-08-07 14:38:33 +02:00
🎉 Add token export event tag
This commit is contained in:
parent
409ff31c30
commit
325a78a967
2 changed files with 5 additions and 3 deletions
|
@ -9,8 +9,10 @@
|
|||
(:require
|
||||
[app.common.json :as json]
|
||||
[app.common.types.tokens-lib :as ctob]
|
||||
[app.main.data.event :as ev]
|
||||
[app.main.data.modal :as modal]
|
||||
[app.main.refs :as refs]
|
||||
[app.main.store :as st]
|
||||
[app.main.ui.components.code-block :refer [code-block]]
|
||||
[app.main.ui.ds.buttons.button :refer [button*]]
|
||||
[app.main.ui.ds.buttons.icon-button :refer [icon-button*]]
|
||||
|
@ -22,6 +24,7 @@
|
|||
[app.util.i18n :refer [tr]]
|
||||
[app.util.webapi :as wapi]
|
||||
[app.util.zip :as zip]
|
||||
[potok.v2.core :as ptk]
|
||||
[rumext.v2 :as mf]))
|
||||
|
||||
(mf/defc export-tab*
|
||||
|
@ -59,6 +62,7 @@
|
|||
(mf/deps tokens-json)
|
||||
(fn []
|
||||
(when tokens-json
|
||||
(st/emit! (ptk/data-event ::ev/event {::ev/name "export-tokens" :type "single"}))
|
||||
(->> (wapi/create-blob (or tokens-json "{}") "application/json")
|
||||
(dom/trigger-download "tokens.json")))))]
|
||||
[:> export-tab* {:is-disabled is-disabled
|
||||
|
@ -85,6 +89,7 @@
|
|||
(mf/use-fn
|
||||
(mf/deps files)
|
||||
(fn []
|
||||
(st/emit! (ptk/data-event ::ev/event {::ev/name "export-tokens" :type "multiple"}))
|
||||
(download-tokens-zip! files)))]
|
||||
[:> export-tab* {:on-export on-export
|
||||
:is-disabled is-disabled}
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
[app.common.data :as d]
|
||||
[app.common.types.tokens-lib :as ctob]
|
||||
[app.config :as cf]
|
||||
[app.main.data.event :as ev]
|
||||
[app.main.data.modal :as modal]
|
||||
[app.main.data.style-dictionary :as sd]
|
||||
[app.main.data.workspace.tokens.application :as dwta]
|
||||
|
@ -37,7 +36,6 @@
|
|||
[app.util.dom :as dom]
|
||||
[app.util.i18n :refer [tr]]
|
||||
[okulary.core :as l]
|
||||
[potok.v2.core :as ptk]
|
||||
[rumext.v2 :as mf]
|
||||
[shadow.resource]))
|
||||
|
||||
|
@ -384,7 +382,6 @@
|
|||
on-export
|
||||
(mf/use-fn
|
||||
(fn []
|
||||
(st/emit! (ptk/data-event ::ev/event {::ev/name "export-tokens"}))
|
||||
(modal/show! :tokens/export {})))
|
||||
|
||||
on-modal-show
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue