@zsviczian/excalidraw 0.17.1-obsidian-22 → 0.17.1-obsidian-24

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 (35) hide show
  1. package/dist/excalidraw.development.js +20 -20
  2. package/dist/excalidraw.production.min.js +1 -1
  3. package/package.json +1 -1
  4. package/types/excalidraw/actions/actionAddToLibrary.d.ts +3 -3
  5. package/types/excalidraw/actions/actionAlign.d.ts +6 -6
  6. package/types/excalidraw/actions/actionBoundText.d.ts +3 -3
  7. package/types/excalidraw/actions/actionCanvas.d.ts +14 -14
  8. package/types/excalidraw/actions/actionClipboard.d.ts +12 -12
  9. package/types/excalidraw/actions/actionDeleteSelected.d.ts +3 -3
  10. package/types/excalidraw/actions/actionDistribute.d.ts +2 -2
  11. package/types/excalidraw/actions/actionDuplicateSelection.d.ts +1 -1
  12. package/types/excalidraw/actions/actionElementLock.d.ts +2 -2
  13. package/types/excalidraw/actions/actionExport.d.ts +11 -11
  14. package/types/excalidraw/actions/actionFinalize.d.ts +2 -2
  15. package/types/excalidraw/actions/actionFlip.d.ts +2 -2
  16. package/types/excalidraw/actions/actionFrame.d.ts +378 -4
  17. package/types/excalidraw/actions/actionGroup.d.ts +378 -2
  18. package/types/excalidraw/actions/actionLinearEditor.d.ts +1 -1
  19. package/types/excalidraw/actions/actionLink.d.ts +1 -1
  20. package/types/excalidraw/actions/actionMenu.d.ts +3 -3
  21. package/types/excalidraw/actions/actionNavigate.d.ts +2 -2
  22. package/types/excalidraw/actions/actionProperties.d.ts +13 -13
  23. package/types/excalidraw/actions/actionSelectAll.d.ts +1 -1
  24. package/types/excalidraw/actions/actionStyles.d.ts +5 -2
  25. package/types/excalidraw/actions/actionTextAutoResize.d.ts +1 -1
  26. package/types/excalidraw/actions/actionToggleGridMode.d.ts +1 -1
  27. package/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +1 -1
  28. package/types/excalidraw/actions/actionToggleStats.d.ts +1 -1
  29. package/types/excalidraw/actions/actionToggleViewMode.d.ts +1 -1
  30. package/types/excalidraw/actions/actionToggleZenMode.d.ts +1 -1
  31. package/types/excalidraw/actions/actionZindex.d.ts +4 -4
  32. package/types/excalidraw/components/App.d.ts +2 -1
  33. package/types/excalidraw/element/embeddable.d.ts +1 -1
  34. package/types/excalidraw/element/newElement.d.ts +2 -0
  35. package/types/excalidraw/store.d.ts +32 -2
@@ -194,7 +194,7 @@ export declare const actionToggleZenMode: {
194
194
  userToFollow: import("../types").UserToFollow | null;
195
195
  followedBy: Set<import("../types").SocketId>;
196
196
  };
197
- storeAction: import("../store").StoreActionType;
197
+ storeAction: "none";
198
198
  };
199
199
  checked: (appState: Readonly<import("../types").AppState>) => boolean;
