@zsviczian/excalidraw 0.15.2-obsidian-6 → 0.15.2-obsidian-8

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 (36) hide show
  1. package/dist/excalidraw.development.js +37 -37
  2. package/dist/excalidraw.production.min.js +1 -1
  3. package/package.json +1 -1
  4. package/types/actions/actionAddToLibrary.d.ts +36 -21
  5. package/types/actions/actionBoundText.d.ts +22 -11
  6. package/types/actions/actionCanvas.d.ts +138 -78
  7. package/types/actions/actionClipboard.d.ts +57 -32
  8. package/types/actions/actionDeleteSelected.d.ts +33 -18
  9. package/types/actions/actionElementLock.d.ts +21 -11
  10. package/types/actions/actionExport.d.ts +108 -63
  11. package/types/actions/actionFinalize.d.ts +24 -14
  12. package/types/actions/actionFrame.d.ts +35 -20
  13. package/types/actions/actionLinearEditor.d.ts +12 -7
  14. package/types/actions/actionMenu.d.ts +36 -21
  15. package/types/actions/actionProperties.d.ts +156 -91
  16. package/types/actions/actionStyles.d.ts +12 -7
  17. package/types/actions/actionToggleGridMode.d.ts +12 -7
  18. package/types/actions/actionToggleStats.d.ts +12 -7
  19. package/types/actions/actionToggleViewMode.d.ts +12 -7
  20. package/types/actions/actionToggleZenMode.d.ts +12 -7
  21. package/types/actions/types.d.ts +1 -1
  22. package/types/appState.d.ts +5 -5
  23. package/types/components/App.d.ts +13 -8
  24. package/types/element/Hyperlink.d.ts +12 -7
  25. package/types/element/collision.d.ts +2 -2
  26. package/types/element/embeddable.d.ts +171 -0
  27. package/types/element/iframe.d.ts +4 -4
  28. package/types/element/linearElementEditor.d.ts +12 -7
  29. package/types/element/newElement.d.ts +4 -4
  30. package/types/element/typeChecks.d.ts +4 -4
  31. package/types/element/types.d.ts +6 -6
  32. package/types/groups.d.ts +1 -1
  33. package/types/history.d.ts +3 -3
  34. package/types/scene/selection.d.ts +11 -1
  35. package/types/types.d.ts +19 -14
  36. package/types/utils.d.ts +1 -1
