@usetheo/ui 0.1.0-next.0 → 0.3.0-next.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/CHANGELOG.md +62 -0
- package/README.md +116 -9
- package/dist/index.d.ts +242 -16
- package/dist/index.js +436 -131
- package/dist/index.js.map +1 -1
- package/dist/plugin-Atb0VKtr.d.ts +172 -0
- package/dist/slide/index.d.ts +212 -0
- package/dist/slide/index.js +714 -0
- package/dist/slide/index.js.map +1 -0
- package/dist/slide/plugins/emoji/index.d.ts +29 -0
- package/dist/slide/plugins/emoji/index.js +157 -0
- package/dist/slide/plugins/emoji/index.js.map +1 -0
- package/dist/slide/plugins/math/index.d.ts +13 -0
- package/dist/slide/plugins/math/index.js +145 -0
- package/dist/slide/plugins/math/index.js.map +1 -0
- package/dist/slide/plugins/mermaid/index.d.ts +55 -0
- package/dist/slide/plugins/mermaid/index.js +218 -0
- package/dist/slide/plugins/mermaid/index.js.map +1 -0
- package/dist/slide/plugins/shiki/index.d.ts +18 -0
- package/dist/slide/plugins/shiki/index.js +87 -0
- package/dist/slide/plugins/shiki/index.js.map +1 -0
- package/dist/slide/themes/default.css +256 -0
- package/dist/slide/themes/layouts.css +143 -0
- package/dist/slide/themes/violet-forge.css +256 -0
- package/dist/slide-deck/index.css +52 -0
- package/dist/slide-deck/index.css.map +1 -0
- package/dist/slide-deck/index.d.ts +377 -0
- package/dist/slide-deck/index.js +1797 -0
- package/dist/slide-deck/index.js.map +1 -0
- package/dist/whiteboard/index.d.ts +258 -0
- package/dist/whiteboard/index.js +738 -0
- package/dist/whiteboard/index.js.map +1 -0
- package/package.json +126 -6
- package/registry/index.json +42 -0
- package/registry/r/agent-composer.json +4 -4
- package/registry/r/agent-editor.json +9 -9
- package/registry/r/agent-error-card.json +2 -2
- package/registry/r/agent-event.json +4 -4
- package/registry/r/agent-handoff.json +2 -2
- package/registry/r/agent-profile.json +2 -2
- package/registry/r/agent-starting-state.json +2 -2
- package/registry/r/agent-stream.json +9 -9
- package/registry/r/agent-streaming.json +2 -2
- package/registry/r/agent-timeline.json +4 -4
- package/registry/r/approval-card.json +4 -4
- package/registry/r/artifact-preview.json +2 -2
- package/registry/r/attachment-chip.json +4 -4
- package/registry/r/audit-log-entry.json +3 -3
- package/registry/r/auto-compact-notice.json +2 -2
- package/registry/r/avatar.json +2 -2
- package/registry/r/badge.json +3 -3
- package/registry/r/browser-controls.json +2 -2
- package/registry/r/build-log-stream.json +2 -2
- package/registry/r/button.json +3 -3
- package/registry/r/capability-indicator.json +3 -3
- package/registry/r/card.json +3 -3
- package/registry/r/chat-composer.json +3 -3
- package/registry/r/chat-message.json +3 -3
- package/registry/r/chat-thread.json +2 -2
- package/registry/r/checkbox.json +4 -3
- package/registry/r/cn.json +1 -1
- package/registry/r/command-palette.json +4 -4
- package/registry/r/context-card.json +3 -3
- package/registry/r/context-window-bar.json +2 -2
- package/registry/r/cost-meter.json +2 -2
- package/registry/r/created-files-card.json +3 -3
- package/registry/r/cron-job-card.json +2 -2
- package/registry/r/cron-jobs-list.json +3 -3
- package/registry/r/deployment-row.json +3 -3
- package/registry/r/dialog.json +2 -2
- package/registry/r/diff-viewer.json +2 -2
- package/registry/r/domain-config.json +6 -6
- package/registry/r/empty-state.json +3 -3
- package/registry/r/env-var-editor.json +5 -5
- package/registry/r/folder-context-card.json +3 -3
- package/registry/r/folder-selector.json +2 -2
- package/registry/r/form-field.json +3 -3
- package/registry/r/hook-config.json +2 -2
- package/registry/r/hook-event-log.json +2 -2
- package/registry/r/input.json +6 -3
- package/registry/r/intent-selector.json +3 -3
- package/registry/r/label.json +2 -2
- package/registry/r/lane-board.json +2 -2
- package/registry/r/login-split.json +2 -2
- package/registry/r/mcp-server-card.json +2 -2
- package/registry/r/mcp-server-list.json +3 -3
- package/registry/r/memory-editor.json +3 -3
- package/registry/r/mention-menu.json +3 -3
- package/registry/r/metrics-panel.json +2 -2
- package/registry/r/model-card.json +3 -3
- package/registry/r/model-selector.json +2 -2
- package/registry/r/permission-matrix.json +2 -2
- package/registry/r/permission-modal.json +4 -4
- package/registry/r/preview-env-card.json +5 -5
- package/registry/r/preview-panel.json +3 -3
- package/registry/r/progress-checklist.json +3 -3
- package/registry/r/project-card.json +5 -5
- package/registry/r/project-switcher.json +2 -2
- package/registry/r/quick-action-chips.json +3 -3
- package/registry/r/radio-group.json +2 -2
- package/registry/r/recent-folders-list.json +2 -2
- package/registry/r/rollback-ui.json +4 -4
- package/registry/r/rule-card.json +3 -3
- package/registry/r/rule-editor.json +10 -10
- package/registry/r/rule-types.json +1 -1
- package/registry/r/run-stats.json +2 -2
- package/registry/r/running-tasks-panel.json +2 -2
- package/registry/r/scroll-area.json +2 -2
- package/registry/r/select.json +4 -3
- package/registry/r/session-list-item.json +2 -2
- package/registry/r/session-timeline.json +2 -2
- package/registry/r/sheet.json +2 -2
- package/registry/r/sidebar.json +2 -2
- package/registry/r/skeleton.json +2 -2
- package/registry/r/skill-card.json +4 -4
- package/registry/r/skill-editor.json +10 -10
- package/registry/r/skills-list.json +3 -3
- package/registry/r/slide-deck.json +130 -0
- package/registry/r/slide-plugin-emoji.json +28 -0
- package/registry/r/slide-plugin-math.json +24 -0
- package/registry/r/slide-plugin-mermaid.json +23 -0
- package/registry/r/slide-plugin-shiki.json +23 -0
- package/registry/r/slide.json +123 -0
- package/registry/r/social-auth-row.json +3 -3
- package/registry/r/steps-rail.json +2 -2
- package/registry/r/sub-agent-dispatch.json +2 -2
- package/registry/r/switch.json +5 -4
- package/registry/r/system-prompt-editor.json +2 -2
- package/registry/r/tabs.json +2 -2
- package/registry/r/tailwind-preset.json +1 -1
- package/registry/r/task-header.json +4 -4
- package/registry/r/task-plan.json +2 -2
- package/registry/r/terminal-panel.json +2 -2
- package/registry/r/textarea.json +6 -3
- package/registry/r/theme-provider.json +4 -4
- package/registry/r/theme-script.json +1 -1
- package/registry/r/theo-ui-provider.json +2 -2
- package/registry/r/toast.json +3 -3
- package/registry/r/token-usage-chart.json +2 -2
- package/registry/r/tool-call-card.json +3 -3
- package/registry/r/tool-call.json +2 -2
- package/registry/r/tool-result.json +2 -2
- package/registry/r/tools-list.json +3 -3
- package/registry/r/tooltip.json +2 -2
- package/registry/r/topnav.json +2 -2
- package/registry/r/whiteboard.json +101 -0
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Zod schema for the Whiteboard JSON v1 (`WhiteboardScene`).
|
|
6
|
+
*
|
|
7
|
+
* Design goals (see RFC 0001 §4 and ADR D4 in the plan):
|
|
8
|
+
* - LLM-friendly: minimal fields per element.
|
|
9
|
+
* - Discriminated union by `type` for exhaustive typing in TS.
|
|
10
|
+
* - Defensive against LLM mistakes:
|
|
11
|
+
* - EC-3: `.finite()` everywhere — rejects NaN / Infinity.
|
|
12
|
+
* - EC-4: `.max()` on dimensions to cap absurd values from the model.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
declare const whiteboardScene: z.ZodObject<{
|
|
16
|
+
version: z.ZodLiteral<1>;
|
|
17
|
+
width: z.ZodNumber;
|
|
18
|
+
height: z.ZodNumber;
|
|
19
|
+
background: z.ZodOptional<z.ZodString>;
|
|
20
|
+
elements: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
21
|
+
id: z.ZodOptional<z.ZodString>;
|
|
22
|
+
x: z.ZodNumber;
|
|
23
|
+
y: z.ZodNumber;
|
|
24
|
+
stroke: z.ZodOptional<z.ZodString>;
|
|
25
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
strokeStyle: z.ZodOptional<z.ZodEnum<{
|
|
27
|
+
solid: "solid";
|
|
28
|
+
dashed: "dashed";
|
|
29
|
+
dotted: "dotted";
|
|
30
|
+
}>>;
|
|
31
|
+
fill: z.ZodOptional<z.ZodString>;
|
|
32
|
+
fillStyle: z.ZodOptional<z.ZodEnum<{
|
|
33
|
+
solid: "solid";
|
|
34
|
+
hachure: "hachure";
|
|
35
|
+
"cross-hatch": "cross-hatch";
|
|
36
|
+
zigzag: "zigzag";
|
|
37
|
+
}>>;
|
|
38
|
+
opacity: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
roughness: z.ZodOptional<z.ZodNumber>;
|
|
40
|
+
seed: z.ZodOptional<z.ZodNumber>;
|
|
41
|
+
type: z.ZodLiteral<"rect">;
|
|
42
|
+
w: z.ZodNumber;
|
|
43
|
+
h: z.ZodNumber;
|
|
44
|
+
label: z.ZodOptional<z.ZodString>;
|
|
45
|
+
roundness: z.ZodOptional<z.ZodEnum<{
|
|
46
|
+
sharp: "sharp";
|
|
47
|
+
round: "round";
|
|
48
|
+
}>>;
|
|
49
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
50
|
+
id: z.ZodOptional<z.ZodString>;
|
|
51
|
+
x: z.ZodNumber;
|
|
52
|
+
y: z.ZodNumber;
|
|
53
|
+
stroke: z.ZodOptional<z.ZodString>;
|
|
54
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
strokeStyle: z.ZodOptional<z.ZodEnum<{
|
|
56
|
+
solid: "solid";
|
|
57
|
+
dashed: "dashed";
|
|
58
|
+
dotted: "dotted";
|
|
59
|
+
}>>;
|
|
60
|
+
fill: z.ZodOptional<z.ZodString>;
|
|
61
|
+
fillStyle: z.ZodOptional<z.ZodEnum<{
|
|
62
|
+
solid: "solid";
|
|
63
|
+
hachure: "hachure";
|
|
64
|
+
"cross-hatch": "cross-hatch";
|
|
65
|
+
zigzag: "zigzag";
|
|
66
|
+
}>>;
|
|
67
|
+
opacity: z.ZodOptional<z.ZodNumber>;
|
|
68
|
+
roughness: z.ZodOptional<z.ZodNumber>;
|
|
69
|
+
seed: z.ZodOptional<z.ZodNumber>;
|
|
70
|
+
type: z.ZodLiteral<"ellipse">;
|
|
71
|
+
w: z.ZodNumber;
|
|
72
|
+
h: z.ZodNumber;
|
|
73
|
+
label: z.ZodOptional<z.ZodString>;
|
|
74
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
75
|
+
id: z.ZodOptional<z.ZodString>;
|
|
76
|
+
x: z.ZodNumber;
|
|
77
|
+
y: z.ZodNumber;
|
|
78
|
+
stroke: z.ZodOptional<z.ZodString>;
|
|
79
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
80
|
+
strokeStyle: z.ZodOptional<z.ZodEnum<{
|
|
81
|
+
solid: "solid";
|
|
82
|
+
dashed: "dashed";
|
|
83
|
+
dotted: "dotted";
|
|
84
|
+
}>>;
|
|
85
|
+
fill: z.ZodOptional<z.ZodString>;
|
|
86
|
+
fillStyle: z.ZodOptional<z.ZodEnum<{
|
|
87
|
+
solid: "solid";
|
|
88
|
+
hachure: "hachure";
|
|
89
|
+
"cross-hatch": "cross-hatch";
|
|
90
|
+
zigzag: "zigzag";
|
|
91
|
+
}>>;
|
|
92
|
+
opacity: z.ZodOptional<z.ZodNumber>;
|
|
93
|
+
roughness: z.ZodOptional<z.ZodNumber>;
|
|
94
|
+
seed: z.ZodOptional<z.ZodNumber>;
|
|
95
|
+
type: z.ZodLiteral<"diamond">;
|
|
96
|
+
w: z.ZodNumber;
|
|
97
|
+
h: z.ZodNumber;
|
|
98
|
+
label: z.ZodOptional<z.ZodString>;
|
|
99
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
100
|
+
id: z.ZodOptional<z.ZodString>;
|
|
101
|
+
x: z.ZodNumber;
|
|
102
|
+
y: z.ZodNumber;
|
|
103
|
+
stroke: z.ZodOptional<z.ZodString>;
|
|
104
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
105
|
+
strokeStyle: z.ZodOptional<z.ZodEnum<{
|
|
106
|
+
solid: "solid";
|
|
107
|
+
dashed: "dashed";
|
|
108
|
+
dotted: "dotted";
|
|
109
|
+
}>>;
|
|
110
|
+
fill: z.ZodOptional<z.ZodString>;
|
|
111
|
+
fillStyle: z.ZodOptional<z.ZodEnum<{
|
|
112
|
+
solid: "solid";
|
|
113
|
+
hachure: "hachure";
|
|
114
|
+
"cross-hatch": "cross-hatch";
|
|
115
|
+
zigzag: "zigzag";
|
|
116
|
+
}>>;
|
|
117
|
+
opacity: z.ZodOptional<z.ZodNumber>;
|
|
118
|
+
roughness: z.ZodOptional<z.ZodNumber>;
|
|
119
|
+
seed: z.ZodOptional<z.ZodNumber>;
|
|
120
|
+
type: z.ZodLiteral<"line">;
|
|
121
|
+
to: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
122
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
123
|
+
id: z.ZodOptional<z.ZodString>;
|
|
124
|
+
x: z.ZodNumber;
|
|
125
|
+
y: z.ZodNumber;
|
|
126
|
+
stroke: z.ZodOptional<z.ZodString>;
|
|
127
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
128
|
+
strokeStyle: z.ZodOptional<z.ZodEnum<{
|
|
129
|
+
solid: "solid";
|
|
130
|
+
dashed: "dashed";
|
|
131
|
+
dotted: "dotted";
|
|
132
|
+
}>>;
|
|
133
|
+
fill: z.ZodOptional<z.ZodString>;
|
|
134
|
+
fillStyle: z.ZodOptional<z.ZodEnum<{
|
|
135
|
+
solid: "solid";
|
|
136
|
+
hachure: "hachure";
|
|
137
|
+
"cross-hatch": "cross-hatch";
|
|
138
|
+
zigzag: "zigzag";
|
|
139
|
+
}>>;
|
|
140
|
+
opacity: z.ZodOptional<z.ZodNumber>;
|
|
141
|
+
roughness: z.ZodOptional<z.ZodNumber>;
|
|
142
|
+
seed: z.ZodOptional<z.ZodNumber>;
|
|
143
|
+
type: z.ZodLiteral<"arrow">;
|
|
144
|
+
to: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
145
|
+
label: z.ZodOptional<z.ZodString>;
|
|
146
|
+
headStart: z.ZodOptional<z.ZodBoolean>;
|
|
147
|
+
headEnd: z.ZodDefault<z.ZodBoolean>;
|
|
148
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
149
|
+
id: z.ZodOptional<z.ZodString>;
|
|
150
|
+
x: z.ZodNumber;
|
|
151
|
+
y: z.ZodNumber;
|
|
152
|
+
stroke: z.ZodOptional<z.ZodString>;
|
|
153
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
154
|
+
strokeStyle: z.ZodOptional<z.ZodEnum<{
|
|
155
|
+
solid: "solid";
|
|
156
|
+
dashed: "dashed";
|
|
157
|
+
dotted: "dotted";
|
|
158
|
+
}>>;
|
|
159
|
+
fill: z.ZodOptional<z.ZodString>;
|
|
160
|
+
fillStyle: z.ZodOptional<z.ZodEnum<{
|
|
161
|
+
solid: "solid";
|
|
162
|
+
hachure: "hachure";
|
|
163
|
+
"cross-hatch": "cross-hatch";
|
|
164
|
+
zigzag: "zigzag";
|
|
165
|
+
}>>;
|
|
166
|
+
opacity: z.ZodOptional<z.ZodNumber>;
|
|
167
|
+
roughness: z.ZodOptional<z.ZodNumber>;
|
|
168
|
+
seed: z.ZodOptional<z.ZodNumber>;
|
|
169
|
+
type: z.ZodLiteral<"text">;
|
|
170
|
+
text: z.ZodString;
|
|
171
|
+
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
172
|
+
align: z.ZodOptional<z.ZodEnum<{
|
|
173
|
+
left: "left";
|
|
174
|
+
center: "center";
|
|
175
|
+
right: "right";
|
|
176
|
+
}>>;
|
|
177
|
+
fontFamily: z.ZodOptional<z.ZodEnum<{
|
|
178
|
+
sans: "sans";
|
|
179
|
+
serif: "serif";
|
|
180
|
+
mono: "mono";
|
|
181
|
+
hand: "hand";
|
|
182
|
+
}>>;
|
|
183
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
184
|
+
id: z.ZodOptional<z.ZodString>;
|
|
185
|
+
x: z.ZodNumber;
|
|
186
|
+
y: z.ZodNumber;
|
|
187
|
+
stroke: z.ZodOptional<z.ZodString>;
|
|
188
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
189
|
+
strokeStyle: z.ZodOptional<z.ZodEnum<{
|
|
190
|
+
solid: "solid";
|
|
191
|
+
dashed: "dashed";
|
|
192
|
+
dotted: "dotted";
|
|
193
|
+
}>>;
|
|
194
|
+
fill: z.ZodOptional<z.ZodString>;
|
|
195
|
+
fillStyle: z.ZodOptional<z.ZodEnum<{
|
|
196
|
+
solid: "solid";
|
|
197
|
+
hachure: "hachure";
|
|
198
|
+
"cross-hatch": "cross-hatch";
|
|
199
|
+
zigzag: "zigzag";
|
|
200
|
+
}>>;
|
|
201
|
+
opacity: z.ZodOptional<z.ZodNumber>;
|
|
202
|
+
roughness: z.ZodOptional<z.ZodNumber>;
|
|
203
|
+
seed: z.ZodOptional<z.ZodNumber>;
|
|
204
|
+
type: z.ZodLiteral<"freedraw">;
|
|
205
|
+
points: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodOptional<z.ZodNumber>], null>>;
|
|
206
|
+
}, z.core.$strip>], "type">>;
|
|
207
|
+
}, z.core.$strip>;
|
|
208
|
+
type WhiteboardScene = z.output<typeof whiteboardScene>;
|
|
209
|
+
type WhiteboardSceneInput = z.input<typeof whiteboardScene>;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Public validator for `WhiteboardScene` JSON. Wraps Zod and converts errors
|
|
213
|
+
* into a structured shape that an LLM can consume to self-correct.
|
|
214
|
+
*
|
|
215
|
+
* Returns `{ ok: true, scene }` on success or `{ ok: false, errors }` with
|
|
216
|
+
* each error carrying `{ path, message, code, got? }`. See RFC 0001 §4.
|
|
217
|
+
*/
|
|
218
|
+
|
|
219
|
+
interface ValidationError {
|
|
220
|
+
/** Dot-joined Zod path, e.g. "elements.2.type" or "width". */
|
|
221
|
+
path: string;
|
|
222
|
+
/** Human-readable explanation (passes through Zod's message). */
|
|
223
|
+
message: string;
|
|
224
|
+
/** Zod issue code: `invalid_type`, `too_small`, `invalid_literal`, ... */
|
|
225
|
+
code: string;
|
|
226
|
+
/** Actual value received at `path`. Populated for type mismatches, discriminator mismatches, and any issue where Zod's `received` is absent but the value can be recovered by walking the original input along `path`. */
|
|
227
|
+
got?: unknown;
|
|
228
|
+
}
|
|
229
|
+
type ValidationResult = {
|
|
230
|
+
ok: true;
|
|
231
|
+
scene: WhiteboardScene;
|
|
232
|
+
} | {
|
|
233
|
+
ok: false;
|
|
234
|
+
errors: ValidationError[];
|
|
235
|
+
};
|
|
236
|
+
declare function validateScene(input: unknown): ValidationResult;
|
|
237
|
+
|
|
238
|
+
/** Input type accepted by the component (defaults like `headEnd` are optional). */
|
|
239
|
+
type WhiteboardData = WhiteboardSceneInput;
|
|
240
|
+
|
|
241
|
+
interface WhiteboardProps {
|
|
242
|
+
/** The scene to render. Validated with Zod on every change. */
|
|
243
|
+
data: WhiteboardData | unknown;
|
|
244
|
+
className?: string;
|
|
245
|
+
/** Starting zoom level (clamped 0.1–8). Default 1. */
|
|
246
|
+
initialZoom?: number;
|
|
247
|
+
/** World coordinate centered in the viewport on first render. */
|
|
248
|
+
initialCenter?: [number, number];
|
|
249
|
+
/** When true, computes a bounding box of all elements and zooms to fit. */
|
|
250
|
+
fitOnLoad?: boolean;
|
|
251
|
+
/** Called once per validation failure with the list of errors (EC-6: in useEffect, not render). */
|
|
252
|
+
onValidationError?: (errors: ValidationError[]) => void;
|
|
253
|
+
/** Accessible label for the SVG (defaults to "Whiteboard diagram"). */
|
|
254
|
+
"aria-label"?: string;
|
|
255
|
+
}
|
|
256
|
+
declare function Whiteboard({ data, className, initialZoom, initialCenter, fitOnLoad, onValidationError, "aria-label": ariaLabel, }: WhiteboardProps): react_jsx_runtime.JSX.Element;
|
|
257
|
+
|
|
258
|
+
export { type ValidationError, type ValidationResult, Whiteboard, type WhiteboardData, type WhiteboardProps, validateScene };
|