200
200
  predicate: (elements: readonly import("../element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
@@ -9,7 +9,7 @@ export declare const actionSendBackward: {
9
9
  perform: (elements: readonly import("../element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
10
10
  elements: readonly import("../element/types").ExcalidrawElement[];
11
11
  appState: Readonly<import("../types").AppState>;
12
- storeAction: import("../store").StoreActionType;
12
+ storeAction: "capture";
13
13
  };
14
14
  keyPriority: number;
15
15
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
@@ -28,7 +28,7 @@ export declare const actionBringForward: {
28
28
  perform: (elements: readonly import("../element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
29
29
  elements: readonly import("../element/types").ExcalidrawElement[];
30
30
  appState: Readonly<import("../types").AppState>;
31
- storeAction: import("../store").StoreActionType;
31
+ storeAction: "capture";
32
32
  };
33
33
  keyPriority: number;
34
34
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
@@ -47,7 +47,7 @@ export declare const actionSendToBack: {
47
47
  perform: (elements: readonly import("../element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
48
48
  elements: readonly import("../element/types").ExcalidrawElement[] | import("../element/types").ExcalidrawElement[];
49
49
  appState: Readonly<import("../types").AppState>;
50
- storeAction: import("../store").StoreActionType;
50
+ storeAction: "capture";
51
51
  };
52
52
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
53
53
  PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
@@ -65,7 +65,7 @@ export declare const actionBringToFront: {
65
65
  perform: (elements: readonly import("../element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
66
66
  elements: readonly import("../element/types").ExcalidrawElement[] | import("../element/types").ExcalidrawElement[];
67
67
  appState: Readonly<import("../types").AppState>;
68
- storeAction: import("../store").StoreActionType;
68
+ storeAction: "capture";
69
69
  };
70
70
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
71
71
  PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
@@ -356,7 +356,7 @@ declare class App extends React.Component<AppProps, AppState> {
356
356
  elements?: SceneData["elements"];
357
357
  appState?: Pick<AppState, K> | null | undefined;
358
358
  collaborators?: SceneData["collaborators"];
359
- /** @default StoreAction.CAPTURE */
359
+ /** @default StoreAction.NONE */
360
360
  storeAction?: SceneData["storeAction"];
361
361
  }) => void;
362
362
  private triggerRender;
@@ -413,6 +413,7 @@ declare class App extends React.Component<AppProps, AppState> {
413
413
  private hitElement;
414
414
  private getTextBindableContainerAtPosition;
415
415
  private startTextEditing;
416
+ private debounceDoubleClickTimestamp;
416
417
  private handleCanvasDoubleClick;
417
418
  private getElementLinkAtPosition;
418
419
  private redirectToLink;
@@ -199,7 +199,7 @@ export declare const actionSetEmbeddableAsActiveTool: {
199
199
  userToFollow: import("../types").UserToFollow | null;
200
200
  followedBy: Set<import("../types").SocketId>;
201
201
  };
202
- storeAction: import("../store").StoreActionType;
202
+ storeAction: "none";
203
203
  };
204
204
  } & {
205
205
  keyTest?: undefined;
@@ -20,6 +20,7 @@ export declare const newMagicFrameElement: (opts: {
20
20
  export declare const newTextElement: (opts: {
21
21
  text: string;
22
22
  rawText: string;
23
+ originalText?: string;
23
24
  fontSize?: number;
24
25
  fontFamily?: FontFamilyValues;
25
26
  textAlign?: TextAlign;
@@ -27,6 +28,7 @@ export declare const newTextElement: (opts: {
27
28
  containerId?: ExcalidrawTextContainer["id"] | null;
28
29
  lineHeight?: ExcalidrawTextElement["lineHeight"];
29
30
  strokeWidth?: ExcalidrawTextElement["strokeWidth"];
31
+ autoResize?: ExcalidrawTextElement["autoResize"];
30
32
  } & ElementConstructorOpts) => NonDeleted<ExcalidrawTextElement>;
31
33
  export declare const refreshTextDimensions: (textElement: ExcalidrawTextElement, container: ExcalidrawTextContainer | null, elementsMap: ElementsMap, text?: string) => {
32
34
  x: number;
@@ -2,11 +2,41 @@ import { AppStateChange, ElementsChange } from "./change";
2
2
  import type { OrderedExcalidrawElement } from "./element/types";
3
3
  import { Emitter } from "./emitter";
4
4
  import type { AppState, ObservedAppState } from "./types";
5
+ import type { ValueOf } from "./utility-types";
5
6
  export declare const getObservedAppState: (appState: AppState) => ObservedAppState;
6
- export type StoreActionType = "capture" | "update" | "none";
7
7
  export declare const StoreAction: {
8
- [K in Uppercase<StoreActionType>]: StoreActionType;
8
+ /**
9
+ * Immediately undoable.
10
+ *
11
+ * Use for updates which should be captured.
12
+ * Should be used for most of the local updates.
13
+ *
14
+ * These updates will _immediately_ make it to the local undo / redo stacks.
15
+ */
16
+ readonly CAPTURE: "capture";
17
+ /**
18
+ * Never undoable.
19
+ *
20
+ * Use for updates which should never be recorded, such as remote updates
21
+ * or scene initialization.
22
+ *
23
+ * These updates will _never_ make it to the local undo / redo stacks.
24
+ */
25
+ readonly UPDATE: "update";
26
+ /**
27
+ * Eventually undoable.
28
+ *
29
+ * Use for updates which should not be captured immediately - likely
30
+ * exceptions which are part of some async multi-step process. Otherwise, all
31
+ * such updates would end up being captured with the next
32
+ * `StoreAction.CAPTURE` - triggered either by the next `updateScene`
33
+ * or internally by the editor.
34
+ *
35
+ * These updates will _eventually_ make it to the local undo / redo stacks.
36
+ */
37
+ readonly NONE: "none";
9
38
  };
39
+ export type StoreActionType = ValueOf<typeof StoreAction>;
10
40
  /**
11
41
  * Represent an increment to the Store.
12
42
  */