mirror of
https://github.com/penpot/penpot.git
synced 2025-12-12 06:24:17 +01:00
Merge branch 'main' into staging
This commit is contained in:
@@ -1547,14 +1547,10 @@
|
|||||||
(update component :path #(d/nilv % "")))]
|
(update component :path #(d/nilv % "")))]
|
||||||
(d/update-when data :components d/update-vals update-component)))
|
(d/update-when data :components d/update-vals update-component)))
|
||||||
|
|
||||||
(defmethod migrate-data "0014-fix-tokens-lib-duplicate-ids"
|
|
||||||
[data _]
|
|
||||||
(d/update-when data :tokens-lib types.tokens-lib/fix-duplicate-token-set-ids))
|
|
||||||
|
|
||||||
(def ^:private valid-stroke?
|
(def ^:private valid-stroke?
|
||||||
(sm/lazy-validator cts/schema:stroke))
|
(sm/lazy-validator cts/schema:stroke))
|
||||||
|
|
||||||
(defmethod migrate-data "0015-clear-invalid-strokes-and-fills"
|
(defmethod migrate-data "0013-clear-invalid-strokes-and-fills"
|
||||||
[data _]
|
[data _]
|
||||||
(letfn [(clear-color-image [image]
|
(letfn [(clear-color-image [image]
|
||||||
(select-keys image types.color/image-attrs))
|
(select-keys image types.color/image-attrs))
|
||||||
@@ -1621,6 +1617,10 @@
|
|||||||
(update :pages-index d/update-vals update-container)
|
(update :pages-index d/update-vals update-container)
|
||||||
(d/update-when :components d/update-vals update-container))))
|
(d/update-when :components d/update-vals update-container))))
|
||||||
|
|
||||||
|
(defmethod migrate-data "0014-fix-tokens-lib-duplicate-ids"
|
||||||
|
[data _]
|
||||||
|
(d/update-when data :tokens-lib types.tokens-lib/fix-duplicate-token-set-ids))
|
||||||
|
|
||||||
(def available-migrations
|
(def available-migrations
|
||||||
(into (d/ordered-set)
|
(into (d/ordered-set)
|
||||||
["legacy-2"
|
["legacy-2"
|
||||||
@@ -1690,5 +1690,5 @@
|
|||||||
"0011-fix-invalid-text-touched-flags"
|
"0011-fix-invalid-text-touched-flags"
|
||||||
"0012-fix-position-data"
|
"0012-fix-position-data"
|
||||||
"0013-fix-component-path"
|
"0013-fix-component-path"
|
||||||
"0014-fix-tokens-lib-duplicate-ids"
|
"0013-clear-invalid-strokes-and-fills"
|
||||||
"0015-clear-invalid-strokes-and-fills"]))
|
"0014-fix-tokens-lib-duplicate-ids"]))
|
||||||
|
|||||||
@@ -420,7 +420,7 @@
|
|||||||
:min 0
|
:min 0
|
||||||
:max 1
|
:max 1
|
||||||
:compile
|
:compile
|
||||||
(fn [{:keys [kind max min] :as props} children _]
|
(fn [{:keys [kind max min ordered] :as props} children _]
|
||||||
(let [kind (or (last children) kind)
|
(let [kind (or (last children) kind)
|
||||||
|
|
||||||
pred
|
pred
|
||||||
@@ -456,18 +456,23 @@
|
|||||||
(fn [value]
|
(fn [value]
|
||||||
(every? pred value)))
|
(every? pred value)))
|
||||||
|
|
||||||
|
empty-set
|
||||||
|
(if ordered
|
||||||
|
(d/ordered-set)
|
||||||
|
#{})
|
||||||
|
|
||||||
decode
|
decode
|
||||||
(fn [v]
|
(fn [v]
|
||||||
(cond
|
(cond
|
||||||
(string? v)
|
(string? v)
|
||||||
(let [v (str/split v #"[\s,]+")]
|
(let [v (str/split v #"[\s,]+")]
|
||||||
(into #{} xf:filter-word-strings v))
|
(into empty-set xf:filter-word-strings v))
|
||||||
|
|
||||||
(set? v)
|
(set? v)
|
||||||
v
|
v
|
||||||
|
|
||||||
(coll? v)
|
(coll? v)
|
||||||
(into #{} v)
|
(into empty-set v)
|
||||||
|
|
||||||
:else
|
:else
|
||||||
v))
|
v))
|
||||||
|
|||||||
@@ -106,7 +106,7 @@
|
|||||||
[:version :int]
|
[:version :int]
|
||||||
[:features ::cfeat/features]
|
[:features ::cfeat/features]
|
||||||
[:migrations {:optional true}
|
[:migrations {:optional true}
|
||||||
[::sm/set :string]]])
|
[::sm/set {:ordered true} :string]]])
|
||||||
|
|
||||||
(sm/register! ::data schema:data)
|
(sm/register! ::data schema:data)
|
||||||
(sm/register! ::file schema:file)
|
(sm/register! ::file schema:file)
|
||||||
|
|||||||
Reference in New Issue
Block a user