@zsviczian/excalidraw 0.18.0-5 → 0.18.0-7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/excalidraw.development.js +28 -17
  2. package/dist/excalidraw.production.min.js +1 -1
  3. package/package.json +1 -1
  4. package/types/common/src/constants.d.ts +2 -0
  5. package/types/common/src/utils.d.ts +1 -0
  6. package/types/element/src/textElement.d.ts +2 -1
  7. package/types/excalidraw/actions/actionAddToLibrary.d.ts +12 -0
  8. package/types/excalidraw/actions/actionBoundText.d.ts +8 -0
  9. package/types/excalidraw/actions/actionCanvas.d.ts +60 -0
  10. package/types/excalidraw/actions/actionClipboard.d.ts +24 -0
  11. package/types/excalidraw/actions/actionCropEditor.d.ts +4 -0
  12. package/types/excalidraw/actions/actionDeleteSelected.d.ts +12 -0
  13. package/types/excalidraw/actions/actionElementLink.d.ts +4 -0
  14. package/types/excalidraw/actions/actionElementLock.d.ts +8 -0
  15. package/types/excalidraw/actions/actionEmbeddable.d.ts +4 -0
  16. package/types/excalidraw/actions/actionExport.d.ts +36 -0
  17. package/types/excalidraw/actions/actionFinalize.d.ts +8 -0
  18. package/types/excalidraw/actions/actionFrame.d.ts +16 -0
  19. package/types/excalidraw/actions/actionGroup.d.ts +8 -0
  20. package/types/excalidraw/actions/actionLinearEditor.d.ts +4 -0
  21. package/types/excalidraw/actions/actionLink.d.ts +4 -0
  22. package/types/excalidraw/actions/actionMenu.d.ts +12 -0
  23. package/types/excalidraw/actions/actionNavigate.d.ts +8 -0
  24. package/types/excalidraw/actions/actionProperties.d.ts +60 -0
  25. package/types/excalidraw/actions/actionSelectAll.d.ts +4 -0
  26. package/types/excalidraw/actions/actionStyles.d.ts +4 -0
  27. package/types/excalidraw/actions/actionToggleGridMode.d.ts +4 -0
  28. package/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +4 -0
  29. package/types/excalidraw/actions/actionToggleSearchMenu.d.ts +8 -0
  30. package/types/excalidraw/actions/actionToggleStats.d.ts +4 -0
  31. package/types/excalidraw/actions/actionToggleViewMode.d.ts +4 -0
  32. package/types/excalidraw/actions/actionToggleZenMode.d.ts +4 -0
  33. package/types/excalidraw/components/App.d.ts +3 -3
  34. package/types/excalidraw/eraser/index.d.ts +14 -0
  35. package/types/excalidraw/lasso/utils.d.ts +1 -2
  36. package/types/excalidraw/types.d.ts +6 -0
  37. package/types/math/src/types.d.ts +1 -0
@@ -182,6 +182,10 @@ export declare const actionGoToCollaborator: {
182
182
  Bold: string;
183
183
  Regular: string;
184
184
  };
185
+ gridDirection: {
186
+ horizontal: boolean;
187
+ vertical: boolean;
188
+ };
185
189
  highlightSearchResult: boolean;
