@orangecatai/adgen-canvas 0.0.1 → 0.0.2

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.
Files changed (96) hide show
  1. package/README.md +8 -12
  2. package/dist/dev/{chunk-23ZG3JRJ.js → chunk-UV7ECD7A.js} +17 -4
  3. package/dist/dev/chunk-UV7ECD7A.js.map +7 -0
  4. package/dist/dev/chunk-X2WWSILD.js +7 -0
  5. package/dist/dev/chunk-X2WWSILD.js.map +7 -0
  6. package/dist/dev/data/{image-D63IS3GP.js → image-H4O52A73.js} +3 -3
  7. package/dist/dev/index.css +1355 -0
  8. package/dist/dev/index.css.map +3 -3
  9. package/dist/dev/index.js +2881 -1233
  10. package/dist/dev/index.js.map +4 -4
  11. package/dist/dev/subset-shared.chunk.js +1 -1
  12. package/dist/dev/subset-worker.chunk.js +1 -1
  13. package/dist/prod/{chunk-6XBRNJFC.js → chunk-DOJFO2UO.js} +3 -3
  14. package/dist/prod/{chunk-TDN63PPO.js → chunk-O3WJMHIE.js} +1 -1
  15. package/dist/prod/data/image-43FV5SMF.js +1 -0
  16. package/dist/prod/index.css +2 -1
  17. package/dist/prod/index.js +28 -28
  18. package/dist/prod/subset-shared.chunk.js +1 -1
  19. package/dist/prod/subset-worker.chunk.js +1 -1
  20. package/dist/types/element/src/arrows/focus.d.ts +1 -1
  21. package/dist/types/element/src/binding.d.ts +3 -3
  22. package/dist/types/element/src/bounds.d.ts +1 -1
  23. package/dist/types/element/src/collision.d.ts +1 -1
  24. package/dist/types/element/src/delta.d.ts +2 -2
  25. package/dist/types/element/src/dragElements.d.ts +1 -1
  26. package/dist/types/element/src/duplicate.d.ts +1 -1
  27. package/dist/types/element/src/embeddable.d.ts +1 -1
  28. package/dist/types/element/src/flowchart.d.ts +1 -1
  29. package/dist/types/element/src/frame.d.ts +1 -1
  30. package/dist/types/element/src/groups.d.ts +1 -1
  31. package/dist/types/element/src/renderElement.d.ts +1 -1
  32. package/dist/types/element/src/selection.d.ts +1 -1
  33. package/dist/types/element/src/shape.d.ts +2 -2
  34. package/dist/types/element/src/store.d.ts +2 -2
  35. package/dist/types/element/src/textElement.d.ts +1 -1
  36. package/dist/types/element/src/transform.d.ts +1 -1
  37. package/dist/types/element/src/utils.d.ts +1 -1
  38. package/dist/types/element/src/zindex.d.ts +1 -1
  39. package/dist/types/excalidraw/actions/actionCanvas.d.ts +7 -7
  40. package/dist/types/excalidraw/actions/actionExport.d.ts +9 -9
  41. package/dist/types/excalidraw/actions/actionProperties.d.ts +1 -1
  42. package/dist/types/excalidraw/appState.d.ts +4 -4
  43. package/dist/types/excalidraw/components/AIChatPanel.d.ts +10 -0
  44. package/dist/types/excalidraw/components/Actions.d.ts +1 -1
  45. package/dist/types/excalidraw/components/App.d.ts +13 -2
  46. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +2 -2
  47. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +1 -1
  48. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +1 -1
  49. package/dist/types/excalidraw/components/DefaultSidebar.d.ts +1 -1
  50. package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +2 -2
  51. package/dist/types/excalidraw/components/EyeDropper.d.ts +1 -1
  52. package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +1 -1
  53. package/dist/types/excalidraw/components/FontPicker/FontPickerList.d.ts +1 -1
  54. package/dist/types/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +1 -1
  55. package/dist/types/excalidraw/components/ImageExportDialog.d.ts +1 -1
  56. package/dist/types/excalidraw/components/ImageGeneratorPanel.d.ts +38 -0
  57. package/dist/types/excalidraw/components/ImageQuickEditPanel.d.ts +7 -0
  58. package/dist/types/excalidraw/components/JSONExportDialog.d.ts +1 -1
  59. package/dist/types/excalidraw/components/LayerUI.d.ts +1 -1
  60. package/dist/types/excalidraw/components/Stats/DragInput.d.ts +1 -1
  61. package/dist/types/excalidraw/components/Stats/FontSize.d.ts +1 -1
  62. package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +1 -1
  63. package/dist/types/excalidraw/components/Stats/MultiFontSize.d.ts +1 -1
  64. package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +1 -1
  65. package/dist/types/excalidraw/components/TTDDialog/types.d.ts +2 -2
  66. package/dist/types/excalidraw/components/ai-chat/agentLoop.d.ts +60 -0
  67. package/dist/types/excalidraw/components/ai-chat/canvasTools.d.ts +288 -0
  68. package/dist/types/excalidraw/components/image-generation/pendingGenerations.d.ts +30 -0
  69. package/dist/types/excalidraw/components/ui/avatar.d.ts +6 -0
  70. package/dist/types/excalidraw/components/ui/button.d.ts +11 -0
  71. package/dist/types/excalidraw/components/ui/chat-container.d.ts +17 -0
  72. package/dist/types/excalidraw/components/ui/code-block.d.ts +16 -0
  73. package/dist/types/excalidraw/components/ui/markdown.d.ts +10 -0
  74. package/dist/types/excalidraw/components/ui/message.d.ts +35 -0
  75. package/dist/types/excalidraw/components/ui/prompt-input.d.ts +28 -0
  76. package/dist/types/excalidraw/components/ui/scroll-button.d.ts +10 -0
  77. package/dist/types/excalidraw/components/ui/select.d.ts +13 -0
  78. package/dist/types/excalidraw/components/ui/textarea.d.ts +3 -0
  79. package/dist/types/excalidraw/components/ui/tooltip.d.ts +7 -0
  80. package/dist/types/excalidraw/data/blob.d.ts +19 -17
  81. package/dist/types/excalidraw/data/json.d.ts +8 -8
  82. package/dist/types/excalidraw/data/library.d.ts +1 -1
  83. package/dist/types/excalidraw/fonts/Fonts.d.ts +2 -2
  84. package/dist/types/excalidraw/i18n.d.ts +1 -1
  85. package/dist/types/excalidraw/index.d.ts +1 -0
  86. package/dist/types/excalidraw/lib/utils.d.ts +2 -0
  87. package/dist/types/excalidraw/types.d.ts +9 -0
  88. package/dist/types/excalidraw/utils/geminiApiKey.d.ts +1 -0
  89. package/package.json +33 -15
  90. package/CHANGELOG.md +0 -34
  91. package/dist/dev/chunk-23ZG3JRJ.js.map +0 -7
  92. package/dist/dev/chunk-L5IYTQZ4.js +0 -7
  93. package/dist/dev/chunk-L5IYTQZ4.js.map +0 -7
  94. package/dist/prod/data/image-H66RFTQG.js +0 -1
  95. package/history.ts +0 -249
  96. /package/dist/dev/data/{image-D63IS3GP.js.map → image-H4O52A73.js.map} +0 -0
