diff --git a/CHANGES.md b/CHANGES.md index 648a176e31..82eb422989 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -33,6 +33,9 @@ - Fix problem when moving texts with keyboard [#2690](https://github.com/penpot/penpot/issues/2690) - Fix problem when drawing boxes won't detect mouse-up [Taiga #4618](https://tree.taiga.io/project/penpot/issue/4618) - Fix missing loading icon on shared libraries [Taiga #4148](https://tree.taiga.io/project/penpot/issue/4148) +- Fix selection stroke missing in properties of multiple texts [Taiga #4048](https://tree.taiga.io/project/penpot/issue/4048) +- Fix missing create component menu for frames [Github #2670](https://github.com/penpot/penpot/issues/2670) +- Fix "currentColor" is not converted when importing SVG [Github 2276](https://github.com/penpot/penpot/issues/2276) ### :arrow_up: Deps updates diff --git a/common/src/app/common/pages/common.cljc b/common/src/app/common/pages/common.cljc index c17a5e16bd..dbfe83cba6 100644 --- a/common/src/app/common/pages/common.cljc +++ b/common/src/app/common/pages/common.cljc @@ -373,6 +373,7 @@ :fill-color-ref-file :fill-color-gradient + :strokes :stroke-style :stroke-alignment :stroke-width diff --git a/frontend/src/app/main/data/workspace/svg_upload.cljs b/frontend/src/app/main/data/workspace/svg_upload.cljs index b0b483f5d6..4f34e2d206 100644 --- a/frontend/src/app/main/data/workspace/svg_upload.cljs +++ b/frontend/src/app/main/data/workspace/svg_upload.cljs @@ -6,6 +6,7 @@ (ns app.main.data.workspace.svg-upload (:require + [app.common.colors :as clr] [app.common.data :as d] [app.common.geom.matrix :as gmt] [app.common.geom.point :as gpt] @@ -73,34 +74,34 @@ :else (str tag)))) (defn setup-fill [shape] - (cond-> shape + (let [color-attr (str/trim (get-in shape [:svg-attrs :fill])) + color-attr (if (= color-attr "currentColor") clr/black color-attr) + color-style (str/trim (get-in shape [:svg-attrs :style :fill])) + color-style (if (= color-style "currentColor") clr/black color-style)] + (cond-> shape ;; Color present as attribute - (uc/color? (str/trim (get-in shape [:svg-attrs :fill]))) - (-> (update :svg-attrs dissoc :fill) - (update-in [:svg-attrs :style] dissoc :fill) - (assoc-in [:fills 0 :fill-color] (-> (get-in shape [:svg-attrs :fill]) - (str/trim) - (uc/parse-color)))) + (uc/color? color-attr) + (-> (update :svg-attrs dissoc :fill) + (update-in [:svg-attrs :style] dissoc :fill) + (assoc-in [:fills 0 :fill-color] (uc/parse-color color-attr))) ;; Color present as style - (uc/color? (str/trim (get-in shape [:svg-attrs :style :fill]))) - (-> (update-in [:svg-attrs :style] dissoc :fill) - (update :svg-attrs dissoc :fill) - (assoc-in [:fills 0 :fill-color] (-> (get-in shape [:svg-attrs :style :fill]) - (str/trim) - (uc/parse-color)))) + (uc/color? color-style) + (-> (update-in [:svg-attrs :style] dissoc :fill) + (update :svg-attrs dissoc :fill) + (assoc-in [:fills 0 :fill-color] (uc/parse-color color-style))) - (get-in shape [:svg-attrs :fill-opacity]) - (-> (update :svg-attrs dissoc :fill-opacity) - (update-in [:svg-attrs :style] dissoc :fill-opacity) - (assoc-in [:fills 0 :fill-opacity] (-> (get-in shape [:svg-attrs :fill-opacity]) - (d/parse-double)))) + (get-in shape [:svg-attrs :fill-opacity]) + (-> (update :svg-attrs dissoc :fill-opacity) + (update-in [:svg-attrs :style] dissoc :fill-opacity) + (assoc-in [:fills 0 :fill-opacity] (-> (get-in shape [:svg-attrs :fill-opacity]) + (d/parse-double)))) - (get-in shape [:svg-attrs :style :fill-opacity]) - (-> (update-in [:svg-attrs :style] dissoc :fill-opacity) - (update :svg-attrs dissoc :fill-opacity) - (assoc-in [:fills 0 :fill-opacity] (-> (get-in shape [:svg-attrs :style :fill-opacity]) - (d/parse-double)))))) + (get-in shape [:svg-attrs :style :fill-opacity]) + (-> (update-in [:svg-attrs :style] dissoc :fill-opacity) + (update :svg-attrs dissoc :fill-opacity) + (assoc-in [:fills 0 :fill-opacity] (-> (get-in shape [:svg-attrs :style :fill-opacity]) + (d/parse-double))))))) (defn setup-stroke [shape] (let [stroke-linecap (-> (or (get-in shape [:svg-attrs :stroke-linecap]) diff --git a/frontend/src/app/main/ui/workspace/context_menu.cljs b/frontend/src/app/main/ui/workspace/context_menu.cljs index eda6e725bf..550b68556a 100644 --- a/frontend/src/app/main/ui/workspace/context_menu.cljs +++ b/frontend/src/app/main/ui/workspace/context_menu.cljs @@ -398,7 +398,6 @@ [{:keys [shapes]}] (let [single? (= (count shapes) 1) - has-frame? (->> shapes (d/seek cph/frame-shape?)) has-component? (some true? (map #(contains? % :component-id) shapes)) is-component? (and single? (-> shapes first :component-id some?)) @@ -454,19 +453,18 @@ :accept-style :primary :on-accept do-update-component-in-bulk}))] [:* - (when (not has-frame?) - [:* - [:& menu-separator] - [:& menu-entry {:title (tr "workspace.shape.menu.create-component") - :shortcut (sc/get-tooltip :create-component) - :on-click do-add-component}] - (when (and has-component? (not single?)) - [:* - [:& menu-entry {:title (tr "workspace.shape.menu.detach-instances-in-bulk") - :shortcut (sc/get-tooltip :detach-component) - :on-click do-detach-component-in-bulk}] - [:& menu-entry {:title (tr "workspace.shape.menu.update-components-in-bulk") - :on-click do-update-in-bulk}]])]) + [:* + [:& menu-separator] + [:& menu-entry {:title (tr "workspace.shape.menu.create-component") + :shortcut (sc/get-tooltip :create-component) + :on-click do-add-component}] + (when (and has-component? (not single?)) + [:* + [:& menu-entry {:title (tr "workspace.shape.menu.detach-instances-in-bulk") + :shortcut (sc/get-tooltip :detach-component) + :on-click do-detach-component-in-bulk}] + [:& menu-entry {:title (tr "workspace.shape.menu.update-components-in-bulk") + :on-click do-update-in-bulk}]])] (when is-component? ;; WARNING: this menu is the same as the context menu at the sidebar.