@@ -18,7 +18,7 @@ export declare const actionCopyStyles: {
18
18
  showWelcomeScreen: boolean;
19
19
  isLoading: boolean;
20
20
  errorMessage: import("react").ReactNode;
21
- activeIFrame: {
21
+ activeEmbeddable: {
22
22
  element: import("../element/types").NonDeletedExcalidrawElement;
23
23
  state: "active" | "hover";
24
24
  } | null;
@@ -30,7 +30,12 @@ export declare const actionCopyStyles: {
30
30
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
31
31
  suggestedBindings: import("../element/binding").SuggestedBinding[];
32
32
  frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
33
- shouldRenderFrames: boolean;
33
+ frameRendering: {
34
+ enabled: boolean;
35
+ name: boolean;
36
+ outline: boolean;
37
+ clip: boolean;
38
+ };
34
39
  editingFrame: string | null;
35
40
  elementsToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | null;
36
41
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
@@ -39,7 +44,7 @@ export declare const actionCopyStyles: {
39
44
  lastActiveTool: import("../types").LastActiveTool;
40
45
  locked: boolean;
41
46
  } & ({
42
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "iframe" | "image" | "frame" | "freedraw" | "eraser" | "hand";
47
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
43
48
  customType: null;
44
49
  } | {
45
50
  type: "custom";
@@ -84,11 +89,11 @@ export declare const actionCopyStyles: {
84
89
  openDialog: "imageExport" | "help" | "jsonExport" | null;
85
90
  defaultSidebarDockedPreference: boolean;
86
91
  lastPointerDownWith: import("../element/types").PointerType;
87
- selectedElementIds: {
88
- [id: string]: boolean;
89
- };
92
+ selectedElementIds: Readonly<{
93
+ [id: string]: true;
94
+ }>;
90
95
  previousSelectedElementIds: {
91
- [id: string]: boolean;
96
+ [id: string]: true;
92
97
  };
93
98
  selectedElementsAreBeingDragged: boolean;
94
99
  shouldCacheIgnoreZoom: boolean;
@@ -18,7 +18,7 @@ export declare const actionToggleGridMode: {
18
18
  showWelcomeScreen: boolean;
19
19
  isLoading: boolean;
20
20
  errorMessage: import("react").ReactNode;
21
- activeIFrame: {
21
+ activeEmbeddable: {
22
22
  element: import("../element/types").NonDeletedExcalidrawElement;
23
23
  state: "active" | "hover";
24
24
  } | null;
@@ -30,7 +30,12 @@ export declare const actionToggleGridMode: {
30
30
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
31
31
  suggestedBindings: import("../element/binding").SuggestedBinding[];
32
32
  frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
33
- shouldRenderFrames: boolean;
33
+ frameRendering: {
34
+ enabled: boolean;
35
+ name: boolean;
36
+ outline: boolean;
37
+ clip: boolean;
38
+ };
34
39
  editingFrame: string | null;
35
40
  elementsToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | null;
36
41
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
@@ -39,7 +44,7 @@ export declare const actionToggleGridMode: {
39
44
  lastActiveTool: import("../types").LastActiveTool;
40
45
  locked: boolean;
41
46
  } & ({
42
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "iframe" | "image" | "frame" | "freedraw" | "eraser" | "hand";
47
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
43
48
  customType: null;
44
49
  } | {
45
50
  type: "custom";
@@ -84,11 +89,11 @@ export declare const actionToggleGridMode: {
84
89
  openDialog: "imageExport" | "help" | "jsonExport" | null;
85
90
  defaultSidebarDockedPreference: boolean;
86
91
  lastPointerDownWith: import("../element/types").PointerType;
87
- selectedElementIds: {
88
- [id: string]: boolean;
89
- };
92
+ selectedElementIds: Readonly<{
93
+ [id: string]: true;
94
+ }>;
90
95
  previousSelectedElementIds: {
91
- [id: string]: boolean;
96
+ [id: string]: true;
92
97
  };
93
98
  selectedElementsAreBeingDragged: boolean;
94
99
  shouldCacheIgnoreZoom: boolean;
@@ -16,7 +16,7 @@ export declare const actionToggleStats: {
16
16
  showWelcomeScreen: boolean;
17
17
  isLoading: boolean;
18
18
  errorMessage: import("react").ReactNode;
19
- activeIFrame: {
19
+ activeEmbeddable: {
20
20
  element: import("../element/types").NonDeletedExcalidrawElement;
21
21
  state: "active" | "hover";
22
22
  } | null;
@@ -28,7 +28,12 @@ export declare const actionToggleStats: {
28
28
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
29
29
  suggestedBindings: import("../element/binding").SuggestedBinding[];
30
30
  frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
31
- shouldRenderFrames: boolean;
31
+ frameRendering: {
32
+ enabled: boolean;
33
+ name: boolean;
34
+ outline: boolean;
35
+ clip: boolean;
36
+ };
32
37
  editingFrame: string | null;
33
38
  elementsToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | null;
34
39
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
@@ -37,7 +42,7 @@ export declare const actionToggleStats: {
37
42
  lastActiveTool: import("../types").LastActiveTool;
38
43
  locked: boolean;
39
44
  } & ({
40
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "iframe" | "image" | "frame" | "freedraw" | "eraser" | "hand";
45
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
41
46
  customType: null;
42
47
  } | {
43
48
  type: "custom";
@@ -82,11 +87,11 @@ export declare const actionToggleStats: {
82
87
  openDialog: "imageExport" | "help" | "jsonExport" | null;
83
88
  defaultSidebarDockedPreference: boolean;
84
89
  lastPointerDownWith: import("../element/types").PointerType;
85
- selectedElementIds: {
86
- [id: string]: boolean;
87
- };
90
+ selectedElementIds: Readonly<{
91
+ [id: string]: true;
92
+ }>;
88
93
  previousSelectedElementIds: {
89
- [id: string]: boolean;
94
+ [id: string]: true;
90
95
  };
91
96
  selectedElementsAreBeingDragged: boolean;
92
97
  shouldCacheIgnoreZoom: boolean;
@@ -17,7 +17,7 @@ export declare const actionToggleViewMode: {
17
17
  showWelcomeScreen: boolean;
18
18
  isLoading: boolean;
19
19
  errorMessage: import("react").ReactNode;
20
- activeIFrame: {
20
+ activeEmbeddable: {
21
21
  element: import("../element/types").NonDeletedExcalidrawElement;
22
22
  state: "active" | "hover";
23
23
  } | null;
@@ -29,7 +29,12 @@ export declare const actionToggleViewMode: {
29
29
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
30
30
  suggestedBindings: import("../element/binding").SuggestedBinding[];
31
31
  frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
32
- shouldRenderFrames: boolean;
32
+ frameRendering: {
33
+ enabled: boolean;
34
+ name: boolean;
35
+ outline: boolean;
36
+ clip: boolean;
37
+ };
33
38
  editingFrame: string | null;
34
39
  elementsToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | null;
35
40
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
@@ -38,7 +43,7 @@ export declare const actionToggleViewMode: {
38
43
  lastActiveTool: import("../types").LastActiveTool;
39
44
  locked: boolean;
40
45
  } & ({
41
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "iframe" | "image" | "frame" | "freedraw" | "eraser" | "hand";
46
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
42
47
  customType: null;
43
48
  } | {
44
49
  type: "custom";
@@ -83,11 +88,11 @@ export declare const actionToggleViewMode: {
83
88
  openDialog: "imageExport" | "help" | "jsonExport" | null;
84
89
  defaultSidebarDockedPreference: boolean;
85
90
  lastPointerDownWith: import("../element/types").PointerType;
86
- selectedElementIds: {
87
- [id: string]: boolean;
88
- };
91
+ selectedElementIds: Readonly<{
92
+ [id: string]: true;
93
+ }>;
89
94
  previousSelectedElementIds: {
90
- [id: string]: boolean;
95
+ [id: string]: true;
91
96
  };
92
97
  selectedElementsAreBeingDragged: boolean;
93
98
  shouldCacheIgnoreZoom: boolean;
@@ -17,7 +17,7 @@ export declare const actionToggleZenMode: {
17
17
  showWelcomeScreen: boolean;
18
18
  isLoading: boolean;
19
19
  errorMessage: import("react").ReactNode;
20
- activeIFrame: {
20
+ activeEmbeddable: {
21
21
  element: import("../element/types").NonDeletedExcalidrawElement;
22
22
  state: "active" | "hover";
23
23
  } | null;
@@ -29,7 +29,12 @@ export declare const actionToggleZenMode: {
29
29
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
30
30
  suggestedBindings: import("../element/binding").SuggestedBinding[];
31
31
  frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
32
- shouldRenderFrames: boolean;
32
+ frameRendering: {
33
+ enabled: boolean;
34
+ name: boolean;
35
+ outline: boolean;
36
+ clip: boolean;
37
+ };
33
38
  editingFrame: string | null;
34
39
  elementsToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | null;
35
40
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
@@ -38,7 +43,7 @@ export declare const actionToggleZenMode: {
38
43
  lastActiveTool: import("../types").LastActiveTool;
39
44
  locked: boolean;
40
45
  } & ({
41
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "iframe" | "image" | "frame" | "freedraw" | "eraser" | "hand";
46
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
42
47
  customType: null;
43
48
  } | {
44
49
  type: "custom";
@@ -83,11 +88,11 @@ export declare const actionToggleZenMode: {
83
88
  openDialog: "imageExport" | "help" | "jsonExport" | null;
84
89
  defaultSidebarDockedPreference: boolean;
85
90
  lastPointerDownWith: import("../element/types").PointerType;
86
- selectedElementIds: {
87
- [id: string]: boolean;
88
- };
91
+ selectedElementIds: Readonly<{
92
+ [id: string]: true;
93
+ }>;
89
94
  previousSelectedElementIds: {
90
- [id: string]: boolean;
95
+ [id: string]: true;
91
96
  };
92
97
  selectedElementsAreBeingDragged: boolean;
93
98
  shouldCacheIgnoreZoom: boolean;
@@ -15,7 +15,7 @@ export type ActionResult = {
15
15
  type ActionFn = (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, formData: any, app: AppClassProperties) => ActionResult | Promise<ActionResult>;
16
16
  export type UpdaterFn = (res: ActionResult) => void;
17
17
  export type ActionFilterFn = (action: Action) => void;
18
- export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeOpacity" | "changeFontSize" | "toggleCanvasMenu" | "toggleEditMenu" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "toggleFrameRendering" | "setFrameAsActiveTool" | "setIFrameAsActiveTool" | "createContainerFromText" | "wrapTextInContainer";
18
+ export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeOpacity" | "changeFontSize" | "toggleCanvasMenu" | "toggleEditMenu" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "setEmbeddableAsActiveTool" | "createContainerFromText" | "wrapTextInContainer";
19
19
  export type PanelComponentProps = {
20
20
  elements: readonly ExcalidrawElement[];
21
21
  appState: AppState;
@@ -7,7 +7,7 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
7
7
  lastActiveTool: import("./types").LastActiveTool;
8
8
  locked: boolean;
9
9
  } & ({
10
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "iframe" | "image" | "frame" | "freedraw" | "eraser" | "hand";
10
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
11
11
  customType: null;
12
12
  } | {
13
13
  type: "custom";
@@ -48,11 +48,11 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
48
48
  } | null | undefined;
49
49
  defaultSidebarDockedPreference?: boolean | undefined;
50
50
  lastPointerDownWith?: import("./element/types").PointerType | undefined;
51
- selectedElementIds?: {
52
- [id: string]: boolean;
53
- } | undefined;
51
+ selectedElementIds?: Readonly<{
52
+ [id: string]: true;
53
+ }> | undefined;
54
54
  previousSelectedElementIds?: {
55
- [id: string]: boolean;
55
+ [id: string]: true;
56
56
  } | undefined;
57
57
  shouldCacheIgnoreZoom?: boolean | undefined;
58
58
  zenModeEnabled?: boolean | undefined;
@@ -64,12 +64,12 @@ declare class App extends React.Component<AppProps, AppState> {
64
64
  constructor(props: AppProps);
65
65
  private renderCanvas;
66
66
  private onWindowMessage;
67
- private updateIFrameRef;
68
- private getIFrameElementById;
69
- private handleIFrameCenterClick;
70
- private isIFrameCenter;
71
- private updateIFrames;
72
- private renderIFrames;
67
+ private updateEmbeddableRef;
68
+ private getHTMLIFrameElement;
69
+ private handleEmbeddableCenterClick;
70
+ private isEmbeddableCenter;
71
+ private updateEmbeddables;
72
+ private renderEmbeddables;
73
73
  private getFrameNameDOMId;
74
74
  frameNameBoundsCache: FrameNameBoundsCache;
75
75
  private renderFrameNames;
@@ -113,7 +113,12 @@ declare class App extends React.Component<AppProps, AppState> {
113
113
  setAppState: React.Component<any, AppState>["setState"];
114
114
  removePointer: (event: React.PointerEvent<HTMLElement> | PointerEvent) => void;
115
115
  toggleLock: (source?: "keyboard" | "ui") => void;
116
- toggleFrameRendering: () => void;
116
+ updateFrameRendering: (opts: Partial<{
117
+ enabled: boolean;
118
+ name: boolean;
119
+ outline: boolean;
120
+ clip: boolean;
121
+ }> | ((prevState: AppState["frameRendering"]) => Partial<AppState["frameRendering"]>)) => void;
117
122
  togglePenMode: () => void;
118
123
  onHandToolToggle: () => void;
119
124
  /**
@@ -222,7 +227,7 @@ declare class App extends React.Component<AppProps, AppState> {
222
227
  private isHittingCommonBoundingBoxOfSelectedElements;
223
228
  private handleTextOnPointerDown;
224
229
  private handleFreeDrawElementOnPointerDown;
225
- private insertIFrameElement;
230
+ private insertEmbeddableElement;
226
231
  private createImageElement;
227
232
  private handleLinearElementOnPointerDown;
228
233
  private getCurrentItemRoundness;
@@ -29,7 +29,7 @@ export declare const actionLink: {
29
29
  showWelcomeScreen: boolean;
30
30
  isLoading: boolean;
31
31
  errorMessage: import("react").ReactNode;
32
- activeIFrame: {
32
+ activeEmbeddable: {
33
33
  element: NonDeletedExcalidrawElement;
34
34
  state: "active" | "hover";
35
35
  } | null;
@@ -41,7 +41,12 @@ export declare const actionLink: {
41
41
  startBoundElement: import("./types").NonDeleted<import("./types").ExcalidrawBindableElement> | null;
42
42
  suggestedBindings: import("./binding").SuggestedBinding[];
43
43
  frameToHighlight: import("./types").NonDeleted<import("./types").ExcalidrawFrameElement> | null;
44
- shouldRenderFrames: boolean;
44
+ frameRendering: {
45
+ enabled: boolean;
46
+ name: boolean;
47
+ outline: boolean;
48
+ clip: boolean;
49
+ };
45
50
  editingFrame: string | null;
46
51
  elementsToHighlight: import("./types").NonDeleted<import("./types").ExcalidrawElement>[] | null;
47
52
  editingElement: NonDeletedExcalidrawElement | null;
@@ -50,7 +55,7 @@ export declare const actionLink: {
50
55
  lastActiveTool: import("../types").LastActiveTool;
51
56
  locked: boolean;
52
57
  } & ({
53
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "iframe" | "image" | "frame" | "freedraw" | "eraser" | "hand";
58
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
54
59
  customType: null;
55
60
  } | {
56
61
  type: "custom";
@@ -94,11 +99,11 @@ export declare const actionLink: {
94
99
  openDialog: "imageExport" | "help" | "jsonExport" | null;
95
100
  defaultSidebarDockedPreference: boolean;
96
101
  lastPointerDownWith: import("./types").PointerType;
97
- selectedElementIds: {
98
- [id: string]: boolean;
99
- };
102
+ selectedElementIds: Readonly<{
103
+ [id: string]: true;
104
+ }>;
100
105
  previousSelectedElementIds: {
101
- [id: string]: boolean;
106
+ [id: string]: true;
102
107
  };
103
108
  selectedElementsAreBeingDragged: boolean;
104
109
  shouldCacheIgnoreZoom: boolean;
@@ -1,5 +1,5 @@
1
1
  import * as GA from "../ga";
2
- import { NonDeletedExcalidrawElement, ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawRectangleElement, ExcalidrawIFrameElement, ExcalidrawDiamondElement, ExcalidrawTextElement, ExcalidrawEllipseElement, NonDeleted, ExcalidrawImageElement, ExcalidrawFrameElement } from "./types";
2
+ import { NonDeletedExcalidrawElement, ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawRectangleElement, ExcalidrawEmbeddableElement, ExcalidrawDiamondElement, ExcalidrawTextElement, ExcalidrawEllipseElement, NonDeleted, ExcalidrawImageElement, ExcalidrawFrameElement } from "./types";
3
3
  import { FrameNameBoundsCache, Point } from "../types";
4
4
  import { AppState } from "../types";
5
5
  export declare const hitTest: (element: NonDeletedExcalidrawElement, appState: AppState, frameNameBoundsCache: FrameNameBoundsCache, x: number, y: number) => boolean;
@@ -18,4 +18,4 @@ export declare const determineFocusPoint: (element: ExcalidrawBindableElement, f
18
18
  export declare const intersectElementWithLine: (element: ExcalidrawBindableElement, a: readonly [number, number], b: readonly [number, number], gap?: number) => Point[];
19
19
  export declare const getCircleIntersections: (center: readonly [number, number, number, number, number, number, number, number], radius: number, line: readonly [number, number, number, number, number, number, number, number]) => GA.Point[];
20
20
  export declare const findFocusPointForEllipse: (ellipse: ExcalidrawEllipseElement, relativeDistance: number, point: readonly [number, number, number, number, number, number, number, number]) => readonly [number, number, number, number, number, number, number, number];
21
- export declare const findFocusPointForRectangulars: (element: ExcalidrawRectangleElement | ExcalidrawImageElement | ExcalidrawDiamondElement | ExcalidrawTextElement | ExcalidrawIFrameElement | ExcalidrawFrameElement, relativeDistance: number, point: readonly [number, number, number, number, number, number, number, number]) => readonly [number, number, number, number, number, number, number, number];
21
+ export declare const findFocusPointForRectangulars: (element: ExcalidrawRectangleElement | ExcalidrawImageElement | ExcalidrawDiamondElement | ExcalidrawTextElement | ExcalidrawEmbeddableElement | ExcalidrawFrameElement, relativeDistance: number, point: readonly [number, number, number, number, number, number, number, number]) => readonly [number, number, number, number, number, number, number, number];
@@ -0,0 +1,171 @@
1
+ /// <reference types="react" />
2
+ import { ExcalidrawProps } from "../types";
3
+ import { ExcalidrawElement, ExcalidrawEmbeddableElement, NonDeletedExcalidrawElement } from "./types";
4
+ type EmbeddedLink = {
5
+ link: string;
6
+ aspectRatio: {
7
+ w: number;
8
+ h: number;
9
+ };
10
+ type: "video" | "generic";
11
+ } | null;
12
+ export declare const getEmbedLink: (link?: string | null) => EmbeddedLink;
13
+ export declare const isEmbeddableOrFrameLabel: (element: NonDeletedExcalidrawElement) => Boolean;
14
+ export declare const createPlaceholderEmbeddableLabel: (element: ExcalidrawEmbeddableElement) => ExcalidrawElement;
15
+ export declare const actionSetEmbeddableAsActiveTool: {
16
+ name: "setEmbeddableAsActiveTool";
17
+ trackEvent: {
18
+ category: "toolbar";
19
+ };
20
+ perform: (elements: readonly ExcalidrawElement[], appState: Readonly<import("../types").AppState>, _: any, app: import("../types").AppClassProperties) => {
21
+ elements: readonly ExcalidrawElement[];
22
+ appState: {
23
+ activeTool: {
24
+ lastActiveTool: import("../types").LastActiveTool;
25
+ locked: boolean;
26
+ } & ({
27
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
28
+ customType: null;
29
+ } | {
30
+ type: "custom";
31
+ customType: string;
32
+ });
33
+ contextMenu: {
34
+ items: import("../components/ContextMenu").ContextMenuItems;
35
+ top: number;
36
+ left: number;
37
+ } | null;
38
+ showWelcomeScreen: boolean;
39
+ isLoading: boolean;
40
+ errorMessage: import("react").ReactNode;
41
+ activeEmbeddable: {
42
+ element: NonDeletedExcalidrawElement;
43
+ state: "active" | "hover";
44
+ } | null;
45
+ draggingElement: NonDeletedExcalidrawElement | null;
46
+ resizingElement: NonDeletedExcalidrawElement | null;
47
+ multiElement: import("./types").NonDeleted<import("./types").ExcalidrawLinearElement> | null;
48
+ selectionElement: NonDeletedExcalidrawElement | null;
49
+ isBindingEnabled: boolean;
50
+ startBoundElement: import("./types").NonDeleted<import("./types").ExcalidrawBindableElement> | null;
51
+ suggestedBindings: import("./binding").SuggestedBinding[];
52
+ frameToHighlight: import("./types").NonDeleted<import("./types").ExcalidrawFrameElement> | null;
53
+ frameRendering: {
54
+ enabled: boolean;
55
+ name: boolean;
56
+ outline: boolean;
57
+ clip: boolean;
58
+ };
59
+ editingFrame: string | null;
60
+ elementsToHighlight: import("./types").NonDeleted<ExcalidrawElement>[] | null;
61
+ editingElement: NonDeletedExcalidrawElement | null;
62
+ editingLinearElement: import("./linearElementEditor").LinearElementEditor | null;
63
+ penMode: boolean;
64
+ penDetected: boolean;
65
+ exportBackground: boolean;
66
+ exportEmbedScene: boolean;
67
+ exportWithDarkMode: boolean;
68
+ exportScale: number;
69
+ currentItemStrokeColor: string;
70
+ currentItemBackgroundColor: string;
71
+ currentItemFillStyle: import("./types").FillStyle;
72
+ currentItemStrokeWidth: number;
73
+ currentItemStrokeStyle: import("./types").StrokeStyle;
74
+ currentItemRoughness: number;
75
+ currentItemOpacity: number;
76
+ currentItemFontFamily: number;
77
+ currentItemFontSize: number;
78
+ currentItemTextAlign: string;
79
+ currentItemStartArrowhead: import("./types").Arrowhead | null;
80
+ currentItemEndArrowhead: import("./types").Arrowhead | null;
81
+ currentItemRoundness: import("./types").StrokeRoundness;
82
+ viewBackgroundColor: string;
83
+ scrollX: number;
84
+ scrollY: number;
85
+ cursorButton: "up" | "down";
86
+ scrolledOutside: boolean;
87
+ name: string;
88
+ isResizing: boolean;
89
+ isRotating: boolean;
90
+ zoom: Readonly<{
91
+ value: import("../types").NormalizedZoomValue;
92
+ }>;
93
+ openMenu: "canvas" | "shape" | null;
94
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
95
+ openSidebar: {
96
+ name: string;
97
+ tab?: string | undefined;
98
+ } | null;
99
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
100
+ defaultSidebarDockedPreference: boolean;
101
+ lastPointerDownWith: import("./types").PointerType;
102
+ selectedElementIds: Readonly<{
103
+ [id: string]: true;
104
+ }>;
105
+ previousSelectedElementIds: {
106
+ [id: string]: true;
107
+ };
108
+ selectedElementsAreBeingDragged: boolean;
109
+ shouldCacheIgnoreZoom: boolean;
110
+ toast: {
111
+ message: string;
112
+ closable?: boolean | undefined;
113
+ duration?: number | undefined;
114
+ } | null;
115
+ zenModeEnabled: boolean;
116
+ theme: string;
117
+ gridSize: number | null;
118
+ previousGridSize: number | null;
119
+ viewModeEnabled: boolean;
120
+ selectedGroupIds: {
121
+ [groupId: string]: boolean;
122
+ };
123
+ editingGroupId: string | null;
124
+ width: number;
125
+ height: number;
126
+ offsetTop: number;
127
+ offsetLeft: number;
128
+ fileHandle: import("browser-fs-access").FileSystemHandle | null;
129
+ collaborators: Map<string, import("../types").Collaborator>;
130
+ showStats: boolean;
131
+ currentChartType: import("./types").ChartType;
132
+ pasteDialog: {
133
+ shown: false;
134
+ data: null;
135
+ } | {
136
+ shown: true;
137
+ data: import("../charts").Spreadsheet;
138
+ };
139
+ pendingImageElementId: string | null;
140
+ showHyperlinkPopup: false | "info" | "editor";
141
+ linkOpacity: number;
142
+ trayModeEnabled: boolean;
143
+ colorPalette?: {
144
+ canvasBackground: import("../colors").ColorPaletteCustom;
145
+ elementBackground: import("../colors").ColorPaletteCustom;
146
+ elementStroke: import("../colors").ColorPaletteCustom;
147
+ topPicks: {
148
+ canvasBackground: [string, string, string, string, string];
149
+ elementStroke: [string, string, string, string, string];
150
+ elementBackground: [string, string, string, string, string];
151
+ };
152
+ } | undefined;
153
+ allowWheelZoom?: boolean | undefined;
154
+ allowPinchZoom?: boolean | undefined;
155
+ pinnedScripts?: string[] | undefined;
156
+ customPens?: any[] | undefined;
157
+ currentStrokeOptions?: any;
158
+ resetCustomPen?: any;
159
+ gridColor: string;
160
+ dynamicStyle: string;
161
+ invertBindingBehaviour: boolean;
162
+ selectedLinearElement: import("./linearElementEditor").LinearElementEditor | null;
163
+ };
164
+ commitToHistory: false;
165
+ };
166
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
167
+ } & {
168
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
169
+ };
170
+ export declare const embeddableURLValidator: (url: string | null | undefined, validateEmbeddable: ExcalidrawProps["validateEmbeddable"]) => boolean;
171
+ export {};
@@ -95,11 +95,11 @@ export declare const actionSetIFrameAsActiveTool: {
95
95
  openDialog: "imageExport" | "help" | "jsonExport" | null;
96
96
  defaultSidebarDockedPreference: boolean;
97
97
  lastPointerDownWith: import("./types").PointerType;
98
- selectedElementIds: {
99
- [id: string]: boolean;
100
- };
98
+ selectedElementIds: Readonly<{
99
+ [id: string]: true;
100
+ }>;
101
101
  previousSelectedElementIds: {
102
- [id: string]: boolean;
102
+ [id: string]: true;
103
103
  };
104
104
  selectedElementsAreBeingDragged: boolean;
105
105
  shouldCacheIgnoreZoom: boolean;
@@ -131,7 +131,7 @@ export declare class LinearElementEditor {
131
131
  showWelcomeScreen: boolean;
132
132
  isLoading: boolean;
133
133
  errorMessage: import("react").ReactNode;
134
- activeIFrame: {
134
+ activeEmbeddable: {
135
135
  element: import("./types").NonDeletedExcalidrawElement;
136
136
  state: "active" | "hover";
137
137
  } | null;
@@ -143,7 +143,12 @@ export declare class LinearElementEditor {
143
143
  startBoundElement: NonDeleted<ExcalidrawBindableElement> | null;
144
144
  suggestedBindings: import("./binding").SuggestedBinding[];
145
145
  frameToHighlight: NonDeleted<import("./types").ExcalidrawFrameElement> | null;
146
- shouldRenderFrames: boolean;
146
+ frameRendering: {
147
+ enabled: boolean;
148
+ name: boolean;
149
+ outline: boolean;
150
+ clip: boolean;
151
+ };
147
152
  editingFrame: string | null;
148
153
  elementsToHighlight: NonDeleted<ExcalidrawElement>[] | null;
149
154
  editingElement: import("./types").NonDeletedExcalidrawElement | null;
@@ -151,7 +156,7 @@ export declare class LinearElementEditor {
151
156
  lastActiveTool: import("../types").LastActiveTool;
152
157
  locked: boolean;
153
158
  } & ({
154
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "iframe" | "image" | "frame" | "freedraw" | "eraser" | "hand";
159
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
155
160
  customType: null;
156
161
  } | {
157
162
  type: "custom";
@@ -196,11 +201,11 @@ export declare class LinearElementEditor {
196
201
  openDialog: "imageExport" | "help" | "jsonExport" | null;
197
202
  defaultSidebarDockedPreference: boolean;
198
203
  lastPointerDownWith: import("./types").PointerType;
199
- selectedElementIds: {
200
- [id: string]: boolean;
201
- };
204
+ selectedElementIds: Readonly<{
205
+ [id: string]: true;
206
+ }>;
202
207
  previousSelectedElementIds: {
203
- [id: string]: boolean;
208
+ [id: string]: true;
204
209
  };
205
210
  selectedElementsAreBeingDragged: boolean;
206
211
  shouldCacheIgnoreZoom: boolean;