@excalidraw/common 0.18.0-2874f9e → 0.18.0-2a82821

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 (143) hide show
  1. package/dist/dev/index.js +173 -25
  2. package/dist/dev/index.js.map +3 -3
  3. package/dist/prod/index.js +3 -3
  4. package/dist/types/common/src/appEventBus.d.ts +27 -0
  5. package/dist/types/common/src/colors.d.ts +14 -14
  6. package/dist/types/common/src/constants.d.ts +9 -7
  7. package/dist/types/common/src/index.d.ts +2 -0
  8. package/dist/types/common/src/utils.d.ts +1 -3
  9. package/dist/types/common/src/versionedSnapshotStore.d.ts +17 -0
  10. package/dist/types/element/src/Scene.d.ts +7 -3
  11. package/dist/types/element/src/arrowheads.d.ts +3 -0
  12. package/dist/types/element/src/binding.d.ts +3 -4
  13. package/dist/types/element/src/bounds.d.ts +22 -3
  14. package/dist/types/element/src/comparisons.d.ts +1 -0
  15. package/dist/types/element/src/duplicate.d.ts +1 -0
  16. package/dist/types/element/src/elbowArrow.d.ts +2 -0
  17. package/dist/types/element/src/frame.d.ts +7 -6
  18. package/dist/types/element/src/index.d.ts +1 -0
  19. package/dist/types/element/src/linearElementEditor.d.ts +5 -2
  20. package/dist/types/element/src/mutateElement.d.ts +2 -0
  21. package/dist/types/element/src/newElement.d.ts +1 -0
  22. package/dist/types/element/src/selection.d.ts +8 -4
  23. package/dist/types/element/src/shape.d.ts +1 -1
  24. package/dist/types/element/src/textElement.d.ts +1 -1
  25. package/dist/types/element/src/textWrapping.d.ts +26 -0
  26. package/dist/types/element/src/typeChecks.d.ts +1 -0
  27. package/dist/types/element/src/types.d.ts +11 -2
  28. package/dist/types/element/src/utils.d.ts +2 -2
  29. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +35 -38
  30. package/dist/types/excalidraw/actions/actionBoundText.d.ts +25 -27
  31. package/dist/types/excalidraw/actions/actionCanvas.d.ts +207 -219
  32. package/dist/types/excalidraw/actions/actionClipboard.d.ts +24 -26
  33. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +12 -13
  34. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +37 -40
  35. package/dist/types/excalidraw/actions/actionDeselect.d.ts +160 -0
  36. package/dist/types/excalidraw/actions/actionElementLink.d.ts +8 -13
  37. package/dist/types/excalidraw/actions/actionElementLock.d.ts +24 -26
  38. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +12 -13
  39. package/dist/types/excalidraw/actions/actionExport.d.ts +112 -394
  40. package/dist/types/excalidraw/actions/actionFrame.d.ts +49 -52
  41. package/dist/types/excalidraw/actions/actionGroup.d.ts +27 -29
  42. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +13 -13
  43. package/dist/types/excalidraw/actions/actionLink.d.ts +12 -13
  44. package/dist/types/excalidraw/actions/actionMenu.d.ts +8 -13
  45. package/dist/types/excalidraw/actions/actionProperties.d.ts +37 -30
  46. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +13 -14
  47. package/dist/types/excalidraw/actions/actionStyles.d.ts +12 -12
  48. package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +3 -3
  49. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +173 -0
  50. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +12 -13
  51. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +173 -0
  52. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +12 -13
  53. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +8 -13
  54. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +12 -13
  55. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +12 -13
  56. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +12 -13
  57. package/dist/types/excalidraw/actions/index.d.ts +4 -1
  58. package/dist/types/excalidraw/actions/types.d.ts +1 -1
  59. package/dist/types/excalidraw/{animated-trail.d.ts → animatedTrail.d.ts} +4 -3
  60. package/dist/types/excalidraw/appState.d.ts +32 -28
  61. package/dist/types/excalidraw/charts/charts.bar.d.ts +2 -0
  62. package/dist/types/excalidraw/charts/charts.constants.d.ts +48 -0
  63. package/dist/types/excalidraw/charts/charts.helpers.d.ts +32 -0
  64. package/dist/types/excalidraw/charts/charts.line.d.ts +2 -0
  65. package/dist/types/excalidraw/charts/charts.parse.d.ts +10 -0
  66. package/dist/types/excalidraw/charts/charts.radar.d.ts +2 -0
  67. package/dist/types/excalidraw/charts/charts.types.d.ts +18 -0
  68. package/dist/types/excalidraw/charts/index.d.ts +7 -0
  69. package/dist/types/excalidraw/clipboard.d.ts +4 -7
  70. package/dist/types/excalidraw/components/ActiveConfirmDialog.d.ts +1 -1
  71. package/dist/types/excalidraw/components/App.d.ts +54 -14
  72. package/dist/types/excalidraw/components/AppStateObserver.d.ts +37 -0
  73. package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
  74. package/dist/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +1 -2
  75. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +1 -1
  76. package/dist/types/excalidraw/components/EyeDropper.d.ts +1 -1
  77. package/dist/types/excalidraw/components/IconPicker.d.ts +14 -9
  78. package/dist/types/excalidraw/components/LibraryMenu.d.ts +1 -1
  79. package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +1 -1
  80. package/dist/types/excalidraw/components/PasteChartDialog.d.ts +4 -5
  81. package/dist/types/excalidraw/components/Range.d.ts +10 -4
  82. package/dist/types/excalidraw/components/SVGLayer.d.ts +1 -1
  83. package/dist/types/excalidraw/components/SearchMenu.d.ts +1 -1
  84. package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +1 -1
  85. package/dist/types/excalidraw/components/TTDDialog/CodeMirrorEditor.d.ts +11 -0
  86. package/dist/types/excalidraw/components/TTDDialog/TTDContext.d.ts +4 -4
  87. package/dist/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +3 -3
  88. package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +4 -1
  89. package/dist/types/excalidraw/components/TTDDialog/mermaid-lang-lite.d.ts +2 -0
  90. package/dist/types/excalidraw/components/TTDDialog/useTTDChatStorage.d.ts +3 -3
  91. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidAutoFix.d.ts +1 -0
  92. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidError.d.ts +10 -0
  93. package/dist/types/excalidraw/components/Toast.d.ts +8 -4
  94. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +2 -1
  95. package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +1 -0
  96. package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +1 -1
  97. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +2 -1
  98. package/dist/types/excalidraw/components/icons.d.ts +19 -8
  99. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +9 -3
  100. package/dist/types/excalidraw/components/shapes.d.ts +7 -0
  101. package/dist/types/excalidraw/data/blob.d.ts +163 -166
  102. package/dist/types/excalidraw/data/filesystem.d.ts +3 -5
  103. package/dist/types/excalidraw/data/index.d.ts +2 -3
  104. package/dist/types/excalidraw/data/json.d.ts +92 -85
  105. package/dist/types/excalidraw/data/library.d.ts +1 -1
  106. package/dist/types/excalidraw/data/resave.d.ts +7 -2
  107. package/dist/types/excalidraw/eraser/index.d.ts +2 -3
  108. package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
  109. package/dist/types/excalidraw/{laser-trails.d.ts → laserTrails.d.ts} +5 -7
  110. package/dist/types/excalidraw/lasso/index.d.ts +2 -3
  111. package/dist/types/excalidraw/renderer/animation.d.ts +4 -1
  112. package/dist/types/excalidraw/scene/Renderer.d.ts +426 -19
  113. package/dist/types/excalidraw/scene/index.d.ts +1 -1
  114. package/dist/types/excalidraw/textAutoResizeHandle.d.ts +15 -0
  115. package/dist/types/excalidraw/types.d.ts +110 -18
  116. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +5 -1
  117. package/dist/types/fractional-indexing/src/index.d.ts +29 -0
  118. package/dist/types/laser-pointer/src/index.d.ts +2 -0
  119. package/dist/types/laser-pointer/src/math.d.ts +16 -0
  120. package/dist/types/laser-pointer/src/simplify.d.ts +2 -0
  121. package/dist/types/laser-pointer/src/state.d.ts +35 -0
  122. package/dist/types/math/src/constants.d.ts +0 -1
  123. package/dist/types/math/src/curve.d.ts +4 -1
  124. package/dist/types/math/src/point.d.ts +2 -1
  125. package/dist/types/utils/src/index.d.ts +1 -2
  126. package/package.json +1 -1
  127. package/dist/types/excalidraw/animation-frame-handler.d.ts +0 -16
  128. package/dist/types/excalidraw/charts.d.ts +0 -27
  129. package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -4
  130. package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +0 -15
  131. package/dist/types/excalidraw/components/InitializeApp.d.ts +0 -10
  132. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +0 -8
  133. package/dist/types/excalidraw/components/TTDDialog/utils/TTDStreamFetch.d.ts +0 -24
  134. package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +0 -8
  135. package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -11
  136. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -58
  137. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -19
  138. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +0 -84
  139. package/dist/types/excalidraw/data/reconcile.d.ts +0 -7
  140. package/dist/types/excalidraw/index.d.ts +0 -47
  141. package/dist/types/excalidraw/polyfill.d.ts +0 -2
  142. package/dist/types/utils/src/bbox.d.ts +0 -9
  143. package/dist/types/utils/src/withinBounds.d.ts +0 -19
