@zsviczian/excalidraw 0.10.0-obsidian-33 → 0.10.0-obsidian-34

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 (43) hide show
  1. package/dist/excalidraw.development.js +136 -114
  2. package/dist/excalidraw.production.min.js +1 -1
  3. package/package.json +15 -12
  4. package/types/actions/actionAddToLibrary.d.ts +268 -1
  5. package/types/actions/actionAlign.d.ts +73 -6
  6. package/types/actions/actionCanvas.d.ts +671 -8
  7. package/types/actions/actionClipboard.d.ts +493 -4
  8. package/types/actions/actionDeleteSelected.d.ts +292 -1
  9. package/types/actions/actionDistribute.d.ts +27 -2
  10. package/types/actions/actionDuplicateSelection.d.ts +19 -1
  11. package/types/actions/actionExport.d.ts +849 -8
  12. package/types/actions/actionFinalize.d.ts +186 -1
  13. package/types/actions/actionFlip.d.ts +29 -2
  14. package/types/actions/actionGroup.d.ts +39 -2
  15. package/types/actions/actionMenu.d.ts +293 -4
  16. package/types/actions/actionNavigate.d.ts +11 -1
  17. package/types/actions/actionProperties.d.ts +1160 -12
  18. package/types/actions/actionSelectAll.d.ts +12 -1
  19. package/types/actions/actionStyles.d.ts +110 -2
  20. package/types/actions/actionToggleGridMode.d.ts +98 -1
  21. package/types/actions/actionToggleStats.d.ts +97 -1
  22. package/types/actions/actionToggleViewMode.d.ts +97 -1
  23. package/types/actions/actionToggleZenMode.d.ts +97 -1
  24. package/types/actions/actionZindex.d.ts +55 -4
  25. package/types/actions/register.d.ts +3 -1
  26. package/types/actions/types.d.ts +1 -1
  27. package/types/components/App.d.ts +4 -0
  28. package/types/components/icons.d.ts +3 -0
  29. package/types/constants.d.ts +2 -4
  30. package/types/element/newElement.d.ts +1 -1
  31. package/types/element/textElement.d.ts +7 -4
  32. package/types/element/textWysiwyg.d.ts +5 -3
  33. package/types/keys.d.ts +4 -0
  34. package/types/packages/excalidraw/example/App.d.ts +1 -0
  35. package/types/packages/excalidraw/example/index.d.ts +1 -0
  36. package/types/packages/excalidraw/example/initialData.d.ts +138 -0
  37. package/types/packages/excalidraw/example/sidebar/Sidebar.d.ts +1 -0
  38. package/types/packages/excalidraw/webpack.dev-server.config.d.ts +19 -0
  39. package/types/packages/excalidraw/webpack.prod.config.d.ts +2 -1
  40. package/types/scene/comparisons.d.ts +1 -1
  41. package/types/shapes.d.ts +1 -1
  42. package/types/types.d.ts +2 -0
  43. package/types/utils.d.ts +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zsviczian/excalidraw",
3
- "version": "0.10.0-obsidian-33",
3
+ "version": "0.10.0-obsidian-34",
4
4
  "main": "main.js",
5
5
  "types": "types/packages/excalidraw/index.d.ts",
6
6
  "files": [
@@ -44,28 +44,30 @@
44
44
  "react-dom": "^17.0.2"
45
45
  },
