@excalidraw/math 0.18.0-ab0255f → 0.18.0-abeeaeb

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 (50) hide show
  1. package/dist/types/common/src/colors.d.ts +5 -7
  2. package/dist/types/element/src/sortElements.d.ts +10 -0
  3. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +15 -6
  4. package/dist/types/excalidraw/actions/actionBoundText.d.ts +10 -4
  5. package/dist/types/excalidraw/actions/actionCanvas.d.ts +35 -14
  6. package/dist/types/excalidraw/actions/actionClipboard.d.ts +10 -4
  7. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +5 -2
  8. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +15 -6
  9. package/dist/types/excalidraw/actions/actionDeselect.d.ts +5 -2
  10. package/dist/types/excalidraw/actions/actionElementLink.d.ts +5 -2
  11. package/dist/types/excalidraw/actions/actionElementLock.d.ts +10 -4
  12. package/dist/types/excalidraw/actions/actionExport.d.ts +10 -4
  13. package/dist/types/excalidraw/actions/actionFrame.d.ts +15 -6
  14. package/dist/types/excalidraw/actions/actionGroup.d.ts +11 -5
  15. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +5 -2
  16. package/dist/types/excalidraw/actions/actionLink.d.ts +5 -2
  17. package/dist/types/excalidraw/actions/actionMenu.d.ts +5 -2
  18. package/dist/types/excalidraw/actions/actionProperties.d.ts +10 -4
  19. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +5 -2
  20. package/dist/types/excalidraw/actions/actionStyles.d.ts +5 -2
  21. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +5 -2
  22. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +5 -2
  23. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +5 -2
  24. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +5 -2
  25. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +5 -2
  26. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +5 -2
  27. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +5 -2
  28. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +5 -2
  29. package/dist/types/excalidraw/appState.d.ts +5 -0
  30. package/dist/types/excalidraw/components/App.bucketFill.d.ts +14 -0
  31. package/dist/types/excalidraw/components/App.cursor.d.ts +2 -3
  32. package/dist/types/excalidraw/components/App.d.ts +12 -5
  33. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +6 -2
  34. package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +3 -1
  35. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -1
  36. package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +4 -2
  37. package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +4 -2
  38. package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +8 -1
  39. package/dist/types/excalidraw/components/ColorPicker/topPicksDnD.d.ts +31 -0
  40. package/dist/types/excalidraw/components/LayerUI.d.ts +2 -1
  41. package/dist/types/excalidraw/components/UserList.d.ts +3 -2
  42. package/dist/types/excalidraw/components/ViewportStatusFrame/ViewportStatusFrame.d.ts +11 -0
  43. package/dist/types/excalidraw/components/icons.d.ts +3 -0
  44. package/dist/types/excalidraw/data/blob.d.ts +10 -4
  45. package/dist/types/excalidraw/data/json.d.ts +5 -2
  46. package/dist/types/excalidraw/lasso/utils.d.ts +2 -0
  47. package/dist/types/excalidraw/types.d.ts +47 -4
  48. package/dist/types/excalidraw/viewport.d.ts +5 -2
  49. package/package.json +2 -2
  50. package/dist/types/excalidraw/components/FollowMode/FollowMode.d.ts +0 -10
