@arkitektio/bsx 4.1.0 → 4.3.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/dist/bsx/references.d.ts.map +1 -1
- package/dist/bsx/references.js +28 -7
- package/dist/bsx/references.js.map +1 -1
- package/dist/catalogs/index.d.ts +83 -27
- package/dist/catalogs/index.d.ts.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 +35 -7
- package/dist/catalogs/parts/forms.d.ts.map +1 -1
- package/dist/catalogs/parts/forms.js +32 -0
- package/dist/catalogs/parts/forms.js.map +1 -1
- package/dist/catalogs/parts/icons.d.ts +2 -2
- package/dist/catalogs/parts/index.d.ts +63 -27
- package/dist/catalogs/parts/index.d.ts.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 +8 -0
- package/dist/catalogs/parts/run.d.ts.map +1 -1
- package/dist/catalogs/parts/scene.d.ts +8 -0
- package/dist/catalogs/parts/scene.d.ts.map +1 -1
- package/dist/catalogs/parts/scene.js +4 -0
- package/dist/catalogs/parts/scene.js.map +1 -1
- package/dist/catalogs/props.d.ts +1 -1
- package/dist/catalogs/scene.d.ts +8 -0
- package/dist/catalogs/scene.d.ts.map +1 -1
- package/dist/catalogs/shadcn.d.ts +59 -11
- package/dist/catalogs/shadcn.d.ts.map +1 -1
- package/dist/catalogs/shadcn.js +2 -0
- package/dist/catalogs/shadcn.js.map +1 -1
- package/dist/catalogs/ui.d.ts +16 -16
- package/dist/ports/dependencies/DependenciesContainer.d.ts +13 -8
- package/dist/ports/dependencies/DependenciesContainer.d.ts.map +1 -1
- package/dist/ports/dependencies/DependenciesContainer.js +130 -118
- package/dist/ports/dependencies/DependenciesContainer.js.map +1 -1
- package/dist/ports/dependencies/DependencyTreeNotice.d.ts +3 -2
- package/dist/ports/dependencies/DependencyTreeNotice.d.ts.map +1 -1
- package/dist/ports/dependencies/DependencyTreeNotice.js +7 -6
- package/dist/ports/dependencies/DependencyTreeNotice.js.map +1 -1
- package/dist/ports/dependencies/tree.d.ts +24 -0
- package/dist/ports/dependencies/tree.d.ts.map +1 -1
- package/dist/ports/dependencies/tree.js +52 -0
- package/dist/ports/dependencies/tree.js.map +1 -1
- package/dist/ports/dependencies/useDependencyTree.d.ts +5 -0
- package/dist/ports/dependencies/useDependencyTree.d.ts.map +1 -1
- package/dist/ports/dependencies/useDependencyTree.js +11 -5
- package/dist/ports/dependencies/useDependencyTree.js.map +1 -1
- package/dist/renderer/BlokRenderer.d.ts +4 -1
- package/dist/renderer/BlokRenderer.d.ts.map +1 -1
- package/dist/renderer/BlokRenderer.js +5 -1
- package/dist/renderer/BlokRenderer.js.map +1 -1
- package/dist/renderer/bloks/control.d.ts +12 -0
- package/dist/renderer/bloks/control.d.ts.map +1 -1
- package/dist/renderer/bloks/control.js +92 -5
- 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 +31 -7
- package/dist/renderer/bloks/forms.d.ts.map +1 -1
- package/dist/renderer/bloks/forms.js +56 -0
- package/dist/renderer/bloks/forms.js.map +1 -1
- package/dist/renderer/bloks/icons.d.ts +1 -1
- package/dist/renderer/bloks/index.d.ts +51 -27
- package/dist/renderer/bloks/index.d.ts.map +1 -1
- 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 +4 -0
- package/dist/renderer/bloks/run/components.d.ts.map +1 -1
- package/dist/renderer/bloks/run/host.d.ts +32 -3
- package/dist/renderer/bloks/run/host.d.ts.map +1 -1
- package/dist/renderer/bloks/run/host.js.map +1 -1
- package/dist/renderer/bloks/scene/index.d.ts +4 -0
- package/dist/renderer/bloks/scene/index.d.ts.map +1 -1
- package/dist/renderer/functions/v2/index.d.ts.map +1 -1
- package/dist/renderer/functions/v2/index.js +39 -0
- package/dist/renderer/functions/v2/index.js.map +1 -1
- package/dist/renderer/runtime/context.d.ts +2 -0
- package/dist/renderer/runtime/context.d.ts.map +1 -1
- package/dist/renderer/runtime/context.js +4 -0
- package/dist/renderer/runtime/context.js.map +1 -1
- package/dist/renderer/runtime/hooks.d.ts.map +1 -1
- package/dist/renderer/runtime/hooks.js +1 -0
- package/dist/renderer/runtime/hooks.js.map +1 -1
- package/dist/renderer/runtime/resolution.d.ts +2 -0
- package/dist/renderer/runtime/resolution.d.ts.map +1 -1
- package/dist/renderer/runtime/resolution.js +17 -1
- package/dist/renderer/runtime/resolution.js.map +1 -1
- package/dist/renderer/runtime/schemas.d.ts +5 -5
- package/dist/renderer/runtime/task.d.ts +25 -2
- package/dist/renderer/runtime/task.d.ts.map +1 -1
- package/dist/renderer/runtime/task.js +11 -2
- package/dist/renderer/runtime/task.js.map +1 -1
- package/dist/renderer/runtime/types.d.ts +7 -2
- package/dist/renderer/runtime/types.d.ts.map +1 -1
- package/dist/shadcn.d.ts +51 -27
- package/dist/shadcn.d.ts.map +1 -1
- package/dist/shadcn.js +2 -0
- package/dist/shadcn.js.map +1 -1
- package/dist/spec/bsx_v2.json +64 -0
- package/dist/spec/catalogs/base@2.json +136 -3
- package/dist/spec/catalogs/base@2.json.js +136 -3
- package/dist/spec/catalogs/scene@1.json +20 -0
- package/dist/spec/catalogs/scene@1.json.js +20 -0
- package/dist/spec/catalogs/shadcn@1.json +142 -0
- package/dist/spec/catalogs/shadcn@1.json.js +142 -0
- package/dist/spec/vocabulary.d.ts +2 -0
- package/dist/spec/vocabulary.d.ts.map +1 -1
- package/dist/spec/vocabulary.js +1 -0
- package/dist/spec/vocabulary.js.map +1 -1
- package/dist/spec/vocabulary.json +43 -11
- package/dist/spec/vocabulary.json.js +43 -11
- package/package.json +1 -1
- package/src/bsx/language.test.ts +1 -1
- package/src/bsx/references.test.ts +59 -0
- package/src/bsx/references.ts +28 -7
- package/src/catalogs/parts/forms.ts +32 -0
- package/src/catalogs/parts/scene.ts +6 -0
- package/src/catalogs/shadcn.ts +2 -0
- package/src/ports/dependencies/DependenciesContainer.test.tsx +176 -0
- package/src/ports/dependencies/DependenciesContainer.tsx +341 -304
- package/src/ports/dependencies/DependencyTreeNotice.tsx +7 -15
- package/src/ports/dependencies/tree.test.ts +75 -0
- package/src/ports/dependencies/tree.ts +54 -0
- package/src/ports/dependencies/useDependencyTree.test.tsx +55 -0
- package/src/ports/dependencies/useDependencyTree.ts +11 -5
- package/src/renderer/BlokRenderer.tsx +9 -0
- package/src/renderer/bloks/control.tsx +116 -5
- package/src/renderer/bloks/forms.tsx +126 -0
- package/src/renderer/bloks/run/host.tsx +33 -3
- package/src/renderer/bloks/run/space.test.tsx +76 -0
- package/src/renderer/functions/v2/functions.test.ts +40 -1
- package/src/renderer/functions/v2/index.ts +47 -0
- package/src/renderer/runtime/context.tsx +6 -0
- package/src/renderer/runtime/hooks.ts +1 -0
- package/src/renderer/runtime/resolution.test.ts +14 -0
- package/src/renderer/runtime/resolution.ts +15 -1
- package/src/renderer/runtime/task.ts +33 -4
- package/src/renderer/runtime/types.ts +7 -2
- package/src/shadcn.ts +2 -0
- package/src/spec/bsx_v2.json +64 -0
- package/src/spec/catalogs/base@2.json +136 -3
- package/src/spec/catalogs/scene@1.json +20 -0
- package/src/spec/catalogs/shadcn@1.json +142 -0
- package/src/spec/spec.test.ts +20 -0
- package/src/spec/vocabulary.json +43 -11
- package/src/spec/vocabulary.ts +3 -0
|
@@ -15,11 +15,41 @@
|
|
|
15
15
|
"Html"
|
|
16
16
|
],
|
|
17
17
|
"text_prop": null,
|
|
18
|
-
"props": [
|
|
18
|
+
"props": [
|
|
19
|
+
{
|
|
20
|
+
"key": "chrome",
|
|
21
|
+
"kind": "STRING",
|
|
22
|
+
"required": false,
|
|
23
|
+
"description": "What the host draws around the blok of its own: `auto` (the default) adds what the blok does not place (the time slider, the open ask, the rest of the argument form, its buttons); `none` adds nothing, the blok places what it wants.",
|
|
24
|
+
"values": [
|
|
25
|
+
"auto",
|
|
26
|
+
"none"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "arg",
|
|
33
|
+
"description": "One argument of the run an assign blok starts, as its port draws it; `<args />` then leaves it out. Draws nothing for an argument the caller gave: it is locked. An assign blok only.",
|
|
34
|
+
"context": "HTML",
|
|
35
|
+
"children_context": null,
|
|
36
|
+
"inherits_context": false,
|
|
37
|
+
"accepts_children": false,
|
|
38
|
+
"downstream_of": [],
|
|
39
|
+
"not_downstream_of": [],
|
|
40
|
+
"text_prop": null,
|
|
41
|
+
"props": [
|
|
42
|
+
{
|
|
43
|
+
"key": "key",
|
|
44
|
+
"kind": "STRING",
|
|
45
|
+
"required": true,
|
|
46
|
+
"description": "The port key of the argument."
|
|
47
|
+
}
|
|
48
|
+
]
|
|
19
49
|
},
|
|
20
50
|
{
|
|
21
51
|
"name": "args",
|
|
22
|
-
"description": "The arguments of the run an assign blok starts, as the form the action's ports generate: filled in right here, and read as `args.<key>`. Without it the host shows the form beside the blok. An assign blok only.",
|
|
52
|
+
"description": "The arguments of the run an assign blok starts, as the form the action's ports generate: filled in right here, and read as `args.<key>`. It draws the rest: every argument the caller did not give (`assign.given.<key>`) and no `<arg />` places. Without it the host shows the form beside the blok. An assign blok only.",
|
|
23
53
|
"context": "HTML",
|
|
24
54
|
"children_context": null,
|
|
25
55
|
"inherits_context": false,
|
|
@@ -27,7 +57,30 @@
|
|
|
27
57
|
"downstream_of": [],
|
|
28
58
|
"not_downstream_of": [],
|
|
29
59
|
"text_prop": null,
|
|
30
|
-
"props": [
|
|
60
|
+
"props": [
|
|
61
|
+
{
|
|
62
|
+
"key": "only",
|
|
63
|
+
"kind": "ANY",
|
|
64
|
+
"required": false,
|
|
65
|
+
"description": "Only these port keys: a list, or one string with spaces between."
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"key": "omit",
|
|
69
|
+
"kind": "ANY",
|
|
70
|
+
"required": false,
|
|
71
|
+
"description": "Not these port keys."
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"key": "given",
|
|
75
|
+
"kind": "STRING",
|
|
76
|
+
"required": false,
|
|
77
|
+
"description": "What to do with the arguments the caller gave: `hide` leaves them out (the default), `show` lists them, locked.",
|
|
78
|
+
"values": [
|
|
79
|
+
"hide",
|
|
80
|
+
"show"
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
]
|
|
31
84
|
},
|
|
32
85
|
{
|
|
33
86
|
"name": "ask",
|
|
@@ -76,6 +129,37 @@
|
|
|
76
129
|
"text_prop": null,
|
|
77
130
|
"props": []
|
|
78
131
|
},
|
|
132
|
+
{
|
|
133
|
+
"name": "dep",
|
|
134
|
+
"description": "The picker of one dependency of the run an assign blok starts; `<deps />` then leaves it out. An assign blok only.",
|
|
135
|
+
"context": "HTML",
|
|
136
|
+
"children_context": null,
|
|
137
|
+
"inherits_context": false,
|
|
138
|
+
"accepts_children": false,
|
|
139
|
+
"downstream_of": [],
|
|
140
|
+
"not_downstream_of": [],
|
|
141
|
+
"text_prop": null,
|
|
142
|
+
"props": [
|
|
143
|
+
{
|
|
144
|
+
"key": "key",
|
|
145
|
+
"kind": "STRING",
|
|
146
|
+
"required": true,
|
|
147
|
+
"description": "The dependency key."
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"name": "deps",
|
|
153
|
+
"description": "The picker of the agents the run an assign blok starts would get: every dependency no `<dep />` places. Without it the host shows the picker beside the blok. An assign blok only.",
|
|
154
|
+
"context": "HTML",
|
|
155
|
+
"children_context": null,
|
|
156
|
+
"inherits_context": false,
|
|
157
|
+
"accepts_children": false,
|
|
158
|
+
"downstream_of": [],
|
|
159
|
+
"not_downstream_of": [],
|
|
160
|
+
"text_prop": null,
|
|
161
|
+
"props": []
|
|
162
|
+
},
|
|
79
163
|
{
|
|
80
164
|
"name": "else",
|
|
81
165
|
"description": "A branch of its `if`: an else-if with `when`, the default without. Only the last `else` may go without `when`.",
|
|
@@ -206,6 +290,43 @@
|
|
|
206
290
|
}
|
|
207
291
|
]
|
|
208
292
|
},
|
|
293
|
+
{
|
|
294
|
+
"name": "returns",
|
|
295
|
+
"description": "What the task this blok is about returned, as the action's return ports show it (an image as an image, a table as a table). Shows nothing before the first yield. A blok with a `task` only.",
|
|
296
|
+
"context": "HTML",
|
|
297
|
+
"children_context": null,
|
|
298
|
+
"inherits_context": false,
|
|
299
|
+
"accepts_children": false,
|
|
300
|
+
"downstream_of": [],
|
|
301
|
+
"not_downstream_of": [],
|
|
302
|
+
"text_prop": null,
|
|
303
|
+
"props": [
|
|
304
|
+
{
|
|
305
|
+
"key": "only",
|
|
306
|
+
"kind": "ANY",
|
|
307
|
+
"required": false,
|
|
308
|
+
"description": "Only these return port keys: a list, or one string with spaces between."
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"key": "omit",
|
|
312
|
+
"kind": "ANY",
|
|
313
|
+
"required": false,
|
|
314
|
+
"description": "Not these return port keys."
|
|
315
|
+
}
|
|
316
|
+
]
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"name": "status",
|
|
320
|
+
"description": "Where the task this blok is about stands, as one line the host draws: its state, how long it took, what it last said. A blok with a `task` only.",
|
|
321
|
+
"context": "HTML",
|
|
322
|
+
"children_context": null,
|
|
323
|
+
"inherits_context": false,
|
|
324
|
+
"accepts_children": false,
|
|
325
|
+
"downstream_of": [],
|
|
326
|
+
"not_downstream_of": [],
|
|
327
|
+
"text_prop": null,
|
|
328
|
+
"props": []
|
|
329
|
+
},
|
|
209
330
|
{
|
|
210
331
|
"name": "suspense",
|
|
211
332
|
"description": "A boundary: while any read inside is pending it shows its `fallback`, when one failed its `error` (with the error as `error`); stale values render, dimmed. The nearest boundary catches.",
|
|
@@ -217,6 +338,18 @@
|
|
|
217
338
|
"not_downstream_of": [],
|
|
218
339
|
"text_prop": null,
|
|
219
340
|
"props": []
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"name": "timeline",
|
|
344
|
+
"description": "The time slider of what the blok shows (the run of its task, or the history of its agents): dragging it shows the whole blok as it was at that moment. Shows nothing where the host has no clock. Without it the host shows its own slider beside the blok.",
|
|
345
|
+
"context": "HTML",
|
|
346
|
+
"children_context": null,
|
|
347
|
+
"inherits_context": false,
|
|
348
|
+
"accepts_children": false,
|
|
349
|
+
"downstream_of": [],
|
|
350
|
+
"not_downstream_of": [],
|
|
351
|
+
"text_prop": null,
|
|
352
|
+
"props": []
|
|
220
353
|
}
|
|
221
354
|
]
|
|
222
355
|
}
|
|
@@ -669,6 +669,16 @@
|
|
|
669
669
|
"top"
|
|
670
670
|
]
|
|
671
671
|
},
|
|
672
|
+
{
|
|
673
|
+
"key": "chrome",
|
|
674
|
+
"kind": "STRING",
|
|
675
|
+
"required": false,
|
|
676
|
+
"description": "What the host draws around the blok of its own: `auto` (the default) adds what the blok does not place (the time slider, the open ask, the rest of the argument form, its buttons); `none` adds nothing, the blok places what it wants.",
|
|
677
|
+
"values": [
|
|
678
|
+
"auto",
|
|
679
|
+
"none"
|
|
680
|
+
]
|
|
681
|
+
},
|
|
672
682
|
{
|
|
673
683
|
"key": "grid",
|
|
674
684
|
"kind": "BOOL",
|
|
@@ -715,6 +725,16 @@
|
|
|
715
725
|
"top"
|
|
716
726
|
]
|
|
717
727
|
},
|
|
728
|
+
{
|
|
729
|
+
"key": "chrome",
|
|
730
|
+
"kind": "STRING",
|
|
731
|
+
"required": false,
|
|
732
|
+
"description": "What the host draws around the blok of its own: `auto` (the default) adds what the blok does not place (the time slider, the open ask, the rest of the argument form, its buttons); `none` adds nothing, the blok places what it wants.",
|
|
733
|
+
"values": [
|
|
734
|
+
"auto",
|
|
735
|
+
"none"
|
|
736
|
+
]
|
|
737
|
+
},
|
|
718
738
|
{
|
|
719
739
|
"key": "grid",
|
|
720
740
|
"kind": "BOOL",
|
|
@@ -1253,6 +1253,86 @@
|
|
|
1253
1253
|
}
|
|
1254
1254
|
]
|
|
1255
1255
|
},
|
|
1256
|
+
{
|
|
1257
|
+
"name": "Combobox",
|
|
1258
|
+
"description": "A select with a search field: for a list too long to scan.",
|
|
1259
|
+
"context": "HTML",
|
|
1260
|
+
"children_context": null,
|
|
1261
|
+
"inherits_context": false,
|
|
1262
|
+
"accepts_children": false,
|
|
1263
|
+
"downstream_of": [],
|
|
1264
|
+
"not_downstream_of": [],
|
|
1265
|
+
"text_prop": null,
|
|
1266
|
+
"props": [
|
|
1267
|
+
{
|
|
1268
|
+
"key": "bind",
|
|
1269
|
+
"kind": "STRING",
|
|
1270
|
+
"required": false,
|
|
1271
|
+
"description": "Data-model path holding the picked value. It writes a STRING: the local is a STRING, ENUM or DATE port."
|
|
1272
|
+
},
|
|
1273
|
+
{
|
|
1274
|
+
"key": "className",
|
|
1275
|
+
"kind": "STRING",
|
|
1276
|
+
"required": false,
|
|
1277
|
+
"description": "Extra Tailwind classes appended to the element."
|
|
1278
|
+
},
|
|
1279
|
+
{
|
|
1280
|
+
"key": "defaultValue",
|
|
1281
|
+
"kind": "ANY",
|
|
1282
|
+
"required": false,
|
|
1283
|
+
"description": "Initial value."
|
|
1284
|
+
},
|
|
1285
|
+
{
|
|
1286
|
+
"key": "disabled",
|
|
1287
|
+
"kind": "BOOL",
|
|
1288
|
+
"required": false,
|
|
1289
|
+
"description": "Disables the control."
|
|
1290
|
+
},
|
|
1291
|
+
{
|
|
1292
|
+
"key": "emptyText",
|
|
1293
|
+
"kind": "ANY",
|
|
1294
|
+
"required": false,
|
|
1295
|
+
"description": "Shown when typing matches nothing."
|
|
1296
|
+
},
|
|
1297
|
+
{
|
|
1298
|
+
"key": "onChange",
|
|
1299
|
+
"kind": "CALLBACK",
|
|
1300
|
+
"required": false,
|
|
1301
|
+
"description": "Runs on selection. Arguments may read event.value.",
|
|
1302
|
+
"event": [
|
|
1303
|
+
{
|
|
1304
|
+
"key": "value",
|
|
1305
|
+
"kind": "STRING",
|
|
1306
|
+
"description": "The value picked."
|
|
1307
|
+
}
|
|
1308
|
+
]
|
|
1309
|
+
},
|
|
1310
|
+
{
|
|
1311
|
+
"key": "options",
|
|
1312
|
+
"kind": "LIST",
|
|
1313
|
+
"required": false,
|
|
1314
|
+
"description": "What can be picked: strings, or `{value, label}` objects. Typing narrows them."
|
|
1315
|
+
},
|
|
1316
|
+
{
|
|
1317
|
+
"key": "placeholder",
|
|
1318
|
+
"kind": "ANY",
|
|
1319
|
+
"required": false,
|
|
1320
|
+
"description": "Shown while nothing is picked."
|
|
1321
|
+
},
|
|
1322
|
+
{
|
|
1323
|
+
"key": "searchPlaceholder",
|
|
1324
|
+
"kind": "ANY",
|
|
1325
|
+
"required": false,
|
|
1326
|
+
"description": "Shown in the search field."
|
|
1327
|
+
},
|
|
1328
|
+
{
|
|
1329
|
+
"key": "value",
|
|
1330
|
+
"kind": "ANY",
|
|
1331
|
+
"required": false,
|
|
1332
|
+
"description": "Controlled value."
|
|
1333
|
+
}
|
|
1334
|
+
]
|
|
1335
|
+
},
|
|
1256
1336
|
{
|
|
1257
1337
|
"name": "ContextMenu",
|
|
1258
1338
|
"description": "A menu opened by right-clicking its trigger.",
|
|
@@ -1612,6 +1692,68 @@
|
|
|
1612
1692
|
}
|
|
1613
1693
|
]
|
|
1614
1694
|
},
|
|
1695
|
+
{
|
|
1696
|
+
"name": "DatePicker",
|
|
1697
|
+
"description": "A button that opens a calendar and shows the date picked.",
|
|
1698
|
+
"context": "HTML",
|
|
1699
|
+
"children_context": null,
|
|
1700
|
+
"inherits_context": false,
|
|
1701
|
+
"accepts_children": false,
|
|
1702
|
+
"downstream_of": [],
|
|
1703
|
+
"not_downstream_of": [],
|
|
1704
|
+
"text_prop": null,
|
|
1705
|
+
"props": [
|
|
1706
|
+
{
|
|
1707
|
+
"key": "bind",
|
|
1708
|
+
"kind": "STRING",
|
|
1709
|
+
"required": false,
|
|
1710
|
+
"description": "Data-model path holding an ISO date string (YYYY-MM-DD). It writes a STRING: the local is a STRING, ENUM or DATE port."
|
|
1711
|
+
},
|
|
1712
|
+
{
|
|
1713
|
+
"key": "className",
|
|
1714
|
+
"kind": "STRING",
|
|
1715
|
+
"required": false,
|
|
1716
|
+
"description": "Extra Tailwind classes appended to the element."
|
|
1717
|
+
},
|
|
1718
|
+
{
|
|
1719
|
+
"key": "defaultValue",
|
|
1720
|
+
"kind": "ANY",
|
|
1721
|
+
"required": false,
|
|
1722
|
+
"description": "Initial ISO date."
|
|
1723
|
+
},
|
|
1724
|
+
{
|
|
1725
|
+
"key": "disabled",
|
|
1726
|
+
"kind": "BOOL",
|
|
1727
|
+
"required": false,
|
|
1728
|
+
"description": "Disables the control."
|
|
1729
|
+
},
|
|
1730
|
+
{
|
|
1731
|
+
"key": "onChange",
|
|
1732
|
+
"kind": "CALLBACK",
|
|
1733
|
+
"required": false,
|
|
1734
|
+
"description": "Runs on selection. Arguments may read event.value.",
|
|
1735
|
+
"event": [
|
|
1736
|
+
{
|
|
1737
|
+
"key": "value",
|
|
1738
|
+
"kind": "STRING",
|
|
1739
|
+
"description": "The date picked, as an ISO date (YYYY-MM-DD)."
|
|
1740
|
+
}
|
|
1741
|
+
]
|
|
1742
|
+
},
|
|
1743
|
+
{
|
|
1744
|
+
"key": "placeholder",
|
|
1745
|
+
"kind": "ANY",
|
|
1746
|
+
"required": false,
|
|
1747
|
+
"description": "Shown while no date is picked."
|
|
1748
|
+
},
|
|
1749
|
+
{
|
|
1750
|
+
"key": "value",
|
|
1751
|
+
"kind": "ANY",
|
|
1752
|
+
"required": false,
|
|
1753
|
+
"description": "Controlled ISO date."
|
|
1754
|
+
}
|
|
1755
|
+
]
|
|
1756
|
+
},
|
|
1615
1757
|
{
|
|
1616
1758
|
"name": "Drawer",
|
|
1617
1759
|
"description": "A panel that slides up from the bottom edge.",
|
package/src/spec/spec.test.ts
CHANGED
|
@@ -85,3 +85,23 @@ describe('the catalog view', () => {
|
|
|
85
85
|
expect(table).toEqual(corpus.text_table);
|
|
86
86
|
});
|
|
87
87
|
});
|
|
88
|
+
|
|
89
|
+
describe('what a blok may do', () => {
|
|
90
|
+
it('is pure, or one effect: a command on a task, or something only the viewer sees', () => {
|
|
91
|
+
const functions = [...loadVocabulary().functions.values()];
|
|
92
|
+
const effects = functions.filter(fn => fn.effect);
|
|
93
|
+
// A command is always an effect, never something an expression may compute with.
|
|
94
|
+
expect(functions.filter(fn => fn.command && !fn.effect)).toEqual([]);
|
|
95
|
+
expect(effects.filter(fn => fn.command).map(fn => fn.name).sort()).toEqual([
|
|
96
|
+
'assign.start',
|
|
97
|
+
'task.answer',
|
|
98
|
+
'task.cancel',
|
|
99
|
+
'task.interrupt',
|
|
100
|
+
'task.pause',
|
|
101
|
+
'task.resume',
|
|
102
|
+
'task.step',
|
|
103
|
+
]);
|
|
104
|
+
// What is left changes nothing but the viewer's own screen and clipboard.
|
|
105
|
+
expect(effects.filter(fn => !fn.command).map(fn => fn.name).sort()).toEqual(['query.fetch_more', 'query.refetch', 'ui.copy']);
|
|
106
|
+
});
|
|
107
|
+
});
|
package/src/spec/vocabulary.json
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"subscriptions": "subscriptions.<name>: a declared subscription's record (status, value, error); value is the latest payload, or the last `keep` payloads.",
|
|
10
10
|
"args": "args.<key>: what the blok is opened on: the item for an agent or custom blok, the task's args for a task or action blok.",
|
|
11
11
|
"task": "The task this blok is about: the sending task, or the run. A task record.",
|
|
12
|
+
"assign": "The run an assign blok prepares: assign.given.<key> (true for an argument the caller decided, which is locked), assign.missing (the keys of required arguments still empty) and assign.ready (nothing is missing).",
|
|
12
13
|
"event": "The payload a component hands its callback. Only inside a callback.",
|
|
13
14
|
"viewer": "{user, org, roles} of whoever is looking.",
|
|
14
15
|
"then": "The moment being viewed while time-travelling (an ISO 8601 datetime), null while live. A blok never reads the wall clock: a query passes then as an ordinary variable (variables={at: \"then\"}), <Time> measures relative time from it, and while it is set subscriptions pause (their history query, or the value at travel start, stale)."
|
|
@@ -20,13 +21,13 @@
|
|
|
20
21
|
"functions": ["cmp", "logic", "math", "str", "list", "obj", "val", "fmt", "time", "ui", "query"],
|
|
21
22
|
"future": ["mutations"]
|
|
22
23
|
},
|
|
23
|
-
"reserved": ["self", "deps", "queries", "subscriptions", "args", "task", "event", "viewer", "then", "error", "cmp", "logic", "math", "str", "list", "obj", "val", "fmt", "time", "ui", "query", "mutations"],
|
|
24
|
+
"reserved": ["self", "deps", "queries", "subscriptions", "args", "task", "assign", "event", "viewer", "then", "error", "cmp", "logic", "math", "str", "list", "obj", "val", "fmt", "time", "ui", "query", "mutations"],
|
|
24
25
|
"agent_segments": {
|
|
25
26
|
"description": "What follows an agent (self or deps.<key>): .<state>.<field> is state, .tasks.<action> the latest task of that action, .assets.<name> one of the agent's assets; deps.<key>.<action>(...) calls it.",
|
|
26
27
|
"tasks": "tasks",
|
|
27
28
|
"assets": "assets",
|
|
28
|
-
"fields": {"id": "The agent's id (a query variable: deps.robot.id).", "name": "The agent's name."},
|
|
29
|
-
"reserved_state_names": ["tasks", "assets", "id", "name"]
|
|
29
|
+
"fields": {"id": "The agent's id (a query variable: deps.robot.id).", "name": "The agent's name.", "connected": "Whether the agent is connected right now (true or false)."},
|
|
30
|
+
"reserved_state_names": ["tasks", "assets", "id", "name", "connected"]
|
|
30
31
|
},
|
|
31
32
|
"kinds": {
|
|
32
33
|
"agent": {
|
|
@@ -55,7 +56,7 @@
|
|
|
55
56
|
},
|
|
56
57
|
"assign": {
|
|
57
58
|
"description": "An action's own blok for starting a run of it (assign_bloks): shown before there is a task, with the arguments being filled in as args and the agents a run would get as deps.",
|
|
58
|
-
"roots": ["self", "deps", "args", "queries", "subscriptions", "viewer"],
|
|
59
|
+
"roots": ["self", "deps", "args", "assign", "queries", "subscriptions", "viewer"],
|
|
59
60
|
"locals": true,
|
|
60
61
|
"contexts": ["HTML", "SCENE"]
|
|
61
62
|
},
|
|
@@ -80,8 +81,9 @@
|
|
|
80
81
|
"description": "One shape for task, deps.<key>.tasks.<action>, self.tasks.<action> and every into name.",
|
|
81
82
|
"fields": [
|
|
82
83
|
{"key": "id", "kind": "STRING", "nullable": true, "description": "The task's id; null before it was started."},
|
|
83
|
-
{"key": "status", "kind": "STRING", "choices": ["idle", "queued", "running", "asking", "done", "failed", "cancelled"], "description": "Lowercase."},
|
|
84
|
-
{"key": "running", "kind": "BOOL", "description": "queued, running or
|
|
84
|
+
{"key": "status", "kind": "STRING", "choices": ["idle", "queued", "running", "asking", "paused", "done", "failed", "cancelled"], "description": "Lowercase."},
|
|
85
|
+
{"key": "running", "kind": "BOOL", "description": "Started and not ended: queued, running, asking or paused."},
|
|
86
|
+
{"key": "paused", "kind": "BOOL", "description": "Waiting for someone to resume it."},
|
|
85
87
|
{"key": "done", "kind": "BOOL"},
|
|
86
88
|
{"key": "failed", "kind": "BOOL"},
|
|
87
89
|
{"key": "progress", "kind": "INT", "description": "0 to 100."},
|
|
@@ -90,9 +92,14 @@
|
|
|
90
92
|
{"key": "args", "kind": "DICT", "description": "What it was called with, filled in by the renderer at dispatch."},
|
|
91
93
|
{"key": "ask", "kind": "DICT", "nullable": true, "children": [{"key": "question", "kind": "STRING"}, {"key": "form", "kind": "DICT"}], "description": "The open ask, or null."},
|
|
92
94
|
{"key": "answer", "kind": "DICT", "nullable": true, "description": "The values returned for the ask."},
|
|
93
|
-
{"key": "returns", "kind": "DICT", "description": "The latest yield, by return port key."}
|
|
95
|
+
{"key": "returns", "kind": "DICT", "description": "The latest yield, by return port key."},
|
|
96
|
+
{"key": "started_at", "kind": "STRING", "nullable": true, "description": "When it was started (an ISO 8601 datetime); null before."},
|
|
97
|
+
{"key": "ended_at", "kind": "STRING", "nullable": true, "description": "When it ended; null while it has not."},
|
|
98
|
+
{"key": "duration", "kind": "FLOAT", "nullable": true, "description": "Seconds from start to end; null while it has not ended (a blok never reads the wall clock: <Time> measures a running task)."},
|
|
99
|
+
{"key": "log", "kind": "LIST", "children": [{"key": "...", "kind": "DICT", "children": [{"key": "at", "kind": "STRING", "nullable": true}, {"key": "kind", "kind": "STRING"}, {"key": "message", "kind": "STRING", "nullable": true}]}], "description": "What it reported, oldest first: {at, kind, message} per entry, the latest hundred."},
|
|
100
|
+
{"key": "can", "kind": "DICT", "children": [{"key": "cancel", "kind": "BOOL"}, {"key": "pause", "kind": "BOOL"}, {"key": "resume", "kind": "BOOL"}, {"key": "step", "kind": "BOOL"}, {"key": "interrupt", "kind": "BOOL"}], "description": "What the viewer may do to the task right now: can.cancel says whether task.cancel() would be taken, and so on. All false for a record the blok started itself (an into name)."}
|
|
94
101
|
],
|
|
95
|
-
"idle": {"id": null, "status": "idle", "running": false, "done": false, "failed": false, "progress": 0, "message": null, "error": null, "args": {}, "ask": null, "answer": null, "returns": {}}
|
|
102
|
+
"idle": {"id": null, "status": "idle", "running": false, "done": false, "paused": false, "failed": false, "progress": 0, "message": null, "error": null, "args": {}, "ask": null, "answer": null, "returns": {}, "started_at": null, "ended_at": null, "duration": null, "log": [], "can": {"cancel": false, "pause": false, "resume": false, "step": false, "interrupt": false}}
|
|
96
103
|
},
|
|
97
104
|
"query": {
|
|
98
105
|
"description": "A declared query's record.",
|
|
@@ -112,6 +119,16 @@
|
|
|
112
119
|
{"key": "error", "kind": "STRING", "nullable": true}
|
|
113
120
|
]
|
|
114
121
|
},
|
|
122
|
+
"assign": {
|
|
123
|
+
"description": "What an assign blok knows of the run it prepares, besides args and deps.",
|
|
124
|
+
"fields": [
|
|
125
|
+
{"key": "given", "kind": "DICT", "description": "given.<key>: true for an argument the caller decided before the blok opened (a preset from a menu); it is locked, and <args /> leaves it out."},
|
|
126
|
+
{"key": "missing", "kind": "LIST", "children": [{"key": "...", "kind": "STRING"}], "description": "The keys of the required arguments that are still empty."},
|
|
127
|
+
{"key": "ready", "kind": "BOOL", "description": "True when no required argument is missing."},
|
|
128
|
+
{"key": "starting", "kind": "BOOL", "description": "True while assign.start() is being taken."},
|
|
129
|
+
{"key": "blocked", "kind": "STRING", "nullable": true, "description": "Why the run cannot start now, as a sentence (a dependency is not met, no agent fits); null when it can."}
|
|
130
|
+
]
|
|
131
|
+
},
|
|
115
132
|
"viewer": {
|
|
116
133
|
"description": "Exposes nothing beyond what the viewer's own token says.",
|
|
117
134
|
"fields": [
|
|
@@ -147,7 +164,7 @@
|
|
|
147
164
|
]
|
|
148
165
|
},
|
|
149
166
|
"functions": {
|
|
150
|
-
"description": "Pure functions by namespace, snake_case. Positional arguments map onto params in order. `lazy`: arguments are read only as needed. `effect`: allowed only as a callback's one thing (ui.*, task
|
|
167
|
+
"description": "Pure functions by namespace, snake_case. Positional arguments map onto params in order. `lazy`: arguments are read only as needed. `effect`: allowed only as a callback's one thing (ui.*, task.*, assign.start, query.*). `command`: an effect that changes the world (it acts on a task or starts one, and is recorded with it); an effect without it only changes what the viewer sees. A blok does nothing else: every other function is pure. `sees_status`: sees pending/failed instead of suspending. No function reads the wall clock. `null` says what the function does with a null argument (known absence); a missing path reads as null.",
|
|
151
168
|
"cmp.eq": {"params": [["a", "ANY"], ["b", "ANY"]], "returns": "BOOL", "description": "Deep JSON equality.", "null": "null equals only null"},
|
|
152
169
|
"cmp.ne": {"params": [["a", "ANY"], ["b", "ANY"]], "returns": "BOOL", "description": "Not deep-equal.", "null": "null equals only null"},
|
|
153
170
|
"cmp.gt": {"params": [["a", "ANY"], ["b", "ANY"]], "returns": "BOOL", "description": "a > b, numbers or strings.", "null": "false"},
|
|
@@ -230,11 +247,18 @@
|
|
|
230
247
|
"list.pluck": {"params": [["value", "LIST"], ["key", "STRING"]], "returns": "LIST", "null": "[]"},
|
|
231
248
|
"list.sort": {"params": [["value", "LIST"], ["key", "STRING", false], ["descending", "BOOL", false]], "returns": "LIST", "null": "[]; null entries sort last"},
|
|
232
249
|
"list.range": {"params": [["start", "INT"], ["end", "INT"], ["step", "INT", false]], "returns": "LIST", "null": "[]"},
|
|
250
|
+
"list.where": {"params": [["value", "LIST"], ["key", "STRING"], ["equals", "ANY", false]], "returns": "LIST", "description": "The items whose `key` (a dotted path) deep-equals `equals`; with `equals` left out, the items whose `key` is truthy.", "null": "[]"},
|
|
251
|
+
"list.find": {"params": [["value", "LIST"], ["key", "STRING"], ["equals", "ANY", false]], "returns": "ANY", "description": "The first item list.where would keep, or null.", "null": "null"},
|
|
252
|
+
"list.count": {"params": [["value", "LIST"], ["key", "STRING"], ["equals", "ANY", false]], "returns": "INT", "description": "How many items list.where would keep.", "null": "0"},
|
|
253
|
+
"list.concat": {"params": [["value", "LIST"], ["other", "LIST"]], "returns": "LIST", "description": "Both lists, one after the other.", "null": "a null list reads as empty"},
|
|
233
254
|
"obj.get": {"params": [["value", "DICT"], ["key", "STRING"], ["default", "ANY", false]], "returns": "ANY", "description": "A dotted key reads a nested field.", "null": "default"},
|
|
234
255
|
"obj.has": {"params": [["value", "DICT"], ["key", "STRING"]], "returns": "BOOL", "null": "false"},
|
|
235
256
|
"obj.keys": {"params": [["value", "DICT"]], "returns": "LIST", "null": "[]"},
|
|
236
257
|
"obj.values": {"params": [["value", "DICT"]], "returns": "LIST", "null": "[]"},
|
|
237
258
|
"obj.entries": {"params": [["value", "DICT"]], "returns": "LIST", "description": "[{key, value}, ...].", "null": "[]"},
|
|
259
|
+
"obj.merge": {"params": [["value", "DICT"], ["other", "DICT"]], "returns": "DICT", "description": "Both dicts as one; `other` wins where both have a key. Not deep.", "null": "a null dict reads as empty"},
|
|
260
|
+
"obj.pick": {"params": [["value", "DICT"], ["keys", "LIST"]], "returns": "DICT", "description": "Only these keys.", "null": "{}"},
|
|
261
|
+
"obj.omit": {"params": [["value", "DICT"], ["keys", "LIST"]], "returns": "DICT", "description": "All but these keys.", "null": "{}"},
|
|
238
262
|
"val.is_null": {"params": [["value", "ANY"]], "returns": "BOOL", "null": "true"},
|
|
239
263
|
"val.is_set": {"params": [["value", "ANY"]], "returns": "BOOL", "null": "false"},
|
|
240
264
|
"val.is_empty": {"params": [["value", "ANY"]], "returns": "BOOL", "description": "null, an empty string, list or object.", "null": "true"},
|
|
@@ -255,9 +279,17 @@
|
|
|
255
279
|
"fmt.quantity": {"params": [["value", "ANY"], ["unit", "STRING", false]], "returns": "STRING", "description": "A quantity ({magnitude, unit} or a number in `unit`), in its unit.", "null": "empty string"},
|
|
256
280
|
"fmt.duration": {"params": [["seconds", "FLOAT"]], "returns": "STRING", "description": "90 -> 1m 30s; negative durations keep their sign.", "null": "empty string"},
|
|
257
281
|
"time.diff": {"params": [["start", "STRING"], ["end", "STRING"]], "returns": "FLOAT", "description": "Seconds from start to end (ISO 8601 datetimes); negative when end is earlier. Pure: relative time to the viewed moment is the <Time> component's.", "null": "null"},
|
|
282
|
+
"time.add": {"params": [["value", "STRING"], ["seconds", "FLOAT"]], "returns": "STRING", "description": "The moment `seconds` after `value` (before, when negative), as an ISO 8601 datetime in UTC.", "null": "null"},
|
|
283
|
+
"time.before": {"params": [["a", "STRING"], ["b", "STRING"]], "returns": "BOOL", "description": "Whether moment a is earlier than b.", "null": "false"},
|
|
284
|
+
"time.after": {"params": [["a", "STRING"], ["b", "STRING"]], "returns": "BOOL", "description": "Whether moment a is later than b.", "null": "false"},
|
|
258
285
|
"ui.copy": {"params": [["text", "ANY"]], "returns": "ANY", "effect": true, "description": "Copies text to the viewer's clipboard: the only non-task effect.", "null": "copies an empty string"},
|
|
259
|
-
"task.answer": {"params": [["values", "DICT"]], "returns": "ANY", "effect": true, "task_operation": true, "description": "Answers the open ask of `task`. Counts as a task operation.", "null": "answers with no values"},
|
|
260
|
-
"
|
|
286
|
+
"task.answer": {"params": [["values", "DICT"]], "returns": "ANY", "effect": true, "command": true, "task_operation": true, "description": "Answers the open ask of `task`. Counts as a task operation.", "null": "answers with no values"},
|
|
287
|
+
"task.cancel": {"params": [], "returns": "ANY", "effect": true, "command": true, "task_operation": true, "description": "Cancels the run `task` is about. Refused while `task.can.cancel` is false, and while the blok shows the past. Counts as a task operation.", "null": "takes no arguments"},
|
|
288
|
+
"task.pause": {"params": [], "returns": "ANY", "effect": true, "command": true, "task_operation": true, "description": "Pauses the run `task` is about: it waits until someone resumes it. Refused while `task.can.pause` is false, and while the blok shows the past. Counts as a task operation.", "null": "takes no arguments"},
|
|
289
|
+
"task.resume": {"params": [], "returns": "ANY", "effect": true, "command": true, "task_operation": true, "description": "Resumes the run `task` is about, after a pause. Refused while `task.can.resume` is false, and while the blok shows the past. Counts as a task operation.", "null": "takes no arguments"},
|
|
290
|
+
"task.step": {"params": [], "returns": "ANY", "effect": true, "command": true, "task_operation": true, "description": "Resumes the run `task` is about until its next breakpoint. Refused while `task.can.step` is false, and while the blok shows the past. Counts as a task operation.", "null": "takes no arguments"},
|
|
291
|
+
"task.interrupt": {"params": [], "returns": "ANY", "effect": true, "command": true, "task_operation": true, "description": "Interrupts the run `task` is about: stopped at once, without waiting for it to wind down. Refused while `task.can.interrupt` is false, and while the blok shows the past. Counts as a task operation.", "null": "takes no arguments"},
|
|
292
|
+
"assign.start": {"params": [], "returns": "ANY", "effect": true, "command": true, "description": "Starts the run an assign blok prepares, with the arguments as they are filled in and the agents the blok was shown (deps) pinned. An assign blok only.", "null": "starts the run"},
|
|
261
293
|
"query.refetch": {"params": [["query", "STRING"]], "returns": "ANY", "effect": true, "description": "Re-reads the declared query named by the literal `query`; never suspends, queries.<name>.refetching is true meanwhile. BSX writes it queries.<name>.refetch().", "null": "refused: the query is named by a literal"},
|
|
262
294
|
"query.fetch_more": {"params": [["query", "STRING"], ["variables", "DICT", false]], "returns": "ANY", "effect": true, "description": "Reads the next page of the declared query named by the literal `query`, its variables overridden by `variables`, and appends the page's list at the query's `more` field to what is shown; queries.<name>.fetching_more is true meanwhile. BSX writes it queries.<name>.fetch_more(name: value, ...). Refused on a query without `more`.", "null": "refused: the query is named by a literal; null variables fetch with the query's own"}
|
|
263
295
|
},
|
package/src/spec/vocabulary.ts
CHANGED
|
@@ -25,6 +25,8 @@ export type VocabFunction = {
|
|
|
25
25
|
lazy: boolean;
|
|
26
26
|
/** Allowed only as a callback's one thing (`ui.copy`, `task.answer`, `query.refetch`). */
|
|
27
27
|
effect: boolean;
|
|
28
|
+
/** An effect that changes the world (acts on a task, or starts one); an effect without it only changes what the viewer sees. */
|
|
29
|
+
command: boolean;
|
|
28
30
|
/** Sees a pending or failed argument instead of suspending. */
|
|
29
31
|
seesStatus: boolean;
|
|
30
32
|
/** The parameter names, in positional order. */
|
|
@@ -257,6 +259,7 @@ const parseFunction = (name: string, raw: unknown): VocabFunction => {
|
|
|
257
259
|
null: typeof entry.null === 'string' ? entry.null : '',
|
|
258
260
|
lazy: entry.lazy === true,
|
|
259
261
|
effect: entry.effect === true,
|
|
262
|
+
command: entry.command === true,
|
|
260
263
|
seesStatus: entry.sees_status === true,
|
|
261
264
|
keys: params.map(param => param.key),
|
|
262
265
|
requiredKeys: params.filter(param => param.required).map(param => param.key),
|