mirror of
https://github.com/penpot/penpot.git
synced 2025-06-04 03:32:36 +02:00
✨ Add legacy flex dir cleaner
This commit is contained in:
parent
3da8b945ca
commit
fef19a3c80
1 changed files with 13 additions and 1 deletions
|
@ -70,13 +70,25 @@
|
||||||
(cts/setup-shape))
|
(cts/setup-shape))
|
||||||
shape))
|
shape))
|
||||||
|
|
||||||
|
(defn- fix-legacy-flex-dir
|
||||||
|
"This operation is only relevant to old data and it is fixed just
|
||||||
|
for convenience."
|
||||||
|
[shape]
|
||||||
|
(d/update-when shape :layout-flex-dir
|
||||||
|
(fn [dir]
|
||||||
|
(case dir
|
||||||
|
:reverse-row :row-reverse
|
||||||
|
:reverse-column :column-reverse
|
||||||
|
dir))))
|
||||||
|
|
||||||
(defn clean-shape-post-decode
|
(defn clean-shape-post-decode
|
||||||
"A shape procesor that expected to be executed after schema decoding
|
"A shape procesor that expected to be executed after schema decoding
|
||||||
process but before validation."
|
process but before validation."
|
||||||
[shape]
|
[shape]
|
||||||
(-> shape
|
(-> shape
|
||||||
(fix-shape-shadow-color)
|
(fix-shape-shadow-color)
|
||||||
(fix-root-shape)))
|
(fix-root-shape)
|
||||||
|
(fix-legacy-flex-dir)))
|
||||||
|
|
||||||
(defn clean-file
|
(defn clean-file
|
||||||
[file & {:as _opts}]
|
[file & {:as _opts}]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue