@arkitektio/bsx 3.0.0 → 4.0.1
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/language.d.ts.map +1 -1
- package/dist/bsx/language.js +4 -3
- package/dist/bsx/language.js.map +1 -1
- package/dist/bsx/references.d.ts +4 -2
- package/dist/bsx/references.d.ts.map +1 -1
- package/dist/bsx/references.js +34 -6
- package/dist/bsx/references.js.map +1 -1
- package/dist/catalogs/index.d.ts +27 -14
- package/dist/catalogs/index.d.ts.map +1 -1
- package/dist/catalogs/parts/index.d.ts +16 -3
- package/dist/catalogs/parts/index.d.ts.map +1 -1
- package/dist/catalogs/parts/run.d.ts +44 -4
- package/dist/catalogs/parts/run.d.ts.map +1 -1
- package/dist/catalogs/parts/run.js +33 -19
- package/dist/catalogs/parts/run.js.map +1 -1
- package/dist/catalogs/parts/scene.js +7 -7
- package/dist/catalogs/parts/scene.js.map +1 -1
- package/dist/catalogs/scene.d.ts +27 -14
- package/dist/catalogs/scene.d.ts.map +1 -1
- package/dist/catalogs/scene.js +3 -3
- package/dist/catalogs/scene.js.map +1 -1
- package/dist/renderer/bloks/run/components.d.ts +15 -2
- package/dist/renderer/bloks/run/components.d.ts.map +1 -1
- package/dist/renderer/bloks/run/components.js +118 -43
- package/dist/renderer/bloks/run/components.js.map +1 -1
- package/dist/renderer/bloks/run/host.d.ts +27 -8
- package/dist/renderer/bloks/run/host.d.ts.map +1 -1
- package/dist/renderer/bloks/run/host.js +8 -4
- package/dist/renderer/bloks/run/host.js.map +1 -1
- package/dist/renderer/bloks/run/index.d.ts +1 -1
- package/dist/renderer/bloks/run/index.d.ts.map +1 -1
- package/dist/renderer/bloks/run/index.js +1 -1
- package/dist/renderer/bloks/run/index.js.map +1 -1
- package/dist/renderer/bloks/run/math.d.ts +3 -20
- package/dist/renderer/bloks/run/math.d.ts.map +1 -1
- package/dist/renderer/bloks/run/math.js +4 -15
- package/dist/renderer/bloks/run/math.js.map +1 -1
- package/dist/renderer/bloks/scene/Scene.d.ts +16 -2
- package/dist/renderer/bloks/scene/Scene.d.ts.map +1 -1
- package/dist/renderer/bloks/scene/Scene.js +11 -3
- package/dist/renderer/bloks/scene/Scene.js.map +1 -1
- package/dist/scene.js +2 -2
- package/dist/scene.js.map +1 -1
- package/dist/spec/bsx_v2.json +277 -62
- package/dist/spec/catalogs/scene@1.json +93 -41
- package/dist/spec/catalogs/scene@1.json.js +93 -41
- package/dist/spec/catalogs.js +1 -1
- package/dist/spec/catalogs.js.map +1 -1
- package/dist/spec/vocabulary.d.ts +1 -1
- package/dist/spec/vocabulary.d.ts.map +1 -1
- package/dist/spec/vocabulary.js +1 -1
- package/dist/spec/vocabulary.js.map +1 -1
- package/dist/spec/vocabulary.json +4 -4
- package/dist/spec/vocabulary.json.js +4 -4
- package/package.json +1 -1
- package/src/bsx/language.test.ts +1 -0
- package/src/bsx/language.ts +4 -3
- package/src/bsx/references.ts +42 -7
- package/src/catalogs/parts/run.ts +39 -19
- package/src/catalogs/parts/scene.ts +7 -7
- package/src/catalogs/scene.ts +3 -3
- package/src/renderer/bloks/run/components.tsx +233 -103
- package/src/renderer/bloks/run/host.tsx +38 -12
- package/src/renderer/bloks/run/index.ts +1 -1
- package/src/renderer/bloks/run/math.test.ts +1 -24
- package/src/renderer/bloks/run/math.ts +5 -33
- package/src/renderer/bloks/run/run.test.tsx +44 -38
- package/src/renderer/bloks/run/space.test.tsx +51 -0
- package/src/renderer/bloks/scene/Scene.tsx +22 -4
- package/src/scene.ts +2 -2
- package/src/spec/bsx_v2.json +277 -62
- package/src/spec/catalogs/scene@1.json +93 -41
- package/src/spec/catalogs.ts +1 -1
- package/src/spec/vocabulary.json +4 -4
- package/src/spec/vocabulary.ts +2 -2
|
@@ -1,29 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scene",
|
|
3
3
|
"version": 1,
|
|
4
|
-
"description": "3D components: the Scene and
|
|
4
|
+
"description": "3D components: the Scene and Space roots, models, verb modifiers on a model's nodes, the HTML bridge (Popout), and the placed dependencies of a Space.",
|
|
5
5
|
"components": [
|
|
6
|
-
{
|
|
7
|
-
"name": "Anchor",
|
|
8
|
-
"description": "Anchors its children at the agent the run got for a dependency, where it stands in the hosting space; Glow, Popout and OnClick inside it bind to that device's model as its scene blok loaded it. A key bound to several agents anchors at each; an agent the space does not place shows in a side tray.",
|
|
9
|
-
"context": "SCENE",
|
|
10
|
-
"children_context": null,
|
|
11
|
-
"inherits_context": false,
|
|
12
|
-
"accepts_children": true,
|
|
13
|
-
"downstream_of": [
|
|
14
|
-
"Overlay"
|
|
15
|
-
],
|
|
16
|
-
"not_downstream_of": [],
|
|
17
|
-
"text_prop": null,
|
|
18
|
-
"props": [
|
|
19
|
-
{
|
|
20
|
-
"key": "dep",
|
|
21
|
-
"kind": "STRING",
|
|
22
|
-
"required": true,
|
|
23
|
-
"description": "The dependency key of the action whose agent this anchors at."
|
|
24
|
-
}
|
|
25
|
-
]
|
|
26
|
-
},
|
|
27
6
|
{
|
|
28
7
|
"name": "Animate",
|
|
29
8
|
"description": "Scrubs a named animation clip of the model to a position, for mechanisms a single move or turn cannot describe. Never loops on its own.",
|
|
@@ -172,7 +151,7 @@
|
|
|
172
151
|
"downstream_of": [
|
|
173
152
|
"Model",
|
|
174
153
|
"Robot",
|
|
175
|
-
"
|
|
154
|
+
"Placed"
|
|
176
155
|
],
|
|
177
156
|
"not_downstream_of": [],
|
|
178
157
|
"text_prop": null,
|
|
@@ -211,7 +190,8 @@
|
|
|
211
190
|
"inherits_context": false,
|
|
212
191
|
"accepts_children": true,
|
|
213
192
|
"downstream_of": [
|
|
214
|
-
"Scene"
|
|
193
|
+
"Scene",
|
|
194
|
+
"Space"
|
|
215
195
|
],
|
|
216
196
|
"not_downstream_of": [],
|
|
217
197
|
"text_prop": null,
|
|
@@ -328,7 +308,7 @@
|
|
|
328
308
|
"downstream_of": [
|
|
329
309
|
"Model",
|
|
330
310
|
"Robot",
|
|
331
|
-
"
|
|
311
|
+
"Placed"
|
|
332
312
|
],
|
|
333
313
|
"not_downstream_of": [],
|
|
334
314
|
"text_prop": null,
|
|
@@ -388,19 +368,37 @@
|
|
|
388
368
|
]
|
|
389
369
|
},
|
|
390
370
|
{
|
|
391
|
-
"name": "
|
|
392
|
-
"description": "
|
|
393
|
-
"context": "
|
|
394
|
-
"children_context":
|
|
371
|
+
"name": "Placed",
|
|
372
|
+
"description": "Places the agent the run got for a dependency in the room, drawn by its own scene blok; Glow, Popout and OnClick inside it bind to that device's model. A key bound to several agents places each; while the room is being arranged a gizmo moves it, and where it is left is kept for everyone.",
|
|
373
|
+
"context": "SCENE",
|
|
374
|
+
"children_context": null,
|
|
395
375
|
"inherits_context": false,
|
|
396
376
|
"accepts_children": true,
|
|
397
|
-
"downstream_of": [
|
|
398
|
-
|
|
399
|
-
"Scene",
|
|
400
|
-
"Overlay"
|
|
377
|
+
"downstream_of": [
|
|
378
|
+
"Space"
|
|
401
379
|
],
|
|
380
|
+
"not_downstream_of": [],
|
|
402
381
|
"text_prop": null,
|
|
403
|
-
"props": [
|
|
382
|
+
"props": [
|
|
383
|
+
{
|
|
384
|
+
"key": "blok",
|
|
385
|
+
"kind": "STRING",
|
|
386
|
+
"required": false,
|
|
387
|
+
"description": "The scene blok of that agent to draw it with, by name. Its default scene blok when left out."
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
"key": "dep",
|
|
391
|
+
"kind": "STRING",
|
|
392
|
+
"required": true,
|
|
393
|
+
"description": "The dependency key of the action whose agent this places."
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"key": "matrix",
|
|
397
|
+
"kind": "ANY",
|
|
398
|
+
"required": false,
|
|
399
|
+
"description": "Where it stands until someone moves it: a 4x4 affine matrix as four rows, in meters with Y up. The room's origin when left out."
|
|
400
|
+
}
|
|
401
|
+
]
|
|
404
402
|
},
|
|
405
403
|
{
|
|
406
404
|
"name": "Popout",
|
|
@@ -412,7 +410,7 @@
|
|
|
412
410
|
"downstream_of": [
|
|
413
411
|
"Model",
|
|
414
412
|
"Robot",
|
|
415
|
-
"
|
|
413
|
+
"Placed"
|
|
416
414
|
],
|
|
417
415
|
"not_downstream_of": [],
|
|
418
416
|
"text_prop": null,
|
|
@@ -462,7 +460,8 @@
|
|
|
462
460
|
"inherits_context": false,
|
|
463
461
|
"accepts_children": true,
|
|
464
462
|
"downstream_of": [
|
|
465
|
-
"Scene"
|
|
463
|
+
"Scene",
|
|
464
|
+
"Space"
|
|
466
465
|
],
|
|
467
466
|
"not_downstream_of": [],
|
|
468
467
|
"text_prop": null,
|
|
@@ -613,13 +612,13 @@
|
|
|
613
612
|
},
|
|
614
613
|
{
|
|
615
614
|
"name": "Route",
|
|
616
|
-
"description": "Draws a line through the agents the run got for these dependencies, where they stand in the
|
|
615
|
+
"description": "Draws a line through the agents the run got for these dependencies, where they stand in the room. A dependency nothing places is skipped.",
|
|
617
616
|
"context": "SCENE",
|
|
618
617
|
"children_context": null,
|
|
619
618
|
"inherits_context": false,
|
|
620
619
|
"accepts_children": false,
|
|
621
620
|
"downstream_of": [
|
|
622
|
-
"
|
|
621
|
+
"Space"
|
|
623
622
|
],
|
|
624
623
|
"not_downstream_of": [],
|
|
625
624
|
"text_prop": null,
|
|
@@ -653,7 +652,8 @@
|
|
|
653
652
|
"accepts_children": true,
|
|
654
653
|
"downstream_of": [],
|
|
655
654
|
"not_downstream_of": [
|
|
656
|
-
"Scene"
|
|
655
|
+
"Scene",
|
|
656
|
+
"Space"
|
|
657
657
|
],
|
|
658
658
|
"text_prop": null,
|
|
659
659
|
"props": [
|
|
@@ -689,6 +689,58 @@
|
|
|
689
689
|
}
|
|
690
690
|
]
|
|
691
691
|
},
|
|
692
|
+
{
|
|
693
|
+
"name": "Space",
|
|
694
|
+
"description": "Root of a 3D view whose layout is shared: places the action's dependencies (`Placed`) in a room the organization arranges together. A device someone moved stands where they left it, for everyone; one nobody moved stands where its `Placed` says. The camera stays the viewer's.",
|
|
695
|
+
"context": "HTML",
|
|
696
|
+
"children_context": "SCENE",
|
|
697
|
+
"inherits_context": false,
|
|
698
|
+
"accepts_children": true,
|
|
699
|
+
"downstream_of": [],
|
|
700
|
+
"not_downstream_of": [
|
|
701
|
+
"Scene",
|
|
702
|
+
"Space"
|
|
703
|
+
],
|
|
704
|
+
"text_prop": null,
|
|
705
|
+
"props": [
|
|
706
|
+
{
|
|
707
|
+
"key": "camera",
|
|
708
|
+
"kind": "STRING",
|
|
709
|
+
"required": false,
|
|
710
|
+
"description": "Where the camera starts looking from; it frames the models whatever their size. Defaults to iso.",
|
|
711
|
+
"values": [
|
|
712
|
+
"iso",
|
|
713
|
+
"front",
|
|
714
|
+
"side",
|
|
715
|
+
"top"
|
|
716
|
+
]
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
"key": "grid",
|
|
720
|
+
"kind": "BOOL",
|
|
721
|
+
"required": false,
|
|
722
|
+
"description": "Whether the ground grid starts shown; the viewer can switch it. Defaults to true."
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
"key": "height",
|
|
726
|
+
"kind": "STRING",
|
|
727
|
+
"required": false,
|
|
728
|
+
"description": "CSS height of the view, e.g. \"24rem\". Omit to fit the element the scene is in (24rem where that has no height of its own)."
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
"key": "persist",
|
|
732
|
+
"kind": "BOOL",
|
|
733
|
+
"required": false,
|
|
734
|
+
"description": "Keep where the viewer leaves the camera (and the grid) on this device, by the scene's explicit id."
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
"key": "room",
|
|
738
|
+
"kind": "STRING",
|
|
739
|
+
"required": true,
|
|
740
|
+
"description": "The room this is, found again by it: a URI (`room:helsinki-lab`) is one room for every app of the organization, a plain key (`lab`) one for this app. Where a device stands in it is kept on the server, the same for everyone."
|
|
741
|
+
}
|
|
742
|
+
]
|
|
743
|
+
},
|
|
692
744
|
{
|
|
693
745
|
"name": "Tint",
|
|
694
746
|
"description": "Overrides the base color of a node. Its materials are copied first, so nodes sharing them are unaffected.",
|
|
@@ -725,8 +777,8 @@
|
|
|
725
777
|
"inherits_context": false,
|
|
726
778
|
"accepts_children": true,
|
|
727
779
|
"downstream_of": [
|
|
728
|
-
"
|
|
729
|
-
"
|
|
780
|
+
"Scene",
|
|
781
|
+
"Space"
|
|
730
782
|
],
|
|
731
783
|
"not_downstream_of": [],
|
|
732
784
|
"text_prop": null,
|
package/src/spec/catalogs.ts
CHANGED
|
@@ -66,7 +66,7 @@ const text = (value: unknown): string | null => (typeof value === 'string' ? val
|
|
|
66
66
|
const texts = (value: unknown): string[] => rawList(value).filter((item): item is string => typeof item === 'string');
|
|
67
67
|
|
|
68
68
|
const contextOf = (value: unknown): BlokContextName | null =>
|
|
69
|
-
value === 'HTML' || value === 'SCENE' || value === '
|
|
69
|
+
value === 'HTML' || value === 'SCENE' || value === 'LOGO' ? value : null;
|
|
70
70
|
|
|
71
71
|
export const parseSpecCatalog = (raw: unknown, file: string): SpecCatalog => {
|
|
72
72
|
if (!isRaw(raw) || typeof raw.name !== 'string') throw new Error(`${file} is not a catalog`);
|
package/src/spec/vocabulary.json
CHANGED
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"description": "An action's own blok, declared inline with the action (ActionBlok); its dependencies are the action's.",
|
|
52
52
|
"roots": ["self", "deps", "args", "task", "queries", "subscriptions", "viewer", "then"],
|
|
53
53
|
"locals": true,
|
|
54
|
-
"contexts": ["HTML", "SCENE"
|
|
54
|
+
"contexts": ["HTML", "SCENE"]
|
|
55
55
|
},
|
|
56
56
|
"action_logo": {
|
|
57
57
|
"description": "An action's logo, drawn against the task the viewer last ran of it (null until then).",
|
|
@@ -62,13 +62,12 @@
|
|
|
62
62
|
},
|
|
63
63
|
"contexts": {
|
|
64
64
|
"HTML": {"text": true, "description": "Panels, dashboards and popouts."},
|
|
65
|
-
"SCENE": {"text": false, "description": "A 3D view."},
|
|
66
|
-
"OVERLAY": {"text": false, "description": "An action's blok drawn into the space that hosts a run; its children are scene components."},
|
|
65
|
+
"SCENE": {"text": false, "description": "A 3D view: a Scene, or an action's Space, which places the run's dependencies in a room whose layout is shared."},
|
|
67
66
|
"LOGO": {"text": false, "description": "An SVG drawing in the viewer's palette: an agent's logo, or an action's (an ACTION_LOGO blok is drawn in LOGO)."}
|
|
68
67
|
},
|
|
69
68
|
"blok_roots": {
|
|
70
69
|
"description": "A blok's root component names its context: every blok starts with one of these, and nothing else declares the context.",
|
|
71
|
-
"roots": {"Html": "HTML", "Scene": "SCENE", "
|
|
70
|
+
"roots": {"Html": "HTML", "Scene": "SCENE", "Space": "SCENE", "AgentLogo": "LOGO", "ActionLogo": "ACTION_LOGO"}
|
|
72
71
|
},
|
|
73
72
|
"records": {
|
|
74
73
|
"task": {
|
|
@@ -417,6 +416,7 @@
|
|
|
417
416
|
"context.root": {"level": "error", "message": "The root of a {context} blok is <{root}>, not <{component}>.", "hint": "Make <{root}> the root and put <{component}> inside it."},
|
|
418
417
|
"context.root_unknown": {"level": "error", "message": "A blok's root names its context ({roots}), not <{component}>.", "hint": "Make the root one of {roots} and put <{component}> inside it."},
|
|
419
418
|
"context.kind": {"level": "error", "message": "A{n} {kind} blok is drawn in {contexts}, not {context}."},
|
|
419
|
+
"space.kind": {"level": "error", "message": "<{component}> places the run's dependencies, so only an action's own blok holds it, not a{n} {kind} blok.", "hint": "Declare it with the action: @app.workflow(bloks=[...])."},
|
|
420
420
|
"logo.complexity": {"level": "error", "message": "{detail}"},
|
|
421
421
|
"catalog.unknown_component": {"level": "warning", "message": "<{component}> is in no catalog in force ({catalogs}).", "hint": "Look the component up in the catalog; names are case-sensitive."},
|
|
422
422
|
"catalog.undeclared": {"level": "warning", "message": "<{component}> is from {catalog}, which the blok does not declare in its catalogs.", "hint": "Add {catalog} to the blok's catalogs."},
|
package/src/spec/vocabulary.ts
CHANGED
|
@@ -11,7 +11,7 @@ import vocabularyJson from './vocabulary.json';
|
|
|
11
11
|
export type BlokKind = 'agent' | 'custom' | 'task' | 'action' | 'action_logo';
|
|
12
12
|
export const BLOK_KINDS: readonly BlokKind[] = ['agent', 'custom', 'task', 'action', 'action_logo'];
|
|
13
13
|
|
|
14
|
-
export type BlokContextName = 'HTML' | 'SCENE' | '
|
|
14
|
+
export type BlokContextName = 'HTML' | 'SCENE' | 'LOGO';
|
|
15
15
|
|
|
16
16
|
export type VocabParam = {key: string; kind: string; required: boolean};
|
|
17
17
|
|
|
@@ -224,7 +224,7 @@ const stringMap = (value: unknown, where: string): Record<string, string> =>
|
|
|
224
224
|
);
|
|
225
225
|
|
|
226
226
|
const isContext = (value: string): value is BlokContextName =>
|
|
227
|
-
value === 'HTML' || value === 'SCENE' || value === '
|
|
227
|
+
value === 'HTML' || value === 'SCENE' || value === 'LOGO';
|
|
228
228
|
|
|
229
229
|
const recordFields = (value: unknown, where: string): VocabRecordField[] =>
|
|
230
230
|
list(value, where).map((raw, index) => {
|