@zsviczian/excalidraw 0.13.0-obsidian-1 → 0.14.0-obsidian

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 (88) hide show
  1. package/README.md +418 -20
  2. package/dist/excalidraw.development.js +571 -1154
  3. package/dist/excalidraw.production.min.js +1 -1
  4. package/dist/excalidraw.production.min.js.LICENSE.txt +0 -102
  5. package/package.json +1 -1
  6. package/types/actions/actionAddToLibrary.d.ts +21 -9
  7. package/types/actions/actionAlign.d.ts +6 -18
  8. package/types/actions/actionBoundText.d.ts +9 -5
  9. package/types/actions/actionCanvas.d.ts +83 -55
  10. package/types/actions/actionClipboard.d.ts +63 -16
  11. package/types/actions/actionDeleteSelected.d.ts +31 -12
  12. package/types/actions/actionDistribute.d.ts +2 -6
  13. package/types/actions/actionDuplicateSelection.d.ts +1 -3
  14. package/types/actions/actionExport.d.ts +79 -58
  15. package/types/actions/actionFinalize.d.ts +15 -9
  16. package/types/actions/actionFlip.d.ts +2 -2
  17. package/types/actions/actionGroup.d.ts +4 -8
  18. package/types/actions/actionLinearEditor.d.ts +8 -4
  19. package/types/actions/actionMenu.d.ts +24 -17
  20. package/types/actions/actionNavigate.d.ts +2 -3
  21. package/types/actions/actionProperties.d.ts +106 -80
  22. package/types/actions/actionStyles.d.ts +7 -3
  23. package/types/actions/actionToggleGridMode.d.ts +9 -3
  24. package/types/actions/actionToggleLock.d.ts +7 -3
  25. package/types/actions/actionToggleStats.d.ts +8 -3
  26. package/types/actions/actionToggleViewMode.d.ts +9 -3
  27. package/types/actions/actionToggleZenMode.d.ts +9 -3
  28. package/types/actions/actionZindex.d.ts +4 -12
  29. package/types/actions/manager.d.ts +2 -1
  30. package/types/actions/types.d.ts +6 -5
  31. package/types/appState.d.ts +8 -9
  32. package/types/clipboard.d.ts +6 -1
  33. package/types/components/App.d.ts +8 -51
  34. package/types/components/Button.d.ts +15 -0
  35. package/types/components/CollabButton.d.ts +1 -2
  36. package/types/components/ContextMenu.d.ts +8 -21
  37. package/types/components/JSONExportDialog.d.ts +3 -1
  38. package/types/components/LayerUI.d.ts +2 -3
  39. package/types/components/LibraryMenuHeaderContent.d.ts +23 -0
  40. package/types/components/MobileMenu.d.ts +4 -6
  41. package/types/components/UserList.d.ts +0 -2
  42. package/types/components/dropdownMenu/DropdownMenu.d.ts +64 -0
  43. package/types/components/dropdownMenu/DropdownMenuContent.d.ts +11 -0
  44. package/types/components/dropdownMenu/DropdownMenuGroup.d.ts +11 -0
  45. package/types/components/dropdownMenu/DropdownMenuItem.d.ts +13 -0
  46. package/types/components/dropdownMenu/DropdownMenuItemContent.d.ts +6 -0
  47. package/types/components/dropdownMenu/DropdownMenuItemCustom.d.ts +6 -0
  48. package/types/components/dropdownMenu/DropdownMenuItemLink.d.ts +12 -0
  49. package/types/components/dropdownMenu/DropdownMenuSeparator.d.ts +5 -0
  50. package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +9 -0
  51. package/types/components/dropdownMenu/dropdownMenuUtils.d.ts +3 -0
  52. package/types/components/footer/Footer.d.ts +13 -0
  53. package/types/components/footer/FooterCenter.d.ts +8 -0
  54. package/types/components/icons.d.ts +1 -1
  55. package/types/components/live-collaboration/LiveCollaborationTrigger.d.ts +10 -0
  56. package/types/components/main-menu/DefaultItems.d.ts +44 -0
  57. package/types/components/main-menu/MainMenu.d.ts +55 -0
  58. package/types/components/mainMenu/DefaultItems.d.ts +44 -0
  59. package/types/components/mainMenu/MainMenu.d.ts +63 -0
  60. package/types/components/welcome-screen/WelcomeScreen.Center.d.ts +58 -0
  61. package/types/components/welcome-screen/WelcomeScreen.Hints.d.ts +19 -0
  62. package/types/components/welcome-screen/WelcomeScreen.d.ts +85 -0
  63. package/types/constants.d.ts +6 -7
  64. package/types/element/Hyperlink.d.ts +9 -7
  65. package/types/element/bounds.d.ts +3 -2
  66. package/types/element/linearElementEditor.d.ts +38 -6
  67. package/types/element/newElement.d.ts +2 -2
  68. package/types/element/resizeElements.d.ts +0 -1
  69. package/types/element/textElement.d.ts +24 -2
  70. package/types/element/textWysiwyg.d.ts +6 -1
  71. package/types/element/transformHandles.d.ts +2 -3
  72. package/types/element/typeChecks.d.ts +10 -1
  73. package/types/element/types.d.ts +11 -4
  74. package/types/excalidraw-app/data/index.d.ts +13 -9
  75. package/types/excalidraw-app/data/localStorage.d.ts +13 -9
  76. package/types/keys.d.ts +2 -0
  77. package/types/math.d.ts +2 -1
  78. package/types/packages/excalidraw/example/CustomFooter.d.ts +5 -0
  79. package/types/packages/excalidraw/example/MobileFooter.d.ts +5 -0
  80. package/types/packages/excalidraw/index.d.ts +10 -0
  81. package/types/renderer/easingFunctions.d.ts +6 -0
  82. package/types/renderer/renderElement.d.ts +4 -3
  83. package/types/scene/Fonts.d.ts +21 -0
  84. package/types/scene/Scene.d.ts +15 -0
  85. package/types/scene/comparisons.d.ts +2 -3
  86. package/types/scene/index.d.ts +1 -1
  87. package/types/types.d.ts +43 -22
  88. package/types/utils.d.ts +17 -0
