@myoc/excalidraw 0.19.518 → 0.19.519
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/CHANGELOG.md +113 -0
- package/dist/dev/{chunk-2ZDXTNY7.js → chunk-MCPNWEHU.js} +2 -2
- package/dist/dev/{chunk-36IX6I7U.js → chunk-RIK6B6HD.js} +27 -8
- package/dist/dev/chunk-RIK6B6HD.js.map +7 -0
- package/dist/dev/data/{image-VHQDH63K.js → image-IRC25PM5.js} +3 -3
- package/dist/dev/index.css +2 -3
- package/dist/dev/index.css.map +2 -2
- package/dist/dev/index.js +547 -595
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/chunk-FL5QOM6C.js +4 -0
- package/dist/prod/{chunk-VW4XDTQW.js → chunk-QW7MIEK6.js} +1 -1
- package/dist/prod/data/image-7LG744DI.js +1 -0
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +17 -17
- 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 +1 -1
- package/dist/types/element/src/bounds.d.ts +18 -1
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +2 -0
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +11 -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/actionDeselect.d.ts +1 -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 +2 -0
- 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/actionToggleArrowBinding.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.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 +3 -2
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +1 -0
- package/dist/types/excalidraw/components/App.d.ts +1 -0
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +7 -4
- package/dist/types/excalidraw/data/blob.d.ts +1 -0
- package/dist/types/excalidraw/data/json.d.ts +1 -0
- package/dist/types/excalidraw/index.d.ts +3 -1
- package/dist/types/excalidraw/types.d.ts +8 -0
- package/dist/types/utils/src/index.d.ts +1 -2
- package/package.json +4 -4
- package/dist/dev/chunk-36IX6I7U.js.map +0 -7
- package/dist/prod/chunk-B67RJXF2.js +0 -4
- package/dist/prod/data/image-YRR6RGIN.js +0 -1
- package/dist/types/utils/src/bbox.d.ts +0 -9
- package/dist/types/utils/src/withinBounds.d.ts +0 -19
- /package/dist/dev/{chunk-2ZDXTNY7.js.map → chunk-MCPNWEHU.js.map} +0 -0
- /package/dist/dev/data/{image-VHQDH63K.js.map → image-IRC25PM5.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d}from"./chunk-Z5NKEFVG.js";import"./chunk-
|
|
1
|
+
import{a,b,c,d}from"./chunk-Z5NKEFVG.js";import"./chunk-QW7MIEK6.js";import"./chunk-SRAX5OIU.js";export{a as Commands,b as subsetToBase64,c as subsetToBinary,d as toBase64};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r,c as t}from"./chunk-Z5NKEFVG.js";import"./chunk-
|
|
1
|
+
import{a as r,c as t}from"./chunk-Z5NKEFVG.js";import"./chunk-QW7MIEK6.js";import"./chunk-SRAX5OIU.js";var s=import.meta.url?new URL(import.meta.url):void 0;typeof window>"u"&&typeof self<"u"&&(self.onmessage=async e=>{switch(e.data.command){case r.Subset:let a=await t(e.data.arrayBuffer,e.data.codePoints);self.postMessage(a,{transfer:[a]});break}});export{s as WorkerUrl};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const applyDarkModeFilter: (color: string) => string;
|
|
1
|
+
export declare const applyDarkModeFilter: (color: string, enable?: boolean) => string;
|
|
2
2
|
export type ColorTuple = readonly [string, string, string, string, string];
|
|
3
3
|
export type ColorPaletteCustom = {
|
|
4
4
|
[key: string]: ColorTuple | string;
|
|
@@ -2,7 +2,7 @@ import { type Bounds } from "@excalidraw/common";
|
|
|
2
2
|
import type { Degrees, GlobalPoint, LineSegment, LocalPoint } from "@excalidraw/math";
|
|
3
3
|
import type { AppState } from "@excalidraw/excalidraw/types";
|
|
4
4
|
import type { Drawable, Op } from "roughjs/bin/core";
|
|
5
|
-
import type { Arrowhead, ElementsMap, ElementsMapOrArray, ExcalidrawElement, ExcalidrawLinearElement, NonDeleted } from "./types";
|
|
5
|
+
import type { Arrowhead, ElementsMap, ElementsMapOrArray, ExcalidrawElement, ExcalidrawLinearElement, NonDeleted, NonDeletedExcalidrawElement } from "./types";
|
|
6
6
|
export type RectangleBox = {
|
|
7
7
|
x: number;
|
|
8
8
|
y: number;
|
|
@@ -80,4 +80,21 @@ export declare const pointInsideBounds: <P extends GlobalPoint | LocalPoint>(p:
|
|
|
80
80
|
export declare const pointInsideBoundsInclusive: <P extends GlobalPoint | LocalPoint>(p: P, bounds: Bounds) => boolean;
|
|
81
81
|
export declare const doBoundsIntersect: (bounds1: Bounds | null, bounds2: Bounds | null) => boolean;
|
|
82
82
|
export declare const boundsContainBounds: (outerBounds: Bounds, innerBounds: Bounds) => boolean;
|
|
83
|
+
/**
|
|
84
|
+
* High level helper to get elements overlapping a bounding box.
|
|
85
|
+
* It can be used to get elements overlapping a selection box, for example.
|
|
86
|
+
*
|
|
87
|
+
*/
|
|
88
|
+
export declare const elementsOverlappingBBox: ({ elements, elementsMap, bounds, type, excludeElementsInFrames, shouldIgnoreElementFromSelection, }: {
|
|
89
|
+
elements: readonly NonDeletedExcalidrawElement[];
|
|
90
|
+
elementsMap?: ElementsMap;
|
|
91
|
+
bounds: Bounds | ExcalidrawElement;
|
|
92
|
+
/**
|
|
93
|
+
* - overlap: elements overlapping or inside bounds
|
|
94
|
+
* - contain: elements inside bounds
|
|
95
|
+
**/
|
|
96
|
+
type: "contain" | "overlap";
|
|
97
|
+
excludeElementsInFrames?: boolean;
|
|
98
|
+
shouldIgnoreElementFromSelection?: (element: NonDeletedExcalidrawElement) => boolean;
|
|
99
|
+
}) => NonDeletedExcalidrawElement[];
|
|
83
100
|
export declare const elementCenterPoint: (element: ExcalidrawElement, elementsMap: ElementsMap, xOffset?: number, yOffset?: number) => GlobalPoint;
|
|
@@ -153,6 +153,7 @@ export declare const actionBindText: {
|
|
|
153
153
|
gridStep: number;
|
|
154
154
|
gridModeEnabled: boolean;
|
|
155
155
|
viewModeEnabled: boolean;
|
|
156
|
+
viewModeOnly: boolean;
|
|
156
157
|
selectedGroupIds: {
|
|
157
158
|
[groupId: string]: boolean;
|
|
158
159
|
};
|
|
@@ -331,6 +332,7 @@ export declare const actionWrapTextInContainer: {
|
|
|
331
332
|
gridStep: number;
|
|
332
333
|
gridModeEnabled: boolean;
|
|
333
334
|
viewModeEnabled: boolean;
|
|
335
|
+
viewModeOnly: boolean;
|
|
334
336
|
selectedGroupIds: {
|
|
335
337
|
[groupId: string]: boolean;
|
|
336
338
|
};
|
|
@@ -144,6 +144,7 @@ export declare const actionZoomIn: {
|
|
|
144
144
|
gridStep: number;
|
|
145
145
|
gridModeEnabled: boolean;
|
|
146
146
|
viewModeEnabled: boolean;
|
|
147
|
+
viewModeOnly: boolean;
|
|
147
148
|
selectedGroupIds: {
|
|
148
149
|
[groupId: string]: boolean;
|
|
149
150
|
};
|
|
@@ -326,6 +327,7 @@ export declare const actionZoomOut: {
|
|
|
326
327
|
gridStep: number;
|
|
327
328
|
gridModeEnabled: boolean;
|
|
328
329
|
viewModeEnabled: boolean;
|
|
330
|
+
viewModeOnly: boolean;
|
|
329
331
|
selectedGroupIds: {
|
|
330
332
|
[groupId: string]: boolean;
|
|
331
333
|
};
|
|
@@ -508,6 +510,7 @@ export declare const actionResetZoom: {
|
|
|
508
510
|
gridStep: number;
|
|
509
511
|
gridModeEnabled: boolean;
|
|
510
512
|
viewModeEnabled: boolean;
|
|
513
|
+
viewModeOnly: boolean;
|
|
511
514
|
selectedGroupIds: {
|
|
512
515
|
[groupId: string]: boolean;
|
|
513
516
|
};
|
|
@@ -691,6 +694,7 @@ export declare const zoomToFitBounds: ({ bounds, appState, canvasOffsets, fitToV
|
|
|
691
694
|
gridStep: number;
|
|
692
695
|
gridModeEnabled: boolean;
|
|
693
696
|
viewModeEnabled: boolean;
|
|
697
|
+
viewModeOnly: boolean;
|
|
694
698
|
selectedGroupIds: {
|
|
695
699
|
[groupId: string]: boolean;
|
|
696
700
|
};
|
|
@@ -870,6 +874,7 @@ export declare const zoomToFit: ({ canvasOffsets, targetElements, appState, fitT
|
|
|
870
874
|
gridStep: number;
|
|
871
875
|
gridModeEnabled: boolean;
|
|
872
876
|
viewModeEnabled: boolean;
|
|
877
|
+
viewModeOnly: boolean;
|
|
873
878
|
selectedGroupIds: {
|
|
874
879
|
[groupId: string]: boolean;
|
|
875
880
|
};
|
|
@@ -1046,6 +1051,7 @@ export declare const actionZoomToFitSelectionInViewport: {
|
|
|
1046
1051
|
gridStep: number;
|
|
1047
1052
|
gridModeEnabled: boolean;
|
|
1048
1053
|
viewModeEnabled: boolean;
|
|
1054
|
+
viewModeOnly: boolean;
|
|
1049
1055
|
selectedGroupIds: {
|
|
1050
1056
|
[groupId: string]: boolean;
|
|
1051
1057
|
};
|
|
@@ -1226,6 +1232,7 @@ export declare const actionZoomToFitSelection: {
|
|
|
1226
1232
|
gridStep: number;
|
|
1227
1233
|
gridModeEnabled: boolean;
|
|
1228
1234
|
viewModeEnabled: boolean;
|
|
1235
|
+
viewModeOnly: boolean;
|
|
1229
1236
|
selectedGroupIds: {
|
|
1230
1237
|
[groupId: string]: boolean;
|
|
1231
1238
|
};
|
|
@@ -1407,6 +1414,7 @@ export declare const actionZoomToFit: {
|
|
|
1407
1414
|
gridStep: number;
|
|
1408
1415
|
gridModeEnabled: boolean;
|
|
1409
1416
|
viewModeEnabled: boolean;
|
|
1417
|
+
viewModeOnly: boolean;
|
|
1410
1418
|
selectedGroupIds: {
|
|
1411
1419
|
[groupId: string]: boolean;
|
|
1412
1420
|
};
|
|
@@ -1583,6 +1591,7 @@ export declare const actionToggleEraserTool: {
|
|
|
1583
1591
|
gridStep: number;
|
|
1584
1592
|
gridModeEnabled: boolean;
|
|
1585
1593
|
viewModeEnabled: boolean;
|
|
1594
|
+
viewModeOnly: boolean;
|
|
1586
1595
|
editingGroupId: import("@excalidraw/element/types").GroupId | null;
|
|
1587
1596
|
width: number;
|
|
1588
1597
|
height: number;
|
|
@@ -1755,6 +1764,7 @@ export declare const actionToggleLassoTool: {
|
|
|
1755
1764
|
gridStep: number;
|
|
1756
1765
|
gridModeEnabled: boolean;
|
|
1757
1766
|
viewModeEnabled: boolean;
|
|
1767
|
+
viewModeOnly: boolean;
|
|
1758
1768
|
editingGroupId: import("@excalidraw/element/types").GroupId | null;
|
|
1759
1769
|
width: number;
|
|
1760
1770
|
height: number;
|
|
@@ -1926,6 +1936,7 @@ export declare const actionToggleHandTool: {
|
|
|
1926
1936
|
gridStep: number;
|
|
1927
1937
|
gridModeEnabled: boolean;
|
|
1928
1938
|
viewModeEnabled: boolean;
|
|
1939
|
+
viewModeOnly: boolean;
|
|
1929
1940
|
editingGroupId: import("@excalidraw/element/types").GroupId | null;
|
|
1930
1941
|
width: number;
|
|
1931
1942
|
height: number;
|
|
@@ -137,6 +137,7 @@ export declare const actionPaste: {
|
|
|
137
137
|
gridStep: number;
|
|
138
138
|
gridModeEnabled: boolean;
|
|
139
139
|
viewModeEnabled: boolean;
|
|
140
|
+
viewModeOnly: boolean;
|
|
140
141
|
selectedGroupIds: {
|
|
141
142
|
[groupId: string]: boolean;
|
|
142
143
|
};
|
|
@@ -353,6 +354,7 @@ export declare const actionCopyAsPng: {
|
|
|
353
354
|
gridStep: number;
|
|
354
355
|
gridModeEnabled: boolean;
|
|
355
356
|
viewModeEnabled: boolean;
|
|
357
|
+
viewModeOnly: boolean;
|
|
356
358
|
selectedGroupIds: {
|
|
357
359
|
[groupId: string]: boolean;
|
|
358
360
|
};
|
|
@@ -139,6 +139,7 @@ export declare const actionDeleteSelected: {
|
|
|
139
139
|
gridStep: number;
|
|
140
140
|
gridModeEnabled: boolean;
|
|
141
141
|
viewModeEnabled: boolean;
|
|
142
|
+
viewModeOnly: boolean;
|
|
142
143
|
selectedGroupIds: {
|
|
143
144
|
[groupId: string]: boolean;
|
|
144
145
|
};
|
|
@@ -338,6 +339,7 @@ export declare const actionDeleteSelected: {
|
|
|
338
339
|
gridStep: number;
|
|
339
340
|
gridModeEnabled: boolean;
|
|
340
341
|
viewModeEnabled: boolean;
|
|
342
|
+
viewModeOnly: boolean;
|
|
341
343
|
selectedGroupIds: {
|
|
342
344
|
[groupId: string]: boolean;
|
|
343
345
|
};
|
|
@@ -502,6 +504,7 @@ export declare const actionDeleteSelected: {
|
|
|
502
504
|
gridStep: number;
|
|
503
505
|
gridModeEnabled: boolean;
|
|
504
506
|
viewModeEnabled: boolean;
|
|
507
|
+
viewModeOnly: boolean;
|
|
505
508
|
width: number;
|
|
506
509
|
height: number;
|
|
507
510
|
offsetTop: number;
|
|
@@ -146,6 +146,7 @@ export declare const actionToggleElementLock: {
|
|
|
146
146
|
gridStep: number;
|
|
147
147
|
gridModeEnabled: boolean;
|
|
148
148
|
viewModeEnabled: boolean;
|
|
149
|
+
viewModeOnly: boolean;
|
|
149
150
|
editingGroupId: import("@excalidraw/element/types").GroupId | null;
|
|
150
151
|
width: number;
|
|
151
152
|
height: number;
|
|
@@ -323,6 +324,7 @@ export declare const actionUnlockAllElements: {
|
|
|
323
324
|
gridStep: number;
|
|
324
325
|
gridModeEnabled: boolean;
|
|
325
326
|
viewModeEnabled: boolean;
|
|
327
|
+
viewModeOnly: boolean;
|
|
326
328
|
editingGroupId: import("@excalidraw/element/types").GroupId | null;
|
|
327
329
|
width: number;
|
|
328
330
|
height: number;
|
|
@@ -155,6 +155,7 @@ export declare const actionLoadScene: {
|
|
|
155
155
|
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
156
156
|
bindMode: import("@excalidraw/element/types").BindMode;
|
|
157
157
|
gridSize: number;
|
|
158
|
+
viewModeOnly: boolean;
|
|
158
159
|
gridModeEnabled: boolean;
|
|
159
160
|
objectsSnapModeEnabled: boolean;
|
|
160
161
|
wheelZoomsOnDefault?: boolean | undefined;
|
|
@@ -373,6 +374,7 @@ export declare const actionLoadScene: {
|
|
|
373
374
|
gridStep: number;
|
|
374
375
|
gridModeEnabled: boolean;
|
|
375
376
|
viewModeEnabled: boolean;
|
|
377
|
+
viewModeOnly: boolean;
|
|
376
378
|
selectedGroupIds: {
|
|
377
379
|
[groupId: string]: boolean;
|
|
378
380
|
};
|
|
@@ -134,6 +134,7 @@ export declare const actionSelectAllElementsInFrame: {
|
|
|
134
134
|
gridStep: number;
|
|
135
135
|
gridModeEnabled: boolean;
|
|
136
136
|
viewModeEnabled: boolean;
|
|
137
|
+
viewModeOnly: boolean;
|
|
137
138
|
selectedGroupIds: {
|
|
138
139
|
[groupId: string]: boolean;
|
|
139
140
|
};
|
|
@@ -316,6 +317,7 @@ export declare const actionRemoveAllElementsFromFrame: {
|
|
|
316
317
|
gridStep: number;
|
|
317
318
|
gridModeEnabled: boolean;
|
|
318
319
|
viewModeEnabled: boolean;
|
|
320
|
+
viewModeOnly: boolean;
|
|
319
321
|
selectedGroupIds: {
|
|
320
322
|
[groupId: string]: boolean;
|
|
321
323
|
};
|
|
@@ -499,6 +501,7 @@ export declare const actionupdateFrameRendering: {
|
|
|
499
501
|
gridStep: number;
|
|
500
502
|
gridModeEnabled: boolean;
|
|
501
503
|
viewModeEnabled: boolean;
|
|
504
|
+
viewModeOnly: boolean;
|
|
502
505
|
selectedGroupIds: {
|
|
503
506
|
[groupId: string]: boolean;
|
|
504
507
|
};
|
|
@@ -679,6 +682,7 @@ export declare const actionSetFrameAsActiveTool: {
|
|
|
679
682
|
gridStep: number;
|
|
680
683
|
gridModeEnabled: boolean;
|
|
681
684
|
viewModeEnabled: boolean;
|
|
685
|
+
viewModeOnly: boolean;
|
|
682
686
|
selectedGroupIds: {
|
|
683
687
|
[groupId: string]: boolean;
|
|
684
688
|
};
|
|
@@ -140,6 +140,7 @@ export declare const actionGroup: {
|
|
|
140
140
|
gridStep: number;
|
|
141
141
|
gridModeEnabled: boolean;
|
|
142
142
|
viewModeEnabled: boolean;
|
|
143
|
+
viewModeOnly: boolean;
|
|
143
144
|
width: number;
|
|
144
145
|
height: number;
|
|
145
146
|
offsetTop: number;
|
|
@@ -321,6 +322,7 @@ export declare const actionUngroup: {
|
|
|
321
322
|
gridStep: number;
|
|
322
323
|
gridModeEnabled: boolean;
|
|
323
324
|
viewModeEnabled: boolean;
|
|
325
|
+
viewModeOnly: boolean;
|
|
324
326
|
width: number;
|
|
325
327
|
height: number;
|
|
326
328
|
offsetTop: number;
|
|
@@ -162,6 +162,7 @@ export declare const actionDecreaseFontSize: {
|
|
|
162
162
|
gridStep: number;
|
|
163
163
|
gridModeEnabled: boolean;
|
|
164
164
|
viewModeEnabled: boolean;
|
|
165
|
+
viewModeOnly: boolean;
|
|
165
166
|
selectedGroupIds: {
|
|
166
167
|
[groupId: string]: boolean;
|
|
167
168
|
};
|
|
@@ -339,6 +340,7 @@ export declare const actionIncreaseFontSize: {
|
|
|
339
340
|
gridStep: number;
|
|
340
341
|
gridModeEnabled: boolean;
|
|
341
342
|
viewModeEnabled: boolean;
|
|
343
|
+
viewModeOnly: boolean;
|
|
342
344
|
selectedGroupIds: {
|
|
343
345
|
[groupId: string]: boolean;
|
|
344
346
|
};
|
|
@@ -7,7 +7,7 @@ export declare const actionToggleViewMode: {
|
|
|
7
7
|
category: "canvas";
|
|
8
8
|
predicate: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
9
9
|
};
|
|
10
|
-
perform(elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>): {
|
|
10
|
+
perform(elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>): false | {
|
|
11
11
|
appState: {
|
|
12
12
|
viewModeEnabled: boolean;
|
|
13
13
|
contextMenu: {
|
|
@@ -136,6 +136,7 @@ export declare const actionToggleViewMode: {
|
|
|
136
136
|
gridSize: number;
|
|
137
137
|
gridStep: number;
|
|
138
138
|
gridModeEnabled: boolean;
|
|
139
|
+
viewModeOnly: boolean;
|
|
139
140
|
selectedGroupIds: {
|
|
140
141
|
[groupId: string]: boolean;
|
|
141
142
|
};
|
|
@@ -177,7 +178,7 @@ export declare const actionToggleViewMode: {
|
|
|
177
178
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
178
179
|
predicate: (elements: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
|
|
179
180
|
keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
|
|
180
|
-
PanelComponent: ({ data, updateData, appState }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
181
|
+
PanelComponent: ({ data, updateData, appState, appProps }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
181
182
|
} & {
|
|
182
183
|
keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
183
184
|
};
|
|
@@ -502,6 +502,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
502
502
|
private handleCanvasClick;
|
|
503
503
|
private getElementLinkAtPosition;
|
|
504
504
|
private handleElementLinkClick;
|
|
505
|
+
private openElementLink;
|
|
505
506
|
/**
|
|
506
507
|
* finds candidate frame under cursor (when dragging frame children/elements
|
|
507
508
|
* inside frames)
|
|
@@ -25,11 +25,14 @@ export declare const Help: {
|
|
|
25
25
|
export declare const ToggleTheme: {
|
|
26
26
|
(props: {
|
|
27
27
|
allowSystemTheme: true;
|
|
28
|
+
/**
|
|
29
|
+
* Controls the theme of this UI component only.
|
|
30
|
+
* You should subscribe to `props.onThemeChange` and control the theme
|
|
31
|
+
* upstream.
|
|
32
|
+
*/
|
|
28
33
|
theme: Theme | "system";
|
|
29
|
-
onSelect: (theme: Theme | "system") => void;
|
|
30
34
|
} | {
|
|
31
|
-
allowSystemTheme
|
|
32
|
-
onSelect?: (theme: Theme) => void;
|
|
35
|
+
allowSystemTheme: false;
|
|
33
36
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
34
37
|
displayName: string;
|
|
35
38
|
};
|
|
@@ -66,7 +69,7 @@ export declare const Preferences: {
|
|
|
66
69
|
ToggleMidpointSnapping: () => import("react/jsx-runtime").JSX.Element;
|
|
67
70
|
ToggleGridMode: () => import("react/jsx-runtime").JSX.Element;
|
|
68
71
|
ToggleZenMode: () => import("react/jsx-runtime").JSX.Element;
|
|
69
|
-
ToggleViewMode: () => import("react/jsx-runtime").JSX.Element;
|
|
72
|
+
ToggleViewMode: () => import("react/jsx-runtime").JSX.Element | null;
|
|
70
73
|
ToggleElementProperties: () => import("react/jsx-runtime").JSX.Element;
|
|
71
74
|
displayName: string;
|
|
72
75
|
};
|
|
@@ -90,6 +90,7 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
|
|
|
90
90
|
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
91
91
|
bindMode: import("@excalidraw/element/types").BindMode;
|
|
92
92
|
gridSize: number;
|
|
93
|
+
viewModeOnly: boolean;
|
|
93
94
|
gridModeEnabled: boolean;
|
|
94
95
|
objectsSnapModeEnabled: boolean;
|
|
95
96
|
wheelZoomsOnDefault?: boolean | undefined;
|
|
@@ -91,6 +91,7 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
91
91
|
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
92
92
|
bindMode: import("@excalidraw/element/types").BindMode;
|
|
93
93
|
gridSize: number;
|
|
94
|
+
viewModeOnly: boolean;
|
|
94
95
|
gridModeEnabled: boolean;
|
|
95
96
|
objectsSnapModeEnabled: boolean;
|
|
96
97
|
wheelZoomsOnDefault?: boolean | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { applyDarkModeFilter } from "@excalidraw/common";
|
|
2
3
|
import Footer from "./components/footer/FooterCenter";
|
|
3
4
|
import LiveCollaborationTrigger from "./components/live-collaboration/LiveCollaborationTrigger";
|
|
4
5
|
import MainMenu from "./components/main-menu/MainMenu";
|
|
@@ -42,7 +43,7 @@ export { Stats } from "./components/Stats";
|
|
|
42
43
|
export { DefaultSidebar } from "./components/DefaultSidebar";
|
|
43
44
|
export { zoomToFitBounds } from "./actions/actionCanvas";
|
|
44
45
|
export { getCommonBounds, getVisibleSceneBounds, convertToExcalidrawElements, } from "@excalidraw/element";
|
|
45
|
-
export { elementsOverlappingBBox
|
|
46
|
+
export { elementsOverlappingBBox } from "@excalidraw/element";
|
|
46
47
|
export { DiagramToCodePlugin } from "./components/DiagramToCodePlugin/DiagramToCodePlugin";
|
|
47
48
|
export { getDataURL } from "./data/blob";
|
|
48
49
|
export { isElementLink } from "@excalidraw/element";
|
|
@@ -60,3 +61,4 @@ export declare function useExcalidrawStateValue<K extends keyof AppState>(prop:
|
|
|
60
61
|
export declare function useExcalidrawStateValue<T extends keyof AppState>(props: T[]): AppState | undefined;
|
|
61
62
|
export declare function useExcalidrawStateValue<T>(selector: (appState: AppState) => T): T | undefined;
|
|
62
63
|
export { _useOnAppStateChange as useOnExcalidrawStateChange };
|
|
64
|
+
export { applyDarkModeFilter };
|
|
@@ -365,6 +365,7 @@ export interface AppState {
|
|
|
365
365
|
gridStep: number;
|
|
366
366
|
gridModeEnabled: boolean;
|
|
367
367
|
viewModeEnabled: boolean;
|
|
368
|
+
viewModeOnly: boolean;
|
|
368
369
|
/** top-most selected groups (i.e. does not include nested groups) */
|
|
369
370
|
selectedGroupIds: {
|
|
370
371
|
[groupId: string]: boolean;
|
|
@@ -464,6 +465,7 @@ export type CompressImageFileOpts = {
|
|
|
464
465
|
export type CompressImageFile = (file: File, opts: CompressImageFileOpts) => Promise<File>;
|
|
465
466
|
export interface ExcalidrawProps {
|
|
466
467
|
onChange?: (elements: readonly OrderedExcalidrawElement[], appState: AppState, files: BinaryFiles) => void;
|
|
468
|
+
onThemeChange?: (theme: Theme | "system") => void;
|
|
467
469
|
/**
|
|
468
470
|
* note: only subscribes if the props.onIncrement is defined on initial render
|
|
469
471
|
*/
|
|
@@ -514,6 +516,7 @@ export interface ExcalidrawProps {
|
|
|
514
516
|
renderTopRightUI?: (isMobile: boolean, appState: UIAppState) => JSX.Element | null;
|
|
515
517
|
langCode?: Language["code"];
|
|
516
518
|
viewModeEnabled?: boolean;
|
|
519
|
+
viewModeOnly?: boolean;
|
|
517
520
|
zenModeEnabled?: boolean;
|
|
518
521
|
gridModeEnabled?: boolean;
|
|
519
522
|
objectsSnapModeEnabled?: boolean;
|
|
@@ -593,6 +596,11 @@ export type CanvasActions = Partial<{
|
|
|
593
596
|
export: false | ExportOpts;
|
|
594
597
|
loadScene: boolean;
|
|
595
598
|
saveToActiveFile: boolean;
|
|
599
|
+
/**
|
|
600
|
+
* defaults to true if `props.theme` is omitted or `props.onThemeChange`
|
|
601
|
+
* is supplied (at which point the theme is considered as host-app controlled),
|
|
602
|
+
* else default to false
|
|
603
|
+
* */
|
|
596
604
|
toggleTheme: boolean | null;
|
|
597
605
|
saveAsImage: boolean;
|
|
598
606
|
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myoc/excalidraw",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.519",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./dist/types/excalidraw/index.d.ts",
|
|
6
6
|
"main": "./dist/prod/index.js",
|
|
@@ -108,9 +108,9 @@
|
|
|
108
108
|
"roughjs": "4.6.4",
|
|
109
109
|
"sass": "1.51.0",
|
|
110
110
|
"tunnel-rat": "0.1.2",
|
|
111
|
-
"@excalidraw/common": "npm:@myoc/common@0.19.
|
|
112
|
-
"@excalidraw/math": "npm:@myoc/math@0.19.
|
|
113
|
-
"@excalidraw/element": "npm:@myoc/element@0.19.
|
|
111
|
+
"@excalidraw/common": "npm:@myoc/common@0.19.519",
|
|
112
|
+
"@excalidraw/math": "npm:@myoc/math@0.19.519",
|
|
113
|
+
"@excalidraw/element": "npm:@myoc/element@0.19.519"
|
|
114
114
|
},
|
|
115
115
|
"devDependencies": {
|
|
116
116
|
"@size-limit/preset-big-lib": "9.0.0",
|