@excalidraw/excalidraw 0.17.0-c7ee46e → 0.17.0-fe75f29

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 (60) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/excalidraw-assets/locales/{gl-ES-json-95041caf90ef2a7e8a53.js → gl-ES-json-d11c7966c3c2f95756e0.js} +1 -1
  3. package/dist/excalidraw-assets-dev/{vendor-37ba5d021227533892ee.js → vendor-2466bf62a35e940e8f28.js} +2 -2
  4. package/dist/excalidraw-with-preact.development.js +221 -56
  5. package/dist/excalidraw-with-preact.production.min.js +1 -1
  6. package/dist/excalidraw.development.js +221 -56
  7. package/dist/excalidraw.production.min.js +1 -1
  8. package/package.json +1 -1
  9. package/types/actions/actionAddToLibrary.d.ts +27 -3
  10. package/types/actions/actionBoundText.d.ts +18 -2
  11. package/types/actions/actionCanvas.d.ts +99 -11
  12. package/types/actions/actionClipboard.d.ts +63 -7
  13. package/types/actions/actionDeleteSelected.d.ts +27 -3
  14. package/types/actions/actionElementLock.d.ts +18 -2
  15. package/types/actions/actionExport.d.ts +72 -8
  16. package/types/actions/actionFinalize.d.ts +18 -2
  17. package/types/actions/actionFrame.d.ts +27 -3
  18. package/types/actions/actionGroup.d.ts +18 -2
  19. package/types/actions/actionLinearEditor.d.ts +9 -1
  20. package/types/actions/actionMenu.d.ts +21 -3
  21. package/types/actions/actionProperties.d.ts +117 -13
  22. package/types/actions/actionSelectAll.d.ts +9 -1
  23. package/types/actions/actionStyles.d.ts +9 -1
  24. package/types/actions/actionToggleGridMode.d.ts +9 -1
  25. package/types/actions/actionToggleObjectsSnapMode.d.ts +9 -1
  26. package/types/actions/actionToggleStats.d.ts +9 -1
  27. package/types/actions/actionToggleViewMode.d.ts +9 -1
  28. package/types/actions/actionToggleZenMode.d.ts +9 -1
  29. package/types/components/App.d.ts +1 -1
  30. package/types/components/Button.d.ts +1 -1
  31. package/types/components/InlineIcon.d.ts +3 -0
  32. package/types/components/LayerUI.d.ts +1 -1
  33. package/types/components/Paragraph.d.ts +4 -0
  34. package/types/components/TTDDialog/MermaidToExcalidraw.d.ts +6 -0
  35. package/types/components/TTDDialog/TTDDialog.d.ts +29 -0
  36. package/types/components/TTDDialog/TTDDialogInput.d.ts +9 -0
  37. package/types/components/TTDDialog/TTDDialogOutput.d.ts +7 -0
  38. package/types/components/TTDDialog/TTDDialogPanel.d.ts +16 -0
  39. package/types/components/TTDDialog/TTDDialogPanels.d.ts +4 -0
  40. package/types/components/TTDDialog/TTDDialogTab.d.ts +7 -0
  41. package/types/components/TTDDialog/TTDDialogTabTrigger.d.ts +8 -0
  42. package/types/components/TTDDialog/TTDDialogTabTriggers.d.ts +6 -0
  43. package/types/components/TTDDialog/TTDDialogTabs.d.ts +9 -0
  44. package/types/components/TTDDialog/TTDDialogTrigger.d.ts +8 -0
  45. package/types/components/TTDDialog/common.d.ts +33 -0
  46. package/types/components/TextField.d.ts +1 -1
  47. package/types/components/dropdownMenu/DropdownMenu.d.ts +6 -0
  48. package/types/components/dropdownMenu/DropdownMenuItem.d.ts +12 -0
  49. package/types/components/icons.d.ts +1 -0
  50. package/types/components/main-menu/MainMenu.d.ts +6 -0
  51. package/types/context/tunnels.d.ts +1 -0
  52. package/types/element/Hyperlink.d.ts +9 -1
  53. package/types/element/embeddable.d.ts +9 -1
  54. package/types/element/linearElementEditor.d.ts +9 -1
  55. package/types/packages/excalidraw/index.d.ts +2 -0
  56. package/types/types.d.ts +10 -2
  57. package/types/utils.d.ts +1 -0
  58. package/types/components/MermaidToExcalidraw.d.ts +0 -3
  59. /package/types/packages/excalidraw/dist/excalidraw-assets/locales/{gl-ES-json-95041caf90ef2a7e8a53.d.ts → gl-ES-json-d11c7966c3c2f95756e0.d.ts} +0 -0
  60. /package/types/packages/excalidraw/dist/excalidraw-assets-dev/{vendor-37ba5d021227533892ee.d.ts → vendor-2466bf62a35e940e8f28.d.ts} +0 -0
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from "react";
2
+ export declare const TTDDialogTrigger: {
3
+ ({ children, icon, }: {
4
+ children?: ReactNode;
5
+ icon?: JSX.Element | undefined;
6
+ }): JSX.Element;
7
+ displayName: string;
8
+ };
@@ -0,0 +1,33 @@
1
+ import { MermaidOptions } from "@excalidraw/mermaid-to-excalidraw";
2
+ import { MermaidToExcalidrawResult } from "@excalidraw/mermaid-to-excalidraw/dist/interfaces";
3
+ import { NonDeletedExcalidrawElement } from "../../element/types";
4
+ import { AppClassProperties, BinaryFiles } from "../../types";
5
+ export interface MermaidToExcalidrawLibProps {
6
+ loaded: boolean;
7
+ api: Promise<{
8
+ parseMermaidToExcalidraw: (definition: string, options: MermaidOptions) => Promise<MermaidToExcalidrawResult>;
9
+ }>;
10
+ }
11
+ interface ConvertMermaidToExcalidrawFormatProps {
12
+ canvasRef: React.RefObject<HTMLDivElement>;
13
+ mermaidToExcalidrawLib: MermaidToExcalidrawLibProps;
14
+ text: string;
15
+ setError: (error: Error | null) => void;
16
+ data: React.MutableRefObject<{
17
+ elements: readonly NonDeletedExcalidrawElement[];
18
+ files: BinaryFiles | null;
19
+ }>;
20
+ }
21
+ export declare const convertMermaidToExcalidraw: ({ canvasRef, mermaidToExcalidrawLib, text, setError, data, }: ConvertMermaidToExcalidrawFormatProps) => Promise<void>;
22
+ export declare const LOCAL_STORAGE_KEY_MERMAID_TO_EXCALIDRAW = "mermaid-to-excalidraw";
23
+ export declare const saveMermaidDataToStorage: (data: string) => void;
24
+ export declare const insertToEditor: ({ app, data, text, shouldSaveMermaidDataToStorage, }: {
25
+ app: AppClassProperties;
26
+ data: React.MutableRefObject<{
27
+ elements: readonly NonDeletedExcalidrawElement[];
28
+ files: BinaryFiles | null;
29
+ }>;
30
+ text?: string | undefined;
31
+ shouldSaveMermaidDataToStorage?: boolean | undefined;
32
+ }) => void;
33
+ export {};
@@ -10,7 +10,7 @@ type TextFieldProps = {
10
10
  selectOnRender?: boolean;
11
11
  label?: string;
12
12
  placeholder?: string;
13
- isPassword?: boolean;
13
+ isRedacted?: boolean;
14
14
  };
