Merge pull request #383 from tokens-studio/andrei/export-import-themes

 Import/Export: Themes #306 [WIP]
This commit is contained in:
Florian Schrödl 2024-12-11 17:25:56 +01:00 committed by GitHub
commit 797374b2ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 58 additions and 17 deletions

View file

@ -323,12 +323,12 @@
:timeout 9000})))))
(set! (.-value (mf/ref-val input-ref)) "")))
on-export (fn []
(let [tokens-blob (some-> (deref refs/tokens-lib)
(let [tokens-json (some-> (deref refs/tokens-lib)
(ctob/encode-dtcg)
(clj->js)
(js/JSON.stringify nil 2)
(wapi/create-blob "application/json"))]
(dom/trigger-download "tokens.json" tokens-blob)))]
(js/JSON.stringify nil 2))]
(->> (wapi/create-blob (or tokens-json "{}") "application/json")
(dom/trigger-download "tokens.json"))))]
[:div {:class (stl/css :import-export-button-wrapper)}
[:input {:type "file"

View file

@ -6583,7 +6583,7 @@ msgstr "Name"
#: src/app/main/ui/workspace/tokens/form.cljs
msgid "workspace.token.enter-token-name"
msgstr "Enter %s token name"
msgstr "Enter %s token name"
#: src/app/main/ui/workspace/tokens/form.cljs
msgid "workspace.token.token-value"