@zsviczian/excalidraw 0.15.2-obsidian-7 → 0.15.2-obsidian-8

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 (32) hide show
  1. package/dist/excalidraw.development.js +30 -30
  2. package/dist/excalidraw.production.min.js +1 -1
  3. package/package.json +1 -1
  4. package/types/actions/actionAddToLibrary.d.ts +24 -9
  5. package/types/actions/actionBoundText.d.ts +16 -6
  6. package/types/actions/actionCanvas.d.ts +96 -36
  7. package/types/actions/actionClipboard.d.ts +40 -15
  8. package/types/actions/actionDeleteSelected.d.ts +24 -9
  9. package/types/actions/actionElementLock.d.ts +16 -6
  10. package/types/actions/actionExport.d.ts +72 -27
  11. package/types/actions/actionFinalize.d.ts +16 -6
  12. package/types/actions/actionFrame.d.ts +26 -11
  13. package/types/actions/actionLinearEditor.d.ts +8 -3
  14. package/types/actions/actionMenu.d.ts +24 -9
  15. package/types/actions/actionProperties.d.ts +104 -39
  16. package/types/actions/actionStyles.d.ts +8 -3
  17. package/types/actions/actionToggleGridMode.d.ts +8 -3
  18. package/types/actions/actionToggleStats.d.ts +8 -3
  19. package/types/actions/actionToggleViewMode.d.ts +8 -3
  20. package/types/actions/actionToggleZenMode.d.ts +8 -3
  21. package/types/actions/types.d.ts +1 -1
  22. package/types/appState.d.ts +1 -1
  23. package/types/components/App.d.ts +13 -8
  24. package/types/element/Hyperlink.d.ts +8 -3
  25. package/types/element/collision.d.ts +2 -2
  26. package/types/element/embeddable.d.ts +171 -0
  27. package/types/element/linearElementEditor.d.ts +8 -3
  28. package/types/element/newElement.d.ts +4 -4
  29. package/types/element/typeChecks.d.ts +4 -4
  30. package/types/element/types.d.ts +6 -6
  31. package/types/types.d.ts +15 -10
  32. package/types/utils.d.ts +1 -1
