@wildmio/excalidraw 0.18.0-custom-1 → 0.18.0-custom.2
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-4FKPNSAF.js +25438 -0
- package/dist/dev/chunk-4FKPNSAF.js.map +7 -0
- package/dist/dev/{chunk-WCM2OLWY.js → chunk-DJHLEOOZ.js} +5 -5
- package/dist/dev/{chunk-WCM2OLWY.js.map → chunk-DJHLEOOZ.js.map} +1 -1
- package/dist/dev/{chunk-OCFTI2BU.js → chunk-OWOU4ALI.js} +3 -2
- package/dist/dev/chunk-OWOU4ALI.js.map +7 -0
- package/dist/dev/{chunk-4BGRJMQS.js → chunk-QRXFLJOF.js} +2 -2
- package/dist/dev/data/{image-HFX5FVZR.js → image-ZNW3236J.js} +3 -3
- package/dist/dev/index.css +4 -3
- package/dist/dev/index.css.map +2 -2
- package/dist/dev/index.js +3274 -5359
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/locales/{de-DE-HE4SJIAA.js → de-DE-ZRDYEPMS.js} +7 -7
- package/dist/dev/locales/de-DE-ZRDYEPMS.js.map +7 -0
- package/dist/dev/locales/{en-MLZIHOCR.js → en-GWPE5KV7.js} +2 -2
- package/dist/dev/locales/{es-ES-EDA76ZAF.js → es-ES-VLQBB7FJ.js} +3 -3
- package/dist/dev/locales/es-ES-VLQBB7FJ.js.map +7 -0
- package/dist/dev/locales/{fr-FR-Z3SBW42Y.js → fr-FR-A72LKGCO.js} +2 -2
- package/dist/dev/locales/{fr-FR-Z3SBW42Y.js.map → fr-FR-A72LKGCO.js.map} +1 -1
- package/dist/dev/locales/{it-IT-HD26UZNF.js → it-IT-X34PIOJ2.js} +2 -2
- package/dist/dev/locales/{it-IT-HD26UZNF.js.map → it-IT-X34PIOJ2.js.map} +1 -1
- package/dist/dev/locales/{nl-NL-RCSOXLW3.js → nl-NL-XGZJ7V2V.js} +226 -226
- package/dist/dev/locales/nl-NL-XGZJ7V2V.js.map +7 -0
- package/dist/dev/locales/{percentages-TR7IWPFY.js → percentages-OGWD7R2K.js} +2 -2
- package/dist/dev/locales/{sk-SK-G2J6PSCB.js → sk-SK-RWC6UWGY.js} +49 -49
- package/dist/dev/locales/sk-SK-RWC6UWGY.js.map +7 -0
- package/dist/dev/locales/{vi-VN-XF3AYKJ7.js → vi-VN-KBZAVWP5.js} +3 -3
- package/dist/dev/locales/{vi-VN-XF3AYKJ7.js.map → vi-VN-KBZAVWP5.js.map} +1 -1
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/{chunk-QNG5NH6R.js → chunk-2KZFBCBN.js} +1 -1
- package/dist/prod/chunk-AJI3LATG.js +1 -0
- package/dist/prod/chunk-B42KGT6Z.js +33 -0
- package/dist/prod/{chunk-RKNJTMKK.js → chunk-OVC72EOF.js} +1 -1
- package/dist/prod/data/image-T7X6V6XU.js +1 -0
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +18 -25
- package/dist/prod/locales/{de-DE-KU2ABQRN.js → de-DE-G3JVZ4MQ.js} +2 -2
- package/dist/prod/locales/{en-BARVNJLJ.js → en-7B5CVO5K.js} +1 -1
- package/dist/prod/locales/{es-ES-MXQVAWTQ.js → es-ES-ART7BI3G.js} +2 -2
- package/dist/prod/locales/{fr-FR-PJOMXPCV.js → fr-FR-XEFNCM4I.js} +1 -1
- package/dist/prod/locales/{it-IT-DQZT3VFE.js → it-IT-GIGIGIBJ.js} +3 -3
- package/dist/prod/locales/nl-NL-R4C4SUIG.js +13 -0
- package/dist/prod/locales/percentages-OL6W367U.js +1 -0
- package/dist/prod/locales/sk-SK-MC7UOHQO.js +7 -0
- package/dist/prod/locales/{vi-VN-I6Q2YS4S.js → vi-VN-K34TWHF7.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/colors.d.ts +4 -1
- package/dist/types/common/src/constants.d.ts +0 -1
- package/dist/types/common/src/utils.d.ts +11 -7
- package/dist/types/element/src/Scene.d.ts +3 -3
- package/dist/types/element/src/renderElement.d.ts +0 -6
- package/dist/types/element/src/shape.d.ts +5 -4
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +3 -0
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +2 -0
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +12 -0
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +2 -0
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +3 -0
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +2 -0
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionExport.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionFrame.d.ts +4 -0
- package/dist/types/excalidraw/actions/actionGroup.d.ts +2 -0
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionLink.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionMenu.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionProperties.d.ts +2 -0
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionStyles.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +1 -0
- package/dist/types/excalidraw/appState.d.ts +2 -1
- package/dist/types/excalidraw/components/App.d.ts +2 -1
- package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +7 -4
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +0 -1
- package/dist/types/excalidraw/components/EyeButton.d.ts +8 -0
- package/dist/types/excalidraw/components/MobileMenu.d.ts +2 -1
- package/dist/types/excalidraw/components/footer/Footer.d.ts +3 -1
- package/dist/types/excalidraw/components/icons.d.ts +2 -0
- package/dist/types/excalidraw/data/blob.d.ts +314 -2
- package/dist/types/excalidraw/data/json.d.ts +157 -1
- package/dist/types/excalidraw/data/restore.d.ts +22 -16
- package/dist/types/excalidraw/index.d.ts +1 -2
- package/dist/types/excalidraw/scene/Renderer.d.ts +3 -1
- package/dist/types/excalidraw/scene/types.d.ts +7 -2
- package/dist/types/excalidraw/types.d.ts +9 -0
- package/dist/types/math/src/range.d.ts +1 -3
- package/package.json +4 -4
- package/dist/dev/chunk-55IZTNXR.js +0 -5472
- package/dist/dev/chunk-55IZTNXR.js.map +0 -7
- package/dist/dev/chunk-OCFTI2BU.js.map +0 -7
- package/dist/dev/locales/de-DE-HE4SJIAA.js.map +0 -7
- package/dist/dev/locales/es-ES-EDA76ZAF.js.map +0 -7
- package/dist/dev/locales/nl-NL-RCSOXLW3.js.map +0 -7
- package/dist/dev/locales/sk-SK-G2J6PSCB.js.map +0 -7
- package/dist/prod/chunk-2KZTCREM.js +0 -4
- package/dist/prod/chunk-Q7BNPSJU.js +0 -1
- package/dist/prod/data/image-CRABYHXF.js +0 -1
- package/dist/prod/locales/nl-NL-AVTAYVB7.js +0 -7
- package/dist/prod/locales/percentages-FZSTHYWV.js +0 -1
- package/dist/prod/locales/sk-SK-2KAMKFW5.js +0 -7
- /package/dist/dev/{chunk-4BGRJMQS.js.map → chunk-QRXFLJOF.js.map} +0 -0
- /package/dist/dev/data/{image-HFX5FVZR.js.map → image-ZNW3236J.js.map} +0 -0
- /package/dist/dev/locales/{en-MLZIHOCR.js.map → en-GWPE5KV7.js.map} +0 -0
- /package/dist/dev/locales/{percentages-TR7IWPFY.js.map → percentages-OGWD7R2K.js.map} +0 -0
|
@@ -7,7 +7,163 @@ export declare const saveAsJSON: (elements: readonly ExcalidrawElement[], appSta
|
|
|
7
7
|
name?: string) => Promise<{
|
|
8
8
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
9
9
|
}>;
|
|
10
|
-
export declare const loadFromJSON: (localAppState: AppState, localElements: readonly ExcalidrawElement[] | null) => Promise<
|
|
10
|
+
export declare const loadFromJSON: (localAppState: AppState, localElements: readonly ExcalidrawElement[] | null) => Promise<{
|
|
11
|
+
elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
|
|
12
|
+
appState: {
|
|
13
|
+
viewBackgroundColor: string;
|
|
14
|
+
theme: import("@excalidraw/element/types").Theme;
|
|
15
|
+
frameRendering: {
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
name: boolean;
|
|
18
|
+
outline: boolean;
|
|
19
|
+
clip: boolean;
|
|
20
|
+
};
|
|
21
|
+
name: string | null;
|
|
22
|
+
zoom: import("../types").Zoom;
|
|
23
|
+
scrollX: number;
|
|
24
|
+
scrollY: number;
|
|
25
|
+
hideAnnotations: boolean;
|
|
26
|
+
viewModeEnabled: boolean;
|
|
27
|
+
openDialog: null | {
|
|
28
|
+
name: "imageExport" | "help" | "jsonExport";
|
|
29
|
+
} | {
|
|
30
|
+
name: "ttd";
|
|
31
|
+
tab: "text-to-diagram" | "mermaid";
|
|
32
|
+
} | {
|
|
33
|
+
name: "commandPalette";
|
|
34
|
+
} | {
|
|
35
|
+
name: "settings";
|
|
36
|
+
} | {
|
|
37
|
+
name: "elementLinkSelector";
|
|
38
|
+
sourceElementId: ExcalidrawElement["id"];
|
|
39
|
+
};
|
|
40
|
+
editingGroupId: import("@excalidraw/element/types").GroupId | null;
|
|
41
|
+
selectedElementIds: Readonly<{
|
|
42
|
+
[id: string]: true;
|
|
43
|
+
}>;
|
|
44
|
+
frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
45
|
+
activeEmbeddable: {
|
|
46
|
+
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
47
|
+
state: "hover" | "active";
|
|
48
|
+
} | null;
|
|
49
|
+
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
50
|
+
selectedGroupIds: {
|
|
51
|
+
[groupId: string]: boolean;
|
|
52
|
+
};
|
|
53
|
+
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
54
|
+
multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
55
|
+
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
56
|
+
isBindingEnabled: boolean;
|
|
57
|
+
suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
58
|
+
isRotating: boolean;
|
|
59
|
+
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
60
|
+
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
61
|
+
snapLines: readonly import("../snapping").SnapLine[];
|
|
62
|
+
zenModeEnabled: boolean;
|
|
63
|
+
editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
64
|
+
isCropping: boolean;
|
|
65
|
+
croppingElementId: ExcalidrawElement["id"] | null;
|
|
66
|
+
searchMatches: Readonly<{
|
|
67
|
+
focusedId: ExcalidrawElement["id"] | null;
|
|
68
|
+
matches: readonly import("../types").SearchMatch[];
|
|
69
|
+
}> | null;
|
|
70
|
+
activeLockedId: string | null;
|
|
71
|
+
hoveredElementIds: Readonly<{
|
|
72
|
+
[id: string]: true;
|
|
73
|
+
}>;
|
|
74
|
+
shouldCacheIgnoreZoom: boolean;
|
|
75
|
+
exportScale: number;
|
|
76
|
+
bindMode: import("@excalidraw/element/types").BindMode;
|
|
77
|
+
gridSize: number;
|
|
78
|
+
contextMenu: {
|
|
79
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
80
|
+
top: number;
|
|
81
|
+
left: number;
|
|
82
|
+
} | null;
|
|
83
|
+
showWelcomeScreen: boolean;
|
|
84
|
+
isLoading: boolean;
|
|
85
|
+
errorMessage: React.ReactNode;
|
|
86
|
+
resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
87
|
+
startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
88
|
+
editingFrame: string | null;
|
|
89
|
+
activeTool: {
|
|
90
|
+
lastActiveTool: import("../types").ActiveTool | null;
|
|
91
|
+
locked: boolean;
|
|
92
|
+
fromSelection: boolean;
|
|
93
|
+
} & import("../types").ActiveTool;
|
|
94
|
+
preferredSelectionTool: {
|
|
95
|
+
type: "selection" | "lasso";
|
|
96
|
+
initialized: boolean;
|
|
97
|
+
};
|
|
98
|
+
penMode: boolean;
|
|
99
|
+
penDetected: boolean;
|
|
100
|
+
exportBackground: boolean;
|
|
101
|
+
exportEmbedScene: boolean;
|
|
102
|
+
exportWithDarkMode: boolean;
|
|
103
|
+
currentItemStrokeColor: string;
|
|
104
|
+
currentItemBackgroundColor: string;
|
|
105
|
+
currentItemFillStyle: ExcalidrawElement["fillStyle"];
|
|
106
|
+
currentItemStrokeWidth: number;
|
|
107
|
+
currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
|
|
108
|
+
currentItemRoughness: number;
|
|
109
|
+
currentItemOpacity: number;
|
|
110
|
+
currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
|
|
111
|
+
currentItemFontSize: number;
|
|
112
|
+
currentItemTextAlign: import("@excalidraw/element/types").TextAlign;
|
|
113
|
+
currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
114
|
+
currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
115
|
+
currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
|
|
116
|
+
currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
|
|
117
|
+
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
118
|
+
cursorButton: "up" | "down";
|
|
119
|
+
scrolledOutside: boolean;
|
|
120
|
+
isResizing: boolean;
|
|
121
|
+
openMenu: "canvas" | null;
|
|
122
|
+
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
123
|
+
openSidebar: {
|
|
124
|
+
name: import("../types").SidebarName;
|
|
125
|
+
tab?: import("../types").SidebarTabName;
|
|
126
|
+
} | null;
|
|
127
|
+
defaultSidebarDockedPreference: boolean;
|
|
128
|
+
lastPointerDownWith: import("@excalidraw/element/types").PointerType;
|
|
129
|
+
previousSelectedElementIds: {
|
|
130
|
+
[id: string]: true;
|
|
131
|
+
};
|
|
132
|
+
selectedElementsAreBeingDragged: boolean;
|
|
133
|
+
toast: {
|
|
134
|
+
message: string;
|
|
135
|
+
closable?: boolean;
|
|
136
|
+
duration?: number;
|
|
137
|
+
} | null;
|
|
138
|
+
gridStep: number;
|
|
139
|
+
gridModeEnabled: boolean;
|
|
140
|
+
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
141
|
+
stats: {
|
|
142
|
+
open: boolean;
|
|
143
|
+
panels: number;
|
|
144
|
+
};
|
|
145
|
+
currentChartType: import("@excalidraw/element/types").ChartType;
|
|
146
|
+
pasteDialog: {
|
|
147
|
+
shown: false;
|
|
148
|
+
data: null;
|
|
149
|
+
} | {
|
|
150
|
+
shown: true;
|
|
151
|
+
data: import("../charts").Spreadsheet;
|
|
152
|
+
};
|
|
153
|
+
showHyperlinkPopup: false | "info" | "editor";
|
|
154
|
+
originSnapOffset: {
|
|
155
|
+
x: number;
|
|
156
|
+
y: number;
|
|
157
|
+
} | null;
|
|
158
|
+
objectsSnapModeEnabled: boolean;
|
|
159
|
+
userToFollow: import("../types").UserToFollow | null;
|
|
160
|
+
followedBy: Set<import("../types").SocketId>;
|
|
161
|
+
lockedMultiSelections: {
|
|
162
|
+
[groupId: string]: true;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
files: BinaryFiles;
|
|
166
|
+
}>;
|
|
11
167
|
export declare const isValidExcalidrawData: (data?: {
|
|
12
168
|
type?: any;
|
|
13
169
|
elements?: any;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type CombineBrandsIfNeeded } from "@excalidraw/common";
|
|
1
2
|
import type { ElementsMap, ElementsMapOrArray, ExcalidrawElement, ExcalidrawSelectionElement, OrderedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
3
|
import type { AppState, BinaryFiles, LibraryItem } from "../types";
|
|
3
4
|
import type { ImportedDataState } from "./types";
|
|
@@ -8,28 +9,33 @@ export type RestoredDataState = {
|
|
|
8
9
|
appState: RestoredAppState;
|
|
9
10
|
files: BinaryFiles;
|
|
10
11
|
};
|
|
11
|
-
export declare const restoreElement: (
|
|
12
|
+
export declare const restoreElement: (
|
|
13
|
+
/** element to be restored */
|
|
14
|
+
element: Exclude<ExcalidrawElement, ExcalidrawSelectionElement>,
|
|
15
|
+
/** all elements to be restored */
|
|
16
|
+
targetElementsMap: Readonly<ElementsMap>,
|
|
17
|
+
/** used for additional context */
|
|
18
|
+
existingElementsMap: Readonly<ElementsMap> | null | undefined, opts?: {
|
|
12
19
|
deleteInvisibleElements?: boolean;
|
|
13
20
|
}) => typeof element | null;
|
|
14
|
-
export declare const restoreElements: (targetElements:
|
|
15
|
-
/**
|
|
16
|
-
|
|
21
|
+
export declare const restoreElements: <T extends ExcalidrawElement>(targetElements: readonly T[] | undefined | null,
|
|
22
|
+
/** used for additional context (e.g. repairing arrow bindings) */
|
|
23
|
+
existingElements: Readonly<ElementsMapOrArray> | null | undefined, opts?: {
|
|
17
24
|
refreshDimensions?: boolean;
|
|
18
25
|
repairBindings?: boolean;
|
|
19
26
|
deleteInvisibleElements?: boolean;
|
|
20
|
-
} | undefined) => OrderedExcalidrawElement
|
|
21
|
-
export declare const restoreAppState: (appState: ImportedDataState["appState"], localAppState: Partial<AppState> | null | undefined) => RestoredAppState;
|
|
22
|
-
export declare const restore: (data: Pick<ImportedDataState, "appState" | "elements" | "files"> | null,
|
|
27
|
+
} | undefined) => CombineBrandsIfNeeded<T, OrderedExcalidrawElement>;
|
|
23
28
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
29
|
+
* When replacing elements that may exist locally, this bumps their versions
|
|
30
|
+
* to the local version + 1. Mainly for later reconciliation to work properly.
|
|
31
|
+
*
|
|
32
|
+
* See https://github.com/excalidraw/excalidraw/issues/3795
|
|
33
|
+
*
|
|
34
|
+
* Generally use this on editor boundaries (importing from file etc.), though
|
|
35
|
+
* it does not apply universally (e.g. we don't want to do this for collab
|
|
36
|
+
* updates).
|
|
28
37
|
*/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
repairBindings?: boolean;
|
|
32
|
-
deleteInvisibleElements?: boolean;
|
|
33
|
-
}) => RestoredDataState;
|
|
38
|
+
export declare const bumpElementVersions: <T extends ExcalidrawElement>(targetElements: readonly T[], localElements: Readonly<ElementsMapOrArray> | null | undefined) => T[];
|
|
39
|
+
export declare const restoreAppState: (appState: ImportedDataState["appState"], localAppState: Partial<AppState> | null | undefined) => RestoredAppState;
|
|
34
40
|
export declare const restoreLibraryItems: (libraryItems: ImportedDataState["libraryItems"], defaultStatus: LibraryItem["status"]) => LibraryItem[];
|
|
35
41
|
export {};
|
|
@@ -12,12 +12,11 @@ export { getSceneVersion, hashElementsVersion, hashString, getNonDeletedElements
|
|
|
12
12
|
export { getTextFromElements } from "@excalidraw/element";
|
|
13
13
|
export { isInvisiblySmallElement } from "@excalidraw/element";
|
|
14
14
|
export { defaultLang, useI18n, languages } from "./i18n";
|
|
15
|
-
export {
|
|
15
|
+
export { 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";
|
|
21
20
|
export { mergeLibraryItems, getLibraryItemsHash } from "./data/library";
|
|
22
21
|
export { isLinearElement } from "@excalidraw/element";
|
|
23
22
|
export { FONT_FAMILY, THEME, MIME_TYPES, ROUNDNESS, DEFAULT_LASER_COLOR, UserIdleState, normalizeLink, sceneCoordsToViewportCoords, viewportCoordsToSceneCoords, getFormFactor, } from "@excalidraw/common";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
2
|
import type { Scene } from "@excalidraw/element";
|
|
3
|
+
import type { RenderableElementsMap } from "./types";
|
|
3
4
|
import type { AppState } from "../types";
|
|
4
5
|
export declare class Renderer {
|
|
5
6
|
private scene;
|
|
@@ -19,8 +20,9 @@ export declare class Renderer {
|
|
|
19
20
|
* (we'd have to prefilter elements outside of this function) */
|
|
20
21
|
newElementId: ExcalidrawElement["id"] | undefined;
|
|
21
22
|
sceneNonce: ReturnType<InstanceType<typeof Scene>["getSceneNonce"]>;
|
|
23
|
+
hideAnnotations: AppState["hideAnnotations"];
|
|
22
24
|
}) => {
|
|
23
|
-
elementsMap:
|
|
25
|
+
elementsMap: RenderableElementsMap;
|
|
24
26
|
visibleElements: readonly NonDeletedExcalidrawElement[];
|
|
25
27
|
}) & {
|
|
26
28
|
clear: () => void;
|
|
@@ -15,6 +15,7 @@ export type StaticCanvasRenderConfig = {
|
|
|
15
15
|
embedsValidationStatus: EmbedsValidationStatus;
|
|
16
16
|
elementsPendingErasure: ElementsPendingErasure;
|
|
17
17
|
pendingFlowchartNodes: PendingExcalidrawElements | null;
|
|
18
|
+
theme: AppState["theme"];
|
|
18
19
|
};
|
|
19
20
|
export type SVGRenderConfig = {
|
|
20
21
|
offsetX: number;
|
|
@@ -32,6 +33,7 @@ export type SVGRenderConfig = {
|
|
|
32
33
|
* @default true
|
|
33
34
|
*/
|
|
34
35
|
reuseImages: boolean;
|
|
36
|
+
theme: AppState["theme"];
|
|
35
37
|
};
|
|
36
38
|
export type InteractiveCanvasRenderConfig = {
|
|
37
39
|
remoteSelectedElementIds: Map<ExcalidrawElement["id"], SocketId[]>;
|
|
@@ -115,14 +117,17 @@ export type ScrollBars = {
|
|
|
115
117
|
deltaMultiplier: number;
|
|
116
118
|
} | null;
|
|
117
119
|
};
|
|
118
|
-
export type
|
|
120
|
+
export type SVGPathString = string & {
|
|
121
|
+
__brand: "SVGPathString";
|
|
122
|
+
};
|
|
123
|
+
export type ElementShape = Drawable | Drawable[] | Path2D | (Drawable | SVGPathString)[] | null;
|
|
119
124
|
export type ElementShapes = {
|
|
120
125
|
rectangle: Drawable;
|
|
121
126
|
ellipse: Drawable;
|
|
122
127
|
diamond: Drawable;
|
|
123
128
|
iframe: Drawable;
|
|
124
129
|
embeddable: Drawable;
|
|
125
|
-
freedraw: Drawable |
|
|
130
|
+
freedraw: (Drawable | SVGPathString)[];
|
|
126
131
|
arrow: Drawable[];
|
|
127
132
|
line: Drawable[];
|
|
128
133
|
text: null;
|
|
@@ -104,6 +104,7 @@ type _CommonCanvasAppState = {
|
|
|
104
104
|
scrollY: AppState["scrollY"];
|
|
105
105
|
width: AppState["width"];
|
|
106
106
|
height: AppState["height"];
|
|
107
|
+
hideAnnotations: AppState["hideAnnotations"];
|
|
107
108
|
viewModeEnabled: AppState["viewModeEnabled"];
|
|
108
109
|
openDialog: AppState["openDialog"];
|
|
109
110
|
editingGroupId: AppState["editingGroupId"];
|
|
@@ -311,6 +312,7 @@ export interface AppState {
|
|
|
311
312
|
gridStep: number;
|
|
312
313
|
gridModeEnabled: boolean;
|
|
313
314
|
viewModeEnabled: boolean;
|
|
315
|
+
hideAnnotations: boolean;
|
|
314
316
|
/** top-most selected groups (i.e. does not include nested groups) */
|
|
315
317
|
selectedGroupIds: {
|
|
316
318
|
[groupId: string]: boolean;
|
|
@@ -456,6 +458,7 @@ export interface ExcalidrawProps {
|
|
|
456
458
|
renderTopLeftUI?: (isMobile: boolean, appState: UIAppState) => JSX.Element | null;
|
|
457
459
|
renderTopRightUI?: (isMobile: boolean, appState: UIAppState) => JSX.Element | null;
|
|
458
460
|
langCode?: Language["code"];
|
|
461
|
+
hideAnnotations?: boolean;
|
|
459
462
|
viewModeEnabled?: boolean;
|
|
460
463
|
zenModeEnabled?: boolean;
|
|
461
464
|
gridModeEnabled?: boolean;
|
|
@@ -480,6 +483,7 @@ export interface ExcalidrawProps {
|
|
|
480
483
|
onUserFollow?: (payload: OnUserFollowedPayload) => void;
|
|
481
484
|
children?: React.ReactNode;
|
|
482
485
|
validateEmbeddable?: boolean | string[] | RegExp | RegExp[] | ((link: string) => boolean | undefined);
|
|
486
|
+
onHideAnnotationsChange?: (hideAnnotations: boolean) => void;
|
|
483
487
|
renderEmbeddable?: (element: NonDeleted<ExcalidrawEmbeddableElement>, appState: AppState) => JSX.Element | null;
|
|
484
488
|
aiEnabled?: boolean;
|
|
485
489
|
showDeprecatedFonts?: boolean;
|
|
@@ -530,7 +534,11 @@ export type UIOptions = Partial<{
|
|
|
530
534
|
fontPicker?: {
|
|
531
535
|
familyChangeEnabled?: boolean;
|
|
532
536
|
};
|
|
537
|
+
shapeControl?: {
|
|
538
|
+
sloppinessChangeEnabled?: boolean;
|
|
539
|
+
};
|
|
533
540
|
viewModeControlEnabled?: boolean;
|
|
541
|
+
hideAnnotationsControlEnabled?: boolean;
|
|
534
542
|
undoRedoPosition: "footer" | "toolbar";
|
|
535
543
|
swapTopMenuAndFooter?: boolean;
|
|
536
544
|
/** @deprecated does nothing. Will be removed in 0.15 */
|
|
@@ -692,6 +700,7 @@ export interface ExcalidrawImperativeAPI {
|
|
|
692
700
|
onPointerUp: (callback: (activeTool: AppState["activeTool"], pointerDownState: PointerDownState, event: PointerEvent) => void) => UnsubscribeCallback;
|
|
693
701
|
onScrollChange: (callback: (scrollX: number, scrollY: number, zoom: Zoom) => void) => UnsubscribeCallback;
|
|
694
702
|
onUserFollow: (callback: (payload: OnUserFollowedPayload) => void) => UnsubscribeCallback;
|
|
703
|
+
onHideAnnotationsChange: (callback: (hideAnnotations: boolean) => void) => UnsubscribeCallback;
|
|
695
704
|
}
|
|
696
705
|
export type FrameNameBounds = {
|
|
697
706
|
x: number;
|
|
@@ -13,9 +13,7 @@ export declare function rangeInclusive(start: number, end: number): InclusiveRan
|
|
|
13
13
|
* @param pair The number pair to convert to an inclusive range
|
|
14
14
|
* @returns The new inclusive range
|
|
15
15
|
*/
|
|
16
|
-
export declare function rangeInclusiveFromPair(pair: [start: number, end: number]):
|
|
17
|
-
_brand: "excalimath_degree";
|
|
18
|
-
};
|
|
16
|
+
export declare function rangeInclusiveFromPair(pair: [start: number, end: number]): InclusiveRange;
|
|
19
17
|
/**
|
|
20
18
|
* Given two ranges, return if the two ranges overlap with each other e.g.
|
|
21
19
|
* [1, 3] overlaps with [2, 4] while [1, 3] does not overlap with [4, 5].
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildmio/excalidraw",
|
|
3
|
-
"version": "0.18.0-custom
|
|
3
|
+
"version": "0.18.0-custom.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./dist/types/excalidraw/index.d.ts",
|
|
6
6
|
"main": "./dist/prod/index.js",
|
|
@@ -79,10 +79,7 @@
|
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@braintree/sanitize-url": "6.0.2",
|
|
82
|
-
"@excalidraw/common": "0.18.0",
|
|
83
|
-
"@excalidraw/element": "0.18.0",
|
|
84
82
|
"@excalidraw/laser-pointer": "1.3.1",
|
|
85
|
-
"@excalidraw/math": "0.18.0",
|
|
86
83
|
"@excalidraw/mermaid-to-excalidraw": "1.1.3",
|
|
87
84
|
"@excalidraw/random-username": "1.1.0",
|
|
88
85
|
"@radix-ui/react-popover": "1.1.6",
|
|
@@ -114,6 +111,9 @@
|
|
|
114
111
|
"tunnel-rat": "0.1.2"
|
|
115
112
|
},
|
|
116
113
|
"devDependencies": {
|
|
114
|
+
"@excalidraw/common": "0.18.0",
|
|
115
|
+
"@excalidraw/element": "0.18.0",
|
|
116
|
+
"@excalidraw/math": "0.18.0",
|
|
117
117
|
"@size-limit/preset-big-lib": "9.0.0",
|
|
118
118
|
"@testing-library/dom": "10.4.0",
|
|
119
119
|
"@testing-library/jest-dom": "6.6.3",
|