@tangle-network/ui 11.11.1 → 11.11.3
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/CHANGELOG.md +14 -0
- package/README.md +9 -1
- package/dist/{chat-D4jAfEmj.js → chat-BUJhNpx2.js} +11 -6
- package/dist/chat.js +1 -1
- package/dist/{document-editor-pane-BcoABlhn.d.ts → document-editor-pane-DHM8DDhb.d.ts} +4 -1
- package/dist/{document-editor-pane-BxlPjaTP.js → document-editor-pane-LyanNypc.js} +6 -14
- package/dist/editor.d.ts +1 -1
- package/dist/editor.js +1 -1
- package/dist/{files-Bug33qCl.js → files-DgPc3vI2.js} +16 -7
- package/dist/files.d.ts +1 -1
- package/dist/files.js +1 -1
- package/dist/{index-DhYmSaLF.d.ts → index-CyGSLGVF.d.ts} +6 -17
- package/dist/index.d.ts +3 -2
- package/dist/index.js +6 -5
- package/dist/{openui-artifact-renderer-DrU1AdVk.js → openui-artifact-renderer-C3bmqfjX.js} +15 -20
- package/dist/openui-schema.d.ts +3 -0
- package/dist/openui-schema.js +2 -0
- package/dist/openui.d.ts +2 -1
- package/dist/openui.js +3 -2
- package/dist/{run-group-BACLbCFl.js → run-group-CxNskmHd.js} +1 -1
- package/dist/run.js +1 -1
- package/dist/schema-BFKgCGH-.d.ts +228 -0
- package/dist/schema-BpW9rSSG.js +9754 -0
- package/package.json +9 -2
- package/src/chat/agent-timeline.stories.tsx +15 -0
- package/src/chat/agent-timeline.tsx +10 -5
- package/src/editor/document-editor-pane.tsx +5 -1
- package/src/files/file-artifact-pane.test.tsx +41 -0
- package/src/files/file-artifact-pane.tsx +3 -0
- package/src/files/file-preview.tsx +16 -3
- package/src/openui/index.ts +10 -0
- package/src/openui/openui-artifact-renderer.stories.tsx +36 -0
- package/src/openui/openui-artifact-renderer.tsx +19 -27
- package/src/openui/schema-compiled.ts +3 -0
- package/src/openui/schema-data.ts +95 -0
- package/src/openui/schema.test.tsx +74 -0
- package/src/openui/schema.ts +136 -0
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { c as OpenUIComponentNode } from "./openui-artifact-renderer-D3E5bIAI.js";
|
|
2
|
+
//#region src/openui/schema-data.d.ts
|
|
3
|
+
declare const OPENUI_NODE_TYPES: readonly ["heading", "text", "badge", "stat", "key_value", "code", "markdown", "table", "actions", "separator", "stack", "grid", "card"];
|
|
4
|
+
/**
|
|
5
|
+
* The model-facing shape and the persistence gate share this exact schema.
|
|
6
|
+
* It covers JSON authored by an agent, not the renderer's programmatic ReactNode
|
|
7
|
+
* cells or onPress callbacks.
|
|
8
|
+
*/
|
|
9
|
+
declare const OPENUI_NODE_JSON_SCHEMA: {
|
|
10
|
+
readonly type: "object";
|
|
11
|
+
readonly $ref: "#/$defs/node";
|
|
12
|
+
readonly $defs: {
|
|
13
|
+
readonly node: {
|
|
14
|
+
readonly oneOf: {
|
|
15
|
+
$ref: string;
|
|
16
|
+
}[];
|
|
17
|
+
};
|
|
18
|
+
readonly action: {
|
|
19
|
+
readonly type: "object";
|
|
20
|
+
readonly required: readonly ["id", "label"];
|
|
21
|
+
readonly properties: {
|
|
22
|
+
readonly id: {
|
|
23
|
+
readonly type: "string";
|
|
24
|
+
};
|
|
25
|
+
readonly label: {
|
|
26
|
+
readonly type: "string";
|
|
27
|
+
};
|
|
28
|
+
readonly tone: {
|
|
29
|
+
readonly enum: readonly ["default", "secondary", "outline", "ghost", "destructive"];
|
|
30
|
+
};
|
|
31
|
+
readonly disabled: {
|
|
32
|
+
readonly type: "boolean";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
readonly additionalProperties: false;
|
|
36
|
+
};
|
|
37
|
+
readonly heading: {
|
|
38
|
+
type: string;
|
|
39
|
+
required: string[];
|
|
40
|
+
properties: {
|
|
41
|
+
type: {
|
|
42
|
+
const: string;
|
|
43
|
+
};
|
|
44
|
+
id: {
|
|
45
|
+
readonly type: "string";
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
additionalProperties: boolean;
|
|
49
|
+
};
|
|
50
|
+
readonly text: {
|
|
51
|
+
type: string;
|
|
52
|
+
required: string[];
|
|
53
|
+
properties: {
|
|
54
|
+
type: {
|
|
55
|
+
const: string;
|
|
56
|
+
};
|
|
57
|
+
id: {
|
|
58
|
+
readonly type: "string";
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
additionalProperties: boolean;
|
|
62
|
+
};
|
|
63
|
+
readonly badge: {
|
|
64
|
+
type: string;
|
|
65
|
+
required: string[];
|
|
66
|
+
properties: {
|
|
67
|
+
type: {
|
|
68
|
+
const: string;
|
|
69
|
+
};
|
|
70
|
+
id: {
|
|
71
|
+
readonly type: "string";
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
additionalProperties: boolean;
|
|
75
|
+
};
|
|
76
|
+
readonly stat: {
|
|
77
|
+
type: string;
|
|
78
|
+
required: string[];
|
|
79
|
+
properties: {
|
|
80
|
+
type: {
|
|
81
|
+
const: string;
|
|
82
|
+
};
|
|
83
|
+
id: {
|
|
84
|
+
readonly type: "string";
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
additionalProperties: boolean;
|
|
88
|
+
};
|
|
89
|
+
readonly key_value: {
|
|
90
|
+
type: string;
|
|
91
|
+
required: string[];
|
|
92
|
+
properties: {
|
|
93
|
+
type: {
|
|
94
|
+
const: string;
|
|
95
|
+
};
|
|
96
|
+
id: {
|
|
97
|
+
readonly type: "string";
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
additionalProperties: boolean;
|
|
101
|
+
};
|
|
102
|
+
readonly code: {
|
|
103
|
+
type: string;
|
|
104
|
+
required: string[];
|
|
105
|
+
properties: {
|
|
106
|
+
type: {
|
|
107
|
+
const: string;
|
|
108
|
+
};
|
|
109
|
+
id: {
|
|
110
|
+
readonly type: "string";
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
additionalProperties: boolean;
|
|
114
|
+
};
|
|
115
|
+
readonly markdown: {
|
|
116
|
+
type: string;
|
|
117
|
+
required: string[];
|
|
118
|
+
properties: {
|
|
119
|
+
type: {
|
|
120
|
+
const: string;
|
|
121
|
+
};
|
|
122
|
+
id: {
|
|
123
|
+
readonly type: "string";
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
additionalProperties: boolean;
|
|
127
|
+
};
|
|
128
|
+
readonly table: {
|
|
129
|
+
type: string;
|
|
130
|
+
required: string[];
|
|
131
|
+
properties: {
|
|
132
|
+
type: {
|
|
133
|
+
const: string;
|
|
134
|
+
};
|
|
135
|
+
id: {
|
|
136
|
+
readonly type: "string";
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
additionalProperties: boolean;
|
|
140
|
+
};
|
|
141
|
+
readonly actions: {
|
|
142
|
+
type: string;
|
|
143
|
+
required: string[];
|
|
144
|
+
properties: {
|
|
145
|
+
type: {
|
|
146
|
+
const: string;
|
|
147
|
+
};
|
|
148
|
+
id: {
|
|
149
|
+
readonly type: "string";
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
additionalProperties: boolean;
|
|
153
|
+
};
|
|
154
|
+
readonly separator: {
|
|
155
|
+
type: string;
|
|
156
|
+
required: string[];
|
|
157
|
+
properties: {
|
|
158
|
+
type: {
|
|
159
|
+
const: string;
|
|
160
|
+
};
|
|
161
|
+
id: {
|
|
162
|
+
readonly type: "string";
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
additionalProperties: boolean;
|
|
166
|
+
};
|
|
167
|
+
readonly stack: {
|
|
168
|
+
type: string;
|
|
169
|
+
required: string[];
|
|
170
|
+
properties: {
|
|
171
|
+
type: {
|
|
172
|
+
const: string;
|
|
173
|
+
};
|
|
174
|
+
id: {
|
|
175
|
+
readonly type: "string";
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
additionalProperties: boolean;
|
|
179
|
+
};
|
|
180
|
+
readonly grid: {
|
|
181
|
+
type: string;
|
|
182
|
+
required: string[];
|
|
183
|
+
properties: {
|
|
184
|
+
type: {
|
|
185
|
+
const: string;
|
|
186
|
+
};
|
|
187
|
+
id: {
|
|
188
|
+
readonly type: "string";
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
additionalProperties: boolean;
|
|
192
|
+
};
|
|
193
|
+
readonly card: {
|
|
194
|
+
type: string;
|
|
195
|
+
required: string[];
|
|
196
|
+
properties: {
|
|
197
|
+
type: {
|
|
198
|
+
const: string;
|
|
199
|
+
};
|
|
200
|
+
id: {
|
|
201
|
+
readonly type: "string";
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
additionalProperties: boolean;
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
//#endregion
|
|
209
|
+
//#region src/openui/schema.d.ts
|
|
210
|
+
interface OpenUISchemaIssue {
|
|
211
|
+
path: string;
|
|
212
|
+
message: string;
|
|
213
|
+
}
|
|
214
|
+
type OpenUISchemaValidation<T> = {
|
|
215
|
+
ok: true;
|
|
216
|
+
value: T;
|
|
217
|
+
} | {
|
|
218
|
+
ok: false;
|
|
219
|
+
issue: OpenUISchemaIssue;
|
|
220
|
+
};
|
|
221
|
+
/** Find an unsupported node at any depth before the renderer can omit it. */
|
|
222
|
+
declare function findUnsupportedOpenUINode(value: unknown): OpenUISchemaIssue | null;
|
|
223
|
+
/** Validate one model-authored JSON node before a product persists or spends on it. */
|
|
224
|
+
declare function validateOpenUIJsonNode(value: unknown): OpenUISchemaValidation<OpenUIComponentNode>;
|
|
225
|
+
/** Validate the renderer's single-node or nonempty node-array artifact shape. */
|
|
226
|
+
declare function validateOpenUIJsonArtifact(value: unknown): OpenUISchemaValidation<OpenUIComponentNode | OpenUIComponentNode[]>;
|
|
227
|
+
//#endregion
|
|
228
|
+
export { validateOpenUIJsonNode as a, validateOpenUIJsonArtifact as i, OpenUISchemaValidation as n, OPENUI_NODE_JSON_SCHEMA as o, findUnsupportedOpenUINode as r, OPENUI_NODE_TYPES as s, OpenUISchemaIssue as t };
|