@littlepress/renderer-web 0.0.0-stage → 1.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/LICENSE +202 -0
- package/NOTICE +20 -0
- package/README.md +229 -2
- package/dist/answer/answerComponents.d.ts +107 -0
- package/dist/answer/answerComponents.js +637 -0
- package/dist/answer/download.d.ts +63 -0
- package/dist/answer/download.js +109 -0
- package/dist/answer/downloadExport.d.ts +44 -0
- package/dist/answer/downloadExport.js +266 -0
- package/dist/answer/hostValues.d.ts +28 -0
- package/dist/answer/hostValues.js +379 -0
- package/dist/answer/mapComponent.d.ts +6 -0
- package/dist/answer/mapComponent.js +213 -0
- package/dist/answer/math.d.ts +57 -0
- package/dist/answer/math.js +168 -0
- package/dist/answer/surfaceStream.d.ts +51 -0
- package/dist/answer/surfaceStream.js +260 -0
- package/dist/answer/tableLayout.d.ts +42 -0
- package/dist/answer/tableLayout.js +89 -0
- package/dist/controls/ActionFeedback.d.ts +5 -0
- package/dist/controls/ActionFeedback.js +43 -0
- package/dist/controls/actionDispatch.d.ts +51 -0
- package/dist/controls/actionDispatch.js +211 -0
- package/dist/controls/actionOutcome.generated.d.ts +64 -0
- package/dist/controls/actionOutcome.generated.js +64 -0
- package/dist/controls/calculationPublisher.d.ts +14 -0
- package/dist/controls/calculationPublisher.js +6 -0
- package/dist/controls/calculations.d.ts +20 -0
- package/dist/controls/calculations.generated.d.ts +73 -0
- package/dist/controls/calculations.generated.js +85 -0
- package/dist/controls/calculations.js +208 -0
- package/dist/controls/controlState.d.ts +84 -0
- package/dist/controls/controlState.js +256 -0
- package/dist/controls/fieldMessages.d.ts +41 -0
- package/dist/controls/fieldMessages.js +81 -0
- package/dist/controls/fieldValidation.d.ts +19 -0
- package/dist/controls/fieldValidation.js +98 -0
- package/dist/controls/formComponents.d.ts +23 -0
- package/dist/controls/formComponents.js +738 -0
- package/dist/controls/formProgress.d.ts +63 -0
- package/dist/controls/formProgress.js +122 -0
- package/dist/controls/inputDrafts.d.ts +55 -0
- package/dist/controls/inputDrafts.js +183 -0
- package/dist/controls/inputValidation.d.ts +33 -0
- package/dist/controls/inputValidation.js +119 -0
- package/dist/controls/localWrites.d.ts +9 -0
- package/dist/controls/localWrites.js +29 -0
- package/dist/core/A2uiSurface.d.ts +13 -0
- package/dist/core/A2uiSurface.js +15 -0
- package/dist/core/AtlasIcon.d.ts +18 -0
- package/dist/core/AtlasIcon.js +22 -0
- package/dist/core/AtlasMedia.d.ts +22 -0
- package/dist/core/AtlasMedia.js +45 -0
- package/dist/core/Carousel.d.ts +61 -0
- package/dist/core/Carousel.js +183 -0
- package/dist/core/CoreMedia.d.ts +19 -0
- package/dist/core/CoreMedia.js +25 -0
- package/dist/core/FoundationA2uiSurface.d.ts +86 -0
- package/dist/core/FoundationA2uiSurface.js +440 -0
- package/dist/core/ImagePreview.d.ts +42 -0
- package/dist/core/ImagePreview.js +73 -0
- package/dist/core/LucideIcon.d.ts +19 -0
- package/dist/core/LucideIcon.js +42 -0
- package/dist/core/SurfaceLink.d.ts +35 -0
- package/dist/core/SurfaceLink.js +60 -0
- package/dist/core/appearance/aegis.d.ts +49 -0
- package/dist/core/appearance/aegis.js +34 -0
- package/dist/core/appearance/colour.d.ts +24 -0
- package/dist/core/appearance/colour.js +103 -0
- package/dist/core/appearance/css.d.ts +17 -0
- package/dist/core/appearance/css.js +153 -0
- package/dist/core/appearance/presets.generated.d.ts +4 -0
- package/dist/core/appearance/presets.generated.js +1184 -0
- package/dist/core/appearance/react.d.ts +29 -0
- package/dist/core/appearance/react.js +110 -0
- package/dist/core/appearance/resolve.d.ts +76 -0
- package/dist/core/appearance/resolve.js +127 -0
- package/dist/core/appearance/textScale.d.ts +11 -0
- package/dist/core/appearance/textScale.js +51 -0
- package/dist/core/appearance/theme.d.ts +138 -0
- package/dist/core/appearance/theme.js +274 -0
- package/dist/core/baseComponents.d.ts +53 -0
- package/dist/core/baseComponents.js +480 -0
- package/dist/core/binding.d.ts +46 -0
- package/dist/core/binding.js +118 -0
- package/dist/core/bundle.d.ts +23 -0
- package/dist/core/bundle.js +75 -0
- package/dist/core/catalog/catalog-index.generated.d.ts +44 -0
- package/dist/core/catalog/catalog-index.generated.js +79 -0
- package/dist/core/catalog/icons.generated.d.ts +6 -0
- package/dist/core/catalog/icons.generated.js +1788 -0
- package/dist/core/catalog.d.ts +6 -0
- package/dist/core/catalog.generated.d.ts +50 -0
- package/dist/core/catalog.generated.js +2174 -0
- package/dist/core/catalog.js +8 -0
- package/dist/core/chartRows.d.ts +7 -0
- package/dist/core/chartRows.js +38 -0
- package/dist/core/component-support.d.ts +39 -0
- package/dist/core/component-support.js +127 -0
- package/dist/core/components/actions.d.ts +4 -0
- package/dist/core/components/actions.js +21 -0
- package/dist/core/components/cards.d.ts +9 -0
- package/dist/core/components/cards.js +227 -0
- package/dist/core/components/charts.d.ts +18 -0
- package/dist/core/components/charts.js +412 -0
- package/dist/core/components/comparisonTable.d.ts +50 -0
- package/dist/core/components/comparisonTable.js +89 -0
- package/dist/core/components/content.d.ts +13 -0
- package/dist/core/components/content.js +108 -0
- package/dist/core/components/seriesCharts.d.ts +531 -0
- package/dist/core/components/seriesCharts.js +1053 -0
- package/dist/core/components/stepFlow.d.ts +7 -0
- package/dist/core/components/stepFlow.js +13 -0
- package/dist/core/components.full.d.ts +10 -0
- package/dist/core/components.full.js +41 -0
- package/dist/core/context.d.ts +207 -0
- package/dist/core/context.js +172 -0
- package/dist/core/coverage.d.ts +30 -0
- package/dist/core/coverage.js +93 -0
- package/dist/core/foundation.d.ts +21 -0
- package/dist/core/foundation.js +22 -0
- package/dist/core/fullTheme.d.ts +5 -0
- package/dist/core/fullTheme.js +9 -0
- package/dist/core/iconNodes.generated.d.ts +7 -0
- package/dist/core/iconNodes.generated.js +5 -0
- package/dist/core/lucideIcons.d.ts +5 -0
- package/dist/core/lucideIcons.js +7 -0
- package/dist/core/messages.d.ts +111 -0
- package/dist/core/messages.js +134 -0
- package/dist/core/pointer.d.ts +17 -0
- package/dist/core/pointer.js +104 -0
- package/dist/core/registry.d.ts +12 -0
- package/dist/core/registry.js +114 -0
- package/dist/core/runtime.d.ts +8 -0
- package/dist/core/runtime.js +6 -0
- package/dist/core/state.d.ts +73 -0
- package/dist/core/state.js +274 -0
- package/dist/core/surfaceMotion.d.ts +5 -0
- package/dist/core/surfaceMotion.js +46 -0
- package/dist/core/theme.d.ts +5 -0
- package/dist/core/theme.js +7 -0
- package/dist/core/useSurfaceImage.d.ts +20 -0
- package/dist/core/useSurfaceImage.js +65 -0
- package/dist/graph/RelationshipGraph.d.ts +14 -0
- package/dist/graph/RelationshipGraph.js +206 -0
- package/dist/graph/model.d.ts +20 -0
- package/dist/graph/model.js +36 -0
- package/dist/graph/program/assets.d.ts +3 -0
- package/dist/graph/program/assets.js +3 -0
- package/dist/graph/program/bridge.d.ts +6 -0
- package/dist/graph/program/bridge.generated.d.ts +136 -0
- package/dist/graph/program/bridge.generated.js +1 -0
- package/dist/graph/program/bridge.js +24 -0
- package/dist/graph/program/bridge.schema.json +717 -0
- package/dist/graph/program/bridgeValidator.cjs +2 -0
- package/dist/graph/program/bridgeValidator.d.cts +4 -0
- package/dist/graph/program/runner.d.ts +1 -0
- package/dist/graph/program/runner.html +2193 -0
- package/dist/graph/program/runner.js +157 -0
- package/dist/graph/program/runtime-manifest.json +1 -0
- package/dist/graph/program/view.d.ts +11 -0
- package/dist/graph/program/view.js +210 -0
- package/dist/graph/program/worker.d.ts +1 -0
- package/dist/graph/program/worker.js +2186 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +45 -0
- package/dist/internal/dsh.d.ts +4 -0
- package/dist/internal/dsh.js +3 -0
- package/dist/internal/relationship-graph.d.ts +4 -0
- package/dist/internal/relationship-graph.js +7202 -0
- package/dist/page/layoutComponents.d.ts +6 -0
- package/dist/page/layoutComponents.js +123 -0
- package/dist/page/layoutGeometry.d.ts +68 -0
- package/dist/page/layoutGeometry.js +174 -0
- package/dist/page/pageFormat.d.ts +34 -0
- package/dist/page/pageFormat.js +119 -0
- package/dist/page/printFit.d.ts +81 -0
- package/dist/page/printFit.js +338 -0
- package/dist/react/index.d.ts +5 -0
- package/dist/react/index.js +2 -0
- package/dist/report/locate.d.ts +42 -0
- package/dist/report/locate.js +34 -0
- package/dist/styles/renderer.css +4580 -0
- package/licenses/LUCIDE-LICENSE.txt +43 -0
- package/licenses/QUICKJS-EMSCRIPTEN-LICENSE.txt +21 -0
- package/licenses/QUICKJS-VARIANT-LICENSE.txt +47 -0
- package/package.json +68 -3
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Controlled public icon names. The full Atlas icon index remains private. */
|
|
2
|
+
export { lucideIconNames } from "./catalog.generated.ts";
|
|
3
|
+
import { lucideIconNames } from "./catalog.generated.ts";
|
|
4
|
+
export type LucideIconName = (typeof lucideIconNames)[number];
|
|
5
|
+
export declare function isLucideIconName(value: unknown): value is LucideIconName;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Controlled public icon names. The full Atlas icon index remains private. */
|
|
2
|
+
export { lucideIconNames } from "./catalog.generated.js";
|
|
3
|
+
import { lucideIconNames } from "./catalog.generated.js";
|
|
4
|
+
const lucideIconNameSet = new Set(lucideIconNames);
|
|
5
|
+
export function isLucideIconName(value) {
|
|
6
|
+
return typeof value === "string" && lucideIconNameSet.has(value);
|
|
7
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A2UI v1.0 wire shapes, narrowed to what the LittlePress Atlas catalog uses.
|
|
3
|
+
*
|
|
4
|
+
* The contract anchor is the official v1.0 schema suite (ADR 0004, decision 2);
|
|
5
|
+
* these types are a hand-kept mirror of the envelope, not a second spec. When
|
|
6
|
+
* the RC envelope moves, this file is the single place the adapter changes —
|
|
7
|
+
* everything downstream reads through the guards below.
|
|
8
|
+
*/
|
|
9
|
+
export type A2uiJsonObject = Record<string, unknown>;
|
|
10
|
+
/** `{"path": "/data/episode/title"}` — a JSON Pointer into the data model. */
|
|
11
|
+
export type A2uiDataBinding = {
|
|
12
|
+
path: string;
|
|
13
|
+
};
|
|
14
|
+
/** `{"call": "formatDuration", "args": {...}}` in a value position. */
|
|
15
|
+
export type A2uiFunctionCall = {
|
|
16
|
+
call: string;
|
|
17
|
+
catalogId?: string;
|
|
18
|
+
args?: A2uiJsonObject;
|
|
19
|
+
};
|
|
20
|
+
/** DynamicString / DynamicNumber / DynamicBoolean / DynamicValue all share this union. */
|
|
21
|
+
export type A2uiDynamic = unknown;
|
|
22
|
+
/** `{"event": {...}}` needs a server round trip, `{"functionCall": {...}}` stays client-side. */
|
|
23
|
+
export type A2uiAction = {
|
|
24
|
+
event?: {
|
|
25
|
+
name: string;
|
|
26
|
+
context?: A2uiJsonObject;
|
|
27
|
+
};
|
|
28
|
+
functionCall?: A2uiFunctionCall;
|
|
29
|
+
};
|
|
30
|
+
/** Fixed child ids, or a `{componentId, path}` template bound to an array. */
|
|
31
|
+
export type A2uiChildList = string[] | {
|
|
32
|
+
componentId: string;
|
|
33
|
+
path: string;
|
|
34
|
+
};
|
|
35
|
+
export type A2uiComponent = {
|
|
36
|
+
id: string;
|
|
37
|
+
component: string;
|
|
38
|
+
accessibility?: {
|
|
39
|
+
label?: A2uiDynamic;
|
|
40
|
+
description?: A2uiDynamic;
|
|
41
|
+
};
|
|
42
|
+
[key: string]: unknown;
|
|
43
|
+
};
|
|
44
|
+
export type A2uiCreateSurface = {
|
|
45
|
+
surfaceId: string;
|
|
46
|
+
catalogId?: string;
|
|
47
|
+
sendDataModel?: boolean;
|
|
48
|
+
metadata?: {
|
|
49
|
+
extensions?: A2uiJsonObject;
|
|
50
|
+
};
|
|
51
|
+
components?: A2uiComponent[];
|
|
52
|
+
dataModel?: A2uiJsonObject;
|
|
53
|
+
};
|
|
54
|
+
export type A2uiUpdateComponents = {
|
|
55
|
+
surfaceId: string;
|
|
56
|
+
components: A2uiComponent[];
|
|
57
|
+
};
|
|
58
|
+
/** A literal `null` deletes `path`; an omitted path or `/` addresses the root. */
|
|
59
|
+
export type A2uiUpdateDataModel = {
|
|
60
|
+
surfaceId: string;
|
|
61
|
+
path?: string;
|
|
62
|
+
value: unknown;
|
|
63
|
+
};
|
|
64
|
+
export type A2uiDeleteSurface = {
|
|
65
|
+
surfaceId: string;
|
|
66
|
+
};
|
|
67
|
+
export type A2uiCallRendererFunction = {
|
|
68
|
+
functionCallId: string;
|
|
69
|
+
callFunction: A2uiFunctionCall & {
|
|
70
|
+
catalogId: string;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
export type A2uiFunctionResponse = {
|
|
74
|
+
functionCallId: string;
|
|
75
|
+
value?: unknown;
|
|
76
|
+
error?: A2uiJsonObject;
|
|
77
|
+
};
|
|
78
|
+
export type A2uiMessage = {
|
|
79
|
+
version?: string;
|
|
80
|
+
} & ({
|
|
81
|
+
createSurface: A2uiCreateSurface;
|
|
82
|
+
} | {
|
|
83
|
+
updateComponents: A2uiUpdateComponents;
|
|
84
|
+
} | {
|
|
85
|
+
updateDataModel: A2uiUpdateDataModel;
|
|
86
|
+
} | {
|
|
87
|
+
deleteSurface: A2uiDeleteSurface;
|
|
88
|
+
} | {
|
|
89
|
+
callRendererFunction: A2uiCallRendererFunction;
|
|
90
|
+
} | {
|
|
91
|
+
agentFunctionResponse: A2uiFunctionResponse;
|
|
92
|
+
});
|
|
93
|
+
export declare function isRecord(value: unknown): value is A2uiJsonObject;
|
|
94
|
+
export declare function isDataBinding(value: unknown): value is A2uiDataBinding;
|
|
95
|
+
export declare function isFunctionCall(value: unknown): value is A2uiFunctionCall;
|
|
96
|
+
export declare function isAction(value: unknown): value is A2uiAction;
|
|
97
|
+
export declare function isChildTemplate(value: unknown): value is {
|
|
98
|
+
componentId: string;
|
|
99
|
+
path: string;
|
|
100
|
+
};
|
|
101
|
+
export declare function readComponent(value: unknown): A2uiComponent | null;
|
|
102
|
+
export declare function readCreateSurface(message: unknown): A2uiCreateSurface | null;
|
|
103
|
+
export declare function readUpdateComponents(message: unknown): A2uiUpdateComponents | null;
|
|
104
|
+
export declare function readUpdateDataModel(message: unknown): A2uiUpdateDataModel | null;
|
|
105
|
+
export declare function readDeleteSurface(message: unknown): A2uiDeleteSurface | null;
|
|
106
|
+
export declare function readCallRendererFunction(message: unknown): A2uiCallRendererFunction | null;
|
|
107
|
+
export declare function readAgentFunctionResponse(message: unknown): A2uiFunctionResponse | null;
|
|
108
|
+
/** Names the envelope member a message carries, or `null` for anything unrecognized. */
|
|
109
|
+
export declare function readMessageKind(message: unknown): "createSurface" | "updateComponents" | "updateDataModel" | "deleteSurface" | "callRendererFunction" | "agentFunctionResponse" | null;
|
|
110
|
+
/** Defensive parse of an untrusted `messages` array (bundle JSON, saved run, import). */
|
|
111
|
+
export declare function readMessageList(value: unknown): A2uiMessage[];
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A2UI v1.0 wire shapes, narrowed to what the LittlePress Atlas catalog uses.
|
|
3
|
+
*
|
|
4
|
+
* The contract anchor is the official v1.0 schema suite (ADR 0004, decision 2);
|
|
5
|
+
* these types are a hand-kept mirror of the envelope, not a second spec. When
|
|
6
|
+
* the RC envelope moves, this file is the single place the adapter changes —
|
|
7
|
+
* everything downstream reads through the guards below.
|
|
8
|
+
*/
|
|
9
|
+
export function isRecord(value) {
|
|
10
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
11
|
+
}
|
|
12
|
+
function readString(value) {
|
|
13
|
+
return typeof value === "string" && value.length > 0 ? value : null;
|
|
14
|
+
}
|
|
15
|
+
export function isDataBinding(value) {
|
|
16
|
+
return isRecord(value) && typeof value.path === "string" && !("call" in value);
|
|
17
|
+
}
|
|
18
|
+
export function isFunctionCall(value) {
|
|
19
|
+
return isRecord(value) && typeof value.call === "string";
|
|
20
|
+
}
|
|
21
|
+
export function isAction(value) {
|
|
22
|
+
if (!isRecord(value))
|
|
23
|
+
return false;
|
|
24
|
+
if (isRecord(value.event) && typeof value.event.name === "string")
|
|
25
|
+
return true;
|
|
26
|
+
return isFunctionCall(value.functionCall);
|
|
27
|
+
}
|
|
28
|
+
export function isChildTemplate(value) {
|
|
29
|
+
return isRecord(value) && typeof value.componentId === "string" && typeof value.path === "string";
|
|
30
|
+
}
|
|
31
|
+
export function readComponent(value) {
|
|
32
|
+
if (!isRecord(value))
|
|
33
|
+
return null;
|
|
34
|
+
const id = readString(value.id);
|
|
35
|
+
const component = readString(value.component);
|
|
36
|
+
if (!id || !component)
|
|
37
|
+
return null;
|
|
38
|
+
return value;
|
|
39
|
+
}
|
|
40
|
+
export function readCreateSurface(message) {
|
|
41
|
+
if (!isRecord(message) || !isRecord(message.createSurface))
|
|
42
|
+
return null;
|
|
43
|
+
const payload = message.createSurface;
|
|
44
|
+
const surfaceId = readString(payload.surfaceId);
|
|
45
|
+
if (!surfaceId)
|
|
46
|
+
return null;
|
|
47
|
+
const components = Array.isArray(payload.components)
|
|
48
|
+
? payload.components.map(readComponent).filter((entry) => Boolean(entry))
|
|
49
|
+
: [];
|
|
50
|
+
return {
|
|
51
|
+
surfaceId,
|
|
52
|
+
catalogId: readString(payload.catalogId) ?? undefined,
|
|
53
|
+
sendDataModel: typeof payload.sendDataModel === "boolean" ? payload.sendDataModel : undefined,
|
|
54
|
+
metadata: isRecord(payload.metadata) ? payload.metadata : undefined,
|
|
55
|
+
components: components.length > 0 ? components : undefined,
|
|
56
|
+
dataModel: isRecord(payload.dataModel) ? payload.dataModel : {},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export function readUpdateComponents(message) {
|
|
60
|
+
if (!isRecord(message) || !isRecord(message.updateComponents))
|
|
61
|
+
return null;
|
|
62
|
+
const payload = message.updateComponents;
|
|
63
|
+
const surfaceId = readString(payload.surfaceId);
|
|
64
|
+
if (!surfaceId || !Array.isArray(payload.components))
|
|
65
|
+
return null;
|
|
66
|
+
return {
|
|
67
|
+
surfaceId,
|
|
68
|
+
components: payload.components.map(readComponent).filter((entry) => Boolean(entry)),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export function readUpdateDataModel(message) {
|
|
72
|
+
if (!isRecord(message) || !isRecord(message.updateDataModel))
|
|
73
|
+
return null;
|
|
74
|
+
const payload = message.updateDataModel;
|
|
75
|
+
const surfaceId = readString(payload.surfaceId);
|
|
76
|
+
if (!surfaceId || !("value" in payload))
|
|
77
|
+
return null;
|
|
78
|
+
const rawPath = typeof payload.path === "string" ? payload.path : "";
|
|
79
|
+
return { surfaceId, path: rawPath === "/" ? "" : rawPath, value: payload.value };
|
|
80
|
+
}
|
|
81
|
+
export function readDeleteSurface(message) {
|
|
82
|
+
if (!isRecord(message) || !isRecord(message.deleteSurface))
|
|
83
|
+
return null;
|
|
84
|
+
const surfaceId = readString(message.deleteSurface.surfaceId);
|
|
85
|
+
return surfaceId ? { surfaceId } : null;
|
|
86
|
+
}
|
|
87
|
+
export function readCallRendererFunction(message) {
|
|
88
|
+
if (!isRecord(message) || !isRecord(message.callRendererFunction))
|
|
89
|
+
return null;
|
|
90
|
+
const payload = message.callRendererFunction;
|
|
91
|
+
const functionCallId = readString(payload.functionCallId);
|
|
92
|
+
if (!functionCallId || !isFunctionCall(payload.callFunction))
|
|
93
|
+
return null;
|
|
94
|
+
const catalogId = readString(payload.callFunction.catalogId);
|
|
95
|
+
if (!catalogId)
|
|
96
|
+
return null;
|
|
97
|
+
return {
|
|
98
|
+
functionCallId,
|
|
99
|
+
callFunction: { ...payload.callFunction, catalogId },
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
export function readAgentFunctionResponse(message) {
|
|
103
|
+
if (!isRecord(message) || !isRecord(message.agentFunctionResponse))
|
|
104
|
+
return null;
|
|
105
|
+
const payload = message.agentFunctionResponse;
|
|
106
|
+
const functionCallId = readString(payload.functionCallId);
|
|
107
|
+
if (!functionCallId)
|
|
108
|
+
return null;
|
|
109
|
+
return payload;
|
|
110
|
+
}
|
|
111
|
+
/** Names the envelope member a message carries, or `null` for anything unrecognized. */
|
|
112
|
+
export function readMessageKind(message) {
|
|
113
|
+
if (!isRecord(message))
|
|
114
|
+
return null;
|
|
115
|
+
if (isRecord(message.createSurface))
|
|
116
|
+
return "createSurface";
|
|
117
|
+
if (isRecord(message.updateComponents))
|
|
118
|
+
return "updateComponents";
|
|
119
|
+
if (isRecord(message.updateDataModel))
|
|
120
|
+
return "updateDataModel";
|
|
121
|
+
if (isRecord(message.deleteSurface))
|
|
122
|
+
return "deleteSurface";
|
|
123
|
+
if (isRecord(message.callRendererFunction))
|
|
124
|
+
return "callRendererFunction";
|
|
125
|
+
if (isRecord(message.agentFunctionResponse))
|
|
126
|
+
return "agentFunctionResponse";
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
/** Defensive parse of an untrusted `messages` array (bundle JSON, saved run, import). */
|
|
130
|
+
export function readMessageList(value) {
|
|
131
|
+
if (!Array.isArray(value))
|
|
132
|
+
return [];
|
|
133
|
+
return value.filter((entry) => isRecord(entry));
|
|
134
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RFC 6901 JSON Pointer helpers.
|
|
3
|
+
*
|
|
4
|
+
* A2UI binds data with the same pointers the LittlePress artifact already used
|
|
5
|
+
* (`/data/episode/title`), and `updateDataModel` addresses partial updates the
|
|
6
|
+
* same way. Writes are immutable: only the containers on the touched path are
|
|
7
|
+
* cloned, so React can compare by reference and re-render one branch.
|
|
8
|
+
*/
|
|
9
|
+
export type PointerSegments = string[];
|
|
10
|
+
/** `""` is the whole document; anything not starting with `/` is not a pointer. */
|
|
11
|
+
export declare function parsePointer(pointer: string): PointerSegments | null;
|
|
12
|
+
export declare function joinPointer(base: string, suffix: string | number): string;
|
|
13
|
+
export declare function readPointer(root: unknown, pointer: string): unknown;
|
|
14
|
+
/** Immutable set. Missing intermediate containers are created. */
|
|
15
|
+
export declare function writePointer(root: unknown, pointer: string, value: unknown): unknown;
|
|
16
|
+
/** Immutable delete used by current v1 when updateDataModel.value is null. */
|
|
17
|
+
export declare function deletePointer(root: unknown, pointer: string): unknown;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RFC 6901 JSON Pointer helpers.
|
|
3
|
+
*
|
|
4
|
+
* A2UI binds data with the same pointers the LittlePress artifact already used
|
|
5
|
+
* (`/data/episode/title`), and `updateDataModel` addresses partial updates the
|
|
6
|
+
* same way. Writes are immutable: only the containers on the touched path are
|
|
7
|
+
* cloned, so React can compare by reference and re-render one branch.
|
|
8
|
+
*/
|
|
9
|
+
function unescapeSegment(segment) {
|
|
10
|
+
return segment.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
11
|
+
}
|
|
12
|
+
/** `""` is the whole document; anything not starting with `/` is not a pointer. */
|
|
13
|
+
export function parsePointer(pointer) {
|
|
14
|
+
if (pointer === "")
|
|
15
|
+
return [];
|
|
16
|
+
if (!pointer.startsWith("/"))
|
|
17
|
+
return null;
|
|
18
|
+
return pointer.slice(1).split("/").map(unescapeSegment);
|
|
19
|
+
}
|
|
20
|
+
export function joinPointer(base, suffix) {
|
|
21
|
+
const escaped = String(suffix).replace(/~/g, "~0").replace(/\//g, "~1");
|
|
22
|
+
return `${base}/${escaped}`;
|
|
23
|
+
}
|
|
24
|
+
function readSegment(container, segment) {
|
|
25
|
+
if (Array.isArray(container)) {
|
|
26
|
+
if (!/^\d+$/.test(segment))
|
|
27
|
+
return undefined;
|
|
28
|
+
return container[Number(segment)];
|
|
29
|
+
}
|
|
30
|
+
if (typeof container === "object" && container !== null) {
|
|
31
|
+
return container[segment];
|
|
32
|
+
}
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
export function readPointer(root, pointer) {
|
|
36
|
+
const segments = parsePointer(pointer);
|
|
37
|
+
if (segments === null)
|
|
38
|
+
return undefined;
|
|
39
|
+
let cursor = root;
|
|
40
|
+
for (const segment of segments) {
|
|
41
|
+
if (cursor === undefined || cursor === null)
|
|
42
|
+
return undefined;
|
|
43
|
+
cursor = readSegment(cursor, segment);
|
|
44
|
+
}
|
|
45
|
+
return cursor;
|
|
46
|
+
}
|
|
47
|
+
function cloneContainer(container, nextSegment) {
|
|
48
|
+
if (Array.isArray(container))
|
|
49
|
+
return [...container];
|
|
50
|
+
if (typeof container === "object" && container !== null)
|
|
51
|
+
return { ...container };
|
|
52
|
+
// Missing intermediate container: a numeric next segment implies an array.
|
|
53
|
+
return nextSegment !== undefined && /^\d+$/.test(nextSegment) ? [] : {};
|
|
54
|
+
}
|
|
55
|
+
function assign(container, segment, value) {
|
|
56
|
+
if (Array.isArray(container)) {
|
|
57
|
+
container[segment === "-" ? container.length : Number(segment)] = value;
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
container[segment] = value;
|
|
61
|
+
}
|
|
62
|
+
function remove(container, segment) {
|
|
63
|
+
if (Array.isArray(container)) {
|
|
64
|
+
const index = Number(segment);
|
|
65
|
+
if (Number.isInteger(index) && index >= 0 && index < container.length)
|
|
66
|
+
container.splice(index, 1);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (typeof container === "object" && container !== null) {
|
|
70
|
+
delete container[segment];
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function writeInternal(root, pointer, value, mode) {
|
|
74
|
+
const segments = parsePointer(pointer);
|
|
75
|
+
if (segments === null)
|
|
76
|
+
return root;
|
|
77
|
+
if (segments.length === 0)
|
|
78
|
+
return mode === "set" ? value : undefined;
|
|
79
|
+
const nextRoot = cloneContainer(root, segments[0]);
|
|
80
|
+
let cursor = nextRoot;
|
|
81
|
+
for (let index = 0; index < segments.length - 1; index += 1) {
|
|
82
|
+
const segment = segments[index];
|
|
83
|
+
const child = readSegment(cursor, segment);
|
|
84
|
+
const clonedChild = cloneContainer(child, segments[index + 1]);
|
|
85
|
+
assign(cursor, segment, clonedChild);
|
|
86
|
+
cursor = clonedChild;
|
|
87
|
+
}
|
|
88
|
+
const lastSegment = segments[segments.length - 1];
|
|
89
|
+
if (mode === "set") {
|
|
90
|
+
assign(cursor, lastSegment, value);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
remove(cursor, lastSegment);
|
|
94
|
+
}
|
|
95
|
+
return nextRoot;
|
|
96
|
+
}
|
|
97
|
+
/** Immutable set. Missing intermediate containers are created. */
|
|
98
|
+
export function writePointer(root, pointer, value) {
|
|
99
|
+
return writeInternal(root, pointer, value, "set");
|
|
100
|
+
}
|
|
101
|
+
/** Immutable delete used by current v1 when updateDataModel.value is null. */
|
|
102
|
+
export function deletePointer(root, pointer) {
|
|
103
|
+
return writeInternal(root, pointer, undefined, "delete");
|
|
104
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type A2uiComponent } from "./messages.ts";
|
|
2
|
+
import { type RenderContext, type RendererRegistry } from "./context.ts";
|
|
3
|
+
export { renderChildren } from "./baseComponents.tsx";
|
|
4
|
+
export declare const foundationRendererRegistry: RendererRegistry;
|
|
5
|
+
export declare function UnsupportedComponent({ component, context }: {
|
|
6
|
+
component: A2uiComponent;
|
|
7
|
+
context: RenderContext;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function RenderComponent({ componentId, context }: {
|
|
10
|
+
componentId: string;
|
|
11
|
+
context: RenderContext;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { ActionFeedback } from "../controls/ActionFeedback.js";
|
|
3
|
+
import { actionScope } from "../controls/actionDispatch.js";
|
|
4
|
+
import { isRecord } from "./messages.js";
|
|
5
|
+
import { resolveBoolean, resolveValue } from "./binding.js";
|
|
6
|
+
import { legacyFoundationComponentAliases } from "./catalog.js";
|
|
7
|
+
import { renderAegisBlock, renderBlockquote, renderCodeBlock, renderList, renderListItem, renderMath, renderRichText, renderTable, } from "../answer/answerComponents.js";
|
|
8
|
+
import { renderDownload } from "../answer/download.js";
|
|
9
|
+
import { renderMap } from "../answer/mapComponent.js";
|
|
10
|
+
import { maxRenderDepth, readFallback, resolveAction, } from "./context.js";
|
|
11
|
+
import { renderActionRow, renderAdContainer, renderAsyncState, renderAvatar, renderButton, renderCard, renderChartElements, renderChildren, renderChip, renderDivider, renderFlow, renderGrid, renderIcon, renderImage, renderKicker, renderListRow, renderMediaFrame, renderMetaRow, renderPager, renderProgress, renderStack, renderStat, renderText, } from "./baseComponents.js";
|
|
12
|
+
import { renderCheckbox, renderChoiceGroup, renderForm, renderInputField, renderPopover, renderSelect, renderSlider, renderTabs, } from "../controls/formComponents.js";
|
|
13
|
+
import { renderLayoutGrid, renderLayoutPage, renderLayoutSlot, } from "../page/layoutComponents.js";
|
|
14
|
+
export { renderChildren } from "./baseComponents.js";
|
|
15
|
+
const canonicalRendererRegistry = {
|
|
16
|
+
"lp.text": renderText,
|
|
17
|
+
"lp.kicker": renderKicker,
|
|
18
|
+
"lp.meta-row": renderMetaRow,
|
|
19
|
+
"lp.image": renderImage,
|
|
20
|
+
"lp.icon": renderIcon,
|
|
21
|
+
"lp.button": renderButton,
|
|
22
|
+
"lp.chip": renderChip,
|
|
23
|
+
"lp.card": renderCard,
|
|
24
|
+
"lp.stack": renderStack,
|
|
25
|
+
"lp.grid": renderGrid,
|
|
26
|
+
"lp.pager": renderPager,
|
|
27
|
+
"lp.list-row": renderListRow,
|
|
28
|
+
"lp.divider": renderDivider,
|
|
29
|
+
"lp.stat": renderStat,
|
|
30
|
+
"lp.progress": renderProgress,
|
|
31
|
+
"lp.avatar": renderAvatar,
|
|
32
|
+
"lp.media-frame": renderMediaFrame,
|
|
33
|
+
"lp.action-row": renderActionRow,
|
|
34
|
+
"lp.ad-container": renderAdContainer,
|
|
35
|
+
"lp.chart-elements": renderChartElements,
|
|
36
|
+
"lp.async-state": renderAsyncState,
|
|
37
|
+
"lp.input-field": renderInputField,
|
|
38
|
+
"lp.select": renderSelect,
|
|
39
|
+
"lp.checkbox": renderCheckbox,
|
|
40
|
+
"lp.choice-group": renderChoiceGroup,
|
|
41
|
+
"lp.slider": renderSlider,
|
|
42
|
+
"lp.form": renderForm,
|
|
43
|
+
"lp.tabs": renderTabs,
|
|
44
|
+
"lp.layout-page": renderLayoutPage,
|
|
45
|
+
"lp.layout-grid": renderLayoutGrid,
|
|
46
|
+
"lp.layout-slot": renderLayoutSlot,
|
|
47
|
+
"lp.rich-text": renderRichText,
|
|
48
|
+
"lp.list": renderList,
|
|
49
|
+
"lp.list-item": renderListItem,
|
|
50
|
+
"lp.table": renderTable,
|
|
51
|
+
"lp.code-block": renderCodeBlock,
|
|
52
|
+
"lp.blockquote": renderBlockquote,
|
|
53
|
+
"lp.math": renderMath,
|
|
54
|
+
"lp.aegis-block": renderAegisBlock,
|
|
55
|
+
"lp.download": renderDownload,
|
|
56
|
+
"lp.popover": renderPopover,
|
|
57
|
+
"lp.flow": renderFlow,
|
|
58
|
+
"lp.map": renderMap,
|
|
59
|
+
};
|
|
60
|
+
const legacyRendererRegistry = Object.fromEntries(Object.entries(legacyFoundationComponentAliases).map(([legacyName, canonicalName]) => [legacyName, canonicalRendererRegistry[canonicalName]]));
|
|
61
|
+
export const foundationRendererRegistry = Object.freeze({
|
|
62
|
+
...canonicalRendererRegistry,
|
|
63
|
+
...legacyRendererRegistry,
|
|
64
|
+
});
|
|
65
|
+
function hasRenderableChildren(component) {
|
|
66
|
+
return Array.isArray(component.children) && component.children.some((id) => typeof id === "string");
|
|
67
|
+
}
|
|
68
|
+
function collectResolvedProps(component, context) {
|
|
69
|
+
const rows = [];
|
|
70
|
+
for (const [key, value] of Object.entries(component)) {
|
|
71
|
+
if (["id", "component", "children", "accessibility", "fallback"].includes(key))
|
|
72
|
+
continue;
|
|
73
|
+
const resolved = resolveValue(value, context.binding, context.valueFunctions);
|
|
74
|
+
if (resolved === undefined || resolved === null)
|
|
75
|
+
continue;
|
|
76
|
+
const printed = isRecord(resolved) || Array.isArray(resolved) ? JSON.stringify(resolved) : String(resolved);
|
|
77
|
+
rows.push([key, printed.length > 160 ? `${printed.slice(0, 157)}...` : printed]);
|
|
78
|
+
}
|
|
79
|
+
return rows;
|
|
80
|
+
}
|
|
81
|
+
export function UnsupportedComponent({ component, context }) {
|
|
82
|
+
const rows = collectResolvedProps(component, context);
|
|
83
|
+
return (_jsxs("section", { className: "a2ui-unsupported", "data-a2ui-component": component.component, children: [_jsx("p", { className: "lp-kicker default", children: "Unsupported component" }), _jsx("p", { className: "lp-title", children: component.component }), rows.length ? _jsx("dl", { className: "a2ui-unsupported-data", children: rows.map(([key, value]) => _jsxs("div", { children: [_jsx("dt", { children: key }), _jsx("dd", { children: value })] }, key)) }) : null] }));
|
|
84
|
+
}
|
|
85
|
+
function GuardCard({ title, detail }) {
|
|
86
|
+
return _jsxs("section", { className: "a2ui-unsupported", "data-a2ui-guard": "true", children: [_jsx("p", { className: "lp-kicker default", children: title }), _jsx("p", { className: "lp-caption", children: detail })] });
|
|
87
|
+
}
|
|
88
|
+
export function RenderComponent({ componentId, context }) {
|
|
89
|
+
if (context.depth > maxRenderDepth)
|
|
90
|
+
return _jsx(GuardCard, { title: "Depth limit", detail: `Stopped at ${componentId}.` });
|
|
91
|
+
if (context.ancestors.includes(componentId))
|
|
92
|
+
return _jsx(GuardCard, { title: "Cycle detected", detail: `Component "${componentId}" references an ancestor.` });
|
|
93
|
+
const component = context.state.components[componentId];
|
|
94
|
+
if (!component)
|
|
95
|
+
return _jsx(GuardCard, { title: "Missing component", detail: `No component with id "${componentId}".` });
|
|
96
|
+
if (component.visible !== undefined && resolveBoolean(component.visible, context.binding, context.valueFunctions) === false) {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
const renderer = context.registry[component.component];
|
|
100
|
+
if (renderer === renderButton && readFallback(component)?.strategy === "hide") {
|
|
101
|
+
const action = resolveAction(component.action ?? component.tapAction, component, context);
|
|
102
|
+
if (!action || (action.kind === "event" && !context.actionSession?.hostAccepts(action)))
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
if (renderer) {
|
|
106
|
+
const scope = actionScope(component.id, context.binding.itemPointer);
|
|
107
|
+
const scoped = { ...context, actionScopes: { ...context.actionScopes, [component.id]: scope } };
|
|
108
|
+
return _jsxs(_Fragment, { children: [renderer(component, scoped), _jsx(ActionFeedback, { context: scoped, scope: scope })] });
|
|
109
|
+
}
|
|
110
|
+
if (hasRenderableChildren(component)) {
|
|
111
|
+
return _jsx("div", { className: "a2ui-degraded-container", "data-a2ui-component": component.component, children: renderChildren(component, context) });
|
|
112
|
+
}
|
|
113
|
+
return _jsx(UnsupportedComponent, { component: component, context: context });
|
|
114
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { A2uiSurface, A2uiPageFrame, type A2uiSurfaceProps, type A2uiPageFrameProps } from "./FoundationA2uiSurface.tsx";
|
|
2
|
+
export type { A2uiLocateOptions, A2uiSurfaceHandle } from "../report/locate.ts";
|
|
3
|
+
export { LucideIcon, lucideIconNames, isLucideIconName, type LucideIconName, type LucideIconProps } from "./LucideIcon.tsx";
|
|
4
|
+
export { CoreMedia, readMediaValue, type CoreMediaProps, type CoreMediaValue } from "./CoreMedia.tsx";
|
|
5
|
+
export { RenderComponent, UnsupportedComponent, foundationRendererRegistry, renderChildren, } from "./registry.tsx";
|
|
6
|
+
export { actionHandler, childContext, composeRendererRegistries, knownComponentsForRegistry, maxRenderDepth, readFallback, resolveAction, RendererRegistryCollisionError, type A2uiInputChange, type A2uiInputChangeHandler, type A2uiInputValue, type ComponentFallback, type ComponentRenderer, type FallbackStrategy, type LayoutRenderMode, type MapAdapterProps, type MapAdapterRenderer, type MapPlace, type MapPlaceGroup, type RenderContext, type RendererRegistry, type ResolvedAction, type SurfaceImageLoader, } from "./context.ts";
|
|
7
|
+
export { measurePrintPage, observePrintSlot, validateSlotAllocation, type PrintPageFitReport, type PrintPartFitReport, type PrintPartPolicy, type SlotFitReport, } from "../page/printFit.ts";
|
|
8
|
+
export type { ActionOutcome, ActionInvocation, A2uiActionHandler } from "../controls/actionDispatch.ts";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { A2uiSurface, A2uiPageFrame } from "./FoundationA2uiSurface.js";
|
|
2
|
+
export { LucideIcon, lucideIconNames, isLucideIconName } from "./LucideIcon.js";
|
|
3
|
+
export { CoreMedia, readMediaValue } from "./CoreMedia.js";
|
|
4
|
+
export { RenderComponent, UnsupportedComponent, foundationRendererRegistry, renderChildren, } from "./registry.js";
|
|
5
|
+
export { actionHandler, childContext, composeRendererRegistries, knownComponentsForRegistry, maxRenderDepth, readFallback, resolveAction, RendererRegistryCollisionError, } from "./context.js";
|
|
6
|
+
export { measurePrintPage, observePrintSlot, validateSlotAllocation, } from "../page/printFit.js";
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The A2UI message state machine.
|
|
3
|
+
*
|
|
4
|
+
* Pure functions, zero DOM: a flat component table plus one data model, folded
|
|
5
|
+
* over `createSurface` / `updateComponents` / `updateDataModel` / `deleteSurface`.
|
|
6
|
+
* This is the piece the Compose and SwiftUI decoders have to agree with, so it
|
|
7
|
+
* is kept free of React and testable with `node --test`.
|
|
8
|
+
*/
|
|
9
|
+
import { type A2uiComponent, type A2uiFunctionResponse, type A2uiJsonObject, type A2uiMessage } from "./messages.ts";
|
|
10
|
+
export type A2uiIssueKind = "unknown_message" | "surface_mismatch" | "no_surface" | "invalid_pointer" | "unsupported_component" | "deleted_surface" | "duplicate_surface" | "function_not_allowed";
|
|
11
|
+
export type A2uiIssue = {
|
|
12
|
+
kind: A2uiIssueKind;
|
|
13
|
+
/** Index of the offending message within the applied batch. */
|
|
14
|
+
messageIndex: number;
|
|
15
|
+
detail: string;
|
|
16
|
+
};
|
|
17
|
+
export type A2uiSurfaceState = {
|
|
18
|
+
/** Original artifact identity and revision, set by the bundle reader, never sent on the wire. */
|
|
19
|
+
sourceRevision?: string;
|
|
20
|
+
surfaceId: string | null;
|
|
21
|
+
catalogId: string | null;
|
|
22
|
+
rendererHints: A2uiJsonObject;
|
|
23
|
+
releaseManifest: A2uiJsonObject | null;
|
|
24
|
+
/** Flat id -> component table, exactly as A2UI models a surface. */
|
|
25
|
+
components: Readonly<Record<string, A2uiComponent>>;
|
|
26
|
+
/** Declaration order, kept for debug listings and stable placeholder output. */
|
|
27
|
+
componentIds: readonly string[];
|
|
28
|
+
rootComponentId: string | null;
|
|
29
|
+
dataModel: unknown;
|
|
30
|
+
/** `deleteSurface` leaves the state addressable but empty. */
|
|
31
|
+
deleted: boolean;
|
|
32
|
+
appliedMessageCount: number;
|
|
33
|
+
agentFunctionResponses: readonly A2uiFunctionResponse[];
|
|
34
|
+
issues: readonly A2uiIssue[];
|
|
35
|
+
};
|
|
36
|
+
export type ApplyMessagesOptions = {
|
|
37
|
+
/**
|
|
38
|
+
* Component names this renderer can draw. Anything else is recorded as an
|
|
39
|
+
* `unsupported_component` issue and rendered by the placeholder card.
|
|
40
|
+
* Defaults to the public Foundation catalog plus generic layout containers.
|
|
41
|
+
*/
|
|
42
|
+
knownComponents?: ReadonlySet<string>;
|
|
43
|
+
};
|
|
44
|
+
export declare function createEmptyA2uiState(): A2uiSurfaceState;
|
|
45
|
+
/**
|
|
46
|
+
* Folds a message batch onto a state. Always returns a new object; the input is
|
|
47
|
+
* never mutated, so re-applying the whole history is a legitimate way to
|
|
48
|
+
* recompute (the playground does exactly that on every render).
|
|
49
|
+
*/
|
|
50
|
+
export declare function applyMessages(state: A2uiSurfaceState, messages: readonly A2uiMessage[], options?: ApplyMessagesOptions): A2uiSurfaceState;
|
|
51
|
+
export declare function hasRenderableSurface(state: A2uiSurfaceState | null): boolean;
|
|
52
|
+
/** Distinct component names in the surface that no renderer implementation covers. */
|
|
53
|
+
export declare function listUnsupportedComponents(state: A2uiSurfaceState, knownComponents?: ReadonlySet<string>): string[];
|
|
54
|
+
export type A2uiSurfaceSummary = {
|
|
55
|
+
surfaceId: string;
|
|
56
|
+
surfaceType: string;
|
|
57
|
+
stylePack: string;
|
|
58
|
+
mode: string;
|
|
59
|
+
pageFormat: string;
|
|
60
|
+
publishState: string;
|
|
61
|
+
catalogId: string;
|
|
62
|
+
componentCount: number;
|
|
63
|
+
unsupportedCount: number;
|
|
64
|
+
issueCount: number;
|
|
65
|
+
};
|
|
66
|
+
export declare function summarizeA2uiState(state: A2uiSurfaceState | null, knownComponents?: ReadonlySet<string>): A2uiSurfaceSummary | null;
|
|
67
|
+
/**
|
|
68
|
+
* Builds the `updateDataModel` message for the catalog's `toggleLocalFlag`
|
|
69
|
+
* client function. A2UI v1.0 has no primitive for client-local state changes
|
|
70
|
+
* (ADR 0004 gap 3), so the renderer synthesizes one and feeds it back through
|
|
71
|
+
* the same state machine instead of keeping a shadow store.
|
|
72
|
+
*/
|
|
73
|
+
export declare function buildLocalToggleMessage(state: A2uiSurfaceState, path: string): A2uiMessage | null;
|