@excalidraw/excalidraw 0.18.0-a5d6939 → 0.18.0-a8acc82
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/dev/chunk-6MX365WZ.js +5666 -0
- package/dist/dev/chunk-6MX365WZ.js.map +7 -0
- package/dist/dev/chunk-CP5DND7P.js +7 -0
- package/dist/dev/chunk-CP5DND7P.js.map +7 -0
- package/dist/dev/{chunk-X3RYHLJU.js → chunk-QF5FRM6O.js} +15 -5
- package/dist/dev/chunk-QF5FRM6O.js.map +7 -0
- package/dist/dev/data/{image-JN3Y4CVN.js → image-GQCFJKGM.js} +3 -3
- package/dist/dev/index.css +230 -23
- package/dist/dev/index.css.map +3 -3
- package/dist/dev/index.js +10262 -10068
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/locales/{en-CKWC2GMK.js → en-SMAPCEOQ.js} +2 -2
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/chunk-A66AFZZU.js +7 -0
- package/dist/prod/chunk-I4UNSFV6.js +12 -0
- package/dist/prod/chunk-R2M7VUMD.js +4 -0
- package/dist/prod/data/image-JWK7QZ22.js +1 -0
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +25 -17
- package/dist/prod/locales/{en-SBO6ZHT2.js → en-TYY6KWIJ.js} +1 -1
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/common/src/constants.d.ts +40 -7
- package/dist/types/{excalidraw → common/src}/emitter.d.ts +1 -1
- package/dist/types/common/src/font-metadata.d.ts +4 -2
- package/dist/types/common/src/index.d.ts +1 -0
- package/dist/types/common/src/utility-types.d.ts +5 -0
- package/dist/types/common/src/utils.d.ts +18 -4
- package/dist/types/{excalidraw/scene → element/src}/Scene.d.ts +16 -15
- package/dist/types/element/src/align.d.ts +4 -3
- package/dist/types/element/src/binding.d.ts +25 -14
- package/dist/types/element/src/bounds.d.ts +14 -6
- package/dist/types/element/src/collision.d.ts +18 -12
- package/dist/types/element/src/cropElement.d.ts +1 -1
- package/dist/types/{excalidraw/change.d.ts → element/src/delta.d.ts} +77 -40
- package/dist/types/element/src/distance.d.ts +2 -2
- package/dist/types/element/src/distribute.d.ts +2 -1
- package/dist/types/element/src/dragElements.d.ts +3 -2
- package/dist/types/element/src/elbowArrow.d.ts +1 -1
- package/dist/types/element/src/flowchart.d.ts +3 -2
- package/dist/types/element/src/fractionalIndex.d.ts +9 -3
- package/dist/types/element/src/frame.d.ts +4 -3
- package/dist/types/element/src/groups.d.ts +1 -0
- package/dist/types/element/src/index.d.ts +44 -2
- package/dist/types/element/src/linearElementEditor.d.ts +23 -36
- package/dist/types/element/src/mutateElement.d.ts +11 -3
- package/dist/types/element/src/newElement.d.ts +4 -3
- package/dist/types/element/src/positionElementsOnGrid.d.ts +2 -0
- package/dist/types/element/src/renderElement.d.ts +4 -1
- package/dist/types/element/src/resizeElements.d.ts +5 -4
- package/dist/types/element/src/selection.d.ts +0 -5
- package/dist/types/element/src/shape.d.ts +42 -0
- package/dist/types/element/src/sizeHelpers.d.ts +2 -2
- package/dist/types/element/src/store.d.ts +237 -0
- package/dist/types/element/src/textElement.d.ts +4 -3
- package/dist/types/element/src/typeChecks.d.ts +19 -1
- package/dist/types/element/src/types.d.ts +15 -2
- package/dist/types/element/src/utils.d.ts +16 -6
- package/dist/types/element/src/zindex.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +45 -54
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +30 -36
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +204 -242
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +90 -106
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +15 -18
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +45 -53
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +14 -17
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +45 -52
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +15 -18
- package/dist/types/excalidraw/actions/actionExport.d.ts +145 -172
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +77 -42
- package/dist/types/excalidraw/actions/actionFrame.d.ts +107 -119
- package/dist/types/excalidraw/actions/actionGroup.d.ts +30 -36
- package/dist/types/excalidraw/actions/actionHistory.d.ts +1 -2
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +541 -20
- package/dist/types/excalidraw/actions/actionLink.d.ts +14 -17
- package/dist/types/excalidraw/actions/actionMenu.d.ts +42 -51
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +29 -35
- package/dist/types/excalidraw/actions/actionProperties.d.ts +246 -274
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +15 -18
- package/dist/types/excalidraw/actions/actionStyles.d.ts +15 -18
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +15 -18
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +15 -18
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +14 -190
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +19 -0
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +15 -18
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +15 -18
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +15 -18
- package/dist/types/excalidraw/actions/index.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +4 -3
- package/dist/types/excalidraw/appState.d.ts +20 -10
- package/dist/types/excalidraw/clipboard.d.ts +64 -1
- package/dist/types/excalidraw/components/Actions.d.ts +8 -5
- package/dist/types/excalidraw/components/App.d.ts +30 -30
- package/dist/types/excalidraw/components/ButtonIcon.d.ts +1 -0
- package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -1
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +7 -2
- package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -3
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +2 -3
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +2 -2
- package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +1 -1
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +23 -0
- package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +4 -3
- package/dist/types/excalidraw/components/Ellipsify.d.ts +4 -0
- package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +2 -1
- package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +2 -1
- package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -0
- package/dist/types/excalidraw/components/{ButtonIconSelect.d.ts → RadioSelection.d.ts} +1 -1
- package/dist/types/excalidraw/components/Range.d.ts +3 -3
- package/dist/types/excalidraw/components/Stats/Angle.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +2 -1
- package/dist/types/excalidraw/components/Stats/Dimension.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/DragInput.d.ts +12 -2
- package/dist/types/excalidraw/components/Stats/FontSize.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/MultiFontSize.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/Position.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/utils.d.ts +4 -11
- package/dist/types/excalidraw/components/UnlockPopup.d.ts +8 -0
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +1 -0
- package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +3 -2
- package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +2 -1
- package/dist/types/excalidraw/components/icons.d.ts +9 -0
- package/dist/types/excalidraw/components/shapes.d.ts +129 -1
- package/dist/types/excalidraw/data/blob.d.ts +3 -7
- package/dist/types/excalidraw/data/reconcile.d.ts +1 -0
- package/dist/types/excalidraw/data/restore.d.ts +6 -1
- package/dist/types/excalidraw/data/transform.d.ts +1 -1
- package/dist/types/excalidraw/data/types.d.ts +4 -1
- package/dist/types/excalidraw/editor-jotai.d.ts +6 -6
- package/dist/types/excalidraw/eraser/index.d.ts +0 -2
- package/dist/types/excalidraw/fonts/Fonts.d.ts +1 -1
- package/dist/types/excalidraw/history.d.ts +30 -22
- package/dist/types/excalidraw/hooks/useEmitter.d.ts +1 -1
- package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
- package/dist/types/excalidraw/index.d.ts +11 -10
- package/dist/types/excalidraw/lasso/index.d.ts +1 -0
- package/dist/types/excalidraw/lasso/utils.d.ts +2 -1
- package/dist/types/excalidraw/renderer/helpers.d.ts +7 -2
- package/dist/types/excalidraw/renderer/staticScene.d.ts +4 -1
- package/dist/types/excalidraw/scene/Renderer.d.ts +1 -2
- package/dist/types/excalidraw/scene/index.d.ts +2 -2
- package/dist/types/excalidraw/scene/scrollbars.d.ts +2 -3
- package/dist/types/excalidraw/scene/types.d.ts +2 -0
- package/dist/types/excalidraw/snapping.d.ts +2 -2
- package/dist/types/excalidraw/types.d.ts +36 -15
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +3 -1
- package/dist/types/math/src/angle.d.ts +2 -0
- package/dist/types/math/src/constants.d.ts +3 -0
- package/dist/types/math/src/curve.d.ts +34 -0
- package/dist/types/math/src/index.d.ts +1 -0
- package/dist/types/math/src/point.d.ts +1 -1
- package/dist/types/math/src/rectangle.d.ts +2 -0
- package/dist/types/math/src/segment.d.ts +1 -0
- package/dist/types/math/src/vector.d.ts +8 -2
- package/dist/types/utils/src/bbox.d.ts +1 -1
- package/dist/types/utils/src/index.d.ts +1 -1
- package/dist/types/utils/src/withinBounds.d.ts +1 -1
- package/history.ts +146 -109
- package/package.json +13 -10
- package/dist/dev/chunk-GBJ7S76A.js +0 -18599
- package/dist/dev/chunk-GBJ7S76A.js.map +0 -7
- package/dist/dev/chunk-GIMGG4AT.js +0 -7
- package/dist/dev/chunk-GIMGG4AT.js.map +0 -7
- package/dist/dev/chunk-X3RYHLJU.js.map +0 -7
- package/dist/prod/chunk-GKI4RZ6C.js +0 -7
- package/dist/prod/chunk-IUH5AXLB.js +0 -12
- package/dist/prod/chunk-TVF64BAY.js +0 -33
- package/dist/prod/data/image-CZ2OEVDB.js +0 -1
- package/dist/types/element/src/Shape.d.ts +0 -17
- package/dist/types/element/src/ShapeCache.d.ts +0 -25
- package/dist/types/element/src/shapes.d.ts +0 -23
- package/dist/types/excalidraw/components/ButtonSelect.d.ts +0 -9
- package/dist/types/excalidraw/store.d.ts +0 -129
- package/dist/types/excalidraw/visualdebug.d.ts +0 -41
- package/dist/types/utils/src/collision.d.ts +0 -8
- /package/dist/dev/data/{image-JN3Y4CVN.js.map → image-GQCFJKGM.js.map} +0 -0
- /package/dist/dev/locales/{en-CKWC2GMK.js.map → en-SMAPCEOQ.js.map} +0 -0
|
@@ -11,9 +11,12 @@ export declare const PlusPromoIcon: import("react/jsx-runtime").JSX.Element;
|
|
|
11
11
|
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
|
+
export declare const DotsHorizontalIcon: import("react/jsx-runtime").JSX.Element;
|
|
14
15
|
export declare const PinIcon: import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const polygonIcon: import("react/jsx-runtime").JSX.Element;
|
|
15
17
|
export declare const UnlockedIcon: import("react/jsx-runtime").JSX.Element;
|
|
16
18
|
export declare const LockedIcon: import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const LockedIconFilled: import("react/jsx-runtime").JSX.Element;
|
|
17
20
|
export declare const WelcomeScreenMenuArrow: import("react/jsx-runtime").JSX.Element;
|
|
18
21
|
export declare const WelcomeScreenHelpArrow: import("react/jsx-runtime").JSX.Element;
|
|
19
22
|
export declare const WelcomeScreenTopToolbarArrow: import("react/jsx-runtime").JSX.Element;
|
|
@@ -28,6 +31,7 @@ export declare const LineIcon: import("react/jsx-runtime").JSX.Element;
|
|
|
28
31
|
export declare const PenModeIcon: import("react/jsx-runtime").JSX.Element;
|
|
29
32
|
export declare const FreedrawIcon: import("react/jsx-runtime").JSX.Element;
|
|
30
33
|
export declare const TextIcon: import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export declare const TextSizeIcon: import("react/jsx-runtime").JSX.Element;
|
|
31
35
|
export declare const ImageIcon: import("react/jsx-runtime").JSX.Element;
|
|
32
36
|
export declare const EraserIcon: import("react/jsx-runtime").JSX.Element;
|
|
33
37
|
export declare const ZoomInIcon: import("react/jsx-runtime").JSX.Element;
|
|
@@ -54,6 +58,7 @@ export declare const LoadIcon: import("react/jsx-runtime").JSX.Element;
|
|
|
54
58
|
export declare const clipboard: import("react/jsx-runtime").JSX.Element;
|
|
55
59
|
export declare const palette: import("react/jsx-runtime").JSX.Element;
|
|
56
60
|
export declare const bucketFillIcon: import("react/jsx-runtime").JSX.Element;
|
|
61
|
+
export declare const slashIcon: import("react/jsx-runtime").JSX.Element;
|
|
57
62
|
export declare const ExportImageIcon: import("react/jsx-runtime").JSX.Element;
|
|
58
63
|
export declare const exportToFileIcon: import("react/jsx-runtime").JSX.Element;
|
|
59
64
|
export declare const zoomIn: import("react/jsx-runtime").JSX.Element;
|
|
@@ -219,4 +224,8 @@ export declare const collapseUpIcon: import("react/jsx-runtime").JSX.Element;
|
|
|
219
224
|
export declare const upIcon: import("react/jsx-runtime").JSX.Element;
|
|
220
225
|
export declare const cropIcon: import("react/jsx-runtime").JSX.Element;
|
|
221
226
|
export declare const elementLinkIcon: import("react/jsx-runtime").JSX.Element;
|
|
227
|
+
export declare const resizeIcon: import("react/jsx-runtime").JSX.Element;
|
|
228
|
+
export declare const adjustmentsIcon: import("react/jsx-runtime").JSX.Element;
|
|
229
|
+
export declare const backgroundIcon: import("react/jsx-runtime").JSX.Element;
|
|
230
|
+
export declare const strokeIcon: import("react/jsx-runtime").JSX.Element;
|
|
222
231
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AppClassProperties } from "../types";
|
|
1
2
|
export declare const SHAPES: readonly [{
|
|
2
3
|
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
3
4
|
readonly value: "selection";
|
|
@@ -59,4 +60,131 @@ export declare const SHAPES: readonly [{
|
|
|
59
60
|
readonly numericKey: "0";
|
|
60
61
|
readonly fillable: false;
|
|
61
62
|
}];
|
|
62
|
-
export declare const
|
|
63
|
+
export declare const getToolbarTools: (app: AppClassProperties) => readonly [{
|
|
64
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
65
|
+
readonly value: "selection";
|
|
66
|
+
readonly key: "v";
|
|
67
|
+
readonly numericKey: "1";
|
|
68
|
+
readonly fillable: true;
|
|
69
|
+
}, {
|
|
70
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
readonly value: "rectangle";
|
|
72
|
+
readonly key: "r";
|
|
73
|
+
readonly numericKey: "2";
|
|
74
|
+
readonly fillable: true;
|
|
75
|
+
}, {
|
|
76
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
77
|
+
readonly value: "diamond";
|
|
78
|
+
readonly key: "d";
|
|
79
|
+
readonly numericKey: "3";
|
|
80
|
+
readonly fillable: true;
|
|
81
|
+
}, {
|
|
82
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
83
|
+
readonly value: "ellipse";
|
|
84
|
+
readonly key: "o";
|
|
85
|
+
readonly numericKey: "4";
|
|
86
|
+
readonly fillable: true;
|
|
87
|
+
}, {
|
|
88
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
89
|
+
readonly value: "arrow";
|
|
90
|
+
readonly key: "a";
|
|
91
|
+
readonly numericKey: "5";
|
|
92
|
+
readonly fillable: true;
|
|
93
|
+
}, {
|
|
94
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
95
|
+
readonly value: "line";
|
|
96
|
+
readonly key: "l";
|
|
97
|
+
readonly numericKey: "6";
|
|
98
|
+
readonly fillable: true;
|
|
99
|
+
}, {
|
|
100
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
101
|
+
readonly value: "freedraw";
|
|
102
|
+
readonly key: readonly ["p", "x"];
|
|
103
|
+
readonly numericKey: "7";
|
|
104
|
+
readonly fillable: false;
|
|
105
|
+
}, {
|
|
106
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
107
|
+
readonly value: "text";
|
|
108
|
+
readonly key: "t";
|
|
109
|
+
readonly numericKey: "8";
|
|
110
|
+
readonly fillable: false;
|
|
111
|
+
}, {
|
|
112
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
113
|
+
readonly value: "image";
|
|
114
|
+
readonly key: null;
|
|
115
|
+
readonly numericKey: "9";
|
|
116
|
+
readonly fillable: false;
|
|
117
|
+
}, {
|
|
118
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
119
|
+
readonly value: "eraser";
|
|
120
|
+
readonly key: "e";
|
|
121
|
+
readonly numericKey: "0";
|
|
122
|
+
readonly fillable: false;
|
|
123
|
+
}] | readonly [{
|
|
124
|
+
readonly value: "lasso";
|
|
125
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
126
|
+
readonly key: "v";
|
|
127
|
+
readonly numericKey: "1";
|
|
128
|
+
readonly fillable: true;
|
|
129
|
+
}, ...({
|
|
130
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
131
|
+
readonly value: "selection";
|
|
132
|
+
readonly key: "v";
|
|
133
|
+
readonly numericKey: "1";
|
|
134
|
+
readonly fillable: true;
|
|
135
|
+
} | {
|
|
136
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
137
|
+
readonly value: "rectangle";
|
|
138
|
+
readonly key: "r";
|
|
139
|
+
readonly numericKey: "2";
|
|
140
|
+
readonly fillable: true;
|
|
141
|
+
} | {
|
|
142
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
143
|
+
readonly value: "diamond";
|
|
144
|
+
readonly key: "d";
|
|
145
|
+
readonly numericKey: "3";
|
|
146
|
+
readonly fillable: true;
|
|
147
|
+
} | {
|
|
148
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
149
|
+
readonly value: "ellipse";
|
|
150
|
+
readonly key: "o";
|
|
151
|
+
readonly numericKey: "4";
|
|
152
|
+
readonly fillable: true;
|
|
153
|
+
} | {
|
|
154
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
155
|
+
readonly value: "arrow";
|
|
156
|
+
readonly key: "a";
|
|
157
|
+
readonly numericKey: "5";
|
|
158
|
+
readonly fillable: true;
|
|
159
|
+
} | {
|
|
160
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
161
|
+
readonly value: "line";
|
|
162
|
+
readonly key: "l";
|
|
163
|
+
readonly numericKey: "6";
|
|
164
|
+
readonly fillable: true;
|
|
165
|
+
} | {
|
|
166
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
167
|
+
readonly value: "freedraw";
|
|
168
|
+
readonly key: readonly ["p", "x"];
|
|
169
|
+
readonly numericKey: "7";
|
|
170
|
+
readonly fillable: false;
|
|
171
|
+
} | {
|
|
172
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
173
|
+
readonly value: "text";
|
|
174
|
+
readonly key: "t";
|
|
175
|
+
readonly numericKey: "8";
|
|
176
|
+
readonly fillable: false;
|
|
177
|
+
} | {
|
|
178
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
179
|
+
readonly value: "image";
|
|
180
|
+
readonly key: null;
|
|
181
|
+
readonly numericKey: "9";
|
|
182
|
+
readonly fillable: false;
|
|
183
|
+
} | {
|
|
184
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
185
|
+
readonly value: "eraser";
|
|
186
|
+
readonly key: "e";
|
|
187
|
+
readonly numericKey: "0";
|
|
188
|
+
readonly fillable: false;
|
|
189
|
+
})[]];
|
|
190
|
+
export declare const findShapeByKey: (key: string, app: AppClassProperties) => "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "lasso" | "eraser" | null;
|
|
@@ -2,7 +2,7 @@ import { IMAGE_MIME_TYPES, MIME_TYPES } from "@excalidraw/common";
|
|
|
2
2
|
import type { ValueOf } from "@excalidraw/common/utility-types";
|
|
3
3
|
import type { ExcalidrawElement, FileId } from "@excalidraw/element/types";
|
|
4
4
|
import type { AppState, DataURL, LibraryItem } from "../types";
|
|
5
|
-
import type { FileSystemHandle } from "
|
|
5
|
+
import type { FileSystemHandle } from "browser-fs-access";
|
|
6
6
|
import type { ImportedLibraryData } from "./types";
|
|
7
7
|
export declare const getMimeType: (blob: Blob | string) => string;
|
|
8
8
|
export declare const getFileHandleType: (handle: FileSystemHandle | null) => string | null;
|
|
@@ -40,12 +40,8 @@ export declare const SVGStringToFile: (SVGString: string, filename?: string) =>
|
|
|
40
40
|
type: typeof MIME_TYPES.svg;
|
|
41
41
|
};
|
|
42
42
|
export declare const ImageURLToFile: (imageUrl: string, filename?: string) => Promise<File | undefined>;
|
|
43
|
-
export declare const
|
|
44
|
-
|
|
45
|
-
fileHandle: FileSystemHandle | null;
|
|
46
|
-
}>;
|
|
47
|
-
export declare const getFileHandle: (event: React.DragEvent<HTMLDivElement>) => Promise<FileSystemHandle | null>;
|
|
48
|
-
export declare const createFile: (blob: File | Blob | ArrayBuffer, mimeType: ValueOf<typeof MIME_TYPES>, name: string | undefined) => File;
|
|
43
|
+
export declare const getFileHandle: (event: DragEvent | React.DragEvent | DataTransferItem) => Promise<FileSystemHandle | null>;
|
|
44
|
+
export declare const createFile: (blob: File | Blob | ArrayBuffer, mimeType: string, name: string | undefined) => File;
|
|
49
45
|
/** attempts to detect correct mimeType if none is set, or if an image
|
|
50
46
|
* has an incorrect extension.
|
|
51
47
|
* Note: doesn't handle missing .excalidraw/.excalidrawlib extension */
|
|
@@ -3,4 +3,5 @@ import type { MakeBrand } from "@excalidraw/common/utility-types";
|
|
|
3
3
|
import type { AppState } from "../types";
|
|
4
4
|
export type ReconciledExcalidrawElement = OrderedExcalidrawElement & MakeBrand<"ReconciledElement">;
|
|
5
5
|
export type RemoteExcalidrawElement = OrderedExcalidrawElement & MakeBrand<"RemoteExcalidrawElement">;
|
|
6
|
+
export declare const shouldDiscardRemoteElement: (localAppState: AppState, local: OrderedExcalidrawElement | undefined, remote: RemoteExcalidrawElement) => boolean;
|
|
6
7
|
export declare const reconcileElements: (localElements: readonly OrderedExcalidrawElement[], remoteElements: readonly RemoteExcalidrawElement[], localAppState: AppState) => ReconciledExcalidrawElement[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExcalidrawElement, OrderedExcalidrawElement } from "@excalidraw/element/types";
|
|
1
|
+
import type { ExcalidrawArrowElement, ExcalidrawElement, ExcalidrawLinearElement, ExcalidrawSelectionElement, ExcalidrawTextElement, OrderedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
2
|
import type { AppState, BinaryFiles, LibraryItem } from "../types";
|
|
3
3
|
import type { ImportedDataState } from "./types";
|
|
4
4
|
type RestoredAppState = Omit<AppState, "offsetTop" | "offsetLeft" | "width" | "height">;
|
|
@@ -8,14 +8,19 @@ export type RestoredDataState = {
|
|
|
8
8
|
appState: RestoredAppState;
|
|
9
9
|
files: BinaryFiles;
|
|
10
10
|
};
|
|
11
|
+
export declare const restoreElement: (element: Exclude<ExcalidrawElement, ExcalidrawSelectionElement>, opts?: {
|
|
12
|
+
deleteInvisibleElements?: boolean;
|
|
13
|
+
}) => ExcalidrawLinearElement | import("@excalidraw/element/types").ExcalidrawRectangleElement | import("@excalidraw/element/types").ExcalidrawDiamondElement | import("@excalidraw/element/types").ExcalidrawEllipseElement | import("@excalidraw/element/types").ExcalidrawEmbeddableElement | import("@excalidraw/element/types").ExcalidrawIframeElement | import("@excalidraw/element/types").ExcalidrawImageElement | import("@excalidraw/element/types").ExcalidrawFrameElement | import("@excalidraw/element/types").ExcalidrawMagicFrameElement | ExcalidrawTextElement | import("@excalidraw/element/types").ExcalidrawFreeDrawElement | ExcalidrawArrowElement | null;
|
|
11
14
|
export declare const restoreElements: (elements: ImportedDataState["elements"], localElements: readonly ExcalidrawElement[] | null | undefined, opts?: {
|
|
12
15
|
refreshDimensions?: boolean;
|
|
13
16
|
repairBindings?: boolean;
|
|
17
|
+
deleteInvisibleElements?: boolean;
|
|
14
18
|
} | undefined) => OrderedExcalidrawElement[];
|
|
15
19
|
export declare const restoreAppState: (appState: ImportedDataState["appState"], localAppState: Partial<AppState> | null | undefined) => RestoredAppState;
|
|
16
20
|
export declare const restore: (data: Pick<ImportedDataState, "appState" | "elements" | "files"> | null, localAppState: Partial<AppState> | null | undefined, localElements: readonly ExcalidrawElement[] | null | undefined, elementsConfig?: {
|
|
17
21
|
refreshDimensions?: boolean;
|
|
18
22
|
repairBindings?: boolean;
|
|
23
|
+
deleteInvisibleElements?: boolean;
|
|
19
24
|
}) => RestoredDataState;
|
|
20
25
|
export declare const restoreLibraryItems: (libraryItems: ImportedDataState["libraryItems"], defaultStatus: LibraryItem["status"]) => LibraryItem[];
|
|
21
26
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ElementConstructorOpts } from "@excalidraw/element
|
|
1
|
+
import type { ElementConstructorOpts } from "@excalidraw/element";
|
|
2
2
|
import type { ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawFrameElement, ExcalidrawFreeDrawElement, ExcalidrawGenericElement, ExcalidrawIframeLikeElement, ExcalidrawImageElement, ExcalidrawLinearElement, ExcalidrawMagicFrameElement, ExcalidrawSelectionElement, ExcalidrawTextElement, FileId, FontFamilyValues, TextAlign, VerticalAlign } from "@excalidraw/element/types";
|
|
3
3
|
import type { MarkOptional } from "@excalidraw/common/utility-types";
|
|
4
4
|
export type ValidLinearElement = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { VERSIONS } from "@excalidraw/common";
|
|
2
2
|
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
3
3
|
import type { cleanAppStateForExport } from "../appState";
|
|
4
|
-
import type { AppState, BinaryFiles, LibraryItems, LibraryItems_anyVersion } from "../types";
|
|
4
|
+
import type { AppState, BinaryFiles, LibraryItem, LibraryItems, LibraryItems_anyVersion } from "../types";
|
|
5
5
|
export interface ExportedDataState {
|
|
6
6
|
type: string;
|
|
7
7
|
version: number;
|
|
@@ -43,3 +43,6 @@ export interface ImportedLibraryData extends Partial<ExportedLibraryData> {
|
|
|
43
43
|
/** @deprecated v1 */
|
|
44
44
|
library?: LibraryItems;
|
|
45
45
|
}
|
|
46
|
+
export type ExcalidrawLibraryIds = {
|
|
47
|
+
itemIds: LibraryItem["id"][];
|
|
48
|
+
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { atom, createStore, type PrimitiveAtom } from "jotai";
|
|
1
|
+
import { atom, createStore, type PrimitiveAtom, type WritableAtom } from "jotai";
|
|
2
2
|
import { createIsolation } from "jotai-scope";
|
|
3
|
-
export { atom, PrimitiveAtom };
|
|
3
|
+
export { atom, PrimitiveAtom, WritableAtom };
|
|
4
4
|
export declare const useAtom: typeof import("jotai").useAtom, useSetAtom: typeof import("jotai").useSetAtom, useAtomValue: typeof import("jotai").useAtomValue, useStore: (options?: {
|
|
5
5
|
store?: {
|
|
6
6
|
get: <Value>(atom: import("jotai").Atom<Value>) => Value;
|
|
7
|
-
set: <Value_1, Args extends unknown[], Result>(atom:
|
|
7
|
+
set: <Value_1, Args extends unknown[], Result>(atom: WritableAtom<Value_1, Args, Result>, ...args: Args) => Result;
|
|
8
8
|
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
9
9
|
} | ({
|
|
10
10
|
get: <Value_2>(atom: import("jotai").Atom<Value_2>) => Value_2;
|
|
11
|
-
set: <Value_1_1, Args_1 extends unknown[], Result_1>(atom:
|
|
11
|
+
set: <Value_1_1, Args_1 extends unknown[], Result_1>(atom: WritableAtom<Value_1_1, Args_1, Result_1>, ...args: Args_1) => Result_1;
|
|
12
12
|
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
13
13
|
} & {
|
|
14
14
|
dev4_get_internal_weak_map: () => WeakMap<import("jotai").Atom<unknown>, {
|
|
@@ -29,11 +29,11 @@ export declare const useAtom: typeof import("jotai").useAtom, useSetAtom: typeof
|
|
|
29
29
|
}) | undefined;
|
|
30
30
|
} | undefined) => {
|
|
31
31
|
get: <Value_3>(atom: import("jotai").Atom<Value_3>) => Value_3;
|
|
32
|
-
set: <Value_1_2, Args_2 extends unknown[], Result_2>(atom:
|
|
32
|
+
set: <Value_1_2, Args_2 extends unknown[], Result_2>(atom: WritableAtom<Value_1_2, Args_2, Result_2>, ...args: Args_2) => Result_2;
|
|
33
33
|
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
34
34
|
} | ({
|
|
35
35
|
get: <Value_4>(atom: import("jotai").Atom<Value_4>) => Value_4;
|
|
36
|
-
set: <Value_1_3, Args_3 extends unknown[], Result_3>(atom:
|
|
36
|
+
set: <Value_1_3, Args_3 extends unknown[], Result_3>(atom: WritableAtom<Value_1_3, Args_3, Result_3>, ...args: Args_3) => Result_3;
|
|
37
37
|
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
38
38
|
} & {
|
|
39
39
|
dev4_get_internal_weak_map: () => WeakMap<import("jotai").Atom<unknown>, {
|
|
@@ -4,8 +4,6 @@ import type App from "../components/App";
|
|
|
4
4
|
export declare class EraserTrail extends AnimatedTrail {
|
|
5
5
|
private elementsToErase;
|
|
6
6
|
private groupsToErase;
|
|
7
|
-
private segmentsCache;
|
|
8
|
-
private geometricShapesCache;
|
|
9
7
|
constructor(animationFrameHandler: AnimationFrameHandler, app: App);
|
|
10
8
|
startPath(x: number, y: number): void;
|
|
11
9
|
addPointToPath(x: number, y: number, restore?: boolean): string[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type FontMetadata } from "@excalidraw/common";
|
|
2
2
|
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
3
|
+
import type { Scene } from "@excalidraw/element";
|
|
3
4
|
import { ExcalidrawFontFace } from "./ExcalidrawFontFace";
|
|
4
|
-
import type Scene from "../scene/Scene";
|
|
5
5
|
export declare class Fonts {
|
|
6
6
|
static readonly loadedFontsCache: Set<string>;
|
|
7
7
|
private static _registered;
|
|
@@ -1,40 +1,48 @@
|
|
|
1
|
+
import { Emitter } from "@excalidraw/common";
|
|
2
|
+
import { StoreDelta } from "@excalidraw/element";
|
|
3
|
+
import type { StoreSnapshot, Store } from "@excalidraw/element";
|
|
1
4
|
import type { SceneElementsMap } from "@excalidraw/element/types";
|
|
2
|
-
import { Emitter } from "./emitter";
|
|
3
|
-
import type { AppStateChange, ElementsChange } from "./change";
|
|
4
|
-
import type { Snapshot } from "./store";
|
|
5
5
|
import type { AppState } from "./types";
|
|
6
|
+
export declare class HistoryDelta extends StoreDelta {
|
|
7
|
+
/**
|
|
8
|
+
* Apply the delta to the passed elements and appState, does not modify the snapshot.
|
|
9
|
+
*/
|
|
10
|
+
applyTo(elements: SceneElementsMap, appState: AppState, snapshot: StoreSnapshot): [SceneElementsMap, AppState, boolean];
|
|
11
|
+
/**
|
|
12
|
+
* Overriding once to avoid type casting everywhere.
|
|
13
|
+
*/
|
|
14
|
+
static calculate(prevSnapshot: StoreSnapshot, nextSnapshot: StoreSnapshot): HistoryDelta;
|
|
15
|
+
/**
|
|
16
|
+
* Overriding once to avoid type casting everywhere.
|
|
17
|
+
*/
|
|
18
|
+
static inverse(delta: StoreDelta): HistoryDelta;
|
|
19
|
+
/**
|
|
20
|
+
* Overriding once to avoid type casting everywhere.
|
|
21
|
+
*/
|
|
22
|
+
static applyLatestChanges(delta: StoreDelta, prevElements: SceneElementsMap, nextElements: SceneElementsMap, modifierOptions?: "deleted" | "inserted"): HistoryDelta;
|
|
23
|
+
}
|
|
6
24
|
export declare class HistoryChangedEvent {
|
|
7
25
|
readonly isUndoStackEmpty: boolean;
|
|
8
26
|
readonly isRedoStackEmpty: boolean;
|
|
9
27
|
constructor(isUndoStackEmpty?: boolean, isRedoStackEmpty?: boolean);
|
|
10
28
|
}
|
|
11
29
|
export declare class History {
|
|
30
|
+
private readonly store;
|
|
12
31
|
readonly onHistoryChangedEmitter: Emitter<[HistoryChangedEvent]>;
|
|
13
|
-
|
|
14
|
-
|
|
32
|
+
readonly undoStack: HistoryDelta[];
|
|
33
|
+
readonly redoStack: HistoryDelta[];
|
|
15
34
|
get isUndoStackEmpty(): boolean;
|
|
16
35
|
get isRedoStackEmpty(): boolean;
|
|
36
|
+
constructor(store: Store);
|
|
17
37
|
clear(): void;
|
|
18
38
|
/**
|
|
19
|
-
* Record a local
|
|
39
|
+
* Record a non-empty local durable increment, which will go into the undo stack..
|
|
40
|
+
* Do not re-record history entries, which were already pushed to undo / redo stack, as part of history action.
|
|
20
41
|
*/
|
|
21
|
-
record(
|
|
22
|
-
undo(elements: SceneElementsMap, appState: AppState
|
|
23
|
-
redo(elements: SceneElementsMap, appState: AppState
|
|
42
|
+
record(delta: StoreDelta): void;
|
|
43
|
+
undo(elements: SceneElementsMap, appState: AppState): void | [SceneElementsMap, AppState];
|
|
44
|
+
redo(elements: SceneElementsMap, appState: AppState): void | [SceneElementsMap, AppState];
|
|
24
45
|
private perform;
|
|
25
46
|
private static pop;
|
|
26
47
|
private static push;
|
|
27
48
|
}
|
|
28
|
-
export declare class HistoryEntry {
|
|
29
|
-
readonly appStateChange: AppStateChange;
|
|
30
|
-
readonly elementsChange: ElementsChange;
|
|
31
|
-
private constructor();
|
|
32
|
-
static create(appStateChange: AppStateChange, elementsChange: ElementsChange): HistoryEntry;
|
|
33
|
-
inverse(): HistoryEntry;
|
|
34
|
-
applyTo(elements: SceneElementsMap, appState: AppState, snapshot: Readonly<Snapshot>): [SceneElementsMap, AppState, boolean];
|
|
35
|
-
/**
|
|
36
|
-
* Apply latest (remote) changes to the history entry, creates new instance of `HistoryEntry`.
|
|
37
|
-
*/
|
|
38
|
-
applyLatestChanges(elements: SceneElementsMap): HistoryEntry;
|
|
39
|
-
isEmpty(): boolean;
|
|
40
|
-
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Emitter } from "
|
|
1
|
+
import type { Emitter } from "@excalidraw/common";
|
|
2
2
|
export declare const useEmitter: <TEvent extends unknown>(emitter: Emitter<[TEvent]>, initialState: TEvent) => TEvent;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type CaretPosition = {
|
|
2
|
+
start: number;
|
|
3
|
+
end: number;
|
|
4
|
+
};
|
|
5
|
+
export declare const saveCaretPosition: () => CaretPosition | null;
|
|
6
|
+
export declare const restoreCaretPosition: (position: CaretPosition | null) => void;
|
|
7
|
+
export declare const withCaretPositionPreservation: (callback: () => void, isCompactMode: boolean, isEditingText: boolean, onPreventClose?: () => void) => void;
|
|
8
|
+
export declare const useTextEditorFocus: () => {
|
|
9
|
+
saveCaretPosition: () => void;
|
|
10
|
+
restoreCaretPosition: () => void;
|
|
11
|
+
clearSavedPosition: () => void;
|
|
12
|
+
hasSavedPosition: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare const temporarilyDisableTextEditorBlur: (duration?: number) => void;
|
|
@@ -9,26 +9,27 @@ import "./fonts/fonts.css";
|
|
|
9
9
|
import type { ExcalidrawProps } from "./types";
|
|
10
10
|
export declare const Excalidraw: React.MemoExoticComponent<(props: ExcalidrawProps) => import("react/jsx-runtime").JSX.Element>;
|
|
11
11
|
export { getSceneVersion, hashElementsVersion, hashString, getNonDeletedElements, } from "@excalidraw/element";
|
|
12
|
-
export { getTextFromElements } from "@excalidraw/element
|
|
13
|
-
export { isInvisiblySmallElement } from "@excalidraw/element
|
|
12
|
+
export { getTextFromElements } from "@excalidraw/element";
|
|
13
|
+
export { isInvisiblySmallElement } from "@excalidraw/element";
|
|
14
14
|
export { defaultLang, useI18n, languages } from "./i18n";
|
|
15
|
-
export { restore, restoreAppState, restoreElements, restoreLibraryItems, } from "./data/restore";
|
|
15
|
+
export { restore, restoreAppState, restoreElement, restoreElements, restoreLibraryItems, } from "./data/restore";
|
|
16
16
|
export { reconcileElements } from "./data/reconcile";
|
|
17
17
|
export { exportToCanvas, exportToBlob, exportToSvg, exportToClipboard, } from "@excalidraw/utils/export";
|
|
18
18
|
export { serializeAsJSON, serializeLibraryAsJSON } from "./data/json";
|
|
19
19
|
export { loadFromBlob, loadSceneOrLibraryFromBlob, loadLibraryFromBlob, } from "./data/blob";
|
|
20
|
-
export { getFreeDrawSvgPath } from "@excalidraw/element
|
|
20
|
+
export { getFreeDrawSvgPath } from "@excalidraw/element";
|
|
21
21
|
export { mergeLibraryItems, getLibraryItemsHash } from "./data/library";
|
|
22
|
-
export { isLinearElement } from "@excalidraw/element
|
|
22
|
+
export { isLinearElement } from "@excalidraw/element";
|
|
23
23
|
export { FONT_FAMILY, THEME, MIME_TYPES, ROUNDNESS, DEFAULT_LASER_COLOR, UserIdleState, normalizeLink, } from "@excalidraw/common";
|
|
24
|
-
export { mutateElement, newElementWith, bumpVersion, } from "@excalidraw/element
|
|
25
|
-
export { CaptureUpdateAction } from "
|
|
24
|
+
export { mutateElement, newElementWith, bumpVersion, } from "@excalidraw/element";
|
|
25
|
+
export { CaptureUpdateAction } from "@excalidraw/element";
|
|
26
26
|
export { parseLibraryTokensFromUrl, useHandleLibrary } from "./data/library";
|
|
27
27
|
export { sceneCoordsToViewportCoords, viewportCoordsToSceneCoords, } from "@excalidraw/common";
|
|
28
28
|
export { Sidebar } from "./components/Sidebar/Sidebar";
|
|
29
29
|
export { Button } from "./components/Button";
|
|
30
30
|
export { Footer };
|
|
31
31
|
export { MainMenu };
|
|
32
|
+
export { Ellipsify } from "./components/Ellipsify";
|
|
32
33
|
export { useDevice } from "./components/App";
|
|
33
34
|
export { WelcomeScreen };
|
|
34
35
|
export { LiveCollaborationTrigger };
|
|
@@ -38,9 +39,9 @@ export { TTDDialog } from "./components/TTDDialog/TTDDialog";
|
|
|
38
39
|
export { TTDDialogTrigger } from "./components/TTDDialog/TTDDialogTrigger";
|
|
39
40
|
export { zoomToFitBounds } from "./actions/actionCanvas";
|
|
40
41
|
export { convertToExcalidrawElements } from "./data/transform";
|
|
41
|
-
export { getCommonBounds, getVisibleSceneBounds
|
|
42
|
+
export { getCommonBounds, getVisibleSceneBounds } from "@excalidraw/element";
|
|
42
43
|
export { elementsOverlappingBBox, isElementInsideBBox, elementPartiallyOverlapsWithOrContainsBBox, } from "@excalidraw/utils/withinBounds";
|
|
43
44
|
export { DiagramToCodePlugin } from "./components/DiagramToCodePlugin/DiagramToCodePlugin";
|
|
44
45
|
export { getDataURL } from "./data/blob";
|
|
45
|
-
export { isElementLink } from "@excalidraw/element
|
|
46
|
-
export { setCustomTextMetricsProvider } from "@excalidraw/element
|
|
46
|
+
export { isElementLink } from "@excalidraw/element";
|
|
47
|
+
export { setCustomTextMetricsProvider } from "@excalidraw/element";
|
|
@@ -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,8 +1,9 @@
|
|
|
1
1
|
import type { ElementsSegmentsMap, GlobalPoint } from "@excalidraw/math/types";
|
|
2
|
-
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
+
import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
|
|
3
3
|
export declare const getLassoSelectedElementIds: (input: {
|
|
4
4
|
lassoPath: GlobalPoint[];
|
|
5
5
|
elements: readonly ExcalidrawElement[];
|
|
6
|
+
elementsMap: ElementsMap;
|
|
6
7
|
elementsSegments: ElementsSegmentsMap;
|
|
7
8
|
intersectedElements: Set<ExcalidrawElement["id"]>;
|
|
8
9
|
enclosedElements: Set<ExcalidrawElement["id"]>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { ElementsMap, ExcalidrawDiamondElement, ExcalidrawRectanguloidElement } from "@excalidraw/element/types";
|
|
1
2
|
import type { StaticCanvasRenderConfig } from "../scene/types";
|
|
2
|
-
import type {
|
|
3
|
-
export declare const fillCircle: (context: CanvasRenderingContext2D, cx: number, cy: number, radius: number, stroke?: boolean) => void;
|
|
3
|
+
import type { AppState, StaticCanvasAppState } from "../types";
|
|
4
|
+
export declare const fillCircle: (context: CanvasRenderingContext2D, cx: number, cy: number, radius: number, stroke: boolean, fill?: boolean) => void;
|
|
4
5
|
export declare const getNormalizedCanvasDimensions: (canvas: HTMLCanvasElement, scale: number) => [number, number];
|
|
5
6
|
export declare const bootstrapCanvas: ({ canvas, scale, normalizedWidth, normalizedHeight, theme, isExporting, viewBackgroundColor, }: {
|
|
6
7
|
canvas: HTMLCanvasElement;
|
|
@@ -11,3 +12,7 @@ export declare const bootstrapCanvas: ({ canvas, scale, normalizedWidth, normali
|
|
|
11
12
|
isExporting?: boolean | undefined;
|
|
12
13
|
viewBackgroundColor?: string | null | undefined;
|
|
13
14
|
}) => CanvasRenderingContext2D;
|
|
15
|
+
export declare const drawHighlightForRectWithRotation: (context: CanvasRenderingContext2D, element: ExcalidrawRectanguloidElement, elementsMap: ElementsMap, padding: number) => void;
|
|
16
|
+
export declare const strokeEllipseWithRotation: (context: CanvasRenderingContext2D, width: number, height: number, cx: number, cy: number, angle: number) => void;
|
|
17
|
+
export declare const strokeRectWithRotation: (context: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, cx: number, cy: number, angle: number, fill?: boolean, radius?: number) => void;
|
|
18
|
+
export declare const drawHighlightForDiamondWithRotation: (context: CanvasRenderingContext2D, padding: number, element: ExcalidrawDiamondElement, elementsMap: ElementsMap) => void;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ExcalidrawFrameLikeElement } from "@excalidraw/element/types";
|
|
2
|
+
import type { StaticCanvasRenderConfig, StaticSceneRenderConfig } from "../scene/types";
|
|
3
|
+
import type { StaticCanvasAppState } from "../types";
|
|
4
|
+
export declare const frameClip: (frame: ExcalidrawFrameLikeElement, context: CanvasRenderingContext2D, renderConfig: StaticCanvasRenderConfig, appState: StaticCanvasAppState) => void;
|
|
2
5
|
/** throttled to animation framerate */
|
|
3
6
|
export declare const renderStaticSceneThrottled: {
|
|
4
7
|
(config: StaticSceneRenderConfig): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
-
import type Scene from "
|
|
2
|
+
import type { Scene } from "@excalidraw/element";
|
|
3
3
|
import type { AppState } from "../types";
|
|
4
4
|
export declare class Renderer {
|
|
5
5
|
private scene;
|
|
@@ -16,7 +16,6 @@ export declare class Renderer {
|
|
|
16
16
|
/** note: first render of newElement will always bust the cache
|
|
17
17
|
* (we'd have to prefilter elements outside of this function) */
|
|
18
18
|
newElementId: ExcalidrawElement["id"] | undefined;
|
|
19
|
-
pendingImageElementId: AppState["pendingImageElementId"];
|
|
20
19
|
sceneNonce: ReturnType<InstanceType<typeof Scene>["getSceneNonce"]>;
|
|
21
20
|
}) => {
|
|
22
21
|
elementsMap: Map<string, NonDeletedExcalidrawElement> & import("@excalidraw/common/utility-types").MakeBrand<"NonDeletedElementsMap"> & import("@excalidraw/common/utility-types").MakeBrand<"RenderableElementsMap">;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { isSomeElementSelected, getElementsWithinSelection,
|
|
1
|
+
export { isSomeElementSelected, getElementsWithinSelection, getSelectedElements, getTargetElements, } from "@excalidraw/element";
|
|
2
2
|
export { calculateScrollCenter } from "./scroll";
|
|
3
|
-
export { hasBackground, hasStrokeWidth, hasStrokeStyle, canHaveArrowheads, canChangeRoundness, } from "@excalidraw/element
|
|
3
|
+
export { hasBackground, hasStrokeWidth, hasStrokeStyle, canHaveArrowheads, canChangeRoundness, } from "@excalidraw/element";
|
|
4
4
|
export { getNormalizedZoom, getNormalizedGridSize, getNormalizedGridStep, } from "./normalize";
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
2
1
|
import type { InteractiveCanvasAppState } from "../types";
|
|
3
|
-
import type { ScrollBars } from "./types";
|
|
2
|
+
import type { RenderableElementsMap, ScrollBars } from "./types";
|
|
4
3
|
export declare const SCROLLBAR_MARGIN = 4;
|
|
5
4
|
export declare const SCROLLBAR_WIDTH = 6;
|
|
6
5
|
export declare const SCROLLBAR_COLOR = "rgba(0,0,0,0.3)";
|
|
7
|
-
export declare const getScrollBars: (elements:
|
|
6
|
+
export declare const getScrollBars: (elements: RenderableElementsMap, viewportWidth: number, viewportHeight: number, appState: InteractiveCanvasAppState) => ScrollBars;
|
|
8
7
|
export declare const isOverScrollBars: (scrollBars: ScrollBars, x: number, y: number) => {
|
|
9
8
|
isOverEither: boolean;
|
|
10
9
|
isOverHorizontal: boolean;
|
|
@@ -93,12 +93,14 @@ export type ScrollBars = {
|
|
|
93
93
|
y: number;
|
|
94
94
|
width: number;
|
|
95
95
|
height: number;
|
|
96
|
+
deltaMultiplier: number;
|
|
96
97
|
} | null;
|
|
97
98
|
vertical: {
|
|
98
99
|
x: number;
|
|
99
100
|
y: number;
|
|
100
101
|
width: number;
|
|
101
102
|
height: number;
|
|
103
|
+
deltaMultiplier: number;
|
|
102
104
|
} | null;
|
|
103
105
|
};
|
|
104
106
|
export type ElementShape = Drawable | Drawable[] | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type GlobalPoint } from "@excalidraw/math";
|
|
2
2
|
import type { InclusiveRange } from "@excalidraw/math";
|
|
3
|
-
import type { Bounds } from "@excalidraw/element
|
|
4
|
-
import type { MaybeTransformHandleType } from "@excalidraw/element
|
|
3
|
+
import type { Bounds } from "@excalidraw/element";
|
|
4
|
+
import type { MaybeTransformHandleType } from "@excalidraw/element";
|
|
5
5
|
import type { ElementsMap, ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
6
6
|
import type { AppClassProperties, AppState, KeyboardModifiersObject } from "./types";
|
|
7
7
|
export declare const getSnapDistance: (zoomValue: number) => number;
|