@@ -7,7 +7,7 @@ export declare const actionGroup: {
7
7
  trackEvent: {
8
8
  category: "element";
9
9
  };
10
- perform: (elements: readonly OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, _: unknown, app: AppClassProperties) => {
10
+ perform: (elements: readonly OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, _: unknown, app: AppClassProperties) => false | {
11
11
  appState: Readonly<import("../types").AppState>;
12
12
  elements: readonly OrderedExcalidrawElement[];
13
13
  captureUpdate: "EVENTUALLY";
@@ -157,8 +157,6 @@ export declare const actionGroup: {
157
157
  y: number;
158
158
  } | null;
159
159
  objectsSnapModeEnabled: boolean;
160
- userToFollow: import("../types").UserToFollow | null;
161
- followedBy: Set<import("../types").SocketId>;
162
160
  isCropping: boolean;
163
161
  croppingElementId: ExcalidrawElement["id"] | null;
164
162
  searchMatches: Readonly<{
@@ -170,6 +168,11 @@ export declare const actionGroup: {
170
168
  [groupId: string]: true;
171
169
  };
172
170
  bindMode: import("@excalidraw/element/types").BindMode;
171
+ colorTopPicks: {
172
+ elementStroke: readonly string[] | null;
173
+ elementBackground: readonly string[] | null;
174
+ bucketFill: readonly string[] | null;
175
+ };
173
176
  };
174
177
  elements: OrderedExcalidrawElement[];
175
178
  captureUpdate: "IMMEDIATELY";
@@ -337,8 +340,6 @@ export declare const actionUngroup: {
337
340
  y: number;
338
341
  } | null;
339
342
  objectsSnapModeEnabled: boolean;
340
- userToFollow: import("../types").UserToFollow | null;
341
- followedBy: Set<import("../types").SocketId>;
342
343
  isCropping: boolean;
343
344
  croppingElementId: ExcalidrawElement["id"] | null;
344
345
  searchMatches: Readonly<{
@@ -350,6 +351,11 @@ export declare const actionUngroup: {
350
351
  [groupId: string]: true;
351
352
  };
352
353
  bindMode: import("@excalidraw/element/types").BindMode;
354
+ colorTopPicks: {
355
+ elementStroke: readonly string[] | null;
356
+ elementBackground: readonly string[] | null;
357
+ bucketFill: readonly string[] | null;
358
+ };
353
359
  };
354
360
  elements: OrderedExcalidrawElement[];
355
361
  captureUpdate: "IMMEDIATELY";
@@ -191,8 +191,6 @@ export declare const actionToggleLinearEditor: {
191
191
  y: number;
192
192
  } | null;
193
193
  objectsSnapModeEnabled: boolean;
194
- userToFollow: import("../types").UserToFollow | null;
195
- followedBy: Set<import("../types").SocketId>;
196
194
  isCropping: boolean;
197
195
  croppingElementId: import("@excalidraw/element/types").ExcalidrawElement["id"] | null;
198
196
  searchMatches: Readonly<{
@@ -204,6 +202,11 @@ export declare const actionToggleLinearEditor: {
204
202
  [groupId: string]: true;
205
203
  };
206
204
  bindMode: import("@excalidraw/element/types").BindMode;
205
+ colorTopPicks: {
206
+ elementStroke: readonly string[] | null;
207
+ elementBackground: readonly string[] | null;
208
+ bucketFill: readonly string[] | null;
209
+ };
207
210
  };
208
211
  captureUpdate: "IMMEDIATELY";
209
212
  };
@@ -153,8 +153,6 @@ export declare const actionLink: {
153
153
  y: number;
154
154
  } | null;
155
155
  objectsSnapModeEnabled: boolean;
156
- userToFollow: import("../types").UserToFollow | null;
157
- followedBy: Set<import("../types").SocketId>;
158
156
  isCropping: boolean;
159
157
  croppingElementId: import("@excalidraw/element/types").ExcalidrawElement["id"] | null;
160
158
  searchMatches: Readonly<{
@@ -166,6 +164,11 @@ export declare const actionLink: {
166
164
  [groupId: string]: true;
167
165
  };
168
166
  bindMode: import("@excalidraw/element/types").BindMode;
167
+ colorTopPicks: {
168
+ elementStroke: readonly string[] | null;
169
+ elementBackground: readonly string[] | null;
170
+ bucketFill: readonly string[] | null;
171
+ };
169
172
  };
170
173
  captureUpdate: "IMMEDIATELY";
171
174
  };
@@ -143,8 +143,6 @@ export declare const actionShortcuts: {
143
143
  y: number;
144
144
  } | null;
145
145
  objectsSnapModeEnabled: boolean;
146
- userToFollow: import("../types").UserToFollow | null;
147
- followedBy: Set<import("../types").SocketId>;
148
146
  isCropping: boolean;
149
147
  croppingElementId: import("@excalidraw/element/types").ExcalidrawElement["id"] | null;
150
148
  searchMatches: Readonly<{
@@ -156,6 +154,11 @@ export declare const actionShortcuts: {
156
154
  [groupId: string]: true;
157
155
  };
158
156
  bindMode: import("@excalidraw/element/types").BindMode;
157
+ colorTopPicks: {
158
+ elementStroke: readonly string[] | null;
159
+ elementBackground: readonly string[] | null;
160
+ bucketFill: readonly string[] | null;
161
+ };
159
162
  };
160
163
  captureUpdate: "EVENTUALLY";
161
164
  };
@@ -195,8 +195,6 @@ export declare const actionDecreaseFontSize: {
195
195
  y: number;
196
196
  } | null;
197
197
  objectsSnapModeEnabled: boolean;
198
- userToFollow: import("../types").UserToFollow | null;
199
- followedBy: Set<import("../types").SocketId>;
200
198
  isCropping: boolean;
