@orangecatai/element 0.0.2 → 0.0.4

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 (93) hide show
  1. package/dist/dev/index.js +67 -4
  2. package/dist/dev/index.js.map +2 -2
  3. package/dist/prod/index.js +9 -9
  4. package/dist/types/common/src/constants.d.ts +4 -0
  5. package/dist/types/common/src/keys.d.ts +2 -0
  6. package/dist/types/element/src/Scene.d.ts +1 -1
  7. package/dist/types/element/src/frame.d.ts +5 -5
  8. package/dist/types/element/src/newElement.d.ts +10 -1
  9. package/dist/types/element/src/typeChecks.d.ts +2 -1
  10. package/dist/types/element/src/types.d.ts +17 -2
  11. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +1 -1
  12. package/dist/types/excalidraw/actions/actionCanvas.d.ts +177 -0
  13. package/dist/types/excalidraw/actions/actionClipboard.d.ts +7 -7
  14. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +2 -2
  15. package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +2 -2
  16. package/dist/types/excalidraw/actions/actionElementLink.d.ts +6 -6
  17. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +1 -1
  18. package/dist/types/excalidraw/actions/actionFrame.d.ts +219 -0
  19. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +48 -7
  20. package/dist/types/excalidraw/actions/actionLink.d.ts +3 -3
  21. package/dist/types/excalidraw/actions/actionMenu.d.ts +1 -1
  22. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +4 -4
  23. package/dist/types/excalidraw/actions/actionStyles.d.ts +2 -2
  24. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +4 -4
  25. package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +3 -3
  26. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +2 -2
  27. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +4 -4
  28. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +4 -4
  29. package/dist/types/excalidraw/actions/actionZindex.d.ts +8 -8
  30. package/dist/types/excalidraw/actions/index.d.ts +1 -1
  31. package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
  32. package/dist/types/excalidraw/actions/types.d.ts +1 -1
  33. package/dist/types/excalidraw/components/AIChatPanel.d.ts +176 -0
  34. package/dist/types/excalidraw/components/Actions.d.ts +3 -0
  35. package/dist/types/excalidraw/components/App.d.ts +10 -0
  36. package/dist/types/excalidraw/components/CanvasBackgroundSwatch.d.ts +7 -0
  37. package/dist/types/excalidraw/components/ColorPicker/AdvancedColorPicker.d.ts +8 -0
  38. package/dist/types/excalidraw/components/ColorPicker/colorConversions.d.ts +27 -0
  39. package/dist/types/excalidraw/components/DarkModeToggle.d.ts +1 -1
  40. package/dist/types/excalidraw/components/DefaultSidebar.d.ts +1 -1
  41. package/dist/types/excalidraw/components/ElementCanvasButtons.d.ts +1 -1
  42. package/dist/types/excalidraw/components/FrameToolbar.d.ts +1 -1
  43. package/dist/types/excalidraw/components/HintViewer.d.ts +1 -1
  44. package/dist/types/excalidraw/components/ImageEditToolbar.d.ts +15 -0
  45. package/dist/types/excalidraw/components/ImageGeneratorPanel.d.ts +59 -13
  46. package/dist/types/excalidraw/components/ImageQuickEditPanel.d.ts +10 -1
  47. package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +2 -2
  48. package/dist/types/excalidraw/components/Stats/DragInput.d.ts +1 -1
  49. package/dist/types/excalidraw/components/Stats/index.d.ts +1 -1
  50. package/dist/types/excalidraw/components/StockImagePanel.d.ts +49 -0
  51. package/dist/types/excalidraw/components/TTDDialog/utils/TTDStreamFetch.d.ts +1 -0
  52. package/dist/types/excalidraw/components/ToolButton.d.ts +1 -1
  53. package/dist/types/excalidraw/components/VideoElement.d.ts +9 -0
  54. package/dist/types/excalidraw/components/VideoGeneratorPanel.d.ts +149 -0
  55. package/dist/types/excalidraw/components/ai-chat/AdGenShimmerLayer.d.ts +10 -0
  56. package/dist/types/excalidraw/components/ai-chat/adGenShimmerStore.d.ts +12 -0
  57. package/dist/types/excalidraw/components/ai-chat/agentLoop.d.ts +114 -0
  58. package/dist/types/excalidraw/components/ai-chat/audioUtils.d.ts +5 -0
  59. package/dist/types/excalidraw/components/ai-chat/canvasTools.d.ts +752 -0
  60. package/dist/types/excalidraw/components/ai-chat/htmlToExcalidraw.d.ts +53 -0
  61. package/dist/types/excalidraw/components/ai-chat/openRouterStream.d.ts +50 -0
  62. package/dist/types/excalidraw/components/ai-chat/reviewerAgent.d.ts +74 -0
  63. package/dist/types/excalidraw/components/auto-resize/AutoResizePanel.d.ts +17 -0
  64. package/dist/types/excalidraw/components/auto-resize/AutoResizePanelHost.d.ts +4 -0
  65. package/dist/types/excalidraw/components/auto-resize/AutoResizeShimmerLayer.d.ts +11 -0
  66. package/dist/types/excalidraw/components/auto-resize/autoResizeEngine.d.ts +185 -0
  67. package/dist/types/excalidraw/components/auto-resize/autoResizePanelStore.d.ts +15 -0
  68. package/dist/types/excalidraw/components/auto-resize/autoResizeStore.d.ts +16 -0
  69. package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +1 -1
  70. package/dist/types/excalidraw/components/icons.d.ts +3 -0
  71. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +5 -1
  72. package/dist/types/excalidraw/components/template-builder/TemplateBuilderPanelHost.d.ts +4 -0
  73. package/dist/types/excalidraw/components/template-builder/TemplateBuilderTray.d.ts +4 -0
  74. package/dist/types/excalidraw/components/template-builder/slotTypes.d.ts +43 -0
  75. package/dist/types/excalidraw/components/template-builder/templateBuilderStore.d.ts +19 -0
  76. package/dist/types/excalidraw/components/ui/avatar.d.ts +6 -0
  77. package/dist/types/excalidraw/components/ui/button.d.ts +11 -0
  78. package/dist/types/excalidraw/components/ui/chat-container.d.ts +17 -0
  79. package/dist/types/excalidraw/components/ui/code-block.d.ts +16 -0
  80. package/dist/types/excalidraw/components/ui/markdown.d.ts +10 -0
  81. package/dist/types/excalidraw/components/ui/message.d.ts +35 -0
  82. package/dist/types/excalidraw/components/ui/scroll-button.d.ts +10 -0
  83. package/dist/types/excalidraw/data/blob.d.ts +4 -1
  84. package/dist/types/excalidraw/fonts/Fonts.d.ts +17 -0
  85. package/dist/types/excalidraw/index.d.ts +13 -1
  86. package/dist/types/excalidraw/scene/types.d.ts +1 -0
  87. package/dist/types/excalidraw/types.d.ts +286 -4
  88. package/dist/types/excalidraw/utils/brandContextUtils.d.ts +23 -0
  89. package/dist/types/excalidraw/utils/imageApi.d.ts +19 -0
  90. package/dist/types/excalidraw/utils/videoApi.d.ts +30 -0
  91. package/dist/types/utils/src/shape.d.ts +2 -2
  92. package/package.json +2 -2
  93. package/dist/types/excalidraw/utils/geminiApiKey.d.ts +0 -1
