@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,6 @@
|
|
|
1
|
+
import type { GraphBridgeMessage } from "./bridge.generated.ts";
|
|
2
|
+
export type { GraphBridgeMessage } from "./bridge.generated.ts";
|
|
3
|
+
export type GraphIdentity = Pick<GraphBridgeMessage, "bridge_version" | "instance_id" | "session_id" | "execution_id">;
|
|
4
|
+
/** Both ends use the validator generated from Foundation's canonical bridge schema. */
|
|
5
|
+
export declare function isGraphMessage(value: unknown): value is GraphBridgeMessage;
|
|
6
|
+
export declare function sameGraphInstance(message: GraphBridgeMessage, identity: GraphIdentity): boolean;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
export type GraphData = {
|
|
2
|
+
readonly "nodes": ReadonlyArray<{
|
|
3
|
+
readonly "id": string;
|
|
4
|
+
readonly "label": string;
|
|
5
|
+
}>;
|
|
6
|
+
readonly "edges": ReadonlyArray<{
|
|
7
|
+
readonly "from": string;
|
|
8
|
+
readonly "to": string;
|
|
9
|
+
}>;
|
|
10
|
+
};
|
|
11
|
+
export type GraphPoint = {
|
|
12
|
+
readonly "id": string;
|
|
13
|
+
readonly "x": number;
|
|
14
|
+
readonly "y": number;
|
|
15
|
+
};
|
|
16
|
+
export type GraphConnectedMessage = {
|
|
17
|
+
readonly "bridge_version": 1;
|
|
18
|
+
readonly "instance_id": string;
|
|
19
|
+
readonly "session_id": string;
|
|
20
|
+
readonly "execution_id": string;
|
|
21
|
+
readonly "state_revision": number;
|
|
22
|
+
readonly "kind": "connected";
|
|
23
|
+
};
|
|
24
|
+
export type GraphInitializeMessage = {
|
|
25
|
+
readonly "bridge_version": 1;
|
|
26
|
+
readonly "instance_id": string;
|
|
27
|
+
readonly "session_id": string;
|
|
28
|
+
readonly "execution_id": string;
|
|
29
|
+
readonly "state_revision": number;
|
|
30
|
+
readonly "kind": "initialize";
|
|
31
|
+
readonly "body": {
|
|
32
|
+
readonly "graph": GraphData;
|
|
33
|
+
readonly "selectedId": string | null;
|
|
34
|
+
readonly "sourceText": string;
|
|
35
|
+
readonly "locale": "en" | "zh";
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export type GraphStateMessage = {
|
|
39
|
+
readonly "bridge_version": 1;
|
|
40
|
+
readonly "instance_id": string;
|
|
41
|
+
readonly "session_id": string;
|
|
42
|
+
readonly "execution_id": string;
|
|
43
|
+
readonly "state_revision": number;
|
|
44
|
+
readonly "kind": "state";
|
|
45
|
+
readonly "body": {
|
|
46
|
+
readonly "selectedId": string | null;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export type GraphInputMessage = {
|
|
50
|
+
readonly "bridge_version": 1;
|
|
51
|
+
readonly "instance_id": string;
|
|
52
|
+
readonly "session_id": string;
|
|
53
|
+
readonly "execution_id": string;
|
|
54
|
+
readonly "state_revision": number;
|
|
55
|
+
readonly "kind": "input";
|
|
56
|
+
readonly "body": {
|
|
57
|
+
readonly "id": string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export type GraphSceneMessage = {
|
|
61
|
+
readonly "bridge_version": 1;
|
|
62
|
+
readonly "instance_id": string;
|
|
63
|
+
readonly "session_id": string;
|
|
64
|
+
readonly "execution_id": string;
|
|
65
|
+
readonly "state_revision": number;
|
|
66
|
+
readonly "kind": "scene";
|
|
67
|
+
readonly "body": {
|
|
68
|
+
readonly "positions": ReadonlyArray<GraphPoint>;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
export type GraphSelectMessage = {
|
|
72
|
+
readonly "bridge_version": 1;
|
|
73
|
+
readonly "instance_id": string;
|
|
74
|
+
readonly "session_id": string;
|
|
75
|
+
readonly "execution_id": string;
|
|
76
|
+
readonly "state_revision": number;
|
|
77
|
+
readonly "kind": "select";
|
|
78
|
+
readonly "body": {
|
|
79
|
+
readonly "id": string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
export type GraphReadyMessage = {
|
|
83
|
+
readonly "bridge_version": 1;
|
|
84
|
+
readonly "instance_id": string;
|
|
85
|
+
readonly "session_id": string;
|
|
86
|
+
readonly "execution_id": string;
|
|
87
|
+
readonly "state_revision": number;
|
|
88
|
+
readonly "kind": "ready";
|
|
89
|
+
};
|
|
90
|
+
export type GraphFailedMessage = {
|
|
91
|
+
readonly "bridge_version": 1;
|
|
92
|
+
readonly "instance_id": string;
|
|
93
|
+
readonly "session_id": string;
|
|
94
|
+
readonly "execution_id": string;
|
|
95
|
+
readonly "state_revision": number;
|
|
96
|
+
readonly "kind": "failed";
|
|
97
|
+
readonly "body": {
|
|
98
|
+
readonly "code": "engine_init" | "execution" | "budget" | "invalid_scene" | "protocol" | "worker_timeout" | "first_frame_timeout";
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
export type GraphSuspendMessage = {
|
|
102
|
+
readonly "bridge_version": 1;
|
|
103
|
+
readonly "instance_id": string;
|
|
104
|
+
readonly "session_id": string;
|
|
105
|
+
readonly "execution_id": string;
|
|
106
|
+
readonly "state_revision": number;
|
|
107
|
+
readonly "kind": "suspend";
|
|
108
|
+
};
|
|
109
|
+
export type GraphResumeMessage = {
|
|
110
|
+
readonly "bridge_version": 1;
|
|
111
|
+
readonly "instance_id": string;
|
|
112
|
+
readonly "session_id": string;
|
|
113
|
+
readonly "execution_id": string;
|
|
114
|
+
readonly "state_revision": number;
|
|
115
|
+
readonly "kind": "resume";
|
|
116
|
+
readonly "body": {
|
|
117
|
+
readonly "selectedId": string | null;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
export type GraphSettledMessage = {
|
|
121
|
+
readonly "bridge_version": 1;
|
|
122
|
+
readonly "instance_id": string;
|
|
123
|
+
readonly "session_id": string;
|
|
124
|
+
readonly "execution_id": string;
|
|
125
|
+
readonly "state_revision": number;
|
|
126
|
+
readonly "kind": "settled";
|
|
127
|
+
};
|
|
128
|
+
export type GraphDisposeMessage = {
|
|
129
|
+
readonly "bridge_version": 1;
|
|
130
|
+
readonly "instance_id": string;
|
|
131
|
+
readonly "session_id": string;
|
|
132
|
+
readonly "execution_id": string;
|
|
133
|
+
readonly "state_revision": number;
|
|
134
|
+
readonly "kind": "dispose";
|
|
135
|
+
};
|
|
136
|
+
export type GraphBridgeMessage = GraphConnectedMessage | GraphInitializeMessage | GraphStateMessage | GraphInputMessage | GraphSceneMessage | GraphSelectMessage | GraphReadyMessage | GraphFailedMessage | GraphSuspendMessage | GraphResumeMessage | GraphSettledMessage | GraphDisposeMessage;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import validate from "./bridgeValidator.cjs";
|
|
2
|
+
/** Both ends use the validator generated from Foundation's canonical bridge schema. */
|
|
3
|
+
export function isGraphMessage(value) {
|
|
4
|
+
try {
|
|
5
|
+
const encoder = new TextEncoder();
|
|
6
|
+
const initial = value?.kind === "initialize";
|
|
7
|
+
if (initial) {
|
|
8
|
+
const source = value.body?.sourceText;
|
|
9
|
+
if (typeof source !== "string" || encoder.encode(source).length > 1024 * 1024)
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
const size = encoder.encode(JSON.stringify(value)).length;
|
|
13
|
+
// JSON escapes one source byte into up to six bytes; admission still caps the original text.
|
|
14
|
+
const limit = initial ? 6 * 1024 * 1024 + 32768 : 32768;
|
|
15
|
+
return size <= limit && validate(value);
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export function sameGraphInstance(message, identity) {
|
|
22
|
+
return message.bridge_version === identity.bridge_version && message.instance_id === identity.instance_id
|
|
23
|
+
&& message.session_id === identity.session_id && message.execution_id === identity.execution_id;
|
|
24
|
+
}
|