201
199
  croppingElementId: ExcalidrawElement["id"] | null;
202
200
  searchMatches: Readonly<{
@@ -208,6 +206,11 @@ export declare const actionDecreaseFontSize: {
208
206
  [groupId: string]: true;
209
207
  };
210
208
  bindMode: import("@excalidraw/element/types").BindMode;
209
+ colorTopPicks: {
210
+ elementStroke: readonly string[] | null;
211
+ elementBackground: readonly string[] | null;
212
+ bucketFill: readonly string[] | null;
213
+ };
211
214
  };
212
215
  captureUpdate: "IMMEDIATELY";
213
216
  };
@@ -371,8 +374,6 @@ export declare const actionIncreaseFontSize: {
371
374
  y: number;
372
375
  } | null;
373
376
  objectsSnapModeEnabled: boolean;
374
- userToFollow: import("../types").UserToFollow | null;
375
- followedBy: Set<import("../types").SocketId>;
376
377
  isCropping: boolean;
377
378
  croppingElementId: ExcalidrawElement["id"] | null;
378
379
  searchMatches: Readonly<{
@@ -384,6 +385,11 @@ export declare const actionIncreaseFontSize: {
384
385
  [groupId: string]: true;
385
386
  };
386
387
  bindMode: import("@excalidraw/element/types").BindMode;
388
+ colorTopPicks: {
389
+ elementStroke: readonly string[] | null;
390
+ elementBackground: readonly string[] | null;
391
+ bucketFill: readonly string[] | null;
392
+ };
387
393
  };
388
394
  captureUpdate: "IMMEDIATELY";
389
395
  };
@@ -154,8 +154,6 @@ export declare const actionSelectAll: {
154
154
  y: number;
155
155
  } | null;
156
156
  objectsSnapModeEnabled: boolean;
157
- userToFollow: import("../types").UserToFollow | null;
158
- followedBy: Set<import("../types").SocketId>;
159
157
  isCropping: boolean;
160
158
  croppingElementId: ExcalidrawElement["id"] | null;
161
159
  searchMatches: Readonly<{
@@ -167,6 +165,11 @@ export declare const actionSelectAll: {
167
165
  [groupId: string]: true;
168
166
  };
169
167
  bindMode: import("@excalidraw/element/types").BindMode;
168
+ colorTopPicks: {
169
+ elementStroke: readonly string[] | null;
170
+ elementBackground: readonly string[] | null;
171
+ bucketFill: readonly string[] | null;
172
+ };
170
173
  };
171
174
  captureUpdate: "IMMEDIATELY";
172
175
  };
@@ -155,8 +155,6 @@ export declare const actionCopyStyles: {
155
155
  y: number;
156
156
  } | null;
157
157
  objectsSnapModeEnabled: boolean;
158
- userToFollow: import("../types").UserToFollow | null;
159
- followedBy: Set<import("../types").SocketId>;
160
158
  isCropping: boolean;
161
159
  croppingElementId: import("@excalidraw/element/types").ExcalidrawElement["id"] | null;
162
160
  searchMatches: Readonly<{
@@ -168,6 +166,11 @@ export declare const actionCopyStyles: {
168
166
  [groupId: string]: true;
169
167
  };
170
168
  bindMode: import("@excalidraw/element/types").BindMode;
169
+ colorTopPicks: {
170
+ elementStroke: readonly string[] | null;
171
+ elementBackground: readonly string[] | null;
172
+ bucketFill: readonly string[] | null;
173
+ };
171
174
  };
172
175
  captureUpdate: "EVENTUALLY";
173
176
  };
@@ -156,8 +156,6 @@ export declare const actionToggleArrowBinding: {
156
156
  y: number;
157
157
  } | null;
158
158
  objectsSnapModeEnabled: boolean;
159
- userToFollow: import("../types").UserToFollow | null;
160
- followedBy: Set<import("../types").SocketId>;
161
159
  isCropping: boolean;
162
160
  croppingElementId: import("@excalidraw/element/types").ExcalidrawElement["id"] | null;
163
161
  searchMatches: Readonly<{
@@ -169,6 +167,11 @@ export declare const actionToggleArrowBinding: {
169
167
  [groupId: string]: true;
170
168
  };
171
169
  bindMode: import("@excalidraw/element/types").BindMode;
170
+ colorTopPicks: {
171
+ elementStroke: readonly string[] | null;
172
+ elementBackground: readonly string[] | null;
173
+ bucketFill: readonly string[] | null;
174
+ };
172
175
  };
