@excalidraw/excalidraw 0.15.2-b7350f9 → 0.15.2-fc9a9a2

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 (99) hide show
  1. package/CHANGELOG.md +22 -1
  2. package/dist/excalidraw-assets/locales/{es-ES-json-f2467c6a875a9e288756.js → es-ES-json-4f3da97feff33cb00e6d.js} +1 -1
  3. package/dist/excalidraw-assets/locales/{hi-IN-json-e22f4ad73126c2971850.js → hi-IN-json-3898c9c1216b44476529.js} +1 -1
  4. package/dist/excalidraw-assets/locales/{id-ID-json-0e69caf5d919807ed234.js → id-ID-json-43d505d7071a0e359681.js} +1 -1
  5. package/dist/excalidraw-assets/locales/{kk-KZ-json-106d2a41c68f69765668.js → kk-KZ-json-f648362328b839e9313f.js} +1 -1
  6. package/dist/excalidraw-assets/locales/{pa-IN-json-0fd029451b07248c5194.js → pa-IN-json-d9ee09801ed220840b2b.js} +1 -1
  7. package/dist/excalidraw-assets/{vendor-53d1c69ef585b6dd219b.js → vendor-ef3c5d81a00ef582b871.js} +2 -2
  8. package/dist/excalidraw-assets-dev/{vendor-e6df8519da951026ff69.js → vendor-a14cd58fa2db417e42b2.js} +6 -6
  9. package/dist/excalidraw.development.js +2189 -2123
  10. package/dist/excalidraw.production.min.js +1 -1
  11. package/dist/excalidraw.production.min.js.LICENSE.txt +15 -0
  12. package/package.json +7 -2
  13. package/types/actions/actionAddToLibrary.d.ts +51 -25
  14. package/types/actions/actionAlign.d.ts +19 -20
  15. package/types/actions/actionBoundText.d.ts +38 -20
  16. package/types/actions/actionCanvas.d.ts +310 -88
  17. package/types/actions/actionClipboard.d.ts +81 -40
  18. package/types/actions/actionDeleteSelected.d.ts +45 -22
  19. package/types/actions/actionDistribute.d.ts +5 -6
  20. package/types/actions/actionDuplicateSelection.d.ts +0 -1
  21. package/types/actions/actionElementLock.d.ts +36 -19
  22. package/types/actions/actionExport.d.ts +161 -80
  23. package/types/actions/actionFinalize.d.ts +31 -17
  24. package/types/actions/actionFlip.d.ts +2 -3
  25. package/types/actions/actionFrame.d.ts +56 -30
  26. package/types/actions/actionGroup.d.ts +5 -6
  27. package/types/actions/actionLinearEditor.d.ts +19 -11
  28. package/types/actions/actionMenu.d.ts +51 -25
  29. package/types/actions/actionProperties.d.ts +221 -105
  30. package/types/actions/actionSelectAll.d.ts +0 -1
  31. package/types/actions/actionStyles.d.ts +17 -9
  32. package/types/actions/actionToggleGridMode.d.ts +17 -9
  33. package/types/actions/actionToggleStats.d.ts +17 -9
  34. package/types/actions/actionToggleViewMode.d.ts +17 -9
  35. package/types/actions/actionToggleZenMode.d.ts +17 -9
  36. package/types/actions/types.d.ts +4 -3
  37. package/types/appState.d.ts +7 -7
  38. package/types/colors.d.ts +9 -9
  39. package/types/components/App.d.ts +27 -1
  40. package/types/components/Button.d.ts +0 -1
  41. package/types/components/Card.d.ts +0 -1
  42. package/types/components/ColorPicker/keyboardNavHandlers.d.ts +0 -1
  43. package/types/components/DefaultSidebar.d.ts +0 -1
  44. package/types/components/EyeDropper.d.ts +0 -1
  45. package/types/components/HintViewer.d.ts +3 -4
  46. package/types/components/LayerUI.d.ts +2 -1
  47. package/types/components/LibraryMenuHeaderContent.d.ts +0 -1
  48. package/types/components/LibraryUnit.d.ts +0 -1
  49. package/types/components/LoadingMessage.d.ts +0 -1
  50. package/types/components/MobileMenu.d.ts +3 -2
  51. package/types/components/Section.d.ts +1 -1
  52. package/types/components/Sidebar/SidebarTab.d.ts +0 -1
  53. package/types/components/Sidebar/SidebarTabTrigger.d.ts +0 -1
  54. package/types/components/Sidebar/SidebarTabTriggers.d.ts +0 -1
  55. package/types/components/Sidebar/SidebarTabs.d.ts +0 -1
  56. package/types/components/Stack.d.ts +2 -2
  57. package/types/components/Trans.d.ts +2 -1
  58. package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +0 -1
  59. package/types/components/icons.d.ts +1 -0
  60. package/types/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -1
  61. package/types/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -1
  62. package/types/components/welcome-screen/WelcomeScreen.d.ts +0 -1
  63. package/types/constants.d.ts +13 -3
  64. package/types/data/url.d.ts +7 -0
  65. package/types/element/Hyperlink.d.ts +26 -14
  66. package/types/element/collision.d.ts +2 -2
  67. package/types/element/embeddable.d.ts +153 -0
  68. package/types/element/linearElementEditor.d.ts +18 -10
  69. package/types/element/newElement.d.ts +5 -2
  70. package/types/element/transformHandles.d.ts +1 -1
  71. package/types/element/typeChecks.d.ts +2 -1
  72. package/types/element/types.d.ts +13 -2
  73. package/types/frame.d.ts +2 -2
  74. package/types/groups.d.ts +3 -3
  75. package/types/history.d.ts +3 -3
  76. package/types/hooks/useOutsideClick.d.ts +0 -1
  77. package/types/hooks/useScrollPosition.d.ts +0 -1
  78. package/types/i18n.d.ts +5 -2
  79. package/types/keys.d.ts +2 -0
  80. package/types/packages/excalidraw/index.d.ts +1 -0
  81. package/types/packages/excalidraw/webpack.dev.config.d.ts +5 -2
  82. package/types/packages/excalidraw/webpack.prod.config.d.ts +3 -0
  83. package/types/packages/utils.d.ts +2 -1
  84. package/types/renderer/renderElement.d.ts +1 -1
  85. package/types/renderer/renderScene.d.ts +2 -1
  86. package/types/scene/Scene.d.ts +13 -0
  87. package/types/scene/export.d.ts +1 -0
  88. package/types/scene/selection.d.ts +11 -1
  89. package/types/types.d.ts +20 -9
  90. package/types/utility-types.d.ts +3 -1
  91. package/types/utils.d.ts +42 -15
  92. /package/dist/excalidraw-assets/{vendor-53d1c69ef585b6dd219b.js.LICENSE.txt → vendor-ef3c5d81a00ef582b871.js.LICENSE.txt} +0 -0
  93. /package/types/packages/excalidraw/dist/excalidraw-assets/locales/{es-ES-json-f2467c6a875a9e288756.d.ts → es-ES-json-4f3da97feff33cb00e6d.d.ts} +0 -0
  94. /package/types/packages/excalidraw/dist/excalidraw-assets/locales/{hi-IN-json-e22f4ad73126c2971850.d.ts → hi-IN-json-3898c9c1216b44476529.d.ts} +0 -0
  95. /package/types/packages/excalidraw/dist/excalidraw-assets/locales/{id-ID-json-0e69caf5d919807ed234.d.ts → id-ID-json-43d505d7071a0e359681.d.ts} +0 -0
  96. /package/types/packages/excalidraw/dist/excalidraw-assets/locales/{kk-KZ-json-106d2a41c68f69765668.d.ts → kk-KZ-json-f648362328b839e9313f.d.ts} +0 -0
  97. /package/types/packages/excalidraw/dist/excalidraw-assets/locales/{pa-IN-json-0fd029451b07248c5194.d.ts → pa-IN-json-d9ee09801ed220840b2b.d.ts} +0 -0
  98. /package/types/packages/excalidraw/dist/excalidraw-assets/{vendor-53d1c69ef585b6dd219b.d.ts → vendor-ef3c5d81a00ef582b871.d.ts} +0 -0
  99. /package/types/packages/excalidraw/dist/excalidraw-assets-dev/{vendor-e6df8519da951026ff69.d.ts → vendor-a14cd58fa2db417e42b2.d.ts} +0 -0
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ExcalidrawElement } from "../element/types";
3
2
  export declare const actionSelectAll: {
4
3
  name: "selectAll";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare let copiedStyles: string;
3
2
  export declare const actionCopyStyles: {
4
3
  name: "copyStyles";
@@ -18,6 +17,10 @@ export declare const actionCopyStyles: {
18
17
  showWelcomeScreen: boolean;
19
18
  isLoading: boolean;
20
19
  errorMessage: import("react").ReactNode;
20
+ activeEmbeddable: {
21
+ element: import("../element/types").NonDeletedExcalidrawElement;
22
+ state: "active" | "hover";
23
+ } | null;
21
24
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
22
25
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
23
26
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -26,7 +29,12 @@ export declare const actionCopyStyles: {
26
29
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
27
30
  suggestedBindings: import("../element/binding").SuggestedBinding[];
28
31
  frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
29
- shouldRenderFrames: boolean;
32
+ frameRendering: {
33
+ enabled: boolean;
34
+ name: boolean;
35
+ outline: boolean;
36
+ clip: boolean;
37
+ };
30
38
  editingFrame: string | null;
31
39
  elementsToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | null;
32
40
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
@@ -35,7 +43,7 @@ export declare const actionCopyStyles: {
35
43
  lastActiveTool: import("../types").LastActiveTool;
36
44
  locked: boolean;
37
45
  } & ({
38
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
46
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
39
47
  customType: null;
40
48
  } | {
41
49
  type: "custom";
@@ -80,16 +88,16 @@ export declare const actionCopyStyles: {
80
88
  openDialog: "imageExport" | "help" | "jsonExport" | null;
81
89
  defaultSidebarDockedPreference: boolean;
82
90
  lastPointerDownWith: import("../element/types").PointerType;
83
- selectedElementIds: {
84
- [id: string]: boolean;
85
- };
91
+ selectedElementIds: Readonly<{
92
+ [id: string]: true;
93
+ }>;
86
94
  previousSelectedElementIds: {
87
- [id: string]: boolean;
95
+ [id: string]: true;
88
96
  };
89
97
  selectedElementsAreBeingDragged: boolean;
90
98
  shouldCacheIgnoreZoom: boolean;
91
99
  zenModeEnabled: boolean;
92
- theme: string;
100
+ theme: import("../element/types").Theme;
93
101
  gridSize: number | null;
94
102
  viewModeEnabled: boolean;
95
103
  selectedGroupIds: {
@@ -112,7 +120,7 @@ export declare const actionCopyStyles: {
112
120
  data: import("../charts").Spreadsheet;
113
121
  };
114
122
  pendingImageElementId: string | null;
115
- showHyperlinkPopup: false | "info" | "editor";
123
+ showHyperlinkPopup: false | "editor" | "info";
116
124
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
117
125
  };
118
126
  commitToHistory: false;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { AppState } from "../types";
3
2
  export declare const actionToggleGridMode: {
4
3
  name: "gridMode";
@@ -18,6 +17,10 @@ export declare const actionToggleGridMode: {
18
17
  showWelcomeScreen: boolean;
19
18
  isLoading: boolean;
20
19
  errorMessage: import("react").ReactNode;
20
+ activeEmbeddable: {
21
+ element: import("../element/types").NonDeletedExcalidrawElement;
22
+ state: "active" | "hover";
23
+ } | null;
21
24
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
22
25
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
23
26
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -26,7 +29,12 @@ export declare const actionToggleGridMode: {
26
29
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
27
30
  suggestedBindings: import("../element/binding").SuggestedBinding[];
28
31
  frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
29
- shouldRenderFrames: boolean;
32
+ frameRendering: {
33
+ enabled: boolean;
34
+ name: boolean;
35
+ outline: boolean;
36
+ clip: boolean;
37
+ };
30
38
  editingFrame: string | null;
31
39
  elementsToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | null;
32
40
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
@@ -35,7 +43,7 @@ export declare const actionToggleGridMode: {
35
43
  lastActiveTool: import("../types").LastActiveTool;
36
44
  locked: boolean;
37
45
  } & ({
38
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
46
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
39
47
  customType: null;
40
48
  } | {
41
49
  type: "custom";
@@ -80,11 +88,11 @@ export declare const actionToggleGridMode: {
80
88
  openDialog: "imageExport" | "help" | "jsonExport" | null;
81
89
  defaultSidebarDockedPreference: boolean;
82
90
  lastPointerDownWith: import("../element/types").PointerType;
83
- selectedElementIds: {
84
- [id: string]: boolean;
85
- };
91
+ selectedElementIds: Readonly<{
92
+ [id: string]: true;
93
+ }>;
86
94
  previousSelectedElementIds: {
87
- [id: string]: boolean;
95
+ [id: string]: true;
88
96
  };
89
97
  selectedElementsAreBeingDragged: boolean;
90
98
  shouldCacheIgnoreZoom: boolean;
@@ -94,7 +102,7 @@ export declare const actionToggleGridMode: {
94
102
  duration?: number | undefined;
95
103
  } | null;
96
104
  zenModeEnabled: boolean;
97
- theme: string;
105
+ theme: import("../element/types").Theme;
98
106
  viewModeEnabled: boolean;
99
107
  selectedGroupIds: {
100
108
  [groupId: string]: boolean;
@@ -116,7 +124,7 @@ export declare const actionToggleGridMode: {
116
124
  data: import("../charts").Spreadsheet;
117
125
  };
118
126
  pendingImageElementId: string | null;
119
- showHyperlinkPopup: false | "info" | "editor";
127
+ showHyperlinkPopup: false | "editor" | "info";
120
128
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
121
129
  };
122
130
  commitToHistory: false;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const actionToggleStats: {
3
2
  name: "stats";
4
3
  viewMode: true;
@@ -16,6 +15,10 @@ export declare const actionToggleStats: {
16
15
  showWelcomeScreen: boolean;
17
16
  isLoading: boolean;
18
17
  errorMessage: import("react").ReactNode;
18
+ activeEmbeddable: {
19
+ element: import("../element/types").NonDeletedExcalidrawElement;
20
+ state: "active" | "hover";
21
+ } | null;
19
22
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
20
23
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
21
24
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -24,7 +27,12 @@ export declare const actionToggleStats: {
24
27
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
25
28
  suggestedBindings: import("../element/binding").SuggestedBinding[];
26
29
  frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
27
- shouldRenderFrames: boolean;
30
+ frameRendering: {
31
+ enabled: boolean;
32
+ name: boolean;
33
+ outline: boolean;
34
+ clip: boolean;
35
+ };
28
36
  editingFrame: string | null;
29
37
  elementsToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | null;
30
38
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
@@ -33,7 +41,7 @@ export declare const actionToggleStats: {
33
41
  lastActiveTool: import("../types").LastActiveTool;
34
42
  locked: boolean;
35
43
  } & ({
36
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
44
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
37
45
  customType: null;
38
46
  } | {
39
47
  type: "custom";
@@ -78,11 +86,11 @@ export declare const actionToggleStats: {
78
86
  openDialog: "imageExport" | "help" | "jsonExport" | null;
79
87
  defaultSidebarDockedPreference: boolean;
80
88
  lastPointerDownWith: import("../element/types").PointerType;
81
- selectedElementIds: {
82
- [id: string]: boolean;
83
- };
89
+ selectedElementIds: Readonly<{
90
+ [id: string]: true;
91
+ }>;
84
92
  previousSelectedElementIds: {
85
- [id: string]: boolean;
93
+ [id: string]: true;
86
94
  };
87
95
  selectedElementsAreBeingDragged: boolean;
88
96
  shouldCacheIgnoreZoom: boolean;
@@ -92,7 +100,7 @@ export declare const actionToggleStats: {
92
100
  duration?: number | undefined;
93
101
  } | null;
94
102
  zenModeEnabled: boolean;
95
- theme: string;
103
+ theme: import("../element/types").Theme;
96
104
  gridSize: number | null;
97
105
  viewModeEnabled: boolean;
98
106
  selectedGroupIds: {
@@ -114,7 +122,7 @@ export declare const actionToggleStats: {
114
122
  data: import("../charts").Spreadsheet;
115
123
  };
116
124
  pendingImageElementId: string | null;
117
- showHyperlinkPopup: false | "info" | "editor";
125
+ showHyperlinkPopup: false | "editor" | "info";
118
126
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
119
127
  };
120
128
  commitToHistory: false;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const actionToggleViewMode: {
3
2
  name: "viewMode";
4
3
  viewMode: true;
@@ -17,6 +16,10 @@ export declare const actionToggleViewMode: {
17
16
  showWelcomeScreen: boolean;
18
17
  isLoading: boolean;
19
18
  errorMessage: import("react").ReactNode;
19
+ activeEmbeddable: {
20
+ element: import("../element/types").NonDeletedExcalidrawElement;
21
+ state: "active" | "hover";
22
+ } | null;
20
23
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
21
24
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
22
25
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -25,7 +28,12 @@ export declare const actionToggleViewMode: {
25
28
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
26
29
  suggestedBindings: import("../element/binding").SuggestedBinding[];
27
30
  frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
28
- shouldRenderFrames: boolean;
31
+ frameRendering: {
32
+ enabled: boolean;
33
+ name: boolean;
34
+ outline: boolean;
35
+ clip: boolean;
36
+ };
29
37
  editingFrame: string | null;
30
38
  elementsToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | null;
31
39
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
@@ -34,7 +42,7 @@ export declare const actionToggleViewMode: {
34
42
  lastActiveTool: import("../types").LastActiveTool;
35
43
  locked: boolean;
36
44
  } & ({
37
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
45
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
38
46
  customType: null;
39
47
  } | {
40
48
  type: "custom";
@@ -79,11 +87,11 @@ export declare const actionToggleViewMode: {
79
87
  openDialog: "imageExport" | "help" | "jsonExport" | null;
80
88
  defaultSidebarDockedPreference: boolean;
81
89
  lastPointerDownWith: import("../element/types").PointerType;
82
- selectedElementIds: {
83
- [id: string]: boolean;
84
- };
90
+ selectedElementIds: Readonly<{
91
+ [id: string]: true;
92
+ }>;
85
93
  previousSelectedElementIds: {
86
- [id: string]: boolean;
94
+ [id: string]: true;
87
95
  };
88
96
  selectedElementsAreBeingDragged: boolean;
89
97
  shouldCacheIgnoreZoom: boolean;
@@ -93,7 +101,7 @@ export declare const actionToggleViewMode: {
93
101
  duration?: number | undefined;
94
102
  } | null;
95
103
  zenModeEnabled: boolean;
96
- theme: string;
104
+ theme: import("../element/types").Theme;
97
105
  gridSize: number | null;
98
106
  selectedGroupIds: {
99
107
  [groupId: string]: boolean;
@@ -115,7 +123,7 @@ export declare const actionToggleViewMode: {
115
123
  data: import("../charts").Spreadsheet;
116
124
  };
117
125
  pendingImageElementId: string | null;
118
- showHyperlinkPopup: false | "info" | "editor";
126
+ showHyperlinkPopup: false | "editor" | "info";
119
127
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
120
128
  };
121
129
  commitToHistory: false;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const actionToggleZenMode: {
3
2
  name: "zenMode";
4
3
  viewMode: true;
@@ -17,6 +16,10 @@ export declare const actionToggleZenMode: {
17
16
  showWelcomeScreen: boolean;
18
17
  isLoading: boolean;
19
18
  errorMessage: import("react").ReactNode;
19
+ activeEmbeddable: {
20
+ element: import("../element/types").NonDeletedExcalidrawElement;
21
+ state: "active" | "hover";
22
+ } | null;
20
23
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
21
24
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
22
25
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -25,7 +28,12 @@ export declare const actionToggleZenMode: {
25
28
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
26
29
  suggestedBindings: import("../element/binding").SuggestedBinding[];
27
30
  frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
28
- shouldRenderFrames: boolean;
31
+ frameRendering: {
32
+ enabled: boolean;
33
+ name: boolean;
34
+ outline: boolean;
35
+ clip: boolean;
36
+ };
29
37
  editingFrame: string | null;
30
38
  elementsToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | null;
31
39
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
@@ -34,7 +42,7 @@ export declare const actionToggleZenMode: {
34
42
  lastActiveTool: import("../types").LastActiveTool;
35
43
  locked: boolean;
36
44
  } & ({
37
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
45
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
38
46
  customType: null;
39
47
  } | {
40
48
  type: "custom";
@@ -79,11 +87,11 @@ export declare const actionToggleZenMode: {
79
87
  openDialog: "imageExport" | "help" | "jsonExport" | null;
80
88
  defaultSidebarDockedPreference: boolean;
81
89
  lastPointerDownWith: import("../element/types").PointerType;
82
- selectedElementIds: {
83
- [id: string]: boolean;
84
- };
90
+ selectedElementIds: Readonly<{
91
+ [id: string]: true;
92
+ }>;
85
93
  previousSelectedElementIds: {
86
- [id: string]: boolean;
94
+ [id: string]: true;
87
95
  };
88
96
  selectedElementsAreBeingDragged: boolean;
89
97
  shouldCacheIgnoreZoom: boolean;
@@ -92,7 +100,7 @@ export declare const actionToggleZenMode: {
92
100
  closable?: boolean | undefined;
93
101
  duration?: number | undefined;
94
102
  } | null;
95
- theme: string;
103
+ theme: import("../element/types").Theme;
96
104
  gridSize: number | null;
97
105
  viewModeEnabled: boolean;
98
106
  selectedGroupIds: {
@@ -115,7 +123,7 @@ export declare const actionToggleZenMode: {
115
123
  data: import("../charts").Spreadsheet;
116
124
  };
117
125
  pendingImageElementId: string | null;
118
- showHyperlinkPopup: false | "info" | "editor";
126
+ showHyperlinkPopup: false | "editor" | "info";
119
127
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
120
128
  };
121
129
  commitToHistory: false;
@@ -15,21 +15,22 @@ 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" | "zoomToSelection" | "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" | "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;
22
22
  updateData: (formData?: any) => void;
23
23
  appProps: ExcalidrawProps;
24
24
  data?: Record<string, any>;
25
+ app: AppClassProperties;
25
26
  };
26
27
  export interface Action {
27
28
  name: ActionName;
28
29
  PanelComponent?: React.FC<PanelComponentProps>;
29
30
  perform: ActionFn;
30
31
  keyPriority?: number;
31
- keyTest?: (event: React.KeyboardEvent | KeyboardEvent, appState: AppState, elements: readonly ExcalidrawElement[]) => boolean;
32
- contextItemLabel?: string | ((elements: readonly ExcalidrawElement[], appState: Readonly<AppState>) => string);
32
+ keyTest?: (event: React.KeyboardEvent | KeyboardEvent, appState: AppState, elements: readonly ExcalidrawElement[], app: AppClassProperties) => boolean;
33
+ contextItemLabel?: string | ((elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, app: AppClassProperties) => string);
33
34
  predicate?: (elements: readonly ExcalidrawElement[], appState: AppState, appProps: ExcalidrawProps, app: AppClassProperties) => boolean;
34
35
  checked?: (appState: Readonly<AppState>) => boolean;
35
36
  trackEvent: false | {
@@ -1,20 +1,20 @@
1
1
  import { 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
- theme?: string | undefined;
4
+ theme?: import("./element/types").Theme | undefined;
5
5
  name?: string | undefined;
6
6
  activeTool?: ({
7
7
  lastActiveTool: import("./types").LastActiveTool;
8
8
  locked: boolean;
9
9
  } & ({
10
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "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";
14
14
  customType: string;
15
15
  })) | undefined;
16
- showWelcomeScreen?: boolean | undefined;
17
16
  penMode?: boolean | undefined;
17
+ showWelcomeScreen?: boolean | undefined;
18
18
  penDetected?: boolean | undefined;
19
19
  exportBackground?: boolean | undefined;
20
20
  exportEmbedScene?: boolean | undefined;
@@ -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;
package/types/colors.d.ts CHANGED
@@ -3,9 +3,9 @@ import { Merge } from "./utility-types";
3
3
  export type ColorPickerColor = Exclude<keyof oc, "indigo" | "lime"> | "transparent" | "bronze";
4
4
  export type ColorTuple = readonly [string, string, string, string, string];
5
5
  export type ColorPalette = Merge<Record<ColorPickerColor, ColorTuple>, {
6
- black: string;
7
- white: string;
8
- transparent: string;
6
+ black: "#1e1e1e";
7
+ white: "#ffffff";
8
+ transparent: "transparent";
9
9
  }>;
10
10
  export type ColorPaletteCustom = {
11
11
  [key: string]: ColorTuple | string;
@@ -34,10 +34,10 @@ export declare const DEFAULT_ELEMENT_STROKE_COLOR_PALETTE: {
34
34
  readonly green: ColorTuple;
35
35
  readonly yellow: ColorTuple;
36
36
  readonly orange: ColorTuple;
37
- readonly transparent: string;
38
- readonly white: string;
37
+ readonly transparent: "transparent";
38
+ readonly white: "#ffffff";
39
39
  readonly gray: ColorTuple;
40
- readonly black: string;
40
+ readonly black: "#1e1e1e";
41
41
  readonly bronze: ColorTuple;
42
42
  };
43
43
  export declare const DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE: {
@@ -51,10 +51,10 @@ export declare const DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE: {
51
51
  readonly green: ColorTuple;
52
52
  readonly yellow: ColorTuple;
53
53
  readonly orange: ColorTuple;
54
- readonly transparent: string;
55
- readonly white: string;
54
+ readonly transparent: "transparent";
55
+ readonly white: "#ffffff";
56
56
  readonly gray: ColorTuple;
57
- readonly black: string;
57
+ readonly black: "#1e1e1e";
58
58
  readonly bronze: ColorTuple;
59
59
  };
60
60
  export declare const getAllColorsSpecificShade: (index: 0 | 1 | 2 | 3 | 4) => readonly [string, string, string, string, string, string, string, string, string, string];
@@ -49,6 +49,7 @@ declare class App extends React.Component<AppProps, AppState> {
49
49
  private excalidrawContainerValue;
50
50
  files: BinaryFiles;
51
51
  imageCache: AppClassProperties["imageCache"];
52
+ private iFrameRefs;
52
53
  hitLinkElement?: NonDeletedExcalidrawElement;
53
54
  lastPointerDown: React.PointerEvent<HTMLElement> | null;
54
55
  lastPointerUp: React.PointerEvent<HTMLElement> | PointerEvent | null;
@@ -58,6 +59,13 @@ declare class App extends React.Component<AppProps, AppState> {
58
59
  };
59
60
  constructor(props: AppProps);
60
61
  private renderCanvas;
62
+ private onWindowMessage;
63
+ private updateEmbeddableRef;
64
+ private getHTMLIFrameElement;
65
+ private handleEmbeddableCenterClick;
66
+ private isEmbeddableCenter;
67
+ private updateEmbeddables;
68
+ private renderEmbeddables;
61
69
  private getFrameNameDOMId;
62
70
  frameNameBoundsCache: FrameNameBoundsCache;
63
71
  private renderFrameNames;
@@ -101,7 +109,12 @@ declare class App extends React.Component<AppProps, AppState> {
101
109
  setAppState: React.Component<any, AppState>["setState"];
102
110
  removePointer: (event: React.PointerEvent<HTMLElement> | PointerEvent) => void;
103
111
  toggleLock: (source?: "keyboard" | "ui") => void;
104
- toggleFrameRendering: () => void;
112
+ updateFrameRendering: (opts: Partial<{
113
+ enabled: boolean;
114
+ name: boolean;
115
+ outline: boolean;
116
+ clip: boolean;
117
+ }> | ((prevState: AppState["frameRendering"]) => Partial<AppState["frameRendering"]>)) => void;
105
118
  togglePenMode: () => void;
106
119
  onHandToolToggle: () => void;
107
120
  /**
@@ -111,6 +124,17 @@ declare class App extends React.Component<AppProps, AppState> {
111
124
  private cancelInProgresAnimation;
112
125
  scrollToContent: (target?: ExcalidrawElement | readonly ExcalidrawElement[], opts?: {
113
126
  fitToContent?: boolean;
127
+ fitToViewport?: never;
128
+ viewportZoomFactor?: never;
129
+ animate?: boolean;
130
+ duration?: number;
131
+ } | {
132
+ fitToContent?: never;
133
+ fitToViewport?: boolean;
134
+ /** when fitToViewport=true, how much screen should the content cover,
135
+ * between 0.1 (10%) and 1 (100%)
136
+ */
137
+ viewportZoomFactor?: number;
114
138
  animate?: boolean;
115
139
  duration?: number;
116
140
  }) => void;
@@ -188,8 +212,10 @@ declare class App extends React.Component<AppProps, AppState> {
188
212
  private isHittingCommonBoundingBoxOfSelectedElements;
189
213
  private handleTextOnPointerDown;
190
214
  private handleFreeDrawElementOnPointerDown;
215
+ private insertEmbeddableElement;
191
216
  private createImageElement;
192
217
  private handleLinearElementOnPointerDown;
218
+ private getCurrentItemRoundness;
193
219
  private createGenericElementOnPointerDown;
194
220
  private createFrameElementOnPointerDown;
195
221
  private onKeyDownFromPointerDownHandler;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./Button.scss";
3
2
  interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
4
3
  type?: "button" | "submit" | "reset";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import OpenColor from "open-color";
3
2
  import "./Card.scss";
4
3
  export declare const Card: React.FC<{
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ColorPaletteCustom } from "../../colors";
3
2
  import { ActiveColorPickerSectionAtomType } from "./colorPickerUtils";
4
3
  interface ColorPickerKeyNavHandlerProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { MarkOptional } from "../utility-types";
3
2
  import { SidebarProps, SidebarTriggerProps } from "./Sidebar/common";
4
3
  export declare const DefaultSidebar: import("react").FC<Omit<MarkOptional<Omit<{
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./EyeDropper.scss";
3
2
  type EyeDropperProperties = {
4
3
  keepOpenOnAlt: boolean;
@@ -1,11 +1,10 @@
1
- import { NonDeletedExcalidrawElement } from "../element/types";
2
- import { Device, UIAppState } from "../types";
1
+ import { AppClassProperties, Device, UIAppState } from "../types";
3
2
  import "./HintViewer.scss";
4
3
  interface HintViewerProps {
5
4
  appState: UIAppState;
6
- elements: readonly NonDeletedExcalidrawElement[];
7
5
  isMobile: boolean;
8
6
  device: Device;
7
+ app: AppClassProperties;
9
8
  }
10
- export declare const HintViewer: ({ appState, elements, isMobile, device, }: HintViewerProps) => JSX.Element | null;
9
+ export declare const HintViewer: ({ appState, isMobile, device, app, }: HintViewerProps) => JSX.Element | null;
11
10
  export {};
@@ -26,6 +26,7 @@ interface LayerUIProps {
26
26
  onExportImage: AppClassProperties["onExportImage"];
27
27
  renderWelcomeScreen: boolean;
28
28
  children?: React.ReactNode;
29
+ app: AppClassProperties;
29
30
  }
30
- declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onLockToggle, onHandToolToggle, onPenModeToggle, showExitZenModeBtn, renderTopRightUI, renderCustomStats, UIOptions, onImageAction, onExportImage, renderWelcomeScreen, children, }: LayerUIProps) => JSX.Element>;
31
+ declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onLockToggle, onHandToolToggle, onPenModeToggle, showExitZenModeBtn, renderTopRightUI, renderCustomStats, UIOptions, onImageAction, onExportImage, renderWelcomeScreen, children, app, }: LayerUIProps) => JSX.Element>;
31
32
  export default _default;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { LibraryItem, UIAppState } from "../types";
3
2
  import Library from "../data/library";
4
3
  export declare const LibraryDropdownMenuButton: React.FC<{
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { LibraryItem } from "../types";
3
2
  import "./LibraryUnit.scss";
4
3
  import { SvgCache } from "../hooks/useLibraryItemSvg";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Theme } from "../element/types";
3
2
  export declare const LoadingMessage: React.FC<{
4
3
  delay?: number;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { AppState, Device, ExcalidrawProps, UIAppState } from "../types";
2
+ import { AppClassProperties, AppState, Device, ExcalidrawProps, UIAppState } from "../types";
3
3
  import { ActionManager } from "../actions/manager";
4
4
  import { NonDeletedExcalidrawElement } from "../element/types";
5
5
  type MobileMenuProps = {
@@ -21,6 +21,7 @@ type MobileMenuProps = {
21
21
  renderSidebars: () => JSX.Element | null;
22
22
  device: Device;
23
23
  renderWelcomeScreen: boolean;
24
+ app: AppClassProperties;
24
25
  };
25
- export declare const MobileMenu: ({ appState, elements, actionManager, setAppState, onLockToggle, onHandToolToggle, onPenModeToggle, canvas, onImageAction, renderTopRightUI, renderCustomStats, renderSidebars, device, renderWelcomeScreen, }: MobileMenuProps) => JSX.Element;
26
+ export declare const MobileMenu: ({ appState, elements, actionManager, setAppState, onLockToggle, onHandToolToggle, onPenModeToggle, canvas, onImageAction, renderTopRightUI, renderCustomStats, renderSidebars, device, renderWelcomeScreen, app, }: MobileMenuProps) => JSX.Element;
26
27
  export {};