46
46
  "devDependencies": {
47
- "@babel/core": "7.16.0",
48
- "@babel/plugin-transform-arrow-functions": "7.16.0",
47
+ "@babel/core": "7.16.7",
48
+ "@babel/plugin-transform-arrow-functions": "7.16.7",
49
49
  "@babel/plugin-transform-async-to-generator": "7.16.0",
50
50
  "@babel/plugin-transform-runtime": "7.16.4",
51
51
  "@babel/plugin-transform-typescript": "7.16.1",
52
- "@babel/preset-env": "7.16.4",
53
- "@babel/preset-react": "7.16.0",
54
- "@babel/preset-typescript": "7.16.0",
55
- "autoprefixer": "10.4.0",
52
+ "@babel/preset-env": "7.16.7",
53
+ "@babel/preset-react": "7.16.7",
54
+ "@babel/preset-typescript": "7.16.7",
55
+ "autoprefixer": "10.4.2",
56
56
  "babel-loader": "8.2.3",
57
57
  "babel-plugin-transform-class-properties": "6.24.1",
58
58
  "cross-env": "7.0.3",
59
59
  "css-loader": "6.5.1",
60
- "mini-css-extract-plugin": "2.4.5",
60
+ "mini-css-extract-plugin": "2.4.6",
61
61
  "postcss-loader": "6.2.1",
62
62
  "sass-loader": "12.4.0",
63
- "terser-webpack-plugin": "5.2.5",
63
+ "terser-webpack-plugin": "5.3.0",
64
64
  "ts-loader": "9.2.6",
65
- "typescript": "4.5.3",
65
+ "typescript": "4.5.4",
66
66
  "webpack": "5.65.0",
67
67
  "webpack-bundle-analyzer": "4.5.0",
68
- "webpack-cli": "4.9.1"
68
+ "webpack-cli": "4.9.1",
69
+ "webpack-dev-server": "4.7.2",
70
+ "webpack-merge": "5.8.0"
69
71
  },
70
72
  "bugs": "https://github.com/excalidraw/excalidraw/issues",
71
73
  "homepage": "https://github.com/excalidraw/excalidraw/tree/master/src/packages/excalidraw",
@@ -73,7 +75,8 @@
73
75
  "gen:types": "tsc --project ../../../tsconfig-types.json",
74
76
  "build:umd": "cross-env NODE_ENV=production webpack --config webpack.prod.config.js && cross-env NODE_ENV=development webpack --config webpack.dev.config.js && yarn gen:types",
75
77
  "build:umd:withAnalyzer": "cross-env NODE_ENV=production ANALYZER=true webpack --config webpack.prod.config.js",
76
- "pack": "yarn build:umd && yarn pack"
78
+ "pack": "yarn build:umd && yarn pack",
79
+ "start": "webpack serve --config webpack.dev-server.config.js "
77
80
  },