173
176
  captureUpdate: "NEVER";
174
177
  };
@@ -158,8 +158,6 @@ export declare const actionToggleGridMode: {
158
158
  x: number;
159
159
  y: number;
160
160
  } | null;
161
- userToFollow: import("../types").UserToFollow | null;
162
- followedBy: Set<import("../types").SocketId>;
163
161
  isCropping: boolean;
164
162
  croppingElementId: import("@excalidraw/element/types").ExcalidrawElement["id"] | null;
165
163
  searchMatches: Readonly<{
@@ -171,6 +169,11 @@ export declare const actionToggleGridMode: {
171
169
  [groupId: string]: true;
172
170
  };
173
171
  bindMode: import("@excalidraw/element/types").BindMode;
172
+ colorTopPicks: {
173
+ elementStroke: readonly string[] | null;
174
+ elementBackground: readonly string[] | null;
175
+ bucketFill: readonly string[] | null;
176
+ };
174
177
  };
175
178
  captureUpdate: "EVENTUALLY";
176
179
  };
@@ -156,8 +156,6 @@ export declare const actionToggleMidpointSnapping: {
156
156
  y: number;
157
157
  } | null;
158
158
  objectsSnapModeEnabled: boolean;
159
- userToFollow: import("../types").UserToFollow | null;
160
- followedBy: Set<import("../types").SocketId>;
161
159
  isCropping: boolean;
162
160
  croppingElementId: import("@excalidraw/element/types").ExcalidrawElement["id"] | null;
163
161
  searchMatches: Readonly<{
@@ -169,6 +167,11 @@ export declare const actionToggleMidpointSnapping: {
169
167
  [groupId: string]: true;
170
168
  };
171
169
  bindMode: import("@excalidraw/element/types").BindMode;
170
+ colorTopPicks: {
171
+ elementStroke: readonly string[] | null;
172
+ elementBackground: readonly string[] | null;
173
+ bucketFill: readonly string[] | null;
174
+ };
172
175
  };
173
176
  captureUpdate: "NEVER";
174
177
  };
@@ -157,8 +157,6 @@ export declare const actionToggleObjectsSnapMode: {
157
157
  x: number;
158
158
  y: number;
159
159
  } | null;
160
- userToFollow: import("../types").UserToFollow | null;
161
- followedBy: Set<import("../types").SocketId>;
162
160
  isCropping: boolean;
163
161
  croppingElementId: import("@excalidraw/element/types").ExcalidrawElement["id"] | null;
164
162
  searchMatches: Readonly<{
@@ -170,6 +168,11 @@ export declare const actionToggleObjectsSnapMode: {
170
168
  [groupId: string]: true;
171
169
  };
172
170
  bindMode: import("@excalidraw/element/types").BindMode;
171
+ colorTopPicks: {
172
+ elementStroke: readonly string[] | null;
173
+ elementBackground: readonly string[] | null;
174
+ bucketFill: readonly string[] | null;
175
+ };
173
176
  };
174
177
  captureUpdate: "EVENTUALLY";
175
178
  };
@@ -143,8 +143,6 @@ export declare const actionToggleSearchMenu: {
143
143
  y: number;
144
144
  } | null;
145
145
  objectsSnapModeEnabled: boolean;
146
- userToFollow: import("../types").UserToFollow | null;
147
- followedBy: Set<import("../types").SocketId>;
148
146
  isCropping: boolean;
149
147
  croppingElementId: import("@excalidraw/element/types").ExcalidrawElement["id"] | null;
150
148
  searchMatches: Readonly<{
@@ -156,6 +154,11 @@ export declare const actionToggleSearchMenu: {
156
154
  [groupId: string]: true;
157
155
  };
158
156
  bindMode: import("@excalidraw/element/types").BindMode;
157
+ colorTopPicks: {
158
+ elementStroke: readonly string[] | null;
159
+ elementBackground: readonly string[] | null;
160
+ bucketFill: readonly string[] | null;
161
+ };
159
162
  };
160
163
  captureUpdate: "EVENTUALLY";
161
164
  };
@@ -157,8 +157,6 @@ export declare const actionToggleStats: {
157
157
  y: number;
158
158
  } | null;
159
159
  objectsSnapModeEnabled: boolean;
160
- userToFollow: import("../types").UserToFollow | null;
161
- followedBy: Set<import("../types").SocketId>;
162
160
  isCropping: boolean;
163
161
  croppingElementId: import("@excalidraw/element/types").ExcalidrawElement["id"] | null;