@@ -11,110 +11,8 @@ https://github.com/nodeca/pica
11
11
 
12
12
  */
13
13
 
14
- /*! *****************************************************************************
15
- Copyright (c) Microsoft Corporation. All rights reserved.
16
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
17
- this file except in compliance with the License. You may obtain a copy of the
18
- License at http://www.apache.org/licenses/LICENSE-2.0
19
-
20
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
22
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
23
- MERCHANTABLITY OR NON-INFRINGEMENT.
24
-
25
- See the Apache Version 2.0 License for specific language governing permissions
26
- and limitations under the License.
27
- ***************************************************************************** */
28
-
29
- /*! https://mths.be/utf8js v2.1.2 by @mathias */
30
-
31
14
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
32
15
 
33
- /**
34
- * @license
35
- * Copyright 2017 Google LLC
36
- *
37
- * Licensed under the Apache License, Version 2.0 (the "License");
38
- * you may not use this file except in compliance with the License.
39
- * You may obtain a copy of the License at
40
- *
41
- * http://www.apache.org/licenses/LICENSE-2.0
42
- *
43
- * Unless required by applicable law or agreed to in writing, software
44
- * distributed under the License is distributed on an "AS IS" BASIS,
45
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
46
- * See the License for the specific language governing permissions and
47
- * limitations under the License.
48
- */
49
-
50
- /**
51
- * @license
52
- * Copyright 2018 Google LLC
53
- *
54
- * Licensed under the Apache License, Version 2.0 (the "License");
55
- * you may not use this file except in compliance with the License.
56
- * You may obtain a copy of the License at
57
- *
58
- * http://www.apache.org/licenses/LICENSE-2.0
59
- *
60
- * Unless required by applicable law or agreed to in writing, software
61
- * distributed under the License is distributed on an "AS IS" BASIS,
62
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
63
- * See the License for the specific language governing permissions and
64
- * limitations under the License.
65
- */
66
-
67
- /**
68
- * @license
69
- * Copyright 2019 Google LLC
70
- *
71
- * Licensed under the Apache License, Version 2.0 (the "License");
72
- * you may not use this file except in compliance with the License.
73
- * You may obtain a copy of the License at
74
- *
75
- * http://www.apache.org/licenses/LICENSE-2.0
76
- *
77
- * Unless required by applicable law or agreed to in writing, software
78
- * distributed under the License is distributed on an "AS IS" BASIS,
79
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
80
- * See the License for the specific language governing permissions and
81
- * limitations under the License.
82
- */
83
-
84
- /**
85
- * @license
86
- * Copyright 2020 Google LLC
87
- *
88
- * Licensed under the Apache License, Version 2.0 (the "License");
89
- * you may not use this file except in compliance with the License.
90
- * You may obtain a copy of the License at
91
- *
92
- * http://www.apache.org/licenses/LICENSE-2.0
93
- *
94
- * Unless required by applicable law or agreed to in writing, software
95
- * distributed under the License is distributed on an "AS IS" BASIS,
96
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
97
- * See the License for the specific language governing permissions and
98
- * limitations under the License.
99
- */
100
-
101
- /**
102
- * @license
103
- * Copyright 2021 Google LLC
104
- *
105
- * Licensed under the Apache License, Version 2.0 (the "License");
106
- * you may not use this file except in compliance with the License.
107
- * You may obtain a copy of the License at
108
- *
109
- * http://www.apache.org/licenses/LICENSE-2.0
110
- *
111
- * Unless required by applicable law or agreed to in writing, software
112
- * distributed under the License is distributed on an "AS IS" BASIS,
113
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
114
- * See the License for the specific language governing permissions and
115
- * limitations under the License.
116
- */
117
-
118
16
  /**
119
17
  * @license React
120
18
  * react-jsx-runtime.production.min.js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zsviczian/excalidraw",
3
- "version": "0.13.0-obsidian-1",
3
+ "version": "0.14.0-obsidian",
4
4
  "main": "main.js",
5
5
  "types": "types/packages/excalidraw/index.d.ts",
6
6
  "files": [
@@ -9,6 +9,11 @@ export declare const actionAddToLibrary: {
9
9
  toast: {
10
10
  message: string;
11
11
  };
12
+ contextMenu: {
13
+ items: import("../components/ContextMenu").ContextMenuItems;
14
+ top: number;
15
+ left: number;
16
+ } | null;
12
17
  showWelcomeScreen: boolean;
13
18
  isLoading: boolean;
14
19
  errorMessage: string | null;
@@ -48,10 +53,9 @@ export declare const actionAddToLibrary: {
48
53
  currentItemFontFamily: number;
49
54
  currentItemFontSize: number;
50
55
  currentItemTextAlign: string;
51
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
52
56
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
53
57
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
54
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
58
+ currentItemRoundness: import("../element/types").StrokeRoundness;
55
59
  viewBackgroundColor: string;
56
60
  scrollX: number;
57
61
  scrollY: number;
@@ -66,7 +70,7 @@ export declare const actionAddToLibrary: {
66
70
  openMenu: "canvas" | "shape" | null;
67
71
  openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
68
72
  openSidebar: "library" | "customSidebar" | null;
69
- openDialog: "imageExport" | "help" | null;
73
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
70
74
  isSidebarDocked: boolean;
71
75
  lastPointerDownWith: import("../element/types").PointerType;
72
76
  selectedElementIds: {
@@ -114,6 +118,11 @@ export declare const actionAddToLibrary: {
114
118
  commitToHistory: false;
115
119
  appState: {
116
120
  errorMessage: any;
121
+ contextMenu: {
122
+ items: import("../components/ContextMenu").ContextMenuItems;
123
+ top: number;
124
+ left: number;
125
+ } | null;
117
126
  showWelcomeScreen: boolean;
118
127
  isLoading: boolean;
119
128
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
@@ -152,10 +161,9 @@ export declare const actionAddToLibrary: {
152
161
  currentItemFontFamily: number;
153
162
  currentItemFontSize: number;
154
163
  currentItemTextAlign: string;
155
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
156
164
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
157
165
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
158
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
166
+ currentItemRoundness: import("../element/types").StrokeRoundness;
159
167
  viewBackgroundColor: string;
160
168
  scrollX: number;
161
169
  scrollY: number;
@@ -170,7 +178,7 @@ export declare const actionAddToLibrary: {
170
178
  openMenu: "canvas" | "shape" | null;
171
179
  openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
172
180
  openSidebar: "library" | "customSidebar" | null;
173
- openDialog: "imageExport" | "help" | null;
181
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
174
182
  isSidebarDocked: boolean;
175
183
  lastPointerDownWith: import("../element/types").PointerType;
176
184
  selectedElementIds: {
@@ -223,6 +231,11 @@ export declare const actionAddToLibrary: {
223
231
  commitToHistory: false;
224
232
  appState: {
225
233
  errorMessage: string;
234
+ contextMenu: {
235
+ items: import("../components/ContextMenu").ContextMenuItems;
236
+ top: number;
237
+ left: number;
238
+ } | null;
226
239
  showWelcomeScreen: boolean;
227
240
  isLoading: boolean;
228
241
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
@@ -261,10 +274,9 @@ export declare const actionAddToLibrary: {
261
274
  currentItemFontFamily: number;
262
275
  currentItemFontSize: number;
263
276
  currentItemTextAlign: string;
264
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
265
277
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
266
278
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
267
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
279
+ currentItemRoundness: import("../element/types").StrokeRoundness;
268
280
  viewBackgroundColor: string;
269
281
  scrollX: number;
270
282
  scrollY: number;
@@ -279,7 +291,7 @@ export declare const actionAddToLibrary: {
279
291
  openMenu: "canvas" | "shape" | null;
280
292
  openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
281
293
  openSidebar: "library" | "customSidebar" | null;
282
- openDialog: "imageExport" | "help" | null;
294
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
283
295
  isSidebarDocked: boolean;
284
296
  lastPointerDownWith: import("../element/types").PointerType;
285
297
  selectedElementIds: {
@@ -12,9 +12,7 @@ export declare const actionAlignTop: {
12
12
  commitToHistory: true;
13
13
  };
14
14
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
15
- PanelComponent: ({ elements, appState, updateData }: import("./types").PanelComponentProps & {
16
- isInHamburgerMenu: boolean;
17
- }) => JSX.Element;
15
+ PanelComponent: ({ elements, appState, updateData }: import("./types").PanelComponentProps) => JSX.Element;
18
16
  } & {
19
17
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
20
18
  };
@@ -29,9 +27,7 @@ export declare const actionAlignBottom: {
29
27
  commitToHistory: true;
30
28
  };
31
29
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
32
- PanelComponent: ({ elements, appState, updateData }: import("./types").PanelComponentProps & {
33
- isInHamburgerMenu: boolean;
34
- }) => JSX.Element;
30
+ PanelComponent: ({ elements, appState, updateData }: import("./types").PanelComponentProps) => JSX.Element;
35
31
  } & {
36
32
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
37
33
  };
@@ -46,9 +42,7 @@ export declare const actionAlignLeft: {
46
42
  commitToHistory: true;
47
43
  };
48
44
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
49
- PanelComponent: ({ elements, appState, updateData }: import("./types").PanelComponentProps & {
50
- isInHamburgerMenu: boolean;
51
- }) => JSX.Element;
45
+ PanelComponent: ({ elements, appState, updateData }: import("./types").PanelComponentProps) => JSX.Element;
52
46
  } & {
53
47
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
54
48
  };
@@ -63,9 +57,7 @@ export declare const actionAlignRight: {
63
57
  commitToHistory: true;
64
58
  };
65
59
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
66
- PanelComponent: ({ elements, appState, updateData }: import("./types").PanelComponentProps & {
67
- isInHamburgerMenu: boolean;
68
- }) => JSX.Element;
60
+ PanelComponent: ({ elements, appState, updateData }: import("./types").PanelComponentProps) => JSX.Element;
69
61
  } & {
70
62
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
71
63
  };
@@ -79,9 +71,7 @@ export declare const actionAlignVerticallyCentered: {
79
71
  elements: ExcalidrawElement[];
80
72
  commitToHistory: true;
81
73
  };
82
- PanelComponent: ({ elements, appState, updateData }: import("./types").PanelComponentProps & {
83
- isInHamburgerMenu: boolean;
84
- }) => JSX.Element;
74
+ PanelComponent: ({ elements, appState, updateData }: import("./types").PanelComponentProps) => JSX.Element;
85
75
  } & {
86
76
  keyTest?: undefined;
87
77
  };
@@ -95,9 +85,7 @@ export declare const actionAlignHorizontallyCentered: {
95
85
  elements: ExcalidrawElement[];
96
86
  commitToHistory: true;
97
87
  };
98
- PanelComponent: ({ elements, appState, updateData }: import("./types").PanelComponentProps & {
99
- isInHamburgerMenu: boolean;
100
- }) => JSX.Element;
88
+ PanelComponent: ({ elements, appState, updateData }: import("./types").PanelComponentProps) => JSX.Element;
101
89
  } & {
102
90
  keyTest?: undefined;
103
91
  };
@@ -4,7 +4,7 @@ export declare const actionUnbindText: {
4
4
  trackEvent: {
5
5
  category: "element";
6
6
  };
7
- contextItemPredicate: (elements: readonly import("../element/types").ExcalidrawElement[], appState: import("../types").AppState) => boolean;
7
+ predicate: (elements: readonly import("../element/types").ExcalidrawElement[], appState: import("../types").AppState) => boolean;
8
8
  perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
9
9
  elements: readonly import("../element/types").ExcalidrawElement[];
10
10
  appState: Readonly<import("../types").AppState>;
@@ -19,13 +19,18 @@ export declare const actionBindText: {
19
19
  trackEvent: {
20
20
  category: "element";
21
21
  };
22
- contextItemPredicate: (elements: readonly import("../element/types").ExcalidrawElement[], appState: import("../types").AppState) => boolean;
22
+ predicate: (elements: readonly import("../element/types").ExcalidrawElement[], appState: import("../types").AppState) => boolean;
23
23
  perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
24
24
  elements: import("../element/types").ExcalidrawElement[];
25
25
  appState: {
26
26
  selectedElementIds: {
27
27
  [x: string]: true;
28
28
  };
29
+ contextMenu: {
30
+ items: import("../components/ContextMenu").ContextMenuItems;
31
+ top: number;
32
+ left: number;
33
+ } | null;
29
34
  showWelcomeScreen: boolean;
30
35
  isLoading: boolean;
31
36
  errorMessage: string | null;
@@ -65,10 +70,9 @@ export declare const actionBindText: {
65
70
  currentItemFontFamily: number;
66
71
  currentItemFontSize: number;
67
72
  currentItemTextAlign: string;
68
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
69
73
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
70
74
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
71
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
75
+ currentItemRoundness: import("../element/types").StrokeRoundness;
72
76
  viewBackgroundColor: string;
73
77
  scrollX: number;
74
78
  scrollY: number;
@@ -83,7 +87,7 @@ export declare const actionBindText: {
83
87
  openMenu: "canvas" | "shape" | null;
84
88
  openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
85
89
  openSidebar: "library" | "customSidebar" | null;
86
- openDialog: "imageExport" | "help" | null;
90
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
87
91
  isSidebarDocked: boolean;
88
92
  lastPointerDownWith: import("../element/types").PointerType;
89
93
  previousSelectedElementIds: {