@excalidraw/excalidraw 0.15.2-bb985eb → 0.15.2-d73cd14

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 (45) hide show
  1. package/dist/excalidraw.development.js +156 -79
  2. package/dist/excalidraw.production.min.js +1 -1
  3. package/dist/excalidraw.production.min.js.LICENSE.txt +0 -15
  4. package/package.json +3 -3
  5. package/types/actions/actionFinalize.d.ts +1 -1
  6. package/types/actions/actionGroup.d.ts +241 -3
  7. package/types/actions/actionProperties.d.ts +2 -0
  8. package/types/actions/actionSelectAll.d.ts +121 -1
  9. package/types/clipboard.d.ts +1 -0
  10. package/types/components/Actions.d.ts +2 -2
  11. package/types/components/App.d.ts +8 -6
  12. package/types/components/ExcalidrawLogo.d.ts +15 -0
  13. package/types/components/JSONExportDialog.d.ts +1 -1
  14. package/types/components/LayerUI.d.ts +3 -2
  15. package/types/components/MobileMenu.d.ts +2 -2
  16. package/types/components/canvases/InteractiveCanvas.d.ts +27 -0
  17. package/types/components/canvases/StaticCanvas.d.ts +18 -0
  18. package/types/components/canvases/index.d.ts +3 -0
  19. package/types/constants.d.ts +1 -0
  20. package/types/data/transform.d.ts +71 -0
  21. package/types/element/Hyperlink.d.ts +1 -1
  22. package/types/element/binding.d.ts +1 -0
  23. package/types/element/linearElementEditor.d.ts +4 -4
  24. package/types/element/newElement.d.ts +10 -6
  25. package/types/element/sizeHelpers.d.ts +8 -1
  26. package/types/element/textElement.d.ts +3 -1
  27. package/types/element/textWysiwyg.d.ts +1 -1
  28. package/types/element/transformHandles.d.ts +2 -2
  29. package/types/element/types.d.ts +5 -5
  30. package/types/frame.d.ts +4 -4
  31. package/types/groups.d.ts +11 -11
  32. package/types/packages/excalidraw/example/initialData.d.ts +182 -70
  33. package/types/packages/excalidraw/index.d.ts +1 -0
  34. package/types/renderer/renderElement.d.ts +9 -21
  35. package/types/renderer/renderScene.d.ts +16 -36
  36. package/types/scene/Renderer.d.ts +25 -0
  37. package/types/scene/Scene.d.ts +2 -0
  38. package/types/scene/Shape.d.ts +12 -0
  39. package/types/scene/ShapeCache.d.ts +20 -0
  40. package/types/scene/scroll.d.ts +1 -1
  41. package/types/scene/scrollbars.d.ts +2 -6
  42. package/types/scene/selection.d.ts +2 -2
  43. package/types/scene/types.d.ts +57 -24
  44. package/types/types.d.ts +43 -3
  45. package/types/utils.d.ts +12 -4
@@ -1,9 +1,3 @@
1
- /*
2
- object-assign
3
- (c) Sindre Sorhus
4
- @license MIT
5
- */
6
-
7
1
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
8
2
 
9
3
  /**
@@ -35,12 +29,3 @@ object-assign
35
29
  * This source code is licensed under the MIT license found in the
36
30
  * LICENSE file in the root directory of this source tree.
37
31
  */
38
-
39
- /** @license React v17.0.2
40
- * react-jsx-runtime.production.min.js
41
- *
42
- * Copyright (c) Facebook, Inc. and its affiliates.
43
- *
44
- * This source code is licensed under the MIT license found in the
45
- * LICENSE file in the root directory of this source tree.
46
- */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@excalidraw/excalidraw",
3
- "version": "0.15.2-bb985eb",
3
+ "version": "0.15.2-d73cd14",
4
4
  "main": "main.js",
5
5
  "types": "types/packages/excalidraw/index.d.ts",