@@ -0,0 +1,60 @@
1
+ import { type ToolExecutionContext, type ToolResult } from "./canvasTools";
2
+ type ContentPart = {
3
+ type: "text";
4
+ text: string;
5
+ } | {
6
+ type: "image_url";
7
+ image_url: {
8
+ url: string;
9
+ };
10
+ };
11
+ export type AgentMessage = {
12
+ role: "system";
13
+ content: string;
14
+ } | {
15
+ role: "user";
16
+ content: string | ContentPart[];
17
+ } | {
18
+ role: "assistant";
19
+ content: string | null;
20
+ tool_calls?: ToolCall[];
21
+ } | {
22
+ role: "tool";
23
+ tool_call_id: string;
24
+ content: string;
25
+ };
26
+ export type ToolCall = {
27
+ id: string;
28
+ type: "function";
29
+ function: {
30
+ name: string;
31
+ arguments: string;
32
+ };
33
+ };
34
+ export type ToolAction = {
35
+ toolName: string;
36
+ args: Record<string, unknown>;
37
+ result: ToolResult;
38
+ };
39
+ export type AgentUpdate = {
40
+ type: "status" | "tool_start" | "tool_done" | "final";
41
+ message: string;
42
+ toolAction?: ToolAction;
43
+ };
44
+ export type AgentResult = {
45
+ reply: string;
46
+ toolActions: ToolAction[];
47
+ };
48
+ export declare function runAgentLoop(opts: {
49
+ userMessages: Array<{
50
+ role: "user" | "assistant";
51
+ content: string;
52
+ }>;
53
+ elementContext?: string;
54
+ frameScreenshot?: string;
55
+ apiKey: string;
56
+ toolCtx: ToolExecutionContext;
57
+ onUpdate: (update: AgentUpdate) => void;
58
+ signal?: AbortSignal;
59
+ }): Promise<AgentResult>;
60
+ export {};
@@ -0,0 +1,288 @@
1
+ import type { ExcalidrawElement } from "@orangecatai/element/types";
2
+ import type { ExcalidrawImperativeAPI } from "../../types";
3
+ export declare const CANVAS_TOOLS: readonly [{
4
+ readonly type: "function";
5
+ readonly function: {
6
+ readonly name: "create_frame";
7
+ readonly description: "Create a new frame on the canvas. Frames act as artboards that clip their children. Default size is 512x512.";
8
+ readonly parameters: {
9
+ readonly type: "object";
10
+ readonly properties: {
11
+ readonly width: {
12
+ readonly type: "number";
13
+ readonly description: "Frame width in pixels (default 512)";
14
+ };
15
+ readonly height: {
16
+ readonly type: "number";
17
+ readonly description: "Frame height in pixels (default 512)";
18
+ };
19
+ readonly name: {
20
+ readonly type: "string";
21
+ readonly description: "Optional display name for the frame";
22
+ };
23
+ };
24
+ readonly required: readonly [];
25
+ readonly additionalProperties: false;
26
+ };
27
+ };
28
+ }, {
29
+ readonly type: "function";
30
+ readonly function: {
31
+ readonly name: "add_rectangle";
32
+ readonly description: "Add a filled rectangle inside a frame. Commonly used for solid background fills behind images and text.";
33
+ readonly parameters: {
34
+ readonly type: "object";
35
+ readonly properties: {
36
+ readonly frameId: {
37
+ readonly type: "string";
38
+ readonly description: "ID of the parent frame";
39
+ };
40
+ readonly x: {
41
+ readonly type: "number";
42
+ readonly description: "X position relative to canvas (use the frame's x for full coverage)";
43
+ };
44
+ readonly y: {
45
+ readonly type: "number";
46
+ readonly description: "Y position relative to canvas (use the frame's y for full coverage)";
47
+ };
48
+ readonly width: {
49
+ readonly type: "number";
50
+ readonly description: "Rectangle width in pixels";
51
+ };
52
+ readonly height: {
53
+ readonly type: "number";
54
+ readonly description: "Rectangle height in pixels";
55
+ };
56
+ readonly backgroundColor: {
57
+ readonly type: "string";
58
+ readonly description: "Fill color as hex string e.g. \"#1a1a2e\". Use \"transparent\" for no fill.";
59
+ };
60
+ readonly fillStyle: {
61
+ readonly type: "string";
62
+ readonly enum: readonly ["solid", "hachure", "cross-hatch"];
63
+ readonly description: "Fill style (default \"solid\")";
64
+ };
65
+ readonly strokeColor: {
66
+ readonly type: "string";
67
+ readonly description: "Stroke/border color as hex (default \"transparent\")";
68
+ };
69
+ readonly strokeWidth: {
70
+ readonly type: "number";
71
+ readonly description: "Stroke width in pixels (default 0)";
72
+ };
73
+ readonly opacity: {
74
+ readonly type: "number";
75
+ readonly description: "Opacity 0-100 (default 100)";
76
+ };
77
+ };
78
+ readonly required: readonly ["frameId", "x", "y", "width", "height", "backgroundColor"];
79
+ readonly additionalProperties: false;
80
+ };
81
+ };
82
+ }, {
83
+ readonly type: "function";
84
+ readonly function: {
85
+ readonly name: "add_text";
86
+ readonly description: "Add a text element inside a frame. Use for headlines, subheads, body copy, CTAs etc.";
87
+ readonly parameters: {
88
+ readonly type: "object";
89
+ readonly properties: {
90
+ readonly frameId: {
91
+ readonly type: "string";
92
+ readonly description: "ID of the parent frame";
93
+ };
94
+ readonly x: {
95
+ readonly type: "number";
96
+ readonly description: "X position (canvas coordinates)";
97
+ };
98
+ readonly y: {
99
+ readonly type: "number";
100
+ readonly description: "Y position (canvas coordinates)";
101
+ };
102
+ readonly text: {
103
+ readonly type: "string";
104
+ readonly description: "The text content";
105
+ };
106
+ readonly fontSize: {
107
+ readonly type: "number";
108
+ readonly description: "Font size in pixels (default 20)";
109
+ };
110
+ readonly fontFamily: {
111
+ readonly type: "number";
112
+ readonly enum: readonly [1, 2, 3, 4, 5];
113
+ readonly description: "Font family: 1=Excalifont(hand), 2=Nunito(sans), 3=Comic Shanns(code), 4=Liberation Sans(clean sans), 5=cascadia(code). Default 2.";
114
+ };
115
+ readonly strokeColor: {
116
+ readonly type: "string";
117
+ readonly description: "Text color as hex string (default \"#000000\")";
118
+ };
119
+ readonly textAlign: {
120
+ readonly type: "string";
121
+ readonly enum: readonly ["left", "center", "right"];
122
+ readonly description: "Horizontal alignment (default left)";
123
+ };
124
+ readonly width: {
125
+ readonly type: "number";
126
+ readonly description: "Optional fixed width for text wrapping";
127
+ };
128
+ };
129
+ readonly required: readonly ["frameId", "x", "y", "text"];
130
+ readonly additionalProperties: false;
131
+ };
132
+ };
133
+ }, {
134
+ readonly type: "function";
135
+ readonly function: {
136
+ readonly name: "generate_image";
137
+ readonly description: "Generate an image using AI (Gemini) from a text prompt and place it inside a frame. Use for hero images, product shots, backgrounds, illustrations etc.";
138
+ readonly parameters: {
139
+ readonly type: "object";
140
+ readonly properties: {
141
+ readonly frameId: {
142
+ readonly type: "string";
143
+ readonly description: "ID of the parent frame to insert the image into";
144
+ };
145
+ readonly prompt: {
146
+ readonly type: "string";
147
+ readonly description: "Detailed image generation prompt describing what to create";
148
+ };
149
+ readonly x: {
150
+ readonly type: "number";
151
+ readonly description: "X position for the image (canvas coordinates)";
152
+ };
153
+ readonly y: {
154
+ readonly type: "number";
155
+ readonly description: "Y position for the image (canvas coordinates)";
156
+ };
157
+ readonly width: {
158
+ readonly type: "number";
159
+ readonly description: "Image width in pixels";
160
+ };
161
+ readonly height: {
162
+ readonly type: "number";
163
+ readonly description: "Image height in pixels";
164
+ };
165
+ };
166
+ readonly required: readonly ["frameId", "prompt", "x", "y", "width", "height"];
167
+ readonly additionalProperties: false;
168
+ };
169
+ };
170
+ }, {
171
+ readonly type: "function";
172
+ readonly function: {
173
+ readonly name: "update_element";
174
+ readonly description: "Update properties of an existing element (move, resize, recolor, change text, etc.)";
175
+ readonly parameters: {
176
+ readonly type: "object";
177
+ readonly properties: {
178
+ readonly elementId: {
179
+ readonly type: "string";
180
+ readonly description: "ID of the element to update";
181
+ };
182
+ readonly x: {
183
+ readonly type: "number";
184
+ readonly description: "New X position";
185
+ };
186
+ readonly y: {
187
+ readonly type: "number";
188
+ readonly description: "New Y position";
189
+ };
190
+ readonly width: {
191
+ readonly type: "number";
192
+ readonly description: "New width";
193
+ };
194
+ readonly height: {
195
+ readonly type: "number";
196
+ readonly description: "New height";
197
+ };
198
+ readonly backgroundColor: {
199
+ readonly type: "string";
200
+ readonly description: "New background/fill color";
201
+ };
202
+ readonly strokeColor: {
203
+ readonly type: "string";
204
+ readonly description: "New stroke/text color";
205
+ };
206
+ readonly opacity: {
207
+ readonly type: "number";
208
+ readonly description: "New opacity 0-100";
209
+ };
210
+ readonly fontSize: {
211
+ readonly type: "number";
212
+ readonly description: "New font size (text elements only)";
213
+ };
214
+ readonly text: {
215
+ readonly type: "string";
216
+ readonly description: "New text content (text elements only)";
217
+ };
218
+ readonly fillStyle: {
219
+ readonly type: "string";
220
+ readonly enum: readonly ["solid", "hachure", "cross-hatch"];
221
+ readonly description: "New fill style";
222
+ };
223
+ };
224
+ readonly required: readonly ["elementId"];
225
+ readonly additionalProperties: false;
226
+ };
227
+ };
228
+ }, {
229
+ readonly type: "function";
230
+ readonly function: {
231
+ readonly name: "delete_element";
232
+ readonly description: "Delete an element from the canvas";
233
+ readonly parameters: {
234
+ readonly type: "object";
235
+ readonly properties: {
236
+ readonly elementId: {
237
+ readonly type: "string";
238
+ readonly description: "ID of the element to delete";
239
+ };
240
+ };
241
+ readonly required: readonly ["elementId"];
242
+ readonly additionalProperties: false;
243
+ };
244
+ };
245
+ }, {
246
+ readonly type: "function";
247
+ readonly function: {
248
+ readonly name: "get_frame_elements";
249
+ readonly description: "Get all child elements inside a frame. Returns their IDs, types, positions, sizes, colors, and text content. Use this to understand the current layout before making changes.";
250
+ readonly parameters: {
251
+ readonly type: "object";
252
+ readonly properties: {
253
+ readonly frameId: {
254
+ readonly type: "string";
255
+ readonly description: "ID of the frame to inspect";
256
+ };
257
+ };
258
+ readonly required: readonly ["frameId"];
259
+ readonly additionalProperties: false;
260
+ };
261
+ };
262
+ }];
263
+ export declare function serializeElements(elements: readonly ExcalidrawElement[]): Record<string, unknown>[];
264
+ export type FrameInfo = {
265
+ id: string;
266
+ name: string;
267
+ width: number;
268
+ height: number;
269
+ childCount: number;
270
+ };
271
+ export declare function listFrames(api: ExcalidrawImperativeAPI): FrameInfo[];
272
+ export declare function captureFrameScreenshot(api: ExcalidrawImperativeAPI, frameId: string): Promise<string | null>;
273
+ export declare function getFrameContext(api: ExcalidrawImperativeAPI, frameId: string): {
274
+ serialized: string;
275
+ frameInfo: FrameInfo;
276
+ } | null;
277
+ export type ToolExecutionContext = {
278
+ excalidrawAPI: ExcalidrawImperativeAPI;
279
+ geminiApiKey: string;
280
+ signal?: AbortSignal;
281
+ };
282
+ export type ToolResult = {
283
+ success: boolean;
284
+ data?: Record<string, unknown>;
285
+ error?: string;
286
+ statusMessage: string;
287
+ };
288
+ export declare function executeCanvasTool(toolName: string, rawArgs: string, ctx: ToolExecutionContext): Promise<ToolResult>;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Pending image generation state — shared across ImageGeneratorPanel and
3
+ * ImageQuickEditPanel so generation survives panel unmount/remount.
4
+ *
5
+ * Flow:
6
+ * 1. User clicks Generate → startPendingGeneration(id, prompt, settings, controller)
7
+ * Stores prompt, model/ratio/resolution, and AbortController. Request continues
8
+ * even if user clicks away (no unmount-abort).
9
+ * 2. Panel subscribes via subscribeGenerationDone(id, cb). If generation already
10
+ * finished while unmounted, cb is invoked immediately with finishedError.
11
+ * 3. On success/error → finishPendingGeneration(id, error) notifies subscribers.
12
+ * 4. On success only → clearGenerationState(id) removes the entry so reselecting
13
+ * the frame/image shows a clean prompt instead of the old one.
14
+ * 5. Stop button → abortPendingGeneration(id) aborts the controller.
15
+ */
16
+ export type GenerationDoneCallback = (error: string | null) => void;
17
+ export interface GenerationSettings {
18
+ model: string;
19
+ ratio: string;
20
+ resolution: string;
21
+ }
22
+ export declare function startPendingGeneration(elementId: string, prompt: string, settings: GenerationSettings, controller: AbortController): void;
23
+ export declare function finishPendingGeneration(elementId: string, error: string | null): void;
24
+ export declare function subscribeGenerationDone(elementId: string, fn: GenerationDoneCallback): boolean;
25
+ export declare function unsubscribeGenerationDone(elementId: string, fn: GenerationDoneCallback): void;
26
+ export declare function clearGenerationState(elementId: string): void;
27
+ export declare function abortPendingGeneration(elementId: string): void;
28
+ export declare function getPendingPrompt(elementId: string): string;
29
+ export declare function getPendingSettings(elementId: string): GenerationSettings | null;
30
+ export declare function hasPendingGeneration(elementId: string): boolean;
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ import * as AvatarPrimitive from "@radix-ui/react-avatar";
3
+ declare const Avatar: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
4
+ declare const AvatarImage: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & React.RefAttributes<HTMLImageElement>, "ref"> & React.RefAttributes<HTMLImageElement>>;
5
+ declare const AvatarFallback: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
6
+ export { Avatar, AvatarImage, AvatarFallback };
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "link" | "default" | "outline" | "destructive" | "secondary" | "ghost" | null | undefined;
5
+ size?: "icon" | "default" | "sm" | "lg" | null | undefined;
6
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
7
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
8
+ asChild?: boolean;
9
+ }
10
+ declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
11
+ export { Button, buttonVariants };
@@ -0,0 +1,17 @@
1
+ import * as React from "react";
2
+ export type ChatContainerRootProps = {
3
+ children: React.ReactNode;
4
+ className?: string;
5
+ } & React.HTMLAttributes<HTMLDivElement>;
6
+ export type ChatContainerContentProps = {
7
+ children: React.ReactNode;
8
+ className?: string;
9
+ } & React.HTMLAttributes<HTMLDivElement>;
10
+ export type ChatContainerScrollAnchorProps = {
11
+ className?: string;
12
+ ref?: React.RefObject<HTMLDivElement>;
13
+ } & React.HTMLAttributes<HTMLDivElement>;
14
+ declare function ChatContainerRoot({ children, className, ...props }: ChatContainerRootProps): import("react/jsx-runtime").JSX.Element;
15
+ declare function ChatContainerContent({ children, className, ...props }: ChatContainerContentProps): import("react/jsx-runtime").JSX.Element;
16
+ declare function ChatContainerScrollAnchor({ className, ...props }: ChatContainerScrollAnchorProps): import("react/jsx-runtime").JSX.Element;
17
+ export { ChatContainerRoot, ChatContainerContent, ChatContainerScrollAnchor };
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ export type CodeBlockProps = {
3
+ children?: React.ReactNode;
4
+ className?: string;
5
+ } & React.HTMLProps<HTMLDivElement>;
6
+ declare function CodeBlock({ children, className, ...props }: CodeBlockProps): import("react/jsx-runtime").JSX.Element;
7
+ export type CodeBlockCodeProps = {
8
+ code: string;
9
+ language?: string;
10
+ theme?: string;
11
+ className?: string;
12
+ } & React.HTMLProps<HTMLDivElement>;
13
+ declare function CodeBlockCode({ code, language, theme, className, ...props }: CodeBlockCodeProps): import("react/jsx-runtime").JSX.Element;
14
+ export type CodeBlockGroupProps = React.HTMLAttributes<HTMLDivElement>;
15
+ declare function CodeBlockGroup({ children, className, ...props }: CodeBlockGroupProps): import("react/jsx-runtime").JSX.Element;
16
+ export { CodeBlockGroup, CodeBlockCode, CodeBlock };
@@ -0,0 +1,10 @@
1
+ import type { Components } from "react-markdown";
2
+ export type MarkdownProps = {
3
+ children: string;
4
+ id?: string;
5
+ className?: string;
6
+ components?: Partial<Components>;
7
+ };
8
+ declare function MarkdownComponent({ children, id, className, components, }: MarkdownProps): import("react/jsx-runtime").JSX.Element;
9
+ declare const Markdown: import("react").MemoExoticComponent<typeof MarkdownComponent>;
10
+ export { Markdown };
@@ -0,0 +1,35 @@
1
+ import * as React from "react";
2
+ import { Markdown } from "./markdown";
3
+ import { Tooltip } from "@/components/ui/tooltip";
4
+ export type MessageProps = {
5
+ children: React.ReactNode;
6
+ className?: string;
7
+ } & React.HTMLProps<HTMLDivElement>;
8
+ declare const Message: ({ children, className, ...props }: MessageProps) => import("react/jsx-runtime").JSX.Element;
9
+ export type MessageAvatarProps = {
10
+ src: string;
11
+ alt: string;
12
+ fallback?: string;
13
+ delayMs?: number;
14
+ className?: string;
15
+ };
16
+ declare const MessageAvatar: ({ src, alt, fallback, delayMs, className, }: MessageAvatarProps) => import("react/jsx-runtime").JSX.Element;
17
+ export type MessageContentProps = {
18
+ children: React.ReactNode;
19
+ markdown?: boolean;
20
+ className?: string;
21
+ } & React.ComponentProps<typeof Markdown> & React.HTMLProps<HTMLDivElement>;
22
+ declare const MessageContent: ({ children, markdown, className, ...props }: MessageContentProps) => import("react/jsx-runtime").JSX.Element;
23
+ export type MessageActionsProps = {
24
+ children: React.ReactNode;
25
+ className?: string;
26
+ } & React.HTMLProps<HTMLDivElement>;
27
+ declare const MessageActions: ({ children, className, ...props }: MessageActionsProps) => import("react/jsx-runtime").JSX.Element;
28
+ export type MessageActionProps = {
29
+ className?: string;
30
+ tooltip: React.ReactNode;
31
+ children: React.ReactNode;
32
+ side?: "top" | "bottom" | "left" | "right";
33
+ } & React.ComponentProps<typeof Tooltip>;
34
+ declare const MessageAction: ({ tooltip, children, className, side, ...props }: MessageActionProps) => import("react/jsx-runtime").JSX.Element;
35
+ export { Message, MessageAvatar, MessageContent, MessageActions, MessageAction, };
@@ -0,0 +1,28 @@
1
+ import React from "react";
2
+ import { Textarea } from "./textarea";
3
+ import { Tooltip } from "./tooltip";
4
+ export type PromptInputProps = {
5
+ isLoading?: boolean;
6
+ value?: string;
7
+ onValueChange?: (value: string) => void;
8
+ maxHeight?: number | string;
9
+ onSubmit?: () => void;
10
+ children: React.ReactNode;
11
+ className?: string;
12
+ disabled?: boolean;
13
+ } & React.ComponentProps<"div">;
14
+ declare function PromptInput({ className, isLoading, maxHeight, value, onValueChange, onSubmit, children, disabled, onClick, ...props }: PromptInputProps): import("react/jsx-runtime").JSX.Element;
15
+ export type PromptInputTextareaProps = {
16
+ disableAutosize?: boolean;
17
+ } & React.ComponentProps<typeof Textarea>;
18
+ declare function PromptInputTextarea({ className, onKeyDown, disableAutosize, ...props }: PromptInputTextareaProps): import("react/jsx-runtime").JSX.Element;
19
+ export type PromptInputActionsProps = React.HTMLAttributes<HTMLDivElement>;
20
+ declare function PromptInputActions({ children, className, ...props }: PromptInputActionsProps): import("react/jsx-runtime").JSX.Element;
21
+ export type PromptInputActionProps = {
22
+ className?: string;
23
+ tooltip: React.ReactNode;
24
+ children: React.ReactNode;
25
+ side?: "top" | "bottom" | "left" | "right";
26
+ } & React.ComponentProps<typeof Tooltip>;
27
+ declare function PromptInputAction({ tooltip, children, className, side, ...props }: PromptInputActionProps): import("react/jsx-runtime").JSX.Element;
28
+ export { PromptInput, PromptInputTextarea, PromptInputActions, PromptInputAction, };
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ import type { buttonVariants } from "@/components/ui/button";
4
+ export type ScrollButtonProps = {
5
+ className?: string;
6
+ variant?: VariantProps<typeof buttonVariants>["variant"];
7
+ size?: VariantProps<typeof buttonVariants>["size"];
8
+ } & React.ButtonHTMLAttributes<HTMLButtonElement>;
9
+ declare function ScrollButton({ className, variant, size, ...props }: ScrollButtonProps): import("react/jsx-runtime").JSX.Element;
10
+ export { ScrollButton };
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ import * as SelectPrimitive from "@radix-ui/react-select";
3
+ declare const Select: React.FC<SelectPrimitive.SelectProps>;
4
+ declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
5
+ declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
6
+ declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
7
+ declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
+ declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
+ declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
10
+ declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
11
+ declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
+ declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
+ export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, };
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ declare const Textarea: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
3
+ export { Textarea };
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import * as TooltipPrimitive from "@radix-ui/react-tooltip";
3
+ declare const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
4
+ declare const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
5
+ declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
6
+ declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
+ export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
@@ -1,6 +1,6 @@
1
1
  import { IMAGE_MIME_TYPES, MIME_TYPES } from "@orangecatai/common";
