@arkitektio/bsx 5.0.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/bsx/analyze.d.ts +6 -5
- package/dist/bsx/analyze.d.ts.map +1 -1
- package/dist/bsx/analyze.js +12 -10
- package/dist/bsx/analyze.js.map +1 -1
- package/dist/bsx/declared.d.ts +111 -0
- package/dist/bsx/declared.d.ts.map +1 -0
- package/dist/bsx/declared.js +311 -0
- package/dist/bsx/declared.js.map +1 -0
- package/dist/bsx/index.d.ts +1 -0
- package/dist/bsx/index.d.ts.map +1 -1
- package/dist/bsx/index.js +1 -0
- package/dist/bsx/index.js.map +1 -1
- package/dist/bsx/infer.d.ts +40 -17
- package/dist/bsx/infer.d.ts.map +1 -1
- package/dist/bsx/infer.js +105 -49
- package/dist/bsx/infer.js.map +1 -1
- package/dist/bsx/language.d.ts +6 -2
- package/dist/bsx/language.d.ts.map +1 -1
- package/dist/bsx/language.js +65 -21
- package/dist/bsx/language.js.map +1 -1
- package/dist/bsx/parse.d.ts +6 -1
- package/dist/bsx/parse.d.ts.map +1 -1
- package/dist/bsx/parse.js +32 -3
- package/dist/bsx/parse.js.map +1 -1
- package/dist/bsx/print.d.ts.map +1 -1
- package/dist/bsx/print.js +3 -0
- package/dist/bsx/print.js.map +1 -1
- package/dist/bsx/references.d.ts +45 -51
- package/dist/bsx/references.d.ts.map +1 -1
- package/dist/bsx/references.js +265 -138
- package/dist/bsx/references.js.map +1 -1
- package/dist/catalogs/html.d.ts +2 -2
- package/dist/catalogs/index.d.ts +49 -71
- package/dist/catalogs/index.d.ts.map +1 -1
- package/dist/catalogs/index.js +1 -1
- package/dist/catalogs/logo.d.ts +14 -28
- package/dist/catalogs/logo.d.ts.map +1 -1
- package/dist/catalogs/logo.js +1 -2
- package/dist/catalogs/logo.js.map +1 -1
- package/dist/catalogs/parts/data.d.ts +1 -1
- package/dist/catalogs/parts/feedback.d.ts +3 -3
- package/dist/catalogs/parts/forms.d.ts +4 -4
- package/dist/catalogs/parts/html.d.ts +2 -2
- package/dist/catalogs/parts/icons.d.ts +2 -2
- package/dist/catalogs/parts/index.d.ts +35 -57
- package/dist/catalogs/parts/index.d.ts.map +1 -1
- package/dist/catalogs/parts/logo.d.ts +10 -25
- package/dist/catalogs/parts/logo.d.ts.map +1 -1
- package/dist/catalogs/parts/logo.js +12 -14
- package/dist/catalogs/parts/logo.js.map +1 -1
- package/dist/catalogs/parts/navigation.d.ts +4 -4
- package/dist/catalogs/parts/overlays.d.ts +11 -11
- package/dist/catalogs/parts/run.d.ts +2 -10
- package/dist/catalogs/parts/run.d.ts.map +1 -1
- package/dist/catalogs/parts/scene.d.ts +7 -15
- package/dist/catalogs/parts/scene.d.ts.map +1 -1
- package/dist/catalogs/parts/scene.js +1 -5
- package/dist/catalogs/parts/scene.js.map +1 -1
- package/dist/catalogs/parts/typography.d.ts +3 -3
- package/dist/catalogs/props.d.ts +2 -2
- package/dist/catalogs/scene.d.ts +5 -13
- package/dist/catalogs/scene.d.ts.map +1 -1
- package/dist/catalogs/shadcn.d.ts +11 -11
- package/dist/catalogs/ui.d.ts +16 -16
- package/dist/logo/actionLogoSource.d.ts +3 -3
- package/dist/logo/actionLogoSource.d.ts.map +1 -1
- package/dist/logo/actionLogoSource.js +4 -4
- package/dist/logo/actionLogoSource.js.map +1 -1
- package/dist/renderer/BlokRenderer.d.ts +10 -6
- package/dist/renderer/BlokRenderer.d.ts.map +1 -1
- package/dist/renderer/BlokRenderer.js +23 -9
- package/dist/renderer/BlokRenderer.js.map +1 -1
- package/dist/renderer/baseCatalog.d.ts +3 -3
- package/dist/renderer/baseCatalog.js +2 -2
- package/dist/renderer/bloks/control.d.ts +18 -2
- package/dist/renderer/bloks/control.d.ts.map +1 -1
- package/dist/renderer/bloks/control.js +85 -14
- package/dist/renderer/bloks/control.js.map +1 -1
- package/dist/renderer/bloks/data.d.ts +1 -1
- package/dist/renderer/bloks/feedback.d.ts +3 -3
- package/dist/renderer/bloks/forms.d.ts +4 -4
- package/dist/renderer/bloks/html.d.ts +2 -2
- package/dist/renderer/bloks/icons.d.ts +1 -1
- package/dist/renderer/bloks/index.d.ts +30 -37
- package/dist/renderer/bloks/index.d.ts.map +1 -1
- package/dist/renderer/bloks/logo/index.d.ts +1 -8
- package/dist/renderer/bloks/logo/index.d.ts.map +1 -1
- package/dist/renderer/bloks/logo/index.js +1 -2
- package/dist/renderer/bloks/logo/index.js.map +1 -1
- package/dist/renderer/bloks/logo/logo.fixture.json +266 -250
- package/dist/renderer/bloks/navigation.d.ts +4 -4
- package/dist/renderer/bloks/overlays.d.ts +11 -11
- package/dist/renderer/bloks/run/components.d.ts +1 -5
- package/dist/renderer/bloks/run/components.d.ts.map +1 -1
- package/dist/renderer/bloks/scene/index.d.ts +4 -8
- package/dist/renderer/bloks/scene/index.d.ts.map +1 -1
- package/dist/renderer/bloks/scene/interaction.d.ts.map +1 -1
- package/dist/renderer/bloks/scene/interaction.js +3 -2
- package/dist/renderer/bloks/scene/interaction.js.map +1 -1
- package/dist/renderer/bloks/shared/props.d.ts +2 -2
- package/dist/renderer/bloks/typography.d.ts +3 -3
- package/dist/renderer/declarations.d.ts +40 -33
- package/dist/renderer/declarations.d.ts.map +1 -1
- package/dist/renderer/declarations.js +41 -56
- package/dist/renderer/declarations.js.map +1 -1
- package/dist/renderer/declare.js +4 -4
- package/dist/renderer/declare.js.map +1 -1
- package/dist/renderer/persist.d.ts +22 -13
- package/dist/renderer/persist.d.ts.map +1 -1
- package/dist/renderer/persist.js +40 -21
- package/dist/renderer/persist.js.map +1 -1
- package/dist/renderer/runtime/catalog.d.ts +4 -4
- package/dist/renderer/runtime/catalog.js +3 -3
- package/dist/renderer/runtime/components.d.ts +4 -4
- package/dist/renderer/runtime/components.d.ts.map +1 -1
- package/dist/renderer/runtime/components.js +5 -5
- package/dist/renderer/runtime/components.js.map +1 -1
- package/dist/renderer/runtime/context.d.ts +5 -5
- package/dist/renderer/runtime/context.d.ts.map +1 -1
- package/dist/renderer/runtime/context.js +11 -5
- package/dist/renderer/runtime/context.js.map +1 -1
- package/dist/renderer/runtime/describe.d.ts +3 -3
- package/dist/renderer/runtime/describe.d.ts.map +1 -1
- package/dist/renderer/runtime/describe.js +2 -2
- package/dist/renderer/runtime/describe.js.map +1 -1
- package/dist/renderer/runtime/hooks.d.ts.map +1 -1
- package/dist/renderer/runtime/hooks.js +8 -4
- package/dist/renderer/runtime/hooks.js.map +1 -1
- package/dist/renderer/runtime/index.d.ts +1 -0
- package/dist/renderer/runtime/index.d.ts.map +1 -1
- package/dist/renderer/runtime/index.js +1 -0
- package/dist/renderer/runtime/index.js.map +1 -1
- package/dist/renderer/runtime/locals.d.ts +57 -0
- package/dist/renderer/runtime/locals.d.ts.map +1 -0
- package/dist/renderer/runtime/locals.js +87 -0
- package/dist/renderer/runtime/locals.js.map +1 -0
- package/dist/renderer/runtime/scope.d.ts +14 -0
- package/dist/renderer/runtime/scope.d.ts.map +1 -1
- package/dist/renderer/runtime/scope.js +25 -3
- package/dist/renderer/runtime/scope.js.map +1 -1
- package/dist/renderer/runtime/tree.d.ts.map +1 -1
- package/dist/renderer/runtime/tree.js +7 -1
- package/dist/renderer/runtime/tree.js.map +1 -1
- package/dist/renderer/runtime/types.d.ts +8 -3
- package/dist/renderer/runtime/types.d.ts.map +1 -1
- package/dist/shadcn.d.ts +36 -43
- package/dist/shadcn.d.ts.map +1 -1
- package/dist/shadcn.js +1 -2
- package/dist/shadcn.js.map +1 -1
- package/dist/spec/bsx_v2.json +11067 -6321
- package/dist/spec/catalogs/{base@3.json → base@4.json} +434 -288
- package/dist/spec/catalogs/{base@3.json.js → base@4.json.js} +434 -288
- package/dist/spec/catalogs/orkestrator@1.json +10 -10
- package/dist/spec/catalogs/orkestrator@1.json.js +10 -10
- package/dist/spec/catalogs.d.ts +4 -4
- package/dist/spec/catalogs.d.ts.map +1 -1
- package/dist/spec/catalogs.js +7 -7
- package/dist/spec/catalogs.js.map +1 -1
- package/dist/spec/vocabulary.d.ts +25 -4
- package/dist/spec/vocabulary.d.ts.map +1 -1
- package/dist/spec/vocabulary.js +50 -5
- package/dist/spec/vocabulary.js.map +1 -1
- package/dist/spec/vocabulary.json +58 -32
- package/dist/spec/vocabulary.json.js +58 -32
- package/package.json +1 -1
- package/src/bsx/analyze.ts +14 -12
- package/src/bsx/bsx.test.ts +4 -4
- package/src/bsx/declared.ts +346 -0
- package/src/bsx/index.ts +1 -0
- package/src/bsx/infer.test.ts +42 -32
- package/src/bsx/infer.ts +128 -71
- package/src/bsx/language.test.ts +37 -25
- package/src/bsx/language.ts +72 -25
- package/src/bsx/parse.ts +34 -3
- package/src/bsx/print.ts +3 -0
- package/src/bsx/references.test.ts +82 -81
- package/src/bsx/references.ts +313 -178
- package/src/catalogs/catalogs.test.ts +3 -2
- package/src/catalogs/index.ts +1 -1
- package/src/catalogs/logo.ts +1 -2
- package/src/catalogs/parts/logo.ts +13 -17
- package/src/catalogs/parts/scene.ts +1 -7
- package/src/logo/actionLogoSource.ts +4 -4
- package/src/renderer/BlokComponentHost.test.tsx +5 -5
- package/src/renderer/BlokRenderer.tsx +46 -14
- package/src/renderer/addBlokComponents.test.tsx +1 -1
- package/src/renderer/baseCatalog.ts +2 -2
- package/src/renderer/bloks/control.tsx +119 -16
- package/src/renderer/bloks/logo/index.tsx +2 -3
- package/src/renderer/bloks/logo/logo.fixture.json +266 -250
- package/src/renderer/bloks/logo/logo.test.tsx +18 -7
- package/src/renderer/bloks/run/space.test.tsx +12 -4
- package/src/renderer/bloks/scene/interaction.tsx +11 -6
- package/src/renderer/bloks/scene/transform.test.ts +8 -7
- package/src/renderer/declarations.test.ts +38 -51
- package/src/renderer/declarations.ts +67 -88
- package/src/renderer/declare.test.ts +4 -4
- package/src/renderer/declare.ts +4 -4
- package/src/renderer/persist.test.ts +70 -49
- package/src/renderer/persist.ts +57 -34
- package/src/renderer/runtime/catalog.test.ts +2 -2
- package/src/renderer/runtime/catalog.ts +4 -4
- package/src/renderer/runtime/components.tsx +8 -8
- package/src/renderer/runtime/context.tsx +17 -10
- package/src/renderer/runtime/describe.ts +5 -5
- package/src/renderer/runtime/hooks.ts +6 -4
- package/src/renderer/runtime/index.ts +1 -0
- package/src/renderer/runtime/locals.tsx +105 -0
- package/src/renderer/runtime/scope.tsx +31 -3
- package/src/renderer/runtime/tree.tsx +16 -4
- package/src/renderer/runtime/types.ts +8 -3
- package/src/shadcn.ts +1 -2
- package/src/spec/bsx_v2.json +11067 -6321
- package/src/spec/catalogs/{base@3.json → base@4.json} +434 -288
- package/src/spec/catalogs/orkestrator@1.json +10 -10
- package/src/spec/catalogs.ts +8 -8
- package/src/spec/spec.test.ts +19 -16
- package/src/spec/vocabulary.json +58 -32
- package/src/spec/vocabulary.ts +69 -10
|
@@ -1,317 +1,333 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
|
-
"id": "
|
|
4
|
-
"component": "
|
|
3
|
+
"id": "Blok[0]",
|
|
4
|
+
"component": "Blok",
|
|
5
5
|
"props": [
|
|
6
6
|
{
|
|
7
|
-
"key": "
|
|
8
|
-
"static_value": "
|
|
7
|
+
"key": "kind",
|
|
8
|
+
"static_value": "agent"
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
|
-
"key": "
|
|
12
|
-
"static_value": "
|
|
11
|
+
"key": "context",
|
|
12
|
+
"static_value": "logo"
|
|
13
13
|
}
|
|
14
14
|
],
|
|
15
15
|
"children": [
|
|
16
16
|
{
|
|
17
|
-
"id": "
|
|
18
|
-
"component": "
|
|
17
|
+
"id": "Blok[0]/Logo[0]",
|
|
18
|
+
"component": "Logo",
|
|
19
|
+
"props": [
|
|
20
|
+
{
|
|
21
|
+
"key": "viewBox",
|
|
22
|
+
"static_value": "0 0 24 24"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"key": "title",
|
|
26
|
+
"static_value": "Microscope"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
19
29
|
"children": [
|
|
20
30
|
{
|
|
21
|
-
"id": "
|
|
22
|
-
"component": "
|
|
23
|
-
"props": [
|
|
24
|
-
{
|
|
25
|
-
"key": "x2",
|
|
26
|
-
"static_value": "1"
|
|
27
|
-
}
|
|
28
|
-
],
|
|
31
|
+
"id": "Blok[0]/Logo[0]/Defs[0]",
|
|
32
|
+
"component": "Defs",
|
|
29
33
|
"children": [
|
|
30
34
|
{
|
|
31
|
-
"id": "sky
|
|
32
|
-
"component": "
|
|
35
|
+
"id": "sky",
|
|
36
|
+
"component": "LinearGradient",
|
|
33
37
|
"props": [
|
|
34
38
|
{
|
|
35
|
-
"key": "
|
|
36
|
-
"static_value": "
|
|
39
|
+
"key": "x2",
|
|
40
|
+
"static_value": "1"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"children": [
|
|
44
|
+
{
|
|
45
|
+
"id": "sky/Stop[0]",
|
|
46
|
+
"component": "Stop",
|
|
47
|
+
"props": [
|
|
48
|
+
{
|
|
49
|
+
"key": "offset",
|
|
50
|
+
"static_value": "0"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"key": "stopColor",
|
|
54
|
+
"static_value": "info"
|
|
55
|
+
}
|
|
56
|
+
]
|
|
37
57
|
},
|
|
38
58
|
{
|
|
39
|
-
"
|
|
40
|
-
"
|
|
59
|
+
"id": "sky/Stop[1]",
|
|
60
|
+
"component": "Stop",
|
|
61
|
+
"props": [
|
|
62
|
+
{
|
|
63
|
+
"key": "offset",
|
|
64
|
+
"static_value": "1"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"key": "stopColor",
|
|
68
|
+
"static_value": "brand"
|
|
69
|
+
}
|
|
70
|
+
]
|
|
41
71
|
}
|
|
42
72
|
]
|
|
43
73
|
},
|
|
44
74
|
{
|
|
45
|
-
"id": "
|
|
46
|
-
"component": "
|
|
47
|
-
"
|
|
75
|
+
"id": "round",
|
|
76
|
+
"component": "ClipPath",
|
|
77
|
+
"children": [
|
|
48
78
|
{
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
79
|
+
"id": "round/Circle[0]",
|
|
80
|
+
"component": "Circle",
|
|
81
|
+
"props": [
|
|
82
|
+
{
|
|
83
|
+
"key": "cx",
|
|
84
|
+
"static_value": "12"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"key": "cy",
|
|
88
|
+
"static_value": "12"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"key": "r",
|
|
92
|
+
"static_value": "11"
|
|
93
|
+
}
|
|
94
|
+
]
|
|
55
95
|
}
|
|
56
96
|
]
|
|
57
97
|
}
|
|
58
98
|
]
|
|
59
99
|
},
|
|
60
100
|
{
|
|
61
|
-
"id": "
|
|
62
|
-
"component": "
|
|
101
|
+
"id": "Blok[0]/Logo[0]/G[0]",
|
|
102
|
+
"component": "G",
|
|
103
|
+
"props": [
|
|
104
|
+
{
|
|
105
|
+
"key": "clipPath",
|
|
106
|
+
"static_value": "url(#round)"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"key": "transform",
|
|
110
|
+
"static_value": "rotate(10 12 12)"
|
|
111
|
+
}
|
|
112
|
+
],
|
|
63
113
|
"children": [
|
|
64
114
|
{
|
|
65
|
-
"id": "
|
|
66
|
-
"component": "
|
|
115
|
+
"id": "Blok[0]/Logo[0]/G[0]/Rect[0]",
|
|
116
|
+
"component": "Rect",
|
|
67
117
|
"props": [
|
|
68
118
|
{
|
|
69
|
-
"key": "
|
|
70
|
-
"static_value": "
|
|
119
|
+
"key": "x",
|
|
120
|
+
"static_value": "0"
|
|
71
121
|
},
|
|
72
122
|
{
|
|
73
|
-
"key": "
|
|
74
|
-
"static_value": "
|
|
123
|
+
"key": "y",
|
|
124
|
+
"static_value": "0"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"key": "width",
|
|
128
|
+
"static_value": "24"
|
|
75
129
|
},
|
|
76
130
|
{
|
|
77
|
-
"key": "
|
|
78
|
-
"static_value": "
|
|
131
|
+
"key": "height",
|
|
132
|
+
"static_value": "24"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"key": "fill",
|
|
136
|
+
"static_value": "url(#sky)"
|
|
79
137
|
}
|
|
80
138
|
]
|
|
81
|
-
}
|
|
82
|
-
]
|
|
83
|
-
}
|
|
84
|
-
]
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"id": "AgentLogo[0]/G[0]",
|
|
88
|
-
"component": "G",
|
|
89
|
-
"props": [
|
|
90
|
-
{
|
|
91
|
-
"key": "clipPath",
|
|
92
|
-
"static_value": "url(#round)"
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"key": "transform",
|
|
96
|
-
"static_value": "rotate(10 12 12)"
|
|
97
|
-
}
|
|
98
|
-
],
|
|
99
|
-
"children": [
|
|
100
|
-
{
|
|
101
|
-
"id": "AgentLogo[0]/G[0]/Rect[0]",
|
|
102
|
-
"component": "Rect",
|
|
103
|
-
"props": [
|
|
104
|
-
{
|
|
105
|
-
"key": "x",
|
|
106
|
-
"static_value": "0"
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
"key": "y",
|
|
110
|
-
"static_value": "0"
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
"key": "width",
|
|
114
|
-
"static_value": "24"
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
"key": "height",
|
|
118
|
-
"static_value": "24"
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
"key": "fill",
|
|
122
|
-
"static_value": "url(#sky)"
|
|
123
|
-
}
|
|
124
|
-
]
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
"id": "AgentLogo[0]/G[0]/Path[0]",
|
|
128
|
-
"component": "Path",
|
|
129
|
-
"props": [
|
|
130
|
-
{
|
|
131
|
-
"key": "d",
|
|
132
|
-
"static_value": "M6 18 L12 4 L18 18 Z"
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
"key": "fill",
|
|
136
|
-
"static_value": "none"
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
"key": "stroke",
|
|
140
|
-
"static_value": "surface"
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
"key": "strokeWidth",
|
|
144
|
-
"static_value": "1.5"
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
"key": "strokeLinejoin",
|
|
148
|
-
"static_value": "round"
|
|
149
|
-
}
|
|
150
|
-
]
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
"id": "AgentLogo[0]/G[0]/Line[0]",
|
|
154
|
-
"component": "Line",
|
|
155
|
-
"props": [
|
|
156
|
-
{
|
|
157
|
-
"key": "x1",
|
|
158
|
-
"static_value": "4"
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
"key": "y1",
|
|
162
|
-
"static_value": "20"
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
"key": "x2",
|
|
166
|
-
"static_value": "20"
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
"key": "y2",
|
|
170
|
-
"static_value": "20"
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
"key": "stroke",
|
|
174
|
-
"static_value": "surface"
|
|
175
|
-
}
|
|
176
|
-
]
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
"id": "AgentLogo[0]/G[0]/Polygon[0]",
|
|
180
|
-
"component": "Polygon",
|
|
181
|
-
"props": [
|
|
182
|
-
{
|
|
183
|
-
"key": "points",
|
|
184
|
-
"static_value": "10,14 14,14 12,10"
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
"key": "fill",
|
|
188
|
-
"static_value": "surface"
|
|
189
|
-
}
|
|
190
|
-
]
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
"id": "AgentLogo[0]/G[0]/Polyline[0]",
|
|
194
|
-
"component": "Polyline",
|
|
195
|
-
"props": [
|
|
196
|
-
{
|
|
197
|
-
"key": "points",
|
|
198
|
-
"static_value": "2,2 4,4 6,2"
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
"key": "stroke",
|
|
202
|
-
"static_value": "surface"
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
"key": "fill",
|
|
206
|
-
"static_value": "none"
|
|
207
|
-
}
|
|
208
|
-
]
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
"id": "AgentLogo[0]/G[0]/Ellipse[0]",
|
|
212
|
-
"component": "Ellipse",
|
|
213
|
-
"props": [
|
|
214
|
-
{
|
|
215
|
-
"key": "cx",
|
|
216
|
-
"static_value": "12"
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
"key": "cy",
|
|
220
|
-
"static_value": "20"
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
"key": "rx",
|
|
224
|
-
"static_value": "6"
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
"key": "ry",
|
|
228
|
-
"static_value": "1"
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
"key": "fill",
|
|
232
|
-
"static_value": "ink"
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
"key": "fillOpacity",
|
|
236
|
-
"static_value": "0.3"
|
|
237
|
-
}
|
|
238
|
-
]
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
"id": "AgentLogo[0]/G[0]/SvgText[0]",
|
|
242
|
-
"component": "SvgText",
|
|
243
|
-
"props": [
|
|
244
|
-
{
|
|
245
|
-
"key": "text",
|
|
246
|
-
"static_value": "A"
|
|
247
|
-
},
|
|
248
|
-
{
|
|
249
|
-
"key": "x",
|
|
250
|
-
"static_value": "12"
|
|
251
139
|
},
|
|
252
140
|
{
|
|
253
|
-
"
|
|
254
|
-
"
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
141
|
+
"id": "Blok[0]/Logo[0]/G[0]/Path[0]",
|
|
142
|
+
"component": "Path",
|
|
143
|
+
"props": [
|
|
144
|
+
{
|
|
145
|
+
"key": "d",
|
|
146
|
+
"static_value": "M6 18 L12 4 L18 18 Z"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"key": "fill",
|
|
150
|
+
"static_value": "none"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"key": "stroke",
|
|
154
|
+
"static_value": "surface"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"key": "strokeWidth",
|
|
158
|
+
"static_value": "1.5"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"key": "strokeLinejoin",
|
|
162
|
+
"static_value": "round"
|
|
163
|
+
}
|
|
164
|
+
]
|
|
259
165
|
},
|
|
260
166
|
{
|
|
261
|
-
"
|
|
262
|
-
"
|
|
167
|
+
"id": "Blok[0]/Logo[0]/G[0]/Line[0]",
|
|
168
|
+
"component": "Line",
|
|
169
|
+
"props": [
|
|
170
|
+
{
|
|
171
|
+
"key": "x1",
|
|
172
|
+
"static_value": "4"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"key": "y1",
|
|
176
|
+
"static_value": "20"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"key": "x2",
|
|
180
|
+
"static_value": "20"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"key": "y2",
|
|
184
|
+
"static_value": "20"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"key": "stroke",
|
|
188
|
+
"static_value": "surface"
|
|
189
|
+
}
|
|
190
|
+
]
|
|
263
191
|
},
|
|
264
192
|
{
|
|
265
|
-
"
|
|
266
|
-
"
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
"path": "self.status.lamps"
|
|
278
|
-
}
|
|
193
|
+
"id": "Blok[0]/Logo[0]/G[0]/Polygon[0]",
|
|
194
|
+
"component": "Polygon",
|
|
195
|
+
"props": [
|
|
196
|
+
{
|
|
197
|
+
"key": "points",
|
|
198
|
+
"static_value": "10,14 14,14 12,10"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"key": "fill",
|
|
202
|
+
"static_value": "surface"
|
|
203
|
+
}
|
|
204
|
+
]
|
|
279
205
|
},
|
|
280
206
|
{
|
|
281
|
-
"
|
|
282
|
-
"
|
|
283
|
-
"
|
|
207
|
+
"id": "Blok[0]/Logo[0]/G[0]/Polyline[0]",
|
|
208
|
+
"component": "Polyline",
|
|
209
|
+
"props": [
|
|
210
|
+
{
|
|
211
|
+
"key": "points",
|
|
212
|
+
"static_value": "2,2 4,4 6,2"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"key": "stroke",
|
|
216
|
+
"static_value": "surface"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"key": "fill",
|
|
220
|
+
"static_value": "none"
|
|
221
|
+
}
|
|
222
|
+
]
|
|
284
223
|
},
|
|
285
224
|
{
|
|
286
|
-
"
|
|
287
|
-
"
|
|
288
|
-
"path": "lamp.name"
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
],
|
|
292
|
-
"children": [
|
|
293
|
-
{
|
|
294
|
-
"id": "AgentLogo[0]/G[0]/foreach[0]/Circle[0]",
|
|
295
|
-
"component": "Circle",
|
|
225
|
+
"id": "Blok[0]/Logo[0]/G[0]/Ellipse[0]",
|
|
226
|
+
"component": "Ellipse",
|
|
296
227
|
"props": [
|
|
297
228
|
{
|
|
298
229
|
"key": "cx",
|
|
299
|
-
"static_value": "
|
|
230
|
+
"static_value": "12"
|
|
300
231
|
},
|
|
301
232
|
{
|
|
302
233
|
"key": "cy",
|
|
234
|
+
"static_value": "20"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"key": "rx",
|
|
238
|
+
"static_value": "6"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"key": "ry",
|
|
242
|
+
"static_value": "1"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"key": "fill",
|
|
246
|
+
"static_value": "ink"
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"key": "fillOpacity",
|
|
250
|
+
"static_value": "0.3"
|
|
251
|
+
}
|
|
252
|
+
]
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"id": "Blok[0]/Logo[0]/G[0]/SvgText[0]",
|
|
256
|
+
"component": "SvgText",
|
|
257
|
+
"props": [
|
|
258
|
+
{
|
|
259
|
+
"key": "text",
|
|
260
|
+
"static_value": "A"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"key": "x",
|
|
264
|
+
"static_value": "12"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"key": "y",
|
|
268
|
+
"static_value": "13"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"key": "fontSize",
|
|
303
272
|
"static_value": "4"
|
|
304
273
|
},
|
|
305
274
|
{
|
|
306
|
-
"key": "
|
|
307
|
-
"static_value": "
|
|
275
|
+
"key": "textAnchor",
|
|
276
|
+
"static_value": "middle"
|
|
308
277
|
},
|
|
309
278
|
{
|
|
310
279
|
"key": "fill",
|
|
280
|
+
"static_value": "surface"
|
|
281
|
+
}
|
|
282
|
+
]
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"id": "Blok[0]/Logo[0]/G[0]/foreach[0]",
|
|
286
|
+
"component": "foreach",
|
|
287
|
+
"props": [
|
|
288
|
+
{
|
|
289
|
+
"key": "items",
|
|
290
|
+
"dynamic_value": {
|
|
291
|
+
"path": "self.status.lamps"
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"key": "let",
|
|
296
|
+
"static_value": "lamp",
|
|
297
|
+
"declares_value": "lamp"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"key": "key",
|
|
311
301
|
"dynamic_value": {
|
|
312
|
-
"path": "lamp.
|
|
302
|
+
"path": "lamp.name"
|
|
313
303
|
}
|
|
314
304
|
}
|
|
305
|
+
],
|
|
306
|
+
"children": [
|
|
307
|
+
{
|
|
308
|
+
"id": "Blok[0]/Logo[0]/G[0]/foreach[0]/Circle[0]",
|
|
309
|
+
"component": "Circle",
|
|
310
|
+
"props": [
|
|
311
|
+
{
|
|
312
|
+
"key": "cx",
|
|
313
|
+
"static_value": "20"
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
"key": "cy",
|
|
317
|
+
"static_value": "4"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"key": "r",
|
|
321
|
+
"static_value": "1.5"
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
"key": "fill",
|
|
325
|
+
"dynamic_value": {
|
|
326
|
+
"path": "lamp.pen"
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
]
|
|
330
|
+
}
|
|
315
331
|
]
|
|
316
332
|
}
|
|
317
333
|
]
|
|
@@ -10,7 +10,7 @@ import {renderBlokDocument, testCatalog} from '../testing';
|
|
|
10
10
|
import tree from './logo.fixture.json';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* `logo.fixture.json` is a v2 logo blok as it is stored: a gradient and a clip
|
|
13
|
+
* `logo.fixture.json` is a v2 logo blok as it is stored (`<Blok kind="agent" context="logo"><Logo>`): a gradient and a clip
|
|
14
14
|
* path referenced by id, every shape, text, and a keyed `foreach` over state
|
|
15
15
|
* drawing one lamp per item, all painted with the viewer's pens.
|
|
16
16
|
*/
|
|
@@ -44,7 +44,8 @@ describe('a v2 logo blok', () => {
|
|
|
44
44
|
'Path',
|
|
45
45
|
'Polygon',
|
|
46
46
|
'Polyline',
|
|
47
|
-
'
|
|
47
|
+
'Blok',
|
|
48
|
+
'Logo',
|
|
48
49
|
'Rect',
|
|
49
50
|
'Stop',
|
|
50
51
|
'SvgText',
|
|
@@ -106,7 +107,7 @@ describe('a v2 logo blok', () => {
|
|
|
106
107
|
renderBlokDocument(testCatalog(), [
|
|
107
108
|
{
|
|
108
109
|
id: 'logo',
|
|
109
|
-
component: '
|
|
110
|
+
component: 'Logo',
|
|
110
111
|
children: [
|
|
111
112
|
{id: 'ok', component: 'Circle', props: [{key: 'r', static_value: '2'}]},
|
|
112
113
|
{id: 'broken', component: 'Circle', props: [{key: 'r', util_call: {operation: 'no_such_function'}}]},
|
|
@@ -135,7 +136,7 @@ describe('paint', () => {
|
|
|
135
136
|
circle('colour', {fill: '#fbbf24'}),
|
|
136
137
|
circle('empty', {fill: 'none'}),
|
|
137
138
|
];
|
|
138
|
-
renderBlokDocument(testCatalog(), [{id: 'logo', component: '
|
|
139
|
+
renderBlokDocument(testCatalog(), [{id: 'logo', component: 'Logo', children: shapes}]);
|
|
139
140
|
|
|
140
141
|
const svg = document.querySelector('svg')!;
|
|
141
142
|
const fills = [...svg.querySelectorAll('circle')].map(shape => shape.getAttribute('fill'));
|
|
@@ -149,7 +150,7 @@ describe('paint', () => {
|
|
|
149
150
|
circle('green', {fill: 'spectrum-green', stroke: 'spectrum-violet'}),
|
|
150
151
|
circle('soft', {fill: 'spectrum-green-soft'}),
|
|
151
152
|
];
|
|
152
|
-
renderBlokDocument(testCatalog(), [{id: 'logo', component: '
|
|
153
|
+
renderBlokDocument(testCatalog(), [{id: 'logo', component: 'Logo', children: shapes}]);
|
|
153
154
|
|
|
154
155
|
const [green, soft] = [...document.querySelectorAll('svg circle')];
|
|
155
156
|
expect(green.getAttribute('fill')).toBe('var(--logo-spectrum-green)');
|
|
@@ -159,7 +160,17 @@ describe('paint', () => {
|
|
|
159
160
|
|
|
160
161
|
it('keeps an action logo a tree this catalog knows, its shapes placed under it', () => {
|
|
161
162
|
const preflight = preflightBlokDocument(
|
|
162
|
-
normalizeBlokComponentTree([
|
|
163
|
+
normalizeBlokComponentTree([
|
|
164
|
+
{
|
|
165
|
+
id: 'Blok[0]',
|
|
166
|
+
component: 'Blok',
|
|
167
|
+
props: [
|
|
168
|
+
{key: 'kind', static_value: 'action'},
|
|
169
|
+
{key: 'context', static_value: 'logo'},
|
|
170
|
+
],
|
|
171
|
+
children: [{id: 'action', component: 'Logo', children: [circle('c', {fill: 'brand'})]}],
|
|
172
|
+
},
|
|
173
|
+
]).roots,
|
|
163
174
|
testCatalog(),
|
|
164
175
|
);
|
|
165
176
|
expect(preflight.errors).toEqual([]);
|
|
@@ -171,7 +182,7 @@ describe('animate', () => {
|
|
|
171
182
|
renderBlokDocument(testCatalog(), [
|
|
172
183
|
{
|
|
173
184
|
id: 'action',
|
|
174
|
-
component: '
|
|
185
|
+
component: 'Logo',
|
|
175
186
|
children: [
|
|
176
187
|
circle('pulse', {animate: 'pulse', animateDelay: '0.3'}),
|
|
177
188
|
{id: 'trace', component: 'Path', props: [{key: 'd', static_value: 'M0 0h4'}, {key: 'animate', static_value: 'draw'}]},
|