@orangecatai/adgen-canvas 0.0.23 → 0.0.24
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/dist/dev/{chunk-E6AX7UYW.js → chunk-3IT4IPF5.js} +23 -13
- package/dist/dev/chunk-3IT4IPF5.js.map +7 -0
- package/dist/dev/{chunk-4K5LIQQU.js → chunk-LIELFD5T.js} +2 -1
- package/dist/dev/chunk-LIELFD5T.js.map +7 -0
- package/dist/dev/{chunk-KNIBTSFD.js → chunk-T44CUBOH.js} +2 -2
- package/dist/dev/data/{image-WJAASDV4.js → image-CVNEYNEF.js} +3 -3
- package/dist/dev/index.css +824 -0
- package/dist/dev/index.css.map +3 -3
- package/dist/dev/index.js +3661 -1605
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/locales/{en-IMRJ2ODG.js → en-VCZQBJ2N.js} +2 -2
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/{chunk-TX6PVFUX.js → chunk-CLQPYXMS.js} +1 -1
- package/dist/prod/{chunk-GOHSI4TL.js → chunk-MFGXKFLH.js} +1 -1
- package/dist/prod/chunk-ZXE5XSJO.js +4 -0
- package/dist/prod/data/image-7TLJ6VAY.js +1 -0
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +62 -62
- package/dist/prod/locales/{en-5WIO63S4.js → en-ZZURI326.js} +1 -1
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/common/src/constants.d.ts +4 -0
- package/dist/types/element/src/Scene.d.ts +1 -1
- package/dist/types/element/src/frame.d.ts +2 -2
- package/dist/types/element/src/newElement.d.ts +10 -1
- package/dist/types/element/src/typeChecks.d.ts +2 -1
- package/dist/types/element/src/types.d.ts +17 -2
- package/dist/types/excalidraw/actions/actionFrame.d.ts +41 -0
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +41 -0
- package/dist/types/excalidraw/components/App.d.ts +10 -0
- package/dist/types/excalidraw/components/ImageGeneratorPanel.d.ts +14 -0
- package/dist/types/excalidraw/components/VideoElement.d.ts +9 -0
- package/dist/types/excalidraw/components/VideoGeneratorPanel.d.ts +149 -0
- package/dist/types/excalidraw/components/icons.d.ts +2 -0
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +4 -0
- package/dist/types/excalidraw/data/blob.d.ts +4 -1
- package/dist/types/excalidraw/index.d.ts +4 -3
- package/dist/types/excalidraw/scene/types.d.ts +1 -0
- package/dist/types/excalidraw/types.d.ts +33 -0
- package/dist/types/excalidraw/utils/videoApi.d.ts +30 -0
- package/dist/types/utils/src/shape.d.ts +2 -2
- package/package.json +3 -3
- package/dist/dev/chunk-4K5LIQQU.js.map +0 -7
- package/dist/dev/chunk-E6AX7UYW.js.map +0 -7
- package/dist/prod/chunk-XIMYEPMA.js +0 -4
- package/dist/prod/data/image-QJTVNM22.js +0 -1
- /package/dist/dev/{chunk-KNIBTSFD.js.map → chunk-T44CUBOH.js.map} +0 -0
- /package/dist/dev/data/{image-WJAASDV4.js.map → image-CVNEYNEF.js.map} +0 -0
- /package/dist/dev/locales/{en-IMRJ2ODG.js.map → en-VCZQBJ2N.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A,B,C,D,E,F,G,H,I,J,K,L,M,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"../chunk-
|
|
1
|
+
import{A,B,C,D,E,F,G,H,I,J,K,L,M,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"../chunk-CLQPYXMS.js";import"../chunk-SRAX5OIU.js";export{f as alerts,e as buttons,l as canvasError,G as chat,s as clearCanvasDialog,C as colorPicker,A as colors,K as commandPalette,v as confirmDialog,M as default,i as element,b as elementLink,x as encrypted,p as errorDialog,m as errorSplash,g as errors,q as exportDialog,I as fontList,j as headings,r as helpDialog,k as hints,w as imageExportDialog,L as keys,a as labels,c as library,E as mermaid,D as overwriteConfirm,t as publishDialog,u as publishSuccessDialog,H as quickSearch,o as roomDialog,d as search,n as shareDialog,y as stats,z as toast,h as toolBar,F as ttd,J as userList,B as welcomeScreen};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d}from"./chunk-Z5NKEFVG.js";import"./chunk-
|
|
1
|
+
import{a,b,c,d}from"./chunk-Z5NKEFVG.js";import"./chunk-MFGXKFLH.js";import"./chunk-SRAX5OIU.js";export{a as Commands,b as subsetToBase64,c as subsetToBinary,d as toBase64};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r,c as t}from"./chunk-Z5NKEFVG.js";import"./chunk-
|
|
1
|
+
import{a as r,c as t}from"./chunk-Z5NKEFVG.js";import"./chunk-MFGXKFLH.js";import"./chunk-SRAX5OIU.js";var s=import.meta.url?new URL(import.meta.url):void 0;typeof window>"u"&&typeof self<"u"&&(self.onmessage=async e=>{switch(e.data.command){case r.Subset:let a=await t(e.data.arrayBuffer,e.data.codePoints);self.postMessage(a,{transfer:[a]});break}});export{s as WorkerUrl};
|
|
@@ -175,6 +175,10 @@ export declare const IMAGE_MIME_TYPES: {
|
|
|
175
175
|
readonly avif: "image/avif";
|
|
176
176
|
readonly jfif: "image/jfif";
|
|
177
177
|
};
|
|
178
|
+
export declare const VIDEO_MIME_TYPES: {
|
|
179
|
+
readonly mp4: "video/mp4";
|
|
180
|
+
readonly mov: "video/quicktime";
|
|
181
|
+
};
|
|
178
182
|
export declare const STRING_MIME_TYPES: {
|
|
179
183
|
readonly text: "text/plain";
|
|
180
184
|
readonly html: "text/html";
|
|
@@ -70,7 +70,7 @@ export declare class Scene {
|
|
|
70
70
|
getElementIndex(elementId: string): number;
|
|
71
71
|
getContainerElement: (element: (ExcalidrawElement & {
|
|
72
72
|
containerId: ExcalidrawElement["id"] | null;
|
|
73
|
-
}) | null) => import("@orangecatai/element/types").ExcalidrawLinearElement | import("@orangecatai/element/types").ExcalidrawSelectionElement | import("@orangecatai/element/types").ExcalidrawRectangleElement | import("@orangecatai/element/types").ExcalidrawDiamondElement | import("@orangecatai/element/types").ExcalidrawEllipseElement | import("@orangecatai/element/types").ExcalidrawEmbeddableElement | import("@orangecatai/element/types").ExcalidrawIframeElement | import("@orangecatai/element/types").ExcalidrawImageElement | import("@orangecatai/element/types").ExcalidrawFrameElement | import("@orangecatai/element/types").ExcalidrawMagicFrameElement | import("@orangecatai/element/types").ExcalidrawTextElement | import("@orangecatai/element/types").ExcalidrawFreeDrawElement | null;
|
|
73
|
+
}) | null) => import("@orangecatai/element/types").ExcalidrawLinearElement | import("@orangecatai/element/types").ExcalidrawSelectionElement | import("@orangecatai/element/types").ExcalidrawRectangleElement | import("@orangecatai/element/types").ExcalidrawDiamondElement | import("@orangecatai/element/types").ExcalidrawEllipseElement | import("@orangecatai/element/types").ExcalidrawEmbeddableElement | import("@orangecatai/element/types").ExcalidrawIframeElement | import("@orangecatai/element/types").ExcalidrawImageElement | import("@orangecatai/element/types").ExcalidrawVideoElement | import("@orangecatai/element/types").ExcalidrawFrameElement | import("@orangecatai/element/types").ExcalidrawMagicFrameElement | import("@orangecatai/element/types").ExcalidrawTextElement | import("@orangecatai/element/types").ExcalidrawFreeDrawElement | null;
|
|
74
74
|
getElementsFromId: (id: string) => ExcalidrawElement[];
|
|
75
75
|
mutateElement<TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, options?: {
|
|
76
76
|
informMutation: boolean;
|
|
@@ -31,8 +31,8 @@ export declare const getFrameLikeElements: (allElements: ExcalidrawElementsInclu
|
|
|
31
31
|
*/
|
|
32
32
|
export declare const getRootElements: (allElements: ExcalidrawElementsIncludingDeleted) => ExcalidrawElement[];
|
|
33
33
|
export declare const getElementsInResizingFrame: (allElements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameLikeElement, appState: AppState, elementsMap: ElementsMap) => ExcalidrawElement[];
|
|
34
|
-
export declare const getElementsInNewFrame: (elements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap) => (import("./types").ExcalidrawLinearElement | import("./types").ExcalidrawSelectionElement | import("./types").ExcalidrawRectangleElement | import("./types").ExcalidrawDiamondElement | import("./types").ExcalidrawEllipseElement | import("./types").ExcalidrawEmbeddableElement | import("./types").ExcalidrawIframeElement | import("./types").ExcalidrawImageElement | import("./types").ExcalidrawFrameElement | import("./types").ExcalidrawMagicFrameElement | import("./types").ExcalidrawTextElement | import("./types").ExcalidrawFreeDrawElement)[];
|
|
35
|
-
export declare const omitPartialGroups: (elements: ExcalidrawElement[], frame: ExcalidrawFrameLikeElement, allElementsMap: ElementsMap) => (import("./types").ExcalidrawLinearElement | import("./types").ExcalidrawSelectionElement | import("./types").ExcalidrawRectangleElement | import("./types").ExcalidrawDiamondElement | import("./types").ExcalidrawEllipseElement | import("./types").ExcalidrawEmbeddableElement | import("./types").ExcalidrawIframeElement | import("./types").ExcalidrawImageElement | import("./types").ExcalidrawFrameElement | import("./types").ExcalidrawMagicFrameElement | import("./types").ExcalidrawTextElement | import("./types").ExcalidrawFreeDrawElement)[];
|
|
34
|
+
export declare const getElementsInNewFrame: (elements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap) => (import("./types").ExcalidrawLinearElement | import("./types").ExcalidrawSelectionElement | import("./types").ExcalidrawRectangleElement | import("./types").ExcalidrawDiamondElement | import("./types").ExcalidrawEllipseElement | import("./types").ExcalidrawEmbeddableElement | import("./types").ExcalidrawIframeElement | import("./types").ExcalidrawImageElement | import("./types").ExcalidrawVideoElement | import("./types").ExcalidrawFrameElement | import("./types").ExcalidrawMagicFrameElement | import("./types").ExcalidrawTextElement | import("./types").ExcalidrawFreeDrawElement)[];
|
|
35
|
+
export declare const omitPartialGroups: (elements: ExcalidrawElement[], frame: ExcalidrawFrameLikeElement, allElementsMap: ElementsMap) => (import("./types").ExcalidrawLinearElement | import("./types").ExcalidrawSelectionElement | import("./types").ExcalidrawRectangleElement | import("./types").ExcalidrawDiamondElement | import("./types").ExcalidrawEllipseElement | import("./types").ExcalidrawEmbeddableElement | import("./types").ExcalidrawIframeElement | import("./types").ExcalidrawImageElement | import("./types").ExcalidrawVideoElement | import("./types").ExcalidrawFrameElement | import("./types").ExcalidrawMagicFrameElement | import("./types").ExcalidrawTextElement | import("./types").ExcalidrawFreeDrawElement)[];
|
|
36
36
|
export declare const getContainingFrame: (element: ExcalidrawElement, elementsMap: ElementsMap) => ExcalidrawFrameLikeElement | null;
|
|
37
37
|
/** */
|
|
38
38
|
export declare const filterElementsEligibleAsFrameChildren: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameLikeElement) => ExcalidrawElement[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MarkOptional } from "@orangecatai/common/utility-types";
|
|
2
|
-
import type { ExcalidrawImageElement, ExcalidrawTextElement, ExcalidrawLinearElement, ExcalidrawGenericElement, NonDeleted, TextAlign, VerticalAlign, Arrowhead, ExcalidrawFreeDrawElement, FontFamilyValues, ExcalidrawTextContainer, ExcalidrawFrameElement, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawIframeElement, ElementsMap, ExcalidrawArrowElement, ExcalidrawElbowArrowElement, ExcalidrawLineElement } from "./types";
|
|
2
|
+
import type { ExcalidrawImageElement, ExcalidrawVideoElement, ExcalidrawTextElement, ExcalidrawLinearElement, ExcalidrawGenericElement, NonDeleted, TextAlign, VerticalAlign, Arrowhead, ExcalidrawFreeDrawElement, FontFamilyValues, ExcalidrawTextContainer, ExcalidrawFrameElement, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawIframeElement, ElementsMap, ExcalidrawArrowElement, ExcalidrawElbowArrowElement, ExcalidrawLineElement } from "./types";
|
|
3
3
|
export type ElementConstructorOpts = MarkOptional<Omit<ExcalidrawGenericElement, "id" | "type" | "isDeleted" | "updated">, "width" | "height" | "angle" | "groupIds" | "frameId" | "index" | "boundElements" | "seed" | "version" | "versionNonce" | "link" | "strokeStyle" | "fillStyle" | "strokeColor" | "backgroundColor" | "roughness" | "strokeWidth" | "roundness" | "locked" | "opacity" | "customData">;
|
|
4
4
|
export declare const newElement: (opts: {
|
|
5
5
|
type: ExcalidrawGenericElement["type"];
|
|
@@ -60,3 +60,12 @@ export declare const newImageElement: (opts: {
|
|
|
60
60
|
scale?: ExcalidrawImageElement["scale"];
|
|
61
61
|
crop?: ExcalidrawImageElement["crop"];
|
|
62
62
|
} & ElementConstructorOpts) => NonDeleted<ExcalidrawImageElement>;
|
|
63
|
+
export declare const newVideoElement: (opts: {
|
|
64
|
+
status?: ExcalidrawVideoElement["status"];
|
|
65
|
+
videoUrl?: ExcalidrawVideoElement["videoUrl"];
|
|
66
|
+
mimeType?: ExcalidrawVideoElement["mimeType"];
|
|
67
|
+
thumbnailDataUrl?: ExcalidrawVideoElement["thumbnailDataUrl"];
|
|
68
|
+
duration?: ExcalidrawVideoElement["duration"];
|
|
69
|
+
naturalWidth?: ExcalidrawVideoElement["naturalWidth"];
|
|
70
|
+
naturalHeight?: ExcalidrawVideoElement["naturalHeight"];
|
|
71
|
+
} & ElementConstructorOpts) => NonDeleted<ExcalidrawVideoElement>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { ElementOrToolType } from "@orangecatai/adgen-canvas/types";
|
|
2
2
|
import type { MarkNonNullable } from "@orangecatai/common/utility-types";
|
|
3
|
-
import type { ExcalidrawElement, ExcalidrawTextElement, ExcalidrawEmbeddableElement, ExcalidrawLinearElement, ExcalidrawBindableElement, ExcalidrawFreeDrawElement, InitializedExcalidrawImageElement, ExcalidrawImageElement, ExcalidrawTextElementWithContainer, ExcalidrawTextContainer, ExcalidrawFrameElement, RoundnessType, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeElement, ExcalidrawIframeLikeElement, ExcalidrawMagicFrameElement, ExcalidrawArrowElement, ExcalidrawElbowArrowElement, ExcalidrawLineElement, ExcalidrawFlowchartNodeElement, ExcalidrawLinearElementSubType } from "./types";
|
|
3
|
+
import type { ExcalidrawElement, ExcalidrawTextElement, ExcalidrawEmbeddableElement, ExcalidrawLinearElement, ExcalidrawBindableElement, ExcalidrawFreeDrawElement, InitializedExcalidrawImageElement, ExcalidrawImageElement, ExcalidrawTextElementWithContainer, ExcalidrawTextContainer, ExcalidrawFrameElement, RoundnessType, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeElement, ExcalidrawIframeLikeElement, ExcalidrawMagicFrameElement, ExcalidrawArrowElement, ExcalidrawElbowArrowElement, ExcalidrawLineElement, ExcalidrawFlowchartNodeElement, ExcalidrawLinearElementSubType, ExcalidrawVideoElement } from "./types";
|
|
4
4
|
export declare const isInitializedImageElement: (element: ExcalidrawElement | null) => element is InitializedExcalidrawImageElement;
|
|
5
5
|
export declare const isImageElement: (element: ExcalidrawElement | null) => element is ExcalidrawImageElement;
|
|
6
|
+
export declare const isVideoElement: (element: ExcalidrawElement | null | undefined) => element is ExcalidrawVideoElement;
|
|
6
7
|
export declare const isEmbeddableElement: (element: ExcalidrawElement | null | undefined) => element is ExcalidrawEmbeddableElement;
|
|
7
8
|
export declare const isIframeElement: (element: ExcalidrawElement | null) => element is ExcalidrawIframeElement;
|
|
8
9
|
export declare const isIframeLikeElement: (element: ExcalidrawElement | null) => element is ExcalidrawIframeLikeElement;
|
|
@@ -137,6 +137,21 @@ export type ExcalidrawImageElement = _ExcalidrawElementBase & Readonly<{
|
|
|
137
137
|
crop: ImageCrop | null;
|
|
138
138
|
}>;
|
|
139
139
|
export type InitializedExcalidrawImageElement = MarkNonNullable<ExcalidrawImageElement, "fileId">;
|
|
140
|
+
export type ExcalidrawVideoElement = _ExcalidrawElementBase & Readonly<{
|
|
141
|
+
type: "video";
|
|
142
|
+
/** URL to host-stored video file (not DataURL — videos are too large for base64) */
|
|
143
|
+
videoUrl: string | null;
|
|
144
|
+
status: "idle" | "uploading" | "saved" | "error";
|
|
145
|
+
mimeType: "video/mp4" | "video/quicktime" | null;
|
|
146
|
+
/** JPEG data URL of the first frame, used as the static thumbnail on canvas */
|
|
147
|
+
thumbnailDataUrl: string | null;
|
|
148
|
+
/** Total duration in seconds */
|
|
149
|
+
duration: number;
|
|
150
|
+
/** Original video pixel width */
|
|
151
|
+
naturalWidth: number;
|
|
152
|
+
/** Original video pixel height */
|
|
153
|
+
naturalHeight: number;
|
|
154
|
+
}>;
|
|
140
155
|
export type ExcalidrawFrameElement = _ExcalidrawElementBase & {
|
|
141
156
|
type: "frame";
|
|
142
157
|
name: string | null;
|
|
@@ -151,13 +166,13 @@ export type ExcalidrawFrameLikeElement = ExcalidrawFrameElement | ExcalidrawMagi
|
|
|
151
166
|
*/
|
|
152
167
|
export type ExcalidrawGenericElement = ExcalidrawSelectionElement | ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement;
|
|
153
168
|
export type ExcalidrawFlowchartNodeElement = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement;
|
|
154
|
-
export type ExcalidrawRectanguloidElement = ExcalidrawRectangleElement | ExcalidrawImageElement | ExcalidrawTextElement | ExcalidrawFreeDrawElement | ExcalidrawIframeLikeElement | ExcalidrawFrameLikeElement | ExcalidrawEmbeddableElement | ExcalidrawSelectionElement;
|
|
169
|
+
export type ExcalidrawRectanguloidElement = ExcalidrawRectangleElement | ExcalidrawImageElement | ExcalidrawVideoElement | ExcalidrawTextElement | ExcalidrawFreeDrawElement | ExcalidrawIframeLikeElement | ExcalidrawFrameLikeElement | ExcalidrawEmbeddableElement | ExcalidrawSelectionElement;
|
|
155
170
|
/**
|
|
156
171
|
* ExcalidrawElement should be JSON serializable and (eventually) contain
|
|
157
172
|
* no computed data. The list of all ExcalidrawElements should be shareable
|
|
158
173
|
* between peers and contain no state local to the peer.
|
|
159
174
|
*/
|
|
160
|
-
export type ExcalidrawElement = ExcalidrawGenericElement | ExcalidrawTextElement | ExcalidrawLinearElement | ExcalidrawArrowElement | ExcalidrawFreeDrawElement | ExcalidrawImageElement | ExcalidrawFrameElement | ExcalidrawMagicFrameElement | ExcalidrawIframeElement | ExcalidrawEmbeddableElement;
|
|
175
|
+
export type ExcalidrawElement = ExcalidrawGenericElement | ExcalidrawTextElement | ExcalidrawLinearElement | ExcalidrawArrowElement | ExcalidrawFreeDrawElement | ExcalidrawImageElement | ExcalidrawVideoElement | ExcalidrawFrameElement | ExcalidrawMagicFrameElement | ExcalidrawIframeElement | ExcalidrawEmbeddableElement;
|
|
161
176
|
export type ExcalidrawNonSelectionElement = Exclude<ExcalidrawElement, ExcalidrawSelectionElement>;
|
|
162
177
|
export type Ordered<TElement extends ExcalidrawElement> = TElement & {
|
|
163
178
|
index: FractionalIndex;
|
|
@@ -1201,6 +1201,47 @@ export declare const actionWrapSelectionInFrame: {
|
|
|
1201
1201
|
link: string | null;
|
|
1202
1202
|
locked: boolean;
|
|
1203
1203
|
customData?: Record<string, any>;
|
|
1204
|
+
}> & Readonly<{
|
|
1205
|
+
type: "video";
|
|
1206
|
+
videoUrl: string | null;
|
|
1207
|
+
status: "idle" | "uploading" | "saved" | "error";
|
|
1208
|
+
mimeType: "video/mp4" | "video/quicktime" | null;
|
|
1209
|
+
thumbnailDataUrl: string | null;
|
|
1210
|
+
duration: number;
|
|
1211
|
+
naturalWidth: number;
|
|
1212
|
+
naturalHeight: number;
|
|
1213
|
+
}> & {
|
|
1214
|
+
index: import("@orangecatai/element/types").FractionalIndex;
|
|
1215
|
+
}) | (Readonly<{
|
|
1216
|
+
id: string;
|
|
1217
|
+
x: number;
|
|
1218
|
+
y: number;
|
|
1219
|
+
strokeColor: string;
|
|
1220
|
+
backgroundColor: string;
|
|
1221
|
+
fillStyle: import("@orangecatai/element/types").FillStyle;
|
|
1222
|
+
strokeWidth: number;
|
|
1223
|
+
strokeStyle: import("@orangecatai/element/types").StrokeStyle;
|
|
1224
|
+
roundness: null | {
|
|
1225
|
+
type: import("@orangecatai/element/types").RoundnessType;
|
|
1226
|
+
value?: number;
|
|
1227
|
+
};
|
|
1228
|
+
roughness: number;
|
|
1229
|
+
opacity: number;
|
|
1230
|
+
width: number;
|
|
1231
|
+
height: number;
|
|
1232
|
+
angle: import("@orangecatai/math").Radians;
|
|
1233
|
+
seed: number;
|
|
1234
|
+
version: number;
|
|
1235
|
+
versionNonce: number;
|
|
1236
|
+
index: import("@orangecatai/element/types").FractionalIndex | null;
|
|
1237
|
+
isDeleted: boolean;
|
|
1238
|
+
groupIds: readonly import("@orangecatai/element/types").GroupId[];
|
|
1239
|
+
frameId: string | null;
|
|
1240
|
+
boundElements: readonly import("@orangecatai/element/types").BoundElement[] | null;
|
|
1241
|
+
updated: number;
|
|
1242
|
+
link: string | null;
|
|
1243
|
+
locked: boolean;
|
|
1244
|
+
customData?: Record<string, any>;
|
|
1204
1245
|
}> & {
|
|
1205
1246
|
type: "frame";
|
|
1206
1247
|
name: string | null;
|
|
@@ -531,6 +531,47 @@ export declare const actionTogglePolygon: {
|
|
|
531
531
|
link: string | null;
|
|
532
532
|
locked: boolean;
|
|
533
533
|
customData?: Record<string, any>;
|
|
534
|
+
}> & Readonly<{
|
|
535
|
+
type: "video";
|
|
536
|
+
videoUrl: string | null;
|
|
537
|
+
status: "idle" | "uploading" | "saved" | "error";
|
|
538
|
+
mimeType: "video/mp4" | "video/quicktime" | null;
|
|
539
|
+
thumbnailDataUrl: string | null;
|
|
540
|
+
duration: number;
|
|
541
|
+
naturalWidth: number;
|
|
542
|
+
naturalHeight: number;
|
|
543
|
+
}> & {
|
|
544
|
+
index: import("@orangecatai/element/types").FractionalIndex;
|
|
545
|
+
}) | (Readonly<{
|
|
546
|
+
id: string;
|
|
547
|
+
x: number;
|
|
548
|
+
y: number;
|
|
549
|
+
strokeColor: string;
|
|
550
|
+
backgroundColor: string;
|
|
551
|
+
fillStyle: import("@orangecatai/element/types").FillStyle;
|
|
552
|
+
strokeWidth: number;
|
|
553
|
+
strokeStyle: import("@orangecatai/element/types").StrokeStyle;
|
|
554
|
+
roundness: null | {
|
|
555
|
+
type: import("@orangecatai/element/types").RoundnessType;
|
|
556
|
+
value?: number;
|
|
557
|
+
};
|
|
558
|
+
roughness: number;
|
|
559
|
+
opacity: number;
|
|
560
|
+
width: number;
|
|
561
|
+
height: number;
|
|
562
|
+
angle: import("@orangecatai/math").Radians;
|
|
563
|
+
seed: number;
|
|
564
|
+
version: number;
|
|
565
|
+
versionNonce: number;
|
|
566
|
+
index: import("@orangecatai/element/types").FractionalIndex | null;
|
|
567
|
+
isDeleted: boolean;
|
|
568
|
+
groupIds: readonly import("@orangecatai/element/types").GroupId[];
|
|
569
|
+
frameId: string | null;
|
|
570
|
+
boundElements: readonly import("@orangecatai/element/types").BoundElement[] | null;
|
|
571
|
+
updated: number;
|
|
572
|
+
link: string | null;
|
|
573
|
+
locked: boolean;
|
|
574
|
+
customData?: Record<string, any>;
|
|
534
575
|
}> & {
|
|
535
576
|
type: "frame";
|
|
536
577
|
name: string | null;
|
|
@@ -258,6 +258,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
258
258
|
private updateEmbedValidationStatus;
|
|
259
259
|
private updateEmbeddables;
|
|
260
260
|
private renderEmbeddables;
|
|
261
|
+
private renderVideos;
|
|
261
262
|
private getFrameNameDOMId;
|
|
262
263
|
frameNameBoundsCache: FrameNameBoundsCache;
|
|
263
264
|
private resetEditingFrame;
|
|
@@ -284,11 +285,17 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
284
285
|
private onIframeSrcCopy;
|
|
285
286
|
onMagicframeToolSelect: () => void;
|
|
286
287
|
onImageGeneratorSelect: () => void;
|
|
288
|
+
onVideoGeneratorSelect: () => void;
|
|
287
289
|
/**
|
|
288
290
|
* Inserts a generated image (base64 data URL) into a frame element,
|
|
289
291
|
* sized to fill the frame exactly. Used by the image generator panel.
|
|
290
292
|
*/
|
|
291
293
|
insertGeneratedImageIntoFrame: (dataURL: string, frameElement: import("@orangecatai/element/types").ExcalidrawFrameLikeElement & import("@orangecatai/element/types").NonDeletedExcalidrawElement) => Promise<void>;
|
|
294
|
+
/**
|
|
295
|
+
* Inserts a generated video (presigned/CDN URL) into a video-generator frame,
|
|
296
|
+
* replacing any previous video. The video element fills the frame exactly.
|
|
297
|
+
*/
|
|
298
|
+
insertGeneratedVideoIntoFrame: (videoUrl: string, frameElement: import("@orangecatai/element/types").ExcalidrawFrameLikeElement & import("@orangecatai/element/types").NonDeletedExcalidrawElement) => void;
|
|
292
299
|
/**
|
|
293
300
|
* Inserts a generated image near a source element (≥ 25 px clearance).
|
|
294
301
|
* Tries right → below → left → above; falls back to right if all collide.
|
|
@@ -532,6 +539,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
532
539
|
*/
|
|
533
540
|
private getLatestInitializedImageElement;
|
|
534
541
|
private onImageToolbarButtonClick;
|
|
542
|
+
onVideoToolbarButtonClick: () => void;
|
|
535
543
|
private getImageNaturalDimensions;
|
|
536
544
|
/** updates image cache, refreshing updated elements and/or setting status
|
|
537
545
|
to error for images that fail during <img> element creation */
|
|
@@ -545,6 +553,8 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
545
553
|
private clearSelection;
|
|
546
554
|
private handleInteractiveCanvasRef;
|
|
547
555
|
private insertImages;
|
|
556
|
+
private newVideoPlaceholder;
|
|
557
|
+
insertVideos: (videoFiles: File[], sceneX: number, sceneY: number) => Promise<void>;
|
|
548
558
|
private handleAppOnDrop;
|
|
549
559
|
loadFileToCanvas: (file: File, fileHandle: FileSystemHandle | null) => Promise<void>;
|
|
550
560
|
private handleCanvasContextMenu;
|
|
@@ -16,6 +16,20 @@ export declare const MODEL_CONFIG: {
|
|
|
16
16
|
readonly supportedResolutions: readonly ["0.5K", "1K", "2K", "4K"];
|
|
17
17
|
readonly supportedRatios: readonly ["21:9", "16:9", "4:3", "3:2", "1:1", "9:16", "3:4", "2:3", "5:4", "4:5", "4:1", "1:4", "8:1", "1:8"];
|
|
18
18
|
};
|
|
19
|
+
readonly "nano banana lite": {
|
|
20
|
+
readonly modelId: "google/gemini-3.1-flash-lite-image";
|
|
21
|
+
readonly textOutput: true;
|
|
22
|
+
readonly supportsImageSize: false;
|
|
23
|
+
readonly supportedResolutions: readonly ["0.5K", "1K", "2K", "4K"];
|
|
24
|
+
readonly supportedRatios: readonly ["21:9", "16:9", "4:3", "3:2", "1:1", "9:16", "3:4", "2:3", "5:4", "4:5", "4:1", "1:4", "8:1", "1:8"];
|
|
25
|
+
};
|
|
26
|
+
readonly "nano banana 2 lite": {
|
|
27
|
+
readonly modelId: "google/gemini-3.1-flash-lite-image";
|
|
28
|
+
readonly textOutput: true;
|
|
29
|
+
readonly supportsImageSize: false;
|
|
30
|
+
readonly supportedResolutions: readonly ["0.5K", "1K", "2K", "4K"];
|
|
31
|
+
readonly supportedRatios: readonly ["21:9", "16:9", "4:3", "3:2", "1:1", "9:16", "3:4", "2:3", "5:4", "4:5", "4:1", "1:4", "8:1", "1:8"];
|
|
32
|
+
};
|
|
19
33
|
readonly "nano banana pro": {
|
|
20
34
|
readonly modelId: "google/gemini-3-pro-image-preview";
|
|
21
35
|
readonly textOutput: true;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ExcalidrawVideoElement } from "@orangecatai/element/types";
|
|
2
|
+
import "./VideoElement.scss";
|
|
3
|
+
interface VideoElementProps {
|
|
4
|
+
element: ExcalidrawVideoElement;
|
|
5
|
+
isActive: boolean;
|
|
6
|
+
videoDownloadProxyUrl?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const VideoElement: ({ element, videoDownloadProxyUrl }: VideoElementProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import "./VideoGeneratorPanel.scss";
|
|
2
|
+
import type { ExcalidrawFrameLikeElement, NonDeletedExcalidrawElement } from "@orangecatai/element/types";
|
|
3
|
+
import type { AppClassProperties } from "../types";
|
|
4
|
+
declare const VIDEO_MODEL_CONFIG: {
|
|
5
|
+
readonly "veo 3.1 fast": {
|
|
6
|
+
readonly modelId: "google/veo-3.1-fast";
|
|
7
|
+
readonly supportsFirstFrame: true;
|
|
8
|
+
readonly supportsLastFrame: true;
|
|
9
|
+
readonly audioMode: "always-on";
|
|
10
|
+
readonly supportsDuration: true;
|
|
11
|
+
readonly durationMode: "choices";
|
|
12
|
+
readonly durationValues: readonly [4, 6, 8];
|
|
13
|
+
readonly supportsResolution: true;
|
|
14
|
+
readonly supportedResolutions: readonly ["720p", "1080p", "4K"];
|
|
15
|
+
readonly supportsNegativePrompt: false;
|
|
16
|
+
readonly supportedRatios: readonly ["16:9", "9:16"];
|
|
17
|
+
readonly frameInputMode: "dual-frame";
|
|
18
|
+
readonly supportsInputReferences: false;
|
|
19
|
+
readonly supportsSeed: true;
|
|
20
|
+
};
|
|
21
|
+
readonly "veo 3.1 lite": {
|
|
22
|
+
readonly modelId: "google/veo-3.1-lite";
|
|
23
|
+
readonly supportsFirstFrame: true;
|
|
24
|
+
readonly supportsLastFrame: true;
|
|
25
|
+
readonly audioMode: "always-on";
|
|
26
|
+
readonly supportsDuration: true;
|
|
27
|
+
readonly durationMode: "choices";
|
|
28
|
+
readonly durationValues: readonly [4, 6, 8];
|
|
29
|
+
readonly supportsResolution: true;
|
|
30
|
+
readonly supportedResolutions: readonly ["720p", "1080p"];
|
|
31
|
+
readonly supportsNegativePrompt: false;
|
|
32
|
+
readonly supportedRatios: readonly ["16:9", "9:16"];
|
|
33
|
+
readonly frameInputMode: "dual-frame";
|
|
34
|
+
readonly supportsInputReferences: false;
|
|
35
|
+
readonly supportsSeed: true;
|
|
36
|
+
};
|
|
37
|
+
readonly "kling v3 pro": {
|
|
38
|
+
readonly modelId: "kwaivgi/kling-v3.0-pro";
|
|
39
|
+
readonly supportsFirstFrame: true;
|
|
40
|
+
readonly supportsLastFrame: true;
|
|
41
|
+
readonly audioMode: "toggle";
|
|
42
|
+
readonly supportsDuration: true;
|
|
43
|
+
readonly durationMode: "slider";
|
|
44
|
+
readonly minDuration: 3;
|
|
45
|
+
readonly maxDuration: 15;
|
|
46
|
+
readonly supportsResolution: false;
|
|
47
|
+
readonly supportsNegativePrompt: true;
|
|
48
|
+
readonly supportedRatios: readonly ["16:9", "9:16", "1:1"];
|
|
49
|
+
readonly frameInputMode: "dual-frame";
|
|
50
|
+
readonly supportsInputReferences: false;
|
|
51
|
+
readonly supportsSeed: true;
|
|
52
|
+
};
|
|
53
|
+
readonly "kling v3 std": {
|
|
54
|
+
readonly modelId: "kwaivgi/kling-v3.0-std";
|
|
55
|
+
readonly supportsFirstFrame: true;
|
|
56
|
+
readonly supportsLastFrame: true;
|
|
57
|
+
readonly audioMode: "toggle";
|
|
58
|
+
readonly supportsDuration: true;
|
|
59
|
+
readonly durationMode: "slider";
|
|
60
|
+
readonly minDuration: 3;
|
|
61
|
+
readonly maxDuration: 15;
|
|
62
|
+
readonly supportsResolution: false;
|
|
63
|
+
readonly supportsNegativePrompt: true;
|
|
64
|
+
readonly supportedRatios: readonly ["16:9", "9:16", "1:1"];
|
|
65
|
+
readonly frameInputMode: "dual-frame";
|
|
66
|
+
readonly supportsInputReferences: false;
|
|
67
|
+
readonly supportsSeed: true;
|
|
68
|
+
};
|
|
69
|
+
readonly "seedance 2.0": {
|
|
70
|
+
readonly modelId: "bytedance/seedance-2.0";
|
|
71
|
+
readonly supportsFirstFrame: true;
|
|
72
|
+
readonly supportsLastFrame: true;
|
|
73
|
+
readonly audioMode: "always-on";
|
|
74
|
+
readonly supportsDuration: true;
|
|
75
|
+
readonly durationMode: "slider";
|
|
76
|
+
readonly minDuration: 4;
|
|
77
|
+
readonly maxDuration: 15;
|
|
78
|
+
readonly supportsResolution: true;
|
|
79
|
+
readonly supportedResolutions: readonly ["480p", "720p", "1080p", "4K"];
|
|
80
|
+
readonly supportsNegativePrompt: false;
|
|
81
|
+
readonly supportedRatios: readonly ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9", "9:21"];
|
|
82
|
+
readonly frameInputMode: "dual-frame";
|
|
83
|
+
readonly supportsInputReferences: true;
|
|
84
|
+
readonly supportsSeed: true;
|
|
85
|
+
};
|
|
86
|
+
readonly "seedance 2.0 fast": {
|
|
87
|
+
readonly modelId: "bytedance/seedance-2.0-fast";
|
|
88
|
+
readonly supportsFirstFrame: true;
|
|
89
|
+
readonly supportsLastFrame: true;
|
|
90
|
+
readonly audioMode: "always-on";
|
|
91
|
+
readonly supportsDuration: true;
|
|
92
|
+
readonly durationMode: "slider";
|
|
93
|
+
readonly minDuration: 4;
|
|
94
|
+
readonly maxDuration: 15;
|
|
95
|
+
readonly supportsResolution: true;
|
|
96
|
+
readonly supportedResolutions: readonly ["480p", "720p"];
|
|
97
|
+
readonly supportsNegativePrompt: false;
|
|
98
|
+
readonly supportedRatios: readonly ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9", "9:21"];
|
|
99
|
+
readonly frameInputMode: "dual-frame";
|
|
100
|
+
readonly supportsInputReferences: true;
|
|
101
|
+
readonly supportsSeed: true;
|
|
102
|
+
};
|
|
103
|
+
readonly "happyhorse 1.1": {
|
|
104
|
+
readonly modelId: "alibaba/happyhorse-1.1";
|
|
105
|
+
readonly supportsFirstFrame: true;
|
|
106
|
+
readonly supportsLastFrame: false;
|
|
107
|
+
readonly audioMode: "none";
|
|
108
|
+
readonly supportsDuration: true;
|
|
109
|
+
readonly durationMode: "slider";
|
|
110
|
+
readonly minDuration: 3;
|
|
111
|
+
readonly maxDuration: 15;
|
|
112
|
+
readonly supportsResolution: true;
|
|
113
|
+
readonly supportedResolutions: readonly ["720p", "1080p"];
|
|
114
|
+
readonly supportsNegativePrompt: false;
|
|
115
|
+
readonly supportedRatios: readonly ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9", "9:21"];
|
|
116
|
+
readonly frameInputMode: "start-only";
|
|
117
|
+
readonly supportsInputReferences: false;
|
|
118
|
+
readonly supportsSeed: true;
|
|
119
|
+
};
|
|
120
|
+
readonly "grok video": {
|
|
121
|
+
readonly modelId: "x-ai/grok-imagine-video";
|
|
122
|
+
readonly supportsFirstFrame: true;
|
|
123
|
+
readonly supportsLastFrame: false;
|
|
124
|
+
readonly audioMode: "none";
|
|
125
|
+
readonly supportsDuration: true;
|
|
126
|
+
readonly durationMode: "slider";
|
|
127
|
+
readonly minDuration: 1;
|
|
128
|
+
readonly maxDuration: 15;
|
|
129
|
+
readonly supportsResolution: true;
|
|
130
|
+
readonly supportedResolutions: readonly ["480p", "720p"];
|
|
131
|
+
readonly supportsNegativePrompt: false;
|
|
132
|
+
readonly supportedRatios: readonly ["16:9", "9:16", "1:1", "4:3", "3:4", "3:2", "2:3"];
|
|
133
|
+
readonly frameInputMode: "start-only";
|
|
134
|
+
readonly supportsInputReferences: false;
|
|
135
|
+
readonly supportsSeed: true;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
export type VideoModelName = keyof typeof VIDEO_MODEL_CONFIG;
|
|
139
|
+
export declare const VIDEO_MODEL_NAMES: VideoModelName[];
|
|
140
|
+
export declare const VideoGeneratorPanel: ({ element, app, onBeforeVideoGen, onAfterVideoGen, }: {
|
|
141
|
+
element: NonDeletedExcalidrawElement & ExcalidrawFrameLikeElement;
|
|
142
|
+
app: AppClassProperties;
|
|
143
|
+
onBeforeVideoGen?: () => Promise<{
|
|
144
|
+
allowed: boolean;
|
|
145
|
+
error?: string;
|
|
146
|
+
}>;
|
|
147
|
+
onAfterVideoGen?: () => void;
|
|
148
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
149
|
+
export {};
|
|
@@ -33,6 +33,7 @@ export declare const FreedrawIcon: import("react/jsx-runtime").JSX.Element;
|
|
|
33
33
|
export declare const TextIcon: import("react/jsx-runtime").JSX.Element;
|
|
34
34
|
export declare const TextSizeIcon: import("react/jsx-runtime").JSX.Element;
|
|
35
35
|
export declare const ImageIcon: import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export declare const VideoIcon: import("react/jsx-runtime").JSX.Element;
|
|
36
37
|
export declare const EraserIcon: import("react/jsx-runtime").JSX.Element;
|
|
37
38
|
export declare const ZoomInIcon: import("react/jsx-runtime").JSX.Element;
|
|
38
39
|
export declare const ZoomOutIcon: import("react/jsx-runtime").JSX.Element;
|
|
@@ -189,6 +190,7 @@ export declare const eyeDropperIcon: import("react/jsx-runtime").JSX.Element;
|
|
|
189
190
|
export declare const extraToolsIcon: import("react/jsx-runtime").JSX.Element;
|
|
190
191
|
export declare const frameToolIcon: import("react/jsx-runtime").JSX.Element;
|
|
191
192
|
export declare const imageGeneratorToolIcon: import("react/jsx-runtime").JSX.Element;
|
|
193
|
+
export declare const videoGeneratorToolIcon: import("react/jsx-runtime").JSX.Element;
|
|
192
194
|
export declare const mermaidLogoIcon: import("react/jsx-runtime").JSX.Element;
|
|
193
195
|
export declare const RetryIcon: import("react/jsx-runtime").JSX.Element;
|
|
194
196
|
export declare const stackPushIcon: import("react/jsx-runtime").JSX.Element;
|
|
@@ -12,6 +12,10 @@ export declare const SaveAsImage: {
|
|
|
12
12
|
(): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
displayName: string;
|
|
14
14
|
};
|
|
15
|
+
export declare const UploadVideo: {
|
|
16
|
+
(): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
15
19
|
export declare const CommandPalette: {
|
|
16
20
|
(opts?: {
|
|
17
21
|
className?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IMAGE_MIME_TYPES, MIME_TYPES } from "@orangecatai/common";
|
|
1
|
+
import { IMAGE_MIME_TYPES, VIDEO_MIME_TYPES, MIME_TYPES } from "@orangecatai/common";
|
|
2
2
|
import type { ExcalidrawElement, FileId } from "@orangecatai/element/types";
|
|
3
3
|
import type { ValueOf } from "@orangecatai/common/utility-types";
|
|
4
4
|
import type { AppState, DataURL, LibraryItem } from "../types";
|
|
@@ -12,6 +12,9 @@ export declare const isSupportedImageFileType: (type: string | null | undefined)
|
|
|
12
12
|
export declare const isSupportedImageFile: (blob: Blob | null | undefined) => blob is Blob & {
|
|
13
13
|
type: ValueOf<typeof IMAGE_MIME_TYPES>;
|
|
14
14
|
};
|
|
15
|
+
export declare const isSupportedVideoFile: (blob: Blob | null | undefined) => blob is Blob & {
|
|
16
|
+
type: ValueOf<typeof VIDEO_MIME_TYPES>;
|
|
17
|
+
};
|
|
15
18
|
export declare const loadSceneOrLibraryFromBlob: (blob: Blob | File,
|
|
16
19
|
/** @see restore.localAppState */
|
|
17
20
|
localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null,
|
|
@@ -14,13 +14,14 @@ export declare const Excalidraw: React.MemoExoticComponent<(props: ExcalidrawPro
|
|
|
14
14
|
export { getSceneVersion, hashElementsVersion, hashString, getNonDeletedElements, } from "@orangecatai/element";
|
|
15
15
|
export { getTextFromElements } from "@orangecatai/element";
|
|
16
16
|
export { isInvisiblySmallElement } from "@orangecatai/element";
|
|
17
|
-
export { newImageElement, newTextElement, newFrameElement, } from "@orangecatai/element";
|
|
17
|
+
export { newImageElement, newVideoElement, newTextElement, newFrameElement, } from "@orangecatai/element";
|
|
18
|
+
export { isVideoElement } from "@orangecatai/element";
|
|
18
19
|
export { defaultLang, useI18n, languages } from "./i18n";
|
|
19
20
|
export { restoreAppState, restoreElement, restoreElements, restoreLibraryItems, } from "./data/restore";
|
|
20
21
|
export { reconcileElements } from "./data/reconcile";
|
|
21
22
|
export { exportToCanvas, exportToBlob, exportToSvg, exportToClipboard, } from "@orangecatai/utils/export";
|
|
22
23
|
export { serializeAsJSON, serializeLibraryAsJSON } from "./data/json";
|
|
23
|
-
export { loadFromBlob, loadSceneOrLibraryFromBlob, loadLibraryFromBlob, } from "./data/blob";
|
|
24
|
+
export { loadFromBlob, loadSceneOrLibraryFromBlob, loadLibraryFromBlob, isSupportedVideoFile, } from "./data/blob";
|
|
24
25
|
export { mergeLibraryItems, getLibraryItemsHash } from "./data/library";
|
|
25
26
|
export { isLinearElement } from "@orangecatai/element";
|
|
26
27
|
export { FONT_FAMILY, THEME, MIME_TYPES, ROUNDNESS, DEFAULT_LASER_COLOR, UserIdleState, normalizeLink, sceneCoordsToViewportCoords, viewportCoordsToSceneCoords, getFormFactor, } from "@orangecatai/common";
|
|
@@ -53,7 +54,7 @@ export { AIChatPanel } from "./components/AIChatPanel";
|
|
|
53
54
|
export type { AIChatPanelProps, AIChatPanelRef, ChatMessage, ChatSession, } from "./components/AIChatPanel";
|
|
54
55
|
export type { ExcalidrawImperativeAPI } from "./types";
|
|
55
56
|
export type { AppState, BinaryFiles, BinaryFileData, ExcalidrawProps, ExcalidrawInitialDataState, LibraryItem, LibraryItems, SceneData, UnsubscribeCallback, } from "./types";
|
|
56
|
-
export type { ExcalidrawElement, NonDeletedExcalidrawElement, NonDeleted, OrderedExcalidrawElement, ExcalidrawElementType, } from "@orangecatai/element/types";
|
|
57
|
+
export type { ExcalidrawElement, NonDeletedExcalidrawElement, NonDeleted, OrderedExcalidrawElement, ExcalidrawElementType, ExcalidrawVideoElement, } from "@orangecatai/element/types";
|
|
57
58
|
export type { ImageEditToolbarCallbacks } from "./components/ImageEditToolbar";
|
|
58
59
|
export type { CustomFontSpec, BrandContext } from "./types";
|
|
59
60
|
export type { ReviewerFeedback, ReviewIssue, } from "./components/ai-chat/reviewerAgent";
|
|
@@ -619,6 +619,35 @@ export interface ExcalidrawProps {
|
|
|
619
619
|
* Called after a successful image generation from any panel or agent tool.
|
|
620
620
|
*/
|
|
621
621
|
onAfterImageGen?: () => void;
|
|
622
|
+
/**
|
|
623
|
+
* Host proxy URL for video uploads. The SDK POSTs multipart/form-data with
|
|
624
|
+
* a `file` field; the host stores the video and returns `{ url: string }`.
|
|
625
|
+
* Without this prop, video upload via drag-and-drop is silently ignored.
|
|
626
|
+
*/
|
|
627
|
+
videoUploadUrl?: string;
|
|
628
|
+
/**
|
|
629
|
+
* Called before a video upload begins. Return `{ allowed: false }` to block
|
|
630
|
+
* (e.g. quota exceeded). Host uses this for credit gating.
|
|
631
|
+
*/
|
|
632
|
+
onBeforeVideoUpload?: () => Promise<{
|
|
633
|
+
allowed: boolean;
|
|
634
|
+
error?: string;
|
|
635
|
+
}>;
|
|
636
|
+
/** Called after a video is successfully uploaded and placed on the canvas. */
|
|
637
|
+
onAfterVideoUpload?: () => void;
|
|
638
|
+
/** Host proxy URL for video generation jobs (POST). */
|
|
639
|
+
videoGenUrl?: string;
|
|
640
|
+
/** Host proxy URL for polling video generation job status (GET {url}/{jobId}). */
|
|
641
|
+
videoGenStatusUrl?: string;
|
|
642
|
+
/** Called before a video generation job is submitted (credit gate). */
|
|
643
|
+
onBeforeVideoGen?: () => Promise<{
|
|
644
|
+
allowed: boolean;
|
|
645
|
+
error?: string;
|
|
646
|
+
}>;
|
|
647
|
+
/** Called after a video is successfully generated and inserted into the canvas. */
|
|
648
|
+
onAfterVideoGen?: () => void;
|
|
649
|
+
/** Host proxy URL for video downloads — works around S3 CORS / presigned-URL expiry. */
|
|
650
|
+
videoDownloadProxyUrl?: string;
|
|
622
651
|
/**
|
|
623
652
|
* Called before a background removal is run (deduct credits, check quota).
|
|
624
653
|
* Return `{ allowed: false, error: "..." }` to block the operation.
|
|
@@ -822,8 +851,10 @@ export type AppClassProperties = {
|
|
|
822
851
|
insertEmbeddableElement: App["insertEmbeddableElement"];
|
|
823
852
|
onMagicframeToolSelect: App["onMagicframeToolSelect"];
|
|
824
853
|
onImageGeneratorSelect: App["onImageGeneratorSelect"];
|
|
854
|
+
onVideoGeneratorSelect: App["onVideoGeneratorSelect"];
|
|
825
855
|
insertGeneratedImageIntoFrame: App["insertGeneratedImageIntoFrame"];
|
|
826
856
|
insertGeneratedImageNearElement: App["insertGeneratedImageNearElement"];
|
|
857
|
+
insertGeneratedVideoIntoFrame: App["insertGeneratedVideoIntoFrame"];
|
|
827
858
|
getName: App["getName"];
|
|
828
859
|
dismissLinearEditor: App["dismissLinearEditor"];
|
|
829
860
|
flowChartCreator: App["flowChartCreator"];
|
|
@@ -844,6 +875,8 @@ export type AppClassProperties = {
|
|
|
844
875
|
refreshEditorInterface: App["refreshEditorInterface"];
|
|
845
876
|
lassoTrail: App["lassoTrail"];
|
|
846
877
|
toggleSidebar: App["toggleSidebar"];
|
|
878
|
+
insertVideos: App["insertVideos"];
|
|
879
|
+
onVideoToolbarButtonClick: App["onVideoToolbarButtonClick"];
|
|
847
880
|
};
|
|
848
881
|
export type PointerDownState = Readonly<{
|
|
849
882
|
origin: Readonly<{
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface VideoJobParams {
|
|
2
|
+
model: string;
|
|
3
|
+
prompt: string;
|
|
4
|
+
aspectRatio: string;
|
|
5
|
+
duration?: number;
|
|
6
|
+
resolution?: string;
|
|
7
|
+
firstFrameDataUrl?: string;
|
|
8
|
+
lastFrameDataUrl?: string;
|
|
9
|
+
audio?: boolean;
|
|
10
|
+
negativePrompt?: string;
|
|
11
|
+
inputReferences?: string[];
|
|
12
|
+
seed?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface VideoJobResult {
|
|
15
|
+
videoPresignedUrl: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Submit a video generation job to the host proxy.
|
|
19
|
+
* Returns { jobId } immediately — the job runs async on OpenRouter.
|
|
20
|
+
*/
|
|
21
|
+
export declare function submitVideoJob(params: VideoJobParams, videoGenUrl: string): Promise<{
|
|
22
|
+
jobId: string;
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* Poll the host status endpoint until the job is done or failed.
|
|
26
|
+
* onProgress is called with values 0–1 as they arrive.
|
|
27
|
+
* Resolves with { videoPresignedUrl } on success.
|
|
28
|
+
* Rejects with an Error on failure or abort.
|
|
29
|
+
*/
|
|
30
|
+
export declare function pollVideoJob(jobId: string, videoGenStatusUrl: string, onProgress: (progress: number) => void, signal?: AbortSignal): Promise<VideoJobResult>;
|