Merge pull request #4047 from penpot/niwinz-staging-bugfix-7

🐛 Fix incorrect props transformation on custom strokes component
This commit is contained in:
Alejandro 2024-01-24 11:53:08 +01:00 committed by GitHub
commit 3c07416c48
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 19 deletions

View file

@ -7,6 +7,7 @@
(ns app.main.ui.dashboard.grid (ns app.main.ui.dashboard.grid
(:require-macros [app.main.style :as stl]) (:require-macros [app.main.style :as stl])
(:require (:require
[app.common.data :as d]
[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.logging :as log] [app.common.logging :as log]
@ -446,8 +447,9 @@
[:& loading-placeholder] [:& loading-placeholder]
(seq files) (seq files)
(for [slice (partition-all limit files)] (for [[index slice] (d/enumerate (partition-all limit files))]
[:ul {:class (stl/css :grid-row)}
[:ul {:class (stl/css :grid-row) :key (dm/str index)}
(when @dragging? (when @dragging?
[:li {:class (stl/css :grid-item)}]) [:li {:class (stl/css :grid-item)}])
(for [item slice] (for [item slice]

View file

@ -31,7 +31,7 @@
suffix (if (some? index) (dm/str "-" index) "") suffix (if (some? index) (dm/str "-" index) "")
clip-id (dm/str "inner-stroke-" render-id "-" shape-id suffix) clip-id (dm/str "inner-stroke-" render-id "-" shape-id suffix)
href (dm/str "#stroke-shape-" render-id "-" shape-id suffix)] href (dm/str "#stroke-shape-" render-id "-" shape-id suffix)]
[:> "clipPath" #js {:id clip-id} [:> "clipPath" {:id clip-id}
[:use {:href href}]])) [:use {:href href}]]))
(mf/defc outer-stroke-mask (mf/defc outer-stroke-mask
@ -473,7 +473,7 @@
shape-blur (get shape :blur) shape-blur (get shape :blur)
shape-fills (get shape :fills) shape-fills (get shape :fills)
shape-shadow (get shape :shadow) shape-shadow (get shape :shadow)
shape-strokes (get shape :strokes) shape-strokes (not-empty (get shape :strokes))
svg-attrs (attrs/get-svg-props shape render-id) svg-attrs (attrs/get-svg-props shape render-id)
@ -481,24 +481,22 @@
(obj/clone) (obj/clone)
(attrs/add-layer-styles! shape)) (attrs/add-layer-styles! shape))
props (-> svg-attrs props (mf/spread-props svg-attrs
(obj/merge!
{:id stroke-id {:id stroke-id
:className "strokes" :className "strokes"
:style style})) :style style})]
props (if ^boolean (cfh/frame-shape? shape)
props (when-not ^boolean (cfh/frame-shape? shape)
(cond-> props (when (and (some? shape-blur)
(and (some? shape-blur)
(not ^boolean (:hidden shape-blur))) (not ^boolean (:hidden shape-blur)))
(obj/set! "filter" (dm/fmt "url(#filter-blur-%)" render-id)) (obj/set! props "filter" (dm/fmt "url(#filter-blur-%)" render-id)))
(and (empty? shape-fills) (when (and (empty? shape-fills)
(some? (->> shape-shadow (remove :hidden) seq))) (some? (->> shape-shadow (remove :hidden) not-empty)))
(obj/set! "filter" (dm/fmt "url(#filter-%)" render-id))))] (obj/set! props "filter" (dm/fmt "url(#filter-%)" render-id))))
(when (d/not-empty? shape-strokes) (when (some? shape-strokes)
[:> :g props [:> :g props
(for [[index value] (reverse (d/enumerate shape-strokes))] (for [[index value] (reverse (d/enumerate shape-strokes))]
[:& shape-custom-stroke {:shape shape [:& shape-custom-stroke {:shape shape