diff --git a/CHANGES.md b/CHANGES.md index 66073f114c..f80e972457 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -129,6 +129,7 @@ - Fix problem with linked colors to strokes [Github #3522](https://github.com/penpot/penpot/issues/3522) - Fix problem with hand tool stuck [Github #3318](https://github.com/penpot/penpot/issues/3318) - Fix problem with fix scrolling on nested elements [Github #3508](https://github.com/penpot/penpot/issues/3508) +- Fix problem when changing typography assets [Github #3683](https://github.com/penpot/penpot/issues/3683) ## 1.19.5 diff --git a/frontend/src/app/main/data/fonts.cljs b/frontend/src/app/main/data/fonts.cljs index 5c9e3837dc..bb8fe193fb 100644 --- a/frontend/src/app/main/data/fonts.cljs +++ b/frontend/src/app/main/data/fonts.cljs @@ -318,9 +318,12 @@ (swap! storage assoc ::recent-fonts most-recent-fonts))))) (defn load-recent-fonts - [] + [fonts] (ptk/reify ::load-recent-fonts ptk/UpdateEvent (update [_ state] - (let [saved-recent-fonts (::recent-fonts @storage)] + (let [fonts-map (d/index-by :id fonts) + saved-recent-fonts (->> (::recent-fonts @storage) + (keep #(get fonts-map (:id %))) + (into #{}))] (assoc-in state [:workspace-data :recent-fonts] saved-recent-fonts))))) diff --git a/frontend/src/app/main/data/viewer/shortcuts.cljs b/frontend/src/app/main/data/viewer/shortcuts.cljs index 5cae65f678..f6ac67296c 100644 --- a/frontend/src/app/main/data/viewer/shortcuts.cljs +++ b/frontend/src/app/main/data/viewer/shortcuts.cljs @@ -37,17 +37,17 @@ :fn #(st/emit! dv/toggle-zoom-style)} :toggle-fullscreen {:tooltip (ds/shift "F") - :command "shift+f" + :command ["shift+f" "alt+enter"] :subsections [:zoom-viewer] :fn #(st/emit! dv/toggle-fullscreen)} - :next-frame {:tooltip ds/left-arrow - :command ["left" "up"] + :prev-frame {:tooltip ds/left-arrow + :command ["left" "up" "shift+enter" "pageup" "shift+space"] :subsections [:general-viewer] :fn #(st/emit! dv/select-prev-frame)} - :prev-frame {:tooltip ds/right-arrow - :command ["right" "down"] + :next-frame {:tooltip ds/right-arrow + :command ["right" "down" "enter" "pagedown" "space"] :subsections [:general-viewer] :fn #(st/emit! dv/select-next-frame)} diff --git a/frontend/src/app/main/data/workspace/libraries_helpers.cljs b/frontend/src/app/main/data/workspace/libraries_helpers.cljs index d157dcd3d4..296cd7c92c 100644 --- a/frontend/src/app/main/data/workspace/libraries_helpers.cljs +++ b/frontend/src/app/main/data/workspace/libraries_helpers.cljs @@ -464,21 +464,35 @@ [changes shape container update-node] (let [old-content (:content shape) new-content (txt/transform-nodes update-node old-content) + + redo-change + (make-change + container + {:type :mod-obj + :id (:id shape) + :operations [{:type :set + :attr :content + :val new-content} + {:type :set + :attr :position-data + :val nil}]}) + + undo-change + (make-change + container + {:type :mod-obj + :id (:id shape) + :operations [{:type :set + :attr :content + :val old-content} + {:type :set + :attr :position-data + :val nil}]}) + changes' (-> changes - (update :redo-changes conj (make-change - container - {:type :mod-obj - :id (:id shape) - :operations [{:type :set - :attr :content - :val new-content}]})) - (update :undo-changes conj (make-change - container - {:type :mod-obj - :id (:id shape) - :operations [{:type :set - :attr :content - :val old-content}]})))] + (update :redo-changes conj redo-change) + (update :undo-changes conj undo-change))] + (if (= new-content old-content) changes changes'))) diff --git a/frontend/src/app/main/ui/workspace/colorpicker/libraries.cljs b/frontend/src/app/main/ui/workspace/colorpicker/libraries.cljs index a00058dfb7..14e851d31d 100644 --- a/frontend/src/app/main/ui/workspace/colorpicker/libraries.cljs +++ b/frontend/src/app/main/ui/workspace/colorpicker/libraries.cljs @@ -21,7 +21,6 @@ [app.main.ui.icons :as i] [app.util.dom :as dom] [app.util.i18n :as i18n :refer [tr]] - [app.util.timers :as ts] [rumext.v2 :as mf])) (mf/defc libraries @@ -51,12 +50,13 @@ toggle-palette (mf/use-fn + (mf/deps @selected) (fn [] (r/set-resize-type! :bottom) (dom/add-class! (dom/get-element-by-class "color-palette") "fade-out-down") - (ts/schedule 300 #(st/emit! (dw/remove-layout-flag :textpalette) - (-> (dw/toggle-layout-flag :colorpalette) - (vary-meta assoc ::ev/origin "workspace-colorpicker")))))) + (st/emit! (dw/remove-layout-flag :textpalette) + (-> (mdc/show-palette @selected) + (vary-meta assoc ::ev/origin "workspace-colorpicker"))))) shared-libs-options (mapv (fn [lib] {:value (d/name (:id lib)) :label (:name lib)}) (vals shared-libs)) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs index c98013450d..0d7977266f 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs @@ -144,8 +144,8 @@ (on-select font) (on-close)))] - (mf/with-effect [] - (st/emit! (fts/load-recent-fonts))) + (mf/with-effect [fonts] + (st/emit! (fts/load-recent-fonts fonts))) (mf/with-effect [fonts] (let [key (events/listen js/document "keydown" on-key-down)] diff --git a/frontend/src/app/main/ui/workspace/viewport/comments.cljs b/frontend/src/app/main/ui/workspace/viewport/comments.cljs index 8adbce9cdd..ca842d1c62 100644 --- a/frontend/src/app/main/ui/workspace/viewport/comments.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/comments.cljs @@ -81,9 +81,10 @@ (when-let [id (:open local)] (when-let [thread (get threads-map id)] - [:& cmt/thread-comments {:thread (update-position positions thread) - :users users - :zoom zoom}])) + (when (seq (dcm/apply-filters local profile [thread])) + [:& cmt/thread-comments {:thread (update-position positions thread) + :users users + :zoom zoom}]))) (when-let [draft (:comment drawing)] [:& cmt/draft-thread {:draft draft diff --git a/frontend/translations/en.po b/frontend/translations/en.po index b1a01bb1ad..df15b1c17b 100644 --- a/frontend/translations/en.po +++ b/frontend/translations/en.po @@ -988,7 +988,7 @@ msgid "errors.webhooks.invalid-uri" msgstr "URL does not pass validation." msgid "errors.webhooks.last-delivery" -msgstr "Last delivery was not successfull." +msgstr "Last delivery was not successful." msgid "errors.webhooks.ssl-validation" msgstr "Error on SSL validation." @@ -3144,7 +3144,7 @@ msgid "viewer.header.sitemap" msgstr "Sitemap" msgid "webhooks.last-delivery.success" -msgstr "Last delivery was successfull." +msgstr "Last delivery was successful." #: src/app/main/ui/workspace/sidebar/align.cljs msgid "workspace.align.hcenter"