@zsviczian/excalidraw 0.18.0-6 → 0.18.0-8

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 (39) hide show
  1. package/dist/excalidraw.development.js +25 -25
  2. package/dist/excalidraw.production.min.js +1 -1
  3. package/package.json +1 -1
  4. package/types/common/src/utils.d.ts +3 -0
  5. package/types/element/src/binding.d.ts +1 -2
  6. package/types/element/src/bounds.d.ts +2 -2
  7. package/types/element/src/duplicate.d.ts +10 -13
  8. package/types/element/src/frame.d.ts +1 -1
  9. package/types/element/src/selection.d.ts +11 -0
  10. package/types/excalidraw/actions/actionAddToLibrary.d.ts +12 -0
  11. package/types/excalidraw/actions/actionBoundText.d.ts +8 -0
  12. package/types/excalidraw/actions/actionCanvas.d.ts +60 -0
  13. package/types/excalidraw/actions/actionClipboard.d.ts +24 -0
  14. package/types/excalidraw/actions/actionCropEditor.d.ts +4 -0
  15. package/types/excalidraw/actions/actionDeleteSelected.d.ts +12 -0
  16. package/types/excalidraw/actions/actionElementLink.d.ts +4 -0
  17. package/types/excalidraw/actions/actionElementLock.d.ts +8 -0
  18. package/types/excalidraw/actions/actionEmbeddable.d.ts +4 -0
  19. package/types/excalidraw/actions/actionExport.d.ts +36 -0
  20. package/types/excalidraw/actions/actionFinalize.d.ts +8 -0
  21. package/types/excalidraw/actions/actionFrame.d.ts +16 -0
  22. package/types/excalidraw/actions/actionGroup.d.ts +8 -0
  23. package/types/excalidraw/actions/actionLinearEditor.d.ts +4 -0
  24. package/types/excalidraw/actions/actionLink.d.ts +4 -0
  25. package/types/excalidraw/actions/actionMenu.d.ts +12 -0
  26. package/types/excalidraw/actions/actionNavigate.d.ts +8 -0
  27. package/types/excalidraw/actions/actionProperties.d.ts +60 -0
  28. package/types/excalidraw/actions/actionSelectAll.d.ts +4 -0
  29. package/types/excalidraw/actions/actionStyles.d.ts +4 -0
  30. package/types/excalidraw/actions/actionToggleGridMode.d.ts +4 -0
  31. package/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +4 -0
  32. package/types/excalidraw/actions/actionToggleSearchMenu.d.ts +8 -0
  33. package/types/excalidraw/actions/actionToggleStats.d.ts +4 -0
  34. package/types/excalidraw/actions/actionToggleViewMode.d.ts +4 -0
  35. package/types/excalidraw/actions/actionToggleZenMode.d.ts +4 -0
  36. package/types/excalidraw/components/App.d.ts +8 -8
  37. package/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +1 -0
  38. package/types/excalidraw/scene/scrollbars.d.ts +2 -3
  39. package/types/excalidraw/types.d.ts +11 -0
@@ -184,6 +184,10 @@ export declare const actionToggleLinearEditor: {
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;
@@ -178,6 +178,10 @@ export declare const actionLink: {
178
178
  Bold: string;
179
179
  Regular: string;
180
180
  };
181
+ gridDirection: {
182
+ horizontal: boolean;
183
+ vertical: boolean;
184
+ };
181
185
  highlightSearchResult: boolean;
182
186
  dynamicStyle: {
183
187
  [x: string]: string;
@@ -179,6 +179,10 @@ export declare const actionToggleCanvasMenu: {
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;
@@ -398,6 +402,10 @@ export declare const actionToggleEditMenu: {
398
402
  Bold: string;
399
403
  Regular: string;
400
404
  };
405
+ gridDirection: {
406
+ horizontal: boolean;
407
+ vertical: boolean;
408
+ };
401
409
  highlightSearchResult: boolean;
402
410
  dynamicStyle: {
403
411
  [x: string]: string;
@@ -612,6 +620,10 @@ export declare const actionShortcuts: {
612
620
  Bold: string;
613
621
  Regular: string;
614
622
  };
623
+ gridDirection: {
624
+ horizontal: boolean;
625
+ vertical: boolean;
626
+ };
615
627
  highlightSearchResult: boolean;
616
628
  dynamicStyle: {
617
629
  [x: string]: string;
@@ -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;
@@ -138,10 +138,6 @@ declare class App extends React.Component<AppProps, AppState> {
138
138
  hit: {
139
139
  element: NonDeleted<ExcalidrawElement> | null;
140
140
  allHitElements: NonDeleted<ExcalidrawElement>[];
141
- /**
142
- * Returns gridSize taking into account `gridModeEnabled`.
143
- * If disabled, returns null.
144
- */
145
141
  wasAddedToSelection: boolean;
146
142
  hasBeenDuplicated: boolean;
147
143
  hasHitCommonBoundingBoxOfSelectedElements: boolean;
@@ -153,6 +149,10 @@ declare class App extends React.Component<AppProps, AppState> {
153
149
  x: number;
154
150
  y: number;
155
151
  } | null;
152
+ origin: {
153
+ x: number;
154
+ y: number;
155
+ };
156
156
  };
157
157
  eventListeners: {
158
158
  onMove: {
@@ -207,10 +207,6 @@ declare class App extends React.Component<AppProps, AppState> {
207
207
  hit: {
208
208
  element: NonDeleted<ExcalidrawElement> | null;
209
209
  allHitElements: NonDeleted<ExcalidrawElement>[];
210
- /**
211
- * Returns gridSize taking into account `gridModeEnabled`.
212
- * If disabled, returns null.
213
- */
214
210
  wasAddedToSelection: boolean;
215
211
  hasBeenDuplicated: boolean;
216
212
  hasHitCommonBoundingBoxOfSelectedElements: boolean;
@@ -222,6 +218,10 @@ declare class App extends React.Component<AppProps, AppState> {
222
218
  x: number;
223
219
  y: number;
224
220
  } | null;
221
+ origin: {
222
+ x: number;
223
+ y: number;
224
+ };
225
225
  };
226
226
  eventListeners: {
227
227
  onMove: {
@@ -14,6 +14,7 @@ type InteractiveCanvasProps = {
14
14
  selectionNonce: number | undefined;
15
15
  scale: number;
16
16
  appState: InteractiveCanvasAppState;
17
+ renderScrollbars: boolean;
17
18
  device: Device;
18
19
  renderInteractiveSceneCallback: (data: RenderInteractiveSceneCallback) => void;
19
20
  handleCanvasRef: (canvas: HTMLCanvasElement | null) => void;
@@ -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(128,128,128,0.3)";
7
- export declare const getScrollBars: (elements: readonly ExcalidrawElement[], viewportWidth: number, viewportHeight: number, appState: InteractiveCanvasAppState) => ScrollBars;
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;
@@ -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;
@@ -512,6 +518,7 @@ export interface ExcalidrawProps {
512
518
  aiEnabled?: boolean;
513
519
  showDeprecatedFonts?: boolean;
514
520
  insertLinkAction?: (linkVal: string) => void;
521
+ renderScrollbars?: boolean;
515
522
  }
516
523
  export type SceneData = {
517
524
  elements?: ImportedDataState["elements"];
@@ -641,6 +648,10 @@ export type PointerDownState = Readonly<{
641
648
  x: number;
642
649
  y: number;
643
650
  } | null;
651
+ origin: {
652
+ x: number;
653
+ y: number;
654
+ };
644
655
  };
645
656
  eventListeners: {
646
657
  onMove: null | ReturnType<typeof throttleRAF>;