@excalidraw/excalidraw 0.18.0-414182f → 0.18.0-4e0441e

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 (88) hide show
  1. package/dist/dev/{chunk-QF5FRM6O.js → chunk-LLUJPE5U.js} +48 -26
  2. package/dist/dev/chunk-LLUJPE5U.js.map +7 -0
  3. package/dist/dev/{chunk-WWDIUJ2Q.js → chunk-YMRX7R7U.js} +50 -51
  4. package/dist/dev/chunk-YMRX7R7U.js.map +7 -0
  5. package/dist/dev/data/{image-VTYIFRQE.js → image-L23D26XS.js} +2 -2
  6. package/dist/dev/index.css +989 -592
  7. package/dist/dev/index.css.map +3 -3
  8. package/dist/dev/index.js +4782 -2938
  9. package/dist/dev/index.js.map +4 -4
  10. package/dist/dev/locales/{en-SMAPCEOQ.js → en-YSPYSBUR.js} +4 -2
  11. package/dist/prod/chunk-HT4FKTIQ.js +4 -0
  12. package/dist/prod/chunk-RSFMSEP5.js +12 -0
  13. package/dist/prod/data/{image-YQ6UXXDA.js → image-NWF7UX55.js} +1 -1
  14. package/dist/prod/index.css +1 -1
  15. package/dist/prod/index.js +22 -22
  16. package/dist/prod/locales/en-SFRQHD7K.js +1 -0
  17. package/dist/types/common/src/constants.d.ts +11 -1
  18. package/dist/types/common/src/utils.d.ts +3 -1
  19. package/dist/types/element/src/renderElement.d.ts +4 -1
  20. package/dist/types/element/src/transformHandles.d.ts +1 -1
  21. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +21 -6
  22. package/dist/types/excalidraw/actions/actionBoundText.d.ts +14 -4
  23. package/dist/types/excalidraw/actions/actionCanvas.d.ts +92 -40
  24. package/dist/types/excalidraw/actions/actionClipboard.d.ts +42 -12
  25. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +7 -2
  26. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +21 -6
  27. package/dist/types/excalidraw/actions/actionElementLink.d.ts +7 -2
  28. package/dist/types/excalidraw/actions/actionElementLock.d.ts +14 -4
  29. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +7 -2
  30. package/dist/types/excalidraw/actions/actionExport.d.ts +63 -18
  31. package/dist/types/excalidraw/actions/actionFinalize.d.ts +14 -4
  32. package/dist/types/excalidraw/actions/actionFrame.d.ts +28 -8
  33. package/dist/types/excalidraw/actions/actionGroup.d.ts +14 -4
  34. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +8 -3
  35. package/dist/types/excalidraw/actions/actionLink.d.ts +6 -1
  36. package/dist/types/excalidraw/actions/actionMenu.d.ts +7 -368
  37. package/dist/types/excalidraw/actions/actionNavigate.d.ts +14 -4
  38. package/dist/types/excalidraw/actions/actionProperties.d.ts +122 -38
  39. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +7 -2
  40. package/dist/types/excalidraw/actions/actionStyles.d.ts +7 -2
  41. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +7 -2
  42. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +7 -2
  43. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +7 -2
  44. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +7 -2
  45. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +7 -2
  46. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +7 -2
  47. package/dist/types/excalidraw/actions/index.d.ts +2 -2
  48. package/dist/types/excalidraw/actions/types.d.ts +1 -1
  49. package/dist/types/excalidraw/appState.d.ts +5 -1
  50. package/dist/types/excalidraw/clipboard.d.ts +2 -0
  51. package/dist/types/excalidraw/components/Actions.d.ts +17 -3
  52. package/dist/types/excalidraw/components/App.d.ts +1 -2
  53. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +1 -0
  54. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -0
  55. package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +2 -1
  56. package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +2 -1
  57. package/dist/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -0
  58. package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +1 -1
  59. package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +2 -1
  60. package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +3 -1
  61. package/dist/types/excalidraw/components/InlineIcon.d.ts +3 -1
  62. package/dist/types/excalidraw/components/LayerUI.d.ts +2 -1
  63. package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +1 -1
  64. package/dist/types/excalidraw/components/MobileMenu.d.ts +3 -5
  65. package/dist/types/excalidraw/components/MobileToolBar.d.ts +11 -0
  66. package/dist/types/excalidraw/components/Popover.d.ts +2 -1
  67. package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -0
  68. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +1 -2
  69. package/dist/types/excalidraw/components/TextField.d.ts +1 -0
  70. package/dist/types/excalidraw/components/ToolPopover.d.ts +25 -0
  71. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +4 -2
  72. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +2 -1
  73. package/dist/types/excalidraw/components/icons.d.ts +5 -0
  74. package/dist/types/excalidraw/data/blob.d.ts +2 -2
  75. package/dist/types/excalidraw/data/types.d.ts +4 -1
  76. package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
  77. package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
  78. package/dist/types/excalidraw/shortcut.d.ts +1 -0
  79. package/dist/types/excalidraw/types.d.ts +10 -3
  80. package/dist/types/math/src/segment.d.ts +1 -0
  81. package/package.json +4 -4
  82. package/dist/dev/chunk-QF5FRM6O.js.map +0 -7
  83. package/dist/dev/chunk-WWDIUJ2Q.js.map +0 -7
  84. package/dist/prod/chunk-I4UNSFV6.js +0 -12
  85. package/dist/prod/chunk-VTWWEYSQ.js +0 -4
  86. package/dist/prod/locales/en-TYY6KWIJ.js +0 -1
  87. /package/dist/dev/data/{image-VTYIFRQE.js.map → image-L23D26XS.js.map} +0 -0
  88. /package/dist/dev/locales/{en-SMAPCEOQ.js.map → en-YSPYSBUR.js.map} +0 -0
