mirror of
https://github.com/penpot/penpot.git
synced 2025-01-09 08:20:45 -05:00
🐛 Fix wrap not working in plugins
This commit is contained in:
parent
26fa2a71ea
commit
d13b9ef3ea
2 changed files with 18 additions and 3 deletions
|
@ -48,8 +48,7 @@
|
|||
#{:flex :grid})
|
||||
|
||||
(def flex-direction-types
|
||||
;;TODO remove reverse-column and reverse-row after script
|
||||
#{:row :reverse-row :row-reverse :column :reverse-column :column-reverse})
|
||||
#{:row :row-reverse :column :column-reverse})
|
||||
|
||||
(def grid-direction-types
|
||||
#{:row :column})
|
||||
|
@ -58,7 +57,7 @@
|
|||
#{:simple :multiple})
|
||||
|
||||
(def wrap-types
|
||||
#{:wrap :nowrap :no-wrap}) ;;TODO remove no-wrap after script
|
||||
#{:wrap :nowrap})
|
||||
|
||||
(def padding-type
|
||||
#{:simple :multiple})
|
||||
|
|
|
@ -66,6 +66,22 @@
|
|||
(let [id (obj/get self "$id")]
|
||||
(st/emit! (dwsl/update-layout #{id} {:layout-flex-dir value}))))))}
|
||||
|
||||
{:name "wrap"
|
||||
:get #(-> % u/proxy->shape :layout-wrap-type d/name)
|
||||
:set
|
||||
(fn [self value]
|
||||
(let [value (keyword value)]
|
||||
(cond
|
||||
(not (contains? ctl/wrap-types value))
|
||||
(u/display-not-valid :wrap value)
|
||||
|
||||
(not (r/check-permission plugin-id "content:write"))
|
||||
(u/display-not-valid :wrap "Plugin doesn't have 'content:write' permission")
|
||||
|
||||
:else
|
||||
(let [id (obj/get self "$id")]
|
||||
(st/emit! (dwsl/update-layout #{id} {:layout-wrap-type value}))))))}
|
||||
|
||||
{:name "alignItems"
|
||||
:get #(-> % u/proxy->shape :layout-align-items d/name)
|
||||
:set
|
||||
|
|
Loading…
Reference in a new issue