@@ -64,12 +64,12 @@ declare class App extends React.Component<AppProps, AppState> {
64
64
  constructor(props: AppProps);
65
65
  private renderCanvas;
66
66
  private onWindowMessage;
67
- private updateIFrameRef;
68
- private getIFrameElementById;
69
- private handleIFrameCenterClick;
70
- private isIFrameCenter;
71
- private updateIFrames;
72
- private renderIFrames;
67
+ private updateEmbeddableRef;
68
+ private getHTMLIFrameElement;
69
+ private handleEmbeddableCenterClick;
70
+ private isEmbeddableCenter;
71
+ private updateEmbeddables;
72
+ private renderEmbeddables;
73
73
  private getFrameNameDOMId;
74
74
  frameNameBoundsCache: FrameNameBoundsCache;
75
75
  private renderFrameNames;
@@ -113,7 +113,12 @@ declare class App extends React.Component<AppProps, AppState> {
113
113
  setAppState: React.Component<any, AppState>["setState"];
114
114
  removePointer: (event: React.PointerEvent<HTMLElement> | PointerEvent) => void;
115
115
  toggleLock: (source?: "keyboard" | "ui") => void;
116
- toggleFrameRendering: () => void;
116
+ updateFrameRendering: (opts: Partial<{
117
+ enabled: boolean;
118
+ name: boolean;
119
+ outline: boolean;
120
+ clip: boolean;
121
+ }> | ((prevState: AppState["frameRendering"]) => Partial<AppState["frameRendering"]>)) => void;
117
122
  togglePenMode: () => void;
118
123
  onHandToolToggle: () => void;
119
124
  /**
@@ -222,7 +227,7 @@ declare class App extends React.Component<AppProps, AppState> {
222
227
  private isHittingCommonBoundingBoxOfSelectedElements;
223
228
  private handleTextOnPointerDown;
224
229
  private handleFreeDrawElementOnPointerDown;
225
- private insertIFrameElement;
230
+ private insertEmbeddableElement;
226
231
  private createImageElement;
227
232
  private handleLinearElementOnPointerDown;
228
233
  private getCurrentItemRoundness;
@@ -29,7 +29,7 @@ export declare const actionLink: {
29
29
  showWelcomeScreen: boolean;
30
30
  isLoading: boolean;
31
31
  errorMessage: import("react").ReactNode;
32
- activeIFrame: {
32
+ activeEmbeddable: {
33
33
  element: NonDeletedExcalidrawElement;
34
34
  state: "active" | "hover";
35
35
  } | null;
@@ -41,7 +41,12 @@ export declare const actionLink: {
41
41
  startBoundElement: import("./types").NonDeleted<import("./types").ExcalidrawBindableElement> | null;
42
42
  suggestedBindings: import("./binding").SuggestedBinding[];
43
43
  frameToHighlight: import("./types").NonDeleted<import("./types").ExcalidrawFrameElement> | null;
44
- shouldRenderFrames: boolean;
44
+ frameRendering: {
45
+ enabled: boolean;
46
+ name: boolean;
47
+ outline: boolean;
48
+ clip: boolean;
49
+ };
45
50
  editingFrame: string | null;
46
51
  elementsToHighlight: import("./types").NonDeleted<import("./types").ExcalidrawElement>[] | null;
47
52
  editingElement: NonDeletedExcalidrawElement | null;
@@ -50,7 +55,7 @@ export declare const actionLink: {
50
55
  lastActiveTool: import("../types").LastActiveTool;
51
56
  locked: boolean;
52
57
  } & ({
53
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "iframe" | "image" | "frame" | "freedraw" | "eraser" | "hand";
58
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
54
59
  customType: null;
55
60
  } | {
56
61
  type: "custom";
@@ -1,5 +1,5 @@
1
1
  import * as GA from "../ga";
2
- import { NonDeletedExcalidrawElement, ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawRectangleElement, ExcalidrawIFrameElement, 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 | ExcalidrawIFrameElement | 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];
@@ -0,0 +1,171 @@
1
+ /// <reference types="react" />
2
+ import { ExcalidrawProps } from "../types";
3
+ import { ExcalidrawElement, ExcalidrawEmbeddableElement, NonDeletedExcalidrawElement } from "./types";
4
+ type EmbeddedLink = {
5
+ link: string;
6
+ aspectRatio: {
7
+ w: number;
8
+ h: number;
9
+ };
10
+ type: "video" | "generic";
11
+ } | null;
12
+ export declare const getEmbedLink: (link?: string | null) => EmbeddedLink;
13
+ export declare const isEmbeddableOrFrameLabel: (element: NonDeletedExcalidrawElement) => Boolean;
14
+ export declare const createPlaceholderEmbeddableLabel: (element: ExcalidrawEmbeddableElement) => ExcalidrawElement;
15
+ export declare const actionSetEmbeddableAsActiveTool: {
16
+ name: "setEmbeddableAsActiveTool";
17
+ trackEvent: {
18
+ category: "toolbar";
19
+ };
20
+ perform: (elements: readonly ExcalidrawElement[], appState: Readonly<import("../types").AppState>, _: any, app: import("../types").AppClassProperties) => {
21
+ elements: readonly ExcalidrawElement[];
22
+ appState: {
23
+ activeTool: {
24
+ lastActiveTool: import("../types").LastActiveTool;
25
+ locked: boolean;
26
+ } & ({
27
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
28
+ customType: null;
29
+ } | {
30
+ type: "custom";
31
+ customType: string;
32
+ });
33
+ contextMenu: {
34
+ items: import("../components/ContextMenu").ContextMenuItems;
35
+ top: number;
36
+ left: number;
37
+ } | null;
38
+ showWelcomeScreen: boolean;
39
+ isLoading: boolean;
40
+ errorMessage: import("react").ReactNode;
41
+ activeEmbeddable: {
42
+ element: NonDeletedExcalidrawElement;
43
+ state: "active" | "hover";
44
+ } | null;
45
+ draggingElement: NonDeletedExcalidrawElement | null;
46
+ resizingElement: NonDeletedExcalidrawElement | null;
47
+ multiElement: import("./types").NonDeleted<import("./types").ExcalidrawLinearElement> | null;
48
+ selectionElement: NonDeletedExcalidrawElement | null;
49
+ isBindingEnabled: boolean;
50
+ startBoundElement: import("./types").NonDeleted<import("./types").ExcalidrawBindableElement> | null;
51
+ suggestedBindings: import("./binding").SuggestedBinding[];
52
+ frameToHighlight: import("./types").NonDeleted<import("./types").ExcalidrawFrameElement> | null;
53
+ frameRendering: {
54
+ enabled: boolean;
55
+ name: boolean;
56
+ outline: boolean;
57
+ clip: boolean;
58
+ };
59
+ editingFrame: string | null;
60
+ elementsToHighlight: import("./types").NonDeleted<ExcalidrawElement>[] | null;
61
+ editingElement: NonDeletedExcalidrawElement | null;
62
+ editingLinearElement: import("./linearElementEditor").LinearElementEditor | null;
63
+ penMode: boolean;
64
+ penDetected: boolean;
65
+ exportBackground: boolean;
66
+ exportEmbedScene: boolean;
67
+ exportWithDarkMode: boolean;
68
+ exportScale: number;
69
+ currentItemStrokeColor: string;
70
+ currentItemBackgroundColor: string;
71
+ currentItemFillStyle: import("./types").FillStyle;
72
+ currentItemStrokeWidth: number;
73
+ currentItemStrokeStyle: import("./types").StrokeStyle;
74
+ currentItemRoughness: number;
75
+ currentItemOpacity: number;
76
+ currentItemFontFamily: number;
77
+ currentItemFontSize: number;
78
+ currentItemTextAlign: string;
79
+ currentItemStartArrowhead: import("./types").Arrowhead | null;
80
+ currentItemEndArrowhead: import("./types").Arrowhead | null;
81
+ currentItemRoundness: import("./types").StrokeRoundness;
82
+ viewBackgroundColor: string;
83
+ scrollX: number;
84
+ scrollY: number;
85
+ cursorButton: "up" | "down";
86
+ scrolledOutside: boolean;
87
+ name: string;
88
+ isResizing: boolean;
89
+ isRotating: boolean;
90
+ zoom: Readonly<{
91
+ value: import("../types").NormalizedZoomValue;
92
+ }>;
93
+ openMenu: "canvas" | "shape" | null;
94
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
95
+ openSidebar: {
96
+ name: string;
97
+ tab?: string | undefined;
98
+ } | null;
99
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
100
+ defaultSidebarDockedPreference: boolean;
101
+ lastPointerDownWith: import("./types").PointerType;
102
+ selectedElementIds: Readonly<{
103
+ [id: string]: true;
104
+ }>;
105
+ previousSelectedElementIds: {
106
+ [id: string]: true;
107
+ };
108
+ selectedElementsAreBeingDragged: boolean;
109
+ shouldCacheIgnoreZoom: boolean;
110
+ toast: {
111
+ message: string;
112
+ closable?: boolean | undefined;
113
+ duration?: number | undefined;
114
+ } | null;
115
+ zenModeEnabled: boolean;
116
+ theme: string;
117
+ gridSize: number | null;
118
+ previousGridSize: number | null;
119
+ viewModeEnabled: boolean;
120
+ selectedGroupIds: {
121
+ [groupId: string]: boolean;
122
+ };
123
+ editingGroupId: string | null;
124
+ width: number;
125
+ height: number;
126
+ offsetTop: number;
127
+ offsetLeft: number;
128
+ fileHandle: import("browser-fs-access").FileSystemHandle | null;
129
+ collaborators: Map<string, import("../types").Collaborator>;
130
+ showStats: boolean;
131
+ currentChartType: import("./types").ChartType;
132
+ pasteDialog: {
133
+ shown: false;
134
+ data: null;
135
+ } | {
136
+ shown: true;
137
+ data: import("../charts").Spreadsheet;
138
+ };
139
+ pendingImageElementId: string | null;
140
+ showHyperlinkPopup: false | "info" | "editor";
141
+ linkOpacity: number;
142
+ trayModeEnabled: boolean;
143
+ colorPalette?: {
144
+ canvasBackground: import("../colors").ColorPaletteCustom;
145
+ elementBackground: import("../colors").ColorPaletteCustom;
146
+ elementStroke: import("../colors").ColorPaletteCustom;
147
+ topPicks: {
148
+ canvasBackground: [string, string, string, string, string];
149
+ elementStroke: [string, string, string, string, string];
150
+ elementBackground: [string, string, string, string, string];
151
+ };
152
+ } | undefined;
153
+ allowWheelZoom?: boolean | undefined;
154
+ allowPinchZoom?: boolean | undefined;
155
+ pinnedScripts?: string[] | undefined;
156
+ customPens?: any[] | undefined;
157
+ currentStrokeOptions?: any;
158
+ resetCustomPen?: any;
159
+ gridColor: string;
160
+ dynamicStyle: string;
161
+ invertBindingBehaviour: boolean;
162
+ selectedLinearElement: import("./linearElementEditor").LinearElementEditor | null;
163
+ };
164
+ commitToHistory: false;
165
+ };
166
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
167
+ } & {
168
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
169
+ };
170
+ export declare const embeddableURLValidator: (url: string | null | undefined, validateEmbeddable: ExcalidrawProps["validateEmbeddable"]) => boolean;
171
+ export {};
@@ -131,7 +131,7 @@ export declare class LinearElementEditor {
131
131
  showWelcomeScreen: boolean;
132
132
  isLoading: boolean;
133
133
  errorMessage: import("react").ReactNode;
134
- activeIFrame: {
134
+ activeEmbeddable: {
135
135
  element: import("./types").NonDeletedExcalidrawElement;
136
136
  state: "active" | "hover";
137
137
  } | null;
@@ -143,7 +143,12 @@ export declare class LinearElementEditor {
143
143
  startBoundElement: NonDeleted<ExcalidrawBindableElement> | null;
144
144
  suggestedBindings: import("./binding").SuggestedBinding[];
145
145
  frameToHighlight: NonDeleted<import("./types").ExcalidrawFrameElement> | null;
146
- shouldRenderFrames: boolean;
146
+ frameRendering: {
147
+ enabled: boolean;
148
+ name: boolean;
149
+ outline: boolean;
150
+ clip: boolean;
151
+ };
147
152
  editingFrame: string | null;
148
153
  elementsToHighlight: NonDeleted<ExcalidrawElement>[] | null;
149
154
  editingElement: import("./types").NonDeletedExcalidrawElement | null;
@@ -151,7 +156,7 @@ export declare class LinearElementEditor {
151
156
  lastActiveTool: import("../types").LastActiveTool;
152
157
  locked: boolean;
153
158
  } & ({
154
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "iframe" | "image" | "frame" | "freedraw" | "eraser" | "hand";
159
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
155
160
  customType: null;
156
161
  } | {
157
162
  type: "custom";
@@ -1,14 +1,14 @@
1
- import { ExcalidrawElement, ExcalidrawImageElement, ExcalidrawTextElement, ExcalidrawLinearElement, ExcalidrawGenericElement, NonDeleted, TextAlign, GroupId, VerticalAlign, Arrowhead, ExcalidrawFreeDrawElement, FontFamilyValues, ExcalidrawTextContainer, ExcalidrawFrameElement, ExcalidrawIFrameElement } from "../element/types";
1
+ import { ExcalidrawElement, ExcalidrawImageElement, ExcalidrawTextElement, ExcalidrawLinearElement, ExcalidrawGenericElement, NonDeleted, TextAlign, GroupId, VerticalAlign, Arrowhead, ExcalidrawFreeDrawElement, FontFamilyValues, ExcalidrawTextContainer, ExcalidrawFrameElement, ExcalidrawEmbeddableElement } from "../element/types";
2
2
  import { AppState } from "../types";
3
3
  import { MarkOptional, Mutable } from "../utility-types";
4
4
  type ElementConstructorOpts = MarkOptional<Omit<ExcalidrawGenericElement, "id" | "type" | "isDeleted" | "updated">, "width" | "height" | "angle" | "groupIds" | "frameId" | "boundElements" | "seed" | "version" | "versionNonce" | "link" | "strokeStyle" | "fillStyle" | "strokeColor" | "backgroundColor" | "roughness" | "strokeWidth" | "roundness" | "locked" | "opacity">;
5
5
  export declare const newElement: (opts: {
6
6
  type: ExcalidrawGenericElement["type"];
7
7
  } & ElementConstructorOpts) => NonDeleted<ExcalidrawGenericElement>;
8
- export declare const newIFrameElement: (opts: {
9
- type: "iframe";
8
+ export declare const newEmbeddableElement: (opts: {
9
+ type: "embeddable";
10
10
  validated: boolean | undefined;
11
- } & ElementConstructorOpts) => NonDeleted<ExcalidrawIFrameElement>;
11
+ } & ElementConstructorOpts) => NonDeleted<ExcalidrawEmbeddableElement>;
12
12
  export declare const newFrameElement: (opts: ElementConstructorOpts) => NonDeleted<ExcalidrawFrameElement>;
13
13
  export declare const newTextElement: (opts: {
14
14
  text: string;
@@ -1,19 +1,19 @@
1
1
  import { AppState } from "../types";
2
2
  import { MarkNonNullable } from "../utility-types";
3
- import { ExcalidrawElement, ExcalidrawTextElement, ExcalidrawIFrameElement, ExcalidrawLinearElement, ExcalidrawBindableElement, ExcalidrawGenericElement, ExcalidrawFreeDrawElement, InitializedExcalidrawImageElement, ExcalidrawImageElement, ExcalidrawTextElementWithContainer, ExcalidrawTextContainer, ExcalidrawFrameElement, RoundnessType } from "./types";
3
+ import { ExcalidrawElement, ExcalidrawTextElement, ExcalidrawEmbeddableElement, ExcalidrawLinearElement, ExcalidrawBindableElement, ExcalidrawGenericElement, ExcalidrawFreeDrawElement, InitializedExcalidrawImageElement, ExcalidrawImageElement, ExcalidrawTextElementWithContainer, ExcalidrawTextContainer, ExcalidrawFrameElement, RoundnessType } from "./types";
4
4
  export declare const isGenericElement: (element: ExcalidrawElement | null) => element is ExcalidrawGenericElement;
5
5
  export declare const isInitializedImageElement: (element: ExcalidrawElement | null) => element is InitializedExcalidrawImageElement;
6
6
  export declare const isImageElement: (element: ExcalidrawElement | null) => element is ExcalidrawImageElement;
7
- export declare const isIFrameElement: (element: ExcalidrawElement | null | undefined) => element is ExcalidrawIFrameElement;
7
+ export declare const isEmbeddableElement: (element: ExcalidrawElement | null | undefined) => element is ExcalidrawEmbeddableElement;
8
8
  export declare const isTextElement: (element: ExcalidrawElement | null) => element is ExcalidrawTextElement;
9
9
  export declare const isFrameElement: (element: ExcalidrawElement | null) => element is ExcalidrawFrameElement;
10
10
  export declare const isFreeDrawElement: (element?: ExcalidrawElement | null) => element is ExcalidrawFreeDrawElement;
11
11
  export declare const isFreeDrawElementType: (elementType: ExcalidrawElement["type"]) => boolean;
12
12
  export declare const isLinearElement: (element?: ExcalidrawElement | null) => element is ExcalidrawLinearElement;
13
13
  export declare const isArrowElement: (element?: ExcalidrawElement | null) => element is ExcalidrawLinearElement;
14
- export declare const isLinearElementType: (elementType: AppState["activeTool"]["type"] | "iframe") => boolean;
14
+ export declare const isLinearElementType: (elementType: AppState["activeTool"]["type"]) => boolean;
15
15
  export declare const isBindingElement: (element?: ExcalidrawElement | null, includeLocked?: boolean) => element is ExcalidrawLinearElement;
16
- export declare const isBindingElementType: (elementType: AppState["activeTool"]["type"] | "iframe") => boolean;
16
+ export declare const isBindingElementType: (elementType: AppState["activeTool"]["type"]) => boolean;
17
17
  export declare const isBindableElement: (element: ExcalidrawElement | null, includeLocked?: boolean) => element is ExcalidrawBindableElement;
18
18
  export declare const isTextBindableContainer: (element: ExcalidrawElement | null, includeLocked?: boolean) => element is ExcalidrawTextContainer;
19
19
  export declare const isExcalidrawElement: (element: any) => boolean;
@@ -73,16 +73,16 @@ export type ExcalidrawDiamondElement = _ExcalidrawElementBase & {
73
73
  export type ExcalidrawEllipseElement = _ExcalidrawElementBase & {
74
74
  type: "ellipse";
75
75
  };
76
- export type ExcalidrawIFrameElement = _ExcalidrawElementBase & Readonly<{
76
+ export type ExcalidrawEmbeddableElement = _ExcalidrawElementBase & Readonly<{
77
77
  /**
78
- * indicates whether the iframe src (url) has been validated for rendering.
78
+ * indicates whether the embeddable src (url) has been validated for rendering.
79
79
  * nullish value indicates that the validation is pending. We reset the
80
80
  * value on each restore (or url change) so that we can guarantee
81
81
  * the validation came from a trusted source (the editor). Also because we
82
82
  * may not have access to host-app supplied url validator during restore.
83
83
  */
84
84
  validated?: boolean;
85
- type: "iframe";
85
+ type: "embeddable";
86
86
  }>;
87
87
  export type ExcalidrawImageElement = _ExcalidrawElementBase & Readonly<{
88
88
  type: "image";
@@ -100,7 +100,7 @@ export type ExcalidrawFrameElement = _ExcalidrawElementBase & {
100
100
  /**
101
101
  * These are elements that don't have any additional properties.
102
102
  */
103
- export type ExcalidrawGenericElement = ExcalidrawSelectionElement | ExcalidrawRectangleElement | ExcalidrawIFrameElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement;
103
+ export type ExcalidrawGenericElement = ExcalidrawSelectionElement | ExcalidrawRectangleElement | ExcalidrawEmbeddableElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement;
104
104
  /**
105
105
  * ExcalidrawElement should be JSON serializable and (eventually) contain
106
106
  * no computed data. The list of all ExcalidrawElements should be shareable
@@ -130,8 +130,8 @@ export type ExcalidrawTextElement = _ExcalidrawElementBase & Readonly<{
130
130
  _brand: "unitlessLineHeight";
131
131
  };
132
132
  }>;
133
- export type ExcalidrawBindableElement = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement | ExcalidrawTextElement | ExcalidrawImageElement | ExcalidrawIFrameElement | ExcalidrawFrameElement;
134
- export type ExcalidrawTextContainer = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement | ExcalidrawArrowElement | ExcalidrawIFrameElement;
133
+ export type ExcalidrawBindableElement = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement | ExcalidrawTextElement | ExcalidrawImageElement | ExcalidrawEmbeddableElement | ExcalidrawFrameElement;
134
+ export type ExcalidrawTextContainer = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement | ExcalidrawArrowElement;
135
135
  export type ExcalidrawTextElementWithContainer = {
136
136
  containerId: ExcalidrawTextContainer["id"];
137
137
  } & ExcalidrawTextElement;
package/types/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { PointerType, ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, TextAlign, ExcalidrawElement, GroupId, ExcalidrawBindableElement, Arrowhead, ChartType, FontFamilyValues, ExcalidrawTextElement, FileId, ExcalidrawImageElement, Theme, StrokeRoundness, ExcalidrawFrameElement } from "./element/types";
2
+ import { PointerType, ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, TextAlign, ExcalidrawElement, GroupId, ExcalidrawBindableElement, Arrowhead, ChartType, FontFamilyValues, ExcalidrawTextElement, FileId, ExcalidrawImageElement, Theme, StrokeRoundness, ExcalidrawFrameElement, ExcalidrawEmbeddableElement } from "./element/types";
3
3
  import { SHAPES } from "./shapes";
4
4
  import { Point as RoughPoint } from "roughjs/bin/geometry";
5
5
  import { LinearElementEditor } from "./element/linearElementEditor";
@@ -58,7 +58,7 @@ export type BinaryFileData = {
58
58
  export type BinaryFileMetadata = Omit<BinaryFileData, "dataURL">;
59
59
  export type BinaryFiles = Record<ExcalidrawElement["id"], BinaryFileData>;
60
60
  export type LastActiveTool = {
61
- type: typeof SHAPES[number]["value"] | "eraser" | "hand" | "frame" | "iframe";
61
+ type: typeof SHAPES[number]["value"] | "eraser" | "hand" | "frame" | "embeddable";
62
62
  customType: null;
63
63
  } | {
64
64
  type: "custom";
@@ -75,7 +75,7 @@ export type AppState = {
75
75
  showWelcomeScreen: boolean;
76
76
  isLoading: boolean;
77
77
  errorMessage: React.ReactNode;
78
- activeIFrame: {
78
+ activeEmbeddable: {
79
79
  element: NonDeletedExcalidrawElement;
80
80
  state: "hover" | "active";
81
81
  } | null;
@@ -87,7 +87,12 @@ export type AppState = {
87
87
  startBoundElement: NonDeleted<ExcalidrawBindableElement> | null;
88
88
  suggestedBindings: SuggestedBinding[];
89
89
  frameToHighlight: NonDeleted<ExcalidrawFrameElement> | null;
90
- shouldRenderFrames: boolean;
90
+ frameRendering: {
91
+ enabled: boolean;
92
+ name: boolean;
93
+ outline: boolean;
94
+ clip: boolean;
95
+ };
91
96
  editingFrame: string | null;
92
97
  elementsToHighlight: NonDeleted<ExcalidrawElement>[] | null;
93
98
  editingElement: NonDeletedExcalidrawElement | null;
@@ -100,7 +105,7 @@ export type AppState = {
100
105
  lastActiveTool: LastActiveTool;
101
106
  locked: boolean;
102
107
  } & ({
103
- type: typeof SHAPES[number]["value"] | "eraser" | "hand" | "frame" | "iframe";
108
+ type: typeof SHAPES[number]["value"] | "eraser" | "hand" | "frame" | "embeddable";
104
109
  customType: null;
105
110
  } | {
106
111
  type: "custom";
@@ -306,10 +311,10 @@ export interface ExcalidrawProps {
306
311
  onPointerDown?: (activeTool: AppState["activeTool"], pointerDownState: PointerDownState) => void;
307
312
  onScrollChange?: (scrollX: number, scrollY: number) => void;
308
313
  children?: React.ReactNode;
309
- validateIFrame?: boolean | RegExp | RegExp[] | ((link: string) => boolean | undefined);
310
- renderCustomIFrame?: (element: NonDeletedExcalidrawElement, radius: number, appState: UIAppState) => JSX.Element | null;
314
+ validateEmbeddable?: boolean | RegExp | RegExp[] | ((link: string) => boolean | undefined);
315
+ renderEmbeddable?: (element: NonDeleted<ExcalidrawEmbeddableElement>, appState: AppState) => JSX.Element | null;
311
316
  renderWebview?: boolean;
312
- renderIFrameMenu?: (//zsivzian
317
+ renderEmbeddableMenu?: (//zsivzian
313
318
  appState: AppState) => JSX.Element | null;
314
319
  }
315
320
  export type SceneData = {
@@ -466,13 +471,13 @@ export type ExcalidrawImperativeAPI = {
466
471
  setCursor: InstanceType<typeof App>["setCursor"];
467
472
  resetCursor: InstanceType<typeof App>["resetCursor"];
468
473
  toggleSidebar: InstanceType<typeof App>["toggleSidebar"];
469
- getIFrameElementById: InstanceType<typeof App>["getIFrameElementById"];
474
+ getHTMLIFrameElement: InstanceType<typeof App>["getHTMLIFrameElement"];
470
475
  /**
471
476
  * Disables rendering of frames (including element clipping), but currently
472
477
  * the frames are still interactive in edit mode. As such, this API should be
473
478
  * used in conjunction with view mode (props.viewModeEnabled).
474
479
  */
475
- toggleFrameRendering: InstanceType<typeof App>["toggleFrameRendering"];
480
+ updateFrameRendering: InstanceType<typeof App>["updateFrameRendering"];
476
481
  };
477
482
  export type Device = Readonly<{
478
483
  isSmScreen: boolean;
package/types/utils.d.ts CHANGED
@@ -81,7 +81,7 @@ export declare const selectNode: (node: Element) => void;
81
81
  export declare const removeSelection: () => void;
82
82
  export declare const distance: (x: number, y: number) => number;
83
83
  export declare const updateActiveTool: (appState: Pick<AppState, "activeTool">, data: ({
84
- type: (typeof SHAPES)[number]["value"] | "eraser" | "hand" | "frame" | "iframe";
84
+ type: (typeof SHAPES)[number]["value"] | "eraser" | "hand" | "frame" | "embeddable";
85
85
  } | {
86
86
  type: "custom";
87
87
  customType: string;