@@ -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";
@@ -53,6 +53,7 @@ export declare const KEYS: {
53
53
  readonly G: "g";
54
54
  readonly H: "h";
55
55
  readonly I: "i";
56
+ readonly J: "j";
56
57
  readonly L: "l";
57
58
  readonly O: "o";
58
59
  readonly P: "p";
@@ -108,6 +109,7 @@ export declare const KeyCodeMap: Map<ValueOf<{
108
109
  readonly G: "g";
109
110
  readonly H: "h";
110
111
  readonly I: "i";
112
+ readonly J: "j";
111
113
  readonly L: "l";
112
114
  readonly O: "o";
113
115
  readonly P: "p";
@@ -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,15 +31,15 @@ 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[];
39
39
  /**
40
- * Retains (or repairs for target frame) the ordering invriant where children
41
- * elements come right before the parent frame:
42
- * [el, el, child, child, frame, el]
40
+ * Retains (or repairs for target frame) the ordering invariant where the frame
41
+ * comes before its children elements:
42
+ * [el, el, frame, child, child, el]
43
43
  *
44
44
  * @returns mutated allElements (same data structure)
45
45
  */
@@ -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;
@@ -3,7 +3,7 @@ export declare const actionAddToLibrary: {
3
3
  trackEvent: {
4
4
  category: "element";
5
5
  };
6
- perform: (elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, _: unknown, app: import("../types").AppClassProperties) => Promise<{
6
+ perform: (elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[], appState: Readonly<import("..").AppState>, _: unknown, app: import("../types").AppClassProperties) => Promise<{
7
7
  captureUpdate: "EVENTUALLY";
8
8
  appState: {
9
9
  toast: {
@@ -706,6 +706,7 @@ export declare const actionResetZoom: {
706
706
  } & {
707
707
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
708
708
  };
709
+ export declare const getNearestContentCluster: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>) => ExcalidrawElement[];
709
710
  export declare const zoomToFitBounds: ({ bounds, appState, canvasOffsets, fitToViewport, viewportZoomFactor, minZoom, maxZoom, }: {
710
711
  bounds: SceneBounds;
711
712
  canvasOffsets?: Offsets;
@@ -1580,6 +1581,182 @@ export declare const actionZoomToFit: {
1580
1581
  } & {
1581
1582
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
1582
1583
  };
1584
+ export declare const actionScrollBackToContent: {
1585
+ name: "scrollBackToContent";
1586
+ label: string;
1587
+ icon: import("react/jsx-runtime").JSX.Element;
1588
+ viewMode: true;
1589
+ trackEvent: {
1590
+ category: "canvas";
1591
+ };
1592
+ perform: (elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, _: unknown, app: import("../types").AppClassProperties) => false | {
1593
+ appState: {
1594
+ scrollX: number;
1595
+ scrollY: number;
1596
+ zoom: {
1597
+ value: import("../types").NormalizedZoomValue;
1598
+ };
1599
+ contextMenu: {
1600
+ items: import("../components/ContextMenu").ContextMenuItems;
1601
+ top: number;
1602
+ left: number;
1603
+ } | null;
1604
+ showWelcomeScreen: boolean;
1605
+ isLoading: boolean;
1606
+ errorMessage: React.ReactNode;
1607
+ activeEmbeddable: {
1608
+ element: import("@orangecatai/element/types").NonDeletedExcalidrawElement;
1609
+ state: "hover" | "active";
1610
+ } | null;
1611
+ newElement: import("@orangecatai/element/types").NonDeleted<import("@orangecatai/element/types").ExcalidrawNonSelectionElement> | null;
1612
+ resizingElement: import("@orangecatai/element/types").NonDeletedExcalidrawElement | null;
1613
+ multiElement: import("@orangecatai/element/types").NonDeleted<import("@orangecatai/element/types").ExcalidrawLinearElement> | null;
1614
+ selectionElement: import("@orangecatai/element/types").NonDeletedExcalidrawElement | null;
1615
+ isBindingEnabled: boolean;
1616
+ startBoundElement: import("@orangecatai/element/types").NonDeleted<import("@orangecatai/element/types").ExcalidrawBindableElement> | null;
1617
+ suggestedBinding: {
1618
+ element: import("@orangecatai/element/types").NonDeleted<import("@orangecatai/element/types").ExcalidrawBindableElement>;
1619
+ midPoint?: import("@orangecatai/math").GlobalPoint;
1620
+ } | null;
1621
+ frameToHighlight: import("@orangecatai/element/types").NonDeleted<import("@orangecatai/element/types").ExcalidrawFrameLikeElement> | null;
1622
+ frameRendering: {
1623
+ enabled: boolean;
1624
+ name: boolean;
1625
+ outline: boolean;
1626
+ clip: boolean;
1627
+ };
1628
+ editingFrame: string | null;
1629
+ elementsToHighlight: import("@orangecatai/element/types").NonDeleted<ExcalidrawElement>[] | null;
1630
+ editingTextElement: import("@orangecatai/element/types").NonDeletedExcalidrawElement | null;
1631
+ activeTool: {
1632
+ lastActiveTool: import("../types").ActiveTool | null;
1633
+ locked: boolean;
1634
+ fromSelection: boolean;
1635
+ } & import("../types").ActiveTool;
1636
+ preferredSelectionTool: {
1637
+ type: "selection" | "lasso";
1638
+ initialized: boolean;
1639
+ };
1640
+ penMode: boolean;
1641
+ penDetected: boolean;
1642
+ exportBackground: boolean;
1643
+ exportEmbedScene: boolean;
1644
+ exportWithDarkMode: boolean;
1645
+ exportScale: number;
1646
+ currentItemStrokeColor: string;
1647
+ currentItemBackgroundColor: string;
1648
+ currentItemFillStyle: ExcalidrawElement["fillStyle"];
1649
+ currentItemStrokeWidth: number;
1650
+ currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
1651
+ currentItemRoughness: number;
1652
+ currentItemOpacity: number;
1653
+ currentItemFontFamily: import("@orangecatai/element/types").FontFamilyValues;
1654
+ currentItemFontSize: number;
1655
+ currentItemTextAlign: import("@orangecatai/element/types").TextAlign;
1656
+ currentItemStartArrowhead: import("@orangecatai/element/types").Arrowhead | null;
1657
+ currentItemEndArrowhead: import("@orangecatai/element/types").Arrowhead | null;
1658
+ currentHoveredFontFamily: import("@orangecatai/element/types").FontFamilyValues | null;
1659
+ currentItemRoundness: import("@orangecatai/element/types").StrokeRoundness;
1660
+ currentItemArrowType: "sharp" | "round" | "elbow";
1661
+ viewBackgroundColor: string;
1662
+ cursorButton: "up" | "down";
1663
+ scrolledOutside: boolean;
1664
+ name: string | null;
1665
+ isResizing: boolean;
1666
+ isRotating: boolean;
1667
+ openMenu: "canvas" | null;
1668
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
1669
+ openSidebar: {
1670
+ name: import("../types").SidebarName;
1671
+ tab?: import("../types").SidebarTabName;
1672
+ } | null;
1673
+ openDialog: null | {
1674
+ name: "imageExport" | "help" | "jsonExport";
1675
+ } | {
1676
+ name: "ttd";
1677
+ tab: "text-to-diagram" | "mermaid";
1678
+ } | {
1679
+ name: "commandPalette";
1680
+ } | {
1681
+ name: "settings";
1682
+ } | {
1683
+ name: "elementLinkSelector";
1684
+ sourceElementId: ExcalidrawElement["id"];
1685
+ };
1686
+ defaultSidebarDockedPreference: boolean;
1687
+ lastPointerDownWith: import("@orangecatai/element/types").PointerType;
1688
+ selectedElementIds: Readonly<{
1689
+ [id: string]: true;
1690
+ }>;
1691
+ hoveredElementIds: Readonly<{
1692
+ [id: string]: true;
1693
+ }>;
1694
+ previousSelectedElementIds: {
1695
+ [id: string]: true;
1696
+ };
1697
+ selectedElementsAreBeingDragged: boolean;
1698
+ shouldCacheIgnoreZoom: boolean;
1699
+ toast: {
1700
+ message: string;
1701
+ closable?: boolean;
1702
+ duration?: number;
1703
+ } | null;
1704
+ zenModeEnabled: boolean;
1705
+ theme: import("@orangecatai/element/types").Theme;
1706
+ gridSize: number;
1707
+ gridStep: number;
1708
+ gridModeEnabled: boolean;
1709
+ viewModeEnabled: boolean;
1710
+ selectedGroupIds: {
1711
+ [groupId: string]: boolean;
1712
+ };
1713
+ editingGroupId: import("@orangecatai/element/types").GroupId | null;
1714
+ width: number;
1715
+ height: number;
1716
+ offsetTop: number;
1717
+ offsetLeft: number;
1718
+ fileHandle: import("browser-fs-access").FileSystemHandle | null;
1719
+ collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
1720
+ stats: {
1721
+ open: boolean;
1722
+ panels: number;
1723
+ };
1724
+ currentChartType: import("@orangecatai/element/types").ChartType;
1725
+ pasteDialog: {
1726
+ shown: false;
1727
+ data: null;
1728
+ } | {
1729
+ shown: true;
1730
+ data: import("../charts").Spreadsheet;
1731
+ };
1732
+ showHyperlinkPopup: false | "info" | "editor";
1733
+ selectedLinearElement: import("@orangecatai/element").LinearElementEditor | null;
1734
+ snapLines: readonly import("../snapping").SnapLine[];
1735
+ originSnapOffset: {
1736
+ x: number;
1737
+ y: number;
1738
+ } | null;
1739
+ objectsSnapModeEnabled: boolean;
1740
+ userToFollow: import("../types").UserToFollow | null;
1741
+ followedBy: Set<import("../types").SocketId>;
1742
+ isCropping: boolean;
1743
+ croppingElementId: ExcalidrawElement["id"] | null;
1744
+ searchMatches: Readonly<{
1745
+ focusedId: ExcalidrawElement["id"] | null;
1746
+ matches: readonly import("../types").SearchMatch[];
1747
+ }> | null;
1748
+ activeLockedId: string | null;
1749
+ lockedMultiSelections: {
1750
+ [groupId: string]: true;
1751
+ };
1752
+ bindMode: import("@orangecatai/element/types").BindMode;
1753
+ };
1754
+ captureUpdate: "EVENTUALLY";
1755
+ };
1756
+ PanelComponent: ({ updateData }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
1757
+ } & {
1758
+ keyTest?: undefined;
1759
+ };
1583
1760
  export declare const actionToggleTheme: import("./types").Action<import("@orangecatai/element/types").Theme> & {
1584
1761
  keyTest?: ((event: React.KeyboardEvent | KeyboardEvent, appState: AppState, elements: readonly ExcalidrawElement[], app: import("../types").AppClassProperties) => boolean) | undefined;
1585
1762
  };
@@ -1,5 +1,5 @@
1
1
  export declare const actionCopy: import("./types").Action<ClipboardEvent | null> & {
2
- keyTest?: ((event: React.KeyboardEvent | KeyboardEvent, appState: import("../types").AppState, elements: readonly import("@orangecatai/element/types").ExcalidrawElement[], app: import("../types").AppClassProperties) => boolean) | undefined;
2
+ keyTest?: ((event: React.KeyboardEvent | KeyboardEvent, appState: import("..").AppState, elements: readonly import("@orangecatai/element/types").ExcalidrawElement[], app: import("../types").AppClassProperties) => boolean) | undefined;
3
3
  };
4
4
  export declare const actionPaste: {
5
5
  name: "paste";
@@ -7,7 +7,7 @@ export declare const actionPaste: {
7
7
  trackEvent: {
8
8
  category: "element";
9
9
  };
10
- perform: (elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, data: unknown, app: import("../types").AppClassProperties) => Promise<false | {
10
+ perform: (elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[], appState: Readonly<import("..").AppState>, data: unknown, app: import("../types").AppClassProperties) => Promise<false | {
11
11
  captureUpdate: "EVENTUALLY";
12
12
  appState: {
13
13
  errorMessage: string;
@@ -177,7 +177,7 @@ export declare const actionPaste: {
177
177
  keyTest?: undefined;
178
178
  };
179
179
  export declare const actionCut: import("./types").Action<ClipboardEvent | null> & {
180
- keyTest?: ((event: React.KeyboardEvent | KeyboardEvent, appState: import("../types").AppState, elements: readonly import("@orangecatai/element/types").ExcalidrawElement[], app: import("../types").AppClassProperties) => boolean) | undefined;
180
+ keyTest?: ((event: React.KeyboardEvent | KeyboardEvent, appState: import("..").AppState, elements: readonly import("@orangecatai/element/types").ExcalidrawElement[], app: import("../types").AppClassProperties) => boolean) | undefined;
181
181
  };
182
182
  export declare const actionCopyAsSvg: {
183
183
  name: "copyAsSvg";
@@ -186,7 +186,7 @@ export declare const actionCopyAsSvg: {
186
186
  trackEvent: {
187
187
  category: "element";
188
188
  };
189
- perform: (elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, _data: unknown, app: import("../types").AppClassProperties) => Promise<{
189
+ perform: (elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[], appState: Readonly<import("..").AppState>, _data: unknown, app: import("../types").AppClassProperties) => Promise<{
190
190
  captureUpdate: "EVENTUALLY";
191
191
  appState?: undefined;
192
192
  } | {
@@ -216,7 +216,7 @@ export declare const actionCopyAsPng: {
216
216
  trackEvent: {
217
217
  category: "element";
218
218
  };
219
- perform: (elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, _data: unknown, app: import("../types").AppClassProperties) => Promise<{
219
+ perform: (elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[], appState: Readonly<import("..").AppState>, _data: unknown, app: import("../types").AppClassProperties) => Promise<{
220
220
  captureUpdate: "EVENTUALLY";
221
221
  appState?: undefined;
222
222
  } | {
@@ -393,10 +393,10 @@ export declare const copyText: {
393
393
  trackEvent: {
394
394
  category: "element";
395
395
  };
396
- perform: (elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, _: unknown, app: import("../types").AppClassProperties) => {
396
+ perform: (elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[], appState: Readonly<import("..").AppState>, _: unknown, app: import("../types").AppClassProperties) => {
397
397
  captureUpdate: "EVENTUALLY";
398
398
  };
399
- predicate: (elements: readonly import("@orangecatai/element/types").ExcalidrawElement[], appState: import("../types").AppState, _: import("../types").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
399
+ predicate: (elements: readonly import("@orangecatai/element/types").ExcalidrawElement[], appState: import("..").AppState, _: import("..").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
400
400
  keywords: string[];
401
401
  } & {
402
402
  keyTest?: undefined;
@@ -7,7 +7,7 @@ export declare const actionToggleCropEditor: {
7
7
  category: "menu";
8
8
  };
9
9
  keywords: string[];
10
- perform(elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, _: unknown, app: import("../types").AppClassProperties): {
10
+ perform(elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[], appState: Readonly<import("..").AppState>, _: unknown, app: import("../types").AppClassProperties): {
11
11
  appState: {
12
12
  isCropping: false;
13
13
  croppingElementId: string;
@@ -169,7 +169,7 @@ export declare const actionToggleCropEditor: {
169
169
  };
170
170
  captureUpdate: "IMMEDIATELY";
171
171
  };
172
- predicate: (elements: readonly import("@orangecatai/element/types").ExcalidrawElement[], appState: import("../types").AppState, _: import("../types").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
172
+ predicate: (elements: readonly import("@orangecatai/element/types").ExcalidrawElement[], appState: import("..").AppState, _: import("..").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
173
173
  PanelComponent: ({ appState, updateData, app }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
174
174
  } & {
175
175
  keyTest?: undefined;
@@ -5,9 +5,9 @@ export declare const actionDuplicateSelection: {
5
5
  trackEvent: {
6
6
  category: "element";
7
7
  };
8
- perform: (elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, formData: unknown, app: import("../types").AppClassProperties) => false | {
8
+ perform: (elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[], appState: Readonly<import("..").AppState>, formData: unknown, app: import("../types").AppClassProperties) => false | {
9
9
  elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[];
10
- appState: import("../types").AppState;
10
+ appState: import("..").AppState;
11
11
  captureUpdate: "IMMEDIATELY";
12
12
  };
13
13
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
@@ -5,7 +5,7 @@ export declare const actionCopyElementLink: {
5
5
  trackEvent: {
6
6
  category: "element";
7
7
  };
8
- perform: (elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, _: unknown, app: import("../types").AppClassProperties) => Promise<{
8
+ perform: (elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[], appState: Readonly<import("..").AppState>, _: unknown, app: import("../types").AppClassProperties) => Promise<{
9
9
  appState: {
10
10
  toast: {
11
11
  message: string;
@@ -16,12 +16,12 @@ export declare const actionCopyElementLink: {
16
16
  elements?: undefined;
17
17
  app?: undefined;
18
18
  } | {
19
- appState: Readonly<import("../types").AppState>;
19
+ appState: Readonly<import("..").AppState>;
20
20
  elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[];
21
21
  app: import("../types").AppClassProperties;
22
22
  captureUpdate: "EVENTUALLY";
23
23
  }>;
24
- predicate: (elements: readonly import("@orangecatai/element/types").ExcalidrawElement[], appState: import("../types").AppState) => boolean;
24
+ predicate: (elements: readonly import("@orangecatai/element/types").ExcalidrawElement[], appState: import("..").AppState) => boolean;
25
25
  } & {
26
26
  keyTest?: undefined;
27
27
  };
@@ -29,9 +29,9 @@ export declare const actionLinkToElement: {
29
29
  name: "linkToElement";
30
30
  label: string;
31
31
  icon: import("react/jsx-runtime").JSX.Element;
32
- perform: (elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, _: unknown, app: import("../types").AppClassProperties) => {
32
+ perform: (elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[], appState: Readonly<import("..").AppState>, _: unknown, app: import("../types").AppClassProperties) => {
33
33
  elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[];
34
- appState: Readonly<import("../types").AppState>;
34
+ appState: Readonly<import("..").AppState>;
35
35
  app: import("../types").AppClassProperties;
36
36
  captureUpdate: "EVENTUALLY";
37
37
  } | {
@@ -189,7 +189,7 @@ export declare const actionLinkToElement: {
189
189
  elements?: undefined;
190
190
  app?: undefined;
191
191
  };
192
- predicate: (elements: readonly import("@orangecatai/element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
192
+ predicate: (elements: readonly import("@orangecatai/element/types").ExcalidrawElement[], appState: import("..").AppState, appProps: import("..").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
193
193
  trackEvent: false;
194
194
  } & {
195
195
  keyTest?: undefined;
@@ -5,7 +5,7 @@ export declare const actionSetEmbeddableAsActiveTool: {
5
5
  };
6
6
  target: string;
7
7
  label: string;
8
- perform: (elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, _: unknown, app: import("../types").AppClassProperties) => {
8
+ perform: (elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[], appState: Readonly<import("..").AppState>, _: unknown, app: import("../types").AppClassProperties) => {
9
9
  elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[];
10
10
  appState: {
11
11
  activeTool: {