@arkitektio/bsx 5.0.0 → 6.1.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 +16 -6
- package/dist/renderer/BlokRenderer.d.ts.map +1 -1
- package/dist/renderer/BlokRenderer.js +32 -13
- 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/Scene.d.ts.map +1 -1
- package/dist/renderer/bloks/scene/Scene.js +4 -2
- package/dist/renderer/bloks/scene/Scene.js.map +1 -1
- package/dist/renderer/bloks/scene/host.d.ts +2 -0
- package/dist/renderer/bloks/scene/host.d.ts.map +1 -1
- package/dist/renderer/bloks/scene/host.js +8 -0
- package/dist/renderer/bloks/scene/host.js.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.test.tsx +22 -0
- package/src/renderer/BlokRenderer.tsx +70 -20
- 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/Scene.tsx +4 -2
- package/src/renderer/bloks/scene/host.tsx +11 -0
- 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,10 +1,9 @@
|
|
|
1
|
-
import { type BlokScopeLocal } from '../bsx/references';
|
|
2
1
|
import type { BlokLocal, BlokLocalChoice } from './persist';
|
|
3
|
-
import { type
|
|
2
|
+
import { type BlokQuery, type BlokSourceStatus, type BlokSubscription, type BlokTaskRecord } from './runtime';
|
|
4
3
|
/**
|
|
5
|
-
* What a v2 blok
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* What a host gets of a v2 blok beside its tree (`Blok`/`BlokRevision`:
|
|
5
|
+
* `vocab`, `resolvedLocals`, `demo`), what its tree declares (its `<query>`
|
|
6
|
+
* and `<subscription>` children), and the data model a renderer starts from.
|
|
8
7
|
*
|
|
9
8
|
* The roots a blok reads (vocabulary `roots.data`) are laid out as:
|
|
10
9
|
*
|
|
@@ -13,18 +12,22 @@ import { type BlokComponentNode, type BlokQuery, type BlokSourceStatus, type Blo
|
|
|
13
12
|
* args: {...}, task: TaskRecord, viewer: {...}, then: null | "...",
|
|
14
13
|
* queries: {<name>: {status, value, error, refetching, fetching_more}},
|
|
15
14
|
* subscriptions: {<name>: {status, value, error}},
|
|
16
|
-
* <
|
|
15
|
+
* <into name>: TaskRecord,
|
|
16
|
+
* $locals: {<local's runtime id, encoded>: value},
|
|
17
17
|
* }
|
|
18
18
|
*
|
|
19
|
-
* `self` reads `deps.self
|
|
19
|
+
* `self` reads `deps.self`; a `<local>` is read by its name through its
|
|
20
|
+
* parent's scope (`runtime/locals`).
|
|
20
21
|
*/
|
|
21
22
|
/**
|
|
22
23
|
* A local as its tree resolves it (`resolvedLocals`): an arg port (`ArgPort`
|
|
23
24
|
* fields) plus `persist`, its kind always said (inferred where the blok left
|
|
24
|
-
* it out, ANY when nothing tells)
|
|
25
|
-
*
|
|
25
|
+
* it out, ANY when nothing tells), and `node`, the id of the `<local>` that
|
|
26
|
+
* declares it. A renderer types a local's values (a kept one too) by its node.
|
|
26
27
|
*/
|
|
27
28
|
export type BlokDeclaredLocal = {
|
|
29
|
+
/** The id of the `<local>` node that declares it. */
|
|
30
|
+
node: string;
|
|
28
31
|
key: string;
|
|
29
32
|
kind: string;
|
|
30
33
|
identifier?: string | null;
|
|
@@ -37,7 +40,7 @@ export type BlokDeclaredLocal = {
|
|
|
37
40
|
persist?: boolean | null;
|
|
38
41
|
};
|
|
39
42
|
/** A child port of a local (a list's item, a dict's or model's fields). */
|
|
40
|
-
export type BlokDeclaredLocalPort = Omit<BlokDeclaredLocal, 'persist'>;
|
|
43
|
+
export type BlokDeclaredLocalPort = Omit<BlokDeclaredLocal, 'persist' | 'node'>;
|
|
41
44
|
export type BlokDeclaredRead = {
|
|
42
45
|
key: string;
|
|
43
46
|
service: string;
|
|
@@ -50,53 +53,57 @@ export type BlokDeclaredRead = {
|
|
|
50
53
|
keep?: number | null;
|
|
51
54
|
history?: string | null;
|
|
52
55
|
};
|
|
56
|
+
/**
|
|
57
|
+
* What a host gets of a blok beside its tree (`Blok`/`BlokRevision`: `vocab`,
|
|
58
|
+
* `resolvedLocals`, `demo`). Its locals, queries and subscriptions are nodes
|
|
59
|
+
* of the tree; `resolvedLocals` is how the server typed the locals.
|
|
60
|
+
*/
|
|
53
61
|
export type BlokDeclarations = {
|
|
54
62
|
vocab?: number | null;
|
|
55
|
-
/** The
|
|
63
|
+
/** The `<local>` nodes as the tree resolves them, each with its `node`: what the renderer types them with. */
|
|
56
64
|
resolvedLocals: readonly BlokDeclaredLocal[];
|
|
57
65
|
demo?: unknown;
|
|
58
|
-
queries?: readonly BlokDeclaredRead[] | null;
|
|
59
|
-
subscriptions?: readonly BlokDeclaredRead[] | null;
|
|
60
66
|
};
|
|
61
67
|
export declare const declaredLocals: (declarations: BlokDeclarations) => BlokLocal[];
|
|
62
|
-
|
|
63
|
-
export declare const
|
|
64
|
-
/**
|
|
65
|
-
export declare const
|
|
68
|
+
/** The reads a blok declares: its `<Blok>`'s `<query>` children. */
|
|
69
|
+
export declare const treeQueries: (roots: ReadonlyArray<unknown> | unknown) => BlokQuery[];
|
|
70
|
+
/** The streams a blok declares: its `<Blok>`'s `<subscription>` children. */
|
|
71
|
+
export declare const treeSubscriptions: (roots: ReadonlyArray<unknown> | unknown) => BlokSubscription[];
|
|
66
72
|
/** The names `into` gives a task call's record, in the tree. */
|
|
67
73
|
export declare const intoNames: (roots: ReadonlyArray<unknown>) => string[];
|
|
68
74
|
/** Every `into` record before its call ran: idle. */
|
|
69
75
|
export declare const intoModel: (roots: ReadonlyArray<unknown>) => Record<string, BlokTaskRecord>;
|
|
70
|
-
/**
|
|
71
|
-
|
|
76
|
+
/**
|
|
77
|
+
* What a renderer shows live before anything synced: idle `into` records and
|
|
78
|
+
* pending reads. Locals read their defaults until written (`runtime/locals`).
|
|
79
|
+
*/
|
|
80
|
+
export declare const liveModel: (roots: ReadonlyArray<unknown>) => {
|
|
72
81
|
data: Record<string, unknown>;
|
|
73
82
|
statuses: Record<string, BlokSourceStatus>;
|
|
74
83
|
};
|
|
75
84
|
/**
|
|
76
85
|
* What a preview renders: the blok's `demo`, mirroring the roots
|
|
77
|
-
* (`{deps, args, task, queries, subscriptions}`), with every
|
|
78
|
-
* answered by its demo value. Nothing is pending in a preview.
|
|
86
|
+
* (`{deps, args, task, queries, subscriptions}`), with every read the tree
|
|
87
|
+
* declares answered by its demo value. Nothing is pending in a preview.
|
|
79
88
|
*/
|
|
80
|
-
export declare const demoModel: (roots: ReadonlyArray<unknown>, declarations: BlokDeclarations) => Record<string, unknown>;
|
|
89
|
+
export declare const demoModel: (roots: ReadonlyArray<unknown>, declarations: Pick<BlokDeclarations, "demo">) => Record<string, unknown>;
|
|
81
90
|
/**
|
|
82
|
-
* What a service serves of a blok
|
|
83
|
-
*
|
|
84
|
-
*
|
|
91
|
+
* What a service serves of a blok as JSON (snake_case values): its tree, and
|
|
92
|
+
* the locals as it resolved them (`resolved_locals`, each with its `node`),
|
|
93
|
+
* when it did.
|
|
85
94
|
*/
|
|
86
95
|
export type BlokDeclarationsJson = {
|
|
87
96
|
vocab?: number | null;
|
|
88
97
|
componentTree?: unknown;
|
|
89
|
-
|
|
98
|
+
resolvedLocals?: unknown;
|
|
90
99
|
demo?: unknown;
|
|
91
|
-
queries?: unknown;
|
|
92
|
-
subscriptions?: unknown;
|
|
93
100
|
};
|
|
94
101
|
/**
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
102
|
+
* The `<local>` nodes of a tree resolved the way the spec and the server
|
|
103
|
+
* resolve them (default, task argument, bind, else ANY), checked unmounted:
|
|
104
|
+
* what a host uses when the server sent no `resolvedLocals`.
|
|
98
105
|
*/
|
|
99
|
-
export declare const
|
|
100
|
-
/** A blok's declarations from JSON a service serves,
|
|
106
|
+
export declare const resolveTreeLocals: (roots: ReadonlyArray<unknown> | unknown) => BlokDeclaredLocal[];
|
|
107
|
+
/** A blok's declarations from JSON a service serves: its resolved locals as served, or resolved from its tree. */
|
|
101
108
|
export declare const parseBlokDeclarations: (raw: BlokDeclarationsJson) => BlokDeclarations;
|
|
102
109
|
//# sourceMappingURL=declarations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declarations.d.ts","sourceRoot":"","sources":["../../src/renderer/declarations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"declarations.d.ts","sourceRoot":"","sources":["../../src/renderer/declarations.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,SAAS,EAAE,eAAe,EAAgB,MAAM,WAAW,CAAC;AACzE,OAAO,EAML,KAAK,SAAS,EAEd,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAErB,KAAK,cAAc,EACpB,MAAM,WAAW,CAAC;AAEnB;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,qBAAqB,EAAE,GAAG,IAAI,CAAC;IACnD,OAAO,CAAC,EAAE,SAAS,eAAe,EAAE,GAAG,IAAI,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF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;;GAGG;AACH,eAAO,MAAM,SAAS,GAAI,OAAO,aAAa,CAAC,OAAO,CAAC,KAAG;IAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;CAMnI,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAI,OAAO,aAAa,CAAC,OAAO,CAAC,EAAE,cAAc,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAyB7H,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAqCF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,OAAO,aAAa,CAAC,OAAO,CAAC,GAAG,OAAO,KAAG,iBAAiB,EAI5F,CAAC;AAEF,kHAAkH;AAClH,eAAO,MAAM,qBAAqB,GAAI,KAAK,oBAAoB,KAAG,gBAIhE,CAAC"}
|
|
@@ -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,K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alogRef, 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,OAA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IAAI,SAAS,CAAC,MAAM,KAAK,gBAAgB,CACjH,CAAC;AAEJ;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,IAAwG,EACxG,OAAoB,EACH,EAAE,CAAC,CAAC;IACrB,EAAE,EAAE,IAAI,CAAC,EAAE;IACX,IAAI,EAAE,IAAI,CAAC,IAAI;IACf,OAAO,EAAE,IAAI,CAAC,OAAO;IACrB,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC;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":["../../src/renderer/persist.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAC,UAAU,EAAoB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"persist.d.ts","sourceRoot":"","sources":["../../src/renderer/persist.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAC,UAAU,EAAoB,MAAM,qBAAqB,CAAC;AAKvE,OAAO,EAAgD,KAAK,gBAAgB,EAAC,MAAM,WAAW,CAAC;AAE/F;;;;;;;;;;;;;;;;;;GAkBG;AAEH,sDAAsD;AACtD,MAAM,MAAM,eAAe,GAAG;IAAC,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAC,CAAC;AAEnG;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,+EAA+E;IAC/E,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,aAAa,EAAE,GAAG,IAAI,CAAC;IAC3C,OAAO,CAA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