186
190
  dynamicStyle: {
187
191
  [x: string]: string;
@@ -393,6 +397,10 @@ export declare const actionGoToCollaborator: {
393
397
  Bold: string;
394
398
  Regular: string;
395
399
  };
400
+ gridDirection: {
401
+ horizontal: boolean;
402
+ vertical: boolean;
403
+ };
396
404
  highlightSearchResult: boolean;
397
405
  dynamicStyle: {
398
406
  [x: string]: string;
@@ -201,6 +201,10 @@ export declare const actionChangeFillStyle: {
201
201
  Bold: string;
202
202
  Regular: string;
203
203
  };
204
+ gridDirection: {
205
+ horizontal: boolean;
206
+ vertical: boolean;
207
+ };
204
208
  highlightSearchResult: boolean;
205
209
  dynamicStyle: {
206
210
  [x: string]: string;
@@ -419,6 +423,10 @@ export declare const actionChangeStrokeWidth: {
419
423
  Bold: string;
420
424
  Regular: string;
421
425
  };
426
+ gridDirection: {
427
+ horizontal: boolean;
428
+ vertical: boolean;
429
+ };
422
430
  highlightSearchResult: boolean;
423
431
  dynamicStyle: {
424
432
  [x: string]: string;
@@ -637,6 +645,10 @@ export declare const actionChangeSloppiness: {
637
645
  Bold: string;
638
646
  Regular: string;
639
647
  };
648
+ gridDirection: {
649
+ horizontal: boolean;
650
+ vertical: boolean;
651
+ };
640
652
  highlightSearchResult: boolean;
641
653
  dynamicStyle: {
642
654
  [x: string]: string;
@@ -855,6 +867,10 @@ export declare const actionChangeStrokeStyle: {
855
867
  Bold: string;
856
868
  Regular: string;
857
869
  };
870
+ gridDirection: {
871
+ horizontal: boolean;
872
+ vertical: boolean;
873
+ };
858
874
  highlightSearchResult: boolean;
859
875
  dynamicStyle: {
860
876
  [x: string]: string;
@@ -1073,6 +1089,10 @@ export declare const actionChangeOpacity: {
1073
1089
  Bold: string;
1074
1090
  Regular: string;
1075
1091
  };
1092
+ gridDirection: {
1093
+ horizontal: boolean;
1094
+ vertical: boolean;
1095
+ };
1076
1096
  highlightSearchResult: boolean;
1077
1097
  dynamicStyle: {
1078
1098
  [x: string]: string;
@@ -1292,6 +1312,10 @@ export declare const actionChangeFontSize: {
1292
1312
  Bold: string;
1293
1313
  Regular: string;
1294
1314
  };
1315
+ gridDirection: {
1316
+ horizontal: boolean;
1317
+ vertical: boolean;
1318
+ };
1295
1319
  highlightSearchResult: boolean;
1296
1320
  dynamicStyle: {
1297
1321
  [x: string]: string;
@@ -1511,6 +1535,10 @@ export declare const actionDecreaseFontSize: {
1511
1535
  Bold: string;
1512
1536
  Regular: string;
1513
1537
  };
1538
+ gridDirection: {
1539
+ horizontal: boolean;
1540
+ vertical: boolean;
1541
+ };
1514
1542
  highlightSearchResult: boolean;
1515
1543
  dynamicStyle: {
1516
1544
  [x: string]: string;
@@ -1730,6 +1758,10 @@ export declare const actionIncreaseFontSize: {
1730
1758
  Bold: string;
1731
1759
  Regular: string;
1732
1760
  };
1761
+ gridDirection: {
1762
+ horizontal: boolean;
1763
+ vertical: boolean;
1764
+ };
1733
1765
  highlightSearchResult: boolean;
1734
1766
  dynamicStyle: {
1735
1767
  [x: string]: string;
@@ -1947,6 +1979,10 @@ export declare const actionChangeFontFamily: {
1947
1979
  Bold: string;
1948
1980
  Regular: string;
1949
1981
  };
1982
+ gridDirection: {
1983
+ horizontal: boolean;
1984
+ vertical: boolean;
1985
+ };
1950
1986
  highlightSearchResult: boolean;
1951
1987
  dynamicStyle: {
1952
1988
  [x: string]: string;
@@ -2156,6 +2192,10 @@ export declare const actionChangeFontFamily: {
2156
2192
  Bold: string;
2157
2193
  Regular: string;
2158
2194
  };
2195
+ gridDirection: {
2196
+ horizontal: boolean;
2197
+ vertical: boolean;
2198
+ };
2159
2199
  highlightSearchResult: boolean;
2160
2200
  dynamicStyle: {
2161
2201
  [x: string]: string;
@@ -2374,6 +2414,10 @@ export declare const actionChangeTextAlign: {
2374
2414
  Bold: string;
2375
2415
  Regular: string;
2376
2416
  };
2417
+ gridDirection: {
2418
+ horizontal: boolean;
2419
+ vertical: boolean;
2420
+ };
2377
2421
  highlightSearchResult: boolean;
2378
2422
  dynamicStyle: {
2379
2423
  [x: string]: string;
@@ -2594,6 +2638,10 @@ export declare const actionChangeVerticalAlign: {
2594
2638
  Bold: string;
2595
2639
  Regular: string;
2596
2640
  };
2641
+ gridDirection: {
2642
+ horizontal: boolean;
2643
+ vertical: boolean;
2644
+ };
2597
2645
  highlightSearchResult: boolean;
2598
2646
  dynamicStyle: {
2599
2647
  [x: string]: string;
@@ -2812,6 +2860,10 @@ export declare const actionChangeRoundness: {
2812
2860
  Bold: string;
2813
2861
  Regular: string;
2814
2862
  };
2863
+ gridDirection: {
2864
+ horizontal: boolean;
2865
+ vertical: boolean;
2866
+ };
2815
2867
  highlightSearchResult: boolean;
2816
2868
  dynamicStyle: {
2817
2869
  [x: string]: string;
@@ -3033,6 +3085,10 @@ export declare const actionChangeArrowhead: {
3033
3085
  Bold: string;
3034
3086
  Regular: string;
3035
3087
  };
3088
+ gridDirection: {
3089
+ horizontal: boolean;
3090
+ vertical: boolean;
3091
+ };
3036
3092
  highlightSearchResult: boolean;
3037
3093
  dynamicStyle: {
3038
3094
  [x: string]: string;
@@ -3251,6 +3307,10 @@ export declare const actionChangeArrowType: {
3251
3307
  Bold: string;
3252
3308
  Regular: string;
3253
3309
  };
3310
+ gridDirection: {
3311
+ horizontal: boolean;
3312
+ vertical: boolean;
3313
+ };
3254
3314
  highlightSearchResult: boolean;
3255
3315
  dynamicStyle: {
3256
3316
  [x: string]: string;
@@ -184,6 +184,10 @@ export declare const actionSelectAll: {
184
184
  Bold: string;
185
185
  Regular: string;
186
186
  };
187
+ gridDirection: {
188
+ horizontal: boolean;
189
+ vertical: boolean;
190
+ };
187
191
  highlightSearchResult: boolean;
188
192
  dynamicStyle: {
189
193
  [x: string]: string;
@@ -179,6 +179,10 @@ export declare const actionCopyStyles: {
179
179
  Bold: string;
180
180
  Regular: string;
181
181
  };
182
+ gridDirection: {
183
+ horizontal: boolean;
184
+ vertical: boolean;
185
+ };
182
186
  highlightSearchResult: boolean;
183
187
  dynamicStyle: {
184
188
  [x: string]: string;
@@ -185,6 +185,10 @@ export declare const actionToggleGridMode: {
185
185
  Bold: string;
186
186
  Regular: string;
187
187
  };
188
+ gridDirection: {
189
+ horizontal: boolean;
190
+ vertical: boolean;
191
+ };
188
192
  highlightSearchResult: boolean;
189
193
  dynamicStyle: {
190
194
  [x: string]: string;
@@ -183,6 +183,10 @@ export declare const actionToggleObjectsSnapMode: {
183
183
  Bold: string;
184
184
  Regular: string;
185
185
  };
186
+ gridDirection: {
187
+ horizontal: boolean;
188
+ vertical: boolean;
189
+ };
186
190
  highlightSearchResult: boolean;
187
191
  dynamicStyle: {
188
192
  [x: string]: string;
@@ -182,6 +182,10 @@ export declare const actionToggleSearchMenu: {
182
182
  Bold: string;
183
183
  Regular: string;
184
184
  };
185
+ gridDirection: {
186
+ horizontal: boolean;
187
+ vertical: boolean;
188
+ };
185
189
  highlightSearchResult: boolean;
186
190
  dynamicStyle: {
187
191
  [x: string]: string;
@@ -380,6 +384,10 @@ export declare const actionToggleSearchMenu: {
380
384
  Bold: string;
381
385
  Regular: string;
382
386
  };
387
+ gridDirection: {
388
+ horizontal: boolean;
389
+ vertical: boolean;
390
+ };
383
391
  highlightSearchResult: boolean;
384
392
  dynamicStyle: {
385
393
  [x: string]: string;
@@ -182,6 +182,10 @@ export declare const actionToggleStats: {
182
182
  Bold: string;
183
183
  Regular: string;
184
184
  };
185
+ gridDirection: {
186
+ horizontal: boolean;
187
+ vertical: boolean;
188
+ };
185
189
  highlightSearchResult: boolean;
186
190
  dynamicStyle: {
187
191
  [x: string]: string;
@@ -182,6 +182,10 @@ export declare const actionToggleViewMode: {
182
182
  Bold: string;
183
183
  Regular: string;
184
184
  };
185
+ gridDirection: {
186
+ horizontal: boolean;
187
+ vertical: boolean;
188
+ };
185
189
  highlightSearchResult: boolean;
186
190
  dynamicStyle: {
187
191
  [x: string]: string;
@@ -182,6 +182,10 @@ export declare const actionToggleZenMode: {
182
182
  Bold: string;
183
183
  Regular: string;
184
184
  };
185
+ gridDirection: {
186
+ horizontal: boolean;
187
+ vertical: boolean;
188
+ };
185
189
  highlightSearchResult: boolean;
186
190
  dynamicStyle: {
187
191
  [x: string]: string;
@@ -9,9 +9,9 @@ import Scene from "../scene/Scene";
9
9
  import { Fonts } from "../fonts";
10
10
  import { Renderer } from "../scene/Renderer";
11
11
  import { Emitter } from "../emitter";
12
- import { AnimatedTrail } from "../animated-trail";
13
12
  import { LaserTrails } from "../laser-trails";
14
13
  import { LassoTrail } from "../lasso";
14
+ import { EraserTrail } from "../eraser";
15
15
  import type { ExportedElements } from "../data";
16
16
  import type { FileSystemHandle } from "../data/filesystem";
17
17
  import type { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, Device, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType, OnUserFollowedPayload, GenerateDiagramToCode, NullableGridSize, Offsets } from "../types";
@@ -96,7 +96,7 @@ declare class App extends React.Component<AppProps, AppState> {
96
96
  allowMobileMode: boolean;
97
97
  animationFrameHandler: AnimationFrameHandler;
98
98
  laserTrails: LaserTrails;
99
- eraserTrail: AnimatedTrail;
99
+ eraserTrail: EraserTrail;
100
100
  lassoTrail: LassoTrail;
101
101
  onChangeEmitter: Emitter<[elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles]>;
102
102
  onPointerDownEmitter: Emitter<[activeTool: {
@@ -447,7 +447,7 @@ declare class App extends React.Component<AppProps, AppState> {
447
447
  private getTextElementAtPosition;
448
448
  private getElementAtPosition;
449
449
  private getElementsAtPosition;
450
- private getElementHitThreshold;
450
+ getElementHitThreshold(): number;
451
451
  private hitElement;
452
452
  private getTextBindableContainerAtPosition;
453
453
  private startTextEditing;
@@ -0,0 +1,14 @@
1
+ import { AnimatedTrail } from "../animated-trail";
2
+ import type { AnimationFrameHandler } from "../animation-frame-handler";
3
+ import type App from "../components/App";
4
+ export declare class EraserTrail extends AnimatedTrail {
5
+ private elementsToErase;
6
+ private groupsToErase;
7
+ private segmentsCache;
8
+ private geometricShapesCache;
9
+ constructor(animationFrameHandler: AnimationFrameHandler, app: App);
10
+ startPath(x: number, y: number): void;
11
+ addPointToPath(x: number, y: number, restore?: boolean): string[];
12
+ private updateElementsToBeErased;
13
+ endPath(): void;
14
+ }
@@ -1,6 +1,5 @@
1
- import type { GlobalPoint, LineSegment } from "@excalidraw/math/types";
1
+ import type { ElementsSegmentsMap, GlobalPoint } from "@excalidraw/math/types";
2
2
  import type { ExcalidrawElement } from "@excalidraw/element/types";
3
- export type ElementsSegmentsMap = Map<string, LineSegment<GlobalPoint>[]>;
4
3
  export declare const getLassoSelectedElementIds: (input: {
5
4
  lassoPath: GlobalPoint[];
6
5
  elements: readonly ExcalidrawElement[];
@@ -126,6 +126,7 @@ export type StaticCanvasAppState = Readonly<_CommonCanvasAppState & {
126
126
  frameRendering: AppState["frameRendering"];
127
127
  linkOpacity: AppState["linkOpacity"];
128
128
  gridColor: AppState["gridColor"];
129
+ gridDirection: AppState["gridDirection"];
129
130
  frameColor: AppState["frameColor"];
130
131
  currentHoveredFontFamily: AppState["currentHoveredFontFamily"];
131
132
  hoveredElementIds: AppState["hoveredElementIds"];
@@ -147,6 +148,7 @@ export type InteractiveCanvasAppState = Readonly<_CommonCanvasAppState & {
147
148
  zenModeEnabled: AppState["zenModeEnabled"];
148
149
  editingTextElement: AppState["editingTextElement"];
149
150
  gridColor: AppState["gridColor"];
151
+ gridDirection: AppState["gridDirection"];
150
152
  highlightSearchResult: AppState["highlightSearchResult"];
151
153
  isCropping: AppState["isCropping"];
152
154
  croppingElementId: AppState["croppingElementId"];
@@ -354,6 +356,10 @@ export interface AppState {
354
356
  Bold: string;
355
357
  Regular: string;
356
358
  };
359
+ gridDirection: {
360
+ horizontal: boolean;
361
+ vertical: boolean;
362
+ };
357
363
  highlightSearchResult: boolean;
358
364
  dynamicStyle: {
359
365
  [x: string]: string;
@@ -103,3 +103,4 @@ export type Ellipse<Point extends GlobalPoint | LocalPoint> = {
103
103
  } & {
104
104
  _brand: "excalimath_ellipse";
105
105
  };
106
+ export type ElementsSegmentsMap = Map<string, LineSegment<GlobalPoint>[]>;