@zsviczian/excalidraw 0.18.0-15 → 0.18.0-17
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 +83 -61
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/styles.development.css +48 -20
- package/dist/styles.production.css +2 -1
- package/package.json +1 -1
- package/types/common/src/constants.d.ts +7 -1
- package/types/element/src/linearElementEditor.d.ts +8 -16
- package/types/element/src/newElement.d.ts +2 -1
- package/types/element/src/shapes.d.ts +5 -1
- package/types/element/src/typeChecks.d.ts +3 -1
- package/types/element/src/types.d.ts +7 -2
- package/types/excalidraw/actions/actionAddToLibrary.d.ts +12 -0
- package/types/excalidraw/actions/actionBoundText.d.ts +8 -0
- package/types/excalidraw/actions/actionCanvas.d.ts +75 -15
- package/types/excalidraw/actions/actionClipboard.d.ts +24 -0
- package/types/excalidraw/actions/actionCropEditor.d.ts +4 -0
- package/types/excalidraw/actions/actionDeleteSelected.d.ts +12 -0
- package/types/excalidraw/actions/actionElementLink.d.ts +4 -0
- package/types/excalidraw/actions/actionElementLock.d.ts +23 -16
- package/types/excalidraw/actions/actionEmbeddable.d.ts +4 -0
- package/types/excalidraw/actions/actionExport.d.ts +36 -0
- package/types/excalidraw/actions/actionFinalize.d.ts +8 -0
- package/types/excalidraw/actions/actionFrame.d.ts +16 -0
- package/types/excalidraw/actions/actionGroup.d.ts +8 -0
- package/types/excalidraw/actions/actionLinearEditor.d.ts +500 -0
- package/types/excalidraw/actions/actionLink.d.ts +4 -0
- package/types/excalidraw/actions/actionMenu.d.ts +12 -0
- package/types/excalidraw/actions/actionNavigate.d.ts +8 -0
- package/types/excalidraw/actions/actionProperties.d.ts +70 -2
- package/types/excalidraw/actions/actionSelectAll.d.ts +4 -0
- package/types/excalidraw/actions/actionStyles.d.ts +4 -0
- package/types/excalidraw/actions/actionToggleGridMode.d.ts +4 -0
- package/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +4 -0
- package/types/excalidraw/actions/actionToggleSearchMenu.d.ts +4 -0
- package/types/excalidraw/actions/actionToggleStats.d.ts +4 -0
- package/types/excalidraw/actions/actionToggleViewMode.d.ts +4 -0
- package/types/excalidraw/actions/actionToggleZenMode.d.ts +4 -0
- package/types/excalidraw/actions/types.d.ts +2 -1
- package/types/excalidraw/appState.d.ts +9 -0
- package/types/excalidraw/components/ButtonIcon.d.ts +1 -0
- package/types/excalidraw/components/{ButtonIconSelect.d.ts → RadioSelection.d.ts} +1 -1
- package/types/excalidraw/components/UnlockPopup.d.ts +8 -0
- package/types/excalidraw/components/hyperlink/helpers.d.ts +1 -0
- package/types/excalidraw/components/icons.d.ts +2 -0
- package/types/excalidraw/index.d.ts +1 -1
- package/types/excalidraw/lasso/index.d.ts +1 -0
- package/types/excalidraw/obsidianUtils.d.ts +9 -1
- package/types/excalidraw/renderer/helpers.d.ts +1 -1
- package/types/excalidraw/types.d.ts +8 -0
- package/types/math/src/point.d.ts +1 -1
- package/types/excalidraw/components/ButtonSelect.d.ts +0 -9
|
@@ -16,7 +16,15 @@ export declare const actionChangeBackgroundColor: {
|
|
|
16
16
|
name: "changeBackgroundColor";
|
|
17
17
|
label: string;
|
|
18
18
|
trackEvent: false;
|
|
19
|
-
perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, value: any) =>
|
|
19
|
+
perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, value: any, app: AppClassProperties) => {
|
|
20
|
+
appState: any;
|
|
21
|
+
captureUpdate: "EVENTUALLY";
|
|
22
|
+
elements?: undefined;
|
|
23
|
+
} | {
|
|
24
|
+
elements: ExcalidrawElement[];
|
|
25
|
+
appState: any;
|
|
26
|
+
captureUpdate: "IMMEDIATELY";
|
|
27
|
+
};
|
|
20
28
|
PanelComponent: ({ elements, appState, updateData, app }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
29
|
} & {
|
|
22
30
|
keyTest?: undefined;
|
|
@@ -230,6 +238,10 @@ export declare const actionChangeFillStyle: {
|
|
|
230
238
|
focusedId: string | null;
|
|
231
239
|
matches: readonly import("../types").SearchMatch[];
|
|
232
240
|
}> | null;
|
|
241
|
+
activeLockedId: string | null;
|
|
242
|
+
lockedMultiSelections: {
|
|
243
|
+
[groupId: string]: true;
|
|
244
|
+
};
|
|
233
245
|
};
|
|
234
246
|
captureUpdate: "IMMEDIATELY";
|
|
235
247
|
};
|
|
@@ -446,6 +458,10 @@ export declare const actionChangeStrokeWidth: {
|
|
|
446
458
|
focusedId: string | null;
|
|
447
459
|
matches: readonly import("../types").SearchMatch[];
|
|
448
460
|
}> | null;
|
|
461
|
+
activeLockedId: string | null;
|
|
462
|
+
lockedMultiSelections: {
|
|
463
|
+
[groupId: string]: true;
|
|
464
|
+
};
|
|
449
465
|
};
|
|
450
466
|
captureUpdate: "IMMEDIATELY";
|
|
451
467
|
};
|
|
@@ -662,6 +678,10 @@ export declare const actionChangeSloppiness: {
|
|
|
662
678
|
focusedId: string | null;
|
|
663
679
|
matches: readonly import("../types").SearchMatch[];
|
|
664
680
|
}> | null;
|
|
681
|
+
activeLockedId: string | null;
|
|
682
|
+
lockedMultiSelections: {
|
|
683
|
+
[groupId: string]: true;
|
|
684
|
+
};
|
|
665
685
|
};
|
|
666
686
|
captureUpdate: "IMMEDIATELY";
|
|
667
687
|
};
|
|
@@ -878,6 +898,10 @@ export declare const actionChangeStrokeStyle: {
|
|
|
878
898
|
focusedId: string | null;
|
|
879
899
|
matches: readonly import("../types").SearchMatch[];
|
|
880
900
|
}> | null;
|
|
901
|
+
activeLockedId: string | null;
|
|
902
|
+
lockedMultiSelections: {
|
|
903
|
+
[groupId: string]: true;
|
|
904
|
+
};
|
|
881
905
|
};
|
|
882
906
|
captureUpdate: "IMMEDIATELY";
|
|
883
907
|
};
|
|
@@ -1094,6 +1118,10 @@ export declare const actionChangeOpacity: {
|
|
|
1094
1118
|
focusedId: string | null;
|
|
1095
1119
|
matches: readonly import("../types").SearchMatch[];
|
|
1096
1120
|
}> | null;
|
|
1121
|
+
activeLockedId: string | null;
|
|
1122
|
+
lockedMultiSelections: {
|
|
1123
|
+
[groupId: string]: true;
|
|
1124
|
+
};
|
|
1097
1125
|
};
|
|
1098
1126
|
captureUpdate: "IMMEDIATELY";
|
|
1099
1127
|
};
|
|
@@ -1311,6 +1339,10 @@ export declare const actionChangeFontSize: {
|
|
|
1311
1339
|
focusedId: string | null;
|
|
1312
1340
|
matches: readonly import("../types").SearchMatch[];
|
|
1313
1341
|
}> | null;
|
|
1342
|
+
activeLockedId: string | null;
|
|
1343
|
+
lockedMultiSelections: {
|
|
1344
|
+
[groupId: string]: true;
|
|
1345
|
+
};
|
|
1314
1346
|
};
|
|
1315
1347
|
captureUpdate: "IMMEDIATELY";
|
|
1316
1348
|
};
|
|
@@ -1528,6 +1560,10 @@ export declare const actionDecreaseFontSize: {
|
|
|
1528
1560
|
focusedId: string | null;
|
|
1529
1561
|
matches: readonly import("../types").SearchMatch[];
|
|
1530
1562
|
}> | null;
|
|
1563
|
+
activeLockedId: string | null;
|
|
1564
|
+
lockedMultiSelections: {
|
|
1565
|
+
[groupId: string]: true;
|
|
1566
|
+
};
|
|
1531
1567
|
};
|
|
1532
1568
|
captureUpdate: "IMMEDIATELY";
|
|
1533
1569
|
};
|
|
@@ -1745,6 +1781,10 @@ export declare const actionIncreaseFontSize: {
|
|
|
1745
1781
|
focusedId: string | null;
|
|
1746
1782
|
matches: readonly import("../types").SearchMatch[];
|
|
1747
1783
|
}> | null;
|
|
1784
|
+
activeLockedId: string | null;
|
|
1785
|
+
lockedMultiSelections: {
|
|
1786
|
+
[groupId: string]: true;
|
|
1787
|
+
};
|
|
1748
1788
|
};
|
|
1749
1789
|
captureUpdate: "IMMEDIATELY";
|
|
1750
1790
|
};
|
|
@@ -1960,6 +2000,10 @@ export declare const actionChangeFontFamily: {
|
|
|
1960
2000
|
focusedId: string | null;
|
|
1961
2001
|
matches: readonly import("../types").SearchMatch[];
|
|
1962
2002
|
}> | null;
|
|
2003
|
+
activeLockedId: string | null;
|
|
2004
|
+
lockedMultiSelections: {
|
|
2005
|
+
[groupId: string]: true;
|
|
2006
|
+
};
|
|
1963
2007
|
};
|
|
1964
2008
|
captureUpdate: "IMMEDIATELY" | "EVENTUALLY";
|
|
1965
2009
|
} | {
|
|
@@ -2167,6 +2211,10 @@ export declare const actionChangeFontFamily: {
|
|
|
2167
2211
|
focusedId: string | null;
|
|
2168
2212
|
matches: readonly import("../types").SearchMatch[];
|
|
2169
2213
|
}> | null;
|
|
2214
|
+
activeLockedId: string | null;
|
|
2215
|
+
lockedMultiSelections: {
|
|
2216
|
+
[groupId: string]: true;
|
|
2217
|
+
};
|
|
2170
2218
|
};
|
|
2171
2219
|
captureUpdate: "NEVER";
|
|
2172
2220
|
};
|
|
@@ -2383,6 +2431,10 @@ export declare const actionChangeTextAlign: {
|
|
|
2383
2431
|
focusedId: string | null;
|
|
2384
2432
|
matches: readonly import("../types").SearchMatch[];
|
|
2385
2433
|
}> | null;
|
|
2434
|
+
activeLockedId: string | null;
|
|
2435
|
+
lockedMultiSelections: {
|
|
2436
|
+
[groupId: string]: true;
|
|
2437
|
+
};
|
|
2386
2438
|
};
|
|
2387
2439
|
captureUpdate: "IMMEDIATELY";
|
|
2388
2440
|
};
|
|
@@ -2601,6 +2653,10 @@ export declare const actionChangeVerticalAlign: {
|
|
|
2601
2653
|
focusedId: string | null;
|
|
2602
2654
|
matches: readonly import("../types").SearchMatch[];
|
|
2603
2655
|
}> | null;
|
|
2656
|
+
activeLockedId: string | null;
|
|
2657
|
+
lockedMultiSelections: {
|
|
2658
|
+
[groupId: string]: true;
|
|
2659
|
+
};
|
|
2604
2660
|
};
|
|
2605
2661
|
captureUpdate: "IMMEDIATELY";
|
|
2606
2662
|
};
|
|
@@ -2817,10 +2873,14 @@ export declare const actionChangeRoundness: {
|
|
|
2817
2873
|
focusedId: string | null;
|
|
2818
2874
|
matches: readonly import("../types").SearchMatch[];
|
|
2819
2875
|
}> | null;
|
|
2876
|
+
activeLockedId: string | null;
|
|
2877
|
+
lockedMultiSelections: {
|
|
2878
|
+
[groupId: string]: true;
|
|
2879
|
+
};
|
|
2820
2880
|
};
|
|
2821
2881
|
captureUpdate: "IMMEDIATELY";
|
|
2822
2882
|
};
|
|
2823
|
-
PanelComponent: ({ elements, appState, updateData, app }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
2883
|
+
PanelComponent: ({ elements, appState, updateData, app, renderAction }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
2824
2884
|
} & {
|
|
2825
2885
|
keyTest?: undefined;
|
|
2826
2886
|
};
|
|
@@ -3036,6 +3096,10 @@ export declare const actionChangeArrowhead: {
|
|
|
3036
3096
|
focusedId: string | null;
|
|
3037
3097
|
matches: readonly import("../types").SearchMatch[];
|
|
3038
3098
|
}> | null;
|
|
3099
|
+
activeLockedId: string | null;
|
|
3100
|
+
lockedMultiSelections: {
|
|
3101
|
+
[groupId: string]: true;
|
|
3102
|
+
};
|
|
3039
3103
|
};
|
|
3040
3104
|
captureUpdate: "IMMEDIATELY";
|
|
3041
3105
|
};
|
|
@@ -3252,6 +3316,10 @@ export declare const actionChangeArrowType: {
|
|
|
3252
3316
|
focusedId: string | null;
|
|
3253
3317
|
matches: readonly import("../types").SearchMatch[];
|
|
3254
3318
|
}> | null;
|
|
3319
|
+
activeLockedId: string | null;
|
|
3320
|
+
lockedMultiSelections: {
|
|
3321
|
+
[groupId: string]: true;
|
|
3322
|
+
};
|
|
3255
3323
|
};
|
|
3256
3324
|
captureUpdate: "IMMEDIATELY";
|
|
3257
3325
|
};
|
|
@@ -212,6 +212,10 @@ export declare const actionSelectAll: {
|
|
|
212
212
|
focusedId: string | null;
|
|
213
213
|
matches: readonly import("../types").SearchMatch[];
|
|
214
214
|
}> | null;
|
|
215
|
+
activeLockedId: string | null;
|
|
216
|
+
lockedMultiSelections: {
|
|
217
|
+
[groupId: string]: true;
|
|
218
|
+
};
|
|
215
219
|
};
|
|
216
220
|
captureUpdate: "IMMEDIATELY";
|
|
217
221
|
};
|
|
@@ -208,6 +208,10 @@ export declare const actionCopyStyles: {
|
|
|
208
208
|
focusedId: string | null;
|
|
209
209
|
matches: readonly import("../types").SearchMatch[];
|
|
210
210
|
}> | null;
|
|
211
|
+
activeLockedId: string | null;
|
|
212
|
+
lockedMultiSelections: {
|
|
213
|
+
[groupId: string]: true;
|
|
214
|
+
};
|
|
211
215
|
};
|
|
212
216
|
captureUpdate: "EVENTUALLY";
|
|
213
217
|
};
|
|
@@ -213,6 +213,10 @@ export declare const actionToggleGridMode: {
|
|
|
213
213
|
focusedId: string | null;
|
|
214
214
|
matches: readonly import("../types").SearchMatch[];
|
|
215
215
|
}> | null;
|
|
216
|
+
activeLockedId: string | null;
|
|
217
|
+
lockedMultiSelections: {
|
|
218
|
+
[groupId: string]: true;
|
|
219
|
+
};
|
|
216
220
|
};
|
|
217
221
|
captureUpdate: "EVENTUALLY";
|
|
218
222
|
};
|
|
@@ -211,6 +211,10 @@ export declare const actionToggleObjectsSnapMode: {
|
|
|
211
211
|
focusedId: string | null;
|
|
212
212
|
matches: readonly import("../types").SearchMatch[];
|
|
213
213
|
}> | null;
|
|
214
|
+
activeLockedId: string | null;
|
|
215
|
+
lockedMultiSelections: {
|
|
216
|
+
[groupId: string]: true;
|
|
217
|
+
};
|
|
214
218
|
};
|
|
215
219
|
captureUpdate: "EVENTUALLY";
|
|
216
220
|
};
|
|
@@ -204,6 +204,10 @@ export declare const actionToggleSearchMenu: {
|
|
|
204
204
|
focusedId: string | null;
|
|
205
205
|
matches: readonly import("../types").SearchMatch[];
|
|
206
206
|
}> | null;
|
|
207
|
+
activeLockedId: string | null;
|
|
208
|
+
lockedMultiSelections: {
|
|
209
|
+
[groupId: string]: true;
|
|
210
|
+
};
|
|
207
211
|
};
|
|
208
212
|
captureUpdate: "EVENTUALLY";
|
|
209
213
|
};
|
|
@@ -211,6 +211,10 @@ export declare const actionToggleStats: {
|
|
|
211
211
|
focusedId: string | null;
|
|
212
212
|
matches: readonly import("../types").SearchMatch[];
|
|
213
213
|
}> | null;
|
|
214
|
+
activeLockedId: string | null;
|
|
215
|
+
lockedMultiSelections: {
|
|
216
|
+
[groupId: string]: true;
|
|
217
|
+
};
|
|
214
218
|
};
|
|
215
219
|
captureUpdate: "EVENTUALLY";
|
|
216
220
|
};
|
|
@@ -211,6 +211,10 @@ export declare const actionToggleViewMode: {
|
|
|
211
211
|
focusedId: string | null;
|
|
212
212
|
matches: readonly import("../types").SearchMatch[];
|
|
213
213
|
}> | null;
|
|
214
|
+
activeLockedId: string | null;
|
|
215
|
+
lockedMultiSelections: {
|
|
216
|
+
[groupId: string]: true;
|
|
217
|
+
};
|
|
214
218
|
};
|
|
215
219
|
captureUpdate: "EVENTUALLY";
|
|
216
220
|
};
|
|
@@ -211,6 +211,10 @@ export declare const actionToggleZenMode: {
|
|
|
211
211
|
focusedId: string | null;
|
|
212
212
|
matches: readonly import("../types").SearchMatch[];
|
|
213
213
|
}> | null;
|
|
214
|
+
activeLockedId: string | null;
|
|
215
|
+
lockedMultiSelections: {
|
|
216
|
+
[groupId: string]: true;
|
|
217
|
+
};
|
|
214
218
|
};
|
|
215
219
|
captureUpdate: "EVENTUALLY";
|
|
216
220
|
};
|
|
@@ -14,7 +14,7 @@ export type ActionResult = {
|
|
|
14
14
|
type ActionFn = (elements: readonly OrderedExcalidrawElement[], appState: Readonly<AppState>, formData: any, app: AppClassProperties) => ActionResult | Promise<ActionResult>;
|
|
15
15
|
export type UpdaterFn = (res: ActionResult) => void;
|
|
16
16
|
export type ActionFilterFn = (action: Action) => void;
|
|
17
|
-
export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "changeOpacity" | "changeFontSize" | "toggleCanvasMenu" | "toggleEditMenu" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "setEmbeddableAsActiveTool" | "createContainerFromText" | "wrapTextInContainer" | "toggleLaserPointerTool" | "commandPalette" | "autoResize" | "elementStats" | "searchMenu" | "copyElementLink" | "linkToElement" | "cropEditor" | "wrapSelectionInFrame" | "toggleLassoTool" | "toggleShapeSwitch";
|
|
17
|
+
export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "changeOpacity" | "changeFontSize" | "toggleCanvasMenu" | "toggleEditMenu" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "setEmbeddableAsActiveTool" | "createContainerFromText" | "wrapTextInContainer" | "toggleLaserPointerTool" | "commandPalette" | "autoResize" | "elementStats" | "searchMenu" | "copyElementLink" | "linkToElement" | "cropEditor" | "wrapSelectionInFrame" | "toggleLassoTool" | "toggleShapeSwitch" | "togglePolygon";
|
|
18
18
|
export type PanelComponentProps = {
|
|
19
19
|
elements: readonly ExcalidrawElement[];
|
|
20
20
|
appState: AppState;
|
|
@@ -22,6 +22,7 @@ export type PanelComponentProps = {
|
|
|
22
22
|
appProps: ExcalidrawProps;
|
|
23
23
|
data?: Record<string, any>;
|
|
24
24
|
app: AppClassProperties;
|
|
25
|
+
renderAction: (name: ActionName, data?: PanelComponentProps["data"]) => React.JSX.Element | null;
|
|
25
26
|
};
|
|
26
27
|
export interface Action {
|
|
27
28
|
name: ActionName;
|
|
@@ -66,18 +66,27 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
66
66
|
currentChartType?: import("@excalidraw/element/types").ChartType | undefined;
|
|
67
67
|
selectedLinearElement?: import("@excalidraw/element").LinearElementEditor | null | undefined;
|
|
68
68
|
objectsSnapModeEnabled?: boolean | undefined;
|
|
69
|
+
lockedMultiSelections?: {
|
|
70
|
+
[groupId: string]: true;
|
|
71
|
+
} | undefined;
|
|
69
72
|
};
|
|
70
73
|
export declare const cleanAppStateForExport: (appState: Partial<AppState>) => {
|
|
71
74
|
viewBackgroundColor?: string | undefined;
|
|
72
75
|
gridSize?: number | undefined;
|
|
73
76
|
gridStep?: number | undefined;
|
|
74
77
|
gridModeEnabled?: boolean | undefined;
|
|
78
|
+
lockedMultiSelections?: {
|
|
79
|
+
[groupId: string]: true;
|
|
80
|
+
} | undefined;
|
|
75
81
|
};
|
|
76
82
|
export declare const clearAppStateForDatabase: (appState: Partial<AppState>) => {
|
|
77
83
|
viewBackgroundColor?: string | undefined;
|
|
78
84
|
gridSize?: number | undefined;
|
|
79
85
|
gridStep?: number | undefined;
|
|
80
86
|
gridModeEnabled?: boolean | undefined;
|
|
87
|
+
lockedMultiSelections?: {
|
|
88
|
+
[groupId: string]: true;
|
|
89
|
+
} | undefined;
|
|
81
90
|
};
|
|
82
91
|
export declare const isEraserActive: ({ activeTool, }: {
|
|
83
92
|
activeTool: AppState["activeTool"];
|
|
@@ -10,6 +10,7 @@ interface ButtonIconProps {
|
|
|
10
10
|
/** include standalone style (could interfere with parent styles) */
|
|
11
11
|
standalone?: boolean;
|
|
12
12
|
onClick: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
13
|
+
style?: React.CSSProperties;
|
|
13
14
|
}
|
|
14
15
|
export declare const ButtonIcon: import("react").ForwardRefExoticComponent<ButtonIconProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
15
16
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./UnlockPopup.scss";
|
|
2
|
+
import type App from "./App";
|
|
3
|
+
import type { AppState } from "../types";
|
|
4
|
+
declare const UnlockPopup: ({ app, activeLockedId, }: {
|
|
5
|
+
app: App;
|
|
6
|
+
activeLockedId: NonNullable<AppState["activeLockedId"]>;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export default UnlockPopup;
|
|
@@ -2,6 +2,7 @@ import type { GlobalPoint, Radians } from "@excalidraw/math";
|
|
|
2
2
|
import type { Bounds } from "@excalidraw/element";
|
|
3
3
|
import type { ElementsMap, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
4
4
|
import type { AppState, UIAppState } from "../../types";
|
|
5
|
+
export declare const DEFAULT_LINK_SIZE = 12;
|
|
5
6
|
export declare const EXTERNAL_LINK_IMG: HTMLImageElement;
|
|
6
7
|
export declare const ELEMENT_LINK_IMG: HTMLImageElement;
|
|
7
8
|
export declare const getLinkHandleFromCoords: ([x1, y1, x2, y2]: Bounds, angle: Radians, appState: Pick<UIAppState, "zoom">) => Bounds;
|
|
@@ -12,8 +12,10 @@ export declare const LibraryIcon: import("react/jsx-runtime").JSX.Element;
|
|
|
12
12
|
export declare const PlusIcon: import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export declare const DotsIcon: import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export declare const PinIcon: import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const polygonIcon: import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
export declare const UnlockedIcon: import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
export declare const LockedIcon: import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const LockedIconFilled: import("react/jsx-runtime").JSX.Element;
|
|
17
19
|
export declare const WelcomeScreenMenuArrow: import("react/jsx-runtime").JSX.Element;
|
|
18
20
|
export declare const WelcomeScreenHelpArrow: import("react/jsx-runtime").JSX.Element;
|
|
19
21
|
export declare const WelcomeScreenTopToolbarArrow: import("react/jsx-runtime").JSX.Element;
|
|
@@ -24,7 +24,7 @@ export { getLineHeight } from "@excalidraw/common";
|
|
|
24
24
|
export { getFontString, getFontFamilyString } from "@excalidraw/common";
|
|
25
25
|
export { getBoundTextMaxWidth } from "@excalidraw/element/textElement";
|
|
26
26
|
export { mermaidToExcalidraw } from "./components/TTDDialog/MermaidToExcalidrawLib";
|
|
27
|
-
export { destroyObsidianUtils, registerLocalFont, getFontFamilies, registerFontsInCSS, getCSSFontDefinition, loadSceneFonts, getSharedMermaidInstance, loadMermaid, intersectElementWithLine, } from "../excalidraw/obsidianUtils";
|
|
27
|
+
export { destroyObsidianUtils, registerLocalFont, getFontMetrics, getFontFamilies, registerFontsInCSS, getCSSFontDefinition, loadSceneFonts, getSharedMermaidInstance, loadMermaid, intersectElementWithLine, } from "../excalidraw/obsidianUtils";
|
|
28
28
|
export { refreshTextDimensions } from "@excalidraw/element/newElement";
|
|
29
29
|
export { getContainerElement } from "@excalidraw/element/textElement";
|
|
30
30
|
export { serializeAsJSON, serializeLibraryAsJSON } from "./data/json";
|
|
@@ -5,6 +5,7 @@ export declare class LassoTrail extends AnimatedTrail {
|
|
|
5
5
|
private intersectedElements;
|
|
6
6
|
private enclosedElements;
|
|
7
7
|
private elementsSegments;
|
|
8
|
+
private canvasTranslate;
|
|
8
9
|
private keepPreviousSelection;
|
|
9
10
|
constructor(animationFrameHandler: AnimationFrameHandler, app: App);
|
|
10
11
|
startPath(x: number, y: number, keepPreviousSelection?: boolean): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GlobalPoint } from "@excalidraw/math/types";
|
|
2
2
|
import type { MermaidToExcalidrawLibProps } from "./components/TTDDialog/common";
|
|
3
|
-
import type { ElementsMap, ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
3
|
+
import type { ElementsMap, ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
4
4
|
import type { FontMetadata } from "@excalidraw/common";
|
|
5
5
|
import type { AppState } from "./types";
|
|
6
6
|
export declare let hostPlugin: any;
|
|
@@ -14,6 +14,14 @@ export declare function isExcaliBrainView(): any;
|
|
|
14
14
|
export declare function getExcalidrawContentEl(): HTMLElement;
|
|
15
15
|
export declare function hideFreedrawPenmodeCursor(): boolean;
|
|
16
16
|
export declare function getOpenAIDefaultVisionModel(): any;
|
|
17
|
+
export declare function getFontMetrics(fontFamily: ExcalidrawTextElement["fontFamily"], fontSize?: number): {
|
|
18
|
+
unitsPerEm: number;
|
|
19
|
+
ascender: number;
|
|
20
|
+
descender: number;
|
|
21
|
+
lineHeight: number;
|
|
22
|
+
baseline: number;
|
|
23
|
+
fontString: string;
|
|
24
|
+
};
|
|
17
25
|
export declare function registerLocalFont(fontMetrics: FontMetadata & {
|
|
18
26
|
name: string;
|
|
19
27
|
}, uri: string): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ExcalidrawDiamondElement, ExcalidrawRectanguloidElement } from "@excalidraw/element/types";
|
|
2
2
|
import type { StaticCanvasRenderConfig } from "../scene/types";
|
|
3
3
|
import type { AppState, StaticCanvasAppState } from "../types";
|
|
4
|
-
export declare const fillCircle: (context: CanvasRenderingContext2D, cx: number, cy: number, radius: number, stroke?: boolean) => void;
|
|
4
|
+
export declare const fillCircle: (context: CanvasRenderingContext2D, cx: number, cy: number, radius: number, stroke: boolean, fill?: boolean) => void;
|
|
5
5
|
export declare const getNormalizedCanvasDimensions: (canvas: HTMLCanvasElement, scale: number) => [number, number];
|
|
6
6
|
export declare const bootstrapCanvas: ({ canvas, scale, normalizedWidth, normalizedHeight, theme, isExporting, viewBackgroundColor, }: {
|
|
7
7
|
canvas: HTMLCanvasElement;
|
|
@@ -153,6 +153,7 @@ export type InteractiveCanvasAppState = Readonly<_CommonCanvasAppState & {
|
|
|
153
153
|
isCropping: AppState["isCropping"];
|
|
154
154
|
croppingElementId: AppState["croppingElementId"];
|
|
155
155
|
searchMatches: AppState["searchMatches"];
|
|
156
|
+
activeLockedId: AppState["activeLockedId"];
|
|
156
157
|
}>;
|
|
157
158
|
export type ObservedAppState = ObservedStandaloneAppState & ObservedElementsAppState;
|
|
158
159
|
export type ObservedStandaloneAppState = {
|
|
@@ -166,6 +167,8 @@ export type ObservedElementsAppState = {
|
|
|
166
167
|
editingLinearElementId: LinearElementEditor["elementId"] | null;
|
|
167
168
|
selectedLinearElementId: LinearElementEditor["elementId"] | null;
|
|
168
169
|
croppingElementId: AppState["croppingElementId"];
|
|
170
|
+
lockedMultiSelections: AppState["lockedMultiSelections"];
|
|
171
|
+
activeLockedId: AppState["activeLockedId"];
|
|
169
172
|
};
|
|
170
173
|
export interface AppState {
|
|
171
174
|
contextMenu: {
|
|
@@ -389,6 +392,11 @@ export interface AppState {
|
|
|
389
392
|
focusedId: ExcalidrawElement["id"] | null;
|
|
390
393
|
matches: readonly SearchMatch[];
|
|
391
394
|
}> | null;
|
|
395
|
+
/** the locked element/group that's active and shows unlock popup */
|
|
396
|
+
activeLockedId: string | null;
|
|
397
|
+
lockedMultiSelections: {
|
|
398
|
+
[groupId: string]: true;
|
|
399
|
+
};
|
|
392
400
|
}
|
|
393
401
|
export type SearchMatch = {
|
|
394
402
|
id: string;
|
|
@@ -43,7 +43,7 @@ export declare function isPoint(p: unknown): p is LocalPoint | GlobalPoint;
|
|
|
43
43
|
* @param b Point The second point to compare
|
|
44
44
|
* @returns TRUE if the points are sufficiently close to each other
|
|
45
45
|
*/
|
|
46
|
-
export declare function pointsEqual<Point extends GlobalPoint | LocalPoint>(a: Point, b: Point): boolean;
|
|
46
|
+
export declare function pointsEqual<Point extends GlobalPoint | LocalPoint>(a: Point, b: Point, tolerance?: number): boolean;
|
|
47
47
|
/**
|
|
48
48
|
* Rotate a point by [angle] radians.
|
|
49
49
|
*
|