mirror of
https://github.com/penpot/penpot.git
synced 2025-06-07 02:21:39 +02:00
Merge remote-tracking branch 'origin/staging' into develop
This commit is contained in:
commit
402eacdb22
12 changed files with 47 additions and 41 deletions
|
@ -26,6 +26,7 @@
|
||||||
### :bug: Bugs fixed
|
### :bug: Bugs fixed
|
||||||
|
|
||||||
- Fix detach when top copy is dangling and nested copy is not [Taiga #9699](https://tree.taiga.io/project/penpot/issue/9699)
|
- Fix detach when top copy is dangling and nested copy is not [Taiga #9699](https://tree.taiga.io/project/penpot/issue/9699)
|
||||||
|
- Fix problem in plugins with `replaceColor` method [#174](https://github.com/penpot/penpot-plugins/issues/174)
|
||||||
|
|
||||||
## 2.4.1
|
## 2.4.1
|
||||||
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" stroke-linecap="round" stroke-linejoin="round">
|
|
||||||
<path d="M3.5 3.5h-2m2 0v-2m0 2h9m-9 0v9m9-9v-2m0 2h2m-2 0v9m0 0h2m-2 0v2m0-2h-9m0 0v2m0-2h-2"/>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 214 B |
|
@ -1,3 +1,3 @@
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" stroke-linecap="round" stroke-linejoin="round">
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" stroke-linecap="round" stroke-linejoin="round">
|
||||||
<path d="M4.88 1.5H2.945c-.798 0-1.445.647-1.445 1.445v1.74M4.88 14.5H2.945c-.798 0-1.445-.842-1.445-1.64v-1.74m13-6.24V2.945c0-.798-.647-1.445-1.445-1.445H11.12m3.38 9.62v1.935c0 .798-.647 1.445-1.445 1.445H11.12"/>
|
<path d="M3.5 3.5h-2m2 0v-2m0 2h9m-9 0v9m9-9v-2m0 2h2m-2 0v9m0 0h2m-2 0v2m0-2h-9m0 0v2m0-2h-2"/>
|
||||||
</svg>
|
</svg>
|
||||||
|
|
Before Width: | Height: | Size: 335 B After Width: | Height: | Size: 214 B |
|
@ -9,7 +9,6 @@
|
||||||
[app.common.types.component :as ctk]
|
[app.common.types.component :as ctk]
|
||||||
[app.common.types.shape :as cts]
|
[app.common.types.shape :as cts]
|
||||||
[app.common.types.shape.layout :as ctl]
|
[app.common.types.shape.layout :as ctl]
|
||||||
[app.config :as cf]
|
|
||||||
[app.main.ui.icons :as i]
|
[app.main.ui.icons :as i]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
|
@ -32,7 +31,7 @@
|
||||||
i/flex-grid
|
i/flex-grid
|
||||||
|
|
||||||
:else
|
:else
|
||||||
(if (cf/external-feature-flag "boards-01" "test") i/board-2 i/board))
|
i/board)
|
||||||
;; TODO -> THUMBNAIL ICON
|
;; TODO -> THUMBNAIL ICON
|
||||||
:image i/img
|
:image i/img
|
||||||
:line (if (cts/has-images? shape) i/img i/path)
|
:line (if (cts/has-images? shape) i/img i/path)
|
||||||
|
@ -57,7 +56,7 @@
|
||||||
(if main-instance?
|
(if main-instance?
|
||||||
i/component
|
i/component
|
||||||
(case type
|
(case type
|
||||||
:frame (if (cf/external-feature-flag "boards-01" "test") i/board-2 i/board)
|
:frame i/board
|
||||||
:image i/img
|
:image i/img
|
||||||
:shape i/path
|
:shape i/path
|
||||||
:text i/text
|
:text i/text
|
||||||
|
|
|
@ -63,7 +63,6 @@
|
||||||
(def ^:icon arrow (icon-xref :arrow))
|
(def ^:icon arrow (icon-xref :arrow))
|
||||||
(def ^:icon asc-sort (icon-xref :asc-sort))
|
(def ^:icon asc-sort (icon-xref :asc-sort))
|
||||||
(def ^:icon board (icon-xref :board))
|
(def ^:icon board (icon-xref :board))
|
||||||
(def ^:icon board-2 (icon-xref :board-2))
|
|
||||||
(def ^:icon boards-thumbnail (icon-xref :boards-thumbnail))
|
(def ^:icon boards-thumbnail (icon-xref :boards-thumbnail))
|
||||||
(def ^:icon boolean-difference (icon-xref :boolean-difference))
|
(def ^:icon boolean-difference (icon-xref :boolean-difference))
|
||||||
(def ^:icon boolean-exclude (icon-xref :boolean-exclude))
|
(def ^:icon boolean-exclude (icon-xref :boolean-exclude))
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
(:require
|
(:require
|
||||||
[app.common.data :as d]
|
[app.common.data :as d]
|
||||||
[app.common.data.macros :as dm]
|
[app.common.data.macros :as dm]
|
||||||
[app.config :as cf]
|
|
||||||
[app.main.data.workspace.undo :as dwu]
|
[app.main.data.workspace.undo :as dwu]
|
||||||
[app.main.refs :as refs]
|
[app.main.refs :as refs]
|
||||||
[app.main.store :as st]
|
[app.main.store :as st]
|
||||||
|
@ -155,7 +154,7 @@
|
||||||
:circle i/elipse
|
:circle i/elipse
|
||||||
:text i/text
|
:text i/text
|
||||||
:path i/path
|
:path i/path
|
||||||
:frame (if (cf/external-feature-flag "boards-01" "test") i/board-2 i/board)
|
:frame i/board
|
||||||
:group i/group
|
:group i/group
|
||||||
:color i/drop-icon
|
:color i/drop-icon
|
||||||
:typography i/text-palette
|
:typography i/text-palette
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
[app.common.files.helpers :as cfh]
|
[app.common.files.helpers :as cfh]
|
||||||
[app.common.types.shape :as cts]
|
[app.common.types.shape :as cts]
|
||||||
[app.common.uuid :as uuid]
|
[app.common.uuid :as uuid]
|
||||||
[app.config :as cf]
|
|
||||||
[app.main.data.workspace :as dw]
|
[app.main.data.workspace :as dw]
|
||||||
[app.main.refs :as refs]
|
[app.main.refs :as refs]
|
||||||
[app.main.store :as st]
|
[app.main.store :as st]
|
||||||
|
@ -337,7 +336,7 @@
|
||||||
:on-click add-filter}
|
:on-click add-filter}
|
||||||
[:div {:class (stl/css :filter-menu-item-name-wrapper)}
|
[:div {:class (stl/css :filter-menu-item-name-wrapper)}
|
||||||
[:span {:class (stl/css :filter-menu-item-icon)}
|
[:span {:class (stl/css :filter-menu-item-icon)}
|
||||||
(if (cf/external-feature-flag "boards-01" "test") i/board-2 i/board)]
|
i/board]
|
||||||
[:span {:class (stl/css :filter-menu-item-name)}
|
[:span {:class (stl/css :filter-menu-item-name)}
|
||||||
(tr "workspace.sidebar.layers.frames")]]
|
(tr "workspace.sidebar.layers.frames")]]
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
[app.common.data.macros :as dm]
|
[app.common.data.macros :as dm]
|
||||||
[app.common.geom.point :as gpt]
|
[app.common.geom.point :as gpt]
|
||||||
[app.common.media :as cm]
|
[app.common.media :as cm]
|
||||||
[app.config :as cf]
|
|
||||||
[app.main.data.event :as ev]
|
[app.main.data.event :as ev]
|
||||||
[app.main.data.modal :as modal]
|
[app.main.data.modal :as modal]
|
||||||
[app.main.data.workspace :as dw]
|
[app.main.data.workspace :as dw]
|
||||||
|
@ -147,7 +146,7 @@
|
||||||
:on-click select-drawtool
|
:on-click select-drawtool
|
||||||
:data-tool "frame"
|
:data-tool "frame"
|
||||||
:data-testid "artboard-btn"}
|
:data-testid "artboard-btn"}
|
||||||
(if (cf/external-feature-flag "boards-01" "test") i/board-2 i/board)]]
|
i/board]]
|
||||||
[:li
|
[:li
|
||||||
[:button
|
[:button
|
||||||
{:title (tr "workspace.toolbar.rect" (sc/get-tooltip :draw-rect))
|
{:title (tr "workspace.toolbar.rect" (sc/get-tooltip :draw-rect))
|
||||||
|
@ -203,7 +202,8 @@
|
||||||
:aria-label (tr "workspace.toolbar.plugins" (sc/get-tooltip :plugins))
|
:aria-label (tr "workspace.toolbar.plugins" (sc/get-tooltip :plugins))
|
||||||
:class (stl/css :main-toolbar-options-button)
|
:class (stl/css :main-toolbar-options-button)
|
||||||
:on-click #(st/emit!
|
:on-click #(st/emit!
|
||||||
(ptk/event ::ev/event {::ev/name "open-plugins-manager" ::ev/origin "workspace:toolbar"})
|
(ptk/data-event ::ev/event {::ev/name "open-plugins-manager"
|
||||||
|
::ev/origin "workspace:toolbar"})
|
||||||
(modal/show :plugin-management {}))
|
(modal/show :plugin-management {}))
|
||||||
:data-tool "plugins"
|
:data-tool "plugins"
|
||||||
:data-testid "plugins-btn"}
|
:data-testid "plugins-btn"}
|
||||||
|
|
|
@ -170,8 +170,8 @@
|
||||||
|
|
||||||
:replaceColor
|
:replaceColor
|
||||||
(fn [shapes old-color new-color]
|
(fn [shapes old-color new-color]
|
||||||
(let [old-color (parser/parse-color old-color)
|
(let [old-color (parser/parse-color-data old-color)
|
||||||
new-color (parser/parse-color new-color)]
|
new-color (parser/parse-color-data new-color)]
|
||||||
(cond
|
(cond
|
||||||
(or (not (array? shapes)) (not (every? shape/shape-proxy? shapes)))
|
(or (not (array? shapes)) (not (every? shape/shape-proxy? shapes)))
|
||||||
(u/display-not-valid :replaceColor-shapes shapes)
|
(u/display-not-valid :replaceColor-shapes shapes)
|
||||||
|
@ -194,7 +194,9 @@
|
||||||
shapes-by-color
|
shapes-by-color
|
||||||
(->> (ctc/extract-all-colors shapes file-id shared-libs)
|
(->> (ctc/extract-all-colors shapes file-id shared-libs)
|
||||||
(group-by :attrs))]
|
(group-by :attrs))]
|
||||||
(st/emit! (dwc/change-color-in-selected new-color (get shapes-by-color old-color) old-color))))))
|
|
||||||
|
(when-let [operations (get shapes-by-color old-color)]
|
||||||
|
(st/emit! (dwc/change-color-in-selected operations new-color old-color)))))))
|
||||||
|
|
||||||
:getRoot
|
:getRoot
|
||||||
(fn []
|
(fn []
|
||||||
|
|
|
@ -128,18 +128,19 @@
|
||||||
;; image?: ImageData;
|
;; image?: ImageData;
|
||||||
;; }
|
;; }
|
||||||
(defn format-color
|
(defn format-color
|
||||||
[{:keys [id name path color opacity ref-id ref-file gradient image] :as color-data}]
|
[{:keys [id file-id name path color opacity ref-id ref-file gradient image] :as color-data}]
|
||||||
(when (some? color-data)
|
(when (some? color-data)
|
||||||
(obj/without-empty
|
(let [id (or (format-id id) (format-id ref-id))
|
||||||
#js {:id (format-id id)
|
file-id (or (format-id file-id) (format-id ref-file))]
|
||||||
:name name
|
(obj/without-empty
|
||||||
:path path
|
#js {:id (or (format-id id) (format-id ref-id))
|
||||||
:color color
|
:fileId (or (format-id file-id) (format-id ref-file))
|
||||||
:opacity opacity
|
:name name
|
||||||
:refId (format-id ref-id)
|
:path path
|
||||||
:refFile (format-id ref-file)
|
:color color
|
||||||
:gradient (format-gradient gradient)
|
:opacity opacity
|
||||||
:image (format-image image)})))
|
:gradient (format-gradient gradient)
|
||||||
|
:image (format-image image)}))))
|
||||||
|
|
||||||
;; Color & ColorShapeInfo
|
;; Color & ColorShapeInfo
|
||||||
(defn format-color-result
|
(defn format-color-result
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
:$file {:enumerable false :get (constantly file-id)}
|
:$file {:enumerable false :get (constantly file-id)}
|
||||||
|
|
||||||
:id {:get (fn [] (dm/str id))}
|
:id {:get (fn [] (dm/str id))}
|
||||||
|
:fileId {:get #(dm/str file-id)}
|
||||||
|
|
||||||
:name
|
:name
|
||||||
{:this true
|
{:this true
|
||||||
|
|
|
@ -111,28 +111,36 @@
|
||||||
|
|
||||||
;; export interface Color {
|
;; export interface Color {
|
||||||
;; id?: string;
|
;; id?: string;
|
||||||
|
;; fileId?: string;
|
||||||
|
;; refId?: string; // deprecated
|
||||||
|
;; refFile?: string; // deprecated
|
||||||
;; name?: string;
|
;; name?: string;
|
||||||
;; path?: string;
|
;; path?: string;
|
||||||
;; color?: string;
|
;; color?: string;
|
||||||
;; opacity?: number;
|
;; opacity?: number;
|
||||||
;; refId?: string;
|
|
||||||
;; refFile?: string;
|
|
||||||
;; gradient?: Gradient;
|
;; gradient?: Gradient;
|
||||||
;; image?: ImageData;
|
;; image?: ImageData;
|
||||||
;; }
|
;; }
|
||||||
|
(defn parse-color-data
|
||||||
|
[^js color]
|
||||||
|
(when (some? color)
|
||||||
|
(let [id (or (obj/get color "id") (obj/get color "refId"))
|
||||||
|
file-id (or (obj/get color "fileId") (obj/get color "refFile"))]
|
||||||
|
(d/without-nils
|
||||||
|
{:id (parse-id id)
|
||||||
|
:file-id (parse-id file-id)
|
||||||
|
:color (-> (obj/get color "color") parse-hex)
|
||||||
|
:opacity (obj/get color "opacity")
|
||||||
|
:gradient (-> (obj/get color "gradient") parse-gradient)
|
||||||
|
:image (-> (obj/get color "image") parse-image-data)}))))
|
||||||
|
|
||||||
(defn parse-color
|
(defn parse-color
|
||||||
[^js color]
|
[^js color]
|
||||||
(when (some? color)
|
(when (some? color)
|
||||||
(d/without-nils
|
(d/without-nils
|
||||||
{:id (-> (obj/get color "id") parse-id)
|
(-> (parse-color-data color)
|
||||||
:name (obj/get color "name")
|
(assoc :name (obj/get color "name")
|
||||||
:path (obj/get color "path")
|
:path (obj/get color "path"))))))
|
||||||
:color (-> (obj/get color "color") parse-hex)
|
|
||||||
:opacity (obj/get color "opacity")
|
|
||||||
:ref-id (-> (obj/get color "refId") parse-id)
|
|
||||||
:ref-file (-> (obj/get color "refFile") parse-id)
|
|
||||||
:gradient (-> (obj/get color "gradient") parse-gradient)
|
|
||||||
:image (-> (obj/get color "image") parse-image-data)})))
|
|
||||||
|
|
||||||
;; export interface Shadow {
|
;; export interface Shadow {
|
||||||
;; id?: string;
|
;; id?: string;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue