@myoc/math 0.19.503 → 0.19.505

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 (48) hide show
  1. package/dist/types/element/src/arrange-algorithms/maxRects.d.ts +16 -0
  2. package/dist/types/element/src/linearElementEditor.d.ts +1 -1
  3. package/dist/types/element/src/types.d.ts +1 -1
  4. package/dist/types/excalidraw/actions/actionAlign.d.ts +8 -8
  5. package/dist/types/excalidraw/actions/actionArrange.d.ts +2 -2
  6. package/dist/types/excalidraw/actions/actionCanvas.d.ts +16 -16
  7. package/dist/types/excalidraw/actions/actionClipboard.d.ts +2 -2
  8. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +2 -2
  9. package/dist/types/excalidraw/actions/actionDistribute.d.ts +4 -4
  10. package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +2 -2
  11. package/dist/types/excalidraw/actions/actionElementLock.d.ts +2 -2
  12. package/dist/types/excalidraw/actions/actionExport.d.ts +12 -12
  13. package/dist/types/excalidraw/actions/actionFlip.d.ts +4 -4
  14. package/dist/types/excalidraw/actions/actionFrame.d.ts +2 -2
  15. package/dist/types/excalidraw/actions/actionGroup.d.ts +4 -4
  16. package/dist/types/excalidraw/actions/actionLink.d.ts +2 -2
  17. package/dist/types/excalidraw/actions/actionMenu.d.ts +2 -2
  18. package/dist/types/excalidraw/actions/actionProperties.d.ts +5 -5
  19. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +3 -3
  20. package/dist/types/excalidraw/actions/actionSmartZoom.d.ts +2 -2
  21. package/dist/types/excalidraw/actions/actionStyles.d.ts +4 -4
  22. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +1 -1
  23. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +2 -2
  24. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +2 -2
  25. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +2 -2
  26. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +2 -2
  27. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +2 -2
  28. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +2 -2
  29. package/dist/types/excalidraw/actions/actionZindex.d.ts +8 -8
  30. package/dist/types/excalidraw/appState.d.ts +7 -7
  31. package/dist/types/excalidraw/components/App.d.ts +10 -1
  32. package/dist/types/excalidraw/data/blob.d.ts +12 -12
  33. package/dist/types/excalidraw/data/json.d.ts +6 -6
  34. package/dist/types/excalidraw/editorPreferences.d.ts +11 -0
  35. package/dist/types/excalidraw/types.d.ts +23 -0
  36. package/package.json +2 -2
  37. package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -4
  38. package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +0 -15
  39. package/dist/types/excalidraw/components/InitializeApp.d.ts +0 -10
  40. package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +0 -8
  41. package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -11
  42. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -58
  43. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -19
  44. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +0 -84
  45. package/dist/types/excalidraw/data/reconcile.d.ts +0 -7
  46. package/dist/types/excalidraw/hooks/useAppStateValue.d.ts +0 -29
  47. package/dist/types/excalidraw/index.d.ts +0 -64
  48. package/dist/types/excalidraw/polyfill.d.ts +0 -2
@@ -12,10 +12,10 @@ export declare const actionSendBackward: {
12
12
  captureUpdate: "IMMEDIATELY";
13
13
  };
14
14
  keyPriority: number;
15
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
15
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
16
16
  PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
17
17
  } & {
18
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
18
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
19
19
  };
20
20
  export declare const actionBringForward: {
21
21
  name: "bringForward";
@@ -31,10 +31,10 @@ export declare const actionBringForward: {
31
31
  captureUpdate: "IMMEDIATELY";
32
32
  };
33
33
  keyPriority: number;
34
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
34
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
35
35
  PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
36
36
  } & {
37
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
37
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
38
38
  };
39
39
  export declare const actionSendToBack: {
40
40
  name: "sendToBack";
@@ -49,10 +49,10 @@ export declare const actionSendToBack: {
49
49
  appState: Readonly<import("../types").AppState>;
50
50
  captureUpdate: "IMMEDIATELY";
51
51
  };
52
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
52
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
53
53
  PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
54
54
  } & {
55
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
55
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
56
56
  };
57
57
  export declare const actionBringToFront: {
58
58
  name: "bringToFront";
@@ -67,8 +67,8 @@ export declare const actionBringToFront: {
67
67
  appState: Readonly<import("../types").AppState>;
68
68
  captureUpdate: "IMMEDIATELY";
69
69
  };
70
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
70
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
71
71
  PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
72
72
  } & {
73
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
73
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
74
74
  };
