@zsviczian/excalidraw 0.11.0-obsidian-18 → 0.11.0-obsidian-21

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 (120) hide show
  1. package/dist/excalidraw.development.js +88 -88
  2. package/dist/excalidraw.production.min.js +1 -1
  3. package/package.json +7 -7
  4. package/types/actions/actionNavigate.d.ts +1 -1
  5. package/types/actions/types.d.ts +1 -5
  6. package/types/appState.d.ts +1 -1
  7. package/types/charts.d.ts +8 -0
  8. package/types/components/App.d.ts +11 -3
  9. package/types/components/LayerUI.d.ts +1 -1
  10. package/types/components/LibraryMenu.d.ts +3 -3
  11. package/types/components/LibraryMenuItems.d.ts +4 -4
  12. package/types/components/LibraryUnit.d.ts +2 -1
  13. package/types/components/MobileMenu.d.ts +1 -1
  14. package/types/components/UserList.d.ts +6 -5
  15. package/types/constants.d.ts +3 -0
  16. package/types/data/blob.d.ts +21 -1
  17. package/types/data/json.d.ts +0 -2
  18. package/types/data/library.d.ts +18 -7
  19. package/types/data/types.d.ts +2 -2
  20. package/types/distribute.d.ts +6 -0
  21. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-ar-SA-json-f37c9765d6ba9c94db28.d.ts +0 -0
  22. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-bg-BG-json-d8c72e41cf02e763b54c.d.ts +0 -0
  23. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-bn-BD-json-246ddff2b69891d1399d.d.ts +0 -0
  24. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-ca-ES-json-2583291c4633e96df9d6.d.ts +0 -0
  25. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-cs-CZ-json-7fb82d30a7139f991154.d.ts +0 -0
  26. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-da-DK-json-5f58e2d75044deee8410.d.ts +0 -0
  27. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-de-DE-json-20912cca3094f0524a21.d.ts +0 -0
  28. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-el-GR-json-96277306136a9ee3d56c.d.ts +0 -0
  29. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-es-ES-json-2d9209d0d8b45e340212.d.ts +0 -0
  30. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-eu-ES-json-40142a580d932c8cb50d.d.ts +0 -0
  31. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-fa-IR-json-5aa04fe7e238f87f3607.d.ts +0 -0
  32. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-fi-FI-json-2e5665a625fe47e2a60f.d.ts +0 -0
  33. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-fr-FR-json-ad79d60ccbf7da435101.d.ts +0 -0
  34. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-he-IL-json-5aa3ca202abb250e82bd.d.ts +0 -0
  35. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-hi-IN-json-8fe2d63926e008f5725c.d.ts +0 -0
  36. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-hu-HU-json-78e1c51d6d92ed32aa2f.d.ts +0 -0
  37. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-id-ID-json-6c529ed7cc3d5353bdc0.d.ts +0 -0
  38. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-it-IT-json-7c39e59e8682963a7851.d.ts +0 -0
  39. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-ja-JP-json-2263e6c8e274763d04cc.d.ts +0 -0
  40. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-kab-KAB-json-9974a930bde67748d79a.d.ts +0 -0
  41. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-kk-KZ-json-b1da82815e51b638b28e.d.ts +0 -0
  42. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-ko-KR-json-36dce31f57535a3884fc.d.ts +0 -0
  43. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-lt-LT-json-7e4b8147241a2807a1f1.d.ts +0 -0
  44. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-lv-LV-json-0292c4b3153e02ba01cc.d.ts +0 -0
  45. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-mr-IN-json-85e3bad5588e60eda6ed.d.ts +0 -0
  46. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-my-MM-json-a50d126ec63009915802.d.ts +0 -0
  47. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-nb-NO-json-dd7cd6513e3d00551949.d.ts +0 -0
  48. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-nl-NL-json-a2e36932c7b397dfdf8b.d.ts +0 -0
  49. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-nn-NO-json-76159e8cfa136255e657.d.ts +0 -0
  50. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-oc-FR-json-8fcbd2e5e589bc9b3f05.d.ts +0 -0
  51. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-pa-IN-json-664d068563584bb41ae4.d.ts +0 -0
  52. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-pl-PL-json-17d817993f240f65dc1f.d.ts +0 -0
  53. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-pt-BR-json-dfbe3455644130e9851c.d.ts +0 -0
  54. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-pt-PT-json-bda935fce18a7b179bcb.d.ts +0 -0
  55. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-ro-RO-json-3473997bac53931c8b1c.d.ts +0 -0
  56. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-ru-RU-json-2a58c91c91fbb9009a4a.d.ts +0 -0
  57. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-si-LK-json-0ad49043e4c810f4e8f2.d.ts +0 -0
  58. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-sk-SK-json-6a88d3cef7420263d448.d.ts +0 -0
  59. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-sl-SI-json-d883f256ad475721b51e.d.ts +0 -0
  60. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-sv-SE-json-ab9784b6a181e4b3e52b.d.ts +0 -0
  61. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-ta-IN-json-49b6bc876b7703f493e7.d.ts +0 -0
  62. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-tr-TR-json-e6a720f75140ee82da6d.d.ts +0 -0
  63. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-uk-UA-json-1d95323ec8040114490e.d.ts +0 -0
  64. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-zh-CN-json-facce09827627d918c14.d.ts +0 -0
  65. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-zh-HK-json-a6e21fe69a6a6f8c8ea6.d.ts +0 -0
  66. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-zh-TW-json-37610fbce479c7f8cef2.d.ts +0 -0
  67. package/types/packages/excalidraw/dist/excalidraw-assets/vendor-b9b3a25c026c138e55b2.d.ts +0 -0
  68. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-ar-SA-json-505ef559f47ea6b69719.d.ts +2 -0
  69. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-bg-BG-json-bcb00de8d85335103437.d.ts +2 -0
  70. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-bn-BD-json-20cb88b768b6656f69a0.d.ts +2 -0
  71. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-ca-ES-json-c0a2946ac526da48c821.d.ts +2 -0
  72. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-cs-CZ-json-3b57cc3db37bad8747c9.d.ts +2 -0
  73. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-da-DK-json-9fd1d27b5e867510c0c4.d.ts +2 -0
  74. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-de-DE-json-80aa4aed6cc5f0f47bec.d.ts +2 -0
  75. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-el-GR-json-08221c6f5387a7ef440e.d.ts +2 -0
  76. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-es-ES-json-bb7d7aa7840ad87ac15d.d.ts +2 -0
  77. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-eu-ES-json-1aff52bfd1a98cc073a3.d.ts +2 -0
  78. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-fa-IR-json-1af59f1130dd499b2aee.d.ts +2 -0
  79. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-fi-FI-json-874b4f80c8cb7c54ba9e.d.ts +2 -0
  80. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-fr-FR-json-b55b922b008349e24e30.d.ts +2 -0
  81. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-he-IL-json-e16fce9c2852e89a31f2.d.ts +2 -0
  82. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-hi-IN-json-96d1324664dcf226249e.d.ts +2 -0
  83. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-hu-HU-json-5e29c373127695ccfe28.d.ts +2 -0
  84. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-id-ID-json-c3b8c47e9f2cd5a218a4.d.ts +2 -0
  85. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-it-IT-json-c4ba0fd51730152b3389.d.ts +2 -0
  86. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-ja-JP-json-4fb9df48c7c2aca8709b.d.ts +2 -0
  87. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-kab-KAB-json-56a2f5b742bb44d84587.d.ts +2 -0
  88. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-kk-KZ-json-69f5849187a51635aa55.d.ts +2 -0
  89. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-ko-KR-json-be749d83561b4547fca0.d.ts +2 -0
  90. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-lt-LT-json-f74d8fbb36e64d164cb3.d.ts +2 -0
  91. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-lv-LV-json-05cafa9d59e825d37a30.d.ts +2 -0
  92. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-mr-IN-json-4df0aaed6b5bd9c354bf.d.ts +2 -0
  93. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-my-MM-json-10cd0a77755d74cc2d88.d.ts +2 -0
  94. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-nb-NO-json-0328d43c8eb21619f1ef.d.ts +2 -0
  95. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-nl-NL-json-ce7bba8e06a59e62a4d0.d.ts +2 -0
  96. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-nn-NO-json-64d56d9257aa9516e081.d.ts +2 -0
  97. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-oc-FR-json-efae2c9bbbc42a6f6c70.d.ts +2 -0
  98. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-pa-IN-json-6378d9552735e33a9fe3.d.ts +2 -0
  99. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-pl-PL-json-ed1bf39b6b8f8061299d.d.ts +2 -0
  100. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-pt-BR-json-2a02a619bfa9700ce852.d.ts +2 -0
  101. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-pt-PT-json-d28b9a54ff94e15ff9bb.d.ts +2 -0
  102. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-ro-RO-json-00d5715f05aa3063960a.d.ts +2 -0
  103. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-ru-RU-json-ac0637166d5b462e339f.d.ts +2 -0
  104. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-si-LK-json-63d7c3f1c548dd28b002.d.ts +2 -0
  105. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-sk-SK-json-42cdbcaa7b9a48f2d39f.d.ts +2 -0
  106. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-sl-SI-json-56b1f2e0db09f030df1d.d.ts +2 -0
  107. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-sv-SE-json-3eb8200f34c205bc6564.d.ts +2 -0
  108. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-ta-IN-json-6d1328c5b1be8952f272.d.ts +2 -0
  109. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-tr-TR-json-f19e7eace448e972fc37.d.ts +2 -0
  110. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-uk-UA-json-da0e1d496b320531f5dc.d.ts +2 -0
  111. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-zh-CN-json-84fc26b884a0a83892c9.d.ts +2 -0
  112. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-zh-HK-json-07799e9c9378a2263273.d.ts +2 -0
  113. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-zh-TW-json-61c7460fdc361e477121.d.ts +2 -0
  114. package/types/packages/excalidraw/dist/excalidraw-assets-dev/vendor-33bd21df77fc9cda16d2.d.ts +0 -0
  115. package/types/packages/excalidraw/example/App.d.ts +7 -0
  116. package/types/packages/excalidraw/example/sidebar/Sidebar.d.ts +5 -1
  117. package/types/packages/excalidraw/index.d.ts +3 -1
  118. package/types/packages/utils.d.ts +3 -1
  119. package/types/scene/Scene.d.ts +1 -2
  120. package/types/types.d.ts +12 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zsviczian/excalidraw",
