@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,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { LOCAL_ANY_KIND } from '../spec/vocabulary.js';
|
|
1
|
+
import { declaredQueries as queriesOfTree, declaredSubscriptions as subscriptionsOfTree } from '../bsx/declared.js';
|
|
2
|
+
import { resolveLocals } from '../bsx/infer.js';
|
|
3
|
+
import { viewForTree } from '../bsx/references.js';
|
|
5
4
|
import { idleTaskRecord, normalizeBlokArgument, pendingReads, } from './runtime/index.js';
|
|
6
5
|
const isRecord = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
7
6
|
const variablesOf = (raw) => (Array.isArray(raw) ? raw : []).map(argument => normalizeBlokArgument(argument));
|
|
@@ -16,8 +15,15 @@ const localPort = (port) => ({
|
|
|
16
15
|
label: port.label ?? null,
|
|
17
16
|
description: port.description ?? null,
|
|
18
17
|
});
|
|
19
|
-
export const declaredLocals = (declarations) => declarations.resolvedLocals.map(local => ({ ...localPort(local), persist: local.persist === true }));
|
|
20
|
-
|
|
18
|
+
export const declaredLocals = (declarations) => declarations.resolvedLocals.map(local => ({ ...localPort(local), node: local.node, persist: local.persist === true }));
|
|
19
|
+
/** The one root of a tree as the wire spells it (a list of roots, or one), or null. */
|
|
20
|
+
const rootOf = (roots) => {
|
|
21
|
+
const list = Array.isArray(roots) ? roots : [roots];
|
|
22
|
+
const [root] = list;
|
|
23
|
+
return list.length === 1 && isRecord(root) && typeof root.component === 'string' ? root : null;
|
|
24
|
+
};
|
|
25
|
+
/** The reads a blok declares: its `<Blok>`'s `<query>` children. */
|
|
26
|
+
export const treeQueries = (roots) => queriesOfTree(rootOf(roots)).map(query => ({
|
|
21
27
|
key: query.key,
|
|
22
28
|
service: query.service,
|
|
23
29
|
document: query.document,
|
|
@@ -25,7 +31,8 @@ export const declaredQueries = (declarations) => (declarations.queries ?? []).ma
|
|
|
25
31
|
poll: query.poll ?? null,
|
|
26
32
|
more: query.more ?? null,
|
|
27
33
|
}));
|
|
28
|
-
|
|
34
|
+
/** The streams a blok declares: its `<Blok>`'s `<subscription>` children. */
|
|
35
|
+
export const treeSubscriptions = (roots) => subscriptionsOfTree(rootOf(roots)).map(subscription => ({
|
|
29
36
|
key: subscription.key,
|
|
30
37
|
service: subscription.service,
|
|
31
38
|
document: subscription.document,
|
|
@@ -33,8 +40,6 @@ export const declaredSubscriptions = (declarations) => (declarations.subscriptio
|
|
|
33
40
|
keep: subscription.keep ?? null,
|
|
34
41
|
history: subscription.history ?? null,
|
|
35
42
|
}));
|
|
36
|
-
/** Each declared local at its default. */
|
|
37
|
-
export const localsModel = (locals) => Object.fromEntries(locals.map(local => [local.key, local.default ?? null]));
|
|
38
43
|
/** The names `into` gives a task call's record, in the tree. */
|
|
39
44
|
export const intoNames = (roots) => {
|
|
40
45
|
const names = new Set();
|
|
@@ -53,34 +58,36 @@ export const intoNames = (roots) => {
|
|
|
53
58
|
};
|
|
54
59
|
/** Every `into` record before its call ran: idle. */
|
|
55
60
|
export const intoModel = (roots) => Object.fromEntries(intoNames(roots).map(name => [name, idleTaskRecord()]));
|
|
56
|
-
/**
|
|
57
|
-
|
|
58
|
-
|
|
61
|
+
/**
|
|
62
|
+
* What a renderer shows live before anything synced: idle `into` records and
|
|
63
|
+
* pending reads. Locals read their defaults until written (`runtime/locals`).
|
|
64
|
+
*/
|
|
65
|
+
export const liveModel = (roots) => {
|
|
66
|
+
const reads = pendingReads(treeQueries(roots), treeSubscriptions(roots));
|
|
59
67
|
return {
|
|
60
|
-
data: { ...
|
|
68
|
+
data: { ...intoModel(roots), ...reads.data },
|
|
61
69
|
statuses: reads.statuses,
|
|
62
70
|
};
|
|
63
71
|
};
|
|
64
72
|
/**
|
|
65
73
|
* What a preview renders: the blok's `demo`, mirroring the roots
|
|
66
|
-
* (`{deps, args, task, queries, subscriptions}`), with every
|
|
67
|
-
* answered by its demo value. Nothing is pending in a preview.
|
|
74
|
+
* (`{deps, args, task, queries, subscriptions}`), with every read the tree
|
|
75
|
+
* declares answered by its demo value. Nothing is pending in a preview.
|
|
68
76
|
*/
|
|
69
77
|
export const demoModel = (roots, declarations) => {
|
|
70
78
|
const demo = isRecord(declarations.demo) ? declarations.demo : {};
|
|
71
79
|
const demoQueries = isRecord(demo.queries) ? demo.queries : {};
|
|
72
80
|
const demoSubscriptions = isRecord(demo.subscriptions) ? demo.subscriptions : {};
|
|
73
|
-
const queries = Object.fromEntries(
|
|
81
|
+
const queries = Object.fromEntries(treeQueries(roots).map(query => [
|
|
74
82
|
query.key,
|
|
75
83
|
{ status: 'ready', value: demoQueries[query.key] ?? null, error: null, refetching: false, fetching_more: false },
|
|
76
84
|
]));
|
|
77
|
-
const subscriptions = Object.fromEntries(
|
|
85
|
+
const subscriptions = Object.fromEntries(treeSubscriptions(roots).map(subscription => [
|
|
78
86
|
subscription.key,
|
|
79
87
|
{ status: 'ready', value: demoSubscriptions[subscription.key] ?? null, error: null },
|
|
80
88
|
]));
|
|
81
89
|
const task = isRecord(demo.task) ? { ...idleTaskRecord(), ...demo.task } : undefined;
|
|
82
90
|
return {
|
|
83
|
-
...localsModel(declaredLocals(declarations)),
|
|
84
91
|
...intoModel(roots),
|
|
85
92
|
deps: isRecord(demo.deps) ? demo.deps : {},
|
|
86
93
|
args: isRecord(demo.args) ? demo.args : {},
|
|
@@ -89,18 +96,15 @@ export const demoModel = (roots, declarations) => {
|
|
|
89
96
|
...(Object.keys(subscriptions).length ? { subscriptions } : {}),
|
|
90
97
|
};
|
|
91
98
|
};
|
|
92
|
-
const optionalNumber = (value) => (typeof value === 'number' ? value : null);
|
|
93
99
|
const optionalString = (value) => (typeof value === 'string' ? value : null);
|
|
94
100
|
const jsonChoices = (raw) => Array.isArray(raw)
|
|
95
101
|
? raw.filter(isRecord).map(choice => ({ value: choice.value ?? null, label: optionalString(choice.label), description: optionalString(choice.description) }))
|
|
96
102
|
: null;
|
|
97
|
-
/** A port from JSON;
|
|
98
|
-
const jsonLocalPort = (port) => typeof port.
|
|
99
|
-
/** A port from JSON with `kind` as given; null without a key. */
|
|
100
|
-
const jsonLocalWritten = (port, kind) => typeof port.key === 'string'
|
|
103
|
+
/** A port from JSON; one without a key or kind is dropped. */
|
|
104
|
+
const jsonLocalPort = (port) => typeof port.key === 'string' && typeof port.kind === 'string'
|
|
101
105
|
? {
|
|
102
106
|
key: port.key,
|
|
103
|
-
kind,
|
|
107
|
+
kind: port.kind,
|
|
104
108
|
identifier: optionalString(port.identifier),
|
|
105
109
|
nullable: port.nullable === true,
|
|
106
110
|
default: port.default ?? null,
|
|
@@ -115,45 +119,26 @@ const jsonLocalWritten = (port, kind) => typeof port.key === 'string'
|
|
|
115
119
|
description: optionalString(port.description),
|
|
116
120
|
}
|
|
117
121
|
: null;
|
|
118
|
-
/**
|
|
119
|
-
const
|
|
120
|
-
const port =
|
|
121
|
-
return port ? [{ ...port, persist: local.persist === true }] : [];
|
|
122
|
+
/** Resolved locals from JSON; one without a node, a key or a kind is dropped. */
|
|
123
|
+
const jsonResolvedLocals = (raw) => (Array.isArray(raw) ? raw : []).filter(isRecord).flatMap(local => {
|
|
124
|
+
const port = jsonLocalPort(local);
|
|
125
|
+
return port && typeof local.node === 'string' ? [{ ...port, node: local.node, persist: local.persist === true }] : [];
|
|
122
126
|
});
|
|
123
|
-
const jsonRoots = (raw) => (Array.isArray(raw) ? raw : [raw]).filter((node) => isRecord(node) && typeof node.component === 'string');
|
|
124
127
|
/**
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
+
* The `<local>` nodes of a tree resolved the way the spec and the server
|
|
129
|
+
* resolve them (default, task argument, bind, else ANY), checked unmounted:
|
|
130
|
+
* what a host uses when the server sent no `resolvedLocals`.
|
|
128
131
|
*/
|
|
129
|
-
export const
|
|
130
|
-
|
|
132
|
+
export const resolveTreeLocals = (roots) => {
|
|
133
|
+
const root = rootOf(roots);
|
|
134
|
+
if (!root)
|
|
131
135
|
return [];
|
|
132
|
-
|
|
133
|
-
if (!root || roots.length !== 1)
|
|
134
|
-
return locals.map(local => ({ ...local, kind: local.kind ?? LOCAL_ANY_KIND }));
|
|
135
|
-
return resolveBlokScope(root, { ...emptyBlokScope(), locals }, defaultBlokView()).locals.map(local => ({ ...local }));
|
|
136
|
+
return [...resolveLocals(root, null, viewForTree(root))].map(([node, { local }]) => ({ ...local, node }));
|
|
136
137
|
};
|
|
137
|
-
|
|
138
|
-
? [
|
|
139
|
-
{
|
|
140
|
-
key: read.key,
|
|
141
|
-
service: read.service,
|
|
142
|
-
document: read.document,
|
|
143
|
-
variables: read.variables,
|
|
144
|
-
poll: optionalNumber(read.poll),
|
|
145
|
-
more: optionalString(read.more),
|
|
146
|
-
keep: optionalNumber(read.keep),
|
|
147
|
-
history: optionalString(read.history),
|
|
148
|
-
},
|
|
149
|
-
]
|
|
150
|
-
: []);
|
|
151
|
-
/** A blok's declarations from JSON a service serves, keeping only well-formed entries. */
|
|
138
|
+
/** A blok's declarations from JSON a service serves: its resolved locals as served, or resolved from its tree. */
|
|
152
139
|
export const parseBlokDeclarations = (raw) => ({
|
|
153
140
|
vocab: raw.vocab ?? null,
|
|
154
|
-
resolvedLocals:
|
|
141
|
+
resolvedLocals: raw.resolvedLocals !== undefined && raw.resolvedLocals !== null ? jsonResolvedLocals(raw.resolvedLocals) : resolveTreeLocals(raw.componentTree),
|
|
155
142
|
demo: raw.demo ?? null,
|
|
156
|
-
queries: jsonReads(raw.queries),
|
|
157
|
-
subscriptions: jsonReads(raw.subscriptions),
|
|
158
143
|
});
|
|
159
144
|
//# sourceMappingURL=declarations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declarations.js","sourceRoot":"","sources":["../../src/renderer/declarations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"declarations.js","sourceRoot":"","sources":["../../src/renderer/declarations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,IAAI,aAAa,EAAE,qBAAqB,IAAI,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AAC/G,OAAO,EAAC,aAAa,EAAC,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,YAAY,GASb,MAAM,WAAW,CAAC;AAuEnB,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE,CACpE,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAEvE,MAAM,WAAW,GAAG,CAAC,GAAY,EAAwB,EAAE,CACzD,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,qBAAqB,CAAC,QAAQ,CAAuB,CAAC,CAAC;AAEzG,MAAM,SAAS,GAAG,CAAC,IAA2B,EAAiB,EAAE,CAAC,CAAC;IACjE,GAAG,EAAE,IAAI,CAAC,GAAG;IACb,IAAI,EAAE,IAAI,CAAC,IAA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AAuB,EAAE;IAChG,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC3B,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IACrB,OAAO,CAAC,GAAG,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,EAAC,KAAK,EAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAC,GAAG,KAAK,EAAE,IAAI,EAAC,CAAsB,CAAC,CAAC;AAC7H,CAAC,CAAC;AAEF,kHAAkH;AAClH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,GAAyB,EAAoB,EAAE,CAAC,CAAC;IACrF,KAAK,EAAE,GAAG,CAAC,KAAK,IAAI,IAAI;IACxB,cAAc,EAAE,GAAG,CAAC,cAAc,KAAK,SAAS,IAAI,GAAG,CAAC,cAAc,KAAK,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,GAAG,CAAC,aAAa,CAAC;IAC/J,IAAI,EAAE,GAAG,CAAC,IAAI,IAAI,IAAI;CACvB,CAAC,CAAC"}
|
package/dist/renderer/declare.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { baseBlokCatalog } from './baseCatalog.js';
|
|
2
2
|
import { BASE_CATALOG_ADDRESS, BASE_CATALOG_REF, catalogRef, describeBlokComponent, extendBlokCatalog, } from './runtime/index.js';
|
|
3
3
|
import { baseCatalog } from '../spec/catalogs.js';
|
|
4
|
-
const CONTEXTS = ['
|
|
4
|
+
const CONTEXTS = ['PANEL', 'SCENE', 'LOGO'];
|
|
5
5
|
/**
|
|
6
6
|
* The context a base component counts towards: its own, and for one that
|
|
7
|
-
* bridges
|
|
8
|
-
* other one: a renderer that draws no 3D still draws
|
|
7
|
+
* bridges a panel and another context (`Scene` opens a scene inside a panel),
|
|
8
|
+
* the other one: a renderer that draws no 3D still draws panels whole.
|
|
9
9
|
*/
|
|
10
|
-
const contextOf = (component) => component.context !== '
|
|
10
|
+
const contextOf = (component) => component.context !== 'PANEL' ? component.context : (component.childrenContext ?? 'PANEL');
|
|
11
11
|
/** The contexts in which `catalog` draws every component of the base catalog. */
|
|
12
12
|
export const baseContextsOf = (catalog) => {
|
|
13
13
|
const components = baseCatalog().components;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declare.js","sourceRoot":"","sources":["../../src/renderer/declare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAC9C,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,qBAAqB,EACrB,iBAAiB,GAKlB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AA0B7C,MAAM,QAAQ,GAA+B,CAAC,
|
|
1
|
+
{"version":3,"file":"declare.js","sourceRoot":"","sources":["../../src/renderer/declare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAC9C,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,qBAAqB,EACrB,iBAAiB,GAKlB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AA0B7C,MAAM,QAAQ,GAA+B,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AAExE;;;;GAIG;AACH,MAAM,SAAS,GAAG,CAAC,SAA8E,EAAmB,EAAE,CACpH,SAAS,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,eAAe,IAAI,OAAO,CAAC,CAAC;AAE7F,iFAAiF;AACjF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAoB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C;IACtB,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,oBAAoB;IAC7C,WAAW,EAAE,IAAI,CAAC,WAAW;IAC7B,UAAU,EAAE,eAAe,CAAC,OAAO,CAAC;SACjC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,qBAAqB,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;SAClE,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACzF,CAAC,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { KeyedStore } from '../cache/keyedStore';
|
|
3
|
-
import type
|
|
3
|
+
import { type BlokRuntimeStore } from './runtime';
|
|
4
4
|
/**
|
|
5
5
|
* What a blok keeps between openings, on this device only (blok language v2):
|
|
6
6
|
*
|
|
7
|
-
* - **form inputs**: a local declared
|
|
8
|
-
*
|
|
7
|
+
* - **form inputs**: a local declared `<local name="x" default={...} persist />`
|
|
8
|
+
* remembers the viewer's last input, by its runtime id: the `<local>`'s node
|
|
9
|
+
* id, plus `@<item key>` per enclosing foreach (one value per item). An
|
|
10
|
+
* explicit `id=` on the `<local>` keeps it across edits of the tree;
|
|
9
11
|
* - **component state**: a component that offers it as its own BOOL prop
|
|
10
12
|
* (`<Scene id="main" persist>`, `<Transform id="arm-pose" persist>`) keeps
|
|
11
13
|
* its interaction state (the camera, the pose) by its id. The language
|
|
@@ -13,10 +15,10 @@ import type { BlokRuntimeStore } from './runtime';
|
|
|
13
15
|
*
|
|
14
16
|
* Nothing reaches a server, so keeping cannot become a channel between
|
|
15
17
|
* clients. Values live in IndexedDB keyed by (hub, user, materialized blok)
|
|
16
|
-
* for the locals
|
|
17
|
-
* component, and are written a
|
|
18
|
-
*
|
|
19
|
-
* dropped when the blok opens.
|
|
18
|
+
* for the locals (one record, values by runtime id) and (hub, user,
|
|
19
|
+
* materialized blok, component id) for each component, and are written a
|
|
20
|
+
* moment after the last change. A local the blok no longer persists, or a
|
|
21
|
+
* value that no longer fits its port, is dropped when the blok opens.
|
|
20
22
|
*/
|
|
21
23
|
/** A choice a local's port offers (`ChoiceInput`). */
|
|
22
24
|
export type BlokLocalChoice = {
|
|
@@ -41,11 +43,16 @@ export type BlokLocalPort = {
|
|
|
41
43
|
label?: string | null;
|
|
42
44
|
description?: string | null;
|
|
43
45
|
};
|
|
44
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* A `<local>` (vocabulary `locals`): an arg port plus `persist`, remembering
|
|
48
|
+
* the last input on this device, and `node`, the id of the `<local>` node
|
|
49
|
+
* that declares it.
|
|
50
|
+
*/
|
|
45
51
|
export type BlokLocal = BlokLocalPort & {
|
|
52
|
+
node: string;
|
|
46
53
|
persist?: boolean | null;
|
|
47
54
|
};
|
|
48
|
-
/** What is kept for one materialization's locals: values by local
|
|
55
|
+
/** What is kept for one materialization's locals: values by the local's runtime id (`runtimeIdOf`). */
|
|
49
56
|
export type KeptLocals = Record<string, unknown>;
|
|
50
57
|
/** Whose a kept record is: the hub and user it was set under, and the materialization. */
|
|
51
58
|
export type BlokPersistScope = {
|
|
@@ -53,6 +60,7 @@ export type BlokPersistScope = {
|
|
|
53
60
|
user: string;
|
|
54
61
|
materializedBlok: string;
|
|
55
62
|
};
|
|
63
|
+
/** Version 2: kept values by runtime id (version 1 kept them by top-level key, and is dropped). */
|
|
56
64
|
export declare const keptLocalsStore: KeyedStore<KeptLocals>;
|
|
57
65
|
/** One component's kept state, wrapped so any JSON value fits the store. */
|
|
58
66
|
export type KeptComponentState = {
|
|
@@ -63,6 +71,7 @@ export declare const keptLocalsId: (scope: BlokPersistScope) => string;
|
|
|
63
71
|
export declare const keptComponentId: (scope: BlokPersistScope, componentId: string) => string;
|
|
64
72
|
/** Whether a kept value can stand for a local: it fits the local's port (a kept value that no longer does is dropped). */
|
|
65
73
|
export declare const fitsLocal: (kept: unknown, local: BlokLocal) => boolean;
|
|
74
|
+
/** What of `record` still stands: the values of persisted locals (by their node) that still fit their port. */
|
|
66
75
|
export declare const keptValuesOf: (record: KeptLocals | null, locals: readonly BlokLocal[]) => {
|
|
67
76
|
values: KeptLocals;
|
|
68
77
|
dropped: boolean;
|
|
@@ -72,9 +81,9 @@ export declare const keptValuesOf: (record: KeptLocals | null, locals: readonly
|
|
|
72
81
|
* seed the renderer with, and what writes changes back.
|
|
73
82
|
*/
|
|
74
83
|
export type BlokPersistence = {
|
|
75
|
-
/** The
|
|
76
|
-
|
|
77
|
-
/** The kept
|
|
84
|
+
/** The `<local>` node ids kept on this device (those declared with `persist`): `BlokRenderer`'s `keptLocals`. */
|
|
85
|
+
locals: ReadonlySet<string>;
|
|
86
|
+
/** The kept values to seed the runtime with, before the first render, by runtime id: `BlokRenderer`'s `keptValues`. */
|
|
78
87
|
initial: KeptLocals;
|
|
79
88
|
/** Follows `store`: a change of a kept local is written after `delay`. Returns the detach, which flushes. */
|
|
80
89
|
attach: (store: BlokRuntimeStore) => () => void;
|
|
@@ -95,7 +104,7 @@ export type BlokComponentStateStore = {
|
|
|
95
104
|
export declare const componentStateStore: (scope: BlokPersistScope, store?: KeyedStore<KeptComponentState>, delay?: number) => BlokComponentStateStore;
|
|
96
105
|
export declare const openBlokPersistence: (options: {
|
|
97
106
|
scope: BlokPersistScope;
|
|
98
|
-
/** The blok's
|
|
107
|
+
/** The blok's resolved locals (by node); those with `persist` are kept. */
|
|
99
108
|
locals: readonly BlokLocal[];
|
|
100
109
|
store?: KeyedStore<KeptLocals>;
|
|
101
110
|
componentStore?: KeyedStore<KeptComponentState>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persist.d.ts","sourceRoot":"","sources":["../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,EACnB,SAAS,OAAO,EAChB,SAAS,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,CAAC,KACtC,uBAAuB,CAAC,CAAC,CAmC3B,CAAC"}
|
package/dist/renderer/persist.js
CHANGED
|
@@ -2,6 +2,8 @@ import * as React from 'react';
|
|
|
2
2
|
import { blokPlatform } from '../platform.js';
|
|
3
3
|
import { valueFitsPort } from '../spec/locals.js';
|
|
4
4
|
import { isExplicitId } from '../spec/vocabulary.js';
|
|
5
|
+
import { nodeOfRuntimeId } from '../bsx/declared.js';
|
|
6
|
+
import { LOCALS_ROOT, localNodeOfPath, runtimeIdOfPath } from './runtime/index.js';
|
|
5
7
|
/** A store made by the app's `keyedStore` the first time it is used: after the app configured it. */
|
|
6
8
|
const lazyKeyedStore = (options) => {
|
|
7
9
|
let store = null;
|
|
@@ -14,10 +16,11 @@ const lazyKeyedStore = (options) => {
|
|
|
14
16
|
};
|
|
15
17
|
};
|
|
16
18
|
const isKeptLocals = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
19
|
+
/** Version 2: kept values by runtime id (version 1 kept them by top-level key, and is dropped). */
|
|
17
20
|
export const keptLocalsStore = lazyKeyedStore({
|
|
18
21
|
db: 'orkestrator-blok-locals',
|
|
19
22
|
store: 'locals',
|
|
20
|
-
version:
|
|
23
|
+
version: 2,
|
|
21
24
|
isValue: isKeptLocals,
|
|
22
25
|
label: 'kept blok local',
|
|
23
26
|
});
|
|
@@ -41,13 +44,16 @@ export const fitsLocal = (kept, local) => {
|
|
|
41
44
|
return kept === null || typeof kept === 'string' || (typeof kept === 'object' && !Array.isArray(kept));
|
|
42
45
|
return valueFitsPort(kept, local);
|
|
43
46
|
};
|
|
47
|
+
/** What of `record` still stands: the values of persisted locals (by their node) that still fit their port. */
|
|
44
48
|
export const keptValuesOf = (record, locals) => {
|
|
45
49
|
const values = {};
|
|
46
50
|
if (!record)
|
|
47
51
|
return { values, dropped: false };
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
const persisted = new Map(locals.filter(local => local.persist).map(local => [local.node, local]));
|
|
53
|
+
for (const [runtimeId, value] of Object.entries(record)) {
|
|
54
|
+
const local = persisted.get(nodeOfRuntimeId(runtimeId));
|
|
55
|
+
if (local && fitsLocal(value, local))
|
|
56
|
+
values[runtimeId] = value;
|
|
51
57
|
}
|
|
52
58
|
return { values, dropped: Object.keys(values).length !== Object.keys(record).length };
|
|
53
59
|
};
|
|
@@ -75,14 +81,27 @@ export const componentStateStore = (scope, store = keptComponentStore, delay = 4
|
|
|
75
81
|
},
|
|
76
82
|
};
|
|
77
83
|
};
|
|
84
|
+
/** The values of the kept locals in `dataModel`, by runtime id: every item's, in a foreach. */
|
|
85
|
+
const keptIn = (dataModel, locals) => {
|
|
86
|
+
const found = new Map();
|
|
87
|
+
const values = dataModel?.[LOCALS_ROOT];
|
|
88
|
+
if (typeof values !== 'object' || values === null)
|
|
89
|
+
return found;
|
|
90
|
+
for (const [segment, value] of Object.entries(values)) {
|
|
91
|
+
const runtimeId = runtimeIdOfPath(`${LOCALS_ROOT}/${segment}`);
|
|
92
|
+
if (runtimeId !== null && locals.has(nodeOfRuntimeId(runtimeId)))
|
|
93
|
+
found.set(runtimeId, value);
|
|
94
|
+
}
|
|
95
|
+
return found;
|
|
96
|
+
};
|
|
78
97
|
export const openBlokPersistence = async (options) => {
|
|
79
98
|
const store = options.store ?? keptLocalsStore;
|
|
80
99
|
const delay = options.delay ?? 400;
|
|
81
100
|
const id = keptLocalsId(options.scope);
|
|
82
101
|
const persisted = options.locals.filter(local => local.persist);
|
|
83
|
-
const
|
|
84
|
-
const defaults = new Map(options.locals.map(local => [local.
|
|
85
|
-
const record =
|
|
102
|
+
const locals = new Set(persisted.map(local => local.node));
|
|
103
|
+
const defaults = new Map(options.locals.map(local => [local.node, local.default ?? null]));
|
|
104
|
+
const record = locals.size > 0 ? await store.load(id, LOCALS_RECORD) : null;
|
|
86
105
|
const { values: initial, dropped } = keptValuesOf(record, persisted);
|
|
87
106
|
if (dropped) {
|
|
88
107
|
await (Object.keys(initial).length > 0 ? store.save(id, LOCALS_RECORD, initial) : store.forget(id));
|
|
@@ -102,30 +121,30 @@ export const openBlokPersistence = async (options) => {
|
|
|
102
121
|
timer = setTimeout(() => void write(), delay);
|
|
103
122
|
};
|
|
104
123
|
return {
|
|
105
|
-
|
|
124
|
+
locals,
|
|
106
125
|
initial,
|
|
107
126
|
attach: target => {
|
|
108
127
|
runtime = target;
|
|
109
|
-
|
|
110
|
-
const seen = new Map([...keys].map(key => [key, valueOf(key)]));
|
|
128
|
+
let seen = keptIn(target.getState().dataModel, locals);
|
|
111
129
|
const unsubscribe = target.subscribe(state => {
|
|
130
|
+
const now = keptIn(state.dataModel, locals);
|
|
112
131
|
let changed = false;
|
|
113
|
-
for (const
|
|
114
|
-
const value =
|
|
115
|
-
if (same(value, seen.get(
|
|
132
|
+
for (const runtimeId of new Set([...seen.keys(), ...now.keys()])) {
|
|
133
|
+
const value = now.get(runtimeId);
|
|
134
|
+
if (same(value, seen.get(runtimeId)))
|
|
116
135
|
continue;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
if (!(key in kept))
|
|
136
|
+
// Back at the default (or cleared) is nothing to keep.
|
|
137
|
+
if (value === undefined || same(value, defaults.get(nodeOfRuntimeId(runtimeId)))) {
|
|
138
|
+
if (!(runtimeId in kept))
|
|
121
139
|
continue;
|
|
122
|
-
delete kept[
|
|
140
|
+
delete kept[runtimeId];
|
|
123
141
|
}
|
|
124
142
|
else {
|
|
125
|
-
kept[
|
|
143
|
+
kept[runtimeId] = value;
|
|
126
144
|
}
|
|
127
145
|
changed = true;
|
|
128
146
|
}
|
|
147
|
+
seen = now;
|
|
129
148
|
if (changed)
|
|
130
149
|
schedule();
|
|
131
150
|
});
|
|
@@ -142,8 +161,8 @@ export const openBlokPersistence = async (options) => {
|
|
|
142
161
|
const state = runtime?.getState();
|
|
143
162
|
if (state) {
|
|
144
163
|
for (const path of Object.keys(state.runtimePathValues)) {
|
|
145
|
-
const
|
|
146
|
-
if (
|
|
164
|
+
const node = localNodeOfPath(path);
|
|
165
|
+
if (node !== null && locals.has(node))
|
|
147
166
|
state.clearRuntimeValue(path);
|
|
148
167
|
}
|
|
149
168
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persist.js","sourceRoot":"","sources":["../../src/renderer/persist.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AACzC,OAAO,EAAC,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"persist.js","sourceRoot":"","sources":["../../src/renderer/persist.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AACzC,OAAO,EAAC,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAC,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAC,WAAW,EAAE,eAAe,EAAE,eAAe,EAAwB,MAAM,WAAW,CAAC;AAwD/F,qGAAqG;AACrG,MAAM,cAAc,GAAG,CAAK,OAA6B,EAAiB,EAAE;IAC1E,IAAI,KAAK,GAAyB,IAAI,CAAC;IACvC,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,CAAC,KAAK,KAAK,YAAY,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;IAClE,OAAO;QACL,IAAI,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC;QACzC,IAAI,EAAE,CAAC,EAAE,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AAE,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAC,CAAC,CAAC;QAChG,CAAC,EACD,GAAG,EAAE;YACH,IAAI,CAAC,SAAS;gBAAE,SAAS,CAAC,EAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAC,CAAC,CAAC;QAC5D,CAAC,CACF,CAAC;QACF,OAAO,GAAG,EAAE;YACV,SAAS,GAAG,IAAI,CAAC;QACnB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;IAEjC,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,CAC5B,CAAC,KAAQ,EAAE,EAAE;QACX,IAAI,MAAM,IAAI,KAAK;YAAE,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IACtD,CAAC,EACD,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,CAC7B,CAAC;IAEF,IAAI,CAAC,MAAM;QAAE,OAAO,EAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAC,CAAC;IACxD,MAAM,OAAO,GAAG,MAAM,EAAE,EAAE,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;IAC3D,OAAO,EAAC,MAAM,EAAE,OAAO,KAAK,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,IAAI,EAAC,CAAC;AAC3E,CAAC,CAAC"}
|
|
@@ -7,7 +7,7 @@ import type { BlokComponentContract, BlokComponentDefinition, BlokRenderArgs } f
|
|
|
7
7
|
* each takes: name, schema, placement. It draws nothing. There are two sorts:
|
|
8
8
|
*
|
|
9
9
|
* - A *family* of the base catalog (`ui`, `html`, `shadcn`, `structure`,
|
|
10
|
-
* `scene`, `logo`): `partOf` names the catalog it is part of (`base@
|
|
10
|
+
* `scene`, `logo`): `partOf` names the catalog it is part of (`base@4`). The
|
|
11
11
|
* base catalog is the spec's, and every renderer draws it whole; the families
|
|
12
12
|
* are how this package holds its contracts, one toolkit at a time.
|
|
13
13
|
* - A UI's *own* catalog (the Orkestrator's MikroScene parts): what it draws
|
|
@@ -18,9 +18,9 @@ import type { BlokComponentContract, BlokComponentDefinition, BlokRenderArgs } f
|
|
|
18
18
|
* component of a contract, a map the compiler checks against the contract.
|
|
19
19
|
*/
|
|
20
20
|
/** The base catalog, as components of it are tagged (`origin`). */
|
|
21
|
-
export declare const BASE_CATALOG_REF = "base@
|
|
21
|
+
export declare const BASE_CATALOG_REF = "base@4";
|
|
22
22
|
/** The address the base catalog is published at: what a blok is written for when it names none. */
|
|
23
|
-
export declare const BASE_CATALOG_ADDRESS = "https://arkitekt.live/catalogs/base/
|
|
23
|
+
export declare const BASE_CATALOG_ADDRESS = "https://arkitekt.live/catalogs/base/v4";
|
|
24
24
|
export type BlokComponentContracts = Record<string, BlokComponentContract<any>>;
|
|
25
25
|
export type BlokCatalogContract<TComponents extends BlokComponentContracts = BlokComponentContracts> = {
|
|
26
26
|
name: string;
|
|
@@ -28,7 +28,7 @@ export type BlokCatalogContract<TComponents extends BlokComponentContracts = Blo
|
|
|
28
28
|
version: number | null;
|
|
29
29
|
description: string;
|
|
30
30
|
components: TComponents;
|
|
31
|
-
/** For a family: the catalog it is part of (`base@
|
|
31
|
+
/** For a family: the catalog it is part of (`base@4`). Null on a catalog of its own. */
|
|
32
32
|
partOf: string | null;
|
|
33
33
|
/** For a published catalog: the address it is published at, which is what a blok names it by. */
|
|
34
34
|
id: string | null;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* each takes: name, schema, placement. It draws nothing. There are two sorts:
|
|
6
6
|
*
|
|
7
7
|
* - A *family* of the base catalog (`ui`, `html`, `shadcn`, `structure`,
|
|
8
|
-
* `scene`, `logo`): `partOf` names the catalog it is part of (`base@
|
|
8
|
+
* `scene`, `logo`): `partOf` names the catalog it is part of (`base@4`). The
|
|
9
9
|
* base catalog is the spec's, and every renderer draws it whole; the families
|
|
10
10
|
* are how this package holds its contracts, one toolkit at a time.
|
|
11
11
|
* - A UI's *own* catalog (the Orkestrator's MikroScene parts): what it draws
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
* component of a contract, a map the compiler checks against the contract.
|
|
17
17
|
*/
|
|
18
18
|
/** The base catalog, as components of it are tagged (`origin`). */
|
|
19
|
-
export const BASE_CATALOG_REF = 'base@
|
|
19
|
+
export const BASE_CATALOG_REF = 'base@4';
|
|
20
20
|
/** The address the base catalog is published at: what a blok is written for when it names none. */
|
|
21
|
-
export const BASE_CATALOG_ADDRESS = 'https://arkitekt.live/catalogs/base/
|
|
21
|
+
export const BASE_CATALOG_ADDRESS = 'https://arkitekt.live/catalogs/base/v4';
|
|
22
22
|
export const defineBlokCatalog = (contract) => ({
|
|
23
23
|
...contract,
|
|
24
24
|
version: contract.version ?? null,
|