@zsviczian/excalidraw 0.10.0-obsidian-42 → 0.10.0-obsidian-46
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.
- package/dist/excalidraw.development.js +66 -66
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +9 -7
- package/types/actions/actionAddToLibrary.d.ts +3 -0
- package/types/actions/actionCanvas.d.ts +9 -1
- package/types/actions/actionClipboard.d.ts +5 -0
- package/types/actions/actionDeleteSelected.d.ts +3 -0
- package/types/actions/actionExport.d.ts +9 -0
- package/types/actions/actionFinalize.d.ts +3 -1
- package/types/actions/actionMenu.d.ts +3 -0
- package/types/actions/actionProperties.d.ts +12 -0
- package/types/actions/actionStyles.d.ts +1 -0
- package/types/actions/actionToggleGridMode.d.ts +1 -0
- package/types/actions/actionToggleStats.d.ts +1 -0
- package/types/actions/actionToggleViewMode.d.ts +1 -0
- package/types/actions/actionToggleZenMode.d.ts +1 -0
- package/types/components/App.d.ts +2 -2
- package/types/components/ButtonIconSelect.d.ts +1 -0
- package/types/constants.d.ts +6 -5
- package/types/element/Hyperlink.d.ts +2 -1
- package/types/element/linearElementEditor.d.ts +1 -0
- package/types/keys.d.ts +1 -0
- package/types/renderer/renderElement.d.ts +11 -1
- package/types/types.d.ts +9 -3
- package/types/utils.d.ts +18 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zsviczian/excalidraw",
|
|
3
|
-
"version": "0.10.0-obsidian-
|
|
3
|
+
"version": "0.10.0-obsidian-46",
|
|
4
4
|
"main": "main.js",
|
|
5
5
|
"types": "types/packages/excalidraw/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"react-dom": "^17.0.2"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@babel/core": "7.
|
|
47
|
+
"@babel/core": "7.17.0",
|
|
48
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.8",
|
|
@@ -56,17 +56,17 @@
|
|
|
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
|
-
"css-loader": "6.
|
|
59
|
+
"css-loader": "6.6.0",
|
|
60
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.3.
|
|
63
|
+
"terser-webpack-plugin": "5.3.1",
|
|
64
64
|
"ts-loader": "9.2.6",
|
|
65
65
|
"typescript": "4.5.4",
|
|
66
66
|
"webpack": "5.65.0",
|
|
67
67
|
"webpack-bundle-analyzer": "4.5.0",
|
|
68
|
-
"webpack-cli": "4.9.
|
|
69
|
-
"webpack-dev-server": "4.7.
|
|
68
|
+
"webpack-cli": "4.9.2",
|
|
69
|
+
"webpack-dev-server": "4.7.4",
|
|
70
70
|
"webpack-merge": "5.8.0"
|
|
71
71
|
},
|
|
72
72
|
"bugs": "https://github.com/excalidraw/excalidraw/issues",
|
|
@@ -76,7 +76,9 @@
|
|
|
76
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",
|
|
77
77
|
"build:umd:withAnalyzer": "cross-env NODE_ENV=production ANALYZER=true webpack --config webpack.prod.config.js",
|
|
78
78
|
"pack": "yarn build:umd && yarn pack",
|
|
79
|
-
"start": "webpack serve --config webpack.dev-server.config.js
|
|
79
|
+
"start": "webpack serve --config webpack.dev-server.config.js",
|
|
80
|
+
"install:deps": "yarn install --frozen-lockfile && yarn --cwd ../../../",
|
|
81
|
+
"build:example": "EXAMPLE=true webpack --config webpack.dev-server.config.js"
|
|
80
82
|
},
|
|
81
83
|
"dependencies": {
|
|
82
84
|
"dotenv": "10.0.0"
|
|
@@ -85,6 +85,7 @@ export declare const actionAddToLibrary: {
|
|
|
85
85
|
};
|
|
86
86
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
87
87
|
showHyperlinkPopup: false | "info" | "editor";
|
|
88
|
+
linkOpacity: number;
|
|
88
89
|
};
|
|
89
90
|
} | {
|
|
90
91
|
commitToHistory: false;
|
|
@@ -171,6 +172,7 @@ export declare const actionAddToLibrary: {
|
|
|
171
172
|
};
|
|
172
173
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
173
174
|
showHyperlinkPopup: false | "info" | "editor";
|
|
175
|
+
linkOpacity: number;
|
|
174
176
|
};
|
|
175
177
|
}> | {
|
|
176
178
|
commitToHistory: false;
|
|
@@ -257,6 +259,7 @@ export declare const actionAddToLibrary: {
|
|
|
257
259
|
};
|
|
258
260
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
259
261
|
showHyperlinkPopup: false | "info" | "editor";
|
|
262
|
+
linkOpacity: number;
|
|
260
263
|
};
|
|
261
264
|
};
|
|
262
265
|
contextItemLabel: string;
|
|
@@ -32,6 +32,7 @@ export declare const actionClearCanvas: {
|
|
|
32
32
|
shown: true;
|
|
33
33
|
data: import("../charts").Spreadsheet;
|
|
34
34
|
};
|
|
35
|
+
elementType: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "freedraw";
|
|
35
36
|
scrollX: number;
|
|
36
37
|
scrollY: number;
|
|
37
38
|
viewBackgroundColor: string;
|
|
@@ -51,7 +52,6 @@ export declare const actionClearCanvas: {
|
|
|
51
52
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
52
53
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
53
54
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
54
|
-
elementType: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw";
|
|
55
55
|
exportWithDarkMode: boolean;
|
|
56
56
|
exportScale: number;
|
|
57
57
|
currentItemStrokeColor: string;
|
|
@@ -95,6 +95,7 @@ export declare const actionClearCanvas: {
|
|
|
95
95
|
currentChartType: import("../element/types").ChartType;
|
|
96
96
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
97
97
|
showHyperlinkPopup: false | "info" | "editor";
|
|
98
|
+
linkOpacity: number;
|
|
98
99
|
};
|
|
99
100
|
commitToHistory: true;
|
|
100
101
|
};
|
|
@@ -188,6 +189,7 @@ export declare const actionZoomIn: {
|
|
|
188
189
|
};
|
|
189
190
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
190
191
|
showHyperlinkPopup: false | "info" | "editor";
|
|
192
|
+
linkOpacity: number;
|
|
191
193
|
};
|
|
192
194
|
commitToHistory: false;
|
|
193
195
|
};
|
|
@@ -282,6 +284,7 @@ export declare const actionZoomOut: {
|
|
|
282
284
|
};
|
|
283
285
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
284
286
|
showHyperlinkPopup: false | "info" | "editor";
|
|
287
|
+
linkOpacity: number;
|
|
285
288
|
};
|
|
286
289
|
commitToHistory: false;
|
|
287
290
|
};
|
|
@@ -376,6 +379,7 @@ export declare const actionResetZoom: {
|
|
|
376
379
|
};
|
|
377
380
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
378
381
|
showHyperlinkPopup: false | "info" | "editor";
|
|
382
|
+
linkOpacity: number;
|
|
379
383
|
};
|
|
380
384
|
commitToHistory: false;
|
|
381
385
|
};
|
|
@@ -468,6 +472,7 @@ export declare const zoomToFitElements: (elements: readonly ExcalidrawElement[],
|
|
|
468
472
|
};
|
|
469
473
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
470
474
|
showHyperlinkPopup: false | "info" | "editor";
|
|
475
|
+
linkOpacity: number;
|
|
471
476
|
};
|
|
472
477
|
commitToHistory: boolean;
|
|
473
478
|
};
|
|
@@ -557,6 +562,7 @@ export declare const actionZoomToSelected: {
|
|
|
557
562
|
};
|
|
558
563
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
559
564
|
showHyperlinkPopup: false | "info" | "editor";
|
|
565
|
+
linkOpacity: number;
|
|
560
566
|
};
|
|
561
567
|
commitToHistory: boolean;
|
|
562
568
|
};
|
|
@@ -650,6 +656,7 @@ export declare const actionZoomToFit: {
|
|
|
650
656
|
};
|
|
651
657
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
652
658
|
showHyperlinkPopup: false | "info" | "editor";
|
|
659
|
+
linkOpacity: number;
|
|
653
660
|
};
|
|
654
661
|
commitToHistory: boolean;
|
|
655
662
|
};
|
|
@@ -743,6 +750,7 @@ export declare const actionToggleTheme: {
|
|
|
743
750
|
};
|
|
744
751
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
745
752
|
showHyperlinkPopup: false | "info" | "editor";
|
|
753
|
+
linkOpacity: number;
|
|
746
754
|
};
|
|
747
755
|
commitToHistory: false;
|
|
748
756
|
};
|
|
@@ -96,6 +96,7 @@ export declare const actionCut: {
|
|
|
96
96
|
};
|
|
97
97
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
98
98
|
showHyperlinkPopup: false | "info" | "editor";
|
|
99
|
+
linkOpacity: number;
|
|
99
100
|
};
|
|
100
101
|
commitToHistory: false;
|
|
101
102
|
} | {
|
|
@@ -200,6 +201,7 @@ export declare const actionCut: {
|
|
|
200
201
|
};
|
|
201
202
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
202
203
|
showHyperlinkPopup: false | "info" | "editor";
|
|
204
|
+
linkOpacity: number;
|
|
203
205
|
};
|
|
204
206
|
commitToHistory: true;
|
|
205
207
|
} | {
|
|
@@ -285,6 +287,7 @@ export declare const actionCut: {
|
|
|
285
287
|
};
|
|
286
288
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
287
289
|
showHyperlinkPopup: false | "info" | "editor";
|
|
290
|
+
linkOpacity: number;
|
|
288
291
|
};
|
|
289
292
|
commitToHistory: boolean;
|
|
290
293
|
};
|
|
@@ -382,6 +385,7 @@ export declare const actionCopyAsSvg: {
|
|
|
382
385
|
};
|
|
383
386
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
384
387
|
showHyperlinkPopup: false | "info" | "editor";
|
|
388
|
+
linkOpacity: number;
|
|
385
389
|
};
|
|
386
390
|
commitToHistory: false;
|
|
387
391
|
}>;
|
|
@@ -478,6 +482,7 @@ export declare const actionCopyAsPng: {
|
|
|
478
482
|
};
|
|
479
483
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
480
484
|
showHyperlinkPopup: false | "info" | "editor";
|
|
485
|
+
linkOpacity: number;
|
|
481
486
|
};
|
|
482
487
|
commitToHistory: false;
|
|
483
488
|
}>;
|
|
@@ -89,6 +89,7 @@ export declare const actionDeleteSelected: {
|
|
|
89
89
|
};
|
|
90
90
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
91
91
|
showHyperlinkPopup: false | "info" | "editor";
|
|
92
|
+
linkOpacity: number;
|
|
92
93
|
};
|
|
93
94
|
commitToHistory: false;
|
|
94
95
|
} | {
|
|
@@ -193,6 +194,7 @@ export declare const actionDeleteSelected: {
|
|
|
193
194
|
};
|
|
194
195
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
195
196
|
showHyperlinkPopup: false | "info" | "editor";
|
|
197
|
+
linkOpacity: number;
|
|
196
198
|
};
|
|
197
199
|
commitToHistory: true;
|
|
198
200
|
} | {
|
|
@@ -278,6 +280,7 @@ export declare const actionDeleteSelected: {
|
|
|
278
280
|
};
|
|
279
281
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
280
282
|
showHyperlinkPopup: false | "info" | "editor";
|
|
283
|
+
linkOpacity: number;
|
|
281
284
|
};
|
|
282
285
|
commitToHistory: boolean;
|
|
283
286
|
};
|
|
@@ -86,6 +86,7 @@ export declare const actionChangeProjectName: {
|
|
|
86
86
|
};
|
|
87
87
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
88
88
|
showHyperlinkPopup: false | "info" | "editor";
|
|
89
|
+
linkOpacity: number;
|
|
89
90
|
};
|
|
90
91
|
commitToHistory: false;
|
|
91
92
|
};
|
|
@@ -179,6 +180,7 @@ export declare const actionChangeExportScale: {
|
|
|
179
180
|
};
|
|
180
181
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
181
182
|
showHyperlinkPopup: false | "info" | "editor";
|
|
183
|
+
linkOpacity: number;
|
|
182
184
|
};
|
|
183
185
|
commitToHistory: false;
|
|
184
186
|
};
|
|
@@ -272,6 +274,7 @@ export declare const actionChangeExportBackground: {
|
|
|
272
274
|
};
|
|
273
275
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
274
276
|
showHyperlinkPopup: false | "info" | "editor";
|
|
277
|
+
linkOpacity: number;
|
|
275
278
|
};
|
|
276
279
|
commitToHistory: false;
|
|
277
280
|
};
|
|
@@ -365,6 +368,7 @@ export declare const actionChangeExportEmbedScene: {
|
|
|
365
368
|
};
|
|
366
369
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
367
370
|
showHyperlinkPopup: false | "info" | "editor";
|
|
371
|
+
linkOpacity: number;
|
|
368
372
|
};
|
|
369
373
|
commitToHistory: false;
|
|
370
374
|
};
|
|
@@ -459,6 +463,7 @@ export declare const actionSaveToActiveFile: {
|
|
|
459
463
|
};
|
|
460
464
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
461
465
|
showHyperlinkPopup: false | "info" | "editor";
|
|
466
|
+
linkOpacity: number;
|
|
462
467
|
};
|
|
463
468
|
} | {
|
|
464
469
|
commitToHistory: false;
|
|
@@ -556,6 +561,7 @@ export declare const actionSaveFileToDisk: {
|
|
|
556
561
|
};
|
|
557
562
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
558
563
|
showHyperlinkPopup: false | "info" | "editor";
|
|
564
|
+
linkOpacity: number;
|
|
559
565
|
};
|
|
560
566
|
} | {
|
|
561
567
|
commitToHistory: false;
|
|
@@ -649,6 +655,7 @@ export declare const actionLoadScene: {
|
|
|
649
655
|
};
|
|
650
656
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
651
657
|
showHyperlinkPopup: false | "info" | "editor";
|
|
658
|
+
linkOpacity: number;
|
|
652
659
|
};
|
|
653
660
|
files: import("../types").BinaryFiles;
|
|
654
661
|
commitToHistory: true;
|
|
@@ -737,6 +744,7 @@ export declare const actionLoadScene: {
|
|
|
737
744
|
};
|
|
738
745
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
739
746
|
showHyperlinkPopup: false | "info" | "editor";
|
|
747
|
+
linkOpacity: number;
|
|
740
748
|
};
|
|
741
749
|
files: import("../types").BinaryFiles;
|
|
742
750
|
commitToHistory: false;
|
|
@@ -832,6 +840,7 @@ export declare const actionExportWithDarkMode: {
|
|
|
832
840
|
};
|
|
833
841
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
834
842
|
showHyperlinkPopup: false | "info" | "editor";
|
|
843
|
+
linkOpacity: number;
|
|
835
844
|
};
|
|
836
845
|
commitToHistory: false;
|
|
837
846
|
};
|
|
@@ -87,6 +87,7 @@ export declare const actionFinalize: {
|
|
|
87
87
|
};
|
|
88
88
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
89
89
|
showHyperlinkPopup: false | "info" | "editor";
|
|
90
|
+
linkOpacity: number;
|
|
90
91
|
};
|
|
91
92
|
commitToHistory: true;
|
|
92
93
|
} | {
|
|
@@ -174,11 +175,12 @@ export declare const actionFinalize: {
|
|
|
174
175
|
data: import("../charts").Spreadsheet;
|
|
175
176
|
};
|
|
176
177
|
showHyperlinkPopup: false | "info" | "editor";
|
|
178
|
+
linkOpacity: number;
|
|
177
179
|
};
|
|
178
180
|
commitToHistory: boolean;
|
|
179
181
|
};
|
|
180
182
|
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>, appState: import("../types").AppState) => boolean;
|
|
181
|
-
PanelComponent: ({ appState, updateData }: import("react").PropsWithChildren<import("./types").PanelComponentProps>) => JSX.Element;
|
|
183
|
+
PanelComponent: ({ appState, updateData, data }: import("react").PropsWithChildren<import("./types").PanelComponentProps>) => JSX.Element;
|
|
182
184
|
} & {
|
|
183
185
|
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>, appState: import("../types").AppState) => boolean) | undefined;
|
|
184
186
|
};
|
|
@@ -85,6 +85,7 @@ export declare const actionToggleCanvasMenu: {
|
|
|
85
85
|
};
|
|
86
86
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
87
87
|
showHyperlinkPopup: false | "info" | "editor";
|
|
88
|
+
linkOpacity: number;
|
|
88
89
|
};
|
|
89
90
|
commitToHistory: false;
|
|
90
91
|
};
|
|
@@ -178,6 +179,7 @@ export declare const actionToggleEditMenu: {
|
|
|
178
179
|
};
|
|
179
180
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
180
181
|
showHyperlinkPopup: false | "info" | "editor";
|
|
182
|
+
linkOpacity: number;
|
|
181
183
|
};
|
|
182
184
|
commitToHistory: false;
|
|
183
185
|
};
|
|
@@ -280,6 +282,7 @@ export declare const actionShortcuts: {
|
|
|
280
282
|
};
|
|
281
283
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
282
284
|
showHyperlinkPopup: false | "info" | "editor";
|
|
285
|
+
linkOpacity: number;
|
|
283
286
|
};
|
|
284
287
|
commitToHistory: false;
|
|
285
288
|
};
|
|
@@ -102,6 +102,7 @@ export declare const actionChangeFillStyle: {
|
|
|
102
102
|
};
|
|
103
103
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
104
104
|
showHyperlinkPopup: false | "info" | "editor";
|
|
105
|
+
linkOpacity: number;
|
|
105
106
|
};
|
|
106
107
|
commitToHistory: true;
|
|
107
108
|
};
|
|
@@ -196,6 +197,7 @@ export declare const actionChangeStrokeWidth: {
|
|
|
196
197
|
};
|
|
197
198
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
198
199
|
showHyperlinkPopup: false | "info" | "editor";
|
|
200
|
+
linkOpacity: number;
|
|
199
201
|
};
|
|
200
202
|
commitToHistory: true;
|
|
201
203
|
};
|
|
@@ -290,6 +292,7 @@ export declare const actionChangeSloppiness: {
|
|
|
290
292
|
};
|
|
291
293
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
292
294
|
showHyperlinkPopup: false | "info" | "editor";
|
|
295
|
+
linkOpacity: number;
|
|
293
296
|
};
|
|
294
297
|
commitToHistory: true;
|
|
295
298
|
};
|
|
@@ -384,6 +387,7 @@ export declare const actionChangeStrokeStyle: {
|
|
|
384
387
|
};
|
|
385
388
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
386
389
|
showHyperlinkPopup: false | "info" | "editor";
|
|
390
|
+
linkOpacity: number;
|
|
387
391
|
};
|
|
388
392
|
commitToHistory: true;
|
|
389
393
|
};
|
|
@@ -478,6 +482,7 @@ export declare const actionChangeOpacity: {
|
|
|
478
482
|
};
|
|
479
483
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
480
484
|
showHyperlinkPopup: false | "info" | "editor";
|
|
485
|
+
linkOpacity: number;
|
|
481
486
|
};
|
|
482
487
|
commitToHistory: true;
|
|
483
488
|
};
|
|
@@ -572,6 +577,7 @@ export declare const actionChangeFontSize: {
|
|
|
572
577
|
};
|
|
573
578
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
574
579
|
showHyperlinkPopup: false | "info" | "editor";
|
|
580
|
+
linkOpacity: number;
|
|
575
581
|
};
|
|
576
582
|
commitToHistory: boolean;
|
|
577
583
|
};
|
|
@@ -666,6 +672,7 @@ export declare const actionDecreaseFontSize: {
|
|
|
666
672
|
};
|
|
667
673
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
668
674
|
showHyperlinkPopup: false | "info" | "editor";
|
|
675
|
+
linkOpacity: number;
|
|
669
676
|
};
|
|
670
677
|
commitToHistory: boolean;
|
|
671
678
|
};
|
|
@@ -760,6 +767,7 @@ export declare const actionIncreaseFontSize: {
|
|
|
760
767
|
};
|
|
761
768
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
762
769
|
showHyperlinkPopup: false | "info" | "editor";
|
|
770
|
+
linkOpacity: number;
|
|
763
771
|
};
|
|
764
772
|
commitToHistory: boolean;
|
|
765
773
|
};
|
|
@@ -854,6 +862,7 @@ export declare const actionChangeFontFamily: {
|
|
|
854
862
|
};
|
|
855
863
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
856
864
|
showHyperlinkPopup: false | "info" | "editor";
|
|
865
|
+
linkOpacity: number;
|
|
857
866
|
};
|
|
858
867
|
commitToHistory: true;
|
|
859
868
|
};
|
|
@@ -948,6 +957,7 @@ export declare const actionChangeTextAlign: {
|
|
|
948
957
|
};
|
|
949
958
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
950
959
|
showHyperlinkPopup: false | "info" | "editor";
|
|
960
|
+
linkOpacity: number;
|
|
951
961
|
};
|
|
952
962
|
commitToHistory: true;
|
|
953
963
|
};
|
|
@@ -1042,6 +1052,7 @@ export declare const actionChangeSharpness: {
|
|
|
1042
1052
|
};
|
|
1043
1053
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
1044
1054
|
showHyperlinkPopup: false | "info" | "editor";
|
|
1055
|
+
linkOpacity: number;
|
|
1045
1056
|
};
|
|
1046
1057
|
commitToHistory: true;
|
|
1047
1058
|
};
|
|
@@ -1139,6 +1150,7 @@ export declare const actionChangeArrowhead: {
|
|
|
1139
1150
|
};
|
|
1140
1151
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
1141
1152
|
showHyperlinkPopup: false | "info" | "editor";
|
|
1153
|
+
linkOpacity: number;
|
|
1142
1154
|
};
|
|
1143
1155
|
commitToHistory: true;
|
|
1144
1156
|
};
|
|
@@ -86,6 +86,7 @@ export declare const actionCopyStyles: {
|
|
|
86
86
|
};
|
|
87
87
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
88
88
|
showHyperlinkPopup: false | "info" | "editor";
|
|
89
|
+
linkOpacity: number;
|
|
89
90
|
};
|
|
90
91
|
commitToHistory: false;
|
|
91
92
|
};
|
|
@@ -86,6 +86,7 @@ export declare const actionToggleGridMode: {
|
|
|
86
86
|
};
|
|
87
87
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
88
88
|
showHyperlinkPopup: false | "info" | "editor";
|
|
89
|
+
linkOpacity: number;
|
|
89
90
|
};
|
|
90
91
|
commitToHistory: false;
|
|
91
92
|
};
|
|
@@ -85,6 +85,7 @@ export declare const actionToggleStats: {
|
|
|
85
85
|
};
|
|
86
86
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
87
87
|
showHyperlinkPopup: false | "info" | "editor";
|
|
88
|
+
linkOpacity: number;
|
|
88
89
|
};
|
|
89
90
|
commitToHistory: false;
|
|
90
91
|
};
|
|
@@ -85,6 +85,7 @@ export declare const actionToggleViewMode: {
|
|
|
85
85
|
};
|
|
86
86
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
87
87
|
showHyperlinkPopup: false | "info" | "editor";
|
|
88
|
+
linkOpacity: number;
|
|
88
89
|
};
|
|
89
90
|
commitToHistory: false;
|
|
90
91
|
};
|
|
@@ -85,6 +85,7 @@ export declare const actionToggleZenMode: {
|
|
|
85
85
|
};
|
|
86
86
|
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
87
87
|
showHyperlinkPopup: false | "info" | "editor";
|
|
88
|
+
linkOpacity: number;
|
|
88
89
|
};
|
|
89
90
|
commitToHistory: false;
|
|
90
91
|
};
|
|
@@ -85,6 +85,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
85
85
|
addFiles: ExcalidrawImperativeAPI["addFiles"];
|
|
86
86
|
setLocalFont: ExcalidrawImperativeAPI["setLocalFont"];
|
|
87
87
|
selectElements: ExcalidrawImperativeAPI["selectElements"];
|
|
88
|
+
setLinkOpacity: ExcalidrawImperativeAPI["setLinkOpacity"];
|
|
88
89
|
bringToFront: ExcalidrawImperativeAPI["bringToFront"];
|
|
89
90
|
bringForward: ExcalidrawImperativeAPI["bringForward"];
|
|
90
91
|
sendToBack: ExcalidrawImperativeAPI["sendToBack"];
|
|
@@ -113,11 +114,10 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
113
114
|
private handleCanvasDoubleClick;
|
|
114
115
|
private getElementLinkAtPosition;
|
|
115
116
|
private redirectToLink;
|
|
116
|
-
private attachLinkListener;
|
|
117
|
-
private detachLinkListener;
|
|
118
117
|
private handleCanvasPointerMove;
|
|
119
118
|
private handleTouchMove;
|
|
120
119
|
private handleCanvasPointerDown;
|
|
120
|
+
private handleCanvasPointerUp;
|
|
121
121
|
private maybeOpenContextMenuAfterPointerDownOnTouchDevices;
|
|
122
122
|
private maybeCleanupAfterMissingPointerUp;
|
|
123
123
|
private handleCanvasPanUsingWheelOrSpaceDrag;
|
package/types/constants.d.ts
CHANGED
|
@@ -17,10 +17,10 @@ export declare const CURSOR_TYPE: {
|
|
|
17
17
|
AUTO: string;
|
|
18
18
|
};
|
|
19
19
|
export declare const POINTER_BUTTON: {
|
|
20
|
-
MAIN:
|
|
21
|
-
WHEEL:
|
|
22
|
-
SECONDARY:
|
|
23
|
-
TOUCH:
|
|
20
|
+
readonly MAIN: 0;
|
|
21
|
+
readonly WHEEL: 1;
|
|
22
|
+
readonly SECONDARY: 2;
|
|
23
|
+
readonly TOUCH: -1;
|
|
24
24
|
};
|
|
25
25
|
export declare enum EVENT {
|
|
26
26
|
COPY = "copy",
|
|
@@ -47,7 +47,8 @@ export declare enum EVENT {
|
|
|
47
47
|
TOUCH_END = "touchend",
|
|
48
48
|
HASHCHANGE = "hashchange",
|
|
49
49
|
VISIBILITY_CHANGE = "visibilitychange",
|
|
50
|
-
SCROLL = "scroll"
|
|
50
|
+
SCROLL = "scroll",
|
|
51
|
+
EXCALIDRAW_LINK = "excalidraw-link"
|
|
51
52
|
}
|
|
52
53
|
export declare const ENV: {
|
|
53
54
|
TEST: string;
|
|
@@ -99,6 +99,7 @@ export declare const actionLink: {
|
|
|
99
99
|
data: import("../charts").Spreadsheet;
|
|
100
100
|
};
|
|
101
101
|
pendingImageElement: import("./types").NonDeleted<import("./types").ExcalidrawImageElement> | null;
|
|
102
|
+
linkOpacity: number;
|
|
102
103
|
};
|
|
103
104
|
commitToHistory: true;
|
|
104
105
|
};
|
|
@@ -111,7 +112,7 @@ export declare const actionLink: {
|
|
|
111
112
|
};
|
|
112
113
|
export declare const getContextMenuLabel: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState) => "labels.link.edit" | "labels.link.create";
|
|
113
114
|
export declare const getLinkHandleFromCoords: ([x1, y1, x2, y2]: Bounds, angle: number, appState: AppState) => [x: number, y: number, width: number, height: number];
|
|
114
|
-
export declare const isPointHittingLinkIcon: (element: NonDeletedExcalidrawElement, appState: AppState, [x, y]: readonly [number, number]) => boolean;
|
|
115
|
+
export declare const isPointHittingLinkIcon: (element: NonDeletedExcalidrawElement, appState: AppState, [x, y]: readonly [number, number], isMobile: boolean) => boolean;
|
|
115
116
|
export declare const showHyperlinkTooltip: (element: NonDeletedExcalidrawElement, appState: AppState) => void;
|
|
116
117
|
export declare const hideHyperlinkToolip: () => void;
|
|
117
118
|
export declare const shouldHideLinkPopup: (element: NonDeletedExcalidrawElement, appState: AppState, [clientX, clientY]: readonly [number, number]) => Boolean;
|
|
@@ -167,6 +167,7 @@ export declare class LinearElementEditor {
|
|
|
167
167
|
};
|
|
168
168
|
pendingImageElement: NonDeleted<import("./types").ExcalidrawImageElement> | null;
|
|
169
169
|
showHyperlinkPopup: false | "info" | "editor";
|
|
170
|
+
linkOpacity: number;
|
|
170
171
|
};
|
|
171
172
|
};
|
|
172
173
|
static deletePoints(element: NonDeleted<ExcalidrawLinearElement>, pointIndices: readonly number[]): void;
|
package/types/keys.d.ts
CHANGED
|
@@ -13,7 +13,16 @@ export interface ExcalidrawElementWithCanvas {
|
|
|
13
13
|
canvasOffsetY: number;
|
|
14
14
|
}
|
|
15
15
|
export declare const DEFAULT_LINK_SIZE = 14;
|
|
16
|
-
|
|
16
|
+
declare type ElementShape = Drawable | Drawable[] | null;
|
|
17
|
+
declare type ElementShapes = {
|
|
18
|
+
freedraw: Drawable | null;
|
|
19
|
+
arrow: Drawable[];
|
|
20
|
+
line: Drawable[];
|
|
21
|
+
text: null;
|
|
22
|
+
image: null;
|
|
23
|
+
};
|
|
24
|
+
export declare const getShapeForElement: <T extends ExcalidrawElement>(element: T) => T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] | undefined : Drawable | null | undefined;
|
|
25
|
+
export declare const setShapeForElement: <T extends ExcalidrawElement>(element: T, shape: T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] : Drawable) => WeakMap<ExcalidrawElement, ElementShape>;
|
|
17
26
|
export declare const invalidateShapeForElement: (element: ExcalidrawElement) => boolean;
|
|
18
27
|
export declare const generateRoughOptions: (element: ExcalidrawElement, continuousPath?: boolean) => Options;
|
|
19
28
|
export declare const renderElement: (element: NonDeletedExcalidrawElement, rc: RoughCanvas, context: CanvasRenderingContext2D, renderConfig: RenderConfig) => void;
|
|
@@ -22,3 +31,4 @@ export declare const pathsCache: WeakMap<ExcalidrawFreeDrawElement, Path2D>;
|
|
|
22
31
|
export declare function generateFreeDrawShape(element: ExcalidrawFreeDrawElement): Path2D;
|
|
23
32
|
export declare function getFreeDrawPath2D(element: ExcalidrawFreeDrawElement): Path2D | undefined;
|
|
24
33
|
export declare function getFreeDrawSvgPath(element: ExcalidrawFreeDrawElement): string;
|
|
34
|
+
export {};
|
package/types/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { LinearElementEditor } from "./element/linearElementEditor";
|
|
|
6
6
|
import { SuggestedBinding } from "./element/binding";
|
|
7
7
|
import { ImportedDataState } from "./data/types";
|
|
8
8
|
import type App from "./components/App";
|
|
9
|
-
import type { ResolvablePromise } from "./utils";
|
|
9
|
+
import type { ResolvablePromise, throttleRAF } from "./utils";
|
|
10
10
|
import { Spreadsheet } from "./charts";
|
|
11
11
|
import { Language } from "./i18n";
|
|
12
12
|
import { ClipboardData } from "./clipboard";
|
|
@@ -126,6 +126,7 @@ export declare type AppState = {
|
|
|
126
126
|
/** imageElement waiting to be placed on canvas */
|
|
127
127
|
pendingImageElement: NonDeleted<ExcalidrawImageElement> | null;
|
|
128
128
|
showHyperlinkPopup: false | "info" | "editor";
|
|
129
|
+
linkOpacity: number;
|
|
129
130
|
};
|
|
130
131
|
export declare type NormalizedZoomValue = number & {
|
|
131
132
|
_brand: "normalizedZoom";
|
|
@@ -204,7 +205,11 @@ export interface ExcalidrawProps {
|
|
|
204
205
|
onBeforeTextSubmit?: (textElement: ExcalidrawTextElement, textToSubmit: string, originalText: string, isDeleted: boolean) => [string, string, string];
|
|
205
206
|
generateIdForFile?: (file: File) => string | Promise<string>;
|
|
206
207
|
onThemeChange?: (newTheme: string) => void;
|
|
207
|
-
onLinkOpen?: (
|
|
208
|
+
onLinkOpen?: (element: NonDeletedExcalidrawElement, event: CustomEvent<{
|
|
209
|
+
nativeEvent: MouseEvent | React.PointerEvent<HTMLCanvasElement>;
|
|
210
|
+
}>) => void;
|
|
211
|
+
onLinkHover?: (element: NonDeletedExcalidrawElement, event: React.PointerEvent<HTMLCanvasElement>) => void;
|
|
212
|
+
linkOpacity?: number;
|
|
208
213
|
}
|
|
209
214
|
export declare type SceneData = {
|
|
210
215
|
elements?: ImportedDataState["elements"];
|
|
@@ -303,7 +308,7 @@ export declare type PointerDownState = Readonly<{
|
|
|
303
308
|
} | null;
|
|
304
309
|
};
|
|
305
310
|
eventListeners: {
|
|
306
|
-
onMove: null |
|
|
311
|
+
onMove: null | ReturnType<typeof throttleRAF>;
|
|
307
312
|
onUp: null | ((event: PointerEvent) => void);
|
|
308
313
|
onKeyDown: null | ((event: KeyboardEvent) => void);
|
|
309
314
|
onKeyUp: null | ((event: KeyboardEvent) => void);
|
|
@@ -338,5 +343,6 @@ export declare type ExcalidrawImperativeAPI = {
|
|
|
338
343
|
bringForward: (elements: readonly ExcalidrawElement[]) => void;
|
|
339
344
|
sendToBack: (elements: readonly ExcalidrawElement[]) => void;
|
|
340
345
|
bringToFront: (elements: readonly ExcalidrawElement[]) => void;
|
|
346
|
+
setLinkOpacity: (opacity?: number) => void;
|
|
341
347
|
};
|
|
342
348
|
export {};
|