2
- import type { ValueOf } from "@orangecatai/common/utility-types";
3
2
  import type { ExcalidrawElement, FileId } from "@orangecatai/element/types";
3
+ import type { ValueOf } from "@orangecatai/common/utility-types";
4
4
  import type { AppState, DataURL, LibraryItem } from "../types";
5
5
  import type { FileSystemHandle } from "browser-fs-access";
6
6
  import type { ImportedLibraryData } from "./types";
@@ -21,14 +21,6 @@ fileHandle?: FileSystemHandle | null) => Promise<{
21
21
  data: {
22
22
  elements: import("@orangecatai/element/types").OrderedExcalidrawElement[];
23
23
  appState: {
24
- viewBackgroundColor: string;
25
- theme: import("@orangecatai/element/types").Theme;
26
- frameRendering: {
27
- enabled: boolean;
28
- name: boolean;
29
- outline: boolean;
30
- clip: boolean;
31
- };
32
24
  name: string | null;
33
25
  zoom: import("../types").Zoom;
34
26
  scrollX: number;
@@ -52,6 +44,7 @@ fileHandle?: FileSystemHandle | null) => Promise<{
52
44
  [id: string]: true;
53
45
  }>;
54
46
  frameToHighlight: import("@orangecatai/element/types").NonDeleted<import("@orangecatai/element/types").ExcalidrawFrameLikeElement> | null;
47
+ theme: import("@orangecatai/element/types").Theme;
55
48
  activeTool: {
56
49
  lastActiveTool: import("../types").ActiveTool | null;
57
50
  locked: boolean;
@@ -89,6 +82,12 @@ fileHandle?: FileSystemHandle | null) => Promise<{
89
82
  hoveredElementIds: Readonly<{
90
83
  [id: string]: true;
91
84
  }>;
85
+ frameRendering: {
86
+ enabled: boolean;
87
+ name: boolean;
88
+ outline: boolean;
89
+ clip: boolean;
90
+ };
92
91
  shouldCacheIgnoreZoom: boolean;
93
92
  exportScale: number;
94
93
  currentItemArrowType: "sharp" | "round" | "elbow";
@@ -128,6 +127,7 @@ fileHandle?: FileSystemHandle | null) => Promise<{
128
127
  currentItemEndArrowhead: import("@orangecatai/element/types").Arrowhead | null;
129
128
  currentHoveredFontFamily: import("@orangecatai/element/types").FontFamilyValues | null;
130
129
  currentItemRoundness: import("@orangecatai/element/types").StrokeRoundness;
130
+ viewBackgroundColor: string;
131
131
  cursorButton: "up" | "down";
132
132
  scrolledOutside: boolean;
133
133
  isResizing: boolean;
@@ -188,14 +188,6 @@ localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | nu
188
188
  fileHandle?: FileSystemHandle | null) => Promise<{
189
189
  elements: import("@orangecatai/element/types").OrderedExcalidrawElement[];
190
190
  appState: {
191
- viewBackgroundColor: string;
192
- theme: import("@orangecatai/element/types").Theme;
193
- frameRendering: {
194
- enabled: boolean;
195
- name: boolean;
196
- outline: boolean;
197
- clip: boolean;
198
- };
199
191
  name: string | null;
200
192
  zoom: import("../types").Zoom;
201
193
  scrollX: number;
@@ -219,6 +211,7 @@ fileHandle?: FileSystemHandle | null) => Promise<{
219
211
  [id: string]: true;
220
212
  }>;
221
213
  frameToHighlight: import("@orangecatai/element/types").NonDeleted<import("@orangecatai/element/types").ExcalidrawFrameLikeElement> | null;
214
+ theme: import("@orangecatai/element/types").Theme;
222
215
  activeTool: {
223
216
  lastActiveTool: import("../types").ActiveTool | null;
224
217
  locked: boolean;
@@ -256,6 +249,12 @@ fileHandle?: FileSystemHandle | null) => Promise<{
256
249
  hoveredElementIds: Readonly<{
257
250
  [id: string]: true;
258
251
  }>;
252
+ frameRendering: {
253
+ enabled: boolean;
254
+ name: boolean;
255
+ outline: boolean;
256
+ clip: boolean;
257
+ };
259
258
  shouldCacheIgnoreZoom: boolean;
260
259
  exportScale: number;
261
260
  currentItemArrowType: "sharp" | "round" | "elbow";
@@ -295,6 +294,7 @@ fileHandle?: FileSystemHandle | null) => Promise<{
295
294
  currentItemEndArrowhead: import("@orangecatai/element/types").Arrowhead | null;
296
295
  currentHoveredFontFamily: import("@orangecatai/element/types").FontFamilyValues | null;
297
296
  currentItemRoundness: import("@orangecatai/element/types").StrokeRoundness;
297
+ viewBackgroundColor: string;
298
298
  cursorButton: "up" | "down";
299
299
  scrolledOutside: boolean;
300
300
  isResizing: boolean;
@@ -353,6 +353,8 @@ export declare const generateIdFromFile: (file: File) => Promise<FileId>;
353
353
  /** async. For sync variant, use getDataURL_sync */
354
354
  export declare const getDataURL: (file: Blob | File) => Promise<DataURL>;
355
355
  export declare const getDataURL_sync: (data: string | Uint8Array | ArrayBuffer, mimeType: ValueOf<typeof MIME_TYPES>) => DataURL;
356
+ /** Parses MIME type from a data URL (e.g. data:image/webp;base64,...). */
357
+ export declare const getMimeTypeFromDataURL: (dataURL: string) => string;
356
358
  export declare const dataURLToFile: (dataURL: DataURL, filename?: string) => File;
357
359
  export declare const dataURLToString: (dataURL: DataURL) => string;
358
360
  export declare const resizeImageFile: (file: File, opts: {