mirror of
https://github.com/penpot/penpot.git
synced 2025-05-29 23:06:10 +02:00
✨ Plugins create svg shapes
This commit is contained in:
parent
21d38a058b
commit
67d48435e7
6 changed files with 128 additions and 103 deletions
|
@ -67,12 +67,12 @@
|
|||
(appendChild [self child]
|
||||
(let [parent-id (get-data self :id)
|
||||
child-id (uuid/uuid (obj/get child "id"))]
|
||||
(st/emit! (udw/relocate-shapes #{ child-id } parent-id 0))))
|
||||
(st/emit! (udw/relocate-shapes #{child-id} parent-id 0))))
|
||||
|
||||
(insertChild [self index child]
|
||||
(let [parent-id (get-data self :id)
|
||||
child-id (uuid/uuid (obj/get child "id"))]
|
||||
(st/emit! (udw/relocate-shapes #{ child-id } parent-id index)))))
|
||||
(st/emit! (udw/relocate-shapes #{child-id} parent-id index)))))
|
||||
|
||||
(crc/define-properties!
|
||||
ShapeProxy
|
||||
|
@ -124,16 +124,14 @@
|
|||
:set (fn [self value]
|
||||
(let [id (get-data self :id)
|
||||
value (mapv #(utils/from-js %) value)]
|
||||
(st/emit! (dwc/update-shapes [id] #(assoc % :fills value)))))
|
||||
}
|
||||
(st/emit! (dwc/update-shapes [id] #(assoc % :fills value)))))}
|
||||
|
||||
{:name "strokes"
|
||||
:get #(get-state % :strokes make-strokes)
|
||||
:set (fn [self value]
|
||||
(let [id (get-data self :id)
|
||||
value (mapv #(utils/from-js %) value)]
|
||||
(st/emit! (dwc/update-shapes [id] #(assoc % :strokes value)))))
|
||||
})
|
||||
(st/emit! (dwc/update-shapes [id] #(assoc % :strokes value)))))})
|
||||
|
||||
(cond-> (or (cfh/frame-shape? data) (cfh/group-shape? data) (cfh/svg-raw-shape? data) (cfh/bool-shape? data))
|
||||
(crc/add-properties!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue