@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
@@ -1 +1 @@
1
- import{a,b,c,d}from"./chunk-Z5NKEFVG.js";import"./chunk-TDN63PPO.js";import"./chunk-SRAX5OIU.js";export{a as Commands,b as subsetToBase64,c as subsetToBinary,d as toBase64};
1
+ import{a,b,c,d}from"./chunk-Z5NKEFVG.js";import"./chunk-O3WJMHIE.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-TDN63PPO.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};
1
+ import{a as r,c as t}from"./chunk-Z5NKEFVG.js";import"./chunk-O3WJMHIE.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};
@@ -1,6 +1,6 @@
1
1
  import { type GlobalPoint } from "@orangecatai/math";
2
- import type { AppState, NullableGridSize } from "@orangecatai/adgen-canvas/types";
3
2
  import { LinearElementEditor } from "../linearElementEditor";
3
+ import type { AppState, NullableGridSize } from "@orangecatai/adgen-canvas/types";
4
4
  import type { ElementsMap, ExcalidrawArrowElement, ExcalidrawBindableElement, NonDeletedSceneElementsMap } from "../types";
5
5
  import type { Scene } from "../Scene";
6
6
  export declare const isFocusPointVisible: (focusPoint: GlobalPoint, arrow: ExcalidrawArrowElement, bindableElement: ExcalidrawBindableElement, elementsMap: ElementsMap, appState: {
@@ -1,8 +1,8 @@
1
1
  import { type GlobalPoint } from "@orangecatai/math";
2
- import type { LineSegment, LocalPoint } from "@orangecatai/math";
3
- import type { AppState } from "@orangecatai/adgen-canvas/types";
4
- import type { Bounds } from "@orangecatai/common";
5
2
  import { type Heading } from "./heading";
3
+ import type { Bounds } from "@orangecatai/common";
4
+ import type { AppState } from "@orangecatai/adgen-canvas/types";
5
+ import type { LineSegment, LocalPoint } from "@orangecatai/math";
6
6
  import type { Scene } from "./Scene";
7
7
  import type { ElementUpdate } from "./mutateElement";
8
8
  import type { BindMode, ElementsMap, ExcalidrawArrowElement, ExcalidrawBindableElement, ExcalidrawElbowArrowElement, ExcalidrawElement, FixedPoint, FixedPointBinding, NonDeleted, NonDeletedExcalidrawElement, NonDeletedSceneElementsMap, Ordered, PointsPositionUpdates } from "./types";
@@ -1,6 +1,6 @@
1
1
  import { type Bounds } from "@orangecatai/common";
2
- import type { Degrees, GlobalPoint, LineSegment, LocalPoint } from "@orangecatai/math";
3
2
  import type { AppState } from "@orangecatai/adgen-canvas/types";
3
+ import type { Degrees, GlobalPoint, LineSegment, LocalPoint } from "@orangecatai/math";
4
4
  import type { Drawable, Op } from "roughjs/bin/core";
5
5
  import type { Arrowhead, ElementsMap, ElementsMapOrArray, ExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawLinearElement, NonDeleted } from "./types";
6
6
  export type RectangleBox = {
@@ -1,5 +1,5 @@
1
- import type { GlobalPoint, LineSegment } from "@orangecatai/math";
2
1
  import type { FrameNameBounds } from "@orangecatai/adgen-canvas/types";
2
+ import type { GlobalPoint, LineSegment } from "@orangecatai/math";
3
3
  import type { ElementsMap, ExcalidrawArrowElement, ExcalidrawBindableElement, ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement, NonDeletedSceneElementsMap, Ordered } from "./types";
4
4
  export declare const shouldTestInside: (element: ExcalidrawElement) => boolean;
5
5
  export type HitTestArgs = {
@@ -1,7 +1,7 @@
1
- import type { ExcalidrawElement, Ordered, OrderedExcalidrawElement, SceneElementsMap } from "@orangecatai/element/types";
1
+ import { StoreSnapshot } from "./store";
2
2
  import type { DTO, ValueOf } from "@orangecatai/common/utility-types";
3
3
  import type { AppState, ObservedAppState } from "@orangecatai/adgen-canvas/types";
4
- import { StoreSnapshot } from "./store";
4
+ import type { ExcalidrawElement, Ordered, OrderedExcalidrawElement, SceneElementsMap } from "@orangecatai/element/types";
5
5
  /**
6
6
  * Represents the difference between two objects of the same type.
7
7
  *
@@ -1,5 +1,5 @@
1
- import type { AppState, NormalizedZoomValue, NullableGridSize, PointerDownState } from "@orangecatai/adgen-canvas/types";
2
1
  import type { NonDeletedExcalidrawElement } from "@orangecatai/element/types";
2
+ import type { AppState, NormalizedZoomValue, NullableGridSize, PointerDownState } from "@orangecatai/adgen-canvas/types";
3
3
  import type { Scene } from "./Scene";
4
4
  export declare const dragSelectedElements: (pointerDownState: PointerDownState, _selectedElements: NonDeletedExcalidrawElement[], offset: {
5
5
  x: number;
@@ -1,5 +1,5 @@
1
- import type { Mutable } from "@orangecatai/common/utility-types";
2
1
  import type { AppState } from "@orangecatai/adgen-canvas/types";
2
+ import type { Mutable } from "@orangecatai/common/utility-types";
3
3
  import type { ExcalidrawElement, GroupId } from "./types";
4
4
  /**
5
5
  * Duplicate an element, often used in the alt-drag operation.
@@ -1,5 +1,5 @@
1
- import type { ExcalidrawProps } from "@orangecatai/adgen-canvas/types";
2
1
  import type { MarkRequired } from "@orangecatai/common/utility-types";
2
+ import type { ExcalidrawProps } from "@orangecatai/adgen-canvas/types";
3
3
  import type { ExcalidrawElement, ExcalidrawIframeLikeElement, IframeData } from "./types";
4
4
  type IframeDataWithSandbox = MarkRequired<IframeData, "sandbox">;
5
5
  export declare const createSrcDoc: (body: string) => string;
@@ -1,5 +1,5 @@
1
- import type { AppState, PendingExcalidrawElements } from "@orangecatai/adgen-canvas/types";
2
1
  import { type ElementsMap, type ExcalidrawBindableElement, type ExcalidrawElement, type ExcalidrawFlowchartNodeElement } from "./types";
2
+ import type { AppState, PendingExcalidrawElements } from "@orangecatai/adgen-canvas/types";
3
3
  import type { Scene } from "./Scene";
4
4
  type LinkDirection = "up" | "right" | "down" | "left";
5
5
  export declare const getLinkDirectionFromKey: (key: string) => LinkDirection;
@@ -1,5 +1,5 @@
1
- import type { AppClassProperties, AppState, StaticCanvasAppState } from "@orangecatai/adgen-canvas/types";
2
1
  import type { ReadonlySetLike } from "@orangecatai/common/utility-types";
2
+ import type { AppClassProperties, AppState, StaticCanvasAppState } from "@orangecatai/adgen-canvas/types";
3
3
  import type { ExcalidrawElementsIncludingDeleted } from "./Scene";
4
4
  import type { ElementsMap, ElementsMapOrArray, ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeleted, NonDeletedExcalidrawElement } from "./types";
5
5
  export declare const bindElementsToFramesAfterDuplication: (nextElements: readonly ExcalidrawElement[], origElements: readonly ExcalidrawElement[], origIdToDuplicateId: Map<ExcalidrawElement["id"], ExcalidrawElement["id"]>) => void;
@@ -1,5 +1,5 @@
1
- import type { AppClassProperties, AppState, InteractiveCanvasAppState } from "@orangecatai/adgen-canvas/types";
2
1
  import type { Mutable } from "@orangecatai/common/utility-types";
2
+ import type { AppClassProperties, AppState, InteractiveCanvasAppState } from "@orangecatai/adgen-canvas/types";
3
3
  import type { GroupId, ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement, ElementsMapOrArray, ElementsMap } from "./types";
4
4
  export declare const selectGroup: (groupId: GroupId, appState: InteractiveCanvasAppState, elements: readonly NonDeleted<ExcalidrawElement>[]) => Pick<InteractiveCanvasAppState, "selectedGroupIds" | "selectedElementIds" | "editingGroupId">;
5
5
  export declare const selectGroupsForSelectedElements: {
@@ -1,6 +1,6 @@
1
1
  import { type GlobalPoint } from "@orangecatai/math";
2
- import type { AppState, StaticCanvasAppState, InteractiveCanvasAppState, ElementsPendingErasure, PendingExcalidrawElements } from "@orangecatai/adgen-canvas/types";
3
2
  import type { StaticCanvasRenderConfig, RenderableElementsMap, InteractiveCanvasRenderConfig } from "@orangecatai/adgen-canvas/scene/types";
3
+ import type { AppState, StaticCanvasAppState, InteractiveCanvasAppState, ElementsPendingErasure, PendingExcalidrawElements } from "@orangecatai/adgen-canvas/types";
4
4
  import type { ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawImageElement, ExcalidrawFrameLikeElement, NonDeletedSceneElementsMap, ElementsMap } from "./types";
5
5
  import type { RoughCanvas } from "roughjs/bin/canvas";
6
6
  export declare const getRenderOpacity: (element: ExcalidrawElement, containingFrame: ExcalidrawFrameLikeElement | null, elementsPendingErasure: ElementsPendingErasure, pendingNodes: Readonly<PendingExcalidrawElements> | null, globalAlpha?: number) => number;
@@ -1,5 +1,5 @@
1
- import type { AppState, InteractiveCanvasAppState } from "@orangecatai/adgen-canvas/types";
2
1
  import { LinearElementEditor } from "./linearElementEditor";
2
+ import type { AppState, InteractiveCanvasAppState } from "@orangecatai/adgen-canvas/types";
3
3
  import type { ElementsMap, ElementsMapOrArray, ExcalidrawElement, NonDeletedExcalidrawElement } from "./types";
4
4
  /**
5
5
  * Frames and their containing elements are not to be selected at the same time.
@@ -1,8 +1,8 @@
1
1
  import { type GeometricShape } from "@orangecatai/utils/shape";
2
2
  import { type LocalPoint } from "@orangecatai/math";
3
- import type { GlobalPoint } from "@orangecatai/math";
4
- import type { AppState, EmbedsValidationStatus } from "@orangecatai/adgen-canvas/types";
5
3
  import type { ElementShape, ElementShapes } from "@orangecatai/adgen-canvas/scene/types";
4
+ import type { AppState, EmbedsValidationStatus } from "@orangecatai/adgen-canvas/types";
5
+ import type { GlobalPoint } from "@orangecatai/math";
6
6
  import type { ExcalidrawElement, ExcalidrawSelectionElement, ExcalidrawLinearElement, ExcalidrawFreeDrawElement, ElementsMap, ExcalidrawLineElement } from "./types";
7
7
  import type { Drawable, Options } from "roughjs/bin/core";
8
8
  export declare class ShapeCache {
@@ -1,8 +1,8 @@
1
1
  import { Emitter } from "@orangecatai/common";
2
- import type App from "@orangecatai/adgen-canvas/components/App";
2
+ import { ElementsDelta, AppStateDelta } from "./delta";
3
3
  import type { DTO, ValueOf } from "@orangecatai/common/utility-types";
4
4
  import type { AppState, ObservedAppState } from "@orangecatai/adgen-canvas/types";
5
- import { ElementsDelta, AppStateDelta } from "./delta";
5
+ import type App from "@orangecatai/adgen-canvas/components/App";
6
6
  import type { ApplyToOptions } from "./delta";
7
7
  import type { ExcalidrawElement, OrderedExcalidrawElement, SceneElementsMap } from "./types";
8
8
  export declare const CaptureUpdateAction: {
@@ -1,6 +1,6 @@
1
1
  import { type Radians } from "@orangecatai/math";
2
- import type { AppState } from "@orangecatai/adgen-canvas/types";
3
2
  import type { ExtractSetType } from "@orangecatai/common/utility-types";
3
+ import type { AppState } from "@orangecatai/adgen-canvas/types";
4
4
  import type { Scene } from "./Scene";
5
5
  import type { MaybeTransformHandleType } from "./transformHandles";
6
6
  import type { ElementsMap, ExcalidrawElement, ExcalidrawElementType, ExcalidrawTextContainer, ExcalidrawTextElement, ExcalidrawTextElementWithContainer, NonDeletedExcalidrawElement } from "./types";
@@ -1,5 +1,5 @@
1
- import type { MarkOptional } from "@orangecatai/common/utility-types";
2
1
  import { type ElementConstructorOpts } from "./newElement";
2
+ import type { MarkOptional } from "@orangecatai/common/utility-types";
3
3
  import type { ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawFrameElement, ExcalidrawFreeDrawElement, ExcalidrawGenericElement, ExcalidrawIframeLikeElement, ExcalidrawImageElement, ExcalidrawLinearElement, ExcalidrawMagicFrameElement, ExcalidrawSelectionElement, ExcalidrawTextElement, FileId, FontFamilyValues, TextAlign, VerticalAlign } from "./types";
4
4
  export type ValidLinearElement = {
5
5
  type: "arrow" | "line";
@@ -1,6 +1,6 @@
1
1
  import { type GlobalPoint } from "@orangecatai/math";
2
- import type { Curve, LineSegment } from "@orangecatai/math";
3
2
  import type { AppState, Zoom } from "@orangecatai/adgen-canvas/types";
3
+ import type { Curve, LineSegment } from "@orangecatai/math";
4
4
  import type { ElementsMap, ExcalidrawArrowElement, ExcalidrawBindableElement, ExcalidrawDiamondElement, ExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawLinearElement, ExcalidrawRectanguloidElement } from "./types";
5
5
  /**
6
6
  * Returns the **rotated** components of freedraw, line or arrow elements.
@@ -1,5 +1,5 @@
1
- import type { AppState } from "@orangecatai/adgen-canvas/types";
2
1
  import type { GlobalPoint } from "@orangecatai/math";
2
+ import type { AppState } from "@orangecatai/adgen-canvas/types";
3
3
  import type { Scene } from "./Scene";
4
4
  import type { ExcalidrawArrowElement, ExcalidrawElement, NonDeletedExcalidrawElement, NonDeletedSceneElementsMap, Ordered, OrderedExcalidrawElement } from "./types";
5
5
  /**
@@ -40,13 +40,6 @@ export declare const actionClearCanvas: {
40
40
  locked: boolean;
41
41
  fromSelection: boolean;
42
42
  } & import("../types").ActiveTool;
43
- viewBackgroundColor: string;
44
- frameRendering: {
45
- enabled: boolean;
46
- name: boolean;
47
- outline: boolean;
48
- clip: boolean;
49
- };
50
43
  name: string | null;
51
44
  zoom: import("../types").Zoom;
52
45
  scrollX: number;
@@ -102,6 +95,12 @@ export declare const actionClearCanvas: {
102
95
  hoveredElementIds: Readonly<{
103
96
  [id: string]: true;
104
97
  }>;
98
+ frameRendering: {
99
+ enabled: boolean;
100
+ name: boolean;
101
+ outline: boolean;
102
+ clip: boolean;
103
+ };
105
104
  shouldCacheIgnoreZoom: boolean;
106
105
  exportScale: number;
107
106
  currentItemArrowType: "sharp" | "round" | "elbow";
@@ -136,6 +135,7 @@ export declare const actionClearCanvas: {
136
135
  currentItemEndArrowhead: import("@orangecatai/element/types").Arrowhead | null;
137
136
  currentHoveredFontFamily: import("@orangecatai/element/types").FontFamilyValues | null;
138
137
  currentItemRoundness: import("@orangecatai/element/types").StrokeRoundness;
138
+ viewBackgroundColor: string;
139
139
  cursorButton: "up" | "down";
140
140
  scrolledOutside: boolean;
141
141
  isResizing: boolean;
@@ -1,5 +1,5 @@
1
- import type { Theme } from "@orangecatai/element/types";
2
1
  import "../components/ToolIcon.scss";
2
+ import type { Theme } from "@orangecatai/element/types";
3
3
  import type { AppState } from "../types";
4
4
  export declare const actionChangeProjectName: import("./types").Action<string | null> & {
5
5
  keyTest?: ((event: React.KeyboardEvent | KeyboardEvent, appState: AppState, elements: readonly import("@orangecatai/element/types").ExcalidrawElement[], app: import("../types").AppClassProperties) => boolean) | undefined;
@@ -362,14 +362,6 @@ export declare const actionLoadScene: {
362
362
  perform: (elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, _: unknown, app: import("../types").AppClassProperties) => Promise<false | {
363
363
  elements: import("@orangecatai/element/types").OrderedExcalidrawElement[];
364
364
  appState: {
365
- viewBackgroundColor: string;
366
- theme: Theme;
367
- frameRendering: {
368
- enabled: boolean;
369
- name: boolean;
370
- outline: boolean;
371
- clip: boolean;
372
- };
373
365
  name: string | null;
374
366
  zoom: import("../types").Zoom;
375
367
  scrollX: number;
@@ -393,6 +385,7 @@ export declare const actionLoadScene: {
393
385
  [id: string]: true;
394
386
  }>;
395
387
  frameToHighlight: import("@orangecatai/element/types").NonDeleted<import("@orangecatai/element/types").ExcalidrawFrameLikeElement> | null;
388
+ theme: Theme;
396
389
  activeTool: {
397
390
  lastActiveTool: import("../types").ActiveTool | null;
398
391
  locked: boolean;
@@ -430,6 +423,12 @@ export declare const actionLoadScene: {
430
423
  hoveredElementIds: Readonly<{
431
424
  [id: string]: true;
432
425
  }>;
426
+ frameRendering: {
427
+ enabled: boolean;
428
+ name: boolean;
429
+ outline: boolean;
430
+ clip: boolean;
431
+ };
433
432
  shouldCacheIgnoreZoom: boolean;
434
433
  exportScale: number;
435
434
  currentItemArrowType: "sharp" | "round" | "elbow";
@@ -469,6 +468,7 @@ export declare const actionLoadScene: {
469
468
  currentItemEndArrowhead: import("@orangecatai/element/types").Arrowhead | null;
470
469
  currentHoveredFontFamily: import("@orangecatai/element/types").FontFamilyValues | null;
471
470
  currentItemRoundness: import("@orangecatai/element/types").StrokeRoundness;
471
+ viewBackgroundColor: string;
472
472
  cursorButton: "up" | "down";
473
473
  scrolledOutside: boolean;
474
474
  isResizing: boolean;
@@ -6,7 +6,7 @@ export declare const getFormValue: <T extends Primitive>(elements: readonly Exca
6
6
  export declare const actionChangeStrokeColor: import("./types").Action<Pick<AppState, "currentItemStrokeColor">> & {
7
7
  keyTest?: ((event: React.KeyboardEvent | KeyboardEvent, appState: AppState, elements: readonly ExcalidrawElement[], app: AppClassProperties) => boolean) | undefined;
8
8
  };
9
- export declare const actionChangeBackgroundColor: import("./types").Action<Pick<AppState, "viewBackgroundColor" | "currentItemBackgroundColor">> & {
9
+ export declare const actionChangeBackgroundColor: import("./types").Action<Pick<AppState, "currentItemBackgroundColor" | "viewBackgroundColor">> & {
10
10
  keyTest?: ((event: React.KeyboardEvent | KeyboardEvent, appState: AppState, elements: readonly ExcalidrawElement[], app: AppClassProperties) => boolean) | undefined;
11
11
  };
12
12
  export declare const actionChangeFillStyle: import("./types").Action<import("@orangecatai/element/types").FillStyle> & {
@@ -1,8 +1,6 @@
1
1
  import type { AppState, NormalizedZoomValue } from "./types";
2
2
  export declare const getDefaultAppState: () => Omit<AppState, "offsetTop" | "offsetLeft" | "width" | "height">;
3
3
  export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>) => {
4
- viewBackgroundColor?: string | undefined;
5
- theme?: import("@orangecatai/element/types").Theme | undefined;
6
4
  name?: string | null | undefined;
7
5
  zoom?: Readonly<{
8
6
  value: NormalizedZoomValue;
@@ -13,6 +11,7 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
13
11
  selectedElementIds?: Readonly<{
14
12
  [id: string]: true;
15
13
  }> | undefined;
14
+ theme?: import("@orangecatai/element/types").Theme | undefined;
16
15
  activeTool?: ({
17
16
  lastActiveTool: import("./types").ActiveTool | null;
18
17
  locked: boolean;
@@ -51,6 +50,7 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
51
50
  currentItemStartArrowhead?: import("@orangecatai/element/types").Arrowhead | null | undefined;
52
51
  currentItemEndArrowhead?: import("@orangecatai/element/types").Arrowhead | null | undefined;
53
52
  currentItemRoundness?: import("@orangecatai/element/types").StrokeRoundness | undefined;
53
+ viewBackgroundColor?: string | undefined;
54
54
  cursorButton?: "up" | "down" | undefined;
55
55
  scrolledOutside?: boolean | undefined;
56
56
  openMenu?: "canvas" | null | undefined;
@@ -76,8 +76,8 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
76
76
  } | undefined;
77
77
  };
78
78
  export declare const cleanAppStateForExport: (appState: Partial<AppState>) => {
79
- viewBackgroundColor?: string | undefined;
80
79
  gridSize?: number | undefined;
80
+ viewBackgroundColor?: string | undefined;
81
81
  gridStep?: number | undefined;
82
82
  gridModeEnabled?: boolean | undefined;
83
83
  lockedMultiSelections?: {
@@ -85,8 +85,8 @@ export declare const cleanAppStateForExport: (appState: Partial<AppState>) => {
85
85
  } | undefined;
86
86
  };
87
87
  export declare const clearAppStateForDatabase: (appState: Partial<AppState>) => {
88
- viewBackgroundColor?: string | undefined;
89
88
  gridSize?: number | undefined;
89
+ viewBackgroundColor?: string | undefined;
90
90
  gridStep?: number | undefined;
91
91
  gridModeEnabled?: boolean | undefined;
92
92
  lockedMultiSelections?: {
@@ -0,0 +1,10 @@
1
+ import type { ExcalidrawImperativeAPI } from "../types";
2
+ import "./AIChatPanel.scss";
3
+ export type AIChatPanelProps = {
4
+ isOpen: boolean;
5
+ onClose: () => void;
6
+ apiKey: string;
7
+ excalidrawAPI?: ExcalidrawImperativeAPI;
8
+ geminiApiKey?: string;
9
+ };
10
+ export declare const AIChatPanel: ({ isOpen, onClose, apiKey, excalidrawAPI, geminiApiKey, }: AIChatPanelProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,5 +1,5 @@
1
- import type { ExcalidrawElement, NonDeletedElementsMap, NonDeletedSceneElementsMap } from "@orangecatai/element/types";
2
1
  import "./Actions.scss";
2
+ import type { ExcalidrawElement, NonDeletedElementsMap, NonDeletedSceneElementsMap } from "@orangecatai/element/types";
3
3
  import type { AppClassProperties, AppProps, UIAppState, Zoom, AppState } from "../types";
4
4
  import type { ActionManager } from "../actions/manager";
5
5
  export declare const canChangeStrokeColor: (appState: UIAppState, targetElements: ExcalidrawElement[]) => boolean;
@@ -1,8 +1,6 @@
1
1
  import React from "react";
2
2
  import { type EXPORT_IMAGE_TYPES, Emitter, type EditorInterface, type StylesPanelMode } from "@orangecatai/common";
3
3
  import { LinearElementEditor, FlowChartCreator, Scene, type ElementUpdate, StoreDelta, type ApplyToOptions } from "@orangecatai/element";
4
- import type { ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement, ExcalidrawFrameLikeElement, ExcalidrawIframeElement, ExcalidrawEmbeddableElement, Ordered, SceneElementsMap } from "@orangecatai/element/types";
5
- import type { Mutable } from "@orangecatai/common/utility-types";
6
4
  import { ActionManager } from "../actions/manager";
7
5
  import { AnimationFrameHandler } from "../animation-frame-handler";
8
6
  import { Fonts } from "../fonts";
@@ -12,6 +10,8 @@ import { LaserTrails } from "../laser-trails";
12
10
  import { isOverScrollBars } from "../scene/scrollbars";
13
11
  import { LassoTrail } from "../lasso";
14
12
  import { EraserTrail } from "../eraser";
13
+ import type { ExcalidrawElement, NonDeleted, ExcalidrawImageElement, NonDeletedExcalidrawElement, ExcalidrawFrameLikeElement, ExcalidrawIframeElement, ExcalidrawEmbeddableElement, Ordered, SceneElementsMap } from "@orangecatai/element/types";
14
+ import type { Mutable } from "@orangecatai/common/utility-types";
15
15
  import type { ExportedElements } from "../data";
16
16
  import type { FileSystemHandle } from "../data/filesystem";
17
17
  import type { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType, OnUserFollowedPayload, GenerateDiagramToCode, NullableGridSize, Offsets } from "../types";
@@ -283,6 +283,17 @@ declare class App extends React.Component<AppProps, AppState> {
283
283
  private onMagicFrameGenerate;
284
284
  private onIframeSrcCopy;
285
285
  onMagicframeToolSelect: () => void;
286
+ onImageGeneratorSelect: () => void;
287
+ /**
288
+ * Inserts a generated image (base64 data URL) into a frame element,
289
+ * sized to fill the frame exactly. Used by the image generator panel.
290
+ */
291
+ insertGeneratedImageIntoFrame: (dataURL: string, frameElement: import("@orangecatai/element/types").ExcalidrawFrameLikeElement & import("@orangecatai/element/types").NonDeletedExcalidrawElement) => Promise<void>;
292
+ /**
293
+ * Inserts a generated image near a source element (≥ 25 px clearance).
294
+ * Tries right → below → left → above; falls back to right if all collide.
295
+ */
296
+ insertGeneratedImageNearElement: (dataURL: string, sourceElement: ExcalidrawImageElement, targetWidth: number, targetHeight: number) => Promise<void>;
286
297
  private openEyeDropper;
287
298
  dismissLinearEditor: () => void;
288
299
  syncActionResult: (actionResult: ActionResult) => void;
@@ -1,6 +1,6 @@
1
- import type { ColorTuple, ColorPaletteCustom } from "@orangecatai/common";
2
- import type { ExcalidrawElement } from "@orangecatai/element/types";
3
1
  import "./ColorPicker.scss";
2
+ import type { ExcalidrawElement } from "@orangecatai/element/types";
3
+ import type { ColorTuple, ColorPaletteCustom } from "@orangecatai/common";
4
4
  import type { ColorPickerType } from "./colorPickerUtils";
5
5
  import type { AppState } from "../../types";
6
6
  interface ColorPickerProps {
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- import type { ExcalidrawElement } from "@orangecatai/element/types";
3
2
  import type { ColorPaletteCustom } from "@orangecatai/common";
3
+ import type { ExcalidrawElement } from "@orangecatai/element/types";
4
4
  import type { ColorPickerType } from "./colorPickerUtils";
5
5
  interface PickerProps {
6
6
  color: string | null;
@@ -1,6 +1,6 @@
1
+ import "./ConvertElementTypePopup.scss";
1
2
  import type { ConvertibleTypes, ExcalidrawElement, ExcalidrawTextContainer, ExcalidrawTextElementWithContainer } from "@orangecatai/element/types";
2
3
  import type { Scene } from "@orangecatai/element";
3
- import "./ConvertElementTypePopup.scss";
4
4
  import type App from "./App";
5
5
  export declare const convertElementTypePopupAtom: import("jotai/vanilla/atom").PrimitiveAtom<{
6
6
  type: "panel";
@@ -1,5 +1,5 @@
1
- import type { MarkOptional } from "@orangecatai/common/utility-types";
2
1
  import "../components/dropdownMenu/DropdownMenu.scss";
2
+ import type { MarkOptional } from "@orangecatai/common/utility-types";
3
3
  import type { SidebarProps, SidebarTriggerProps } from "./Sidebar/common";
4
4
  export declare const DefaultSidebar: import("react").FC<Omit<MarkOptional<Omit<{
5
5
  name: import("../types").SidebarName;
@@ -1,6 +1,6 @@
1
- import type { ExcalidrawElement } from "@orangecatai/element/types";
2
- import type { Scene } from "@orangecatai/element";
3
1
  import "./ElementLinkDialog.scss";
2
+ import type { Scene } from "@orangecatai/element";
3
+ import type { ExcalidrawElement } from "@orangecatai/element/types";
4
4
  import type { AppProps, UIAppState } from "../types";
5
5
  declare const ElementLinkDialog: ({ sourceElementId, onClose, appState, scene, generateLinkForSelection, }: {
6
6
  sourceElementId: ExcalidrawElement["id"];
@@ -1,5 +1,5 @@
1
- import type { ExcalidrawElement } from "@orangecatai/element/types";
2
1
  import "./EyeDropper.scss";
2
+ import type { ExcalidrawElement } from "@orangecatai/element/types";
3
3
  import type { ColorPickerType } from "./ColorPicker/colorPickerUtils";
4
4
  export type EyeDropperProperties = {
5
5
  keepOpenOnAlt: boolean;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- import type { FontFamilyValues } from "@orangecatai/element/types";
3
2
  import "./FontPicker.scss";
3
+ import type { FontFamilyValues } from "@orangecatai/element/types";
4
4
  export declare const DEFAULT_FONTS: {
5
5
  value: number;
6
6
  icon: import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { type FontFamilyValues } from "@orangecatai/element/types";
3
- import type { ValueOf } from "@orangecatai/common/utility-types";
4
3
  import { DropDownMenuItemBadgeType } from "../dropdownMenu/DropdownMenuItem";
4
+ import type { ValueOf } from "@orangecatai/common/utility-types";
5
5
  import type { JSX } from "react";
6
6
  export interface FontDescriptor {
7
7
  value: number;
@@ -1,5 +1,5 @@
1
- import type { Node } from "@orangecatai/common";
2
1
  import { type FontDescriptor } from "./FontPickerList";
2
+ import type { Node } from "@orangecatai/common";
3
3
  interface FontPickerKeyNavHandlerProps {
4
4
  event: React.KeyboardEvent<HTMLDivElement>;
5
5
  inputRef: React.RefObject<HTMLInputElement | null>;
@@ -1,5 +1,5 @@
1
- import type { NonDeletedExcalidrawElement } from "@orangecatai/element/types";
2
1
  import "./ImageExportDialog.scss";
2
+ import type { NonDeletedExcalidrawElement } from "@orangecatai/element/types";
3
3
  import type { ActionManager } from "../actions/manager";
4
4
  import type { AppClassProperties, BinaryFiles, UIAppState } from "../types";
5
5
  export declare const ErrorCanvasPreview: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,38 @@
1
+ import "./ImageGeneratorPanel.scss";
2
+ import type { ExcalidrawFrameLikeElement, NonDeletedExcalidrawElement } from "@orangecatai/element/types";
3
+ import type { AppClassProperties } from "../types";
4
+ export declare const MODEL_CONFIG: {
5
+ readonly "Gemini 2.5 Flash": {
6
+ readonly geminiModelId: "gemini-2.5-flash-image";
7
+ readonly supportsImageSize: false;
8
+ readonly supportsThinking: false;
9
+ readonly supportedResolutions: readonly ["1K"];
10
+ readonly supportedRatios: readonly ["21:9", "16:9", "4:3", "3:2", "1:1", "9:16", "3:4", "2:3", "5:4", "4:5"];
11
+ };
12
+ readonly "Gemini 3.1 Flash": {
13
+ readonly geminiModelId: "gemini-3.1-flash-image-preview";
14
+ readonly supportsImageSize: true;
15
+ readonly supportsThinking: true;
16
+ readonly supportedResolutions: readonly ["0.5K", "1K", "2K", "4K"];
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
+ };
19
+ readonly "Gemini 3 Pro": {
20
+ readonly geminiModelId: "gemini-3-pro-image-preview";
21
+ readonly supportsImageSize: true;
22
+ readonly supportsThinking: false;
23
+ readonly supportedResolutions: readonly ["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"];
25
+ };
26
+ };
27
+ export type ModelName = keyof typeof MODEL_CONFIG;
28
+ export declare const MODEL_NAMES: ModelName[];
29
+ export type Resolution = "0.5K" | "1K" | "2K" | "4K";
30
+ export declare function getDimensions(model: ModelName, ratio: string, resolution: Resolution): {
31
+ width: number;
32
+ height: number;
33
+ };
34
+ export declare function callGeminiAPI(prompt: string, modelId: string, aspectRatio: string, resolution: Resolution, supportsImageSize: boolean, supportsThinking: boolean, apiKey: string, referenceImageDataUrl?: string, signal?: AbortSignal): Promise<string>;
35
+ export declare const ImageGeneratorPanel: ({ element, app, }: {
36
+ element: NonDeletedExcalidrawElement & ExcalidrawFrameLikeElement;
37
+ app: AppClassProperties;
38
+ }) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,7 @@
1
+ import "./ImageQuickEditPanel.scss";
2
+ import type { ExcalidrawImageElement, NonDeletedExcalidrawElement } from "@orangecatai/element/types";
3
+ import type { AppClassProperties } from "../types";
4
+ export declare const ImageQuickEditPanel: ({ element, app, }: {
5
+ element: ExcalidrawImageElement & NonDeletedExcalidrawElement;
6
+ app: AppClassProperties;
7
+ }) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- import type { NonDeletedExcalidrawElement } from "@orangecatai/element/types";
3
2
  import "./ExportDialog.scss";
3
+ import type { NonDeletedExcalidrawElement } from "@orangecatai/element/types";
4
4
  import type { ActionManager } from "../actions/manager";
5
5
  import type { ExportOpts, BinaryFiles, UIAppState } from "../types";
6
6
  export type ExportCB = (elements: readonly NonDeletedExcalidrawElement[], scale?: number) => void;
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
- import type { NonDeletedExcalidrawElement } from "@orangecatai/element/types";
3
2
  import "./LayerUI.scss";
4
3
  import "./Toolbar.scss";
4
+ import type { NonDeletedExcalidrawElement } from "@orangecatai/element/types";
5
5
  import type { ActionManager } from "../actions/manager";
6
6
  import type { Language } from "../i18n";
7
7
  import type { AppProps, AppState, ExcalidrawProps, BinaryFiles, UIAppState, AppClassProperties } from "../types";
@@ -1,7 +1,7 @@
1
- import type { ElementsMap, ExcalidrawElement } from "@orangecatai/element/types";
2
1
  import type { Scene } from "@orangecatai/element";
3
2
  import { useApp, useExcalidrawSetAppState } from "../App";
4
3
  import "./DragInput.scss";
4
+ import type { ElementsMap, ExcalidrawElement } from "@orangecatai/element/types";
5
5
  import type { StatsInputProperty } from "./utils";
6
6
  import type { AppState } from "../../types";
7
7
  export type DragInputCallbackType<P extends StatsInputProperty, E = ExcalidrawElement> = (props: {
@@ -1,5 +1,5 @@
1
- import type { ExcalidrawElement } from "@orangecatai/element/types";
2
1
  import type { Scene } from "@orangecatai/element";
2
+ import type { ExcalidrawElement } from "@orangecatai/element/types";
3
3
  import type { AppState } from "../../types";
4
4
  interface FontSizeProps {
5
5
  element: ExcalidrawElement;
@@ -1,5 +1,5 @@
1
- import type { ExcalidrawElement, NonDeletedSceneElementsMap } from "@orangecatai/element/types";
2
1
  import type { Scene } from "@orangecatai/element";
2
+ import type { ExcalidrawElement, NonDeletedSceneElementsMap } from "@orangecatai/element/types";
3
3
  import type { AtomicUnit } from "./utils";
4
4
  import type { AppState } from "../../types";
5
5
  interface MultiDimensionProps {
@@ -1,5 +1,5 @@
1
- import type { ExcalidrawElement, NonDeletedSceneElementsMap } from "@orangecatai/element/types";
2
1
  import type { Scene } from "@orangecatai/element";
2
+ import type { ExcalidrawElement, NonDeletedSceneElementsMap } from "@orangecatai/element/types";
3
3
  import type { AppState } from "../../types";
4
4
  interface MultiFontSizeProps {
5
5
  elements: readonly ExcalidrawElement[];
@@ -1,5 +1,5 @@
1
- import type { ElementsMap, ExcalidrawElement } from "@orangecatai/element/types";
2
1
  import type { Scene } from "@orangecatai/element";
2
+ import type { ElementsMap, ExcalidrawElement } from "@orangecatai/element/types";
3
3
  import type { AtomicUnit } from "./utils";
4
4
  import type { AppState } from "../../types";
5
5
  interface MultiPositionProps {
@@ -1,7 +1,7 @@
1
- import type { RequestError } from "@orangecatai/adgen-canvas/errors";
2
- import type { NonDeletedExcalidrawElement } from "@orangecatai/element/types";
3
1
  import type { MermaidConfig } from "@excalidraw/mermaid-to-excalidraw";
4
2
  import type { MermaidToExcalidrawResult } from "@excalidraw/mermaid-to-excalidraw/dist/interfaces";
3
+ import type { RequestError } from "@orangecatai/adgen-canvas/errors";
4
+ import type { NonDeletedExcalidrawElement } from "@orangecatai/element/types";
5
5
  import type { BinaryFiles } from "../../types";
6
6
  export type LLMMessage = {
7
7
  role: "user" | "assistant";