15
15
  export declare const TextField: import("react").ForwardRefExoticComponent<TextFieldProps & import("react").RefAttributes<HTMLInputElement>>;
16
16
  export {};
@@ -34,6 +34,12 @@ declare const DropdownMenu: {
34
34
  className?: string | undefined;
35
35
  } & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onSelect">): JSX.Element;
36
36
  displayName: string;
37
+ Badge: {
38
+ ({ children, }: {
39
+ children: React.ReactNode;
40
+ }): JSX.Element;
41
+ displayName: string;
42
+ };
37
43
  };
38
44
  ItemLink: {
39
45
  ({ icon, shortcut, href, children, onSelect, className, selected, ...rest }: {
@@ -9,5 +9,17 @@ declare const DropdownMenuItem: {
9
9
  className?: string | undefined;
10
10
  } & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onSelect">): JSX.Element;
11
11
  displayName: string;
12
+ Badge: {
13
+ ({ children, }: {
14
+ children: React.ReactNode;
15
+ }): JSX.Element;
16
+ displayName: string;
17
+ };
18
+ };
19
+ export declare const DropDownMenuItemBadge: {
20
+ ({ children, }: {
21
+ children: React.ReactNode;
22
+ }): JSX.Element;
23
+ displayName: string;
12
24
  };
13
25
  export default DropdownMenuItem;
@@ -158,4 +158,5 @@ export declare const OpenAIIcon: JSX.Element;
158
158
  export declare const fullscreenIcon: JSX.Element;
159
159
  export declare const eyeIcon: JSX.Element;
160
160
  export declare const eyeClosedIcon: JSX.Element;
161
+ export declare const brainIcon: JSX.Element;
161
162
  export {};
@@ -28,6 +28,12 @@ declare const MainMenu: React.FC<{
28
28
  className?: string | undefined;
29
29
  } & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onSelect">): JSX.Element;
30
30
  displayName: string;
31
+ Badge: {
32
+ ({ children, }: {
33
+ children: React.ReactNode;
34
+ }): JSX.Element;
35
+ displayName: string;
36
+ };
31
37
  };
32
38
  ItemLink: {
33
39
  ({ icon, shortcut, href, children, onSelect, className, selected, ...rest }: {
@@ -11,6 +11,7 @@ type TunnelsContextValue = {
11
11
  DefaultSidebarTriggerTunnel: Tunnel;
12
12
  DefaultSidebarTabTriggersTunnel: Tunnel;
13
13
  OverwriteConfirmDialogTunnel: Tunnel;
14
+ TTDDialogTriggerTunnel: Tunnel;
14
15
  jotaiScope: symbol;
15
16
  };
16
17
  export declare const TunnelsContext: React.Context<TunnelsContextValue>;
@@ -89,7 +89,15 @@ export declare const actionLink: {
89
89
  name: string;
90
90
  tab?: string | undefined;
91
91
  } | null;
92
- openDialog: "mermaid" | "magicSettings" | "imageExport" | "help" | "jsonExport" | null;
92
+ openDialog: {
93
+ name: "imageExport" | "help" | "jsonExport";
94
+ } | {
95
+ name: "magicSettings";
96
+ source: "tool" | "generation" | "settings";
97
+ } | {
98
+ name: "ttd";
99
+ tab: string;
100
+ } | null;
93
101
  defaultSidebarDockedPreference: boolean;
94
102
  lastPointerDownWith: import("./types").PointerType;
95
103
  selectedElementIds: Readonly<{
@@ -82,7 +82,15 @@ export declare const actionSetEmbeddableAsActiveTool: {
82
82
  name: string;
83
83
  tab?: string | undefined;
84
84
  } | null;
85
- openDialog: "mermaid" | "magicSettings" | "imageExport" | "help" | "jsonExport" | null;
85
+ openDialog: {
86
+ name: "imageExport" | "help" | "jsonExport";
87
+ } | {
88
+ name: "magicSettings";
89
+ source: "tool" | "generation" | "settings";
90
+ } | {
91
+ name: "ttd";
92
+ tab: string;
93
+ } | null;
86
94
  defaultSidebarDockedPreference: boolean;
87
95
  lastPointerDownWith: import("./types").PointerType;
88
96
  selectedElementIds: Readonly<{
@@ -192,7 +192,15 @@ export declare class LinearElementEditor {
192
192
  name: string;
193
193
  tab?: string | undefined;
194
194
  } | null;
195
- openDialog: "mermaid" | "magicSettings" | "imageExport" | "help" | "jsonExport" | null;
195
+ openDialog: {
196
+ name: "imageExport" | "help" | "jsonExport";
197
+ } | {
198
+ name: "magicSettings";
199
+ source: "tool" | "generation" | "settings";
200
+ } | {
201
+ name: "ttd";
202
+ tab: string;
203
+ } | null;
196
204
  defaultSidebarDockedPreference: boolean;
197
205
  lastPointerDownWith: import("./types").PointerType;
198
206
  selectedElementIds: Readonly<{
@@ -24,6 +24,8 @@ export { useDevice } from "../../components/App";
24
24
  export { WelcomeScreen };
25
25
  export { LiveCollaborationTrigger };
26
26
  export { DefaultSidebar } from "../../components/DefaultSidebar";
27
+ export { TTDDialog } from "../../components/TTDDialog/TTDDialog";
28
+ export { TTDDialogTrigger } from "../../components/TTDDialog/TTDDialogTrigger";
27
29
  export { normalizeLink } from "../../data/url";
28
30
  export { convertToExcalidrawElements } from "../../data/transform";
29
31
  export { getCommonBounds } from "../../element/bounds";
package/types/types.d.ts CHANGED
@@ -182,7 +182,15 @@ export interface AppState {
182
182
  name: SidebarName;
183
183
  tab?: SidebarTabName;
184
184
  } | null;
185
- openDialog: "imageExport" | "help" | "jsonExport" | "mermaid" | "magicSettings" | null;
185
+ openDialog: null | {
186
+ name: "imageExport" | "help" | "jsonExport";
187
+ } | {
188
+ name: "magicSettings";
189
+ source: "tool" | "generation" | "settings";
190
+ } | {
191
+ name: "ttd";
192
+ tab: string;
193
+ };
186
194
  /**
187
195
  * Reflects user preference for whether the default sidebar should be docked.
188
196
  *
@@ -401,7 +409,7 @@ export type AppClassProperties = {
401
409
  setActiveTool: App["setActiveTool"];
402
410
  setOpenDialog: App["setOpenDialog"];
403
411
  insertEmbeddableElement: App["insertEmbeddableElement"];
404
- onMagicButtonSelect: App["onMagicButtonSelect"];
412
+ onMagicframeToolSelect: App["onMagicframeToolSelect"];
405
413
  };
406
414
  export type PointerDownState = Readonly<{
407
415
  origin: Readonly<{
package/types/utils.d.ts CHANGED
@@ -201,3 +201,4 @@ export declare const isRenderThrottlingEnabled: () => boolean;
201
201
  /** Checks if value is inside given collection. Useful for type-safety. */
202
202
  export declare const isMemberOf: <T extends string>(collection: Set<T> | Record<T, any> | Map<T, any> | readonly T[], value: string) => value is T;
203
203
  export declare const cloneJSON: <T>(obj: T) => T;
204
+ export declare const isFiniteNumber: (value: any) => value is number;
@@ -1,3 +0,0 @@
1
- import "./MermaidToExcalidraw.scss";
2
- declare const MermaidToExcalidraw: () => JSX.Element;
3
- export default MermaidToExcalidraw;