@@ -0,0 +1 @@
1
+ import{A,B,C,D,E,F,G,H,I,J,K,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"../chunk-RSFMSEP5.js";import"../chunk-SRAX5OIU.js";export{f as alerts,e as buttons,l as canvasError,s as clearCanvasDialog,C as colorPicker,A as colors,I as commandPalette,v as confirmDialog,K as default,i as element,b as elementLink,x as encrypted,p as errorDialog,m as errorSplash,g as errors,q as exportDialog,G as fontList,j as headings,r as helpDialog,k as hints,w as imageExportDialog,J as keys,a as labels,c as library,E as mermaid,D as overwriteConfirm,t as publishDialog,u as publishSuccessDialog,F as quickSearch,o as roomDialog,d as search,n as shareDialog,y as stats,z as toast,h as toolBar,H as userList,B as welcomeScreen};
@@ -87,10 +87,12 @@ export declare const ENV: {
87
87
  PRODUCTION: string;
88
88
  };
89
89
  export declare const CLASSES: {
90
+ SIDEBAR: string;
90
91
  SHAPE_ACTIONS_MENU: string;
91
92
  ZOOM_ACTIONS: string;
92
93
  SEARCH_MENU_INPUT_WRAPPER: string;
93
94
  CONVERT_ELEMENT_TYPE_POPUP: string;
95
+ SHAPE_ACTIONS_THEME_SCOPE: string;
94
96
  };
95
97
  export declare const CJK_HAND_DRAWN_FALLBACK_FONT = "Xiaolai";
96
98
  export declare const WINDOWS_EMOJI_FALLBACK_FONT = "Segoe UI Emoji";
@@ -182,6 +184,7 @@ export declare const STRING_MIME_TYPES: {
182
184
  readonly json: "application/json";
183
185
  readonly excalidraw: "application/vnd.excalidraw+json";
184
186
  readonly excalidrawlib: "application/vnd.excalidrawlib+json";
187
+ readonly excalidrawlibIds: "application/vnd.excalidrawlib.ids+json";
185
188
  };
186
189
  export declare const MIME_TYPES: {
187
190
  readonly svg: "image/svg+xml";
@@ -201,6 +204,7 @@ export declare const MIME_TYPES: {
201
204
  readonly json: "application/json";
202
205
  readonly excalidraw: "application/vnd.excalidraw+json";
203
206
  readonly excalidrawlib: "application/vnd.excalidrawlib+json";
207
+ readonly excalidrawlibIds: "application/vnd.excalidrawlib.ids+json";
204
208
  };
205
209
  export declare const ALLOWED_PASTE_MIME_TYPES: readonly ["text/plain", "text/html", ...("image/svg+xml" | "image/png" | "image/jpeg" | "image/gif" | "image/webp" | "image/bmp" | "image/x-icon" | "image/avif" | "image/jfif")[]];
206
210
  export declare const EXPORT_IMAGE_TYPES: {
@@ -235,9 +239,12 @@ export declare const URL_HASH_KEYS: {
235
239
  readonly addLibrary: "addLibrary";
236
240
  };
237
241
  export declare const DEFAULT_UI_OPTIONS: AppProps["UIOptions"];
238
- export declare const MQ_MAX_WIDTH_PORTRAIT = 730;
242
+ export declare const MQ_MAX_MOBILE = 599;
239
243
  export declare const MQ_MAX_WIDTH_LANDSCAPE = 1000;
240
244
  export declare const MQ_MAX_HEIGHT_LANDSCAPE = 500;
245
+ export declare const MQ_MIN_TABLET: number;
246
+ export declare const MQ_MAX_TABLET = 1400;
247
+ export declare const MQ_MIN_WIDTH_DESKTOP = 1440;
241
248
  export declare const MQ_RIGHT_SIDEBAR_MIN_WIDTH = 1229;
242
249
  export declare const MAX_DECIMALS_FOR_SVG_EXPORT = 2;
243
250
  export declare const EXPORT_SCALES: number[];
@@ -351,3 +358,6 @@ export declare enum UserIdleState {
351
358
  */
352
359
  export declare const LINE_POLYGON_POINT_MERGE_DISTANCE = 20;
353
360
  export declare const DOUBLE_TAP_POSITION_THRESHOLD = 35;
361
+ export declare const MOBILE_ACTION_BUTTON_BG: {
362
+ readonly background: "var(--mobile-action-button-bg)";
363
+ };
@@ -17,6 +17,8 @@ export declare const getFontString: ({ fontSize, fontFamily, }: {
17
17
  fontSize: number;
18
18
  fontFamily: FontFamilyValues;
19
19
  }) => FontString;
20
+ /** executes callback in the frame that's after the current one */
21
+ export declare const nextAnimationFrame: (cb: () => any) => Promise<void>;
20
22
  export declare const debounce: <T extends any[]>(fn: (...args: T) => void, timeout: number) => {
21
23
  (...args: T): void;
22
24
  flush(): void;
@@ -94,7 +96,6 @@ export declare const updateActiveTool: (appState: Pick<AppState, "activeTool">,
94
96
  export declare const isFullScreen: () => boolean;
95
97
  export declare const allowFullScreen: () => Promise<void>;
96
98
  export declare const exitFullScreen: () => Promise<void>;
97
- export declare const getShortcutKey: (shortcut: string) => string;
98
99
  export declare const viewportCoordsToSceneCoords: ({ clientX, clientY }: {
99
100
  clientX: number;
100
101
  clientY: number;
@@ -264,4 +265,5 @@ export declare const castArray: <T>(value: T | T[]) => T[];
264
265
  export declare const isReadonlyArray: (value?: any) => value is readonly any[];
265
266
  export declare const sizeOf: (value: readonly unknown[] | Readonly<Map<string, unknown>> | Readonly<Record<string, unknown>> | ReadonlySet<unknown>) => number;
266
267
  export declare const reduceToCommonValue: <T, R = T>(collection: ReadonlySet<T> | readonly T[], getValue?: ((item: T) => R) | undefined) => R | null;
268
+ export declare const isMobileOrTablet: () => boolean;
267
269
  export {};
@@ -1,6 +1,7 @@
1
+ import { type GlobalPoint } from "@excalidraw/math";
1
2
  import type { AppState, StaticCanvasAppState, InteractiveCanvasAppState, ElementsPendingErasure, PendingExcalidrawElements } from "@excalidraw/excalidraw/types";
2
3
  import type { StaticCanvasRenderConfig, RenderableElementsMap, InteractiveCanvasRenderConfig } from "@excalidraw/excalidraw/scene/types";
3
- import type { ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawImageElement, ExcalidrawFrameLikeElement, NonDeletedSceneElementsMap } from "./types";
4
+ import type { ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawImageElement, ExcalidrawFrameLikeElement, NonDeletedSceneElementsMap, ElementsMap } from "./types";
4
5
  import type { RoughCanvas } from "roughjs/bin/canvas";
5
6
  export declare const IMAGE_INVERT_FILTER = "invert(100%) hue-rotate(180deg) saturate(1.25)";
6
7
  export declare const getRenderOpacity: (element: ExcalidrawElement, containingFrame: ExcalidrawFrameLikeElement | null, elementsPendingErasure: ElementsPendingErasure, pendingNodes: Readonly<PendingExcalidrawElements> | null, globalAlpha?: number) => number;
@@ -26,3 +27,5 @@ export declare const pathsCache: WeakMap<ExcalidrawFreeDrawElement, Path2D>;
26
27
  export declare function generateFreeDrawShape(element: ExcalidrawFreeDrawElement): Path2D;
27
28
  export declare function getFreeDrawPath2D(element: ExcalidrawFreeDrawElement): Path2D | undefined;
28
29
  export declare function getFreeDrawSvgPath(element: ExcalidrawFreeDrawElement): string;
30
+ export declare function getFreedrawOutlineAsSegments(element: ExcalidrawFreeDrawElement, points: [number, number][], elementsMap: ElementsMap): import("@excalidraw/math").LineSegment<GlobalPoint>[];
31
+ export declare function getFreedrawOutlinePoints(element: ExcalidrawFreeDrawElement): [number, number][];
@@ -52,4 +52,4 @@ export declare const getTransformHandles: (element: ExcalidrawElement, zoom: Zoo
52
52
  se?: boolean | undefined;
53
53
  rotation?: boolean | undefined;
54
54
  }) => TransformHandles;
55
- export declare const shouldShowBoundingBox: (elements: readonly NonDeletedExcalidrawElement[], appState: InteractiveCanvasAppState) => boolean;
55
+ export declare const hasBoundingBox: (elements: readonly NonDeletedExcalidrawElement[], appState: InteractiveCanvasAppState) => boolean;
@@ -44,6 +44,10 @@ export declare const actionAddToLibrary: {
44
44
  locked: boolean;
45
45
  fromSelection: boolean;
46
46
  } & import("../types").ActiveTool;
47
+ preferredSelectionTool: {
48
+ type: "selection" | "lasso";
49
+ initialized: boolean;
50
+ };
47
51
  penMode: boolean;
48
52
  penDetected: boolean;
49
53
  exportBackground: boolean;
@@ -76,8 +80,8 @@ export declare const actionAddToLibrary: {
76
80
  zoom: Readonly<{
77
81
  value: import("../types").NormalizedZoomValue;
78
82
  }>;
79
- openMenu: "canvas" | "shape" | null;
80
- openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
83
+ openMenu: "canvas" | null;
84
+ openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
81
85
  openSidebar: {
82
86
  name: string;
83
87
  tab?: string | undefined;
@@ -173,6 +177,7 @@ export declare const actionAddToLibrary: {
173
177
  lockedMultiSelections: {
174
178
  [groupId: string]: true;
175
179
  };
180
+ stylesPanelMode: "compact" | "full" | "mobile";
176
181
  };
177
182
  } | {
178
183
  captureUpdate: "EVENTUALLY";
@@ -211,6 +216,10 @@ export declare const actionAddToLibrary: {
211
216
  locked: boolean;
212
217
  fromSelection: boolean;
213
218
  } & import("../types").ActiveTool;
219
+ preferredSelectionTool: {
220
+ type: "selection" | "lasso";
221
+ initialized: boolean;
222
+ };
214
223
  penMode: boolean;
215
224
  penDetected: boolean;
216
225
  exportBackground: boolean;
@@ -243,8 +252,8 @@ export declare const actionAddToLibrary: {
243
252
  zoom: Readonly<{
244
253
  value: import("../types").NormalizedZoomValue;
245
254
  }>;
246
- openMenu: "canvas" | "shape" | null;
247
- openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
255
+ openMenu: "canvas" | null;
256
+ openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
248
257
  openSidebar: {
249
258
  name: string;
250
259
  tab?: string | undefined;
@@ -345,6 +354,7 @@ export declare const actionAddToLibrary: {
345
354
  lockedMultiSelections: {
346
355
  [groupId: string]: true;
347
356
  };
357
+ stylesPanelMode: "compact" | "full" | "mobile";
348
358
  };
349
359
  }> | {
350
360
  captureUpdate: "EVENTUALLY";
@@ -383,6 +393,10 @@ export declare const actionAddToLibrary: {
383
393
  locked: boolean;
384
394
  fromSelection: boolean;
385
395
  } & import("../types").ActiveTool;
396
+ preferredSelectionTool: {
397
+ type: "selection" | "lasso";
398
+ initialized: boolean;
399
+ };
386
400
  penMode: boolean;
387
401
  penDetected: boolean;
388
402
  exportBackground: boolean;
@@ -415,8 +429,8 @@ export declare const actionAddToLibrary: {
415
429
  zoom: Readonly<{
416
430
  value: import("../types").NormalizedZoomValue;
417
431
  }>;
418
- openMenu: "canvas" | "shape" | null;
419
- openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
432
+ openMenu: "canvas" | null;
433
+ openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
420
434
  openSidebar: {
421
435
  name: string;
422
436
  tab?: string | undefined;
@@ -517,6 +531,7 @@ export declare const actionAddToLibrary: {
517
531
  lockedMultiSelections: {
518
532
  [groupId: string]: true;
519
533
  };
534
+ stylesPanelMode: "compact" | "full" | "mobile";
520
535
  };
521
536
  };
522
537
  label: string;
@@ -64,6 +64,10 @@ export declare const actionBindText: {
64
64
  locked: boolean;
65
65
  fromSelection: boolean;
66
66
  } & import("../types").ActiveTool;
67
+ preferredSelectionTool: {
68
+ type: "selection" | "lasso";
69
+ initialized: boolean;
70
+ };
67
71
  penMode: boolean;
68
72
  penDetected: boolean;
69
73
  exportBackground: boolean;
@@ -96,8 +100,8 @@ export declare const actionBindText: {
96
100
  zoom: Readonly<{
97
101
  value: import("../types").NormalizedZoomValue;
98
102
  }>;
99
- openMenu: "canvas" | "shape" | null;
100
- openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
103
+ openMenu: "canvas" | null;
104
+ openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
101
105
  openSidebar: {
102
106
  name: string;
103
107
  tab?: string | undefined;
@@ -195,6 +199,7 @@ export declare const actionBindText: {
195
199
  lockedMultiSelections: {
196
200
  [groupId: string]: true;
197
201
  };
202
+ stylesPanelMode: "compact" | "full" | "mobile";
198
203
  };
199
204
  captureUpdate: "IMMEDIATELY";
200
205
  };
@@ -248,6 +253,10 @@ export declare const actionWrapTextInContainer: {
248
253
  locked: boolean;
249
254
  fromSelection: boolean;
250
255
  } & import("../types").ActiveTool;
256
+ preferredSelectionTool: {
257
+ type: "selection" | "lasso";
258
+ initialized: boolean;
259
+ };
251
260
  penMode: boolean;
252
261
  penDetected: boolean;
253
262
  exportBackground: boolean;
@@ -280,8 +289,8 @@ export declare const actionWrapTextInContainer: {
280
289
  zoom: Readonly<{
281
290
  value: import("../types").NormalizedZoomValue;
282
291
  }>;
283
- openMenu: "canvas" | "shape" | null;
284
- openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
292
+ openMenu: "canvas" | null;
293
+ openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
285
294
  openSidebar: {
286
295
  name: string;
287
296
  tab?: string | undefined;
@@ -379,6 +388,7 @@ export declare const actionWrapTextInContainer: {
379
388
  lockedMultiSelections: {
380
389
  [groupId: string]: true;
381
390
  };
391
+ stylesPanelMode: "compact" | "full" | "mobile";
382
392
  };
383
393
  captureUpdate: "IMMEDIATELY";
384
394
  };