@@ -30,11 +30,14 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
30
30
  currentItemArrowType?: "round" | "sharp" | "elbow" | undefined;
31
31
  bindMode?: import("@excalidraw/element/types").BindMode | undefined;
32
32
  gridSize?: number | undefined;
33
+ gridModeEnabled?: boolean | undefined;
34
+ objectsSnapModeEnabled?: boolean | undefined;
35
+ wheelZoomsOnDefault?: boolean | undefined;
36
+ gridStep?: number | undefined;
33
37
  showWelcomeScreen?: boolean | undefined;
34
38
  myocSimplifiedMode?: boolean | undefined;
35
39
  dontResizeLimitMBs?: number | undefined;
36
40
  hideMainMenus?: boolean | undefined;
37
- wheelZoomsOnDefault?: boolean | undefined;
38
41
  arrangeConfiguration?: {
39
42
  algorithm: import("@excalidraw/element/types").ArrangeAlgorithms;
40
43
  gap: number;
@@ -43,7 +46,7 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
43
46
  mode: import("./types").NormaliseMode;
44
47
  metric: import("./types").NormaliseMetric;
45
48
  } | undefined;
46
- bindingPreference?: "enabled" | "disabled" | undefined;
49
+ bindingPreference?: "disabled" | "enabled" | undefined;
47
50
  preferredSelectionTool?: {
48
51
  type: "selection" | "lasso";
49
52
  initialized: boolean;
@@ -78,13 +81,10 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
78
81
  previousSelectedElementIds?: {
79
82
  [id: string]: true;
80
83
  } | undefined;
81
- gridStep?: number | undefined;
82
- gridModeEnabled?: boolean | undefined;
83
84
  stats?: {
84
85
  open: boolean;
85
86
  panels: number;
86
87
  } | undefined;
87
- objectsSnapModeEnabled?: boolean | undefined;
88
88
  lockedMultiSelections?: {
89
89
  [groupId: string]: true;
90
90
  } | undefined;
@@ -92,8 +92,8 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
92
92
  export declare const cleanAppStateForExport: (appState: Partial<AppState>) => {
93
93
  viewBackgroundColor?: string | undefined;
94
94
  gridSize?: number | undefined;
95
- gridStep?: number | undefined;
96
95
  gridModeEnabled?: boolean | undefined;
96
+ gridStep?: number | undefined;
97
97
  lockedMultiSelections?: {
98
98
  [groupId: string]: true;
99
99
  } | undefined;
@@ -101,8 +101,8 @@ export declare const cleanAppStateForExport: (appState: Partial<AppState>) => {
101
101
  export declare const clearAppStateForDatabase: (appState: Partial<AppState>) => {
102
102
  viewBackgroundColor?: string | undefined;
103
103
  gridSize?: number | undefined;
104
- gridStep?: number | undefined;
105
104
  gridModeEnabled?: boolean | undefined;
105
+ gridStep?: number | undefined;
106
106
  lockedMultiSelections?: {
107
107
  [groupId: string]: true;
108
108
  } | undefined;
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import { AppEventBus, type EXPORT_IMAGE_TYPES, Emitter, type EditorInterface, type StylesPanelMode } from "@excalidraw/common";
3
- import { LinearElementEditor, FlowChartCreator, Scene, Store, type ElementUpdate, StoreDelta, type ApplyToOptions } from "@excalidraw/element";
3
+ import { FlowChartCreator, Scene, Store, type ElementUpdate, StoreDelta, type ApplyToOptions } from "@excalidraw/element";
4
+ import { LinearElementEditor } from "@excalidraw/element/linearElementEditor";
4
5
  import type { ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement, ExcalidrawFrameLikeElement, ExcalidrawIframeElement, ExcalidrawEmbeddableElement, Ordered, SceneElementsMap } from "@excalidraw/element/types";
5
6
  import type { Mutable } from "@excalidraw/common/utility-types";
6
7
  import { ActionManager } from "../actions/manager";
@@ -381,6 +382,14 @@ declare class App extends React.Component<AppProps, AppState> {
381
382
  */
382
383
  value: number) => void;
383
384
  private cancelInProgressAnimation;
385
+ scrollToViewport: (target: {
386
+ scrollX: number;
387
+ scrollY: number;
388
+ zoom: number;
389
+ }, opts?: {
390
+ animate?: boolean;
391
+ duration?: number;
392
+ }) => void;
384
393
  scrollToContent: (
385
394
  /**
386
395
  * target to scroll to
@@ -95,6 +95,12 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
95
95
  currentItemArrowType: "sharp" | "round" | "elbow";
96
96
  bindMode: import("@excalidraw/element/types").BindMode;
97
97
  gridSize: number;
98
+ gridModeEnabled: boolean;
99
+ objectsSnapModeEnabled: boolean;
100
+ wheelZoomsOnDefault?: boolean | undefined;
101
+ selectedElementsAreBeingDragged: boolean;
102
+ gridStep: number;
103
+ currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
98
104
  contextMenu: {
99
105
  items: import("../components/ContextMenu").ContextMenuItems;
100
106
  top: number;
@@ -105,7 +111,6 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
105
111
  myocSimplifiedMode: boolean;
106
112
  dontResizeLimitMBs: number;
107
113
  hideMainMenus: boolean;
108
- wheelZoomsOnDefault?: boolean | undefined;
109
114
  arrangeConfiguration: {
110
115
  algorithm: import("@excalidraw/element/types").ArrangeAlgorithms;
111
116
  gap: number;
@@ -140,7 +145,6 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
140
145
  currentItemTextAlign: import("@excalidraw/element/types").TextAlign;
141
146
  currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null;
142
147
  currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
143
- currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
144
148
  currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
145
149
  cursorButton: "up" | "down";
146
150
  scrolledOutside: boolean;
@@ -156,14 +160,11 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
156
160
  previousSelectedElementIds: {
157
161
  [id: string]: true;
158
162
  };
159
- selectedElementsAreBeingDragged: boolean;
160
163
  toast: {
161
164
  message: React.ReactNode;
162
165
  closable?: boolean;
163
166
  duration?: number;
164
167
  } | null;
165
- gridStep: number;
166
- gridModeEnabled: boolean;
167
168
  fileHandle: FileSystemFileHandle | null;
168
169
  stats: {
169
170
  open: boolean;
@@ -174,7 +175,6 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
174
175
  x: number;
175
176
  y: number;
176
177
  } | null;
177
- objectsSnapModeEnabled: boolean;
178
178
  userToFollow: import("../types").UserToFollow | null;
179
179
  followedBy: Set<import("../types").SocketId>;
180
180
  lockedMultiSelections: {
@@ -269,6 +269,12 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
269
269
  currentItemArrowType: "sharp" | "round" | "elbow";
270
270
  bindMode: import("@excalidraw/element/types").BindMode;
271
271
  gridSize: number;
272
+ gridModeEnabled: boolean;
273
+ objectsSnapModeEnabled: boolean;
274
+ wheelZoomsOnDefault?: boolean | undefined;
275
+ selectedElementsAreBeingDragged: boolean;
276
+ gridStep: number;
277
+ currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
272
278
  contextMenu: {
273
279
  items: import("../components/ContextMenu").ContextMenuItems;
274
280
  top: number;
@@ -279,7 +285,6 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
279
285
  myocSimplifiedMode: boolean;
280
286
  dontResizeLimitMBs: number;
281
287
  hideMainMenus: boolean;
282
- wheelZoomsOnDefault?: boolean | undefined;
283
288
  arrangeConfiguration: {
284
289
  algorithm: import("@excalidraw/element/types").ArrangeAlgorithms;
285
290
  gap: number;
@@ -314,7 +319,6 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
314
319
  currentItemTextAlign: import("@excalidraw/element/types").TextAlign;
315
320
  currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null;
316
321
  currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
317
- currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
318
322
  currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
319
323
  cursorButton: "up" | "down";
320
324
  scrolledOutside: boolean;
@@ -330,14 +334,11 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
330
334
  previousSelectedElementIds: {
331
335
  [id: string]: true;
332
336
  };
333
- selectedElementsAreBeingDragged: boolean;
334
337
  toast: {
335
338
  message: React.ReactNode;
336
339
  closable?: boolean;
337
340
  duration?: number;
338
341
  } | null;
339
- gridStep: number;
340
- gridModeEnabled: boolean;
341
342
  fileHandle: FileSystemFileHandle | null;
342
343
  stats: {
343
344
  open: boolean;
@@ -348,7 +349,6 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
348
349
  x: number;
349
350
  y: number;
350
351
  } | null;
351
- objectsSnapModeEnabled: boolean;
352
352
  userToFollow: import("../types").UserToFollow | null;
353
353
  followedBy: Set<import("../types").SocketId>;
354
354
  lockedMultiSelections: {
@@ -93,6 +93,12 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
93
93
  currentItemArrowType: "sharp" | "round" | "elbow";
94
94
  bindMode: import("@excalidraw/element/types").BindMode;
95
95
  gridSize: number;
96
+ gridModeEnabled: boolean;
97
+ objectsSnapModeEnabled: boolean;
98
+ wheelZoomsOnDefault?: boolean | undefined;
99
+ selectedElementsAreBeingDragged: boolean;
100
+ gridStep: number;
101
+ currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
96
102
  contextMenu: {
97
103
  items: import("../components/ContextMenu").ContextMenuItems;
98
104
  top: number;
@@ -103,7 +109,6 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
103
109
  myocSimplifiedMode: boolean;
104
110
  dontResizeLimitMBs: number;
105
111
  hideMainMenus: boolean;
106
- wheelZoomsOnDefault?: boolean | undefined;
107
112
  arrangeConfiguration: {
108
113
  algorithm: import("@excalidraw/element/types").ArrangeAlgorithms;
109
114
  gap: number;
@@ -138,7 +143,6 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
138
143
  currentItemTextAlign: import("@excalidraw/element/types").TextAlign;
139
144
  currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null;
140
145
  currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
141
- currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
142
146
  currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
143
147
  cursorButton: "up" | "down";
144
148
  scrolledOutside: boolean;
@@ -154,14 +158,11 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
154
158
  previousSelectedElementIds: {
155
159
  [id: string]: true;
156
160
  };
157
- selectedElementsAreBeingDragged: boolean;
158
161
  toast: {
159
162
  message: React.ReactNode;
160
163
  closable?: boolean;
161
164
  duration?: number;
162
165
  } | null;
163
- gridStep: number;
164
- gridModeEnabled: boolean;
165
166
  fileHandle: FileSystemFileHandle | null;
166
167
  stats: {
167
168
  open: boolean;
@@ -172,7 +173,6 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
172
173
  x: number;
173
174
  y: number;
174
175
  } | null;
175
- objectsSnapModeEnabled: boolean;
176
176
  userToFollow: import("../types").UserToFollow | null;
177
177
  followedBy: Set<import("../types").SocketId>;
178
178
  lockedMultiSelections: {
@@ -0,0 +1,11 @@
1
+ import type { AppState, ArrangePreferences, EditorPreferences, NormalisePreferences, SmartZoomPreferences } from "./types";
2
+ export type ResolvedSmartZoomPreferences = Required<SmartZoomPreferences>;
3
+ export type ResolvedArrangePreferences = Required<ArrangePreferences>;
4
+ export type ResolvedNormalisePreferences = Required<NormalisePreferences>;
5
+ export type ResolvedEditorPreferences = {
6
+ smartZoom: ResolvedSmartZoomPreferences;
7
+ arrange: ResolvedArrangePreferences;
8
+ normalise: ResolvedNormalisePreferences;
9
+ };
10
+ export declare const DEFAULT_SMART_ZOOM_PREFERENCES: ResolvedSmartZoomPreferences;
11
+ export declare const getEffectiveEditorPreferences: (appState: Readonly<Pick<AppState, "arrangeConfiguration" | "normaliseConfiguration">>, editorPreferences?: EditorPreferences) => ResolvedEditorPreferences;
@@ -174,6 +174,25 @@ export type ObservedElementsAppState = {
174
174
  };
175
175
  export type NormaliseMode = "first" | "average";
176
176
  export type NormaliseMetric = "scale" | "height" | "width" | "size";
177
+ export type SmartZoomPreferences = {
178
+ fitToViewport?: boolean;
179
+ animate?: boolean;
180
+ duration?: number;
181
+ viewportZoomFactor?: number;
182
+ };
183
+ export type ArrangePreferences = {
184
+ algorithm?: ArrangeAlgorithms;
185
+ gap?: number;
186
+ };
187
+ export type NormalisePreferences = {
188
+ mode?: NormaliseMode;
189
+ metric?: NormaliseMetric;
190
+ };
191
+ export type EditorPreferences = {
192
+ smartZoom?: SmartZoomPreferences;
193
+ arrange?: ArrangePreferences;
194
+ normalise?: NormalisePreferences;
195
+ };
177
196
  export interface AppState {
178
197
  contextMenu: {
179
198
  items: ContextMenuItems;
@@ -511,6 +530,8 @@ export interface ExcalidrawProps {
511
530
  theme?: Theme;
512
531
  name?: string;
513
532
  renderCustomStats?: (elements: readonly NonDeletedExcalidrawElement[], appState: UIAppState) => JSX.Element;
533
+ editorPreferences?: EditorPreferences;
534
+ onEditorPreferencesChange?: (next: EditorPreferences) => void;
514
535
  UIOptions?: Partial<UIOptions>;
515
536
  detectScroll?: boolean;
516
537
  handleKeyboardGlobally?: boolean;
@@ -628,6 +649,7 @@ export type AppClassProperties = {
628
649
  onInsertElements: App["onInsertElements"];
629
650
  onExportImage: App["onExportImage"];
630
651
  lastViewportPosition: App["lastViewportPosition"];
652
+ scrollToViewport: App["scrollToViewport"];
631
653
  scrollToContent: App["scrollToContent"];
632
654
  addFiles: App["addFiles"];
633
655
  addElementsFromPasteOrLibrary: App["addElementsFromPasteOrLibrary"];
@@ -740,6 +762,7 @@ export interface ExcalidrawImperativeAPI {
740
762
  getAppState: () => InstanceType<typeof App>["state"];
741
763
  getFiles: () => InstanceType<typeof App>["files"];
742
764
  getName: InstanceType<typeof App>["getName"];
765
+ scrollToViewport: InstanceType<typeof App>["scrollToViewport"];
743
766
  scrollToContent: InstanceType<typeof App>["scrollToContent"];
744
767
  registerAction: (action: Action) => void;
745
768
  refresh: InstanceType<typeof App>["refresh"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myoc/math",
3
- "version": "0.19.503",
3
+ "version": "0.19.505",
4
4
  "type": "module",
5
5
  "types": "./dist/types/math/src/index.d.ts",
6
6
  "main": "./dist/prod/index.js",
@@ -61,6 +61,6 @@
61
61
  "build:esm": "rimraf dist && node ../../scripts/buildBase.js && yarn gen:types"
62
62
  },
63
63
  "dependencies": {
64
- "@excalidraw/common": "npm:@myoc/common@0.19.503"
64
+ "@excalidraw/common": "npm:@myoc/common@0.19.505"
65
65
  }
66
66
  }
@@ -1,4 +0,0 @@
1
- import type { GenerateDiagramToCode } from "../../types";
2
- export declare const DiagramToCodePlugin: (props: {
3
- generate: GenerateDiagramToCode;
4
- }) => null;
@@ -1,15 +0,0 @@
1
- import "./ExcalidrawLogo.scss";
2
- type LogoSize = "xs" | "small" | "normal" | "large" | "custom" | "mobile";
3
- interface LogoProps {
4
- size?: LogoSize;
5
- withText?: boolean;
6
- style?: React.CSSProperties;
7
- /**
8
- * If true, the logo will not be wrapped in a Link component.
9
- * The link prop will be ignored as well.
10
- * It will merely be a plain div.
11
- */
12
- isNotLink?: boolean;
13
- }
14
- export declare const ExcalidrawLogo: ({ style, size, withText, }: LogoProps) => import("react/jsx-runtime").JSX.Element;
15
- export {};
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- import type { Theme } from "@excalidraw/element/types";
3
- import type { Language } from "../i18n";
4
- interface Props {
5
- langCode: Language["code"];
6
- children: React.ReactElement;
7
- theme?: Theme;
8
- }
9
- export declare const InitializeApp: (props: Props) => import("react/jsx-runtime").JSX.Element;
10
- export {};
@@ -1,8 +0,0 @@
1
- import "./FooterCenter.scss";
2
- declare const FooterCenter: {
3
- ({ children }: {
4
- children?: React.ReactNode;
5
- }): import("react/jsx-runtime").JSX.Element;
6
- displayName: string;
7
- };
8
- export default FooterCenter;
@@ -1,11 +0,0 @@
1
- import { type EditorInterface } from "@excalidraw/common";
2
- import "./LiveCollaborationTrigger.scss";
3
- declare const LiveCollaborationTrigger: {
4
- ({ isCollaborating, onSelect, editorInterface, ...rest }: {
5
- isCollaborating: boolean;
6
- onSelect: () => void;
7
- editorInterface?: EditorInterface;
8
- } & React.ButtonHTMLAttributes<HTMLButtonElement>): import("react/jsx-runtime").JSX.Element;
9
- displayName: string;
10
- };
11
- export default LiveCollaborationTrigger;
@@ -1,58 +0,0 @@
1
- import type { JSX } from "react";
2
- declare const Center: {
3
- ({ children }: {
4
- children?: React.ReactNode;
5
- }): import("react/jsx-runtime").JSX.Element;
6
- displayName: string;
7
- Logo: {
8
- ({ children }: {
9
- children?: React.ReactNode;
10
- }): import("react/jsx-runtime").JSX.Element;
11
- displayName: string;
12
- };
13
- Heading: {
14
- ({ children }: {
15
- children: React.ReactNode;
16
- }): import("react/jsx-runtime").JSX.Element;
17
- displayName: string;
18
- };
19
- Menu: {
20
- ({ children }: {
21
- children?: React.ReactNode;
22
- }): import("react/jsx-runtime").JSX.Element;
23
- displayName: string;
24
- };
25
- MenuItem: {
26
- ({ onSelect, children, icon, shortcut, className, ...props }: {
27
- onSelect: () => void;
28
- children: React.ReactNode;
29
- icon?: JSX.Element;
30
- shortcut?: string | null;
31
- } & React.ButtonHTMLAttributes<HTMLButtonElement>): import("react/jsx-runtime").JSX.Element;
32
- displayName: string;
33
- };
34
- MenuItemLink: {
35
- ({ children, href, icon, shortcut, className, ...props }: {
36
- children: React.ReactNode;
37
- href: string;
38
- icon?: JSX.Element;
39
- shortcut?: string | null;
40
- } & React.AnchorHTMLAttributes<HTMLAnchorElement>): import("react/jsx-runtime").JSX.Element;
41
- displayName: string;
42
- };
43
- MenuItemHelp: {
44
- (): import("react/jsx-runtime").JSX.Element;
45
- displayName: string;
46
- };
47
- MenuItemLoadScene: {
48
- (): import("react/jsx-runtime").JSX.Element | null;
49
- displayName: string;
50
- };
51
- MenuItemLiveCollaborationTrigger: {
52
- ({ onSelect, }: {
53
- onSelect: () => any;
54
- }): import("react/jsx-runtime").JSX.Element;
55
- displayName: string;
56
- };
57
- };
58
- export { Center };
@@ -1,19 +0,0 @@
1
- declare const MenuHint: {
2
- ({ children }: {
3
- children?: React.ReactNode;
4
- }): import("react/jsx-runtime").JSX.Element;
5
- displayName: string;
6
- };
7
- declare const ToolbarHint: {
8
- ({ children }: {
9
- children?: React.ReactNode;
10
- }): import("react/jsx-runtime").JSX.Element;
11
- displayName: string;
12
- };
13
- declare const HelpHint: {
14
- ({ children }: {
15
- children?: React.ReactNode;
16
- }): import("react/jsx-runtime").JSX.Element;
17
- displayName: string;
18
- };
19
- export { HelpHint, MenuHint, ToolbarHint };
@@ -1,84 +0,0 @@
1
- import "./WelcomeScreen.scss";
2
- declare const WelcomeScreen: {
3
- (props: {
4
- children?: React.ReactNode;
5
- }): import("react/jsx-runtime").JSX.Element;
6
- displayName: string;
7
- Center: {
8
- ({ children }: {
9
- children?: React.ReactNode;
10
- }): import("react/jsx-runtime").JSX.Element;
11
- displayName: string;
12
- Logo: {
13
- ({ children }: {
14
- children?: React.ReactNode;
15
- }): import("react/jsx-runtime").JSX.Element;
16
- displayName: string;
17
- };
18
- Heading: {
19
- ({ children }: {
20
- children: React.ReactNode;
21
- }): import("react/jsx-runtime").JSX.Element;
22
- displayName: string;
23
- };
24
- Menu: {
25
- ({ children }: {
26
- children?: React.ReactNode;
27
- }): import("react/jsx-runtime").JSX.Element;
28
- displayName: string;
29
- };
30
- MenuItem: {
31
- ({ onSelect, children, icon, shortcut, className, ...props }: {
32
- onSelect: () => void;
33
- children: React.ReactNode;
34
- icon?: import("react").JSX.Element;
35
- shortcut?: string | null;
36
- } & React.ButtonHTMLAttributes<HTMLButtonElement>): import("react/jsx-runtime").JSX.Element;
37
- displayName: string;
38
- };
39
- MenuItemLink: {
40
- ({ children, href, icon, shortcut, className, ...props }: {
41
- children: React.ReactNode;
42
- href: string;
43
- icon?: import("react").JSX.Element;
44
- shortcut?: string | null;
45
- } & React.AnchorHTMLAttributes<HTMLAnchorElement>): import("react/jsx-runtime").JSX.Element;
46
- displayName: string;
47
- };
48
- MenuItemHelp: {
49
- (): import("react/jsx-runtime").JSX.Element;
50
- displayName: string;
51
- };
52
- MenuItemLoadScene: {
53
- (): import("react/jsx-runtime").JSX.Element | null;
54
- displayName: string;
55
- };
56
- MenuItemLiveCollaborationTrigger: {
57
- ({ onSelect, }: {
58
- onSelect: () => any;
59
- }): import("react/jsx-runtime").JSX.Element;
60
- displayName: string;
61
- };
62
- };
63
- Hints: {
64
- MenuHint: {
65
- ({ children }: {
66
- children?: React.ReactNode;
67
- }): import("react/jsx-runtime").JSX.Element;
68
- displayName: string;
69
- };
70
- ToolbarHint: {
71
- ({ children }: {
72
- children?: React.ReactNode;
73
- }): import("react/jsx-runtime").JSX.Element;
74
- displayName: string;
75
- };
76
- HelpHint: {
77
- ({ children }: {
78
- children?: React.ReactNode;
79
- }): import("react/jsx-runtime").JSX.Element;
80
- displayName: string;
81
- };
82
- };
83
- };
84
- export default WelcomeScreen;
@@ -1,7 +0,0 @@
1
- import type { OrderedExcalidrawElement } from "@excalidraw/element/types";
2
- import type { MakeBrand } from "@excalidraw/common/utility-types";
3
- import type { AppState } from "../types";
4
- export type ReconciledExcalidrawElement = OrderedExcalidrawElement & MakeBrand<"ReconciledElement">;
5
- export type RemoteExcalidrawElement = OrderedExcalidrawElement & MakeBrand<"RemoteExcalidrawElement">;
6
- export declare const shouldDiscardRemoteElement: (localAppState: AppState, local: OrderedExcalidrawElement | undefined, remote: RemoteExcalidrawElement) => boolean;
7
- export declare const reconcileElements: (localElements: readonly OrderedExcalidrawElement[], remoteElements: readonly RemoteExcalidrawElement[], localAppState: AppState) => ReconciledExcalidrawElement[];
@@ -1,29 +0,0 @@
1
- import type { AppState } from "../types";
2
- /**
3
- * Subscribes to specific appState changes. The component re-renders
4
- * only when the specified prop(s) change — not on every appState update.
5
- *
6
- * Works both inside and outside the <Excalidraw> tree, as long as
7
- * ExcalidrawAPIContext.Provider is an ancestor (automatically provided
8
- * inside <Excalidraw>, or manually by the host app).
9
- *
10
- * Returns the narrowed value depending on prop form:
11
- * - `keyof AppState` → `AppState[K]`
12
- * - `(keyof AppState)[]` → whole `AppState`
13
- * - selector function → selector's return type `T`
14
- *
15
- * If excalidrawAPI is not ready yet (host apps), hook is rerendered with latest
16
- * value once available.
17
- */
18
- export declare function useAppStateValue<K extends keyof AppState>(prop: K, _internal?: boolean): AppState[K];
19
- export declare function useAppStateValue(props: (keyof AppState)[], _internal?: boolean): AppState;
20
- export declare function useAppStateValue<T>(selector: (appState: AppState) => T, _internal?: boolean): T;
21
- /**
22
- * Subscribes to specific appState changes without causing component rerenders.
23
- *
24
- * The callback is called on every matching change, but also on initial render
25
- * so you can initialize your state.
26
- */
27
- export declare function useOnAppStateChange<K extends keyof AppState>(prop: K, callback: (value: AppState[K], appState: AppState) => void): undefined;
28
- export declare function useOnAppStateChange(props: (keyof AppState)[], callback: (props: AppState, appState: AppState) => void): undefined;
29
- export declare function useOnAppStateChange<T>(selector: (appState: AppState) => T, callback: (value: T, appState: AppState) => void): undefined;