mirror of
https://github.com/penpot/penpot.git
synced 2025-04-30 07:26:20 +02:00
Cleanup
This commit is contained in:
parent
18d120bbaa
commit
dc0a1c1555
1 changed files with 0 additions and 35 deletions
|
@ -12,7 +12,6 @@
|
||||||
[app.common.geom.point :as gpt]
|
[app.common.geom.point :as gpt]
|
||||||
[app.common.types.shape :as cts]
|
[app.common.types.shape :as cts]
|
||||||
[app.common.types.tokens-lib :as ctob]
|
[app.common.types.tokens-lib :as ctob]
|
||||||
[app.common.uuid :as uuid]
|
|
||||||
[app.main.data.changes :as dch]
|
[app.main.data.changes :as dch]
|
||||||
[app.main.data.workspace.shapes :as dwsh]
|
[app.main.data.workspace.shapes :as dwsh]
|
||||||
[app.main.refs :as refs]
|
[app.main.refs :as refs]
|
||||||
|
@ -89,11 +88,6 @@
|
||||||
(let [workspace-data (deref refs/workspace-data)]
|
(let [workspace-data (deref refs/workspace-data)]
|
||||||
(get (:tokens workspace-data) id)))
|
(get (:tokens workspace-data) id)))
|
||||||
|
|
||||||
(defn get-token-set-data-from-token-set-id
|
|
||||||
[id]
|
|
||||||
(let [workspace-data (deref refs/workspace-data)]
|
|
||||||
(get (:token-sets-index workspace-data) id)))
|
|
||||||
|
|
||||||
(defn set-selected-token-set-id
|
(defn set-selected-token-set-id
|
||||||
[id]
|
[id]
|
||||||
(ptk/reify ::set-selected-token-set-id
|
(ptk/reify ::set-selected-token-set-id
|
||||||
|
@ -101,10 +95,6 @@
|
||||||
(update [_ state]
|
(update [_ state]
|
||||||
(wtts/assoc-selected-token-set-id state id))))
|
(wtts/assoc-selected-token-set-id state id))))
|
||||||
|
|
||||||
(defn get-token-set-tokens
|
|
||||||
[token-set file]
|
|
||||||
(map #(get-in file [:tokens %]) (:tokens token-set)))
|
|
||||||
|
|
||||||
(defn create-token-theme [token-theme]
|
(defn create-token-theme [token-theme]
|
||||||
(let [new-token-theme token-theme]
|
(let [new-token-theme token-theme]
|
||||||
(ptk/reify ::create-token-theme
|
(ptk/reify ::create-token-theme
|
||||||
|
@ -125,21 +115,6 @@
|
||||||
(rx/of
|
(rx/of
|
||||||
(dch/commit-changes changes))))))
|
(dch/commit-changes changes))))))
|
||||||
|
|
||||||
(defn ensure-token-theme-changes [changes state {:keys [id new-set?]}]
|
|
||||||
(let [theme-id (wtts/update-theme-id state)
|
|
||||||
theme (some-> theme-id (wtts/get-workspace-token-theme state))]
|
|
||||||
(cond
|
|
||||||
(not theme-id) (-> changes
|
|
||||||
(pcb/add-temporary-token-theme
|
|
||||||
{:id (uuid/next)
|
|
||||||
:name "Test theme"
|
|
||||||
:sets #{id}}))
|
|
||||||
new-set? (-> changes
|
|
||||||
(pcb/update-token-theme
|
|
||||||
(wtts/add-token-set-to-token-theme id theme)
|
|
||||||
theme))
|
|
||||||
:else changes)))
|
|
||||||
|
|
||||||
(defn toggle-token-theme-active? [group name]
|
(defn toggle-token-theme-active? [group name]
|
||||||
(ptk/reify ::toggle-token-theme-active?
|
(ptk/reify ::toggle-token-theme-active?
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
|
@ -195,16 +170,6 @@
|
||||||
(rx/of
|
(rx/of
|
||||||
(dch/commit-changes changes))))))
|
(dch/commit-changes changes))))))
|
||||||
|
|
||||||
#_[target-theme-id (wtts/get-temp-theme-id state)
|
|
||||||
active-set-ids (wtts/get-active-set-ids state)
|
|
||||||
theme (-> (wtts/get-workspace-token-theme target-theme-id state)
|
|
||||||
(assoc :sets active-set-ids))
|
|
||||||
changes (-> (pcb/empty-changes it)
|
|
||||||
(pcb/update-token-theme
|
|
||||||
(wtts/toggle-token-set-to-token-theme token-set-id theme)
|
|
||||||
theme)
|
|
||||||
(pcb/update-active-token-themes #{target-theme-id} (wtts/get-active-theme-ids state)))]
|
|
||||||
|
|
||||||
(defn toggle-token-set [{:keys [token-set-name]}]
|
(defn toggle-token-set [{:keys [token-set-name]}]
|
||||||
(ptk/reify ::toggle-token-set
|
(ptk/reify ::toggle-token-set
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
|
|
Loading…
Add table
Reference in a new issue