6
6
  "files": [
@@ -52,7 +52,7 @@
52
52
  "@babel/preset-env": "7.18.6",
53
53
  "@babel/preset-react": "7.18.6",
54
54
  "@babel/preset-typescript": "7.18.6",
55
- "@size-limit/preset-big-lib": "8.2.6",
55
+ "@size-limit/preset-big-lib": "9.0.0",
56
56
  "autoprefixer": "10.4.7",
57
57
  "babel-loader": "8.2.5",
58
58
  "babel-plugin-transform-class-properties": "6.24.1",
@@ -63,7 +63,7 @@
63
63
  "mini-css-extract-plugin": "2.6.1",
64
64
  "postcss-loader": "7.0.1",
65
65
  "sass-loader": "13.0.2",
66
- "size-limit": "8.2.4",
66
+ "size-limit": "9.0.0",
67
67
  "style-loader": "3.3.3",
68
68
  "terser-webpack-plugin": "5.3.3",
69
69
  "ts-loader": "9.3.1",
@@ -3,7 +3,7 @@ import { AppState } from "../types";
3
3
  export declare const actionFinalize: {
4
4
  name: "finalize";
5
5
  trackEvent: false;
6
- perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<AppState>, _: any, { canvas, focusContainer, scene }: import("../types").AppClassProperties) => {
6
+ perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<AppState>, _: any, { interactiveCanvas, focusContainer, scene }: import("../types").AppClassProperties) => {
7
7
  elements: import("../element/types").ExcalidrawElement[] | undefined;
8
8
  appState: {
9
9
  cursorButton: "up";
@@ -1,4 +1,4 @@
1
- import { ExcalidrawElement } from "../element/types";
1
+ import { ExcalidrawElement, ExcalidrawFrameElement } from "../element/types";
2
2
  import { AppClassProperties, AppState } from "../types";
3
3
  export declare const actionGroup: {
4
4
  name: "group";
@@ -10,7 +10,126 @@ export declare const actionGroup: {
10
10
  elements: readonly ExcalidrawElement[];
11
11
  commitToHistory: false;
12
12
  } | {
13
- appState: AppState;
13
+ appState: {
14
+ selectedElementIds: Readonly<{
15
+ [id: string]: true;
16
+ }>;
17
+ selectedGroupIds: {
18
+ [groupId: string]: boolean;
19
+ };
20
+ editingGroupId: string | null;
21
+ contextMenu: {
22
+ items: import("../components/ContextMenu").ContextMenuItems;
23
+ top: number;
24
+ left: number;
25
+ } | null;
26
+ showWelcomeScreen: boolean;
27
+ isLoading: boolean;
28
+ errorMessage: import("react").ReactNode;
29
+ activeEmbeddable: {
30
+ element: import("../element/types").NonDeletedExcalidrawElement;
31
+ state: "active" | "hover";
32
+ } | null;
33
+ draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
34
+ resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
35
+ multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
36
+ selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
37
+ isBindingEnabled: boolean;
38
+ startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
39
+ suggestedBindings: import("../element/binding").SuggestedBinding[];
40
+ frameToHighlight: import("../element/types").NonDeleted<ExcalidrawFrameElement> | null;
41
+ frameRendering: {
42
+ enabled: boolean;
43
+ name: boolean;
44
+ outline: boolean;
45
+ clip: boolean;
46
+ };
47
+ editingFrame: string | null;
48
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
49
+ editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
50
+ editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
51
+ activeTool: {
52
+ lastActiveTool: import("../types").LastActiveTool;
53
+ locked: boolean;
54
+ } & ({
55
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
56
+ customType: null;
57
+ } | {
58
+ type: "custom";
59
+ customType: string;
60
+ });
61
+ penMode: boolean;
62
+ penDetected: boolean;
63
+ exportBackground: boolean;
64
+ exportEmbedScene: boolean;
65
+ exportWithDarkMode: boolean;
66
+ exportScale: number;
67
+ currentItemStrokeColor: string;
68
+ currentItemBackgroundColor: string;
69
+ currentItemFillStyle: import("../element/types").FillStyle;
70
+ currentItemStrokeWidth: number;
71
+ currentItemStrokeStyle: import("../element/types").StrokeStyle;
72
+ currentItemRoughness: number;
73
+ currentItemOpacity: number;
74
+ currentItemFontFamily: number;
75
+ currentItemFontSize: number;
76
+ currentItemTextAlign: string;
77
+ currentItemStartArrowhead: import("../element/types").Arrowhead | null;
78
+ currentItemEndArrowhead: import("../element/types").Arrowhead | null;
79
+ currentItemRoundness: import("../element/types").StrokeRoundness;
80
+ viewBackgroundColor: string;
81
+ scrollX: number;
82
+ scrollY: number;
83
+ cursorButton: "up" | "down";
84
+ scrolledOutside: boolean;
85
+ name: string;
86
+ isResizing: boolean;
87
+ isRotating: boolean;
88
+ zoom: Readonly<{
89
+ value: import("../types").NormalizedZoomValue;
90
+ }>;
91
+ openMenu: "canvas" | "shape" | null;
92
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
93
+ openSidebar: {
94
+ name: string;
95
+ tab?: string | undefined;
96
+ } | null;
97
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
98
+ defaultSidebarDockedPreference: boolean;
99
+ lastPointerDownWith: import("../element/types").PointerType;
100
+ previousSelectedElementIds: {
101
+ [id: string]: true;
102
+ };
103
+ selectedElementsAreBeingDragged: boolean;
104
+ shouldCacheIgnoreZoom: boolean;
105
+ toast: {
106
+ message: string;
107
+ closable?: boolean | undefined;
108
+ duration?: number | undefined;
109
+ } | null;
110
+ zenModeEnabled: boolean;
111
+ theme: import("../element/types").Theme;
112
+ gridSize: number | null;
113
+ viewModeEnabled: boolean;
114
+ width: number;
115
+ height: number;
116
+ offsetTop: number;
117
+ offsetLeft: number;
118
+ fileHandle: import("browser-fs-access").FileSystemHandle | null;
119
+ collaborators: Map<string, import("../types").Collaborator>;
120
+ showStats: boolean;
121
+ currentChartType: import("../element/types").ChartType;
122
+ pasteDialog: {
123
+ shown: false;
124
+ data: null;
125
+ } | {
126
+ shown: true;
127
+ data: import("../charts").Spreadsheet;
128
+ };
129
+ pendingImageElementId: string | null;
130
+ showHyperlinkPopup: false | "editor" | "info";
131
+ selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
132
+ };
14
133
  elements: ExcalidrawElement[];
15
134
  commitToHistory: true;
16
135
  };
@@ -31,7 +150,126 @@ export declare const actionUngroup: {
31
150
  elements: readonly ExcalidrawElement[];
32
151
  commitToHistory: false;
33
152
  } | {
34
- appState: AppState;
153
+ appState: {
154
+ selectedElementIds: Readonly<{
155
+ [id: string]: true;
156
+ }>;
157
+ selectedGroupIds: {
158
+ [groupId: string]: boolean;
159
+ };
160
+ editingGroupId: string | null;
161
+ contextMenu: {
162
+ items: import("../components/ContextMenu").ContextMenuItems;
163
+ top: number;
164
+ left: number;
165
+ } | null;
166
+ showWelcomeScreen: boolean;
167
+ isLoading: boolean;
168
+ errorMessage: import("react").ReactNode;
169
+ activeEmbeddable: {
170
+ element: import("../element/types").NonDeletedExcalidrawElement;
171
+ state: "active" | "hover";
172
+ } | null;
173
+ draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
174
+ resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
175
+ multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
176
+ selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
177
+ isBindingEnabled: boolean;
178
+ startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
179
+ suggestedBindings: import("../element/binding").SuggestedBinding[];
180
+ frameToHighlight: import("../element/types").NonDeleted<ExcalidrawFrameElement> | null;
181
+ frameRendering: {
182
+ enabled: boolean;
183
+ name: boolean;
184
+ outline: boolean;
185
+ clip: boolean;
186
+ };
187
+ editingFrame: string | null;
188
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
189
+ editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
190
+ editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
191
+ activeTool: {
192
+ lastActiveTool: import("../types").LastActiveTool;
193
+ locked: boolean;
194
+ } & ({
195
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
196
+ customType: null;
197
+ } | {
198
+ type: "custom";
199
+ customType: string;
200
+ });
201
+ penMode: boolean;
202
+ penDetected: boolean;
203
+ exportBackground: boolean;
204
+ exportEmbedScene: boolean;
205
+ exportWithDarkMode: boolean;
206
+ exportScale: number;
207
+ currentItemStrokeColor: string;
208
+ currentItemBackgroundColor: string;
209
+ currentItemFillStyle: import("../element/types").FillStyle;
210
+ currentItemStrokeWidth: number;
211
+ currentItemStrokeStyle: import("../element/types").StrokeStyle;
212
+ currentItemRoughness: number;
213
+ currentItemOpacity: number;
214
+ currentItemFontFamily: number;
215
+ currentItemFontSize: number;
216
+ currentItemTextAlign: string;
217
+ currentItemStartArrowhead: import("../element/types").Arrowhead | null;
218
+ currentItemEndArrowhead: import("../element/types").Arrowhead | null;
219
+ currentItemRoundness: import("../element/types").StrokeRoundness;
220
+ viewBackgroundColor: string;
221
+ scrollX: number;
222
+ scrollY: number;
223
+ cursorButton: "up" | "down";
224
+ scrolledOutside: boolean;
225
+ name: string;
226
+ isResizing: boolean;
227
+ isRotating: boolean;
228
+ zoom: Readonly<{
229
+ value: import("../types").NormalizedZoomValue;
230
+ }>;
231
+ openMenu: "canvas" | "shape" | null;
232
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
233
+ openSidebar: {
234
+ name: string;
235
+ tab?: string | undefined;
236
+ } | null;
237
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
238
+ defaultSidebarDockedPreference: boolean;
239
+ lastPointerDownWith: import("../element/types").PointerType;
240
+ previousSelectedElementIds: {
241
+ [id: string]: true;
242
+ };
243
+ selectedElementsAreBeingDragged: boolean;
244
+ shouldCacheIgnoreZoom: boolean;
245
+ toast: {
246
+ message: string;
247
+ closable?: boolean | undefined;
248
+ duration?: number | undefined;
249
+ } | null;
250
+ zenModeEnabled: boolean;
251
+ theme: import("../element/types").Theme;
252
+ gridSize: number | null;
253
+ viewModeEnabled: boolean;
254
+ width: number;
255
+ height: number;
256
+ offsetTop: number;
257
+ offsetLeft: number;
258
+ fileHandle: import("browser-fs-access").FileSystemHandle | null;
259
+ collaborators: Map<string, import("../types").Collaborator>;
260
+ showStats: boolean;
261
+ currentChartType: import("../element/types").ChartType;
262
+ pasteDialog: {
263
+ shown: false;
264
+ data: null;
265
+ } | {
266
+ shown: true;
267
+ data: import("../charts").Spreadsheet;
268
+ };
269
+ pendingImageElementId: string | null;
270
+ showHyperlinkPopup: false | "editor" | "info";
271
+ selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
272
+ };
35
273
  elements: ExcalidrawElement[];
36
274
  commitToHistory: true;
37
275
  };
@@ -1,5 +1,7 @@
1
1
  import { AppState } from "../../src/types";
2
2
  import { Arrowhead, ExcalidrawElement, ExcalidrawLinearElement } from "../element/types";
3
+ export declare const changeProperty: (elements: readonly ExcalidrawElement[], appState: AppState, callback: (element: ExcalidrawElement) => ExcalidrawElement, includeBoundText?: boolean) => ExcalidrawElement[];
4
+ export declare const getFormValue: <T>(elements: readonly ExcalidrawElement[], appState: AppState, getAttribute: (element: ExcalidrawElement) => T, defaultValue: T) => T;
3
5
  export declare const actionChangeStrokeColor: {
4
6
  name: "changeStrokeColor";
5
7
  trackEvent: false;
@@ -1,11 +1,131 @@
1
1
  import { ExcalidrawElement } from "../element/types";
2
+ import { LinearElementEditor } from "../element/linearElementEditor";
2
3
  export declare const actionSelectAll: {
3
4
  name: "selectAll";
4
5
  trackEvent: {
5
6
  category: "canvas";
6
7
  };
7
8
  perform: (elements: readonly ExcalidrawElement[], appState: Readonly<import("../types").AppState>, value: any, app: import("../types").AppClassProperties) => false | {
8
- appState: import("../types").AppState;
9
+ appState: {
10
+ selectedLinearElement: LinearElementEditor | null;
11
+ selectedElementIds: Readonly<{
12
+ [id: string]: true;
13
+ }>;
14
+ selectedGroupIds: {
15
+ [groupId: string]: boolean;
16
+ };
17
+ editingGroupId: string | null;
18
+ contextMenu: {
19
+ items: import("../components/ContextMenu").ContextMenuItems;
20
+ top: number;
21
+ left: number;
22
+ } | null;
23
+ showWelcomeScreen: boolean;
24
+ isLoading: boolean;
25
+ errorMessage: import("react").ReactNode;
26
+ activeEmbeddable: {
27
+ element: import("../element/types").NonDeletedExcalidrawElement;
28
+ state: "active" | "hover";
29
+ } | null;
30
+ draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
31
+ resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
32
+ multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
33
+ selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
34
+ isBindingEnabled: boolean;
35
+ startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
36
+ suggestedBindings: import("../element/binding").SuggestedBinding[];
37
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
38
+ frameRendering: {
39
+ enabled: boolean;
40
+ name: boolean;
41
+ outline: boolean;
42
+ clip: boolean;
43
+ };
44
+ editingFrame: string | null;
45
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
46
+ editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
47
+ editingLinearElement: LinearElementEditor | null;
48
+ activeTool: {
49
+ lastActiveTool: import("../types").LastActiveTool;
50
+ locked: boolean;
51
+ } & ({
52
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
53
+ customType: null;
54
+ } | {
55
+ type: "custom";
56
+ customType: string;
57
+ });
58
+ penMode: boolean;
59
+ penDetected: boolean;
60
+ exportBackground: boolean;
61
+ exportEmbedScene: boolean;
62
+ exportWithDarkMode: boolean;
63
+ exportScale: number;
64
+ currentItemStrokeColor: string;
65
+ currentItemBackgroundColor: string;
66
+ currentItemFillStyle: import("../element/types").FillStyle;
67
+ currentItemStrokeWidth: number;
68
+ currentItemStrokeStyle: import("../element/types").StrokeStyle;
69
+ currentItemRoughness: number;
70
+ currentItemOpacity: number;
71
+ currentItemFontFamily: number;
72
+ currentItemFontSize: number;
73
+ currentItemTextAlign: string;
74
+ currentItemStartArrowhead: import("../element/types").Arrowhead | null;
75
+ currentItemEndArrowhead: import("../element/types").Arrowhead | null;
76
+ currentItemRoundness: import("../element/types").StrokeRoundness;
77
+ viewBackgroundColor: string;
78
+ scrollX: number;
79
+ scrollY: number;
80
+ cursorButton: "up" | "down";
81
+ scrolledOutside: boolean;
82
+ name: string;
83
+ isResizing: boolean;
84
+ isRotating: boolean;
85
+ zoom: Readonly<{
86
+ value: import("../types").NormalizedZoomValue;
87
+ }>;
88
+ openMenu: "canvas" | "shape" | null;
89
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
90
+ openSidebar: {
91
+ name: string;
92
+ tab?: string | undefined;
93
+ } | null;
94
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
95
+ defaultSidebarDockedPreference: boolean;
96
+ lastPointerDownWith: import("../element/types").PointerType;
97
+ previousSelectedElementIds: {
98
+ [id: string]: true;
99
+ };
100
+ selectedElementsAreBeingDragged: boolean;
101
+ shouldCacheIgnoreZoom: boolean;
102
+ toast: {
103
+ message: string;
104
+ closable?: boolean | undefined;
105
+ duration?: number | undefined;
106
+ } | null;
107
+ zenModeEnabled: boolean;
108
+ theme: import("../element/types").Theme;
109
+ gridSize: number | null;
110
+ viewModeEnabled: boolean;
111
+ width: number;
112
+ height: number;
113
+ offsetTop: number;
114
+ offsetLeft: number;
115
+ fileHandle: import("browser-fs-access").FileSystemHandle | null;
116
+ collaborators: Map<string, import("../types").Collaborator>;
117
+ showStats: boolean;
118
+ currentChartType: import("../element/types").ChartType;
119
+ pasteDialog: {
120
+ shown: false;
121
+ data: null;
122
+ } | {
123
+ shown: true;
124
+ data: import("../charts").Spreadsheet;
125
+ };
126
+ pendingImageElementId: string | null;
127
+ showHyperlinkPopup: false | "editor" | "info";
128
+ };
9
129
  commitToHistory: true;
10
130
  };
11
131
  contextItemLabel: string;
@@ -7,6 +7,7 @@ export interface ClipboardData {
7
7
  files?: BinaryFiles;
8
8
  text?: string;
9
9
  errorMessage?: string;
10
+ programmaticAPI?: boolean;
10
11
  }
11
12
  export declare const probablySupportsClipboardReadText: boolean;
12
13
  export declare const probablySupportsClipboardWriteText: boolean;
@@ -8,8 +8,8 @@ export declare const SelectedShapeActions: ({ appState, elements, renderAction,
8
8
  elements: readonly ExcalidrawElement[];
9
9
  renderAction: ActionManager["renderAction"];
10
10
  }) => JSX.Element;
11
- export declare const ShapesSwitcher: ({ canvas, activeTool, setAppState, onImageAction, appState, }: {
12
- canvas: HTMLCanvasElement | null;
11
+ export declare const ShapesSwitcher: ({ interactiveCanvas, activeTool, setAppState, onImageAction, appState, }: {
12
+ interactiveCanvas: HTMLCanvasElement | null;
13
13
  activeTool: UIAppState["activeTool"];
14
14
  setAppState: React.Component<any, UIAppState>["setState"];
15
15
  onImageAction: (data: {
@@ -8,6 +8,7 @@ import History from "../history";
8
8
  import Scene from "../scene/Scene";
9
9
  import { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, Device, FrameNameBoundsCache, SidebarName, SidebarTabName } from "../types";
10
10
  import { FileSystemHandle } from "../data/filesystem";
11
+ import { Renderer } from "../scene/Renderer";
11
12
  export declare const ExcalidrawContainerContext: React.Context<{
12
13
  container: HTMLDivElement | null;
13
14
  id: string | null;
@@ -31,7 +32,8 @@ export declare const useExcalidrawSetAppState: () => <K extends keyof AppState>(
31
32
  export declare const useExcalidrawActionManager: () => ActionManager;
32
33
  declare class App extends React.Component<AppProps, AppState> {
33
34
  canvas: AppClassProperties["canvas"];
34
- rc: RoughCanvas | null;
35
+ interactiveCanvas: AppClassProperties["interactiveCanvas"];
36
+ rc: RoughCanvas;
35
37
  unmounted: boolean;
36
38
  actionManager: ActionManager;
37
39
  device: Device;
@@ -39,6 +41,7 @@ declare class App extends React.Component<AppProps, AppState> {
39
41
  private excalidrawContainerRef;
40
42
  static defaultProps: Partial<AppProps>;
41
43
  scene: Scene;
44
+ renderer: Renderer;
42
45
  private fonts;
43
46
  private resizeObserver;
44
47
  private nearestScrollableContainer;
@@ -58,7 +61,6 @@ declare class App extends React.Component<AppProps, AppState> {
58
61
  y: number;
59
62
  };
60
63
  constructor(props: AppProps);
61
- private renderCanvas;
62
64
  private onWindowMessage;
63
65
  private updateEmbeddableRef;
64
66
  private getHTMLIFrameElement;
@@ -94,15 +96,15 @@ declare class App extends React.Component<AppProps, AppState> {
94
96
  private removeEventListeners;
95
97
  private addEventListeners;
96
98
  componentDidUpdate(prevProps: AppProps, prevState: AppState): void;
97
- private renderScene;
99
+ private renderInteractiveSceneCallback;
98
100
  private onScroll;
99
101
  private onCut;
100
102
  private onCopy;
101
103
  private cutAll;
102
104
  private copyAll;
103
105
  private static resetTapTwice;
104
- private onTapStart;
105
- private onTapEnd;
106
+ private onTouchStart;
107
+ private onTouchEnd;
106
108
  pasteFromClipboard: (event: ClipboardEvent | null) => Promise<void>;
107
109
  private addElementsFromPasteOrLibrary;
108
110
  private addTextFromPaste;
@@ -246,7 +248,7 @@ declare class App extends React.Component<AppProps, AppState> {
246
248
  private maybeSuggestBindingsForLinearElementAtCoords;
247
249
  private maybeSuggestBindingForAll;
248
250
  private clearSelection;
249
- private handleCanvasRef;
251
+ private handleInteractiveCanvasRef;
250
252
  private handleAppOnDrop;
251
253
  loadFileToCanvas: (file: File, fileHandle: FileSystemHandle | null) => Promise<void>;
252
254
  private handleCanvasContextMenu;
@@ -0,0 +1,15 @@
1
+ import "./ExcalidrawLogo.scss";
2
+ type LogoSize = "xs" | "small" | "normal" | "large" | "custom";
3
+ interface LogoProps {
4
+ size?: LogoSize;
5
+ withText?: boolean;
6
+ style?: React.CSSProperties;
7
+ /**
8
+ * If true, the logo will not be wrapped in a Link component.
9
+ * The link prop will be ignored as well.
10
+ * It will merely be a plain div.
11
+ */
12
+ isNotLink?: boolean;
13
+ }
14
+ export declare const ExcalidrawLogo: ({ style, size, withText, }: LogoProps) => JSX.Element;
15
+ export {};
@@ -10,6 +10,6 @@ export declare const JSONExportDialog: ({ elements, appState, files, actionManag
10
10
  files: BinaryFiles;
11
11
  actionManager: ActionManager;
12
12
  exportOpts: ExportOpts;
13
- canvas: HTMLCanvasElement | null;
13
+ canvas: HTMLCanvasElement;
14
14
  setAppState: React.Component<any, UIAppState>["setState"];
15
15
  }) => JSX.Element;
@@ -9,7 +9,8 @@ interface LayerUIProps {
9
9
  actionManager: ActionManager;
10
10
  appState: UIAppState;
11
11
  files: BinaryFiles;
12
- canvas: HTMLCanvasElement | null;
12
+ canvas: HTMLCanvasElement;
13
+ interactiveCanvas: HTMLCanvasElement | null;
13
14
  setAppState: React.Component<any, AppState>["setState"];
14
15
  elements: readonly NonDeletedExcalidrawElement[];
15
16
  onLockToggle: () => void;
@@ -28,5 +29,5 @@ interface LayerUIProps {
28
29
  children?: React.ReactNode;
29
30
  app: AppClassProperties;
30
31
  }
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>;
32
+ declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, interactiveCanvas, onLockToggle, onHandToolToggle, onPenModeToggle, showExitZenModeBtn, renderTopRightUI, renderCustomStats, UIOptions, onImageAction, onExportImage, renderWelcomeScreen, children, app, }: LayerUIProps) => JSX.Element>;
32
33
  export default _default;
@@ -12,7 +12,7 @@ type MobileMenuProps = {
12
12
  onLockToggle: () => void;
13
13
  onHandToolToggle: () => void;
14
14
  onPenModeToggle: () => void;
15
- canvas: HTMLCanvasElement | null;
15
+ interactiveCanvas: HTMLCanvasElement | null;
16
16
  onImageAction: (data: {
17
17
  insertOnCanvasDirectly: boolean;
18
18
  }) => void;
@@ -23,5 +23,5 @@ type MobileMenuProps = {
23
23
  renderWelcomeScreen: boolean;
24
24
  app: AppClassProperties;
25
25
  };
26
- export declare const MobileMenu: ({ appState, elements, actionManager, setAppState, onLockToggle, onHandToolToggle, onPenModeToggle, canvas, onImageAction, renderTopRightUI, renderCustomStats, renderSidebars, device, renderWelcomeScreen, app, }: MobileMenuProps) => JSX.Element;
26
+ export declare const MobileMenu: ({ appState, elements, actionManager, setAppState, onLockToggle, onHandToolToggle, onPenModeToggle, interactiveCanvas, onImageAction, renderTopRightUI, renderCustomStats, renderSidebars, device, renderWelcomeScreen, app, }: MobileMenuProps) => JSX.Element;
27
27
  export {};
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ import type { DOMAttributes } from "react";
3
+ import type { InteractiveCanvasAppState } from "../../types";
4
+ import type { RenderInteractiveSceneCallback } from "../../scene/types";
5
+ import type { NonDeletedExcalidrawElement } from "../../element/types";
6
+ type InteractiveCanvasProps = {
7
+ containerRef: React.RefObject<HTMLDivElement>;
8
+ canvas: HTMLCanvasElement | null;
9
+ elements: readonly NonDeletedExcalidrawElement[];
10
+ visibleElements: readonly NonDeletedExcalidrawElement[];
11
+ selectedElements: readonly NonDeletedExcalidrawElement[];
12
+ versionNonce: number | undefined;
13
+ selectionNonce: number | undefined;
14
+ scale: number;
15
+ appState: InteractiveCanvasAppState;
16
+ renderInteractiveSceneCallback: (data: RenderInteractiveSceneCallback) => void;
17
+ handleCanvasRef: (canvas: HTMLCanvasElement | null) => void;
18
+ onContextMenu: Exclude<DOMAttributes<HTMLCanvasElement | HTMLDivElement>["onContextMenu"], undefined>;
19
+ onPointerMove: Exclude<DOMAttributes<HTMLCanvasElement>["onPointerMove"], undefined>;
20
+ onPointerUp: Exclude<DOMAttributes<HTMLCanvasElement>["onPointerUp"], undefined>;
21
+ onPointerCancel: Exclude<DOMAttributes<HTMLCanvasElement>["onPointerCancel"], undefined>;
22
+ onTouchMove: Exclude<DOMAttributes<HTMLCanvasElement>["onTouchMove"], undefined>;
23
+ onPointerDown: Exclude<DOMAttributes<HTMLCanvasElement>["onPointerDown"], undefined>;
24
+ onDoubleClick: Exclude<DOMAttributes<HTMLCanvasElement>["onDoubleClick"], undefined>;
25
+ };
26
+ declare const _default: React.MemoExoticComponent<(props: InteractiveCanvasProps) => JSX.Element>;
27
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ import { RoughCanvas } from "roughjs/bin/canvas";
3
+ import type { StaticCanvasAppState } from "../../types";
4
+ import type { StaticCanvasRenderConfig } from "../../scene/types";
5
+ import type { NonDeletedExcalidrawElement } from "../../element/types";
6
+ type StaticCanvasProps = {
7
+ canvas: HTMLCanvasElement;
8
+ rc: RoughCanvas;
9
+ elements: readonly NonDeletedExcalidrawElement[];
10
+ visibleElements: readonly NonDeletedExcalidrawElement[];
11
+ versionNonce: number | undefined;
12
+ selectionNonce: number | undefined;
13
+ scale: number;
14
+ appState: StaticCanvasAppState;
15
+ renderConfig: StaticCanvasRenderConfig;
16
+ };
17
+ declare const _default: React.MemoExoticComponent<(props: StaticCanvasProps) => JSX.Element>;
18
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import InteractiveCanvas from "./InteractiveCanvas";
2
+ import StaticCanvas from "./StaticCanvas";
3
+ export { InteractiveCanvas, StaticCanvas };