@arkitektio/bsx 2.3.0 → 4.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/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/ports.d.ts +0 -1
- package/dist/ports.d.ts.map +1 -1
- package/dist/ports.js +1 -2
- package/dist/ports.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 +114 -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 -6
- 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/ports.ts +1 -2
- package/src/renderer/bloks/run/components.tsx +227 -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/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
- package/dist/ports/engine/ActionDescription.d.ts +0 -27
- package/dist/ports/engine/ActionDescription.d.ts.map +0 -1
- package/dist/ports/engine/ActionDescription.js +0 -61
- package/dist/ports/engine/ActionDescription.js.map +0 -1
- package/src/ports/engine/ActionDescription.tsx +0 -78
|
@@ -51,7 +51,7 @@ export default {
|
|
|
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 @@ export default {
|
|
|
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 @@ export default {
|
|
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkitektio/bsx",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "The BSX language, the blok spec, runtime and React renderer: one copy for every Arkitekt frontend.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -79,7 +79,6 @@
|
|
|
79
79
|
"date-fns": "^4.1.0",
|
|
80
80
|
"embla-carousel-react": "^8.6.0",
|
|
81
81
|
"graphql": "^16.8.0",
|
|
82
|
-
"handlebars": "^4.7.8",
|
|
83
82
|
"input-otp": "^1.4.2",
|
|
84
83
|
"lucide-react": ">=0.500.0",
|
|
85
84
|
"monaco-editor": ">=0.50.0",
|
|
@@ -168,9 +167,6 @@
|
|
|
168
167
|
"@hookform/resolvers": {
|
|
169
168
|
"optional": true
|
|
170
169
|
},
|
|
171
|
-
"handlebars": {
|
|
172
|
-
"optional": true
|
|
173
|
-
},
|
|
174
170
|
"cmdk": {
|
|
175
171
|
"optional": true
|
|
176
172
|
},
|
|
@@ -198,7 +194,6 @@
|
|
|
198
194
|
"date-fns": "^4.1.0",
|
|
199
195
|
"embla-carousel-react": "^8.6.0",
|
|
200
196
|
"graphql": "^16.8.0",
|
|
201
|
-
"handlebars": "^4.7.8",
|
|
202
197
|
"input-otp": "^1.4.2",
|
|
203
198
|
"jsdom": "^29.1.1",
|
|
204
199
|
"lucide-react": "^0.562.0",
|
package/src/bsx/language.test.ts
CHANGED
|
@@ -68,6 +68,7 @@ describe('completeBsx: components and props', () => {
|
|
|
68
68
|
expect(labels('<Scene><Model><|')).toContain('OnClick');
|
|
69
69
|
expect(labels('<Scene><|')).not.toContain('OnClick');
|
|
70
70
|
expect(labels('<|', env({context: 'SCENE'}))).toEqual(['Scene']);
|
|
71
|
+
expect(labels('<|', env({kind: 'action', context: 'SCENE'}))).toEqual(['Scene', 'Space']);
|
|
71
72
|
expect(labels('<|', env({context: 'LOGO'}))).toEqual(['AgentLogo']);
|
|
72
73
|
expect(labels('<|', env({context: 'ACTION_LOGO'}))).toEqual(['ActionLogo']);
|
|
73
74
|
expect(labels('<|', env({context: 'HTML'}))).toEqual(['Html']);
|
package/src/bsx/language.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {defaultBlokView, innerContext, type BlokView, type SpecComponent, type SpecProp} from '../spec/catalogs';
|
|
2
2
|
import {loadVocabulary, type BlokContextName, type VocabFunction, type VocabRecordField} from '../spec/vocabulary';
|
|
3
3
|
import {FOREACH_COMPONENT, FOREACH_LET_PROP, INTO_KEYWORD} from './parse';
|
|
4
|
-
import {
|
|
4
|
+
import {blokRootsOf, drawnIn, type BlokCheckScope, type BlokPortMatch, type BlokScopeDependency, type BlokScopeLocalPort} from './references';
|
|
5
5
|
import type {BsxRange} from './source';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -289,8 +289,9 @@ const completeTag = (env: BsxEnvironment, cursor: Extract<BsxCursor, {kind: 'tag
|
|
|
289
289
|
const components = [...view.components.values()];
|
|
290
290
|
if (stack.length === 0) {
|
|
291
291
|
const context = drawnIn(env.scope) as BlokContextName;
|
|
292
|
-
|
|
293
|
-
const
|
|
292
|
+
// A Space places the run's dependencies: it starts only an action's own blok, which has a run.
|
|
293
|
+
const roots = blokRootsOf(env.scope.context).filter(root => root !== 'Space' || env.scope.kind === 'action');
|
|
294
|
+
const candidates = roots.length ? components.filter(component => roots.includes(component.name)) : components.filter(component => fitsUnder(component, [], context));
|
|
294
295
|
return candidates.map(component => componentCompletion(component, from));
|
|
295
296
|
}
|
|
296
297
|
const parent = view.components.get(stack[stack.length - 1].tag);
|
package/src/bsx/references.ts
CHANGED
|
@@ -151,17 +151,25 @@ const SCENE = 'SCENE';
|
|
|
151
151
|
/** The context a scope's components are drawn in: an action logo's is a logo's. */
|
|
152
152
|
export const drawnIn = (scope: BlokCheckScope): string => (scope.context === ACTION_LOGO ? LOGO : scope.context);
|
|
153
153
|
|
|
154
|
-
/** The root
|
|
155
|
-
export const
|
|
156
|
-
Object.entries(loadVocabulary().blokRoots)
|
|
154
|
+
/** The root components a blok of ``context`` may start with (`HTML` → `Html`; `SCENE` → `Scene`, `Space`): a blok's root names its context. */
|
|
155
|
+
export const blokRootsOf = (context: string): string[] =>
|
|
156
|
+
Object.entries(loadVocabulary().blokRoots)
|
|
157
|
+
.filter(([, named]) => named === context)
|
|
158
|
+
.map(([root]) => root);
|
|
157
159
|
|
|
158
|
-
/** The blok context
|
|
160
|
+
/** The root a new blok of ``context`` starts with: the first it may start with (`SCENE` → `Scene`). */
|
|
161
|
+
export const blokRootOf = (context: string): string | null => blokRootsOf(context)[0] ?? null;
|
|
162
|
+
|
|
163
|
+
/** The blok context a root component names (`Space` → `SCENE`), or null when it names none. */
|
|
159
164
|
export const blokContextOf = (component: string): string | null => loadVocabulary().blokRoots[component] ?? null;
|
|
160
165
|
|
|
161
166
|
/* -------------------------------------------------------------------------- */
|
|
162
167
|
/* Matches */
|
|
163
168
|
/* -------------------------------------------------------------------------- */
|
|
164
169
|
|
|
170
|
+
/** Props whose value is the blok's dependency keys, written out (not paths): each must be a dependency. */
|
|
171
|
+
const DEPENDENCY_KEY_PROPS = new Set(['Placed.dep', 'Route.through']);
|
|
172
|
+
|
|
165
173
|
const OPEN_IDENTIFIER = '*';
|
|
166
174
|
const ITEM = '...';
|
|
167
175
|
const TOAST_COMPONENT = 'Toast';
|
|
@@ -428,9 +436,10 @@ class Checker {
|
|
|
428
436
|
if (wrongLogo || !(this.kind.contexts as readonly string[]).includes(drawn)) {
|
|
429
437
|
this.add('context.kind', null, {n: article(scope.kind), kind: scope.kind, contexts: this.kind.contexts.join(', '), context: scope.context});
|
|
430
438
|
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
439
|
+
// A context may have several roots (a SCENE blok is a <Scene> or a <Space>).
|
|
440
|
+
const roots = blokRootsOf(scope.context);
|
|
441
|
+
if (roots.length && !roots.includes(tree.component)) {
|
|
442
|
+
this.add('context.root', tree.id, {context: scope.context.toLowerCase(), root: roots.join('> or <'), component: tree.component});
|
|
434
443
|
}
|
|
435
444
|
if (scope.locals.length && !this.kind.locals) this.notInKind(null, 'locals', 'locals');
|
|
436
445
|
for (const local of scope.locals) {
|
|
@@ -598,6 +607,27 @@ class Checker {
|
|
|
598
607
|
}
|
|
599
608
|
}
|
|
600
609
|
|
|
610
|
+
/** A ``Placed dep`` or ``Route through`` names dependencies of the blok, written out as keys. */
|
|
611
|
+
private checkDependencyKeys(node: BlokComponentNode, prop: BlokComponentProp): void {
|
|
612
|
+
if (this.scope.kind !== 'action') {
|
|
613
|
+
this.add('space.kind', node.id, {component: node.component, n: article(this.scope.kind), kind: this.scope.kind}, prop.key);
|
|
614
|
+
return;
|
|
615
|
+
}
|
|
616
|
+
const path = `${node.component}.${prop.key}`;
|
|
617
|
+
const value = prop.static_value;
|
|
618
|
+
const keys = typeof value === 'string' ? [value] : Array.isArray(value) ? value.filter((key): key is string => typeof key === 'string') : [];
|
|
619
|
+
for (const key of keys) {
|
|
620
|
+
if (!this.dependencies.has(key)) {
|
|
621
|
+
this.add(
|
|
622
|
+
'deps.unknown',
|
|
623
|
+
node.id,
|
|
624
|
+
{path, key, keys: [...this.dependencies.keys()].sort().join(', ') || 'none', hint: dependencyHint(key, this.scope.kind)},
|
|
625
|
+
prop.key,
|
|
626
|
+
);
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
|
|
601
631
|
private checkProp(node: BlokComponentNode, prop: BlokComponentProp, spec: SpecComponent | undefined): void {
|
|
602
632
|
const {vocabulary} = this;
|
|
603
633
|
const propSpec = spec?.props.find(candidate => candidate.key === prop.key);
|
|
@@ -642,6 +672,11 @@ class Checker {
|
|
|
642
672
|
}
|
|
643
673
|
}
|
|
644
674
|
}
|
|
675
|
+
if (DEPENDENCY_KEY_PROPS.has(`${node.component}.${prop.key}`)) this.checkDependencyKeys(node, prop);
|
|
676
|
+
if (node.component === 'Space' && prop.key === 'room' && this.scope.kind !== 'action') {
|
|
677
|
+
// A Space places the run's dependencies: only an action's own blok has a run.
|
|
678
|
+
this.add('space.kind', node.id, {component: node.component, n: article(this.scope.kind), kind: this.scope.kind}, prop.key);
|
|
679
|
+
}
|
|
645
680
|
if (node.component === TOAST_COMPONENT && prop.key === TOAST_TASK_PROP) {
|
|
646
681
|
const path = prop.dynamic_value?.path ?? null;
|
|
647
682
|
if (path === null || (path !== 'task' && !this.into.has(path))) this.add('toast.task', node.id, {what: path ?? what(prop)}, prop.key);
|
|
@@ -1,29 +1,49 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
import type {BlokComponentContracts} from '../../renderer/runtime/catalog';
|
|
3
3
|
import {describedString} from '../props';
|
|
4
|
+
import {sceneSchema} from './scene';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
|
-
* The components
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* and `Route` draws
|
|
7
|
+
* The components that place an action's dependencies in 3D (scene@1). `Space`
|
|
8
|
+
* is a scene whose layout is shared: a room the whole organization arranges,
|
|
9
|
+
* found again by its `room` (not `id`: that is every node's own explicit id). `Placed` draws the agent a dependency is bound to
|
|
10
|
+
* with that agent's own scene blok, where the room keeps it, and `Route` draws
|
|
11
|
+
* a line through several.
|
|
10
12
|
*
|
|
11
|
-
*
|
|
13
|
+
* Which agents they draw is the run's (a task, or the dry run before one):
|
|
14
|
+
* they belong in an action's own blok, whose dependencies they name.
|
|
15
|
+
*
|
|
16
|
+
* `Placed` and `Route` read their props through the module-level schema rather
|
|
12
17
|
* than the `schema` they are handed: those schemas are exported here.
|
|
13
18
|
*/
|
|
14
19
|
|
|
15
|
-
const
|
|
16
|
-
.
|
|
20
|
+
export const spaceSchema = sceneSchema
|
|
21
|
+
.extend({
|
|
22
|
+
room: z
|
|
23
|
+
.string()
|
|
24
|
+
.describe(
|
|
25
|
+
'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.',
|
|
26
|
+
),
|
|
27
|
+
})
|
|
17
28
|
.describe(
|
|
18
|
-
'Root of
|
|
29
|
+
'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.',
|
|
19
30
|
);
|
|
20
31
|
|
|
21
|
-
export const
|
|
32
|
+
export const placedSchema = z
|
|
22
33
|
.object({
|
|
23
|
-
dep: z.string().describe('The dependency key of the action whose agent this
|
|
34
|
+
dep: z.string().describe('The dependency key of the action whose agent this places.'),
|
|
35
|
+
blok: describedString(
|
|
36
|
+
'The scene blok of that agent to draw it with, by name. Its default scene blok when left out.',
|
|
37
|
+
),
|
|
38
|
+
matrix: z
|
|
39
|
+
.unknown()
|
|
40
|
+
.optional()
|
|
41
|
+
.describe(
|
|
42
|
+
'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.',
|
|
43
|
+
),
|
|
24
44
|
})
|
|
25
45
|
.describe(
|
|
26
|
-
'
|
|
46
|
+
'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.',
|
|
27
47
|
);
|
|
28
48
|
|
|
29
49
|
export const routeSchema = z
|
|
@@ -39,19 +59,19 @@ export const routeSchema = z
|
|
|
39
59
|
color: describedString('The colour of the line: a colour role of the theme, usually a chart role (`chart-2`). Defaults to `chart-1`.'),
|
|
40
60
|
})
|
|
41
61
|
.describe(
|
|
42
|
-
'Draws a line through the agents the run got for these dependencies, where they stand in the
|
|
62
|
+
'Draws a line through the agents the run got for these dependencies, where they stand in the room. A dependency nothing places is skipped.',
|
|
43
63
|
);
|
|
44
64
|
|
|
45
65
|
export const runContracts = {
|
|
46
|
-
|
|
66
|
+
Space: {
|
|
47
67
|
acceptsChildren: true,
|
|
48
|
-
placement: {childrenContext: 'scene', notDownstreamOf: ['Scene', '
|
|
49
|
-
schema:
|
|
68
|
+
placement: {childrenContext: 'scene', notDownstreamOf: ['Scene', 'Space']},
|
|
69
|
+
schema: spaceSchema,
|
|
50
70
|
},
|
|
51
|
-
|
|
71
|
+
Placed: {
|
|
52
72
|
acceptsChildren: true,
|
|
53
|
-
placement: {context: 'scene', downstreamOf: ['
|
|
54
|
-
schema:
|
|
73
|
+
placement: {context: 'scene', downstreamOf: ['Space']},
|
|
74
|
+
schema: placedSchema,
|
|
55
75
|
},
|
|
56
|
-
Route: {placement: {context: 'scene', downstreamOf: ['
|
|
76
|
+
Route: {placement: {context: 'scene', downstreamOf: ['Space']}, schema: routeSchema},
|
|
57
77
|
} satisfies BlokComponentContracts;
|
|
@@ -119,10 +119,10 @@ export const transformSchema = z
|
|
|
119
119
|
const IN_MODEL: BlokComponentPlacement = {context: 'scene', downstreamOf: ['Model', 'Robot']};
|
|
120
120
|
|
|
121
121
|
/**
|
|
122
|
-
* Bindings
|
|
123
|
-
*
|
|
122
|
+
* Bindings a `Space` may also use under a `Placed`, on the model the placed
|
|
123
|
+
* device's scene blok loaded. Interaction (OnClick, Popout) sits here too.
|
|
124
124
|
*/
|
|
125
|
-
const IN_MODEL_OR_AT: BlokComponentPlacement = {context: 'scene', downstreamOf: ['Model', 'Robot', '
|
|
125
|
+
const IN_MODEL_OR_AT: BlokComponentPlacement = {context: 'scene', downstreamOf: ['Model', 'Robot', 'Placed']};
|
|
126
126
|
|
|
127
127
|
const nodeProp = z.string().describe('The name of the node in the enclosing model that this binds.');
|
|
128
128
|
|
|
@@ -255,24 +255,24 @@ export const popoutSchema = z
|
|
|
255
255
|
export const sceneContracts = {
|
|
256
256
|
Scene: {
|
|
257
257
|
acceptsChildren: true,
|
|
258
|
-
placement: {childrenContext: 'scene', notDownstreamOf: ['Scene']},
|
|
258
|
+
placement: {childrenContext: 'scene', notDownstreamOf: ['Scene', 'Space']},
|
|
259
259
|
schema: sceneSchema,
|
|
260
260
|
},
|
|
261
261
|
Model: {
|
|
262
262
|
acceptsChildren: true,
|
|
263
|
-
placement: {context: 'scene', downstreamOf: ['Scene']},
|
|
263
|
+
placement: {context: 'scene', downstreamOf: ['Scene', 'Space']},
|
|
264
264
|
propKinds: MODEL_PROP_KINDS,
|
|
265
265
|
schema: modelSchema,
|
|
266
266
|
},
|
|
267
267
|
Robot: {
|
|
268
268
|
acceptsChildren: true,
|
|
269
|
-
placement: {context: 'scene', downstreamOf: ['Scene']},
|
|
269
|
+
placement: {context: 'scene', downstreamOf: ['Scene', 'Space']},
|
|
270
270
|
propKinds: MODEL_PROP_KINDS,
|
|
271
271
|
schema: robotSchema,
|
|
272
272
|
},
|
|
273
273
|
Transform: {
|
|
274
274
|
acceptsChildren: true,
|
|
275
|
-
placement: {context: 'scene', downstreamOf: ['
|
|
275
|
+
placement: {context: 'scene', downstreamOf: ['Scene', 'Space']},
|
|
276
276
|
schema: transformSchema,
|
|
277
277
|
},
|
|
278
278
|
Move: {placement: IN_MODEL, schema: moveSchema},
|
package/src/catalogs/scene.ts
CHANGED
|
@@ -5,9 +5,8 @@ import {parts} from './parts';
|
|
|
5
5
|
export const sceneCatalog = defineBlokCatalog({
|
|
6
6
|
name: "scene",
|
|
7
7
|
version: 1,
|
|
8
|
-
description: "3D components: the Scene and
|
|
8
|
+
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.",
|
|
9
9
|
components: {
|
|
10
|
-
Anchor: parts.Anchor,
|
|
11
10
|
Animate: parts.Animate,
|
|
12
11
|
Attach: parts.Attach,
|
|
13
12
|
Beam: parts.Beam,
|
|
@@ -15,12 +14,13 @@ export const sceneCatalog = defineBlokCatalog({
|
|
|
15
14
|
Model: parts.Model,
|
|
16
15
|
Move: parts.Move,
|
|
17
16
|
OnClick: {...parts.OnClick, events: {onClick: [{key: "node", kind: "STRING", description: "The node that was clicked."}, {key: "point", kind: "LIST", description: "Where it was hit: [x, y, z] in meters."}]}},
|
|
18
|
-
|
|
17
|
+
Placed: parts.Placed,
|
|
19
18
|
Popout: parts.Popout,
|
|
20
19
|
Robot: {...parts.Robot, events: {onJointChange: [{key: "name", kind: "STRING", description: "The joint the viewer set."}, {key: "value", kind: "FLOAT", description: "Its new value."}]}},
|
|
21
20
|
Rotate: parts.Rotate,
|
|
22
21
|
Route: parts.Route,
|
|
23
22
|
Scene: parts.Scene,
|
|
23
|
+
Space: parts.Space,
|
|
24
24
|
Tint: parts.Tint,
|
|
25
25
|
Transform: {...parts.Transform, bindKinds: {bind: "ANY"}},
|
|
26
26
|
Visible: parts.Visible,
|
package/src/ports.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// @arkitektio/bsx/ports: an action's form, the port engine and its widgets. What the app gives it is
|
|
2
2
|
// `configurePortHost`; `hostedStructure` draws structure@1 with the same host. A form needs the
|
|
3
|
-
// optional peers react-hook-form, @hookform/resolvers,
|
|
4
|
-
export * from './ports/engine/ActionDescription';
|
|
3
|
+
// optional peers react-hook-form, @hookform/resolvers, cmdk and date-fns.
|
|
5
4
|
export * from './ports/engine/DependencyContext';
|
|
6
5
|
export * from './ports/engine/EffectWrapper';
|
|
7
6
|
export * from './ports/engine/PortFitsContext';
|