3
- "version": "0.11.0-obsidian-18",
3
+ "version": "0.11.0-obsidian-21",
4
4
  "main": "main.js",
5
5
  "types": "types/packages/excalidraw/index.d.ts",
6
6
  "files": [
@@ -49,11 +49,11 @@
49
49
  "@babel/plugin-transform-async-to-generator": "7.16.0",
50
50
  "@babel/plugin-transform-runtime": "7.17.10",
51
51
  "@babel/plugin-transform-typescript": "7.16.1",
52
- "@babel/preset-env": "7.16.7",
52
+ "@babel/preset-env": "7.17.10",
53
53
  "@babel/preset-react": "7.16.7",
54
54
  "@babel/preset-typescript": "7.16.7",
55
- "autoprefixer": "10.4.5",
56
- "babel-loader": "8.2.3",
55
+ "autoprefixer": "10.4.7",
56
+ "babel-loader": "8.2.5",
57
57
  "babel-plugin-transform-class-properties": "6.24.1",
58
58
  "cross-env": "7.0.3",
59
59
  "css-loader": "6.7.1",
@@ -61,12 +61,12 @@
61
61
  "postcss-loader": "6.2.1",
62
62
  "sass-loader": "12.4.0",
63
63
  "terser-webpack-plugin": "5.3.1",
64
- "ts-loader": "9.2.8",
65
- "typescript": "4.5.4",
64
+ "ts-loader": "9.3.0",
65
+ "typescript": "4.6.4",
66
66
  "webpack": "5.72.0",
67
67
  "webpack-bundle-analyzer": "4.5.0",
68
68
  "webpack-cli": "4.9.2",
69
- "webpack-dev-server": "4.7.4",
69
+ "webpack-dev-server": "4.9.0",
70
70
  "webpack-merge": "5.8.0"
71
71
  },
