@zsviczian/excalidraw 0.15.2-obsidian-5 → 0.15.2-obsidian-7
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 +49 -27
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +1 -1
- package/types/actions/actionAddToLibrary.d.ts +12 -12
- package/types/actions/actionBoundText.d.ts +6 -5
- package/types/actions/actionCanvas.d.ts +337 -41
- package/types/actions/actionClipboard.d.ts +17 -17
- package/types/actions/actionDeleteSelected.d.ts +9 -9
- package/types/actions/actionElementLock.d.ts +5 -5
- package/types/actions/actionExport.d.ts +36 -36
- package/types/actions/actionFinalize.d.ts +8 -8
- package/types/actions/actionFrame.d.ts +9 -9
- package/types/actions/actionLinearEditor.d.ts +4 -4
- package/types/actions/actionMenu.d.ts +12 -12
- package/types/actions/actionProperties.d.ts +52 -52
- package/types/actions/actionStyles.d.ts +4 -4
- package/types/actions/actionToggleGridMode.d.ts +4 -4
- package/types/actions/actionToggleStats.d.ts +4 -4
- package/types/actions/actionToggleViewMode.d.ts +4 -4
- package/types/actions/actionToggleZenMode.d.ts +4 -4
- package/types/actions/types.d.ts +1 -1
- package/types/appState.d.ts +4 -4
- package/types/components/App.d.ts +13 -1
- package/types/constants.d.ts +8 -8
- package/types/data/url.d.ts +2 -0
- package/types/element/Hyperlink.d.ts +4 -6
- package/types/element/iframe.d.ts +5 -11
- package/types/element/linearElementEditor.d.ts +4 -4
- package/types/element/newElement.d.ts +1 -2
- package/types/element/types.d.ts +8 -1
- package/types/groups.d.ts +1 -1
- package/types/history.d.ts +3 -3
- package/types/keys.d.ts +1 -0
- package/types/packages/excalidraw/index.d.ts +1 -0
- package/types/scene/selection.d.ts +11 -1
- package/types/types.d.ts +9 -5
- package/types/utils.d.ts +41 -14
package/package.json
CHANGED
|
@@ -84,11 +84,11 @@ export declare const actionAddToLibrary: {
|
|
|
84
84
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
85
85
|
defaultSidebarDockedPreference: boolean;
|
|
86
86
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
87
|
-
selectedElementIds: {
|
|
88
|
-
[id: string]:
|
|
89
|
-
}
|
|
87
|
+
selectedElementIds: Readonly<{
|
|
88
|
+
[id: string]: true;
|
|
89
|
+
}>;
|
|
90
90
|
previousSelectedElementIds: {
|
|
91
|
-
[id: string]:
|
|
91
|
+
[id: string]: true;
|
|
92
92
|
};
|
|
93
93
|
selectedElementsAreBeingDragged: boolean;
|
|
94
94
|
shouldCacheIgnoreZoom: boolean;
|
|
@@ -218,11 +218,11 @@ export declare const actionAddToLibrary: {
|
|
|
218
218
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
219
219
|
defaultSidebarDockedPreference: boolean;
|
|
220
220
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
221
|
-
selectedElementIds: {
|
|
222
|
-
[id: string]:
|
|
223
|
-
}
|
|
221
|
+
selectedElementIds: Readonly<{
|
|
222
|
+
[id: string]: true;
|
|
223
|
+
}>;
|
|
224
224
|
previousSelectedElementIds: {
|
|
225
|
-
[id: string]:
|
|
225
|
+
[id: string]: true;
|
|
226
226
|
};
|
|
227
227
|
selectedElementsAreBeingDragged: boolean;
|
|
228
228
|
shouldCacheIgnoreZoom: boolean;
|
|
@@ -357,11 +357,11 @@ export declare const actionAddToLibrary: {
|
|
|
357
357
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
358
358
|
defaultSidebarDockedPreference: boolean;
|
|
359
359
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
360
|
-
selectedElementIds: {
|
|
361
|
-
[id: string]:
|
|
362
|
-
}
|
|
360
|
+
selectedElementIds: Readonly<{
|
|
361
|
+
[id: string]: true;
|
|
362
|
+
}>;
|
|
363
363
|
previousSelectedElementIds: {
|
|
364
|
-
[id: string]:
|
|
364
|
+
[id: string]: true;
|
|
365
365
|
};
|
|
366
366
|
selectedElementsAreBeingDragged: boolean;
|
|
367
367
|
shouldCacheIgnoreZoom: boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ExcalidrawElement, ExcalidrawLinearElement } from "../element/types";
|
|
3
3
|
import { AppState } from "../types";
|
|
4
|
+
import { Mutable } from "../utility-types";
|
|
4
5
|
export declare const actionUnbindText: {
|
|
5
6
|
name: "unbindText";
|
|
6
7
|
contextItemLabel: string;
|
|
@@ -104,7 +105,7 @@ export declare const actionBindText: {
|
|
|
104
105
|
defaultSidebarDockedPreference: boolean;
|
|
105
106
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
106
107
|
previousSelectedElementIds: {
|
|
107
|
-
[id: string]:
|
|
108
|
+
[id: string]: true;
|
|
108
109
|
};
|
|
109
110
|
selectedElementsAreBeingDragged: boolean;
|
|
110
111
|
shouldCacheIgnoreZoom: boolean;
|
|
@@ -177,9 +178,9 @@ export declare const actionWrapTextInContainer: {
|
|
|
177
178
|
perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>) => {
|
|
178
179
|
elements: readonly ExcalidrawElement[];
|
|
179
180
|
appState: {
|
|
180
|
-
selectedElementIds: {
|
|
181
|
-
[id: string]:
|
|
182
|
-
}
|
|
181
|
+
selectedElementIds: Mutable<Readonly<{
|
|
182
|
+
[id: string]: true;
|
|
183
|
+
}>>;
|
|
183
184
|
contextMenu: {
|
|
184
185
|
items: import("../components/ContextMenu").ContextMenuItems;
|
|
185
186
|
top: number;
|
|
@@ -255,7 +256,7 @@ export declare const actionWrapTextInContainer: {
|
|
|
255
256
|
defaultSidebarDockedPreference: boolean;
|
|
256
257
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
257
258
|
previousSelectedElementIds: {
|
|
258
|
-
[id: string]:
|
|
259
|
+
[id: string]: true;
|
|
259
260
|
};
|
|
260
261
|
selectedElementsAreBeingDragged: boolean;
|
|
261
262
|
shouldCacheIgnoreZoom: boolean;
|
|
@@ -122,11 +122,11 @@ export declare const actionClearCanvas: {
|
|
|
122
122
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
123
123
|
defaultSidebarDockedPreference: boolean;
|
|
124
124
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
125
|
-
selectedElementIds: {
|
|
126
|
-
[id: string]:
|
|
127
|
-
}
|
|
125
|
+
selectedElementIds: Readonly<{
|
|
126
|
+
[id: string]: true;
|
|
127
|
+
}>;
|
|
128
128
|
previousSelectedElementIds: {
|
|
129
|
-
[id: string]:
|
|
129
|
+
[id: string]: true;
|
|
130
130
|
};
|
|
131
131
|
selectedElementsAreBeingDragged: boolean;
|
|
132
132
|
shouldCacheIgnoreZoom: boolean;
|
|
@@ -242,11 +242,11 @@ export declare const actionZoomIn: {
|
|
|
242
242
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
243
243
|
defaultSidebarDockedPreference: boolean;
|
|
244
244
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
245
|
-
selectedElementIds: {
|
|
246
|
-
[id: string]:
|
|
247
|
-
}
|
|
245
|
+
selectedElementIds: Readonly<{
|
|
246
|
+
[id: string]: true;
|
|
247
|
+
}>;
|
|
248
248
|
previousSelectedElementIds: {
|
|
249
|
-
[id: string]:
|
|
249
|
+
[id: string]: true;
|
|
250
250
|
};
|
|
251
251
|
selectedElementsAreBeingDragged: boolean;
|
|
252
252
|
shouldCacheIgnoreZoom: boolean;
|
|
@@ -393,11 +393,11 @@ export declare const actionZoomOut: {
|
|
|
393
393
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
394
394
|
defaultSidebarDockedPreference: boolean;
|
|
395
395
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
396
|
-
selectedElementIds: {
|
|
397
|
-
[id: string]:
|
|
398
|
-
}
|
|
396
|
+
selectedElementIds: Readonly<{
|
|
397
|
+
[id: string]: true;
|
|
398
|
+
}>;
|
|
399
399
|
previousSelectedElementIds: {
|
|
400
|
-
[id: string]:
|
|
400
|
+
[id: string]: true;
|
|
401
401
|
};
|
|
402
402
|
selectedElementsAreBeingDragged: boolean;
|
|
403
403
|
shouldCacheIgnoreZoom: boolean;
|
|
@@ -544,11 +544,11 @@ export declare const actionResetZoom: {
|
|
|
544
544
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
545
545
|
defaultSidebarDockedPreference: boolean;
|
|
546
546
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
547
|
-
selectedElementIds: {
|
|
548
|
-
[id: string]:
|
|
549
|
-
}
|
|
547
|
+
selectedElementIds: Readonly<{
|
|
548
|
+
[id: string]: true;
|
|
549
|
+
}>;
|
|
550
550
|
previousSelectedElementIds: {
|
|
551
|
-
[id: string]:
|
|
551
|
+
[id: string]: true;
|
|
552
552
|
};
|
|
553
553
|
selectedElementsAreBeingDragged: boolean;
|
|
554
554
|
shouldCacheIgnoreZoom: boolean;
|
|
@@ -613,13 +613,20 @@ export declare const actionResetZoom: {
|
|
|
613
613
|
} & {
|
|
614
614
|
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
615
615
|
};
|
|
616
|
-
export declare const
|
|
616
|
+
export declare const zoomToFit: ({ targetElements, appState, fitToViewport, viewportZoomFactor, }: {
|
|
617
|
+
targetElements: readonly ExcalidrawElement[];
|
|
618
|
+
appState: Readonly<AppState>;
|
|
619
|
+
/** whether to fit content to viewport (beyond >100%) */
|
|
620
|
+
fitToViewport: boolean;
|
|
621
|
+
/** zoom content to cover X of the viewport, when fitToViewport=true */
|
|
622
|
+
viewportZoomFactor?: number | undefined;
|
|
623
|
+
}) => {
|
|
617
624
|
appState: {
|
|
625
|
+
scrollX: number;
|
|
626
|
+
scrollY: number;
|
|
618
627
|
zoom: {
|
|
619
628
|
value: NormalizedZoomValue;
|
|
620
629
|
};
|
|
621
|
-
scrollX: number;
|
|
622
|
-
scrollY: number;
|
|
623
630
|
contextMenu: {
|
|
624
631
|
items: import("../components/ContextMenu").ContextMenuItems;
|
|
625
632
|
top: number;
|
|
@@ -689,11 +696,11 @@ export declare const zoomToFitElements: (elements: readonly ExcalidrawElement[],
|
|
|
689
696
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
690
697
|
defaultSidebarDockedPreference: boolean;
|
|
691
698
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
692
|
-
selectedElementIds: {
|
|
693
|
-
[id: string]:
|
|
694
|
-
}
|
|
699
|
+
selectedElementIds: Readonly<{
|
|
700
|
+
[id: string]: true;
|
|
701
|
+
}>;
|
|
695
702
|
previousSelectedElementIds: {
|
|
696
|
-
[id: string]:
|
|
703
|
+
[id: string]: true;
|
|
697
704
|
};
|
|
698
705
|
selectedElementsAreBeingDragged: boolean;
|
|
699
706
|
shouldCacheIgnoreZoom: boolean;
|
|
@@ -753,18 +760,167 @@ export declare const zoomToFitElements: (elements: readonly ExcalidrawElement[],
|
|
|
753
760
|
};
|
|
754
761
|
commitToHistory: boolean;
|
|
755
762
|
};
|
|
756
|
-
export declare const
|
|
757
|
-
name: "
|
|
763
|
+
export declare const actionZoomToFitSelectionInViewport: {
|
|
764
|
+
name: "zoomToFitSelectionInViewport";
|
|
758
765
|
trackEvent: {
|
|
759
766
|
category: "canvas";
|
|
760
767
|
};
|
|
761
768
|
perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>) => {
|
|
762
769
|
appState: {
|
|
770
|
+
scrollX: number;
|
|
771
|
+
scrollY: number;
|
|
763
772
|
zoom: {
|
|
764
773
|
value: NormalizedZoomValue;
|
|
765
774
|
};
|
|
775
|
+
contextMenu: {
|
|
776
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
777
|
+
top: number;
|
|
778
|
+
left: number;
|
|
779
|
+
} | null;
|
|
780
|
+
showWelcomeScreen: boolean;
|
|
781
|
+
isLoading: boolean;
|
|
782
|
+
errorMessage: import("react").ReactNode;
|
|
783
|
+
activeIFrame: {
|
|
784
|
+
element: import("../element/types").NonDeletedExcalidrawElement;
|
|
785
|
+
state: "active" | "hover";
|
|
786
|
+
} | null;
|
|
787
|
+
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
788
|
+
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
789
|
+
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
790
|
+
selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
791
|
+
isBindingEnabled: boolean;
|
|
792
|
+
startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
|
|
793
|
+
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
794
|
+
frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
|
|
795
|
+
shouldRenderFrames: boolean;
|
|
796
|
+
editingFrame: string | null;
|
|
797
|
+
elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
798
|
+
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
799
|
+
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
800
|
+
activeTool: {
|
|
801
|
+
lastActiveTool: import("../types").LastActiveTool;
|
|
802
|
+
locked: boolean;
|
|
803
|
+
} & ({
|
|
804
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "iframe" | "image" | "frame" | "freedraw" | "eraser" | "hand";
|
|
805
|
+
customType: null;
|
|
806
|
+
} | {
|
|
807
|
+
type: "custom";
|
|
808
|
+
customType: string;
|
|
809
|
+
});
|
|
810
|
+
penMode: boolean;
|
|
811
|
+
penDetected: boolean;
|
|
812
|
+
exportBackground: boolean;
|
|
813
|
+
exportEmbedScene: boolean;
|
|
814
|
+
exportWithDarkMode: boolean;
|
|
815
|
+
exportScale: number;
|
|
816
|
+
currentItemStrokeColor: string;
|
|
817
|
+
currentItemBackgroundColor: string;
|
|
818
|
+
currentItemFillStyle: import("../element/types").FillStyle;
|
|
819
|
+
currentItemStrokeWidth: number;
|
|
820
|
+
currentItemStrokeStyle: import("../element/types").StrokeStyle;
|
|
821
|
+
currentItemRoughness: number;
|
|
822
|
+
currentItemOpacity: number;
|
|
823
|
+
currentItemFontFamily: number;
|
|
824
|
+
currentItemFontSize: number;
|
|
825
|
+
currentItemTextAlign: string;
|
|
826
|
+
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
827
|
+
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
828
|
+
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
829
|
+
viewBackgroundColor: string;
|
|
830
|
+
cursorButton: "up" | "down";
|
|
831
|
+
scrolledOutside: boolean;
|
|
832
|
+
name: string;
|
|
833
|
+
isResizing: boolean;
|
|
834
|
+
isRotating: boolean;
|
|
835
|
+
openMenu: "canvas" | "shape" | null;
|
|
836
|
+
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
837
|
+
openSidebar: {
|
|
838
|
+
name: string;
|
|
839
|
+
tab?: string | undefined;
|
|
840
|
+
} | null;
|
|
841
|
+
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
842
|
+
defaultSidebarDockedPreference: boolean;
|
|
843
|
+
lastPointerDownWith: import("../element/types").PointerType;
|
|
844
|
+
selectedElementIds: Readonly<{
|
|
845
|
+
[id: string]: true;
|
|
846
|
+
}>;
|
|
847
|
+
previousSelectedElementIds: {
|
|
848
|
+
[id: string]: true;
|
|
849
|
+
};
|
|
850
|
+
selectedElementsAreBeingDragged: boolean;
|
|
851
|
+
shouldCacheIgnoreZoom: boolean;
|
|
852
|
+
toast: {
|
|
853
|
+
message: string;
|
|
854
|
+
closable?: boolean | undefined;
|
|
855
|
+
duration?: number | undefined;
|
|
856
|
+
} | null;
|
|
857
|
+
zenModeEnabled: boolean;
|
|
858
|
+
theme: string;
|
|
859
|
+
gridSize: number | null;
|
|
860
|
+
previousGridSize: number | null;
|
|
861
|
+
viewModeEnabled: boolean;
|
|
862
|
+
selectedGroupIds: {
|
|
863
|
+
[groupId: string]: boolean;
|
|
864
|
+
};
|
|
865
|
+
editingGroupId: string | null;
|
|
866
|
+
width: number;
|
|
867
|
+
height: number;
|
|
868
|
+
offsetTop: number;
|
|
869
|
+
offsetLeft: number;
|
|
870
|
+
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
871
|
+
collaborators: Map<string, import("../types").Collaborator>;
|
|
872
|
+
showStats: boolean;
|
|
873
|
+
currentChartType: import("../element/types").ChartType;
|
|
874
|
+
pasteDialog: {
|
|
875
|
+
shown: false;
|
|
876
|
+
data: null;
|
|
877
|
+
} | {
|
|
878
|
+
shown: true;
|
|
879
|
+
data: import("../charts").Spreadsheet;
|
|
880
|
+
};
|
|
881
|
+
pendingImageElementId: string | null;
|
|
882
|
+
showHyperlinkPopup: false | "info" | "editor";
|
|
883
|
+
linkOpacity: number;
|
|
884
|
+
trayModeEnabled: boolean;
|
|
885
|
+
colorPalette?: {
|
|
886
|
+
canvasBackground: import("../colors").ColorPaletteCustom;
|
|
887
|
+
elementBackground: import("../colors").ColorPaletteCustom;
|
|
888
|
+
elementStroke: import("../colors").ColorPaletteCustom;
|
|
889
|
+
topPicks: {
|
|
890
|
+
canvasBackground: [string, string, string, string, string];
|
|
891
|
+
elementStroke: [string, string, string, string, string];
|
|
892
|
+
elementBackground: [string, string, string, string, string];
|
|
893
|
+
};
|
|
894
|
+
} | undefined;
|
|
895
|
+
allowWheelZoom?: boolean | undefined;
|
|
896
|
+
allowPinchZoom?: boolean | undefined;
|
|
897
|
+
pinnedScripts?: string[] | undefined;
|
|
898
|
+
customPens?: any[] | undefined;
|
|
899
|
+
currentStrokeOptions?: any;
|
|
900
|
+
resetCustomPen?: any;
|
|
901
|
+
gridColor: string;
|
|
902
|
+
dynamicStyle: string;
|
|
903
|
+
invertBindingBehaviour: boolean;
|
|
904
|
+
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
905
|
+
};
|
|
906
|
+
commitToHistory: boolean;
|
|
907
|
+
};
|
|
908
|
+
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
909
|
+
} & {
|
|
910
|
+
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
911
|
+
};
|
|
912
|
+
export declare const actionZoomToFitSelection: {
|
|
913
|
+
name: "zoomToFitSelection";
|
|
914
|
+
trackEvent: {
|
|
915
|
+
category: "canvas";
|
|
916
|
+
};
|
|
917
|
+
perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>) => {
|
|
918
|
+
appState: {
|
|
766
919
|
scrollX: number;
|
|
767
920
|
scrollY: number;
|
|
921
|
+
zoom: {
|
|
922
|
+
value: NormalizedZoomValue;
|
|
923
|
+
};
|
|
768
924
|
contextMenu: {
|
|
769
925
|
items: import("../components/ContextMenu").ContextMenuItems;
|
|
770
926
|
top: number;
|
|
@@ -834,11 +990,11 @@ export declare const actionZoomToSelected: {
|
|
|
834
990
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
835
991
|
defaultSidebarDockedPreference: boolean;
|
|
836
992
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
837
|
-
selectedElementIds: {
|
|
838
|
-
[id: string]:
|
|
839
|
-
}
|
|
993
|
+
selectedElementIds: Readonly<{
|
|
994
|
+
[id: string]: true;
|
|
995
|
+
}>;
|
|
840
996
|
previousSelectedElementIds: {
|
|
841
|
-
[id: string]:
|
|
997
|
+
[id: string]: true;
|
|
842
998
|
};
|
|
843
999
|
selectedElementsAreBeingDragged: boolean;
|
|
844
1000
|
shouldCacheIgnoreZoom: boolean;
|
|
@@ -910,11 +1066,11 @@ export declare const actionZoomToFit: {
|
|
|
910
1066
|
};
|
|
911
1067
|
perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>) => {
|
|
912
1068
|
appState: {
|
|
1069
|
+
scrollX: number;
|
|
1070
|
+
scrollY: number;
|
|
913
1071
|
zoom: {
|
|
914
1072
|
value: NormalizedZoomValue;
|
|
915
1073
|
};
|
|
916
|
-
scrollX: number;
|
|
917
|
-
scrollY: number;
|
|
918
1074
|
contextMenu: {
|
|
919
1075
|
items: import("../components/ContextMenu").ContextMenuItems;
|
|
920
1076
|
top: number;
|
|
@@ -984,11 +1140,11 @@ export declare const actionZoomToFit: {
|
|
|
984
1140
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
985
1141
|
defaultSidebarDockedPreference: boolean;
|
|
986
1142
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
987
|
-
selectedElementIds: {
|
|
988
|
-
[id: string]:
|
|
989
|
-
}
|
|
1143
|
+
selectedElementIds: Readonly<{
|
|
1144
|
+
[id: string]: true;
|
|
1145
|
+
}>;
|
|
990
1146
|
previousSelectedElementIds: {
|
|
991
|
-
[id: string]:
|
|
1147
|
+
[id: string]: true;
|
|
992
1148
|
};
|
|
993
1149
|
selectedElementsAreBeingDragged: boolean;
|
|
994
1150
|
shouldCacheIgnoreZoom: boolean;
|
|
@@ -1135,11 +1291,11 @@ export declare const actionToggleTheme: {
|
|
|
1135
1291
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
1136
1292
|
defaultSidebarDockedPreference: boolean;
|
|
1137
1293
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
1138
|
-
selectedElementIds: {
|
|
1139
|
-
[id: string]:
|
|
1140
|
-
}
|
|
1294
|
+
selectedElementIds: Readonly<{
|
|
1295
|
+
[id: string]: true;
|
|
1296
|
+
}>;
|
|
1141
1297
|
previousSelectedElementIds: {
|
|
1142
|
-
[id: string]:
|
|
1298
|
+
[id: string]: true;
|
|
1143
1299
|
};
|
|
1144
1300
|
selectedElementsAreBeingDragged: boolean;
|
|
1145
1301
|
shouldCacheIgnoreZoom: boolean;
|
|
@@ -1284,7 +1440,7 @@ export declare const actionToggleEraserTool: {
|
|
|
1284
1440
|
defaultSidebarDockedPreference: boolean;
|
|
1285
1441
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
1286
1442
|
previousSelectedElementIds: {
|
|
1287
|
-
[id: string]:
|
|
1443
|
+
[id: string]: true;
|
|
1288
1444
|
};
|
|
1289
1445
|
selectedElementsAreBeingDragged: boolean;
|
|
1290
1446
|
shouldCacheIgnoreZoom: boolean;
|
|
@@ -1426,7 +1582,7 @@ export declare const actionToggleHandTool: {
|
|
|
1426
1582
|
defaultSidebarDockedPreference: boolean;
|
|
1427
1583
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
1428
1584
|
previousSelectedElementIds: {
|
|
1429
|
-
[id: string]:
|
|
1585
|
+
[id: string]: true;
|
|
1430
1586
|
};
|
|
1431
1587
|
selectedElementsAreBeingDragged: boolean;
|
|
1432
1588
|
shouldCacheIgnoreZoom: boolean;
|
|
@@ -1487,3 +1643,143 @@ export declare const actionToggleHandTool: {
|
|
|
1487
1643
|
} & {
|
|
1488
1644
|
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
1489
1645
|
};
|
|
1646
|
+
export declare const zoomToFitElements: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, zoomToSelection: boolean, maxZoom?: number, margin?: number) => {
|
|
1647
|
+
appState: {
|
|
1648
|
+
zoom: {
|
|
1649
|
+
value: NormalizedZoomValue;
|
|
1650
|
+
};
|
|
1651
|
+
scrollX: number;
|
|
1652
|
+
scrollY: number;
|
|
1653
|
+
contextMenu: {
|
|
1654
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
1655
|
+
top: number;
|
|
1656
|
+
left: number;
|
|
1657
|
+
} | null;
|
|
1658
|
+
showWelcomeScreen: boolean;
|
|
1659
|
+
isLoading: boolean;
|
|
1660
|
+
errorMessage: import("react").ReactNode;
|
|
1661
|
+
activeIFrame: {
|
|
1662
|
+
element: import("../element/types").NonDeletedExcalidrawElement;
|
|
1663
|
+
state: "active" | "hover";
|
|
1664
|
+
} | null;
|
|
1665
|
+
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
1666
|
+
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
1667
|
+
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
1668
|
+
selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
1669
|
+
isBindingEnabled: boolean;
|
|
1670
|
+
startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
|
|
1671
|
+
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
1672
|
+
frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
|
|
1673
|
+
shouldRenderFrames: boolean;
|
|
1674
|
+
editingFrame: string | null;
|
|
1675
|
+
elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
1676
|
+
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
1677
|
+
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
1678
|
+
activeTool: {
|
|
1679
|
+
lastActiveTool: import("../types").LastActiveTool;
|
|
1680
|
+
locked: boolean;
|
|
1681
|
+
} & ({
|
|
1682
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "iframe" | "image" | "frame" | "freedraw" | "eraser" | "hand";
|
|
1683
|
+
customType: null;
|
|
1684
|
+
} | {
|
|
1685
|
+
type: "custom";
|
|
1686
|
+
customType: string;
|
|
1687
|
+
});
|
|
1688
|
+
penMode: boolean;
|
|
1689
|
+
penDetected: boolean;
|
|
1690
|
+
exportBackground: boolean;
|
|
1691
|
+
exportEmbedScene: boolean;
|
|
1692
|
+
exportWithDarkMode: boolean;
|
|
1693
|
+
exportScale: number;
|
|
1694
|
+
currentItemStrokeColor: string;
|
|
1695
|
+
currentItemBackgroundColor: string;
|
|
1696
|
+
currentItemFillStyle: import("../element/types").FillStyle;
|
|
1697
|
+
currentItemStrokeWidth: number;
|
|
1698
|
+
currentItemStrokeStyle: import("../element/types").StrokeStyle;
|
|
1699
|
+
currentItemRoughness: number;
|
|
1700
|
+
currentItemOpacity: number;
|
|
1701
|
+
currentItemFontFamily: number;
|
|
1702
|
+
currentItemFontSize: number;
|
|
1703
|
+
currentItemTextAlign: string;
|
|
1704
|
+
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
1705
|
+
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
1706
|
+
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
1707
|
+
viewBackgroundColor: string;
|
|
1708
|
+
cursorButton: "up" | "down";
|
|
1709
|
+
scrolledOutside: boolean;
|
|
1710
|
+
name: string;
|
|
1711
|
+
isResizing: boolean;
|
|
1712
|
+
isRotating: boolean;
|
|
1713
|
+
openMenu: "canvas" | "shape" | null;
|
|
1714
|
+
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
1715
|
+
openSidebar: {
|
|
1716
|
+
name: string;
|
|
1717
|
+
tab?: string | undefined;
|
|
1718
|
+
} | null;
|
|
1719
|
+
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
1720
|
+
defaultSidebarDockedPreference: boolean;
|
|
1721
|
+
lastPointerDownWith: import("../element/types").PointerType;
|
|
1722
|
+
selectedElementIds: Readonly<{
|
|
1723
|
+
[id: string]: true;
|
|
1724
|
+
}>;
|
|
1725
|
+
previousSelectedElementIds: {
|
|
1726
|
+
[id: string]: true;
|
|
1727
|
+
};
|
|
1728
|
+
selectedElementsAreBeingDragged: boolean;
|
|
1729
|
+
shouldCacheIgnoreZoom: boolean;
|
|
1730
|
+
toast: {
|
|
1731
|
+
message: string;
|
|
1732
|
+
closable?: boolean | undefined;
|
|
1733
|
+
duration?: number | undefined;
|
|
1734
|
+
} | null;
|
|
1735
|
+
zenModeEnabled: boolean;
|
|
1736
|
+
theme: string;
|
|
1737
|
+
gridSize: number | null;
|
|
1738
|
+
previousGridSize: number | null;
|
|
1739
|
+
viewModeEnabled: boolean;
|
|
1740
|
+
selectedGroupIds: {
|
|
1741
|
+
[groupId: string]: boolean;
|
|
1742
|
+
};
|
|
1743
|
+
editingGroupId: string | null;
|
|
1744
|
+
width: number;
|
|
1745
|
+
height: number;
|
|
1746
|
+
offsetTop: number;
|
|
1747
|
+
offsetLeft: number;
|
|
1748
|
+
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
1749
|
+
collaborators: Map<string, import("../types").Collaborator>;
|
|
1750
|
+
showStats: boolean;
|
|
1751
|
+
currentChartType: import("../element/types").ChartType;
|
|
1752
|
+
pasteDialog: {
|
|
1753
|
+
shown: false;
|
|
1754
|
+
data: null;
|
|
1755
|
+
} | {
|
|
1756
|
+
shown: true;
|
|
1757
|
+
data: import("../charts").Spreadsheet;
|
|
1758
|
+
};
|
|
1759
|
+
pendingImageElementId: string | null;
|
|
1760
|
+
showHyperlinkPopup: false | "info" | "editor";
|
|
1761
|
+
linkOpacity: number;
|
|
1762
|
+
trayModeEnabled: boolean;
|
|
1763
|
+
colorPalette?: {
|
|
1764
|
+
canvasBackground: import("../colors").ColorPaletteCustom;
|
|
1765
|
+
elementBackground: import("../colors").ColorPaletteCustom;
|
|
1766
|
+
elementStroke: import("../colors").ColorPaletteCustom;
|
|
1767
|
+
topPicks: {
|
|
1768
|
+
canvasBackground: [string, string, string, string, string];
|
|
1769
|
+
elementStroke: [string, string, string, string, string];
|
|
1770
|
+
elementBackground: [string, string, string, string, string];
|
|
1771
|
+
};
|
|
1772
|
+
} | undefined;
|
|
1773
|
+
allowWheelZoom?: boolean | undefined;
|
|
1774
|
+
allowPinchZoom?: boolean | undefined;
|
|
1775
|
+
pinnedScripts?: string[] | undefined;
|
|
1776
|
+
customPens?: any[] | undefined;
|
|
1777
|
+
currentStrokeOptions?: any;
|
|
1778
|
+
resetCustomPen?: any;
|
|
1779
|
+
gridColor: string;
|
|
1780
|
+
dynamicStyle: string;
|
|
1781
|
+
invertBindingBehaviour: boolean;
|
|
1782
|
+
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
1783
|
+
};
|
|
1784
|
+
commitToHistory: boolean;
|
|
1785
|
+
};
|
|
@@ -109,11 +109,11 @@ export declare const actionCut: {
|
|
|
109
109
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
110
110
|
defaultSidebarDockedPreference: boolean;
|
|
111
111
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
112
|
-
selectedElementIds: {
|
|
113
|
-
[id: string]:
|
|
114
|
-
}
|
|
112
|
+
selectedElementIds: Readonly<{
|
|
113
|
+
[id: string]: true;
|
|
114
|
+
}>;
|
|
115
115
|
previousSelectedElementIds: {
|
|
116
|
-
[id: string]:
|
|
116
|
+
[id: string]: true;
|
|
117
117
|
};
|
|
118
118
|
selectedElementsAreBeingDragged: boolean;
|
|
119
119
|
shouldCacheIgnoreZoom: boolean;
|
|
@@ -277,11 +277,11 @@ export declare const actionCut: {
|
|
|
277
277
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
278
278
|
defaultSidebarDockedPreference: boolean;
|
|
279
279
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
280
|
-
selectedElementIds: {
|
|
281
|
-
[id: string]:
|
|
282
|
-
}
|
|
280
|
+
selectedElementIds: Readonly<{
|
|
281
|
+
[id: string]: true;
|
|
282
|
+
}>;
|
|
283
283
|
previousSelectedElementIds: {
|
|
284
|
-
[id: string]:
|
|
284
|
+
[id: string]: true;
|
|
285
285
|
};
|
|
286
286
|
selectedElementsAreBeingDragged: boolean;
|
|
287
287
|
shouldCacheIgnoreZoom: boolean;
|
|
@@ -416,7 +416,7 @@ export declare const actionCut: {
|
|
|
416
416
|
defaultSidebarDockedPreference: boolean;
|
|
417
417
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
418
418
|
previousSelectedElementIds: {
|
|
419
|
-
[id: string]:
|
|
419
|
+
[id: string]: true;
|
|
420
420
|
};
|
|
421
421
|
selectedElementsAreBeingDragged: boolean;
|
|
422
422
|
shouldCacheIgnoreZoom: boolean;
|
|
@@ -566,11 +566,11 @@ export declare const actionCopyAsSvg: {
|
|
|
566
566
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
567
567
|
defaultSidebarDockedPreference: boolean;
|
|
568
568
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
569
|
-
selectedElementIds: {
|
|
570
|
-
[id: string]:
|
|
571
|
-
}
|
|
569
|
+
selectedElementIds: Readonly<{
|
|
570
|
+
[id: string]: true;
|
|
571
|
+
}>;
|
|
572
572
|
previousSelectedElementIds: {
|
|
573
|
-
[id: string]:
|
|
573
|
+
[id: string]: true;
|
|
574
574
|
};
|
|
575
575
|
selectedElementsAreBeingDragged: boolean;
|
|
576
576
|
shouldCacheIgnoreZoom: boolean;
|
|
@@ -719,11 +719,11 @@ export declare const actionCopyAsPng: {
|
|
|
719
719
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
720
720
|
defaultSidebarDockedPreference: boolean;
|
|
721
721
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
722
|
-
selectedElementIds: {
|
|
723
|
-
[id: string]:
|
|
724
|
-
}
|
|
722
|
+
selectedElementIds: Readonly<{
|
|
723
|
+
[id: string]: true;
|
|
724
|
+
}>;
|
|
725
725
|
previousSelectedElementIds: {
|
|
726
|
-
[id: string]:
|
|
726
|
+
[id: string]: true;
|
|
727
727
|
};
|
|
728
728
|
selectedElementsAreBeingDragged: boolean;
|
|
729
729
|
shouldCacheIgnoreZoom: boolean;
|