78
81
  "dependencies": {
79
82
  "dotenv": "10.0.0"
@@ -1 +1,268 @@
1
- export declare const actionAddToLibrary: import("./types").Action;
1
+ export declare const actionAddToLibrary: {
2
+ name: "addToLibrary";
3
+ perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>, _: any, app: import("../types").AppClassProperties) => Promise<{
4
+ commitToHistory: boolean;
5
+ appState: {
6
+ toastMessage: string;
7
+ isLoading: boolean;
8
+ errorMessage: string | null;
9
+ draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
10
+ resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
11
+ multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
12
+ selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
13
+ isBindingEnabled: boolean;
14
+ startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
15
+ suggestedBindings: import("../element/binding").SuggestedBinding[];
16
+ editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
17
+ editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
18
+ elementType: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw";
19
+ elementLocked: boolean;
20
+ exportBackground: boolean;
21
+ exportEmbedScene: boolean;
22
+ exportWithDarkMode: boolean;
23
+ exportScale: number;
24
+ currentItemStrokeColor: string;
25
+ currentItemBackgroundColor: string;
26
+ currentItemFillStyle: import("../element/types").FillStyle;
27
+ currentItemStrokeWidth: number;
28
+ currentItemStrokeStyle: import("../element/types").StrokeStyle;
29
+ currentItemRoughness: number;
30
+ currentItemOpacity: number;
31
+ currentItemFontFamily: number;
32
+ currentItemFontSize: number;
33
+ currentItemTextAlign: import("../element/types").TextAlign;
34
+ currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
35
+ currentItemStartArrowhead: import("../element/types").Arrowhead | null;
36
+ currentItemEndArrowhead: import("../element/types").Arrowhead | null;
37
+ currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
38
+ viewBackgroundColor: string;
39
+ scrollX: number;
40
+ scrollY: number;
41
+ cursorButton: "up" | "down";
42
+ scrolledOutside: boolean;
43
+ name: string;
44
+ isResizing: boolean;
45
+ isRotating: boolean;
46
+ zoom: Readonly<{
47
+ value: import("../types").NormalizedZoomValue;
48
+ translation: Readonly<{
49
+ x: number;
50
+ y: number;
51
+ }>;
52
+ }>;
53
+ openMenu: "canvas" | "shape" | null;
54
+ openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
55
+ lastPointerDownWith: import("../element/types").PointerType;
56
+ selectedElementIds: {
57
+ [id: string]: boolean;
58
+ };
59
+ previousSelectedElementIds: {
60
+ [id: string]: boolean;
61
+ };
62
+ shouldCacheIgnoreZoom: boolean;
63
+ showHelpDialog: boolean;
64
+ zenModeEnabled: boolean;
65
+ theme: string;
66
+ gridSize: number | null;
67
+ viewModeEnabled: boolean;
68
+ selectedGroupIds: {
69
+ [groupId: string]: boolean;
70
+ };
71
+ editingGroupId: string | null;
72
+ width: number;
73
+ height: number;
74
+ offsetTop: number;
75
+ offsetLeft: number;
76
+ isLibraryOpen: boolean;
77
+ fileHandle: import("browser-fs-access").FileSystemHandle | null;
78
+ collaborators: Map<string, import("../types").Collaborator>;
79
+ showStats: boolean;
80
+ currentChartType: import("../element/types").ChartType;
81
+ pasteDialog: {
82
+ shown: false;
83
+ data: null;
84
+ } | {
85
+ shown: true;
86
+ data: import("../charts").Spreadsheet;
87
+ };
88
+ pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
89
+ };
90
+ } | {
91
+ commitToHistory: false;
92
+ appState: {
93
+ errorMessage: any;
94
+ isLoading: boolean;
95
+ draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
96
+ resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
97
+ multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
98
+ selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
99
+ isBindingEnabled: boolean;
100
+ startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
101
+ suggestedBindings: import("../element/binding").SuggestedBinding[];
102
+ editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
103
+ editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
104
+ elementType: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw";
105
+ elementLocked: boolean;
106
+ exportBackground: boolean;
107
+ exportEmbedScene: boolean;
108
+ exportWithDarkMode: boolean;
109
+ exportScale: number;
110
+ currentItemStrokeColor: string;
111
+ currentItemBackgroundColor: string;
112
+ currentItemFillStyle: import("../element/types").FillStyle;
113
+ currentItemStrokeWidth: number;
114
+ currentItemStrokeStyle: import("../element/types").StrokeStyle;
115
+ currentItemRoughness: number;
116
+ currentItemOpacity: number;
117
+ currentItemFontFamily: number;
118
+ currentItemFontSize: number;
119
+ currentItemTextAlign: import("../element/types").TextAlign;
120
+ currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
121
+ currentItemStartArrowhead: import("../element/types").Arrowhead | null;
122
+ currentItemEndArrowhead: import("../element/types").Arrowhead | null;
123
+ currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
124
+ viewBackgroundColor: string;
125
+ scrollX: number;
126
+ scrollY: number;
127
+ cursorButton: "up" | "down";
128
+ scrolledOutside: boolean;
129
+ name: string;
130
+ isResizing: boolean;
131
+ isRotating: boolean;
132
+ zoom: Readonly<{
133
+ value: import("../types").NormalizedZoomValue;
134
+ translation: Readonly<{
135
+ x: number;
136
+ y: number;
137
+ }>;
138
+ }>;
139
+ openMenu: "canvas" | "shape" | null;
140
+ openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
141
+ lastPointerDownWith: import("../element/types").PointerType;
142
+ selectedElementIds: {
143
+ [id: string]: boolean;
144
+ };
145
+ previousSelectedElementIds: {
146
+ [id: string]: boolean;
147
+ };
148
+ shouldCacheIgnoreZoom: boolean;
149
+ showHelpDialog: boolean;
150
+ toastMessage: string | null;
151
+ zenModeEnabled: boolean;
152
+ theme: string;
153
+ gridSize: number | null;
154
+ viewModeEnabled: boolean;
155
+ selectedGroupIds: {
156
+ [groupId: string]: boolean;
157
+ };
158
+ editingGroupId: string | null;
159
+ width: number;
160
+ height: number;
161
+ offsetTop: number;
162
+ offsetLeft: number;
163
+ isLibraryOpen: boolean;
164
+ fileHandle: import("browser-fs-access").FileSystemHandle | null;
165
+ collaborators: Map<string, import("../types").Collaborator>;
166
+ showStats: boolean;
167
+ currentChartType: import("../element/types").ChartType;
168
+ pasteDialog: {
169
+ shown: false;
170
+ data: null;
171
+ } | {
172
+ shown: true;
173
+ data: import("../charts").Spreadsheet;
174
+ };
175
+ pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
176
+ };
177
+ }> | {
178
+ commitToHistory: false;
179
+ appState: {
180
+ errorMessage: string;
181
+ isLoading: boolean;
182
+ draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
183
+ resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
184
+ multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
185
+ selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
186
+ isBindingEnabled: boolean;
187
+ startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
188
+ suggestedBindings: import("../element/binding").SuggestedBinding[];
189
+ editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
190
+ editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
191
+ elementType: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw";
192
+ elementLocked: boolean;
193
+ exportBackground: boolean;
194
+ exportEmbedScene: boolean;
195
+ exportWithDarkMode: boolean;
196
+ exportScale: number;
197
+ currentItemStrokeColor: string;
198
+ currentItemBackgroundColor: string;
199
+ currentItemFillStyle: import("../element/types").FillStyle;
200
+ currentItemStrokeWidth: number;
201
+ currentItemStrokeStyle: import("../element/types").StrokeStyle;
202
+ currentItemRoughness: number;
203
+ currentItemOpacity: number;
204
+ currentItemFontFamily: number;
205
+ currentItemFontSize: number;
206
+ currentItemTextAlign: import("../element/types").TextAlign;
207
+ currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
208
+ currentItemStartArrowhead: import("../element/types").Arrowhead | null;
209
+ currentItemEndArrowhead: import("../element/types").Arrowhead | null;
210
+ currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
211
+ viewBackgroundColor: string;
212
+ scrollX: number;
213
+ scrollY: number;
214
+ cursorButton: "up" | "down";
215
+ scrolledOutside: boolean;
216
+ name: string;
217
+ isResizing: boolean;
218
+ isRotating: boolean;
219
+ zoom: Readonly<{
220
+ value: import("../types").NormalizedZoomValue;
221
+ translation: Readonly<{
222
+ x: number;
223
+ y: number;
224
+ }>;
225
+ }>;
226
+ openMenu: "canvas" | "shape" | null;
227
+ openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
228
+ lastPointerDownWith: import("../element/types").PointerType;
229
+ selectedElementIds: {
230
+ [id: string]: boolean;
231
+ };
232
+ previousSelectedElementIds: {
233
+ [id: string]: boolean;
234
+ };
235
+ shouldCacheIgnoreZoom: boolean;
236
+ showHelpDialog: boolean;
237
+ toastMessage: string | null;
238
+ zenModeEnabled: boolean;
239
+ theme: string;
240
+ gridSize: number | null;
241
+ viewModeEnabled: boolean;
242
+ selectedGroupIds: {
243
+ [groupId: string]: boolean;
244
+ };
245
+ editingGroupId: string | null;
246
+ width: number;
247
+ height: number;
248
+ offsetTop: number;
249
+ offsetLeft: number;
250
+ isLibraryOpen: boolean;
251
+ fileHandle: import("browser-fs-access").FileSystemHandle | null;
252
+ collaborators: Map<string, import("../types").Collaborator>;
253
+ showStats: boolean;
254
+ currentChartType: import("../element/types").ChartType;
255
+ pasteDialog: {
256
+ shown: false;
257
+ data: null;
258
+ } | {
259
+ shown: true;
260
+ data: import("../charts").Spreadsheet;
261
+ };
262
+ pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
263
+ };
264
+ };
265
+ contextItemLabel: string;
266
+ } & {
267
+ keyTest?: undefined;
268
+ };
@@ -1,6 +1,73 @@
1
- export declare const actionAlignTop: import("./types").Action;
2
- export declare const actionAlignBottom: import("./types").Action;
3
- export declare const actionAlignLeft: import("./types").Action;
4
- export declare const actionAlignRight: import("./types").Action;
5
- export declare const actionAlignVerticallyCentered: import("./types").Action;
6
- export declare const actionAlignHorizontallyCentered: import("./types").Action;
1
+ /// <reference types="react" />
2
+ import { ExcalidrawElement } from "../element/types";
3
+ import { AppState } from "../types";
4
+ export declare const actionAlignTop: {
5
+ name: "alignTop";
6
+ perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>) => {
7
+ appState: Readonly<AppState>;
8
+ elements: ExcalidrawElement[];
9
+ commitToHistory: true;
10
+ };
11
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
12
+ PanelComponent: ({ elements, appState, updateData }: import("react").PropsWithChildren<import("./types").PanelComponentProps>) => JSX.Element;
13
+ } & {
14
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
15
+ };
16
+ export declare const actionAlignBottom: {
17
+ name: "alignBottom";
18
+ perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>) => {
19
+ appState: Readonly<AppState>;
20
+ elements: ExcalidrawElement[];
21
+ commitToHistory: true;
22
+ };
23
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
24
+ PanelComponent: ({ elements, appState, updateData }: import("react").PropsWithChildren<import("./types").PanelComponentProps>) => JSX.Element;
25
+ } & {
26
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
27
+ };
28
+ export declare const actionAlignLeft: {
29
+ name: "alignLeft";
30
+ perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>) => {
31
+ appState: Readonly<AppState>;
32
+ elements: ExcalidrawElement[];
33
+ commitToHistory: true;
34
+ };
35
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
36
+ PanelComponent: ({ elements, appState, updateData }: import("react").PropsWithChildren<import("./types").PanelComponentProps>) => JSX.Element;
37
+ } & {
38
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
39
+ };
40
+ export declare const actionAlignRight: {
41
+ name: "alignRight";
42
+ perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>) => {
43
+ appState: Readonly<AppState>;
44
+ elements: ExcalidrawElement[];
45
+ commitToHistory: true;
46
+ };
47
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
48
+ PanelComponent: ({ elements, appState, updateData }: import("react").PropsWithChildren<import("./types").PanelComponentProps>) => JSX.Element;
49
+ } & {
50
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
51
+ };
52
+ export declare const actionAlignVerticallyCentered: {
53
+ name: "alignVerticallyCentered";
54
+ perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>) => {
55
+ appState: Readonly<AppState>;
56
+ elements: ExcalidrawElement[];
57
+ commitToHistory: true;
58
+ };
59
+ PanelComponent: ({ elements, appState, updateData }: import("react").PropsWithChildren<import("./types").PanelComponentProps>) => JSX.Element;
60
+ } & {
61
+ keyTest?: undefined;
62
+ };
63
+ export declare const actionAlignHorizontallyCentered: {
64
+ name: "alignHorizontallyCentered";
65
+ perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>) => {
66
+ appState: Readonly<AppState>;
67
+ elements: ExcalidrawElement[];
68
+ commitToHistory: true;
69
+ };
70
+ PanelComponent: ({ elements, appState, updateData }: import("react").PropsWithChildren<import("./types").PanelComponentProps>) => JSX.Element;
71
+ } & {
72
+ keyTest?: undefined;
73
+ };