72
72
  "bugs": "https://github.com/excalidraw/excalidraw/issues",
@@ -8,7 +8,7 @@ export declare const actionGoToCollaborator: {
8
8
  appState: Readonly<import("../types").AppState>;
9
9
  commitToHistory: false;
10
10
  };
11
- PanelComponent: ({ appState, updateData, data }: import("react").PropsWithChildren<import("./types").PanelComponentProps>) => JSX.Element | null;
11
+ PanelComponent: ({ appState, updateData, data }: import("react").PropsWithChildren<import("./types").PanelComponentProps>) => JSX.Element;
12
12
  } & {
13
13
  keyTest?: undefined;
14
14
  };
@@ -1,7 +1,6 @@
1
1
  import React from "react";
2
2
  import { ExcalidrawElement } from "../element/types";
3
3
  import { AppClassProperties, AppState, ExcalidrawProps, BinaryFiles } from "../types";
4
- import { ToolButtonSize } from "../components/ToolButton";
5
4
  export declare type ActionSource = "ui" | "keyboard" | "contextMenu" | "api";
6
5
  /** if false, the action should be prevented */
7
6
  export declare type ActionResult = {
@@ -21,10 +20,7 @@ export declare type PanelComponentProps = {
21
20
  appState: AppState;
22
21
  updateData: (formData?: any) => void;
23
22
  appProps: ExcalidrawProps;
24
- data?: Partial<{
25
- id: string;
26
- size: ToolButtonSize;
27
- }>;
23
+ data?: Record<string, any>;
28
24
  };
29
25
  export interface Action {
30
26
  name: ActionName;
@@ -3,7 +3,7 @@ export declare const getDefaultAppState: () => Omit<AppState, "offsetTop" | "off
3
3
  export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>) => {
4
4
  activeTool?: {
5
5
  type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
6
- lastActiveToolBeforeEraser: import("./types").LastActiveToolBeforeEraser; /** whether to keep when exporting to file/database */
6
+ lastActiveToolBeforeEraser: import("./types").LastActiveToolBeforeEraser;
7
7
  locked: boolean;
8
8
  customType: null;
9
9
  } | {
package/types/charts.d.ts CHANGED
@@ -14,6 +14,14 @@ declare type ParseSpreadsheetResult = {
14
14
  type: typeof VALID_SPREADSHEET;
15
15
  spreadsheet: Spreadsheet;
16
16
  };
17
+ /**
18
+ * @private exported for testing
19
+ */
20
+ export declare const tryParseNumber: (s: string) => number | null;
21
+ /**
22
+ * @private exported for testing
23
+ */
24
+ export declare const tryParseCells: (cells: string[][]) => ParseSpreadsheetResult;
17
25
  export declare const tryParseSpreadsheet: (text: string) => ParseSpreadsheetResult;
18
26
  export declare const renderSpreadsheet: (chartType: string, spreadsheet: Spreadsheet, x: number, y: number) => ChartElements;
19
27
  export {};
@@ -5,6 +5,7 @@ import { RestoredDataState } from "../data/restore";
5
5
  import { ExcalidrawElement, NonDeletedExcalidrawElement } from "../element/types";
6
6
  import History from "../history";
7
7
  import { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, DeviceType } from "../types";
8
+ import { FileSystemHandle } from "../data/filesystem";
8
9
  import { ImportedDataState } from "../data/types";
9
10
  export declare let showFourthFont: boolean;
10
11
  export declare const useDeviceType: () => DeviceType;
@@ -51,7 +52,6 @@ declare class App extends React.Component<AppProps, AppState> {
51
52
  private onUnload;
52
53
  private disableEvent;
53
54
  private onFontLoaded;
54
- private importLibraryFromUrl;
55
55
  private resetHistory;
56
56
  /**
57
57
  * Resets scene & history.
@@ -103,13 +103,21 @@ declare class App extends React.Component<AppProps, AppState> {
103
103
  appState?: Pick<AppState, K> | null | undefined;
104
104
  collaborators?: SceneData["collaborators"];
105
105
  commitToHistory?: SceneData["commitToHistory"];
106
- libraryItems?: LibraryItems | import("../types").LibraryItems_v1 | Promise<LibraryItems | import("../types").LibraryItems_v1> | ((currentLibraryItems: LibraryItems) => Required<SceneData>["libraryItems"] | Promise<Required<SceneData>["libraryItems"]>) | undefined;
107
106
  }) => void;
108
107
  private onSceneUpdated;
109
108
  private updateCurrentCursorPosition;
110
109
  private onKeyDown;
111
110
  private onKeyUp;
112
111
  private setActiveTool;
112
+ private setCursor;
113
+ private resetCursor;
114
+ /**
115
+ * returns whether user is making a gesture with >= 2 fingers (points)
116
+ * on o touch screen (not on a trackpad). Currently only relates to Darwin
117
+ * (iOS/iPadOS,MacOS), but may work on other devices in the future if
118
+ * GestureEvent is standardized.
119
+ */
120
+ private isTouchScreenMultiTouchGesture;
113
121
  private onGestureStart;
114
122
  private onGestureChange;
115
123
  private onGestureEnd;
@@ -176,7 +184,7 @@ declare class App extends React.Component<AppProps, AppState> {
176
184
  private clearSelection;
177
185
  private handleCanvasRef;
178
186
  private handleAppOnDrop;
179
- loadFileToCanvas: (file: Blob) => void;
187
+ loadFileToCanvas: (file: File, fileHandle: FileSystemHandle | null) => Promise<void>;
180
188
  private handleCanvasContextMenu;
181
189
  private maybeDragNewGenericElement;
182
190
  private maybeHandleResize;
@@ -24,7 +24,7 @@ interface LayerUIProps {
24
24
  langCode: Language["code"];
25
25
  isCollaborating: boolean;
26
26
  renderTopRightUI?: (isMobile: boolean, appState: AppState) => JSX.Element | null;
27
- renderCustomFooter?: (isMobile: boolean, appState: AppState) => JSX.Element;
27
+ renderCustomFooter?: (isMobile: boolean, appState: AppState) => JSX.Element | null;
28
28
  viewModeEnabled: boolean;
29
29
  libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
30
30
  UIOptions: AppProps["UIOptions"];
@@ -1,11 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import Library from "../data/library";
3
- import { LibraryItem, AppState, BinaryFiles, ExcalidrawProps } from "../types";
3
+ import { LibraryItems, LibraryItem, AppState, BinaryFiles, ExcalidrawProps } from "../types";
4
4
  import "./LibraryMenu.scss";
5
- export declare const LibraryMenu: ({ onClose, onInsertShape, pendingElements, onAddToLibrary, theme, setAppState, files, libraryReturnUrl, focusContainer, library, id, appState, }: {
5
+ export declare const LibraryMenu: ({ onClose, onInsertLibraryItems, pendingElements, onAddToLibrary, theme, setAppState, files, libraryReturnUrl, focusContainer, library, id, appState, }: {
6
6
  pendingElements: LibraryItem["elements"];
7
7
  onClose: () => void;
8
- onInsertShape: (elements: LibraryItem["elements"]) => void;
8
+ onInsertLibraryItems: (libraryItems: LibraryItems) => void;
9
9
  onAddToLibrary: () => void;
10
10
  theme: AppState["theme"];
11
11
  files: BinaryFiles;
@@ -1,13 +1,13 @@
1
- /// <reference types="react" />
1
+ import React from "react";
2
2
  import Library from "../data/library";
3
3
  import { AppState, BinaryFiles, ExcalidrawProps, LibraryItem, LibraryItems } from "../types";
4
4
  import "./LibraryMenuItems.scss";
5
- declare const LibraryMenuItems: ({ isLoading, libraryItems, onRemoveFromLibrary, onAddToLibrary, onInsertShape, pendingElements, theme, setAppState, libraryReturnUrl, library, files, id, selectedItems, onToggle, onPublish, resetLibrary, }: {
5
+ declare const LibraryMenuItems: ({ isLoading, libraryItems, onRemoveFromLibrary, onAddToLibrary, onInsertLibraryItems, pendingElements, theme, setAppState, libraryReturnUrl, library, files, id, selectedItems, onSelectItems, onPublish, resetLibrary, }: {
6
6
  isLoading: boolean;
7
7
  libraryItems: LibraryItems;
8
8
  pendingElements: LibraryItem["elements"];
9
9
  onRemoveFromLibrary: () => void;
10
- onInsertShape: (elements: LibraryItem["elements"]) => void;
10
+ onInsertLibraryItems: (libraryItems: LibraryItems) => void;
11
11
  onAddToLibrary: (elements: LibraryItem["elements"]) => void;
12
12
  theme: AppState["theme"];
13
13
  files: BinaryFiles;
@@ -16,7 +16,7 @@ declare const LibraryMenuItems: ({ isLoading, libraryItems, onRemoveFromLibrary,
16
16
  library: Library;
17
17
  id: string;
18
18
  selectedItems: LibraryItem["id"][];
19
- onToggle: (id: LibraryItem["id"], event: React.MouseEvent) => void;
19
+ onSelectItems: (id: LibraryItem["id"][]) => void;
20
20
  onPublish: () => void;
21
21
  resetLibrary: () => void;
22
22
  }) => JSX.Element;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { BinaryFiles, LibraryItem } from "../types";
3
3
  import "./LibraryUnit.scss";
4
- export declare const LibraryUnit: ({ id, elements, files, isPending, onClick, selected, onToggle, }: {
4
+ export declare const LibraryUnit: ({ id, elements, files, isPending, onClick, selected, onToggle, onDrag, }: {
5
5
  id: LibraryItem["id"] | /** for pending item */ null;
6
6
  elements?: readonly import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | undefined;
7
7
  files: BinaryFiles;
@@ -9,4 +9,5 @@ export declare const LibraryUnit: ({ id, elements, files, isPending, onClick, se
9
9
  onClick: () => void;
10
10
  selected: boolean;
11
11
  onToggle: (id: string, event: React.MouseEvent) => void;
12
+ onDrag: (id: string, event: React.DragEvent) => void;
12
13
  }) => JSX.Element;
@@ -15,7 +15,7 @@ declare type MobileMenuProps = {
15
15
  onPenModeToggle: () => void;
16
16
  canvas: HTMLCanvasElement | null;
17
17
  isCollaborating: boolean;
18
- renderCustomFooter?: (isMobile: boolean, appState: AppState) => JSX.Element;
18
+ renderCustomFooter?: (isMobile: boolean, appState: AppState) => JSX.Element | null;
19
19
  viewModeEnabled: boolean;
20
20
  showThemeBtn: boolean;
21
21
  onImageAction: (data: {
@@ -1,9 +1,10 @@
1
1
  import "./UserList.scss";
2
2
  import React from "react";
3
- declare type UserListProps = {
4
- children: React.ReactNode;
3
+ import { AppState } from "../types";
4
+ import { ActionManager } from "../actions/manager";
5
+ export declare const UserList: React.FC<{
5
6
  className?: string;
6
7
  mobile?: boolean;
7
- };
8
- export declare const UserList: ({ children, className, mobile }: UserListProps) => JSX.Element;
9
- export {};
8
+ collaborators: AppState["collaborators"];
9
+ actionManager: ActionManager;
10
+ }>;
@@ -141,3 +141,6 @@ export declare const VERTICAL_ALIGN: {
141
141
  BOTTOM: string;
142
142
  };
143
143
  export declare const ELEMENT_READY_TO_ERASE_OPACITY = 20;
144
+ export declare const COOKIES: {
145
+ readonly AUTH_STATE_COOKIE: "excplus-auth";
146
+ };
@@ -2,6 +2,7 @@ import { ALLOWED_IMAGE_MIME_TYPES, MIME_TYPES } from "../constants";
2
2
  import { ExcalidrawElement, FileId } from "../element/types";
3
3
  import { AppState, DataURL, LibraryItem } from "../types";
4
4
  import { FileSystemHandle } from "./filesystem";
5
+ import { ImportedLibraryData } from "./types";
5
6
  export declare const getMimeType: (blob: Blob | string) => string;
6
7
  export declare const getFileHandleType: (handle: FileSystemHandle | null) => string | null;
7
8
  export declare const isImageFileHandleType: (type: string | null) => type is "svg" | "png";
@@ -9,7 +10,15 @@ export declare const isImageFileHandle: (handle: FileSystemHandle | null) => boo
9
10
  export declare const isSupportedImageFile: (blob: Blob | null | undefined) => blob is Blob & {
10
11
  type: typeof ALLOWED_IMAGE_MIME_TYPES[number];
11
12
  };
12
- export declare const loadFromBlob: (blob: Blob, localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null) => Promise<import("./restore").RestoredDataState>;
13
+ export declare const loadSceneOrLibraryFromBlob: (blob: Blob | File, localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null, fileHandle?: FileSystemHandle | null | undefined) => Promise<{
14
+ type: "application/vnd.excalidraw+json";
15
+ data: import("./restore").RestoredDataState;
16
+ } | {
17
+ type: "application/vnd.excalidrawlib+json";
18
+ data: ImportedLibraryData;
19
+ }>;
20
+ export declare const loadFromBlob: (blob: Blob, localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null, fileHandle?: FileSystemHandle | null | undefined) => Promise<import("./restore").RestoredDataState>;
21
+ export declare const parseLibraryJSON: (json: string, defaultStatus?: LibraryItem["status"]) => LibraryItem[];
13
22
  export declare const loadLibraryFromBlob: (blob: Blob, defaultStatus?: LibraryItem["status"]) => Promise<LibraryItem[]>;
14
23
  export declare const canvasToBlob: (canvas: HTMLCanvasElement) => Promise<Blob>;
15
24
  /** generates SHA-1 digest from supplied file (if not supported, falls back
@@ -25,3 +34,14 @@ export declare const resizeImageFile: (file: File, opts: {
25
34
  export declare const SVGStringToFile: (SVGString: string, filename?: string) => File & {
26
35
  type: typeof MIME_TYPES.svg;
27
36
  };
37
+ export declare const getFileFromEvent: (event: React.DragEvent<HTMLDivElement>) => Promise<{
38
+ file: File | null;
39
+ fileHandle: FileSystemHandle | null;
40
+ }>;
41
+ export declare const getFileHandle: (event: React.DragEvent<HTMLDivElement>) => Promise<FileSystemHandle | null>;
42
+ export declare const createFile: (blob: File | Blob | ArrayBuffer, mimeType: ValueOf<typeof MIME_TYPES>, name: string | undefined) => File;
43
+ /** attemps to detect correct mimeType if none is set, or if an image
44
+ * has an incorrect extension.
45
+ * Note: doesn't handle missing .excalidraw/.excalidrawlib extension */
46
+ export declare const normalizeFile: (file: File) => Promise<File>;
47
+ export declare const blobToArrayBuffer: (blob: Blob) => Promise<ArrayBuffer>;
@@ -1,7 +1,6 @@
1
1
  import { ExcalidrawElement } from "../element/types";
2
2
  import { AppState, BinaryFiles, LibraryItems } from "../types";
3
3
  import { ImportedDataState, ImportedLibraryData } from "./types";
4
- import Library from "./library";
5
4
  export declare const serializeAsJSON: (elements: readonly ExcalidrawElement[], appState: Partial<AppState>, files: BinaryFiles, type: "local" | "database") => string;
6
5
  export declare const saveAsJSON: (elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles) => Promise<{
7
6
  fileHandle: import("browser-fs-access").FileSystemHandle | null;
@@ -15,4 +14,3 @@ export declare const isValidExcalidrawData: (data?: {
15
14
  export declare const isValidLibrary: (json: any) => json is ImportedLibraryData;
16
15
  export declare const serializeLibraryAsJSON: (libraryItems: LibraryItems) => string;
17
16
  export declare const saveLibraryAsJSON: (libraryItems: LibraryItems) => Promise<void>;
18
- export declare const importLibraryFromJSON: (library: Library) => Promise<void>;
@@ -1,6 +1,6 @@
1
- import { LibraryItems, LibraryItem } from "../types";
1
+ import { LibraryItems, ExcalidrawImperativeAPI, LibraryItemsSource } from "../types";
2
2
  import type App from "../components/App";
3
- import { ImportedDataState } from "./types";
3
+ import { ExcalidrawElement } from "../element/types";
4
4
  export declare const libraryItemsAtom: import("jotai").Atom<{
5
5
  status: "loading" | "loaded";
6
6
  isInitialized: boolean;
@@ -71,15 +71,26 @@ declare class Library {
71
71
  private getLastUpdateTask;
72
72
  private notifyListeners;
73
73
  resetLibrary: () => Promise<LibraryItems>;
74
- /**
75
- * imports library (from blob or libraryItems), merging with current library
76
- * (attempting to remove duplicates)
77
- */
78
- importLibrary(library: Blob | Required<ImportedDataState>["libraryItems"] | Promise<Required<ImportedDataState>["libraryItems"]>, defaultStatus?: LibraryItem["status"]): Promise<LibraryItems>;
79
74
  /**
80
75
  * @returns latest cloned libraryItems. Awaits all in-progress updates first.
81
76
  */
82
77
  getLatestLibrary: () => Promise<LibraryItems>;
78
+ updateLibrary: ({ libraryItems, prompt, merge, openLibraryMenu, defaultStatus, }: {
79
+ libraryItems: LibraryItemsSource;
80
+ merge?: boolean | undefined;
81
+ prompt?: boolean | undefined;
82
+ openLibraryMenu?: boolean | undefined;
83
+ defaultStatus?: "published" | "unpublished" | undefined;
84
+ }) => Promise<LibraryItems>;
83
85
  setLibrary: (libraryItems: LibraryItems | Promise<LibraryItems> | ((latestLibraryItems: LibraryItems) => LibraryItems | Promise<LibraryItems>)) => Promise<LibraryItems>;
84
86
  }
85
87
  export default Library;
88
+ export declare const distributeLibraryItemsOnSquareGrid: (libraryItems: LibraryItems) => ExcalidrawElement[];
89
+ export declare const parseLibraryTokensFromUrl: () => {
90
+ libraryUrl: string;
91
+ idToken: string | null;
92
+ } | null;
93
+ export declare const useHandleLibrary: ({ excalidrawAPI, getInitialLibraryItems, }: {
94
+ excalidrawAPI: ExcalidrawImperativeAPI | null;
95
+ getInitialLibraryItems?: (() => LibraryItemsSource) | undefined;
96
+ }) => void;
@@ -1,5 +1,5 @@
1
1
  import { ExcalidrawElement } from "../element/types";
2
- import { AppState, BinaryFiles, LibraryItems, LibraryItems_v1 } from "../types";
2
+ import { AppState, BinaryFiles, LibraryItems, LibraryItems_anyVersion } from "../types";
3
3
  import type { cleanAppStateForExport } from "../appState";
4
4
  import { VERSIONS } from "../constants";
5
5
  export interface ExportedDataState {
@@ -17,7 +17,7 @@ export interface ImportedDataState {
17
17
  elements?: readonly ExcalidrawElement[] | null;
18
18
  appState?: Readonly<Partial<AppState>> | null;
19
19
  scrollToContent?: boolean;
20
- libraryItems?: LibraryItems | LibraryItems_v1;
20
+ libraryItems?: LibraryItems_anyVersion;
21
21
  files?: BinaryFiles;
22
22
  }
23
23
  export interface ExportedLibraryData {
@@ -0,0 +1,6 @@
1
+ import { ExcalidrawElement } from "./element/types";
2
+ export interface Distribution {
3
+ space: "between";
4
+ axis: "x" | "y";
5
+ }
6
+ export declare const distributeElements: (selectedElements: ExcalidrawElement[], distribution: Distribution) => ExcalidrawElement[];
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;