@arkitektio/bsx 4.3.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 +39 -18
- 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 +19 -8
- package/dist/bsx/parse.d.ts.map +1 -1
- package/dist/bsx/parse.js +49 -59
- package/dist/bsx/parse.js.map +1 -1
- package/dist/bsx/print.d.ts.map +1 -1
- package/dist/bsx/print.js +25 -35
- package/dist/bsx/print.js.map +1 -1
- package/dist/bsx/references.d.ts +48 -54
- package/dist/bsx/references.d.ts.map +1 -1
- package/dist/bsx/references.js +359 -159
- package/dist/bsx/references.js.map +1 -1
- package/dist/catalogs/html.d.ts +3 -3
- package/dist/catalogs/html.d.ts.map +1 -1
- package/dist/catalogs/html.js +3 -3
- package/dist/catalogs/html.js.map +1 -1
- package/dist/catalogs/index.d.ts +172 -180
- package/dist/catalogs/index.d.ts.map +1 -1
- package/dist/catalogs/index.js +6 -2
- package/dist/catalogs/index.js.map +1 -1
- package/dist/catalogs/logo.d.ts +19 -33
- package/dist/catalogs/logo.d.ts.map +1 -1
- package/dist/catalogs/logo.js +4 -5
- package/dist/catalogs/logo.js.map +1 -1
- package/dist/catalogs/parts/data.d.ts +6 -6
- package/dist/catalogs/parts/feedback.d.ts +15 -15
- package/dist/catalogs/parts/forms.d.ts +24 -24
- package/dist/catalogs/parts/html.d.ts +3 -3
- package/dist/catalogs/parts/html.d.ts.map +1 -1
- package/dist/catalogs/parts/html.js +1 -1
- package/dist/catalogs/parts/html.js.map +1 -1
- package/dist/catalogs/parts/icons.d.ts +11 -11
- package/dist/catalogs/parts/icons.js +1 -1
- package/dist/catalogs/parts/index.d.ts +153 -165
- package/dist/catalogs/parts/index.d.ts.map +1 -1
- package/dist/catalogs/parts/layout.d.ts +11 -1
- package/dist/catalogs/parts/layout.d.ts.map +1 -1
- package/dist/catalogs/parts/layout.js +9 -0
- package/dist/catalogs/parts/layout.js.map +1 -1
- package/dist/catalogs/parts/logo.d.ts +17 -32
- package/dist/catalogs/parts/logo.d.ts.map +1 -1
- package/dist/catalogs/parts/logo.js +13 -15
- package/dist/catalogs/parts/logo.js.map +1 -1
- package/dist/catalogs/parts/navigation.d.ts +20 -20
- package/dist/catalogs/parts/overlays.d.ts +55 -55
- package/dist/catalogs/parts/run.d.ts +5 -13
- package/dist/catalogs/parts/run.d.ts.map +1 -1
- package/dist/catalogs/parts/run.js +1 -1
- package/dist/catalogs/parts/scene.d.ts +9 -17
- 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/structure.js +2 -2
- package/dist/catalogs/parts/toast.js +1 -1
- package/dist/catalogs/parts/toast.js.map +1 -1
- package/dist/catalogs/parts/typography.d.ts +3 -3
- package/dist/catalogs/parts/typography.js +1 -1
- package/dist/catalogs/parts/typography.js.map +1 -1
- package/dist/catalogs/props.d.ts +4 -4
- package/dist/catalogs/scene.d.ts +8 -16
- 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/catalogs/shadcn.d.ts +58 -58
- package/dist/catalogs/shadcn.d.ts.map +1 -1
- package/dist/catalogs/shadcn.js +4 -4
- package/dist/catalogs/shadcn.js.map +1 -1
- package/dist/catalogs/structure.d.ts +1 -1
- package/dist/catalogs/structure.d.ts.map +1 -1
- package/dist/catalogs/structure.js +3 -3
- package/dist/catalogs/structure.js.map +1 -1
- package/dist/catalogs/ui.d.ts +83 -73
- package/dist/catalogs/ui.d.ts.map +1 -1
- package/dist/catalogs/ui.js +4 -3
- package/dist/catalogs/ui.js.map +1 -1
- package/dist/catalogs.d.ts +1 -1
- package/dist/catalogs.d.ts.map +1 -1
- package/dist/catalogs.js +2 -2
- package/dist/catalogs.js.map +1 -1
- 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/ports.js +1 -1
- package/dist/ports.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 +8 -6
- package/dist/renderer/baseCatalog.d.ts.map +1 -1
- package/dist/renderer/baseCatalog.js +7 -5
- package/dist/renderer/baseCatalog.js.map +1 -1
- package/dist/renderer/bloks/control.d.ts +20 -2
- package/dist/renderer/bloks/control.d.ts.map +1 -1
- package/dist/renderer/bloks/control.js +98 -15
- package/dist/renderer/bloks/control.js.map +1 -1
- package/dist/renderer/bloks/data.d.ts +6 -6
- package/dist/renderer/bloks/feedback.d.ts +15 -15
- package/dist/renderer/bloks/forms.d.ts +24 -24
- package/dist/renderer/bloks/html.d.ts +2 -2
- package/dist/renderer/bloks/html.js +2 -2
- package/dist/renderer/bloks/icons.d.ts +5 -5
- package/dist/renderer/bloks/index.d.ts +145 -144
- package/dist/renderer/bloks/index.d.ts.map +1 -1
- package/dist/renderer/bloks/index.js +1 -1
- package/dist/renderer/bloks/layout.d.ts +9 -1
- package/dist/renderer/bloks/layout.d.ts.map +1 -1
- package/dist/renderer/bloks/layout.js +15 -0
- package/dist/renderer/bloks/layout.js.map +1 -1
- package/dist/renderer/bloks/logo/index.d.ts +6 -13
- package/dist/renderer/bloks/logo/index.d.ts.map +1 -1
- package/dist/renderer/bloks/logo/index.js +3 -4
- 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 +20 -20
- package/dist/renderer/bloks/overlays.d.ts +55 -55
- package/dist/renderer/bloks/run/components.d.ts +2 -6
- package/dist/renderer/bloks/run/components.d.ts.map +1 -1
- package/dist/renderer/bloks/run/components.js +1 -1
- package/dist/renderer/bloks/scene/index.d.ts +5 -9
- 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/toast.d.ts +1 -1
- package/dist/renderer/bloks/typography.d.ts +3 -3
- package/dist/renderer/bloks/typography.js +1 -1
- package/dist/renderer/catalog.d.ts +4 -7
- package/dist/renderer/catalog.d.ts.map +1 -1
- package/dist/renderer/catalog.js +7 -31
- package/dist/renderer/catalog.js.map +1 -1
- 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.d.ts +31 -19
- package/dist/renderer/declare.d.ts.map +1 -1
- package/dist/renderer/declare.js +44 -18
- 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 +27 -7
- package/dist/renderer/runtime/catalog.d.ts.map +1 -1
- package/dist/renderer/runtime/catalog.js +30 -3
- package/dist/renderer/runtime/catalog.js.map +1 -1
- package/dist/renderer/runtime/components.d.ts +10 -4
- package/dist/renderer/runtime/components.d.ts.map +1 -1
- package/dist/renderer/runtime/components.js +8 -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 +16 -6
- package/dist/renderer/runtime/describe.d.ts.map +1 -1
- package/dist/renderer/runtime/describe.js +5 -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 +2 -0
- package/dist/renderer/runtime/index.d.ts.map +1 -1
- package/dist/renderer/runtime/index.js +2 -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/preflight.d.ts.map +1 -1
- package/dist/renderer/runtime/preflight.js +5 -2
- package/dist/renderer/runtime/preflight.js.map +1 -1
- 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/text.d.ts +28 -0
- package/dist/renderer/runtime/text.d.ts.map +1 -0
- package/dist/renderer/runtime/text.js +82 -0
- package/dist/renderer/runtime/text.js.map +1 -0
- 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/runtime.d.ts +0 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +0 -1
- package/dist/runtime.js.map +1 -1
- package/dist/scene.d.ts +1 -1
- package/dist/scene.d.ts.map +1 -1
- package/dist/scene.js +2 -2
- package/dist/scene.js.map +1 -1
- package/dist/shadcn.d.ts +154 -153
- package/dist/shadcn.d.ts.map +1 -1
- package/dist/shadcn.js +7 -7
- package/dist/shadcn.js.map +1 -1
- package/dist/spec/bsx_v2.json +12324 -6934
- package/dist/spec/catalogs/base@4.json +13175 -0
- package/dist/spec/catalogs/base@4.json.js +13175 -0
- package/dist/spec/catalogs/orkestrator@1.json +489 -0
- package/dist/spec/catalogs/orkestrator@1.json.js +489 -0
- package/dist/spec/catalogs.d.ts +109 -46
- package/dist/spec/catalogs.d.ts.map +1 -1
- package/dist/spec/catalogs.js +243 -75
- package/dist/spec/catalogs.js.map +1 -1
- package/dist/spec/vocabulary.d.ts +44 -7
- package/dist/spec/vocabulary.d.ts.map +1 -1
- package/dist/spec/vocabulary.js +65 -7
- package/dist/spec/vocabulary.js.map +1 -1
- package/dist/spec/vocabulary.json +83 -43
- package/dist/spec/vocabulary.json.js +83 -43
- package/dist/vendor/core/ui/button-group.d.ts +1 -1
- package/dist/vendor/core/ui/button.d.ts +1 -1
- package/dist/vendor/core/ui/field.d.ts +1 -1
- 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 +54 -52
- 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 +51 -64
- package/src/bsx/partial.test.ts +1 -1
- package/src/bsx/print.ts +27 -34
- package/src/bsx/references.test.ts +86 -83
- package/src/bsx/references.ts +391 -198
- package/src/catalogs/catalogs.test.ts +46 -14
- package/src/catalogs/html.ts +3 -3
- package/src/catalogs/index.ts +6 -2
- package/src/catalogs/logo.ts +4 -5
- package/src/catalogs/parts/html.ts +1 -1
- package/src/catalogs/parts/icons.ts +1 -1
- package/src/catalogs/parts/layout.ts +11 -0
- package/src/catalogs/parts/logo.ts +14 -18
- package/src/catalogs/parts/run.ts +1 -1
- package/src/catalogs/parts/scene.ts +1 -7
- package/src/catalogs/parts/structure.ts +2 -2
- package/src/catalogs/parts/toast.ts +1 -1
- package/src/catalogs/parts/typography.ts +1 -1
- package/src/catalogs/scene.ts +3 -3
- package/src/catalogs/shadcn.ts +4 -4
- package/src/catalogs/structure.ts +3 -3
- package/src/catalogs/ui.ts +4 -3
- package/src/catalogs.ts +9 -2
- package/src/logo/actionLogoSource.ts +4 -4
- package/src/ports.ts +1 -1
- package/src/renderer/BlokComponentHost.test.tsx +5 -5
- package/src/renderer/BlokRenderer.tsx +46 -14
- package/src/renderer/addBlokComponents.test.tsx +8 -22
- package/src/renderer/baseCatalog.ts +7 -5
- package/src/renderer/bloks/components.test.tsx +2 -2
- package/src/renderer/bloks/control.tsx +136 -17
- package/src/renderer/bloks/flow.test.tsx +1 -1
- package/src/renderer/bloks/html.tsx +2 -2
- package/src/renderer/bloks/index.ts +1 -1
- package/src/renderer/bloks/layout.tsx +28 -0
- package/src/renderer/bloks/logo/index.tsx +4 -5
- 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/components.tsx +1 -1
- 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/bloks/time.test.tsx +1 -1
- package/src/renderer/bloks/toast.tsx +1 -1
- package/src/renderer/bloks/typography.tsx +1 -1
- package/src/renderer/catalog.tsx +7 -31
- package/src/renderer/declarations.test.ts +38 -51
- package/src/renderer/declarations.ts +67 -88
- package/src/renderer/declare.test.ts +41 -0
- package/src/renderer/declare.ts +70 -32
- 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 +35 -10
- package/src/renderer/runtime/components.tsx +17 -8
- package/src/renderer/runtime/context.tsx +17 -10
- package/src/renderer/runtime/describe.ts +21 -8
- package/src/renderer/runtime/hooks.ts +6 -4
- package/src/renderer/runtime/index.ts +2 -0
- package/src/renderer/runtime/locals.tsx +105 -0
- package/src/renderer/runtime/preflight.ts +5 -2
- package/src/renderer/runtime/scope.tsx +31 -3
- package/src/renderer/runtime/text.test.tsx +65 -0
- package/src/renderer/runtime/text.ts +88 -0
- package/src/renderer/runtime/tree.tsx +16 -4
- package/src/renderer/runtime/types.ts +8 -3
- package/src/runtime.ts +0 -1
- package/src/scene.ts +2 -2
- package/src/shadcn.ts +7 -7
- package/src/spec/bsx_v2.json +12324 -6934
- package/src/spec/catalogs/base@4.json +13175 -0
- package/src/spec/catalogs/orkestrator@1.json +489 -0
- package/src/spec/catalogs.ts +259 -103
- package/src/spec/spec.test.ts +93 -24
- package/src/spec/vocabulary.json +83 -43
- package/src/spec/vocabulary.ts +102 -17
- package/dist/renderer/modules.d.ts +0 -4
- package/dist/renderer/modules.d.ts.map +0 -1
- package/dist/renderer/modules.js +0 -11
- package/dist/renderer/modules.js.map +0 -1
- package/dist/spec/catalogs/base@2.json +0 -355
- package/dist/spec/catalogs/base@2.json.js +0 -355
- package/dist/spec/catalogs/html@1.json +0 -308
- package/dist/spec/catalogs/html@1.json.js +0 -308
- package/dist/spec/catalogs/logo@1.json +0 -1687
- package/dist/spec/catalogs/logo@1.json.js +0 -1687
- package/dist/spec/catalogs/scene@1.json +0 -878
- package/dist/spec/catalogs/scene@1.json.js +0 -878
- package/dist/spec/catalogs/shadcn@1.json +0 -4002
- package/dist/spec/catalogs/shadcn@1.json.js +0 -4002
- package/dist/spec/catalogs/structure@1.json +0 -185
- package/dist/spec/catalogs/structure@1.json.js +0 -185
- package/dist/spec/catalogs/ui@1.json +0 -5349
- package/dist/spec/catalogs/ui@1.json.js +0 -5349
- package/src/renderer/modules.ts +0 -12
- package/src/spec/catalogs/base@2.json +0 -355
- package/src/spec/catalogs/html@1.json +0 -308
- package/src/spec/catalogs/logo@1.json +0 -1687
- package/src/spec/catalogs/scene@1.json +0 -878
- package/src/spec/catalogs/shadcn@1.json +0 -4002
- package/src/spec/catalogs/structure@1.json +0 -185
- package/src/spec/catalogs/ui@1.json +0 -5349
|
@@ -14,7 +14,7 @@ import { SceneFrame } from '../scene/Scene.js';
|
|
|
14
14
|
import { useBlokRunHost, useBlokSpaceHost } from './host.js';
|
|
15
15
|
import { progressFraction, routePoints, splitRoute, throughKeys } from './math.js';
|
|
16
16
|
/**
|
|
17
|
-
* The components that place an action's dependencies in 3D (scene
|
|
17
|
+
* The components that place an action's dependencies in 3D (the scene family). `Space`
|
|
18
18
|
* is a scene whose layout is a shared room, `Placed` draws the agent a
|
|
19
19
|
* dependency is bound to with that agent's own scene blok where the room keeps
|
|
20
20
|
* it, and `Route` draws a line through several.
|
|
@@ -14,15 +14,11 @@ export declare const sceneRenders: {
|
|
|
14
14
|
notDownstreamOf: string[];
|
|
15
15
|
};
|
|
16
16
|
schema: import("zod").ZodObject<{
|
|
17
|
-
chrome: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
18
|
-
none: "none";
|
|
19
|
-
auto: "auto";
|
|
20
|
-
}>>;
|
|
21
17
|
camera: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
18
|
+
top: "top";
|
|
19
|
+
side: "side";
|
|
22
20
|
iso: "iso";
|
|
23
21
|
front: "front";
|
|
24
|
-
side: "side";
|
|
25
|
-
top: "top";
|
|
26
22
|
}>>;
|
|
27
23
|
grid: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
28
24
|
height: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -177,15 +173,15 @@ export declare const sceneRenders: {
|
|
|
177
173
|
title: import("zod").ZodOptional<import("zod").ZodString>;
|
|
178
174
|
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
179
175
|
mode: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
180
|
-
popout: "popout";
|
|
181
176
|
panel: "panel";
|
|
177
|
+
popout: "popout";
|
|
182
178
|
}>>;
|
|
183
179
|
}, import("zod/v4/core").$strip>;
|
|
184
180
|
}>;
|
|
185
181
|
Popout: import("../../runtime").BlokRender<{
|
|
186
182
|
acceptsChildren: true;
|
|
187
183
|
placement: {
|
|
188
|
-
childrenContext: "
|
|
184
|
+
childrenContext: "panel";
|
|
189
185
|
context?: import("../../runtime").BlokComponentContext;
|
|
190
186
|
inheritsContext?: boolean;
|
|
191
187
|
downstreamOf?: readonly string[];
|
|
@@ -194,9 +190,9 @@ export declare const sceneRenders: {
|
|
|
194
190
|
schema: import("zod").ZodObject<{
|
|
195
191
|
node: import("zod").ZodOptional<import("zod").ZodString>;
|
|
196
192
|
trigger: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
197
|
-
always: "always";
|
|
198
193
|
click: "click";
|
|
199
194
|
hover: "hover";
|
|
195
|
+
always: "always";
|
|
200
196
|
}>>;
|
|
201
197
|
open: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
202
198
|
title: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/renderer/bloks/scene/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAC,MAAM,WAAW,CAAC;AAC9E,OAAO,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AAErC,cAAc,QAAQ,CAAC;AAEvB;;;;GAIG;AACH,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/renderer/bloks/scene/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAC,MAAM,WAAW,CAAC;AAC9E,OAAO,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AAErC,cAAc,QAAQ,CAAC;AAEvB;;;;GAIG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAexB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interaction.d.ts","sourceRoot":"","sources":["../../../../src/renderer/bloks/scene/interaction.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA8B,KAAK,cAAc,EAAC,MAAM,+BAA+B,CAAC;AAC/F,OAAO,
|
|
1
|
+
{"version":3,"file":"interaction.d.ts","sourceRoot":"","sources":["../../../../src/renderer/bloks/scene/interaction.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA8B,KAAK,cAAc,EAAC,MAAM,+BAA+B,CAAC;AAC/F,OAAO,EAYL,KAAK,UAAU,EAChB,MAAM,eAAe,CAAC;AAKvB,KAAK,SAAS,GAAG,OAAO,cAAc,CAAC;AAKvC,eAAO,MAAM,aAAa,EAAE,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,CAoD1D,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,UAAU,CAAC,SAAS,CAAC,QAAQ,CAAC,CAoFxD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { onClickSchema, popoutSchema } from '../../../catalogs/parts/scene.js';
|
|
4
|
-
import { BlokRuntimeProvider, BlokScopeProvider, BlokTreeProvider, useBlok, useBlokRuntimeStoreApi, useBlokScope, useBlokTree, useEventAction, useValue, } from '../../runtime/index.js';
|
|
4
|
+
import { BlokItemKeysBridge, BlokRuntimeProvider, BlokScopeProvider, BlokTreeProvider, useBlok, useBlokRuntimeStoreApi, useBlokScope, useBlokItemKeys, useBlokTree, useEventAction, useValue, } from '../../runtime/index.js';
|
|
5
5
|
import { useModel, useSceneNotice, useSceneOverlay, useSceneStoreApi } from './context.js';
|
|
6
6
|
import { useBlokSceneHost } from './host.js';
|
|
7
7
|
import { useBlokTray } from '../run/host.js';
|
|
@@ -111,9 +111,10 @@ export const PopoutRender = ({ component, buildChild }) => {
|
|
|
111
111
|
// So are the blok's runtime and tree: in a scene shared by several bloks
|
|
112
112
|
// that half is outside each of them.
|
|
113
113
|
const scope = useBlokScope();
|
|
114
|
+
const itemKeys = useBlokItemKeys();
|
|
114
115
|
const runtime = useBlokRuntimeStoreApi();
|
|
115
116
|
const tree = useBlokTree();
|
|
116
|
-
const content = React.useMemo(() => (_jsx(BlokRuntimeProvider, { store: runtime, children: _jsx(BlokTreeProvider, { tree: tree, children: _jsx(BlokScopeProvider, { aliases: scope.aliases, values: scope.values, basePath: scope.basePath, children: (component.children ?? []).map(child => (_jsx(React.Fragment, { children: buildChild(child.id) }, child.id))) }) }) })), [buildChild, component, runtime, scope, tree]);
|
|
117
|
+
const content = React.useMemo(() => (_jsx(BlokRuntimeProvider, { store: runtime, children: _jsx(BlokTreeProvider, { tree: tree, children: _jsx(BlokItemKeysBridge, { keys: itemKeys, children: _jsx(BlokScopeProvider, { aliases: scope.aliases, values: scope.values, basePath: scope.basePath, defaults: scope.defaults, children: (component.children ?? []).map(child => (_jsx(React.Fragment, { children: buildChild(child.id) }, child.id))) }) }) }) })), [buildChild, component, itemKeys, runtime, scope, tree]);
|
|
117
118
|
useSceneOverlay({
|
|
118
119
|
visible: Boolean(node) && visible,
|
|
119
120
|
anchor,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interaction.js","sourceRoot":"","sources":["../../../../src/renderer/bloks/scene/interaction.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,aAAa,EAAE,YAAY,EAAsB,MAAM,+BAA+B,CAAC;AAC/F,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,OAAO,EACP,sBAAsB,EACtB,YAAY,EACZ,WAAW,EACX,cAAc,EACd,QAAQ,GAET,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,QAAQ,EAAE,cAAc,EAAE,eAAe,EAAE,gBAAgB,EAAC,MAAM,WAAW,CAAC;AACtF,OAAO,EAAC,gBAAgB,EAAC,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAC,WAAW,EAAC,MAAM,aAAa,CAAC;AAIxC,0GAA0G;AAC1G,MAAM,UAAU,GAAG,CAAC,IAAoB,EAAE,KAAoB,EAAiB,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;AAEnH,MAAM,CAAC,MAAM,aAAa,GAAqC,CAAC,EAAC,SAAS,EAAC,EAAE,EAAE;IAC3E,MAAM,IAAI,GAAG,OAAO,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IAC/C,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,IAAI,GAAG,gBAAgB,EAAE,CAAC;IAChC,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,KAAK,GAAG,QAAQ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AAM,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,YAChH,CAAC,SAAS,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CACvC,KAAC,KAAK,CAAC,QAAQ,cAAiB,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,IAA/B,KAAK,CAAC,EAAE,CAAyC,CACvE,CAAC,GACgB,GACD,GACJ,GACC,CACvB,EACD,CAAC,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,CACxD,CAAC;IACF,eAAe,CAAC;QACd,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,OAAO;QACjC,MAAM;QACN,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;QACzC,KAAK,EAAE,KAAK,IAAI,IAAI,IAAI,IAAI,IAAI,SAAS;QACzC,WAAW;QACX,OAAO;QACP,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO;QACxC,WAAW,EAAE,IAAI,KAAK,IAAI,IAAI,UAAU,KAAK,SAAS,IAAI,OAAO,KAAK,OAAO;QAC7E,SAAS,EAAE,KAAK;KACjB,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC"}
|
|
@@ -53,7 +53,7 @@ export declare const useBaseLayoutProps: (blok: BaseLayoutBlok) => BaseLayoutPro
|
|
|
53
53
|
export declare const useTextPresentationProps: (blok: TextPresentationBlok) => {
|
|
54
54
|
tone: "default" | "muted" | "destructive" | "success" | undefined;
|
|
55
55
|
size: "base" | "xs" | "sm" | "lg" | undefined;
|
|
56
|
-
weight: "bold" | "
|
|
56
|
+
weight: "bold" | "regular" | "medium" | "semibold" | undefined;
|
|
57
57
|
align: "start" | "end" | "center" | undefined;
|
|
58
58
|
mono: boolean | undefined;
|
|
59
59
|
italic: boolean | undefined;
|
|
@@ -65,7 +65,7 @@ export declare const mapTextAlign: (align?: "start" | "center" | "end") => "text
|
|
|
65
65
|
export declare const textVariants: (props?: ({
|
|
66
66
|
tone?: "default" | "muted" | "destructive" | "success" | null | undefined;
|
|
67
67
|
size?: "base" | "xs" | "sm" | "lg" | null | undefined;
|
|
68
|
-
weight?: "bold" | "
|
|
68
|
+
weight?: "bold" | "regular" | "medium" | "semibold" | null | undefined;
|
|
69
69
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
70
70
|
/** Convenience: the class list every text-bearing blok composes. */
|
|
71
71
|
export declare const textPresentationClasses: (presentation: ReturnType<typeof useTextPresentationProps>) => Array<string | false | undefined>;
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import * as z from 'zod';
|
|
3
3
|
/**
|
|
4
4
|
* `<Toast task={move}>`: a notification when a task settles, once per task
|
|
5
|
-
* (ui
|
|
5
|
+
* (the ui family). Each outcome slot (`done`, `failed`, `cancelled`) is optional and
|
|
6
6
|
* holds the text shown for it:
|
|
7
7
|
*
|
|
8
8
|
* <Toast task={move}>
|
|
@@ -17,8 +17,8 @@ export declare const typographyRenders: {
|
|
|
17
17
|
}>>;
|
|
18
18
|
weight: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
19
19
|
bold: "bold";
|
|
20
|
-
medium: "medium";
|
|
21
20
|
regular: "regular";
|
|
21
|
+
medium: "medium";
|
|
22
22
|
semibold: "semibold";
|
|
23
23
|
}>>;
|
|
24
24
|
align: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
@@ -56,8 +56,8 @@ export declare const typographyRenders: {
|
|
|
56
56
|
}>>;
|
|
57
57
|
weight: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
58
58
|
bold: "bold";
|
|
59
|
-
medium: "medium";
|
|
60
59
|
regular: "regular";
|
|
60
|
+
medium: "medium";
|
|
61
61
|
semibold: "semibold";
|
|
62
62
|
}>>;
|
|
63
63
|
align: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
@@ -95,8 +95,8 @@ export declare const typographyRenders: {
|
|
|
95
95
|
}>>;
|
|
96
96
|
weight: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
97
97
|
bold: "bold";
|
|
98
|
-
medium: "medium";
|
|
99
98
|
regular: "regular";
|
|
99
|
+
medium: "medium";
|
|
100
100
|
semibold: "semibold";
|
|
101
101
|
}>>;
|
|
102
102
|
align: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
@@ -78,7 +78,7 @@ const useClock = (active, target) => {
|
|
|
78
78
|
return now;
|
|
79
79
|
};
|
|
80
80
|
/**
|
|
81
|
-
* `<Time value relative? format?>` (ui
|
|
81
|
+
* `<Time value relative? format?>` (the ui family): a moment, absolute or relative.
|
|
82
82
|
* Relative time is measured from the viewed moment: the wall clock live
|
|
83
83
|
* (ticking here), `then` while travelling, so the past renders as it did.
|
|
84
84
|
*/
|
|
@@ -5,7 +5,7 @@ export declare const BlokCatalogProvider: ({ catalog, children }: {
|
|
|
5
5
|
catalog: BlokCatalog;
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
}) => React.JSX.Element;
|
|
8
|
-
/** The app's catalog when no provider says otherwise: the platform's, or
|
|
8
|
+
/** The app's catalog when no provider says otherwise: the platform's, or the language's own elements alone. */
|
|
9
9
|
export declare const appBlokCatalog: () => BlokCatalog;
|
|
10
10
|
/** The catalog the app provides here, or the app's. */
|
|
11
11
|
export declare const useBlokCatalog: () => BlokCatalog;
|
|
@@ -15,12 +15,9 @@ export declare const useBlokCatalog: () => BlokCatalog;
|
|
|
15
15
|
* export) offers them. Called once, by the composition root that installs the
|
|
16
16
|
* modules; core never imports a module.
|
|
17
17
|
*
|
|
18
|
-
* A
|
|
19
|
-
* the
|
|
20
|
-
*
|
|
21
|
-
* already holds (base's, the app's own, another module's) is refused, whoever
|
|
22
|
-
* brought it. Returns the undo, which puts a drawn-over component back (a dev
|
|
23
|
-
* hot reload installs the modules again).
|
|
18
|
+
* A catalog only adds: a name the catalog already holds (the language's, the
|
|
19
|
+
* base catalog's, the app's own, another module's) is refused, whoever brought
|
|
20
|
+
* it. Returns the undo (a dev hot reload installs the modules again).
|
|
24
21
|
*/
|
|
25
22
|
export declare const addBlokComponents: (components: readonly BlokComponentDefinition[], catalog: BlokCatalog) => (() => void);
|
|
26
23
|
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/renderer/catalog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/renderer/catalog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAC,WAAW,EAAE,uBAAuB,EAAC,MAAM,WAAW,CAAC;AAWpE,sDAAsD;AACtD,eAAO,MAAM,mBAAmB,GAAI,uBAAqB;IAAC,OAAO,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAC,sBAE1G,CAAC;AAEF,+GAA+G;AAC/G,eAAO,MAAM,cAAc,QAAO,WAAwD,CAAC;AAE3F,uDAAuD;AACvD,eAAO,MAAM,cAAc,QAAO,WAAuE,CAAC;AAE1G;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,GAC5B,YAAY,SAAS,uBAAuB,EAAE,EAC9C,SAAS,WAAW,KACnB,CAAC,MAAM,IAAI,CAWb,CAAC"}
|
package/dist/renderer/catalog.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { baseBlokCatalog } from './baseCatalog.js';
|
|
4
|
-
import { moduleShadowsOf } from './modules.js';
|
|
5
4
|
import { blokPlatform } from '../platform.js';
|
|
6
5
|
/**
|
|
7
6
|
* The catalog a blok payload is validated and rendered against: which
|
|
@@ -12,53 +11,30 @@ import { blokPlatform } from '../platform.js';
|
|
|
12
11
|
const BlokCatalogContext = React.createContext(null);
|
|
13
12
|
/** The app's catalog, for every renderer below it. */
|
|
14
13
|
export const BlokCatalogProvider = ({ catalog, children }) => (_jsx(BlokCatalogContext.Provider, { value: catalog, children: children }));
|
|
15
|
-
/** The app's catalog when no provider says otherwise: the platform's, or
|
|
14
|
+
/** The app's catalog when no provider says otherwise: the platform's, or the language's own elements alone. */
|
|
16
15
|
export const appBlokCatalog = () => blokPlatform().catalog ?? baseBlokCatalog;
|
|
17
16
|
/** The catalog the app provides here, or the app's. */
|
|
18
17
|
export const useBlokCatalog = () => React.useContext(BlokCatalogContext) ?? appBlokCatalog();
|
|
19
|
-
/** A component of a global catalog (`ui@1`, `scene@1`): what a module may draw over. */
|
|
20
|
-
const isGlobal = (component) => component?.origin?.includes('@') === true;
|
|
21
18
|
/**
|
|
22
19
|
* Adds components a module brings (`ModuleBuiltins.bloks`) to the catalog, so
|
|
23
20
|
* everything that reads the app's catalog (the renderer, the registrar, the
|
|
24
21
|
* export) offers them. Called once, by the composition root that installs the
|
|
25
22
|
* modules; core never imports a module.
|
|
26
23
|
*
|
|
27
|
-
* A
|
|
28
|
-
* the
|
|
29
|
-
*
|
|
30
|
-
* already holds (base's, the app's own, another module's) is refused, whoever
|
|
31
|
-
* brought it. Returns the undo, which puts a drawn-over component back (a dev
|
|
32
|
-
* hot reload installs the modules again).
|
|
24
|
+
* A catalog only adds: a name the catalog already holds (the language's, the
|
|
25
|
+
* base catalog's, the app's own, another module's) is refused, whoever brought
|
|
26
|
+
* it. Returns the undo (a dev hot reload installs the modules again).
|
|
33
27
|
*/
|
|
34
28
|
export const addBlokComponents = (components, catalog) => {
|
|
35
|
-
const
|
|
36
|
-
const taken = components.filter(component => {
|
|
37
|
-
const held = catalog.components.get(component.name);
|
|
38
|
-
return held !== undefined && (!isGlobal(held) || shadows.has(component.name));
|
|
39
|
-
});
|
|
29
|
+
const taken = components.filter(component => catalog.components.has(component.name));
|
|
40
30
|
if (taken.length > 0) {
|
|
41
31
|
throw new Error(`Blok components already in the catalog: ${taken.map(component => component.name).join(', ')}`);
|
|
42
32
|
}
|
|
43
|
-
const
|
|
44
|
-
for (const component of components) {
|
|
45
|
-
const drawnOver = catalog.components.get(component.name);
|
|
46
|
-
if (drawnOver) {
|
|
47
|
-
previous.set(component.name, drawnOver);
|
|
48
|
-
shadows.add(component.name);
|
|
49
|
-
}
|
|
33
|
+
for (const component of components)
|
|
50
34
|
catalog.components.set(component.name, component);
|
|
51
|
-
}
|
|
52
35
|
return () => {
|
|
53
36
|
for (const component of components) {
|
|
54
|
-
if (catalog.components.get(component.name)
|
|
55
|
-
continue;
|
|
56
|
-
const restored = previous.get(component.name);
|
|
57
|
-
if (restored) {
|
|
58
|
-
catalog.components.set(component.name, restored);
|
|
59
|
-
shadows.delete(component.name);
|
|
60
|
-
}
|
|
61
|
-
else
|
|
37
|
+
if (catalog.components.get(component.name) === component)
|
|
62
38
|
catalog.components.delete(component.name);
|
|
63
39
|
}
|
|
64
40
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/renderer/catalog.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/renderer/catalog.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AAGzC;;;;;GAKG;A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AC,IAAI,CAAC,KAAK,SAAS;gBAAE,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACtG,CAAC;IACH,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -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,iBAAi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