diff --git a/common/app/common/pages.cljc b/common/app/common/pages.cljc index 809c0c9e3e..74f14b057c 100644 --- a/common/app/common/pages.cljc +++ b/common/app/common/pages.cljc @@ -877,15 +877,15 @@ (defmethod process-change :add-typography [data {:keys [typography]}] - (update data :typography assoc (:id typography) typography)) + (update data :typographies assoc (:id typography) typography)) (defmethod process-change :mod-typography [data {:keys [typography]}] - (d/update-in-when data [:typography (:id typography)] merge typography)) + (d/update-in-when data [:typographies (:id typography)] merge typography)) (defmethod process-change :del-typography [data {:keys [id]}] - (update data :typography dissoc id)) + (update data :typographies dissoc id)) ;; -- Operations diff --git a/frontend/src/app/main/data/workspace/libraries.cljs b/frontend/src/app/main/data/workspace/libraries.cljs index 03aafbc224..a9e441b65c 100644 --- a/frontend/src/app/main/data/workspace/libraries.cljs +++ b/frontend/src/app/main/data/workspace/libraries.cljs @@ -453,7 +453,7 @@ (let [[rchanges1 uchanges1] (dwlh/generate-sync-file-components state file-id) [rchanges2 uchanges2] (dwlh/generate-sync-library-components state file-id) [rchanges3 uchanges3] (dwlh/generate-sync-file :colors file-id state) - [rchanges4 uchanges4] (dwlh/generate-sync-file :typography file-id state) + [rchanges4 uchanges4] (dwlh/generate-sync-file :typographies file-id state) rchanges (d/concat rchanges1 rchanges2 rchanges3 rchanges4) uchanges (d/concat uchanges1 uchanges2 uchanges3 uchanges4)] (rx/concat @@ -543,7 +543,7 @@ (ptk/reify ::update-typography ptk/WatchEvent (watch [_ state stream] - (let [prev (get-in state [:workspace-data :typography (:id typography)]) + (let [prev (get-in state [:workspace-data :typographies (:id typography)]) rchg {:type :mod-typography :typography typography} uchg {:type :mod-typography @@ -557,7 +557,7 @@ (ptk/reify ::delete-typography ptk/WatchEvent (watch [_ state stream] - (let [prev (get-in state [:workspace-data :typography id]) + (let [prev (get-in state [:workspace-data :typographies id]) rchg {:type :del-typography :id id} uchg {:type :add-typography diff --git a/frontend/src/app/main/data/workspace/libraries_helpers.cljs b/frontend/src/app/main/data/workspace/libraries_helpers.cljs index 0f70b7f616..ad4ac4d712 100644 --- a/frontend/src/app/main/data/workspace/libraries_helpers.cljs +++ b/frontend/src/app/main/data/workspace/libraries_helpers.cljs @@ -35,7 +35,7 @@ and call synchronize" [asset-type library-id state] - (s/assert #{:colors :components :typography} asset-type) + (s/assert #{:colors :components :typographies} asset-type) (s/assert (s/nilable ::us/uuid) library-id) (let [library-items @@ -73,7 +73,7 @@ (= library-id (get shape attr-ref-file)))) cp/color-sync-attrs)) - :typography + :typographies (fn [shape] (and (= (:type shape) :text) (->> shape @@ -146,7 +146,7 @@ (conj roperations roperation) (conj uoperations uoperation))))))))) -(defmethod generate-sync-shape :typography +(defmethod generate-sync-shape :typographies [_ library-id library-items page shape] (let [update-node (fn [node] (if-let [typography (get library-items (:typography-ref-id node))] diff --git a/frontend/src/app/main/refs.cljs b/frontend/src/app/main/refs.cljs index e4b053f777..6547d3c168 100644 --- a/frontend/src/app/main/refs.cljs +++ b/frontend/src/app/main/refs.cljs @@ -100,7 +100,7 @@ (def workspace-file-typography (l/derived (fn [state] (when-let [file (:workspace-file state)] - (get-in file [:data :typography]))) + (get-in file [:data :typographies]))) st/state)) (def workspace-project diff --git a/frontend/src/app/main/ui/workspace/libraries.cljs b/frontend/src/app/main/ui/workspace/libraries.cljs index ada134ebbb..00a27dc171 100644 --- a/frontend/src/app/main/ui/workspace/libraries.cljs +++ b/frontend/src/app/main/ui/workspace/libraries.cljs @@ -28,7 +28,7 @@ (let [components-count (count (get-in library [:data :components] [])) graphics-count (count (get-in library [:data :media] [])) colors-count (count (get-in library [:data :colors] [])) - typography-count (count (get-in library [:data :typography] []))] + typography-count (count (get-in library [:data :typographies] []))] ;; Include a   so this block has always some content (str (str/join " ยท " diff --git a/frontend/src/app/main/ui/workspace/sidebar/assets.cljs b/frontend/src/app/main/ui/workspace/sidebar/assets.cljs index eeb4b13313..6b73d1b2d5 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/assets.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/assets.cljs @@ -465,8 +465,8 @@ (l/derived (fn [state] (let [wfile (:workspace-file state)] (if (= (:id wfile) id) - (vals (get-in wfile [:data :typography])) - (vals (get-in state [:workspace-libraries id :data :typography]))))) + (vals (get-in wfile [:data :typographies])) + (vals (get-in state [:workspace-libraries id :data :typographies]))))) st/state =)) (defn apply-filters @@ -487,7 +487,7 @@ toggles (mf/use-state #{:components :graphics :colors - :typography}) + :typographies}) url (rt/resolve router :workspace {:project-id (:project-id file) @@ -537,7 +537,7 @@ (or (> (count colors) 0) (str/empty? (:term filters)))) show-typography? (and (or (= (:box filters) :all) - (= (:box filters) :typography)) + (= (:box filters) :typographies)) (or (> (count colors) 0) (str/empty? (:term filters))))] [:div.tool-window-content @@ -570,9 +570,9 @@ :local? local? :locale locale :typographies typographies - :open? (contains? @toggles :typography) - :on-open #(swap! toggles conj :typography) - :on-close #(swap! toggles disj :typography)}]) + :open? (contains? @toggles :typographies) + :on-open #(swap! toggles conj :typographies) + :on-close #(swap! toggles disj :typographies)}]) (when (and (not show-components?) (not show-graphics?) (not show-colors?)) [:div.asset-group @@ -636,7 +636,7 @@ [:option {:value ":components"} (t locale "workspace.assets.components")] [:option {:value ":graphics"} (t locale "workspace.assets.graphics")] [:option {:value ":colors"} (t locale "workspace.assets.colors")] - [:option {:value ":typography"} (t locale "workspace.assets.typography")]]]] + [:option {:value ":typographies"} (t locale "workspace.assets.typography")]]]] [:div.libraries-wrapper [:& file-library diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/text.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/text.cljs index 4718358ef1..8ad4b4e72b 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/text.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/text.cljs @@ -207,7 +207,7 @@ (not= (:typography-ref-id values) :multiple) (:typography-ref-file values)) (-> shared-libs - (get-in [(:typography-ref-file values) :data :typography (:typography-ref-id values)]) + (get-in [(:typography-ref-file values) :data :typographies (:typography-ref-id values)]) (assoc :file-id (:typography-ref-file values))) (and (:typography-ref-id values)