@arkitektio/bsx 4.3.0 → 5.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/parse.d.ts +13 -7
- package/dist/bsx/parse.d.ts.map +1 -1
- package/dist/bsx/parse.js +18 -57
- package/dist/bsx/parse.js.map +1 -1
- package/dist/bsx/print.d.ts.map +1 -1
- package/dist/bsx/print.js +22 -35
- package/dist/bsx/print.js.map +1 -1
- package/dist/bsx/references.d.ts +5 -5
- package/dist/bsx/references.d.ts.map +1 -1
- package/dist/bsx/references.js +106 -33
- package/dist/bsx/references.js.map +1 -1
- package/dist/catalogs/html.d.ts +1 -1
- 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 +126 -112
- 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 +5 -5
- package/dist/catalogs/logo.d.ts.map +1 -1
- package/dist/catalogs/logo.js +3 -3
- package/dist/catalogs/logo.js.map +1 -1
- package/dist/catalogs/parts/data.d.ts +5 -5
- package/dist/catalogs/parts/feedback.d.ts +12 -12
- package/dist/catalogs/parts/forms.d.ts +20 -20
- package/dist/catalogs/parts/html.d.ts +1 -1
- 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 +9 -9
- package/dist/catalogs/parts/icons.js +1 -1
- package/dist/catalogs/parts/index.d.ts +120 -110
- 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 +8 -8
- package/dist/catalogs/parts/logo.d.ts.map +1 -1
- package/dist/catalogs/parts/logo.js +2 -2
- package/dist/catalogs/parts/logo.js.map +1 -1
- package/dist/catalogs/parts/navigation.d.ts +16 -16
- package/dist/catalogs/parts/overlays.d.ts +44 -44
- package/dist/catalogs/parts/run.d.ts +5 -5
- package/dist/catalogs/parts/run.js +1 -1
- package/dist/catalogs/parts/scene.d.ts +4 -4
- 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.js +1 -1
- package/dist/catalogs/parts/typography.js.map +1 -1
- package/dist/catalogs/props.d.ts +2 -2
- package/dist/catalogs/scene.d.ts +5 -5
- 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 +47 -47
- 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 +67 -57
- 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/ports.js +1 -1
- package/dist/ports.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 +2 -0
- package/dist/renderer/bloks/control.d.ts.map +1 -1
- package/dist/renderer/bloks/control.js +13 -1
- package/dist/renderer/bloks/control.js.map +1 -1
- package/dist/renderer/bloks/data.d.ts +5 -5
- package/dist/renderer/bloks/feedback.d.ts +12 -12
- package/dist/renderer/bloks/forms.d.ts +20 -20
- package/dist/renderer/bloks/html.js +2 -2
- package/dist/renderer/bloks/icons.d.ts +4 -4
- package/dist/renderer/bloks/index.d.ts +115 -107
- 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 +5 -5
- package/dist/renderer/bloks/logo/index.d.ts.map +1 -1
- package/dist/renderer/bloks/logo/index.js +2 -2
- package/dist/renderer/bloks/logo/index.js.map +1 -1
- package/dist/renderer/bloks/navigation.d.ts +16 -16
- package/dist/renderer/bloks/overlays.d.ts +44 -44
- package/dist/renderer/bloks/run/components.d.ts +2 -2
- package/dist/renderer/bloks/run/components.js +1 -1
- package/dist/renderer/bloks/scene/index.d.ts +2 -2
- package/dist/renderer/bloks/toast.d.ts +1 -1
- 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/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/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 +7 -1
- package/dist/renderer/runtime/components.d.ts.map +1 -1
- package/dist/renderer/runtime/components.js +3 -0
- package/dist/renderer/runtime/components.js.map +1 -1
- package/dist/renderer/runtime/describe.d.ts +14 -4
- package/dist/renderer/runtime/describe.d.ts.map +1 -1
- package/dist/renderer/runtime/describe.js +3 -0
- package/dist/renderer/runtime/describe.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/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/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/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 +118 -110
- package/dist/shadcn.d.ts.map +1 -1
- package/dist/shadcn.js +6 -5
- package/dist/shadcn.js.map +1 -1
- package/dist/spec/bsx_v2.json +3080 -2436
- package/dist/spec/catalogs/base@3.json +13029 -0
- package/dist/spec/catalogs/base@3.json.js +13029 -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 +241 -73
- package/dist/spec/catalogs.js.map +1 -1
- package/dist/spec/vocabulary.d.ts +19 -3
- package/dist/spec/vocabulary.d.ts.map +1 -1
- package/dist/spec/vocabulary.js +15 -2
- package/dist/spec/vocabulary.js.map +1 -1
- package/dist/spec/vocabulary.json +30 -16
- package/dist/spec/vocabulary.json.js +30 -16
- 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/infer.test.ts +18 -26
- package/src/bsx/language.test.ts +1 -1
- package/src/bsx/parse.ts +18 -62
- package/src/bsx/partial.test.ts +1 -1
- package/src/bsx/print.ts +24 -34
- package/src/bsx/references.test.ts +16 -14
- package/src/bsx/references.ts +96 -38
- package/src/catalogs/catalogs.test.ts +45 -14
- package/src/catalogs/html.ts +3 -3
- package/src/catalogs/index.ts +6 -2
- package/src/catalogs/logo.ts +3 -3
- 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 +2 -2
- package/src/catalogs/parts/run.ts +1 -1
- 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/ports.ts +1 -1
- 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 +17 -1
- 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 +2 -2
- package/src/renderer/bloks/run/components.tsx +1 -1
- 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/declare.test.ts +41 -0
- package/src/renderer/declare.ts +70 -32
- package/src/renderer/runtime/catalog.ts +35 -10
- package/src/renderer/runtime/components.tsx +10 -1
- package/src/renderer/runtime/describe.ts +17 -4
- package/src/renderer/runtime/index.ts +1 -0
- package/src/renderer/runtime/preflight.ts +5 -2
- package/src/renderer/runtime/text.test.tsx +65 -0
- package/src/renderer/runtime/text.ts +88 -0
- package/src/runtime.ts +0 -1
- package/src/scene.ts +2 -2
- package/src/shadcn.ts +6 -5
- package/src/spec/bsx_v2.json +3080 -2436
- package/src/spec/catalogs/base@3.json +13029 -0
- package/src/spec/catalogs/orkestrator@1.json +489 -0
- package/src/spec/catalogs.ts +257 -101
- package/src/spec/spec.test.ts +87 -21
- package/src/spec/vocabulary.json +30 -16
- package/src/spec/vocabulary.ts +33 -7
- 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
|
@@ -1,28 +1,59 @@
|
|
|
1
|
-
import {readFileSync} from 'node:fs';
|
|
2
1
|
import {describe, expect, it} from 'vitest';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import {controlBlokComponents} from '../renderer/bloks/control';
|
|
3
|
+
import {BASE_CATALOG_REF, describeBlokContract, type SpecComponentJson} from '../renderer/runtime';
|
|
4
|
+
import baseCatalogJson from '../spec/catalogs/base@3.json';
|
|
5
|
+
import {baseFamilies} from './index';
|
|
5
6
|
import {parts} from './parts';
|
|
6
|
-
import baseCatalogJson from '../spec/catalogs/base@2.json';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/** What the spec adds to an entry beside what its contract says: where it is listed, and what the spec alone knows of it. */
|
|
9
|
+
const SPEC_OWNED = ['group', 'kinds', 'touch', 'since', 'service'] as const;
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
type BaseEntry = SpecComponentJson & {group: string};
|
|
12
|
+
|
|
13
|
+
const shipped = new Map((baseCatalogJson.components as unknown as BaseEntry[]).map(component => [component.name, component]));
|
|
14
|
+
|
|
15
|
+
const asContract = (entry: BaseEntry): SpecComponentJson =>
|
|
16
|
+
Object.fromEntries(Object.entries(entry).filter(([key]) => !(SPEC_OWNED as readonly string[]).includes(key))) as SpecComponentJson;
|
|
17
|
+
|
|
18
|
+
describe('the families of the base catalog', () => {
|
|
19
|
+
it('are what the spec\'s base catalog says, component for component', () => {
|
|
20
|
+
for (const family of baseFamilies) {
|
|
21
|
+
expect(family.partOf, family.name).toBe(BASE_CATALOG_REF);
|
|
22
|
+
for (const described of describeBlokContract(family).components) {
|
|
23
|
+
const entry = shipped.get(described.name);
|
|
24
|
+
expect(entry, `<${described.name}> is not in the base catalog: rebuild it from \`pnpm spec:export\``).toBeDefined();
|
|
25
|
+
if (!entry) continue;
|
|
26
|
+
expect(entry.group, described.name).toBe(family.name);
|
|
27
|
+
expect(asContract(entry), described.name).toEqual(described);
|
|
28
|
+
}
|
|
14
29
|
}
|
|
15
30
|
});
|
|
16
31
|
|
|
17
|
-
it('hold each component once, and never one
|
|
18
|
-
const
|
|
19
|
-
const names =
|
|
32
|
+
it('hold each component once, and never one the renderer draws itself', () => {
|
|
33
|
+
const own = new Set(controlBlokComponents.map(component => component.name));
|
|
34
|
+
const names = baseFamilies.flatMap(family => Object.keys(family.components));
|
|
20
35
|
expect(names.filter((name, index) => names.indexOf(name) !== index)).toEqual([]);
|
|
21
|
-
expect(names.filter(name =>
|
|
36
|
+
expect(names.filter(name => own.has(name))).toEqual([]);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('are, with what the renderer draws itself, the whole base catalog', () => {
|
|
40
|
+
const drawn = new Set([...baseFamilies.flatMap(family => Object.keys(family.components)), ...controlBlokComponents.map(component => component.name)]);
|
|
41
|
+
expect([...shipped.keys()].filter(name => !drawn.has(name))).toEqual([]);
|
|
42
|
+
expect([...drawn].filter(name => !shipped.has(name))).toEqual([]);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('take, where the renderer draws a component itself, the props the base catalog lists', () => {
|
|
46
|
+
for (const component of controlBlokComponents) {
|
|
47
|
+
const entry = shipped.get(component.name);
|
|
48
|
+
expect(entry, component.name).toBeDefined();
|
|
49
|
+
expect(entry?.group === 'language' || entry?.group === 'run', component.name).toBe(true);
|
|
50
|
+
const props = Object.keys(component.schema.shape).filter(key => key !== 'children').sort();
|
|
51
|
+
expect(props, component.name).toEqual((entry?.props ?? []).map(prop => prop.key).sort());
|
|
52
|
+
}
|
|
22
53
|
});
|
|
23
54
|
|
|
24
55
|
it('use every contract the package defines', () => {
|
|
25
|
-
const used = new Set(
|
|
56
|
+
const used = new Set(baseFamilies.flatMap(family => Object.keys(family.components)));
|
|
26
57
|
expect(Object.keys(parts).filter(name => !used.has(name))).toEqual([]);
|
|
27
58
|
});
|
|
28
59
|
});
|
package/src/catalogs/html.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {defineBlokCatalog} from '../renderer/runtime/catalog';
|
|
1
|
+
import {BASE_CATALOG_REF, defineBlokCatalog} from '../renderer/runtime/catalog';
|
|
2
2
|
import {parts} from './parts';
|
|
3
3
|
|
|
4
|
-
/** `html
|
|
4
|
+
/** The `html` family of the base catalog. */
|
|
5
5
|
export const htmlCatalog = defineBlokCatalog({
|
|
6
6
|
name: "html",
|
|
7
|
-
|
|
7
|
+
partOf: BASE_CATALOG_REF,
|
|
8
8
|
description: "Plain containers that translate directly to React Native: div (View), p and span (Text).",
|
|
9
9
|
components: {
|
|
10
10
|
div: parts.div,
|
package/src/catalogs/index.ts
CHANGED
|
@@ -8,5 +8,9 @@ import {uiCatalog} from './ui';
|
|
|
8
8
|
export {htmlCatalog, logoCatalog, sceneCatalog, shadcnCatalog, structureCatalog, uiCatalog};
|
|
9
9
|
export * from './props';
|
|
10
10
|
|
|
11
|
-
/**
|
|
12
|
-
|
|
11
|
+
/**
|
|
12
|
+
* The families of the base catalog this package holds contracts for: every
|
|
13
|
+
* component of it that is not the language's own (`renderer/bloks/control`).
|
|
14
|
+
* The spec's `catalogs/base@3.json` is what they say (`catalogs.test.ts`).
|
|
15
|
+
*/
|
|
16
|
+
export const baseFamilies = [uiCatalog, htmlCatalog, logoCatalog, sceneCatalog, structureCatalog, shadcnCatalog] as const;
|
package/src/catalogs/logo.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {defineBlokCatalog} from '../renderer/runtime/catalog';
|
|
1
|
+
import {BASE_CATALOG_REF, defineBlokCatalog} from '../renderer/runtime/catalog';
|
|
2
2
|
import {parts} from './parts';
|
|
3
3
|
|
|
4
|
-
/** `logo
|
|
4
|
+
/** The `logo` family of the base catalog. */
|
|
5
5
|
export const logoCatalog = defineBlokCatalog({
|
|
6
6
|
name: "logo",
|
|
7
|
-
|
|
7
|
+
partOf: BASE_CATALOG_REF,
|
|
8
8
|
description: "SVG drawing for logos and action logos; the palette is restricted to the logo pens.",
|
|
9
9
|
components: {
|
|
10
10
|
ActionLogo: parts.ActionLogo,
|
|
@@ -3,7 +3,7 @@ import type {BlokComponentContracts} from '../../renderer/runtime/catalog';
|
|
|
3
3
|
import {BlokPropSchemas} from '../../renderer/runtime/schemas';
|
|
4
4
|
import {actionProp, boolSchema, classNameSchema, contentSchema, layoutFields, textFields} from '../props';
|
|
5
5
|
|
|
6
|
-
/** ui
|
|
6
|
+
/** the ui family's links and media: `Link`, `Image` and `Code`. */
|
|
7
7
|
|
|
8
8
|
export const htmlContracts = {
|
|
9
9
|
Link: {
|
|
@@ -3,7 +3,7 @@ import type {BlokComponentContracts} from '../../renderer/runtime/catalog';
|
|
|
3
3
|
import {classNameSchema, numberSchema} from '../props';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* The icons a blok payload may name, and `Icon` (ui
|
|
6
|
+
* The icons a blok payload may name, and `Icon` (the ui family).
|
|
7
7
|
*
|
|
8
8
|
* The names are spelled out here so the contract carries no icon set: the
|
|
9
9
|
* renderer's `BLOK_ICONS` map is typed against this tuple, so a name without a
|
|
@@ -152,6 +152,17 @@ export const layoutContracts = {
|
|
|
152
152
|
})
|
|
153
153
|
.describe('A scrollable region with styled scrollbars.'),
|
|
154
154
|
},
|
|
155
|
+
List: {
|
|
156
|
+
schema: z
|
|
157
|
+
.object({
|
|
158
|
+
children: childListSchema,
|
|
159
|
+
className: classNameSchema,
|
|
160
|
+
height: sizeSchema.describe('CSS height of the list; it scrolls inside it. Fills its parent when left out.'),
|
|
161
|
+
})
|
|
162
|
+
.describe(
|
|
163
|
+
'A long list: a `<foreach>` placed directly inside it is drawn row by row as it scrolls into view, so thousands of items cost what a screenful does. Anything else inside it is drawn as a Column would.',
|
|
164
|
+
),
|
|
165
|
+
},
|
|
155
166
|
Resizable: {
|
|
156
167
|
schema: z
|
|
157
168
|
.object({
|
|
@@ -5,7 +5,7 @@ import {loadVocabulary} from '../../spec/vocabulary';
|
|
|
5
5
|
import {actionProp, describedString} from '../props';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* The `logo
|
|
8
|
+
* The `logo` family of the blok language: the `AgentLogo` and `ActionLogo`
|
|
9
9
|
* roots and the classic SVG elements as components.
|
|
10
10
|
*
|
|
11
11
|
* A logo root sits in html like `Scene` does and opens the `logo` context, so a
|
|
@@ -156,7 +156,7 @@ const gradientUnits = z
|
|
|
156
156
|
.optional()
|
|
157
157
|
.describe('Whether the coordinates are fractions of the shape (the default) or user units.');
|
|
158
158
|
|
|
159
|
-
/** The `logo
|
|
159
|
+
/** The `logo` family: the root, seven shapes, text, and what shapes reference. */
|
|
160
160
|
export const logoContracts = {
|
|
161
161
|
[AGENT_LOGO_ROOT]: logoRoot(
|
|
162
162
|
"The root of an agent's logo: a drawing in the viewer's pens. Its children are SVG shapes.",
|
|
@@ -4,7 +4,7 @@ import {describedString} from '../props';
|
|
|
4
4
|
import {sceneSchema} from './scene';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* The components that place an action's dependencies in 3D (scene
|
|
7
|
+
* The components that place an action's dependencies in 3D (the scene family). `Space`
|
|
8
8
|
* is a scene whose layout is shared: a room the whole organization arranges,
|
|
9
9
|
* found again by its `room` (not `id`: that is every node's own explicit id). `Placed` draws the agent a dependency is bound to
|
|
10
10
|
* with that agent's own scene blok, where the room keeps it, and `Route` draws
|
|
@@ -4,9 +4,9 @@ import {BlokPropSchemas} from '../../renderer/runtime/schemas';
|
|
|
4
4
|
import {actionProp, bindSchema, boolSchema, classNameSchema, disabledSchema, sizeSchema, structureValueSchema} from '../props';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* structure
|
|
7
|
+
* the structure family: bloks over other modules' objects, by structure identifier. The
|
|
8
8
|
* contract only: drawing one needs the app's smart system (its option sources,
|
|
9
|
-
* displays and viewers), so every app that claims structure
|
|
9
|
+
* displays and viewers), so every app that claims the structure family draws it itself.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
const emptyTextSchema = BlokPropSchemas.DynamicString.optional().describe(
|
|
@@ -2,7 +2,7 @@ import * as z from 'zod';
|
|
|
2
2
|
import type {BlokComponentContracts} from '../../renderer/runtime/catalog';
|
|
3
3
|
import {BlokPropSchemas} from '../../renderer/runtime/schemas';
|
|
4
4
|
|
|
5
|
-
/** `<Toast task={move}>` (ui
|
|
5
|
+
/** `<Toast task={move}>` (the ui family) and its outcome slots `done`, `failed`, `cancelled`. */
|
|
6
6
|
|
|
7
7
|
const toastSchema = z
|
|
8
8
|
.object({
|
|
@@ -3,7 +3,7 @@ import type {BlokComponentContracts} from '../../renderer/runtime/catalog';
|
|
|
3
3
|
import {BlokPropSchemas} from '../../renderer/runtime/schemas';
|
|
4
4
|
import {classNameSchema, contentSchema, headingLevelSchema, textAlignSchema, textFields} from '../props';
|
|
5
5
|
|
|
6
|
-
/** Text-bearing components: `Text` (ui
|
|
6
|
+
/** Text-bearing components: `Text` (the ui family), `p` and `span` (the html family), `Heading`, `Kbd`, `Markdown`, `Time`. */
|
|
7
7
|
|
|
8
8
|
/** `Text` and `p`/`span` differ only in the element they render: one schema. */
|
|
9
9
|
const textComponentSchema = z
|
package/src/catalogs/scene.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {defineBlokCatalog} from '../renderer/runtime/catalog';
|
|
1
|
+
import {BASE_CATALOG_REF, defineBlokCatalog} from '../renderer/runtime/catalog';
|
|
2
2
|
import {parts} from './parts';
|
|
3
3
|
|
|
4
|
-
/** `scene
|
|
4
|
+
/** The `scene` family of the base catalog. */
|
|
5
5
|
export const sceneCatalog = defineBlokCatalog({
|
|
6
6
|
name: "scene",
|
|
7
|
-
|
|
7
|
+
partOf: BASE_CATALOG_REF,
|
|
8
8
|
description: "3D components: the Scene and Space roots, models, verb modifiers on a model's nodes, the HTML bridge (Popout), and the placed dependencies of a Space.",
|
|
9
9
|
components: {
|
|
10
10
|
Animate: parts.Animate,
|
package/src/catalogs/shadcn.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {defineBlokCatalog} from '../renderer/runtime/catalog';
|
|
1
|
+
import {BASE_CATALOG_REF, defineBlokCatalog} from '../renderer/runtime/catalog';
|
|
2
2
|
import {parts} from './parts';
|
|
3
3
|
|
|
4
|
-
/** `shadcn
|
|
4
|
+
/** The `shadcn` family of the base catalog. */
|
|
5
5
|
export const shadcnCatalog = defineBlokCatalog({
|
|
6
6
|
name: "shadcn",
|
|
7
|
-
|
|
8
|
-
description: "The shadcn families beyond ui
|
|
7
|
+
partOf: BASE_CATALOG_REF,
|
|
8
|
+
description: "The shadcn families beyond the ui family (alert dialogs, sheets, drawers, menus, calendars, carousels, resizable panels, bento grids ...), charts and the raw inspector.",
|
|
9
9
|
components: {
|
|
10
10
|
AlertDialog: {...parts.AlertDialog, events: {onOpenChange: [{key: "value", kind: "BOOL", description: "Whether it is open now."}]}},
|
|
11
11
|
AlertDialogAction: parts.AlertDialogAction,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {defineBlokCatalog} from '../renderer/runtime/catalog';
|
|
1
|
+
import {BASE_CATALOG_REF, defineBlokCatalog} from '../renderer/runtime/catalog';
|
|
2
2
|
import {parts} from './parts';
|
|
3
3
|
|
|
4
|
-
/** `structure
|
|
4
|
+
/** The `structure` family of the base catalog. */
|
|
5
5
|
export const structureCatalog = defineBlokCatalog({
|
|
6
6
|
name: "structure",
|
|
7
|
-
|
|
7
|
+
partOf: BASE_CATALOG_REF,
|
|
8
8
|
description: "Pick, show and view structures, typed by `\"@package/key\"`.",
|
|
9
9
|
components: {
|
|
10
10
|
StructureDisplay: parts.StructureDisplay,
|
package/src/catalogs/ui.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {defineBlokCatalog} from '../renderer/runtime/catalog';
|
|
1
|
+
import {BASE_CATALOG_REF, defineBlokCatalog} from '../renderer/runtime/catalog';
|
|
2
2
|
import {parts} from './parts';
|
|
3
3
|
|
|
4
|
-
/** `ui
|
|
4
|
+
/** The `ui` family of the base catalog. */
|
|
5
5
|
export const uiCatalog = defineBlokCatalog({
|
|
6
6
|
name: "ui",
|
|
7
|
-
|
|
7
|
+
partOf: BASE_CATALOG_REF,
|
|
8
8
|
description: "Standard HTML components: layout, text, feedback, forms, data and overlays (shadcn-based).",
|
|
9
9
|
components: {
|
|
10
10
|
Accordion: {...parts.Accordion, events: {onChange: [{key: "value", kind: "ANY", description: "The open/pressed value(s): a string, or a list when multiple."}]}},
|
|
@@ -50,6 +50,7 @@ export const uiCatalog = defineBlokCatalog({
|
|
|
50
50
|
RadioGroup: {...parts.RadioGroup, events: {onChange: [{key: "value", kind: "STRING", description: "The value now chosen."}]}, bindKinds: {bind: "STRING"}},
|
|
51
51
|
RadioGroupItem: {...parts.RadioGroupItem, textProp: "label"},
|
|
52
52
|
Row: parts.Row,
|
|
53
|
+
List: parts.List,
|
|
53
54
|
ScrollArea: parts.ScrollArea,
|
|
54
55
|
Select: {...parts.Select, events: {onChange: [{key: "value", kind: "STRING", description: "The value now chosen."}]}, bindKinds: {bind: "STRING"}},
|
|
55
56
|
SelectContent: parts.SelectContent,
|
package/src/catalogs.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
// @arkitektio/bsx/catalogs: the
|
|
1
|
+
// @arkitektio/bsx/catalogs: the contracts of the base catalog's families (ui, html, logo, scene, structure, shadcn)
|
|
2
2
|
// and the prop-schema vocabulary to define a UI's own. zod only: no React, no DOM.
|
|
3
3
|
export * from './catalogs/index';
|
|
4
|
-
export {
|
|
4
|
+
export {
|
|
5
|
+
BASE_CATALOG_ADDRESS,
|
|
6
|
+
BASE_CATALOG_REF,
|
|
7
|
+
catalogRef,
|
|
8
|
+
defineBlokCatalog,
|
|
9
|
+
type BlokCatalogContract,
|
|
10
|
+
type BlokComponentContracts,
|
|
11
|
+
} from './renderer/runtime/catalog';
|
|
5
12
|
export type {BlokComponentContract} from './renderer/runtime/components';
|
|
6
13
|
export {describeBlokContract, specJsonText, type SpecCatalogJson} from './renderer/runtime/describe';
|
package/src/ports.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @arkitektio/bsx/ports: an action's form, the port engine and its widgets. What the app gives it is
|
|
2
|
-
// `configurePortHost`; `hostedStructure` draws structure
|
|
2
|
+
// `configurePortHost`; `hostedStructure` draws the structure family with the same host. A form needs the
|
|
3
3
|
// optional peers react-hook-form, @hookform/resolvers, cmdk and date-fns.
|
|
4
4
|
export * from './ports/engine/DependencyContext';
|
|
5
5
|
export * from './ports/engine/EffectWrapper';
|
|
@@ -5,12 +5,11 @@ import * as z from "zod";
|
|
|
5
5
|
import { cleanup, screen } from "@testing-library/react";
|
|
6
6
|
import { renderBsx, testCatalog} from "./bloks/testing";
|
|
7
7
|
import { addBlokComponents } from "./catalog";
|
|
8
|
-
import { moduleShadowsOf } from "./modules";
|
|
9
8
|
import { createBlokCatalog, createBlokComponent } from "./runtime";
|
|
10
9
|
|
|
11
10
|
const part = (name: string) => createBlokComponent({ name, schema: z.object({}) }, () => null);
|
|
12
|
-
/** A component of
|
|
13
|
-
const
|
|
11
|
+
/** A component of the base catalog, as `implementBlokCatalog` tags one of its families'. */
|
|
12
|
+
const base = (name: string) => ({ ...part(name), origin: "base@3" });
|
|
14
13
|
|
|
15
14
|
describe("addBlokComponents", () => {
|
|
16
15
|
it("adds a module's components and takes them back out", () => {
|
|
@@ -29,36 +28,23 @@ describe("addBlokComponents", () => {
|
|
|
29
28
|
expect([...catalog.components.keys()]).toEqual(["Card", "foreach", "MikroScene"]);
|
|
30
29
|
});
|
|
31
30
|
|
|
32
|
-
it("
|
|
33
|
-
const standard =
|
|
34
|
-
const mine = part("Slider");
|
|
31
|
+
it("never draws over a component of the base catalog: a catalog only adds", () => {
|
|
32
|
+
const standard = base("Slider");
|
|
35
33
|
const catalog = createBlokCatalog("test", [standard]);
|
|
36
|
-
const undo = addBlokComponents([mine], catalog);
|
|
37
|
-
expect(catalog.components.get("Slider")).toBe(mine);
|
|
38
|
-
// A second module cannot draw over it again.
|
|
39
34
|
expect(() => addBlokComponents([part("Slider")], catalog)).toThrow(/Slider/);
|
|
40
|
-
undo();
|
|
41
35
|
expect(catalog.components.get("Slider")).toBe(standard);
|
|
42
36
|
});
|
|
43
37
|
|
|
44
38
|
it("renders the module's component where a blok uses the name", () => {
|
|
45
|
-
const mine = createBlokComponent({ name: "
|
|
39
|
+
const mine = createBlokComponent({ name: "Gauge", schema: z.object({}) }, () => <span>my gauge</span>);
|
|
46
40
|
const undo = addBlokComponents([mine], testCatalog());
|
|
47
41
|
try {
|
|
48
|
-
renderBsx(testCatalog(), "<Card><
|
|
49
|
-
expect(screen.queryByText("my
|
|
42
|
+
renderBsx(testCatalog(), "<Card><Gauge /></Card>");
|
|
43
|
+
expect(screen.queryByText("my gauge")).not.toBeNull();
|
|
50
44
|
} finally {
|
|
51
45
|
cleanup();
|
|
52
46
|
undo();
|
|
53
47
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
it("records a drawn-over global component as the module's own until undone", () => {
|
|
57
|
-
const catalog = createBlokCatalog("test", [global("Slider")]);
|
|
58
|
-
expect(moduleShadowsOf(catalog).has("Slider")).toBe(false);
|
|
59
|
-
const undo = addBlokComponents([part("Slider")], catalog);
|
|
60
|
-
expect(moduleShadowsOf(catalog).has("Slider")).toBe(true);
|
|
61
|
-
undo();
|
|
62
|
-
expect(moduleShadowsOf(catalog).has("Slider")).toBe(false);
|
|
48
|
+
expect(testCatalog().components.has("Gauge")).toBe(false);
|
|
63
49
|
});
|
|
64
50
|
});
|
|
@@ -2,13 +2,15 @@ import {controlBlokComponents} from './bloks/control';
|
|
|
2
2
|
import {createBlokCatalog, type BlokCatalog} from './runtime';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* The
|
|
6
|
-
*
|
|
7
|
-
* `fragment`, `suspense`/`fallback`/`error`,
|
|
8
|
-
*
|
|
5
|
+
* The part of the base catalog the renderer itself draws, whatever toolkit
|
|
6
|
+
* draws the rest: the language's elements (`if`/`else`, `foreach`,
|
|
7
|
+
* `match`/`case`/`default`, `fragment`, `suspense`/`fallback`/`error`, the
|
|
8
|
+
* context root `Html`, text) and the parts of a host's interface a blok may
|
|
9
|
+
* place (`ask`, `args`, `timeline`, ...), which the host supplies. Its
|
|
10
|
+
* functions are the vocabulary's (`functions/v2`), evaluated by the renderer.
|
|
9
11
|
*/
|
|
10
12
|
export const BASE_CATALOG_NAME = 'base';
|
|
11
|
-
export const BASE_CATALOG_VERSION =
|
|
13
|
+
export const BASE_CATALOG_VERSION = 3;
|
|
12
14
|
export const BASE_CATALOG_ID = `${BASE_CATALOG_NAME}@${BASE_CATALOG_VERSION}`;
|
|
13
15
|
|
|
14
16
|
export const baseBlokCatalog: BlokCatalog = createBlokCatalog(BASE_CATALOG_ID, controlBlokComponents);
|
|
@@ -8,7 +8,7 @@ afterEach(cleanup);
|
|
|
8
8
|
const render = (roots: unknown[], initialState?: unknown) =>
|
|
9
9
|
renderBlokDocument(testCatalog(), roots, initialState);
|
|
10
10
|
|
|
11
|
-
describe('links and media (ui
|
|
11
|
+
describe('links and media (the ui family)', () => {
|
|
12
12
|
it('renders a link, inline code and a heading', () => {
|
|
13
13
|
const {errors} = render([
|
|
14
14
|
{
|
|
@@ -33,7 +33,7 @@ describe('links and media (ui@1)', () => {
|
|
|
33
33
|
expect(screen.getByRole('heading', {level: 2}).textContent).toBe('Overview');
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
it('keeps raw html to the three containers html
|
|
36
|
+
it('keeps raw html to the three containers the html family has', () => {
|
|
37
37
|
expect(testCatalog().components.has('div')).toBe(true);
|
|
38
38
|
expect(testCatalog().components.has('p')).toBe(true);
|
|
39
39
|
expect(testCatalog().components.has('span')).toBe(true);
|
|
@@ -22,7 +22,7 @@ import {useBlokRunHost} from './run/host';
|
|
|
22
22
|
import {blokPlatform} from '../../platform';
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
* The language of base
|
|
25
|
+
* The language of the base catalog (`core/blok/spec/base_v2.json`): components that
|
|
26
26
|
* decide *whether* and *how often* their children render, rather than drawing
|
|
27
27
|
* anything themselves. Lowercase names are reserved for language.
|
|
28
28
|
*
|
|
@@ -228,6 +228,21 @@ export const Else = createBlokComponent(
|
|
|
228
228
|
({buildChild, component}) => renderDeclaredChildren(component, buildChild),
|
|
229
229
|
);
|
|
230
230
|
|
|
231
|
+
/** A run of text, as the parser stores it: drawn as it stands where no component took it (`runtime/text`). */
|
|
232
|
+
export const TextNode = createBlokComponent(
|
|
233
|
+
{
|
|
234
|
+
name: '#text',
|
|
235
|
+
schema: z
|
|
236
|
+
.object({value: z.unknown().describe('The text: a literal, or an expression whose value is shown as text.')})
|
|
237
|
+
.describe('A run of text between elements: what the parser stores it as (no element can be called this).'),
|
|
238
|
+
},
|
|
239
|
+
({component, schema}) => {
|
|
240
|
+
const blok = useBlok(component, schema);
|
|
241
|
+
const value = useValue(blok.value);
|
|
242
|
+
return <>{value === null || value === undefined ? null : typeof value === 'string' ? value : String(value)}</>;
|
|
243
|
+
},
|
|
244
|
+
);
|
|
245
|
+
|
|
231
246
|
export const Fragment = createBlokComponent(
|
|
232
247
|
{
|
|
233
248
|
name: 'fragment',
|
|
@@ -540,6 +555,7 @@ export const Timeline = createBlokComponent(
|
|
|
540
555
|
);
|
|
541
556
|
|
|
542
557
|
export const controlBlokComponents = [
|
|
558
|
+
TextNode,
|
|
543
559
|
Foreach,
|
|
544
560
|
If,
|
|
545
561
|
Else,
|
|
@@ -5,7 +5,7 @@ import {foreachItemIds} from './control';
|
|
|
5
5
|
import {renderBsx, testCatalog} from './testing';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* The language of base
|
|
8
|
+
* The language of the base catalog rendered end to end, from BSX: branches, loops, the
|
|
9
9
|
* `when` guard, and the async model (suspense, fallback, error, stale).
|
|
10
10
|
*/
|
|
11
11
|
|
|
@@ -8,8 +8,8 @@ import {renderContent, textPresentationClasses, useTextPresentationProps} from '
|
|
|
8
8
|
type Contracts = typeof htmlContracts;
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* ui
|
|
12
|
-
* part of the language; html
|
|
11
|
+
* The ui family's links and media: `Link`, `Image` and `Code`. Raw HTML tags are not
|
|
12
|
+
* part of the language; the html family keeps only `div`, `p` and `span`, the
|
|
13
13
|
* containers that translate directly to React Native (View, Text).
|
|
14
14
|
*/
|
|
15
15
|
|
|
@@ -13,7 +13,7 @@ import {typographyRenders} from './typography';
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* The shadcn/HTML/SVG renders, by component name: what `@arkitektio/bsx/shadcn`
|
|
16
|
-
* implements ui
|
|
16
|
+
* implements the ui family, the html family, the logo family and the shadcn family with. Grouped by family as the
|
|
17
17
|
* contracts are (`catalogs/parts`).
|
|
18
18
|
*/
|
|
19
19
|
export const domRenders = {
|
|
@@ -166,6 +166,33 @@ const ScrollAreaRender: BlokRender<Contracts['ScrollArea']> = ({buildChild, comp
|
|
|
166
166
|
);
|
|
167
167
|
};
|
|
168
168
|
|
|
169
|
+
/**
|
|
170
|
+
* A long list. Its rows are the children a `foreach` draws straight into it:
|
|
171
|
+
* each is left unlaid and unpainted until it scrolls near the view
|
|
172
|
+
* (`content-visibility`), so a list of thousands costs what a screenful does
|
|
173
|
+
* to draw. The rows are still mounted, as a renderer without a window of its
|
|
174
|
+
* own would mount them.
|
|
175
|
+
*/
|
|
176
|
+
const ListRender: BlokRender<Contracts['List']> = ({buildChild, component, schema}) => {
|
|
177
|
+
const blok = useBlok(component, schema);
|
|
178
|
+
const children = useValue(blok.children);
|
|
179
|
+
const className = useValue(blok.className);
|
|
180
|
+
const height = useValue(blok.height);
|
|
181
|
+
|
|
182
|
+
return (
|
|
183
|
+
<div
|
|
184
|
+
className={cn(
|
|
185
|
+
'flex min-h-0 min-w-0 flex-col overflow-y-auto [&>*]:shrink-0 [&>*]:[contain-intrinsic-size:auto_2.5rem] [&>*]:[content-visibility:auto]',
|
|
186
|
+
!height && 'h-full',
|
|
187
|
+
className,
|
|
188
|
+
)}
|
|
189
|
+
style={{height}}
|
|
190
|
+
>
|
|
191
|
+
{renderChildList(children, buildChild)}
|
|
192
|
+
</div>
|
|
193
|
+
);
|
|
194
|
+
};
|
|
195
|
+
|
|
169
196
|
const ResizableRender: BlokRender<Contracts['Resizable']> = ({buildChild, component, schema}) => {
|
|
170
197
|
const blok = useBlok(component, schema);
|
|
171
198
|
const children = useValue(blok.children);
|
|
@@ -293,6 +320,7 @@ export const layoutRenders = {
|
|
|
293
320
|
Separator: SeparatorRender,
|
|
294
321
|
AspectRatio: AspectRatioRender,
|
|
295
322
|
ScrollArea: ScrollAreaRender,
|
|
323
|
+
List: ListRender,
|
|
296
324
|
Resizable: ResizableRender,
|
|
297
325
|
ResizablePanel: ResizablePanelRender,
|
|
298
326
|
ResizableHandle: ResizableHandleRender,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
type Contracts = typeof logoContracts;
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
* The `logo
|
|
25
|
+
* The `logo` family drawn: see the contract for the language. A node's id is
|
|
26
26
|
* the BSX `id`, and that is what a gradient or a clip path is referenced by.
|
|
27
27
|
* Ids are made unique per drawing, so two logos on one page never share a
|
|
28
28
|
* gradient.
|
|
@@ -265,7 +265,7 @@ const ClipPathRender: BlokRender<Contracts['ClipPath']> = args => {
|
|
|
265
265
|
);
|
|
266
266
|
};
|
|
267
267
|
|
|
268
|
-
/** The `logo
|
|
268
|
+
/** The `logo` family: the root, seven shapes, text, and what shapes reference. */
|
|
269
269
|
export const logoRenders = {
|
|
270
270
|
AgentLogo: LogoRootRender,
|
|
271
271
|
ActionLogo: LogoRootRender,
|
|
@@ -16,7 +16,7 @@ import {progressFraction, routePoints, splitRoute, throughKeys} from './math';
|
|
|
16
16
|
type Contracts = typeof runContracts;
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* The components that place an action's dependencies in 3D (scene
|
|
19
|
+
* The components that place an action's dependencies in 3D (the scene family). `Space`
|
|
20
20
|
* is a scene whose layout is a shared room, `Placed` draws the agent a
|
|
21
21
|
* dependency is bound to with that agent's own scene blok where the room keeps
|
|
22
22
|
* it, and `Route` draws a line through several.
|
|
@@ -4,7 +4,7 @@ import {afterEach, beforeEach, describe, expect, it, vi} from 'vitest';
|
|
|
4
4
|
import {renderBsx, testCatalog} from './testing';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* `<Time value relative? format?>` (ui
|
|
7
|
+
* `<Time value relative? format?>` (the ui family): a moment, absolute or relative.
|
|
8
8
|
* Relative time ticks inside the component, against the wall clock live and
|
|
9
9
|
* against `then` while travelling; a blok never reads the clock itself.
|
|
10
10
|
*/
|
|
@@ -16,7 +16,7 @@ type Contracts = typeof toastContracts;
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* `<Toast task={move}>`: a notification when a task settles, once per task
|
|
19
|
-
* (ui
|
|
19
|
+
* (the ui family). Each outcome slot (`done`, `failed`, `cancelled`) is optional and
|
|
20
20
|
* holds the text shown for it:
|
|
21
21
|
*
|
|
22
22
|
* <Toast task={move}>
|
|
@@ -115,7 +115,7 @@ const useClock = (active: boolean, target: number | null): number => {
|
|
|
115
115
|
};
|
|
116
116
|
|
|
117
117
|
/**
|
|
118
|
-
* `<Time value relative? format?>` (ui
|
|
118
|
+
* `<Time value relative? format?>` (the ui family): a moment, absolute or relative.
|
|
119
119
|
* Relative time is measured from the viewed moment: the wall clock live
|
|
120
120
|
* (ticking here), `then` while travelling, so the past renders as it did.
|
|
121
121
|
*/
|