@excalidraw/excalidraw 0.15.2-6546-a6b389c → 0.15.2-6546-3398d86

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 (94) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/excalidraw-assets/locales/{es-ES-json-f2467c6a875a9e288756.js → es-ES-json-4f3da97feff33cb00e6d.js} +1 -1
  3. package/dist/excalidraw-assets/locales/{hi-IN-json-e22f4ad73126c2971850.js → hi-IN-json-3898c9c1216b44476529.js} +1 -1
  4. package/dist/excalidraw-assets/locales/{id-ID-json-0e69caf5d919807ed234.js → id-ID-json-43d505d7071a0e359681.js} +1 -1
  5. package/dist/excalidraw-assets/locales/{kk-KZ-json-106d2a41c68f69765668.js → kk-KZ-json-f648362328b839e9313f.js} +1 -1
  6. package/dist/excalidraw-assets/locales/{pa-IN-json-0fd029451b07248c5194.js → pa-IN-json-d9ee09801ed220840b2b.js} +1 -1
  7. package/dist/excalidraw-assets/{vendor-53d1c69ef585b6dd219b.js → vendor-ef3c5d81a00ef582b871.js} +2 -2
  8. package/dist/excalidraw-assets-dev/{vendor-e6df8519da951026ff69.js → vendor-a14cd58fa2db417e42b2.js} +6 -6
  9. package/dist/excalidraw.development.js +2163 -2119
  10. package/dist/excalidraw.production.min.js +1 -1
  11. package/dist/excalidraw.production.min.js.LICENSE.txt +15 -0
  12. package/package.json +7 -2
  13. package/types/actions/actionAddToLibrary.d.ts +21 -10
  14. package/types/actions/actionAlign.d.ts +0 -1
  15. package/types/actions/actionBoundText.d.ts +14 -7
  16. package/types/actions/actionCanvas.d.ts +76 -39
  17. package/types/actions/actionClipboard.d.ts +32 -16
  18. package/types/actions/actionDeleteSelected.d.ts +18 -10
  19. package/types/actions/actionDistribute.d.ts +0 -1
  20. package/types/actions/actionDuplicateSelection.d.ts +0 -1
  21. package/types/actions/actionElementLock.d.ts +14 -7
  22. package/types/actions/actionExport.d.ts +71 -35
  23. package/types/actions/actionFinalize.d.ts +11 -7
  24. package/types/actions/actionFlip.d.ts +0 -1
  25. package/types/actions/actionFrame.d.ts +21 -10
  26. package/types/actions/actionGroup.d.ts +0 -1
  27. package/types/actions/actionLinearEditor.d.ts +7 -4
  28. package/types/actions/actionMenu.d.ts +21 -10
  29. package/types/actions/actionProperties.d.ts +91 -40
  30. package/types/actions/actionSelectAll.d.ts +0 -1
  31. package/types/actions/actionStyles.d.ts +7 -4
  32. package/types/actions/actionToggleGridMode.d.ts +7 -4
  33. package/types/actions/actionToggleStats.d.ts +7 -4
  34. package/types/actions/actionToggleViewMode.d.ts +7 -4
  35. package/types/actions/actionToggleZenMode.d.ts +7 -4
  36. package/types/actions/types.d.ts +1 -1
  37. package/types/appState.d.ts +3 -3
  38. package/types/colors.d.ts +9 -9
  39. package/types/components/App.d.ts +10 -0
  40. package/types/components/Button.d.ts +0 -1
  41. package/types/components/Card.d.ts +0 -1
  42. package/types/components/ColorPicker/keyboardNavHandlers.d.ts +0 -1
  43. package/types/components/DefaultSidebar.d.ts +0 -1
  44. package/types/components/EyeDropper.d.ts +0 -1
  45. package/types/components/LibraryMenuHeaderContent.d.ts +0 -1
  46. package/types/components/LibraryUnit.d.ts +0 -1
  47. package/types/components/LoadingMessage.d.ts +0 -1
  48. package/types/components/Section.d.ts +1 -1
  49. package/types/components/Sidebar/SidebarTab.d.ts +0 -1
  50. package/types/components/Sidebar/SidebarTabTrigger.d.ts +0 -1
  51. package/types/components/Sidebar/SidebarTabTriggers.d.ts +0 -1
  52. package/types/components/Sidebar/SidebarTabs.d.ts +0 -1
  53. package/types/components/Stack.d.ts +2 -2
  54. package/types/components/Trans.d.ts +2 -1
  55. package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +0 -1
  56. package/types/components/icons.d.ts +1 -0
  57. package/types/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -1
  58. package/types/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -1
  59. package/types/components/welcome-screen/WelcomeScreen.d.ts +0 -1
  60. package/types/constants.d.ts +16 -3
  61. package/types/data/transform.d.ts +8 -11
  62. package/types/data/url.d.ts +5 -0
  63. package/types/element/Hyperlink.d.ts +16 -7
  64. package/types/element/collision.d.ts +2 -2
  65. package/types/element/embeddable.d.ts +153 -0
  66. package/types/element/linearElementEditor.d.ts +8 -5
  67. package/types/element/newElement.d.ts +5 -2
  68. package/types/element/textElement.d.ts +4 -7
  69. package/types/element/transformHandles.d.ts +1 -1
  70. package/types/element/typeChecks.d.ts +2 -1
  71. package/types/element/types.d.ts +13 -2
  72. package/types/hooks/useOutsideClick.d.ts +0 -1
  73. package/types/hooks/useScrollPosition.d.ts +0 -1
  74. package/types/i18n.d.ts +5 -2
  75. package/types/keys.d.ts +1 -0
  76. package/types/packages/excalidraw/example/initialData.d.ts +2 -1
  77. package/types/packages/excalidraw/index.d.ts +1 -0
  78. package/types/packages/excalidraw/webpack.dev.config.d.ts +5 -2
  79. package/types/packages/excalidraw/webpack.prod.config.d.ts +3 -0
  80. package/types/packages/utils.d.ts +2 -1
  81. package/types/renderer/renderElement.d.ts +1 -1
  82. package/types/renderer/renderScene.d.ts +2 -1
  83. package/types/scene/export.d.ts +1 -0
  84. package/types/types.d.ts +9 -3
  85. package/types/utility-types.d.ts +1 -1
  86. package/types/utils.d.ts +2 -1
  87. /package/dist/excalidraw-assets/{vendor-53d1c69ef585b6dd219b.js.LICENSE.txt → vendor-ef3c5d81a00ef582b871.js.LICENSE.txt} +0 -0
  88. /package/types/packages/excalidraw/dist/excalidraw-assets/locales/{es-ES-json-f2467c6a875a9e288756.d.ts → es-ES-json-4f3da97feff33cb00e6d.d.ts} +0 -0
  89. /package/types/packages/excalidraw/dist/excalidraw-assets/locales/{hi-IN-json-e22f4ad73126c2971850.d.ts → hi-IN-json-3898c9c1216b44476529.d.ts} +0 -0
  90. /package/types/packages/excalidraw/dist/excalidraw-assets/locales/{id-ID-json-0e69caf5d919807ed234.d.ts → id-ID-json-43d505d7071a0e359681.d.ts} +0 -0
  91. /package/types/packages/excalidraw/dist/excalidraw-assets/locales/{kk-KZ-json-106d2a41c68f69765668.d.ts → kk-KZ-json-f648362328b839e9313f.d.ts} +0 -0
  92. /package/types/packages/excalidraw/dist/excalidraw-assets/locales/{pa-IN-json-0fd029451b07248c5194.d.ts → pa-IN-json-d9ee09801ed220840b2b.d.ts} +0 -0
  93. /package/types/packages/excalidraw/dist/excalidraw-assets/{vendor-53d1c69ef585b6dd219b.d.ts → vendor-ef3c5d81a00ef582b871.d.ts} +0 -0
  94. /package/types/packages/excalidraw/dist/excalidraw-assets-dev/{vendor-e6df8519da951026ff69.d.ts → vendor-a14cd58fa2db417e42b2.d.ts} +0 -0
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const actionToggleViewMode: {
3
2
  name: "viewMode";
4
3
  viewMode: true;
@@ -17,6 +16,10 @@ export declare const actionToggleViewMode: {
17
16
  showWelcomeScreen: boolean;
18
17
  isLoading: boolean;
19
18
  errorMessage: import("react").ReactNode;
19
+ activeEmbeddable: {
20
+ element: import("../element/types").NonDeletedExcalidrawElement;
21
+ state: "active" | "hover";
22
+ } | null;
20
23
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
21
24
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
22
25
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -39,7 +42,7 @@ export declare const actionToggleViewMode: {
39
42
  lastActiveTool: import("../types").LastActiveTool;
40
43
  locked: boolean;
41
44
  } & ({
42
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
45
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
43
46
  customType: null;
44
47
  } | {
45
48
  type: "custom";
@@ -98,7 +101,7 @@ export declare const actionToggleViewMode: {
98
101
  duration?: number | undefined;
99
102
  } | null;
100
103
  zenModeEnabled: boolean;
101
- theme: string;
104
+ theme: import("../element/types").Theme;
102
105
  gridSize: number | null;
103
106
  selectedGroupIds: {
104
107
  [groupId: string]: boolean;
@@ -120,7 +123,7 @@ export declare const actionToggleViewMode: {
120
123
  data: import("../charts").Spreadsheet;
121
124
  };
122
125
  pendingImageElementId: string | null;
123
- showHyperlinkPopup: false | "info" | "editor";
126
+ showHyperlinkPopup: false | "editor" | "info";
124
127
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
125
128
  };
126
129
  commitToHistory: false;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const actionToggleZenMode: {
3
2
  name: "zenMode";
4
3
  viewMode: true;
@@ -17,6 +16,10 @@ export declare const actionToggleZenMode: {
17
16
  showWelcomeScreen: boolean;
18
17
  isLoading: boolean;
19
18
  errorMessage: import("react").ReactNode;
19
+ activeEmbeddable: {
20
+ element: import("../element/types").NonDeletedExcalidrawElement;
21
+ state: "active" | "hover";
22
+ } | null;
20
23
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
21
24
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
22
25
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -39,7 +42,7 @@ export declare const actionToggleZenMode: {
39
42
  lastActiveTool: import("../types").LastActiveTool;
40
43
  locked: boolean;
41
44
  } & ({
42
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
45
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
43
46
  customType: null;
44
47
  } | {
45
48
  type: "custom";
@@ -97,7 +100,7 @@ export declare const actionToggleZenMode: {
97
100
  closable?: boolean | undefined;
98
101
  duration?: number | undefined;
99
102
  } | null;
100
- theme: string;
103
+ theme: import("../element/types").Theme;
101
104
  gridSize: number | null;
102
105
  viewModeEnabled: boolean;
103
106
  selectedGroupIds: {
@@ -120,7 +123,7 @@ export declare const actionToggleZenMode: {
120
123
  data: import("../charts").Spreadsheet;
121
124
  };
122
125
  pendingImageElementId: string | null;
123
- showHyperlinkPopup: false | "info" | "editor";
126
+ showHyperlinkPopup: false | "editor" | "info";
124
127
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
125
128
  };
126
129
  commitToHistory: false;
@@ -15,7 +15,7 @@ export type ActionResult = {
15
15
  type ActionFn = (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, formData: any, app: AppClassProperties) => ActionResult | Promise<ActionResult>;
16
16
  export type UpdaterFn = (res: ActionResult) => void;
17
17
  export type ActionFilterFn = (action: Action) => void;
18
- export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeOpacity" | "changeFontSize" | "toggleCanvasMenu" | "toggleEditMenu" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "createContainerFromText" | "wrapTextInContainer";
18
+ export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeOpacity" | "changeFontSize" | "toggleCanvasMenu" | "toggleEditMenu" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "setEmbeddableAsActiveTool" | "createContainerFromText" | "wrapTextInContainer";
19
19
  export type PanelComponentProps = {
20
20
  elements: readonly ExcalidrawElement[];
21
21
  appState: AppState;
@@ -1,20 +1,20 @@
1
1
  import { AppState, NormalizedZoomValue } from "./types";
2
2
  export declare const getDefaultAppState: () => Omit<AppState, "offsetTop" | "offsetLeft" | "width" | "height">;
3
3
  export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>) => {
4
- theme?: string | undefined;
4
+ theme?: import("./element/types").Theme | undefined;
5
5
  name?: string | undefined;
6
6
  activeTool?: ({
7
7
  lastActiveTool: import("./types").LastActiveTool;
8
8
  locked: boolean;
9
9
  } & ({
10
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
10
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
11
11
  customType: null;
12
12
  } | {
13
13
  type: "custom";
14
14
  customType: string;
15
15
  })) | undefined;
16
- showWelcomeScreen?: boolean | undefined;
17
16
  penMode?: boolean | undefined;
17
+ showWelcomeScreen?: boolean | undefined;
18
18
  penDetected?: boolean | undefined;
19
19
  exportBackground?: boolean | undefined;
20
20
  exportEmbedScene?: boolean | undefined;
package/types/colors.d.ts CHANGED
@@ -3,9 +3,9 @@ import { Merge } from "./utility-types";
3
3
  export type ColorPickerColor = Exclude<keyof oc, "indigo" | "lime"> | "transparent" | "bronze";
4
4
  export type ColorTuple = readonly [string, string, string, string, string];
5
5
  export type ColorPalette = Merge<Record<ColorPickerColor, ColorTuple>, {
6
- black: string;
7
- white: string;
8
- transparent: string;
6
+ black: "#1e1e1e";
7
+ white: "#ffffff";
8
+ transparent: "transparent";
9
9
  }>;
10
10
  export type ColorPaletteCustom = {
11
11
  [key: string]: ColorTuple | string;
@@ -34,10 +34,10 @@ export declare const DEFAULT_ELEMENT_STROKE_COLOR_PALETTE: {
34
34
  readonly green: ColorTuple;
35
35
  readonly yellow: ColorTuple;
36
36
  readonly orange: ColorTuple;
37
- readonly transparent: string;
38
- readonly white: string;
37
+ readonly transparent: "transparent";
38
+ readonly white: "#ffffff";
39
39
  readonly gray: ColorTuple;
40
- readonly black: string;
40
+ readonly black: "#1e1e1e";
41
41
  readonly bronze: ColorTuple;
42
42
  };
43
43
  export declare const DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE: {
@@ -51,10 +51,10 @@ export declare const DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE: {
51
51
  readonly green: ColorTuple;
52
52
  readonly yellow: ColorTuple;
53
53
  readonly orange: ColorTuple;
54
- readonly transparent: string;
55
- readonly white: string;
54
+ readonly transparent: "transparent";
55
+ readonly white: "#ffffff";
56
56
  readonly gray: ColorTuple;
57
- readonly black: string;
57
+ readonly black: "#1e1e1e";
58
58
  readonly bronze: ColorTuple;
59
59
  };
60
60
  export declare const getAllColorsSpecificShade: (index: 0 | 1 | 2 | 3 | 4) => readonly [string, string, string, string, string, string, string, string, string, string];
@@ -49,6 +49,7 @@ declare class App extends React.Component<AppProps, AppState> {
49
49
  private excalidrawContainerValue;
50
50
  files: BinaryFiles;
51
51
  imageCache: AppClassProperties["imageCache"];
52
+ private iFrameRefs;
52
53
  hitLinkElement?: NonDeletedExcalidrawElement;
53
54
  lastPointerDown: React.PointerEvent<HTMLElement> | null;
54
55
  lastPointerUp: React.PointerEvent<HTMLElement> | PointerEvent | null;
@@ -58,6 +59,13 @@ declare class App extends React.Component<AppProps, AppState> {
58
59
  };
59
60
  constructor(props: AppProps);
60
61
  private renderCanvas;
62
+ private onWindowMessage;
63
+ private updateEmbeddableRef;
64
+ private getHTMLIFrameElement;
65
+ private handleEmbeddableCenterClick;
66
+ private isEmbeddableCenter;
67
+ private updateEmbeddables;
68
+ private renderEmbeddables;
61
69
  private getFrameNameDOMId;
62
70
  frameNameBoundsCache: FrameNameBoundsCache;
63
71
  private renderFrameNames;
@@ -204,8 +212,10 @@ declare class App extends React.Component<AppProps, AppState> {
204
212
  private isHittingCommonBoundingBoxOfSelectedElements;
205
213
  private handleTextOnPointerDown;
206
214
  private handleFreeDrawElementOnPointerDown;
215
+ private insertEmbeddableElement;
207
216
  private createImageElement;
208
217
  private handleLinearElementOnPointerDown;
218
+ private getCurrentItemRoundness;
209
219
  private createGenericElementOnPointerDown;
210
220
  private createFrameElementOnPointerDown;
211
221
  private onKeyDownFromPointerDownHandler;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./Button.scss";
3
2
  interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
4
3
  type?: "button" | "submit" | "reset";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import OpenColor from "open-color";
3
2
  import "./Card.scss";
4
3
  export declare const Card: React.FC<{
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ColorPaletteCustom } from "../../colors";
3
2
  import { ActiveColorPickerSectionAtomType } from "./colorPickerUtils";
4
3
  interface ColorPickerKeyNavHandlerProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { MarkOptional } from "../utility-types";
3
2
  import { SidebarProps, SidebarTriggerProps } from "./Sidebar/common";
4
3
  export declare const DefaultSidebar: import("react").FC<Omit<MarkOptional<Omit<{
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./EyeDropper.scss";
3
2
  type EyeDropperProperties = {
4
3
  keepOpenOnAlt: boolean;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { LibraryItem, UIAppState } from "../types";
3
2
  import Library from "../data/library";
4
3
  export declare const LibraryDropdownMenuButton: React.FC<{
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { LibraryItem } from "../types";
3
2
  import "./LibraryUnit.scss";
4
3
  import { SvgCache } from "../hooks/useLibraryItemSvg";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Theme } from "../element/types";
3
2
  export declare const LoadingMessage: React.FC<{
4
3
  delay?: number;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  export declare const Section: React.FC<{
3
- heading: string;
3
+ heading: "canvasActions" | "selectedShapeActions" | "shapes";
4
4
  children?: React.ReactNode | ((heading: React.ReactNode) => React.ReactNode);
5
5
  className?: string;
6
6
  }>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SidebarTabName } from "../../types";
3
2
  export declare const SidebarTab: {
4
3
  ({ tab, children, ...rest }: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SidebarTabName } from "../../types";
3
2
  export declare const SidebarTabTrigger: {
4
3
  ({ children, tab, onSelect, ...rest }: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const SidebarTabTriggers: {
3
2
  ({ children, ...rest }: {
4
3
  children: React.ReactNode;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const SidebarTabs: {
3
2
  ({ children, ...rest }: {
4
3
  children: React.ReactNode;
@@ -10,7 +10,7 @@ type StackProps = {
10
10
  ref: React.RefObject<HTMLDivElement>;
11
11
  };
12
12
  declare const _default: {
13
- Row: React.ForwardRefExoticComponent<Pick<StackProps, "style" | "className" | "children" | "gap" | "justifyContent" | "align"> & React.RefAttributes<HTMLDivElement>>;
14
- Col: React.ForwardRefExoticComponent<Pick<StackProps, "style" | "className" | "children" | "gap" | "justifyContent" | "align"> & React.RefAttributes<HTMLDivElement>>;
13
+ Row: React.ForwardRefExoticComponent<Pick<StackProps, "style" | "className" | "children" | "align" | "gap" | "justifyContent"> & React.RefAttributes<HTMLDivElement>>;
14
+ Col: React.ForwardRefExoticComponent<Pick<StackProps, "style" | "className" | "children" | "align" | "gap" | "justifyContent"> & React.RefAttributes<HTMLDivElement>>;
15
15
  };
16
16
  export default _default;
@@ -1,7 +1,8 @@
1
1
  import React from "react";
2
+ import { TranslationKeys } from "../i18n";
2
3
  declare const Trans: ({ i18nKey, children, ...props }: {
3
4
  [key: string]: React.ReactNode | ((el: React.ReactNode) => React.ReactNode);
4
- i18nKey: string;
5
+ i18nKey: TranslationKeys;
5
6
  }) => React.FunctionComponentElement<{
6
7
  children?: React.ReactNode;
7
8
  }>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const MenuTrigger: {
3
2
  ({ className, children, onToggle, title, ...rest }: {
4
3
  className?: string | undefined;
@@ -31,6 +31,7 @@ export declare const EraserIcon: JSX.Element;
31
31
  export declare const ZoomInIcon: JSX.Element;
32
32
  export declare const ZoomOutIcon: JSX.Element;
33
33
  export declare const TrashIcon: JSX.Element;
34
+ export declare const EmbedIcon: JSX.Element;
34
35
  export declare const DuplicateIcon: JSX.Element;
35
36
  export declare const MoonIcon: JSX.Element;
36
37
  export declare const SunIcon: JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./LiveCollaborationTrigger.scss";
3
2
  declare const LiveCollaborationTrigger: {
4
3
  ({ isCollaborating, onSelect, ...rest }: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const Center: {
3
2
  ({ children }: {
4
3
  children?: React.ReactNode;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./WelcomeScreen.scss";
3
2
  declare const WelcomeScreen: {
4
3
  (props: {
@@ -57,8 +57,17 @@ export declare enum EVENT {
57
57
  VISIBILITY_CHANGE = "visibilitychange",
58
58
  SCROLL = "scroll",
59
59
  EXCALIDRAW_LINK = "excalidraw-link",
60
- MENU_ITEM_SELECT = "menu.itemSelect"
60
+ MENU_ITEM_SELECT = "menu.itemSelect",
61
+ MESSAGE = "message"
61
62
  }
63
+ export declare const YOUTUBE_STATES: {
64
+ readonly UNSTARTED: -1;
65
+ readonly ENDED: 0;
66
+ readonly PLAYING: 1;
67
+ readonly PAUSED: 2;
68
+ readonly BUFFERING: 3;
69
+ readonly CUED: 5;
70
+ };
62
71
  export declare const ENV: {
63
72
  TEST: string;
64
73
  DEVELOPMENT: string;
@@ -72,8 +81,8 @@ export declare const FONT_FAMILY: {
72
81
  Cascadia: number;
73
82
  };
74
83
  export declare const THEME: {
75
- LIGHT: string;
76
- DARK: string;
84
+ readonly LIGHT: "light";
85
+ readonly DARK: "dark";
77
86
  };
78
87
  export declare const FRAME_STYLE: {
79
88
  strokeColor: string;
@@ -89,6 +98,7 @@ export declare const FRAME_STYLE: {
89
98
  radius: number;
90
99
  };
91
100
  export declare const WINDOWS_EMOJI_FALLBACK_FONT = "Segoe UI Emoji";
101
+ export declare const MIN_FONT_SIZE = 1;
92
102
  export declare const DEFAULT_FONT_SIZE = 20;
93
103
  export declare const DEFAULT_FONT_FAMILY: FontFamilyValues;
94
104
  export declare const DEFAULT_TEXT_ALIGN = "left";
@@ -173,6 +183,8 @@ export declare const VERSIONS: {
173
183
  readonly excalidrawLibrary: 2;
174
184
  };
175
185
  export declare const BOUND_TEXT_PADDING = 5;
186
+ export declare const ARROW_LABEL_WIDTH_FRACTION = 0.7;
187
+ export declare const ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO = 11;
176
188
  export declare const VERTICAL_ALIGN: {
177
189
  TOP: string;
178
190
  MIDDLE: string;
@@ -209,3 +221,4 @@ export declare const DEFAULT_SIDEBAR: {
209
221
  readonly name: "default";
210
222
  readonly defaultTab: "library";
211
223
  };
224
+ export declare const LIBRARY_DISABLED_TYPES: Set<"embeddable" | "image">;
@@ -1,5 +1,5 @@
1
1
  import { ElementConstructorOpts } from "../element/newElement";
2
- import { ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawFrameElement, ExcalidrawFreeDrawElement, ExcalidrawGenericElement, ExcalidrawImageElement, ExcalidrawLinearElement, ExcalidrawSelectionElement, ExcalidrawTextElement, FontFamilyValues, TextAlign, VerticalAlign } from "../element/types";
2
+ import { ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawEmbeddableElement, ExcalidrawFrameElement, ExcalidrawFreeDrawElement, ExcalidrawGenericElement, ExcalidrawImageElement, ExcalidrawLinearElement, ExcalidrawSelectionElement, ExcalidrawTextElement, FileId, FontFamilyValues, TextAlign, VerticalAlign } from "../element/types";
3
3
  import { MarkOptional } from "../utility-types";
4
4
  export type ValidLinearElement = {
5
5
  type: "arrow" | "line";
@@ -13,11 +13,11 @@ export type ValidLinearElement = {
13
13
  verticalAlign?: VerticalAlign;
14
14
  } & MarkOptional<ElementConstructorOpts, "x" | "y">;
15
15
  end?: (({
16
- type: Exclude<ExcalidrawBindableElement["type"], "image" | "selection" | "text" | "frame">;
16
+ type: Exclude<ExcalidrawBindableElement["type"], "image" | "text" | "frame" | "embeddable">;
17
17
  id?: ExcalidrawGenericElement["id"];
18
18
  } | {
19
19
  id: ExcalidrawGenericElement["id"];
20
- type?: Exclude<ExcalidrawBindableElement["type"], "image" | "selection" | "text" | "frame">;
20
+ type?: Exclude<ExcalidrawBindableElement["type"], "image" | "text" | "frame" | "embeddable">;
21
21
  }) | (({
22
22
  type: "text";
23
23
  text: string;
@@ -27,11 +27,11 @@ export type ValidLinearElement = {
27
27
  text: string;
28
28
  }) & Partial<ExcalidrawTextElement>)) & MarkOptional<ElementConstructorOpts, "x" | "y">;
29
29
  start?: (({
30
- type: Exclude<ExcalidrawBindableElement["type"], "image" | "selection" | "text" | "frame">;
30
+ type: Exclude<ExcalidrawBindableElement["type"], "image" | "text" | "frame" | "embeddable">;
31
31
  id?: ExcalidrawGenericElement["id"];
32
32
  } | {
33
33
  id: ExcalidrawGenericElement["id"];
34
- type?: Exclude<ExcalidrawBindableElement["type"], "image" | "selection" | "text" | "frame">;
34
+ type?: Exclude<ExcalidrawBindableElement["type"], "image" | "text" | "frame" | "embeddable">;
35
35
  }) | (({
36
36
  type: "text";
37
37
  text: string;
@@ -52,7 +52,7 @@ export type ValidContainer = {
52
52
  verticalAlign?: VerticalAlign;
53
53
  } & MarkOptional<ElementConstructorOpts, "x" | "y">;
54
54
  } & ElementConstructorOpts;
55
- export type ExcalidrawProgrammaticElement = Extract<ExcalidrawElement, ExcalidrawSelectionElement | ExcalidrawFreeDrawElement | ExcalidrawFrameElement> | ({
55
+ export type ExcalidrawElementSkeleton = Extract<Exclude<ExcalidrawElement, ExcalidrawSelectionElement>, ExcalidrawEmbeddableElement | ExcalidrawFreeDrawElement | ExcalidrawFrameElement> | ({
56
56
  type: Extract<ExcalidrawLinearElement["type"], "line">;
57
57
  x: number;
58
58
  y: number;
@@ -66,9 +66,6 @@ export type ExcalidrawProgrammaticElement = Extract<ExcalidrawElement, Excalidra
66
66
  type: Extract<ExcalidrawImageElement["type"], "image">;
67
67
  x: number;
68
68
  y: number;
69
+ fileId: FileId;
69
70
  } & Partial<ExcalidrawImageElement>);
70
- export interface ExcalidrawProgrammaticAPI {
71
- elements?: readonly ExcalidrawProgrammaticElement[] | null;
72
- }
73
- export declare const ELEMENTS_SUPPORTING_PROGRAMMATIC_API: string[];
74
- export declare const convertToExcalidrawElements: (elements: ExcalidrawProgrammaticAPI["elements"]) => ExcalidrawElement[];
71
+ export declare const convertToExcalidrawElements: (elements: ExcalidrawElementSkeleton[] | null) => ExcalidrawElement[];
@@ -1,2 +1,7 @@
1
1
  export declare const normalizeLink: (link: string) => string;
2
2
  export declare const isLocalLink: (link: string | null) => boolean;
3
+ /**
4
+ * Returns URL sanitized and safe for usage in places such as
5
+ * iframe's src attribute or <a> href attributes.
6
+ */
7
+ export declare const toValidURL: (link: string) => string;
@@ -1,13 +1,17 @@
1
- /// <reference types="react" />
2
1
  import { AppState, ExcalidrawProps, UIAppState } from "../types";
3
2
  import { NonDeletedExcalidrawElement } from "./types";
4
3
  import { Bounds } from "./bounds";
5
4
  import "./Hyperlink.scss";
6
5
  export declare const EXTERNAL_LINK_IMG: HTMLImageElement;
7
- export declare const Hyperlink: ({ element, setAppState, onLinkOpen, }: {
6
+ export declare const Hyperlink: ({ element, setAppState, onLinkOpen, setToast, }: {
8
7
  element: NonDeletedExcalidrawElement;
9
8
  setAppState: React.Component<any, AppState>["setState"];
10
9
  onLinkOpen: ExcalidrawProps["onLinkOpen"];
10
+ setToast: (toast: {
11
+ message: string;
12
+ closable?: boolean;
13
+ duration?: number;
14
+ } | null) => void;
11
15
  }) => JSX.Element | null;
12
16
  export declare const actionLink: {
13
17
  name: "hyperlink";
@@ -24,6 +28,10 @@ export declare const actionLink: {
24
28
  showWelcomeScreen: boolean;
25
29
  isLoading: boolean;
26
30
  errorMessage: import("react").ReactNode;
31
+ activeEmbeddable: {
32
+ element: NonDeletedExcalidrawElement;
33
+ state: "active" | "hover";
34
+ } | null;
27
35
  draggingElement: NonDeletedExcalidrawElement | null;
28
36
  resizingElement: NonDeletedExcalidrawElement | null;
29
37
  multiElement: import("./types").NonDeleted<import("./types").ExcalidrawLinearElement> | null;
@@ -46,7 +54,7 @@ export declare const actionLink: {
46
54
  lastActiveTool: import("../types").LastActiveTool;
47
55
  locked: boolean;
48
56
  } & ({
49
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
57
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
50
58
  customType: null;
51
59
  } | {
52
60
  type: "custom";
@@ -104,7 +112,7 @@ export declare const actionLink: {
104
112
  duration?: number | undefined;
105
113
  } | null;
106
114
  zenModeEnabled: boolean;
107
- theme: string;
115
+ theme: import("./types").Theme;
108
116
  gridSize: number | null;
109
117
  viewModeEnabled: boolean;
110
118
  selectedGroupIds: {
@@ -136,15 +144,16 @@ export declare const actionLink: {
136
144
  action: string;
137
145
  };
138
146
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
139
- contextItemLabel: (elements: readonly import("./types").ExcalidrawElement[], appState: Readonly<AppState>) => "labels.link.edit" | "labels.link.create";
147
+ contextItemLabel: (elements: readonly import("./types").ExcalidrawElement[], appState: Readonly<AppState>) => "labels.link.editEmbed" | "labels.link.edit" | "labels.link.createEmbed" | "labels.link.create";
140
148
  predicate: (elements: readonly import("./types").ExcalidrawElement[], appState: AppState) => boolean;
141
149
  PanelComponent: ({ elements, appState, updateData }: import("../actions/types").PanelComponentProps) => JSX.Element;
142
150
  } & {
143
151
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
144
152
  };
145
- export declare const getContextMenuLabel: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState) => "labels.link.edit" | "labels.link.create";
153
+ export declare const getContextMenuLabel: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState) => "labels.link.editEmbed" | "labels.link.edit" | "labels.link.createEmbed" | "labels.link.create";
146
154
  export declare const getLinkHandleFromCoords: ([x1, y1, x2, y2]: Bounds, angle: number, appState: UIAppState) => [x: number, y: number, width: number, height: number];
147
- export declare const isPointHittingLinkIcon: (element: NonDeletedExcalidrawElement, appState: AppState, [x, y]: readonly [number, number], isMobile: boolean) => boolean;
155
+ export declare const isPointHittingLinkIcon: (element: NonDeletedExcalidrawElement, appState: AppState, [x, y]: readonly [number, number]) => boolean;
156
+ export declare const isPointHittingLink: (element: NonDeletedExcalidrawElement, appState: AppState, [x, y]: readonly [number, number], isMobile: boolean) => boolean;
148
157
  export declare const showHyperlinkTooltip: (element: NonDeletedExcalidrawElement, appState: AppState) => void;
149
158
  export declare const hideHyperlinkToolip: () => void;
150
159
  export declare const shouldHideLinkPopup: (element: NonDeletedExcalidrawElement, appState: AppState, [clientX, clientY]: readonly [number, number]) => Boolean;
@@ -1,5 +1,5 @@
1
1
  import * as GA from "../ga";
2
- import { NonDeletedExcalidrawElement, ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawRectangleElement, ExcalidrawDiamondElement, ExcalidrawTextElement, ExcalidrawEllipseElement, NonDeleted, ExcalidrawImageElement, ExcalidrawFrameElement } from "./types";
2
+ import { NonDeletedExcalidrawElement, ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawRectangleElement, ExcalidrawEmbeddableElement, ExcalidrawDiamondElement, ExcalidrawTextElement, ExcalidrawEllipseElement, NonDeleted, ExcalidrawImageElement, ExcalidrawFrameElement } from "./types";
3
3
  import { FrameNameBoundsCache, Point } from "../types";
4
4
  import { AppState } from "../types";
5
5
  export declare const hitTest: (element: NonDeletedExcalidrawElement, appState: AppState, frameNameBoundsCache: FrameNameBoundsCache, x: number, y: number) => boolean;
@@ -18,4 +18,4 @@ export declare const determineFocusPoint: (element: ExcalidrawBindableElement, f
18
18
  export declare const intersectElementWithLine: (element: ExcalidrawBindableElement, a: readonly [number, number], b: readonly [number, number], gap?: number) => Point[];
19
19
  export declare const getCircleIntersections: (center: readonly [number, number, number, number, number, number, number, number], radius: number, line: readonly [number, number, number, number, number, number, number, number]) => GA.Point[];
20
20
  export declare const findFocusPointForEllipse: (ellipse: ExcalidrawEllipseElement, relativeDistance: number, point: readonly [number, number, number, number, number, number, number, number]) => readonly [number, number, number, number, number, number, number, number];
21
- export declare const findFocusPointForRectangulars: (element: ExcalidrawRectangleElement | ExcalidrawImageElement | ExcalidrawDiamondElement | ExcalidrawTextElement | ExcalidrawFrameElement, relativeDistance: number, point: readonly [number, number, number, number, number, number, number, number]) => readonly [number, number, number, number, number, number, number, number];
21
+ export declare const findFocusPointForRectangulars: (element: ExcalidrawRectangleElement | ExcalidrawImageElement | ExcalidrawDiamondElement | ExcalidrawTextElement | ExcalidrawEmbeddableElement | ExcalidrawFrameElement, relativeDistance: number, point: readonly [number, number, number, number, number, number, number, number]) => readonly [number, number, number, number, number, number, number, number];