@@ -2,12 +2,11 @@ import { IMAGE_MIME_TYPES, MIME_TYPES } from "@excalidraw/common";
2
2
  import type { ValueOf } from "@excalidraw/common/utility-types";
3
3
  import type { ExcalidrawElement, FileId } from "@excalidraw/element/types";
4
4
  import type { AppState, DataURL, LibraryItem } from "../types";
5
- import type { FileSystemHandle } from "browser-fs-access";
6
5
  import type { ImportedLibraryData } from "./types";
7
6
  export declare const getMimeType: (blob: Blob | string) => string;
8
- export declare const getFileHandleType: (handle: FileSystemHandle | null) => string | null;
7
+ export declare const getFileHandleType: (handle: FileSystemFileHandle | null) => string | null;
9
8
  export declare const isImageFileHandleType: (type: string | null) => type is "png" | "svg";
10
- export declare const isImageFileHandle: (handle: FileSystemHandle | null) => boolean;
9
+ export declare const isImageFileHandle: (handle: FileSystemFileHandle | null) => handle is FileSystemFileHandle;
11
10
  export declare const isSupportedImageFileType: (type: string | null | undefined) => boolean;
12
11
  export declare const isSupportedImageFile: (blob: Blob | null | undefined) => blob is Blob & {
13
12
  type: ValueOf<typeof IMAGE_MIME_TYPES>;
@@ -15,96 +14,59 @@ export declare const isSupportedImageFile: (blob: Blob | null | undefined) => bl
15
14
  export declare const loadSceneOrLibraryFromBlob: (blob: Blob | File,
16
15
  /** @see restore.localAppState */
17
16
  localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null,
18
- /** FileSystemHandle. Defaults to `blob.handle` if defined, otherwise null. */
19
- fileHandle?: FileSystemHandle | null) => Promise<{
17
+ /** FileSystemFileHandle. Defaults to `blob.handle` if defined, otherwise null. */
18
+ fileHandle?: FileSystemFileHandle | null) => Promise<{
20
19
  type: "application/vnd.excalidraw+json";
21
20
  data: {
22
21
  elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
23
22
  appState: {
24
- viewBackgroundColor: string;
23
+ viewModeEnabled: boolean;
24
+ zenModeEnabled: boolean;
25
+ gridModeEnabled: boolean;
26
+ objectsSnapModeEnabled: boolean;
25
27
  theme: import("@excalidraw/element/types").Theme;
26
- frameRendering: {
27
- enabled: boolean;
28
- name: boolean;
29
- outline: boolean;
30
- clip: boolean;
31
- };
32
28
  name: string | null;
33
- zoom: import("../types").Zoom;
34
- scrollX: number;
35
- scrollY: number;
36
- viewModeEnabled: boolean;
37
- openDialog: null | {
38
- name: "imageExport" | "help" | "jsonExport";
39
- } | {
40
- name: "ttd";
41
- tab: "text-to-diagram" | "mermaid";
42
- } | {
43
- name: "commandPalette";
44
- } | {
45
- name: "settings";
46
- } | {
47
- name: "elementLinkSelector";
48
- sourceElementId: ExcalidrawElement["id"];
49
- };
50
- editingGroupId: import("@excalidraw/element/types").GroupId | null;
51
- selectedElementIds: Readonly<{
52
- [id: string]: true;
53
- }>;
54
- frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
29
+ currentItemArrowType: "sharp" | "round" | "elbow";
30
+ gridSize: number;
55
31
  activeTool: {
56
32
  lastActiveTool: import("../types").ActiveTool | null;
57
33
  locked: boolean;
58
34
  fromSelection: boolean;
59
35
  } & import("../types").ActiveTool;
36
+ contextMenu: {
37
+ items: import("../components/ContextMenu").ContextMenuItems;
38
+ top: number;
39
+ left: number;
40
+ } | null;
41
+ showWelcomeScreen: boolean;
42
+ isLoading: boolean;
43
+ errorMessage: React.ReactNode;
60
44
  activeEmbeddable: {
61
45
  element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
62
46
  state: "hover" | "active";
63
47
  } | null;
64
- selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
65
- selectedGroupIds: {
66
- [groupId: string]: boolean;
67
- };
68
- selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
69
- multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
70
48
  newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
49
+ resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
50
+ multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
51
+ selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
71
52
  isBindingEnabled: boolean;
53
+ boxSelectionMode: import("../types").BoxSelectionMode;
54
+ bindingPreference: "enabled" | "disabled";
55
+ isMidpointSnappingEnabled: boolean;
72
56
  suggestedBinding: {
73
57
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
74
58
  midPoint?: import("@excalidraw/math").GlobalPoint;
75
59
  } | null;
76
- isRotating: boolean;
77
- elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
78
- collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
79
- snapLines: readonly import("../snapping").SnapLine[];
80
- zenModeEnabled: boolean;
81
- editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
82
- isCropping: boolean;
83
- croppingElementId: ExcalidrawElement["id"] | null;
84
- searchMatches: Readonly<{
85
- focusedId: ExcalidrawElement["id"] | null;
86
- matches: readonly import("../types").SearchMatch[];
87
- }> | null;
88
- activeLockedId: string | null;
89
- hoveredElementIds: Readonly<{
90
- [id: string]: true;
91
- }>;
92
- shouldCacheIgnoreZoom: boolean;
93
- exportScale: number;
94
- currentItemArrowType: "sharp" | "round" | "elbow";
95
- bindMode: import("@excalidraw/element/types").BindMode;
96
- gridSize: number;
97
- contextMenu: {
98
- items: import("../components/ContextMenu").ContextMenuItems;
99
- top: number;
100
- left: number;
101
- } | null;
102
- showWelcomeScreen: boolean;
103
- isLoading: boolean;
104
- errorMessage: React.ReactNode;
105
- resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
106
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
60
+ frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
61
+ frameRendering: {
62
+ enabled: boolean;
63
+ name: boolean;
64
+ outline: boolean;
65
+ clip: boolean;
66
+ };
107
67
  editingFrame: string | null;
68
+ elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
69
+ editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
108
70
  preferredSelectionTool: {
109
71
  type: "selection" | "lasso";
110
72
  initialized: boolean;
@@ -114,12 +76,14 @@ fileHandle?: FileSystemHandle | null) => Promise<{
114
76
  exportBackground: boolean;
115
77
  exportEmbedScene: boolean;
116
78
  exportWithDarkMode: boolean;
79
+ exportScale: number;
117
80
  currentItemStrokeColor: string;
118
81
  currentItemBackgroundColor: string;
119
82
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
120
- currentItemStrokeWidth: number;
83
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
121
84
  currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
122
85
  currentItemRoughness: number;
86
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
123
87
  currentItemOpacity: number;
124
88
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
125
89
  currentItemFontSize: number;
@@ -128,52 +92,86 @@ fileHandle?: FileSystemHandle | null) => Promise<{
128
92
  currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
129
93
  currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
130
94
  currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
95
+ viewBackgroundColor: string;
96
+ scrollX: number;
97
+ scrollY: number;
131
98
  cursorButton: "up" | "down";
132
99
  scrolledOutside: boolean;
133
100
  isResizing: boolean;
101
+ isRotating: boolean;
102
+ zoom: import("../types").Zoom;
134
103
  openMenu: "canvas" | null;
135
104
  openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
136
105
  openSidebar: {
137
106
  name: import("../types").SidebarName;
138
107
  tab?: import("../types").SidebarTabName;
139
108
  } | null;
109
+ openDialog: null | {
110
+ name: "imageExport" | "help" | "jsonExport";
111
+ } | {
112
+ name: "ttd";
113
+ tab: "text-to-diagram" | "mermaid";
114
+ } | {
115
+ name: "commandPalette";
116
+ } | {
117
+ name: "settings";
118
+ } | {
119
+ name: "elementLinkSelector";
120
+ sourceElementId: ExcalidrawElement["id"];
121
+ } | {
122
+ name: "charts";
123
+ data: import("../charts").Spreadsheet;
124
+ rawText: string;
125
+ };
140
126
  defaultSidebarDockedPreference: boolean;
141
127
  lastPointerDownWith: import("@excalidraw/element/types").PointerType;
128
+ selectedElementIds: Readonly<{
129
+ [id: string]: true;
130
+ }>;
131
+ hoveredElementIds: Readonly<{
132
+ [id: string]: true;
133
+ }>;
142
134
  previousSelectedElementIds: {
143
135
  [id: string]: true;
144
136
  };
145
137
  selectedElementsAreBeingDragged: boolean;
138
+ shouldCacheIgnoreZoom: boolean;
146
139
  toast: {
147
- message: string;
140
+ message: React.ReactNode;
148
141
  closable?: boolean;
149
142
  duration?: number;
150
143
  } | null;
151
144
  gridStep: number;
152
- gridModeEnabled: boolean;
153
- fileHandle: FileSystemHandle | null;
145
+ selectedGroupIds: {
146
+ [groupId: string]: boolean;
147
+ };
148
+ editingGroupId: import("@excalidraw/element/types").GroupId | null;
149
+ fileHandle: FileSystemFileHandle | null;
150
+ collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
154
151
  stats: {
155
152
  open: boolean;
156
153
  panels: number;
157
154
  };
158
- currentChartType: import("@excalidraw/element/types").ChartType;
159
- pasteDialog: {
160
- shown: false;
161
- data: null;
162
- } | {
163
- shown: true;
164
- data: import("../charts").Spreadsheet;
165
- };
166
155
  showHyperlinkPopup: false | "info" | "editor";
156
+ selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
157
+ snapLines: readonly import("../snapping").SnapLine[];
167
158
  originSnapOffset: {
168
159
  x: number;
169
160
  y: number;
170
161
  } | null;
171
- objectsSnapModeEnabled: boolean;
172
162
  userToFollow: import("../types").UserToFollow | null;
173
163
  followedBy: Set<import("../types").SocketId>;
164
+ isCropping: boolean;
165
+ croppingElementId: ExcalidrawElement["id"] | null;
166
+ searchMatches: Readonly<{
167
+ focusedId: ExcalidrawElement["id"] | null;
168
+ matches: readonly import("../types").SearchMatch[];
169
+ }> | null;
170
+ activeLockedId: string | null;
174
171
  lockedMultiSelections: {
175
172
  [groupId: string]: true;
176
173
  };
174
+ bindMode: import("@excalidraw/element/types").BindMode;
177
175
  };
178
176
  files: import("../types").BinaryFiles;
179
177
  };
@@ -184,94 +182,57 @@ fileHandle?: FileSystemHandle | null) => Promise<{
184
182
  export declare const loadFromBlob: (blob: Blob,
185
183
  /** @see restore.localAppState */
186
184
  localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null,
187
- /** FileSystemHandle. Defaults to `blob.handle` if defined, otherwise null. */
188
- fileHandle?: FileSystemHandle | null) => Promise<{
185
+ /** FileSystemFileHandle. Defaults to `blob.handle` if defined, otherwise null. */
186
+ fileHandle?: FileSystemFileHandle | null) => Promise<{
189
187
  elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
190
188
  appState: {
191
- viewBackgroundColor: string;
189
+ viewModeEnabled: boolean;
190
+ zenModeEnabled: boolean;
191
+ gridModeEnabled: boolean;
192
+ objectsSnapModeEnabled: boolean;
192
193
  theme: import("@excalidraw/element/types").Theme;
193
- frameRendering: {
194
- enabled: boolean;
195
- name: boolean;
196
- outline: boolean;
197
- clip: boolean;
198
- };
199
194
  name: string | null;
200
- zoom: import("../types").Zoom;
201
- scrollX: number;
202
- scrollY: number;
203
- viewModeEnabled: boolean;
204
- openDialog: null | {
205
- name: "imageExport" | "help" | "jsonExport";
206
- } | {
207
- name: "ttd";
208
- tab: "text-to-diagram" | "mermaid";
209
- } | {
210
- name: "commandPalette";
211
- } | {
212
- name: "settings";
213
- } | {
214
- name: "elementLinkSelector";
215
- sourceElementId: ExcalidrawElement["id"];
216
- };
217
- editingGroupId: import("@excalidraw/element/types").GroupId | null;
218
- selectedElementIds: Readonly<{
219
- [id: string]: true;
220
- }>;
221
- frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
195
+ currentItemArrowType: "sharp" | "round" | "elbow";
196
+ gridSize: number;
222
197
  activeTool: {
223
198
  lastActiveTool: import("../types").ActiveTool | null;
224
199
  locked: boolean;
225
200
  fromSelection: boolean;
226
201
  } & import("../types").ActiveTool;
202
+ contextMenu: {
203
+ items: import("../components/ContextMenu").ContextMenuItems;
204
+ top: number;
205
+ left: number;
206
+ } | null;
207
+ showWelcomeScreen: boolean;
208
+ isLoading: boolean;
209
+ errorMessage: React.ReactNode;
227
210
  activeEmbeddable: {
228
211
  element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
229
212
  state: "hover" | "active";
230
213
  } | null;
231
- selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
232
- selectedGroupIds: {
233
- [groupId: string]: boolean;
234
- };
235
- selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
236
- multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
237
214
  newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
215
+ resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
216
+ multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
217
+ selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
238
218
  isBindingEnabled: boolean;
219
+ boxSelectionMode: import("../types").BoxSelectionMode;
220
+ bindingPreference: "enabled" | "disabled";
221
+ isMidpointSnappingEnabled: boolean;
239
222
  suggestedBinding: {
240
223
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
241
224
  midPoint?: import("@excalidraw/math").GlobalPoint;
242
225
  } | null;
243
- isRotating: boolean;
244
- elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
245
- collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
246
- snapLines: readonly import("../snapping").SnapLine[];
247
- zenModeEnabled: boolean;
248
- editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
249
- isCropping: boolean;
250
- croppingElementId: ExcalidrawElement["id"] | null;
251
- searchMatches: Readonly<{
252
- focusedId: ExcalidrawElement["id"] | null;
253
- matches: readonly import("../types").SearchMatch[];
254
- }> | null;
255
- activeLockedId: string | null;
256
- hoveredElementIds: Readonly<{
257
- [id: string]: true;
258
- }>;
259
- shouldCacheIgnoreZoom: boolean;
260
- exportScale: number;
261
- currentItemArrowType: "sharp" | "round" | "elbow";
262
- bindMode: import("@excalidraw/element/types").BindMode;
263
- gridSize: number;
264
- contextMenu: {
265
- items: import("../components/ContextMenu").ContextMenuItems;
266
- top: number;
267
- left: number;
268
- } | null;
269
- showWelcomeScreen: boolean;
270
- isLoading: boolean;
271
- errorMessage: React.ReactNode;
272
- resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
273
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
226
+ frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
227
+ frameRendering: {
228
+ enabled: boolean;
229
+ name: boolean;
230
+ outline: boolean;
231
+ clip: boolean;
232
+ };
274
233
  editingFrame: string | null;
234
+ elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
235
+ editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
275
236
  preferredSelectionTool: {
276
237
  type: "selection" | "lasso";
277
238
  initialized: boolean;
@@ -281,12 +242,14 @@ fileHandle?: FileSystemHandle | null) => Promise<{
281
242
  exportBackground: boolean;
282
243
  exportEmbedScene: boolean;
283
244
  exportWithDarkMode: boolean;
245
+ exportScale: number;
284
246
  currentItemStrokeColor: string;
285
247
  currentItemBackgroundColor: string;
286
248
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
287
- currentItemStrokeWidth: number;
249
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
288
250
  currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
289
251
  currentItemRoughness: number;
252
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
290
253
  currentItemOpacity: number;
291
254
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
292
255
  currentItemFontSize: number;
@@ -295,52 +258,86 @@ fileHandle?: FileSystemHandle | null) => Promise<{
295
258
  currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
296
259
  currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
297
260
  currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
261
+ viewBackgroundColor: string;
262
+ scrollX: number;
263
+ scrollY: number;
298
264
  cursorButton: "up" | "down";
299
265
  scrolledOutside: boolean;
300
266
  isResizing: boolean;
267
+ isRotating: boolean;
268
+ zoom: import("../types").Zoom;
301
269
  openMenu: "canvas" | null;
302
270
  openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
303
271
  openSidebar: {
304
272
  name: import("../types").SidebarName;
305
273
  tab?: import("../types").SidebarTabName;
306
274
  } | null;
275
+ openDialog: null | {
276
+ name: "imageExport" | "help" | "jsonExport";
277
+ } | {
278
+ name: "ttd";
279
+ tab: "text-to-diagram" | "mermaid";
280
+ } | {
281
+ name: "commandPalette";
282
+ } | {
283
+ name: "settings";
284
+ } | {
285
+ name: "elementLinkSelector";
286
+ sourceElementId: ExcalidrawElement["id"];
287
+ } | {
288
+ name: "charts";
289
+ data: import("../charts").Spreadsheet;
290
+ rawText: string;
291
+ };
307
292
  defaultSidebarDockedPreference: boolean;
308
293
  lastPointerDownWith: import("@excalidraw/element/types").PointerType;
294
+ selectedElementIds: Readonly<{
295
+ [id: string]: true;
296
+ }>;
297
+ hoveredElementIds: Readonly<{
298
+ [id: string]: true;
299
+ }>;
309
300
  previousSelectedElementIds: {
310
301
  [id: string]: true;
311
302
  };
312
303
  selectedElementsAreBeingDragged: boolean;
304
+ shouldCacheIgnoreZoom: boolean;
313
305
  toast: {
314
- message: string;
306
+ message: React.ReactNode;
315
307
  closable?: boolean;
316
308
  duration?: number;
317
309
  } | null;
318
310
  gridStep: number;
319
- gridModeEnabled: boolean;
320
- fileHandle: FileSystemHandle | null;
311
+ selectedGroupIds: {
312
+ [groupId: string]: boolean;
313
+ };
314
+ editingGroupId: import("@excalidraw/element/types").GroupId | null;
315
+ fileHandle: FileSystemFileHandle | null;
316
+ collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
321
317
  stats: {
322
318
  open: boolean;
323
319
  panels: number;
324
320
  };
325
- currentChartType: import("@excalidraw/element/types").ChartType;
326
- pasteDialog: {
327
- shown: false;
328
- data: null;
329
- } | {
330
- shown: true;
331
- data: import("../charts").Spreadsheet;
332
- };
333
321
  showHyperlinkPopup: false | "info" | "editor";
322
+ selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
323
+ snapLines: readonly import("../snapping").SnapLine[];
334
324
  originSnapOffset: {
335
325
  x: number;
336
326
  y: number;
337
327
  } | null;
338
- objectsSnapModeEnabled: boolean;
339
328
  userToFollow: import("../types").UserToFollow | null;
340
329
  followedBy: Set<import("../types").SocketId>;
330
+ isCropping: boolean;
331
+ croppingElementId: ExcalidrawElement["id"] | null;
332
+ searchMatches: Readonly<{
333
+ focusedId: ExcalidrawElement["id"] | null;
334
+ matches: readonly import("../types").SearchMatch[];
335
+ }> | null;
336
+ activeLockedId: string | null;
341
337
  lockedMultiSelections: {
342
338
  [groupId: string]: true;
343
339
  };
340
+ bindMode: import("@excalidraw/element/types").BindMode;
344
341
  };
345
342
  files: import("../types").BinaryFiles;
346
343
  }>;
@@ -364,7 +361,7 @@ export declare const SVGStringToFile: (SVGString: string, filename?: string) =>
364
361
  type: typeof MIME_TYPES.svg;
365
362
  };
366
363
  export declare const ImageURLToFile: (imageUrl: string, filename?: string) => Promise<File | undefined>;
367
- export declare const getFileHandle: (event: DragEvent | React.DragEvent | DataTransferItem) => Promise<FileSystemHandle | null>;
364
+ export declare const getFileHandle: (event: DragEvent | React.DragEvent | DataTransferItem) => Promise<FileSystemFileHandle | null>;
368
365
  export declare const createFile: (blob: File | Blob | ArrayBuffer, mimeType: string, name: string | undefined) => File;
369
366
  /** attempts to detect correct mimeType if none is set, or if an image
370
367
  * has an incorrect extension.
@@ -1,6 +1,5 @@
1
1
  import { supported as nativeFileSystemSupported } from "browser-fs-access";
2
2
  import { MIME_TYPES } from "@excalidraw/common";
3
- import type { FileSystemHandle } from "browser-fs-access";
4
3
  type FILE_EXTENSION = Exclude<keyof typeof MIME_TYPES, "binary">;
5
4
  export declare const fileOpen: <M extends boolean | undefined = false>(opts: {
6
5
  extensions?: FILE_EXTENSION[];
@@ -14,8 +13,7 @@ export declare const fileSave: (blob: Blob | Promise<Blob>, opts: {
14
13
  extension: FILE_EXTENSION;
15
14
  mimeTypes?: string[];
16
15
  description: string;
17
- /** existing FileSystemHandle */
18
- fileHandle?: FileSystemHandle | null;
19
- }) => Promise<FileSystemHandle | null>;
16
+ /** existing FileSystemFileHandle */
17
+ fileHandle?: FileSystemFileHandle | null;
18
+ }) => Promise<FileSystemFileHandle | null>;
20
19
  export { nativeFileSystemSupported };
21
- export type { FileSystemHandle };
@@ -1,5 +1,4 @@
1
1
  import type { ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
2
- import type { FileSystemHandle } from "./filesystem";
3
2
  import type { ExportType } from "../scene/types";
4
3
  import type { AppState, BinaryFiles } from "../types";
5
4
  export { loadFromBlob } from "./blob";
@@ -17,6 +16,6 @@ export declare const exportCanvas: (type: Omit<ExportType, "backend">, elements:
17
16
  viewBackgroundColor: string;
18
17
  /** filename, if applicable */
19
18
  name?: string;
20
- fileHandle?: FileSystemHandle | null;
19
+ fileHandle?: FileSystemFileHandle | null;
21
20
  exportingFrame: ExcalidrawFrameLikeElement | null;
22
- }) => Promise<FileSystemHandle | null | undefined>;
21
+ }) => Promise<FileSystemFileHandle | null | undefined>;