164
162
  searchMatches: Readonly<{
@@ -170,6 +168,11 @@ export declare const actionToggleStats: {
170
168
  [groupId: string]: true;
171
169
  };
172
170
  bindMode: import("@excalidraw/element/types").BindMode;
171
+ colorTopPicks: {
172
+ elementStroke: readonly string[] | null;
173
+ elementBackground: readonly string[] | null;
174
+ bucketFill: readonly string[] | null;
175
+ };
173
176
  };
174
177
  captureUpdate: "EVENTUALLY";
175
178
  };
@@ -157,8 +157,6 @@ export declare const actionToggleViewMode: {
157
157
  y: number;
158
158
  } | null;
159
159
  objectsSnapModeEnabled: boolean;
160
- userToFollow: import("../types").UserToFollow | null;
161
- followedBy: Set<import("../types").SocketId>;
162
160
  isCropping: boolean;
163
161
  croppingElementId: import("@excalidraw/element/types").ExcalidrawElement["id"] | null;
164
162
  searchMatches: Readonly<{
@@ -170,6 +168,11 @@ export declare const actionToggleViewMode: {
170
168
  [groupId: string]: true;
171
169
  };
172
170
  bindMode: import("@excalidraw/element/types").BindMode;
171
+ colorTopPicks: {
172
+ elementStroke: readonly string[] | null;
173
+ elementBackground: readonly string[] | null;
174
+ bucketFill: readonly string[] | null;
175
+ };
173
176
  };
174
177
  captureUpdate: "EVENTUALLY";
175
178
  };
@@ -157,8 +157,6 @@ export declare const actionToggleZenMode: {
157
157
  y: number;
158
158
  } | null;
159
159
  objectsSnapModeEnabled: boolean;
160
- userToFollow: import("../types").UserToFollow | null;
161
- followedBy: Set<import("../types").SocketId>;
162
160
  isCropping: boolean;
163
161
  croppingElementId: import("@excalidraw/element/types").ExcalidrawElement["id"] | null;
164
162
  searchMatches: Readonly<{
@@ -170,6 +168,11 @@ export declare const actionToggleZenMode: {
170
168
  [groupId: string]: true;
171
169
  };
172
170
  bindMode: import("@excalidraw/element/types").BindMode;
171
+ colorTopPicks: {
172
+ elementStroke: readonly string[] | null;
173
+ elementBackground: readonly string[] | null;
174
+ bucketFill: readonly string[] | null;
175
+ };
173
176
  };
174
177
  captureUpdate: "EVENTUALLY";
175
178
  };
@@ -78,6 +78,11 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
78
78
  lockedMultiSelections?: {
79
79
  [groupId: string]: true;
80
80
  } | undefined;
81
+ colorTopPicks?: {
82
+ elementStroke: readonly string[] | null;
83
+ elementBackground: readonly string[] | null;
84
+ bucketFill: readonly string[] | null;
85
+ } | undefined;
81
86
  };
