mirror of
https://github.com/penpot/penpot.git
synced 2025-06-05 23:41:38 +02:00
🔥 Remove unused functions
This commit is contained in:
parent
90b1895f19
commit
2f20ccf289
2 changed files with 12 additions and 55 deletions
|
@ -1,45 +0,0 @@
|
||||||
(ns app.main.ui.workspace.tokens.token-set
|
|
||||||
(:require
|
|
||||||
[app.common.types.tokens-lib :as ctob]
|
|
||||||
[app.main.data.helpers :as dsh]))
|
|
||||||
|
|
||||||
(defn get-workspace-tokens-lib
|
|
||||||
[state]
|
|
||||||
(-> (dsh/lookup-file-data state)
|
|
||||||
(get :tokens-lib)))
|
|
||||||
|
|
||||||
;; Themes ----------------------------------------------------------------------
|
|
||||||
|
|
||||||
(defn get-active-theme-ids
|
|
||||||
[state]
|
|
||||||
(-> (dsh/lookup-file-data state)
|
|
||||||
(get :token-active-themes #{})))
|
|
||||||
|
|
||||||
(defn get-temp-theme-id
|
|
||||||
[state]
|
|
||||||
(-> (dsh/lookup-file-data state)
|
|
||||||
(get :token-theme-temporary-id)))
|
|
||||||
|
|
||||||
(defn update-theme-id
|
|
||||||
[state]
|
|
||||||
(let [active-themes (get-active-theme-ids state)
|
|
||||||
temporary-theme-id (get-temp-theme-id state)]
|
|
||||||
(cond
|
|
||||||
(empty? active-themes) temporary-theme-id
|
|
||||||
(= 1 (count active-themes)) (first active-themes)
|
|
||||||
:else temporary-theme-id)))
|
|
||||||
|
|
||||||
(defn get-workspace-token-theme
|
|
||||||
[id state]
|
|
||||||
(-> (dsh/lookup-file-data state)
|
|
||||||
(get :token-themes-index)
|
|
||||||
(get id)))
|
|
||||||
|
|
||||||
(defn add-token-set-to-token-theme [token-set-id token-theme]
|
|
||||||
(update token-theme :sets conj token-set-id))
|
|
||||||
|
|
||||||
;; Sets ------------------------------------------------------------------------
|
|
||||||
|
|
||||||
(defn get-active-theme-sets-tokens-names-map [state]
|
|
||||||
(when-let [lib (get-workspace-tokens-lib state)]
|
|
||||||
(ctob/get-active-themes-set-tokens lib)))
|
|
|
@ -9,13 +9,13 @@
|
||||||
[app.common.files.helpers :as cfh]
|
[app.common.files.helpers :as cfh]
|
||||||
[app.common.logging :as l]
|
[app.common.logging :as l]
|
||||||
[app.common.types.token :as ctt]
|
[app.common.types.token :as ctt]
|
||||||
|
[app.common.types.tokens-lib :as ctob]
|
||||||
[app.main.data.helpers :as dsh]
|
[app.main.data.helpers :as dsh]
|
||||||
[app.main.data.workspace.shapes :as dwsh]
|
[app.main.data.workspace.shapes :as dwsh]
|
||||||
[app.main.data.workspace.thumbnails :as dwt]
|
[app.main.data.workspace.thumbnails :as dwt]
|
||||||
[app.main.data.workspace.undo :as dwu]
|
[app.main.data.workspace.undo :as dwu]
|
||||||
[app.main.ui.workspace.tokens.changes :as wtch]
|
[app.main.ui.workspace.tokens.changes :as wtch]
|
||||||
[app.main.ui.workspace.tokens.style-dictionary :as wtsd]
|
[app.main.ui.workspace.tokens.style-dictionary :as wtsd]
|
||||||
[app.main.ui.workspace.tokens.token-set :as wtts]
|
|
||||||
[app.util.time :as dt]
|
[app.util.time :as dt]
|
||||||
[beicon.v2.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[clojure.data :as data]
|
[clojure.data :as data]
|
||||||
|
@ -182,7 +182,9 @@
|
||||||
(ptk/reify ::update-workspace-tokens
|
(ptk/reify ::update-workspace-tokens
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ state _]
|
(watch [_ state _]
|
||||||
(let [tokens (-> (wtts/get-active-theme-sets-tokens-names-map state)
|
(when-let [tokens-lib (-> (dsh/lookup-file-data state)
|
||||||
|
(get :tokens-lib))]
|
||||||
|
(let [tokens (-> (ctob/get-active-themes-set-tokens tokens-lib)
|
||||||
(wtsd/resolve-tokens+))]
|
(wtsd/resolve-tokens+))]
|
||||||
(->> (rx/from tokens)
|
(->> (rx/from tokens)
|
||||||
(rx/mapcat (fn [sd-tokens]
|
(rx/mapcat (fn [sd-tokens]
|
||||||
|
@ -190,4 +192,4 @@
|
||||||
(rx/concat
|
(rx/concat
|
||||||
(rx/of (dwu/start-undo-transaction undo-id :timeout false))
|
(rx/of (dwu/start-undo-transaction undo-id :timeout false))
|
||||||
(update-tokens state sd-tokens)
|
(update-tokens state sd-tokens)
|
||||||
(rx/of (dwu/commit-undo-transaction undo-id)))))))))))
|
(rx/of (dwu/commit-undo-transaction undo-id))))))))))))
|
Loading…
Add table
Add a link
Reference in a new issue