🎉 Add malli based validation and coersion subsystem

This commit is contained in:
Andrey Antukh 2023-03-18 10:32:26 +01:00
parent dbc08ba80f
commit 5ca3d01ea1
125 changed files with 4984 additions and 2762 deletions

View file

@ -82,14 +82,14 @@
store (the/prepare-store state done
(fn [new-state]
; Expected shape tree:
; [Page]
; Root Frame
; Component 1
; Rect 1
; Rect-2
;
; [Component 1]
; page1 / Component 1
; [Page]
; Root Frame
; Component 1
; Rect 1
; Rect-2
;
; [Component 1]
; page1 / Component 1
;
(let [shape1 (thp/get-shape new-state :shape1)
@ -136,14 +136,14 @@
(fn [new-state]
; Expected shape tree:
;
; [Page]
; Root Frame
; Group
; Rect 1
; Rect-2
;
; [Group]
; page1 / Group
; [Page]
; Root Frame
; Group
; Rect 1
; Rect-2
;
; [Group]
; page1 / Group
;
(let [[[group shape1 shape2]
[c-group c-shape1 c-shape2]
@ -184,17 +184,17 @@
(fn [new-state]
; Expected shape tree:
;
; [Page]
; Root Frame
; Rect 1
; Rect 1
; Rect 1
;
; [Rect 1]
; page1 / Rect 1
;
; [Rect 1]
; page1 / Rect 1
; [Page]
; Root Frame
; Rect 1
; Rect 1
; Rect 1
;
; [Rect 1]
; page1 / Rect 1
;
; [Rect 1]
; page1 / Rect 1
;
(let [[[instance1 shape1]
[c-instance1 c-shape1]
@ -247,13 +247,13 @@
(fn [new-state]
; Expected shape tree:
;
; [Page]
; Root Frame
; Rect 1
; Rect 1
;
; [Renamed component]
; page1 / Rect 1
; [Page]
; Root Frame
; Rect 1
; Rect 1
;
; [Renamed component]
; page1 / Rect 1
;
(let [libs (wsh/get-libraries new-state)
component (ctf/get-component libs
@ -284,18 +284,18 @@
(fn [new-state]
; Expected shape tree:
;
; [Page]
; Root Frame
; Rect 1
; Rect 1
; Rect 1 #--> Rect 1
; Rect 1 ---> Rect 1
;
; [Page]
; Root Frame
; Rect 1
; Rect 1
; Rect 1 #--> Rect 1
; Rect 1 ---> Rect 1
;
; [Rect 1]
; page1 / Rect 1
;
; [Rect 1]
; page1 / Rect 1
; page1 / Rect 1
;
; [Rect 1]
; page1 / Rect 1
;
(let [new-component-id (->> (get-in new-state
[:workspace-data
@ -340,10 +340,10 @@
(fn [new-state]
; Expected shape tree:
;
; [Page]
; Root Frame
; Rect 1 #--> ?
; Rect 1 ---> ?
; [Page]
; Root Frame
; Rect 1 #--> ?
; Rect 1 ---> ?
;
(let [[main1 shape1]
(thl/resolve-noninstance
@ -406,15 +406,15 @@
(fn [new-state]
; Expected shape tree:
;
; [Page]
; Root Frame
; Rect 1 #--> Rect 1
; Rect 1 ---> Rect 1
; Rect 1
; Rect 1
;
; [Rect 1]
; page1 / Rect 1
; [Page]
; Root Frame
; Rect 1 #--> Rect 1
; Rect 1 ---> Rect 1
; Rect 1
; Rect 1
;
; [Rect 1]
; page1 / Rect 1
;
(let [[[instance1 shape2] [c-instance1 c-shape2] component1]
(thl/resolve-instance-and-main
@ -459,15 +459,15 @@
(fn [new-state]
; Expected shape tree:
;
; [Page]
; Root Frame
; Rect 1
; Rect 1
; [Page]
; Root Frame
; Rect 1
; Rect 1
; Rect 1 #--> Rect 1
; Rect 1 ---> Rect 1
;
; [Rect 1]
; page1 / Rect 1
; Rect 1 ---> Rect 1
;
; [Rect 1]
; page1 / Rect 1
;
(let [new-instance-id (-> new-state
wsh/lookup-selected
@ -563,15 +563,15 @@
(fn [new-state]
; Expected shape tree:
;
; [Page]
; Root Frame
; Rect 1
; Rect 1
; Rect 1
; Rect 1
;
; [Rect 1]
; page1 / Rect 1
; [Page]
; Root Frame
; Rect 1
; Rect 1
; Rect 1
; Rect 1
;
; [Rect 1]
; page1 / Rect 1
;
(let [[instance2 shape1]
(thl/resolve-noninstance
@ -598,17 +598,17 @@
(fn [new-state]
; Expected shape tree:
;
; [Page]
; Root Frame
; Group
; Rect 1
; Rect 1
;
; [Page]
; Root Frame
; Group
; Rect 1
; Rect 1
;
; [Rect 1]
; page1 / Rect 1
;
; [Group]
; page1 / Group
; page1 / Rect 1
;
; [Group]
; page1 / Group
;
(let [page (thp/current-page new-state)
shape1 (thp/get-shape new-state :shape1)
@ -658,20 +658,20 @@
(fn [new-state]
; Expected shape tree:
;
; [Page]
; Root Frame
; Rect 1
; Rect 1
; Rect 1
; Rect 1 #--> Rect 1
; Rect 1 @--> Rect 1
; Rect 1 ---> Rect 1
;
; [Page]
; Root Frame
; Rect 1
; Rect 1
; Rect 1
; Rect 1 #--> Rect 1
; Rect 1 @--> Rect 1
; Rect 1 ---> Rect 1
;
; [Rect 1]
; page1 / Rect 1
;
; [Rect 1]
; page1 / Rect 1
; page1 / Rect 1
;
; [Rect 1]
; page1 / Rect 1
;
(let [new-instance-id (-> new-state
wsh/lookup-selected
@ -724,14 +724,14 @@
(fn [new-state]
; Expected shape tree:
;
; [Page]
; Root Frame
; Group
; Rect 1 #--> <Library 1> Rect 1
; Rect 1 ---> <Library 1> Rect 1
;
; [Group]
; page1 / Group
; [Page]
; Root Frame
; Group
; Rect 1 #--> <Library 1> Rect 1
; Rect 1 ---> <Library 1> Rect 1
;
; [Group]
; page1 / Group
;
(let [instance1 (thp/get-shape new-state :instance1)