82
87
  export declare const cleanAppStateForExport: (appState: Partial<AppState>) => {
83
88
  viewBackgroundColor?: string | undefined;
@@ -1,3 +1,4 @@
1
+ import type { Theme } from "@excalidraw/element/types";
1
2
  import type App from "./App";
2
3
  type ScenePoint = {
3
4
  x: number;
@@ -7,6 +8,7 @@ type ScenePoint = {
7
8
  export declare class AppBucketFill {
8
9
  private app;
9
10
  constructor(app: App);
11
+ private temporaryEyeDropper;
10
12
  /**
11
13
  * The click armed on pointer down, committed on pointer up. Deferring the
12
14
  * scene mutation to pointer up is what lets a pinch/pan second finger, a
@@ -24,11 +26,23 @@ export declare class AppBucketFill {
24
26
  handlePointerUp: () => void;
25
27
  /** Abort the armed fill (second finger, context menu, pointercancel). */
26
28
  cancel: () => void;
29
+ cycleBackgroundColor: () => void;
30
+ openTemporaryEyeDropper: () => void;
31
+ closeTemporaryEyeDropper: () => void;
27
32
  /**
28
33
  * Apply the current bucket fill settings to an existing fill-compatible
29
34
  * element (no-op when nothing would change). One undoable step.
30
35
  */
31
36
  private restyle;
32
37
  private fill;
38
+ /**
39
+ * The color the bucket fill tool actually fills with: the shared
40
+ * `currentItemBackgroundColor`, falling back to green when that is
41
+ * transparent (the tool's picker doesn't offer transparent, but the shared
42
+ * state can hold it from the generic shape picker).
43
+ */
44
+ getBucketFillBackgroundColor: (backgroundColor: string,
45
+ /** supply only for display purposes such as when applying to the cursor */
46
+ theme?: Theme) => string;
33
47
  }
34
48
  export {};
@@ -1,5 +1,5 @@
1
- import type App from "./App";
2
1
  import type { AppState } from "../types";
2
+ import type App from "./App";
3
3
  /**
4
4
  * Captures all cursor management for the interactive canvas.
5
5
  *
@@ -10,10 +10,9 @@ import type { AppState } from "../types";
10
10
  */
11
11
  export declare class AppCursor {
12
12
  private app;
13
+ private toolCursorMemo;
13
14
  private eraserCanvasCache;
14
15
  private eraserPreviewDataURL;
15
- private drawShapeCanvasCache;
16
- private drawShapePreviewDataURL;
17
16
  constructor(app: App);
18
17
  private get canvas();
19
18
  set: (cursor: string) => void;
@@ -338,10 +338,11 @@ declare class App extends React.Component<AppProps, AppState> {
338
338
  isToolLocked(): boolean;
339
339
  /**
340
340
  * Whether the active tool captures the primary pointer instead of the
341
- * view-mode drag-to-pan — the laser always does; while non-interactive,
342
- * any tool allowed via `interaction.enabled.tools` does. (Editing tools
343
- * capture the pointer trivially since view mode implies they're not
344
- * active; this predicate only matters where view-mode gates apply.)
341
+ * view-mode drag-to-pan — the laser and host-implemented custom tools do;
342
+ * while non-interactive, any tool allowed via
343
+ * `interaction.enabled.tools` does. (Editing tools capture the pointer
344
+ * trivially since view mode implies they're not active; this predicate only
345
+ * matters where view-mode gates apply.)
345
346
  */
346
347
  isActiveToolPointerCapturing(): boolean;
347
348
  /** Whether Excalidraw's full default UI is rendered. */
@@ -476,7 +477,13 @@ declare class App extends React.Component<AppProps, AppState> {
476
477
  updateFrameRendering: (opts: Partial<AppState["frameRendering"]> | ((prevState: AppState["frameRendering"]) => Partial<AppState["frameRendering"]>)) => void;
477
478
  togglePenMode: (force: boolean | null) => void;
478
479
  revealIfHidden: (elements: NonDeletedExcalidrawElement[]) => void;
479
- private maybeUnfollowRemoteUser;
480
+ /** emits a follow/unfollow intent to the host (which owns the
481
+ * `userToFollow` state) via both the `onUserFollow` prop and the
482
+ * imperative API emitter */
483
+ emitUserFollowIntent: (payload: OnUserFollowedPayload) => void;
484
+ /** emits an UNFOLLOW intent if currently following someone — use on
485
+ * user-initiated viewport changes which should break follow mode */
486
+ requestUnfollow: () => void;
480
487
  setToast: (toast: AppState["toast"]) => void;
481
488
  restoreFileFromShare: () => Promise<void>;
482
489
  /**
@@ -2,7 +2,7 @@ import type { ColorTuple, ColorPaletteCustom } from "@excalidraw/common";
2
2
  import type { ExcalidrawElement } from "@excalidraw/element/types";
3
3
  import "./ColorPicker.scss";
4
4
  import type { ColorPickerType } from "./colorPickerUtils";
5
- import type { UIAppState } from "../../types";
5
+ import type { AppState, UIAppState } from "../../types";
6
6
  interface ColorPickerProps {
7
7
  type: ColorPickerType;
8
8
  /**
@@ -19,6 +19,10 @@ interface ColorPickerProps {
19
19
  updateData: (formData?: any) => void;
20
20
  /** palette colors to hide from the popup, keeping hotkey positions */
21
21
  excludedColors?: readonly string[];
22
+ /** allow users to customize the top picks strip by drag & dropping colors
23
+ * from the picker popup onto it. The value names the
24
+ * `appState.colorTopPicks` slot the customization is stored in */
25
+ customizableTopPicks?: keyof AppState["colorTopPicks"];
22
26
  }
23
- export declare const ColorPicker: ({ type, color, onChange, label, elements, palette, topPicks, updateData, appState, excludedColors, }: ColorPickerProps) => import("react/jsx-runtime").JSX.Element;
27
+ export declare const ColorPicker: import("react").MemoExoticComponent<({ type, color, onChange, label, elements, palette, topPicks, updateData, appState, excludedColors, customizableTopPicks, }: ColorPickerProps) => import("react/jsx-runtime").JSX.Element>;
24
28
  export {};
@@ -1,8 +1,10 @@
1
+ import type { Theme } from "@excalidraw/element/types";
1
2
  interface CustomColorListProps {
3
+ theme: Theme;
2
4
  colors: string[];
3
5
  color: string | null;
4
6
  onChange: (color: string) => void;
5
7
  label: string;
6
8
  }
7
- export declare const CustomColorList: ({ colors, color, onChange, label, }: CustomColorListProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const CustomColorList: ({ theme, colors, color, onChange, label, }: CustomColorListProps) => import("react/jsx-runtime").JSX.Element;
8
10
  export {};
@@ -1,8 +1,9 @@
1
1
  import React from "react";
2
- import type { ExcalidrawElement } from "@excalidraw/element/types";
2
+ import type { ExcalidrawElement, Theme } from "@excalidraw/element/types";
3
3
  import type { ColorPaletteCustom } from "@excalidraw/common";
4
4
  import type { ColorPickerType } from "./colorPickerUtils";
5
5
  interface PickerProps {
6
+ theme: Theme;
6
7
  color: string | null;
7
8
  onChange: (color: string) => void;
8
9
  type: ColorPickerType;
@@ -1,5 +1,7 @@
1
- import type { ColorPaletteCustom } from "@excalidraw/common";
1
+ import { type ColorPaletteCustom } from "@excalidraw/common";
2
+ import type { Theme } from "@excalidraw/element/types";
2
3
  interface PickerColorListProps {
4
+ theme: Theme;
3
5
  palette: ColorPaletteCustom;
4
6
  color: string | null;
5
7
  onChange: (color: string) => void;
@@ -11,5 +13,5 @@ interface PickerColorListProps {
11
13
  */
12
14
  excludedColors?: readonly string[];
13
15
  }
14
- declare const PickerColorList: ({ palette, color, onChange, activeShade, showHotKey, excludedColors, }: PickerColorListProps) => import("react/jsx-runtime").JSX.Element;
16
+ declare const PickerColorList: ({ theme, palette, color, onChange, activeShade, showHotKey, excludedColors, }: PickerColorListProps) => import("react/jsx-runtime").JSX.Element;
15
17
  export default PickerColorList;
@@ -1,9 +1,11 @@
1
- import type { ColorPaletteCustom } from "@excalidraw/common";
1
+ import { type ColorPaletteCustom } from "@excalidraw/common";
2
+ import type { Theme } from "@excalidraw/element/types";
2
3
  interface ShadeListProps {
4
+ theme: Theme;
3
5
  color: string | null;
4
6
  onChange: (color: string) => void;
5
7
  palette: ColorPaletteCustom;
6
8
  showHotKey?: boolean;
7
9
  }
8
- export declare const ShadeList: ({ color, onChange, palette, showHotKey, }: ShadeListProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const ShadeList: ({ theme, color, onChange, palette, showHotKey, }: ShadeListProps) => import("react/jsx-runtime").JSX.Element;
9
11
  export {};
@@ -1,9 +1,16 @@
1
+ import type { Theme } from "@excalidraw/element/types";
1
2
  import type { ColorPickerType } from "./colorPickerUtils";
2
3
  interface TopPicksProps {
4
+ theme: Theme;
3
5
  onChange: (color: string) => void;
4
6
  type: ColorPickerType;
5
7
  activeColor: string | null;
6
8
  topPicks?: readonly string[];
9
+ /** present when the strip is user-customizable — enables the right-click
10
+ * context menu resetting the strip to its default picks */
11
+ onReset?: () => void;
12
+ /** whether custom picks are currently applied (enables the reset item) */
13
+ isCustomized?: boolean;
7
14
  }
8
- export declare const TopPicks: ({ onChange, type, activeColor, topPicks, }: TopPicksProps) => import("react/jsx-runtime").JSX.Element | null;
15
+ export declare const TopPicks: ({ theme, onChange, type, activeColor, topPicks, onReset, isCustomized, }: TopPicksProps) => import("react/jsx-runtime").JSX.Element | null;
9
16
  export {};
@@ -0,0 +1,31 @@
1
+ type DragOrigin = {
2
+ kind: "swatch";
3
+ } | {
4
+ kind: "pick";
5
+ index: number;
6
+ };
7
+ export type TopPicksDragState = {
8
+ color: string;
9
+ origin: DragOrigin;
10
+ /** hovered strip slot — the slot to replace (swatch drags) or the final
11
+ * position (pick reorders). null while the pointer is outside the strip */
12
+ overIndex: number | null;
13
+ /** index of an already-pinned identical color that blocks the drop */
14
+ duplicateIndex: number | null;
15
+ /** signed distance between strip slot centers (for reorder preview) */
16
+ slotSpan: number;
17
+ } | null;
18
+ export type ColorPickerDnD = {
19
+ dragState: TopPicksDragState;
20
+ startSwatchDrag: (event: React.PointerEvent, color: string | null) => void;
21
+ startPickDrag: (event: React.PointerEvent, index: number, color: string) => void;
22
+ setStripEl: (el: HTMLDivElement | null) => void;
23
+ };
24
+ export declare const ColorPickerDnDContext: import("react").Context<ColorPickerDnD | null>;
25
+ export declare const useColorPickerDnD: () => ColorPickerDnD | null;
26
+ export declare const useTopPicksDnD: ({ enabled, picks, onPicksChange, }: {
27
+ enabled: boolean;
28
+ picks: readonly string[];
29
+ onPicksChange: (picks: string[]) => void;
30
+ }) => ColorPickerDnD;
31
+ export {};
@@ -29,6 +29,7 @@ interface LayerUIProps {
29
29
  scrollBackToContentUIEnabled: boolean;
30
30
  isCollaborating: boolean;
31
31
  generateLinkForSelection?: AppProps["generateLinkForSelection"];
32
+ currentUserControls?: ExcalidrawProps["currentUserControls"];
32
33
  }
33
- declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onLockToggle, onPenModeToggle, showExitZenModeBtn, renderTopLeftUI, renderTopRightUI, renderCustomStats, UIOptions, onExportImage, renderWelcomeScreen, children, app, defaultUIEnabled, zoomUIEnabled, scrollBackToContentUIEnabled, isCollaborating, generateLinkForSelection, }: LayerUIProps) => import("react/jsx-runtime").JSX.Element>;
34
+ declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onLockToggle, onPenModeToggle, showExitZenModeBtn, renderTopLeftUI, renderTopRightUI, renderCustomStats, UIOptions, onExportImage, renderWelcomeScreen, children, app, defaultUIEnabled, zoomUIEnabled, scrollBackToContentUIEnabled, isCollaborating, generateLinkForSelection, currentUserControls, }: LayerUIProps) => import("react/jsx-runtime").JSX.Element>;
34
35
  export default _default;
@@ -7,12 +7,13 @@ export type GoToCollaboratorComponentProps = {
7
7
  withName: boolean;
8
8
  isBeingFollowed: boolean;
9
9
  };
10
- type UserListUserObject = Pick<Collaborator, "avatarUrl" | "id" | "socketId" | "username" | "isInCall" | "isSpeaking" | "isMuted">;
10
+ type UserListUserObject = Pick<Collaborator, "avatarUrl" | "id" | "socketId" | "username" | "isInCall" | "isSpeaking" | "isMuted" | "isCurrentUser">;
11
11
  type UserListProps = {
12
12
  className?: string;
13
13
  mobile?: boolean;
14
14
  collaborators: Map<SocketId, UserListUserObject>;
15
15
  userToFollow: SocketId | null;
16
+ currentUserControls?: React.ReactNode | ((isMobile: boolean) => React.ReactNode);
16
17
  };
17
- export declare const UserList: React.MemoExoticComponent<({ className, mobile, collaborators, userToFollow }: UserListProps) => import("react/jsx-runtime").JSX.Element>;
18
+ export declare const UserList: React.MemoExoticComponent<({ className, mobile, collaborators, userToFollow, currentUserControls, }: UserListProps) => import("react/jsx-runtime").JSX.Element>;
18
19
  export {};
@@ -0,0 +1,11 @@
1
+ import "./ViewportStatusFrame.scss";
2
+ import type { CSSProperties } from "react";
3
+ import type { ViewportStatusFrame as ViewportStatusFrameType } from "../../types";
4
+ export declare const ViewportStatusBorder: ({ border, style, }: {
5
+ border: string;
6
+ style?: CSSProperties;
7
+ }) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const ViewportStatusBadge: ({ label, border, }: {
9
+ label: NonNullable<ViewportStatusFrameType["label"]>;
10
+ border?: ViewportStatusFrameType["border"];
11
+ }) => import("react/jsx-runtime").JSX.Element;