@zsviczian/excalidraw 0.17.1-obsidian-16 → 0.17.1-obsidian-18

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 (36) hide show
  1. package/dist/excalidraw.development.js +95 -40
  2. package/dist/excalidraw.production.min.js +1 -1
  3. package/package.json +1 -1
  4. package/types/excalidraw/components/Toast.d.ts +3 -1
  5. package/types/excalidraw/components/icons.d.ts +1 -0
  6. package/types/excalidraw/data/library.d.ts +60 -8
  7. package/types/excalidraw/element/index.d.ts +8 -0
  8. package/types/excalidraw/element/linearElementEditor.d.ts +1 -1
  9. package/types/excalidraw/element/newElement.d.ts +0 -1
  10. package/types/excalidraw/element/textElement.d.ts +24 -2
  11. package/types/excalidraw/element/types.d.ts +0 -1
  12. package/types/excalidraw/index.d.ts +8 -4
  13. package/types/excalidraw/obsidianUtils.d.ts +1 -0
  14. package/types/excalidraw/queue.d.ts +9 -0
  15. package/types/excalidraw/renderer/helpers.d.ts +13 -0
  16. package/types/excalidraw/renderer/interactiveScene.d.ts +20 -0
  17. package/types/excalidraw/renderer/renderElement.d.ts +3 -4
  18. package/types/excalidraw/renderer/staticScene.d.ts +11 -0
  19. package/types/excalidraw/renderer/staticSvgScene.d.ts +5 -0
  20. package/types/excalidraw/types.d.ts +6 -6
  21. package/types/excalidraw/utility-types.d.ts +2 -0
  22. package/types/excalidraw/utils.d.ts +3 -1
  23. package/types/utils/export.d.ts +0 -6
  24. package/types/utils/index.d.ts +2 -0
  25. package/types/excalidraw/components/LaserTool/LaserPathManager.d.ts +0 -28
  26. package/types/excalidraw/components/LaserTool/LaserPointerButton.d.ts +0 -10
  27. package/types/excalidraw/components/LaserTool/LaserTool.d.ts +0 -7
  28. package/types/excalidraw/element/Hyperlink.d.ts +0 -220
  29. package/types/excalidraw/example/App.d.ts +0 -14
  30. package/types/excalidraw/example/CustomFooter.d.ts +0 -5
  31. package/types/excalidraw/example/MobileFooter.d.ts +0 -5
  32. package/types/excalidraw/example/index.d.ts +0 -1
  33. package/types/excalidraw/example/initialData.d.ts +0 -290
  34. package/types/excalidraw/example/sidebar/ExampleSidebar.d.ts +0 -4
  35. package/types/excalidraw/renderer/renderScene.d.ts +0 -23
  36. package/types/excalidraw/vite.config.d.mts +0 -2
@@ -1,220 +0,0 @@
1
- import { AppState, ExcalidrawProps, UIAppState } from "../types";
2
- import { ExcalidrawEmbeddableElement, NonDeletedExcalidrawElement } from "./types";
3
- import { Bounds } from "./bounds";
4
- import "./Hyperlink.scss";
5
- export declare const EXTERNAL_LINK_IMG: HTMLImageElement;
6
- export declare const Hyperlink: ({ element, setAppState, onLinkOpen, setToast, updateEmbedValidationStatus, }: {
7
- element: NonDeletedExcalidrawElement;
8
- setAppState: React.Component<any, AppState>["setState"];
9
- onLinkOpen: ExcalidrawProps["onLinkOpen"];
10
- setToast: (toast: {
11
- message: string;
12
- closable?: boolean;
13
- duration?: number;
14
- } | null) => void;
15
- updateEmbedValidationStatus: (element: ExcalidrawEmbeddableElement, status: boolean) => void;
16
- }) => import("react/jsx-runtime").JSX.Element | null;
17
- export declare const actionLink: {
18
- name: "hyperlink";
19
- perform: (elements: readonly import("./types").ExcalidrawElement[], appState: Readonly<AppState>) => false | {
20
- elements: readonly import("./types").ExcalidrawElement[];
21
- appState: {
22
- showHyperlinkPopup: "editor";
23
- openMenu: null;
24
- contextMenu: {
25
- items: import("../components/ContextMenu").ContextMenuItems;
26
- top: number;
27
- left: number;
28
- } | null;
29
- showWelcomeScreen: boolean;
30
- isLoading: boolean;
31
- errorMessage: import("react").ReactNode;
32
- activeEmbeddable: {
33
- element: NonDeletedExcalidrawElement;
34
- state: "active" | "hover";
35
- } | null;
36
- draggingElement: NonDeletedExcalidrawElement | null;
37
- resizingElement: NonDeletedExcalidrawElement | null;
38
- multiElement: import("./types").NonDeleted<import("./types").ExcalidrawLinearElement> | null;
39
- selectionElement: NonDeletedExcalidrawElement | null;
40
- isBindingEnabled: boolean;
41
- startBoundElement: import("./types").NonDeleted<import("./types").ExcalidrawBindableElement> | null;
42
- suggestedBindings: import("./binding").SuggestedBinding[];
43
- frameToHighlight: import("./types").NonDeleted<import("./types").ExcalidrawFrameLikeElement> | null;
44
- frameRendering: {
45
- enabled: boolean;
46
- name: boolean;
47
- outline: boolean;
48
- clip: boolean;
49
- };
50
- editingFrame: string | null;
51
- elementsToHighlight: import("./types").NonDeleted<import("./types").ExcalidrawElement>[] | null;
52
- editingElement: NonDeletedExcalidrawElement | null;
53
- editingLinearElement: import("./linearElementEditor").LinearElementEditor | null;
54
- activeTool: {
55
- lastActiveTool: import("../types").ActiveTool | null;
56
- locked: boolean;
57
- } & import("../types").ActiveTool;
58
- penMode: boolean;
59
- penDetected: boolean;
60
- exportBackground: boolean;
61
- exportEmbedScene: boolean;
62
- exportWithDarkMode: boolean;
63
- exportScale: number;
64
- currentItemStrokeColor: string;
65
- currentItemBackgroundColor: string;
66
- currentItemFillStyle: import("./types").FillStyle;
67
- currentItemStrokeWidth: number;
68
- currentItemStrokeStyle: import("./types").StrokeStyle;
69
- currentItemRoughness: number;
70
- currentItemOpacity: number;
71
- currentItemFontFamily: number;
72
- currentItemFontSize: number;
73
- currentItemTextAlign: string;
74
- currentItemStartArrowhead: import("./types").Arrowhead | null;
75
- currentItemEndArrowhead: import("./types").Arrowhead | null;
76
- currentItemRoundness: import("./types").StrokeRoundness;
77
- viewBackgroundColor: string;
78
- scrollX: number;
79
- scrollY: number;
80
- cursorButton: "up" | "down";
81
- scrolledOutside: boolean;
82
- name: string;
83
- isResizing: boolean;
84
- isRotating: boolean;
85
- zoom: Readonly<{
86
- value: import("../types").NormalizedZoomValue;
87
- }>;
88
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
89
- openSidebar: {
90
- name: string;
91
- tab?: string | undefined;
92
- } | null;
93
- openDialog: {
94
- name: "imageExport" | "help" | "jsonExport";
95
- } | {
96
- name: "settings";
97
- source: "settings" | "tool" | "generation";
98
- tab: "text-to-diagram" | "diagram-to-code";
99
- } | {
100
- name: "ttd";
101
- tab: "mermaid" | "text-to-diagram";
102
- } | null;
103
- defaultSidebarDockedPreference: boolean;
104
- lastPointerDownWith: import("./types").PointerType;
105
- selectedElementIds: Readonly<{
106
- [id: string]: true;
107
- }>;
108
- previousSelectedElementIds: {
109
- [id: string]: true;
110
- };
111
- selectedElementsAreBeingDragged: boolean;
112
- shouldCacheIgnoreZoom: boolean;
113
- toast: {
114
- message: string;
115
- closable?: boolean | undefined;
116
- duration?: number | undefined;
117
- } | null;
118
- zenModeEnabled: boolean;
119
- theme: import("./types").Theme;
120
- gridSize: number | null;
121
- previousGridSize: number | null;
122
- viewModeEnabled: boolean;
123
- selectedGroupIds: {
124
- [groupId: string]: boolean;
125
- };
126
- editingGroupId: string | null;
127
- width: number;
128
- height: number;
129
- offsetTop: number;
130
- offsetLeft: number;
131
- fileHandle: import("browser-fs-access").FileSystemHandle | null;
132
- collaborators: Map<import("../types").SocketId, Readonly<{
133
- pointer?: import("../types").CollaboratorPointer | undefined;
134
- button?: "up" | "down" | undefined;
135
- selectedElementIds?: Readonly<{
136
- [id: string]: true;
137
- }> | undefined;
138
- username?: string | null | undefined;
139
- userState?: import("../types").UserIdleState | undefined;
140
- color?: {
141
- background: string;
142
- stroke: string;
143
- } | undefined;
144
- avatarUrl?: string | undefined;
145
- id?: string | undefined;
146
- socketId?: import("../types").SocketId | undefined;
147
- isCurrentUser?: boolean | undefined;
148
- }>>;
149
- showStats: boolean;
150
- currentChartType: import("./types").ChartType;
151
- pasteDialog: {
152
- shown: false;
153
- data: null;
154
- } | {
155
- shown: true;
156
- data: import("../charts").Spreadsheet;
157
- };
158
- pendingImageElementId: string | null;
159
- linkOpacity: number;
160
- trayModeEnabled: boolean;
161
- colorPalette?: {
162
- canvasBackground: import("../colors").ColorPaletteCustom;
163
- elementBackground: import("../colors").ColorPaletteCustom;
164
- elementStroke: import("../colors").ColorPaletteCustom;
165
- topPicks: {
166
- canvasBackground: [string, string, string, string, string];
167
- elementStroke: [string, string, string, string, string];
168
- elementBackground: [string, string, string, string, string];
169
- };
170
- } | undefined;
171
- allowWheelZoom?: boolean | undefined;
172
- allowPinchZoom?: boolean | undefined;
173
- pinnedScripts?: string[] | undefined;
174
- customPens?: any[] | undefined;
175
- currentStrokeOptions?: any;
176
- resetCustomPen?: any;
177
- gridColor: {
178
- Bold: string;
179
- Regular: string;
180
- MajorGridFrequency?: number | undefined;
181
- };
182
- dynamicStyle: {
183
- [x: string]: string;
184
- };
185
- frameColor: {
186
- stroke: string;
187
- fill: string;
188
- nameColor: string;
189
- };
190
- invertBindingBehaviour: boolean;
191
- selectedLinearElement: import("./linearElementEditor").LinearElementEditor | null;
192
- snapLines: readonly import("../snapping").SnapLine[];
193
- originSnapOffset: {
194
- x: number;
195
- y: number;
196
- } | null;
197
- objectsSnapModeEnabled: boolean;
198
- userToFollow: import("../types").UserToFollow | null;
199
- followedBy: Set<import("../types").SocketId>;
200
- };
201
- commitToHistory: true;
202
- };
203
- trackEvent: {
204
- category: "hyperlink";
205
- action: string;
206
- };
207
- keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
208
- contextItemLabel: (elements: readonly import("./types").ExcalidrawElement[], appState: Readonly<AppState>) => "labels.link.editEmbed" | "labels.link.edit" | "labels.link.createEmbed" | "labels.link.create";
209
- predicate: (elements: readonly import("./types").ExcalidrawElement[], appState: AppState) => boolean;
210
- PanelComponent: ({ elements, appState, updateData }: import("../actions/types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
211
- } & {
212
- keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
213
- };
214
- export declare const getContextMenuLabel: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState) => "labels.link.editEmbed" | "labels.link.edit" | "labels.link.createEmbed" | "labels.link.create";
215
- export declare const getLinkHandleFromCoords: ([x1, y1, x2, y2]: Bounds, angle: number, appState: Pick<UIAppState, "zoom">) => Bounds;
216
- export declare const isPointHittingLinkIcon: (element: NonDeletedExcalidrawElement, appState: AppState, [x, y]: readonly [number, number]) => boolean;
217
- export declare const isPointHittingLink: (element: NonDeletedExcalidrawElement, appState: AppState, [x, y]: readonly [number, number], isMobile: boolean) => boolean;
218
- export declare const showHyperlinkTooltip: (element: NonDeletedExcalidrawElement, appState: AppState) => void;
219
- export declare const hideHyperlinkToolip: () => void;
220
- export declare const shouldHideLinkPopup: (element: NonDeletedExcalidrawElement, appState: AppState, [clientX, clientY]: readonly [number, number]) => Boolean;
@@ -1,14 +0,0 @@
1
- import type * as TExcalidraw from "../index";
2
- import "./App.scss";
3
- import type { ExcalidrawImperativeAPI } from "../types";
4
- declare global {
5
- interface Window {
6
- ExcalidrawLib: typeof TExcalidraw;
7
- }
8
- }
9
- export interface AppProps {
10
- appTitle: string;
11
- useCustom: (api: ExcalidrawImperativeAPI | null, customArgs?: any[]) => void;
12
- customArgs?: any[];
13
- }
14
- export default function App({ appTitle, useCustom, customArgs }: AppProps): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +0,0 @@
1
- import type { ExcalidrawImperativeAPI } from "../types";
2
- declare const CustomFooter: ({ excalidrawAPI, }: {
3
- excalidrawAPI: ExcalidrawImperativeAPI;
4
- }) => import("react/jsx-runtime").JSX.Element;
5
- export default CustomFooter;
@@ -1,5 +0,0 @@
1
- import type { ExcalidrawImperativeAPI } from "../types";
2
- declare const MobileFooter: ({ excalidrawAPI, }: {
3
- excalidrawAPI: ExcalidrawImperativeAPI;
4
- }) => import("react/jsx-runtime").JSX.Element | null;
5
- export default MobileFooter;
@@ -1 +0,0 @@
1
- export {};
@@ -1,290 +0,0 @@
1
- import type { ExcalidrawElementSkeleton } from "../data/transform";
2
- declare const _default: {
3
- elements: ExcalidrawElementSkeleton[];
4
- appState: {
5
- viewBackgroundColor: string;
6
- currentItemFontFamily: number;
7
- };
8
- scrollToContent: boolean;
9
- libraryItems: ({
10
- type: string;
11
- x: number;
12
- y: number;
13
- strokeColor: string;
14
- backgroundColor: string;
15
- width: number;
16
- height: number;
17
- strokeSharpness: string;
18
- points: number[][];
19
- }[] | ({
20
- type: string;
21
- fillStyle: string;
22
- strokeWidth: number;
23
- strokeStyle: string;
24
- x: number;
25
- y: number;
26
- strokeColor: string;
27
- backgroundColor: string;
28
- width: number;
29
- height: number;
30
- groupIds: string[];
31
- points: number[][];
32
- roughness?: undefined;
33
- opacity?: undefined;
34
- angle?: undefined;
35
- seed?: undefined;
36
- strokeSharpness?: undefined;
37
- boundElementIds?: undefined;
38
- } | {
39
- type: string;
40
- fillStyle: string;
41
- strokeWidth: number;
42
- strokeStyle: string;
43
- roughness: number;
44
- opacity: number;
45
- angle: number;
46
- x: number;
47
- y: number;
48
- strokeColor: string;
49
- backgroundColor: string;
50
- width: number;
51
- height: number;
52
- seed: number;
53
- groupIds: string[];
54
- strokeSharpness: string;
55
- points: number[][];
56
- boundElementIds?: undefined;
57
- } | {
58
- type: string;
59
- fillStyle: string;
60
- strokeWidth: number;
61
- strokeStyle: string;
62
- roughness: number;
63
- opacity: number;
64
- angle: number;
65
- x: number;
66
- y: number;
67
- strokeColor: string;
68
- backgroundColor: string;
69
- width: number;
70
- height: number;
71
- seed: number;
72
- groupIds: string[];
73
- strokeSharpness: string;
74
- boundElementIds: string[];
75
- points?: undefined;
76
- } | {
77
- type: string;
78
- fillStyle: string;
79
- strokeWidth: number;
80
- strokeStyle: string;
81
- roughness: number;
82
- opacity: number;
83
- angle: number;
84
- x: number;
85
- y: number;
86
- strokeColor: string;
87
- backgroundColor: string;
88
- width: number;
89
- height: number;
90
- seed: number;
91
- groupIds: string[];
92
- strokeSharpness: string;
93
- points?: undefined;
94
- boundElementIds?: undefined;
95
- })[] | ({
96
- type: string;
97
- fillStyle: string;
98
- strokeWidth: number;
99
- strokeStyle: string;
100
- roughness: number;
101
- opacity: number;
102
- angle: number;
103
- x: number;
104
- y: number;
105
- strokeColor: string;
106
- backgroundColor: string;
107
- width: number;
108
- height: number;
109
- seed: number;
110
- groupIds: string[];
111
- strokeSharpness: string;
112
- points: number[][];
113
- version?: undefined;
114
- versionNonce?: undefined;
115
- isDeleted?: undefined;
116
- id?: undefined;
117
- boundElementIds?: undefined;
118
- } | {
119
- type: string;
120
- version: number;
121
- versionNonce: number;
122
- isDeleted: boolean;
123
- id: string;
124
- fillStyle: string;
125
- strokeWidth: number;
126
- strokeStyle: string;
127
- roughness: number;
128
- opacity: number;
129
- angle: number;
130
- x: number;
131
- y: number;
132
- strokeColor: string;
133
- backgroundColor: string;
134
- width: number;
135
- height: number;
136
- seed: number;
137
- groupIds: string[];
138
- strokeSharpness: string;
139
- points: number[][];
140
- boundElementIds?: undefined;
141
- } | {
142
- type: string;
143
- fillStyle: string;
144
- strokeWidth: number;
145
- strokeStyle: string;
146
- roughness: number;
147
- opacity: number;
148
- angle: number;
149
- x: number;
150
- y: number;
151
- strokeColor: string;
152
- backgroundColor: string;
153
- width: number;
154
- height: number;
155
- seed: number;
156
- groupIds: string[];
157
- strokeSharpness: string;
158
- boundElementIds: string[];
159
- points?: undefined;
160
- version?: undefined;
161
- versionNonce?: undefined;
162
- isDeleted?: undefined;
163
- id?: undefined;
164
- })[] | ({
165
- type: string;
166
- fillStyle: string;
167
- strokeWidth: number;
168
- strokeStyle: string;
169
- roughness: number;
170
- opacity: number;
171
- angle: number;
172
- x: number;
173
- y: number;
174
- strokeColor: string;
175
- backgroundColor: string;
176
- width: number;
177
- height: number;
178
- seed: number;
179
- groupIds: string[];
180
- strokeSharpness: string;
181
- points?: undefined;
182
- } | {
183
- type: string;
184
- fillStyle: string;
185
- strokeWidth: number;
186
- strokeStyle: string;
187
- roughness: number;
188
- opacity: number;
189
- angle: number;
190
- x: number;
191
- y: number;
192
- strokeColor: string;
193
- backgroundColor: string;
194
- width: number;
195
- height: number;
196
- seed: number;
197
- groupIds: string[];
198
- strokeSharpness: string;
199
- points: number[][];
200
- } | {
201
- type: string;
202
- fillStyle: string;
203
- strokeWidth: number;
204
- strokeStyle: string;
205
- x: number;
206
- y: number;
207
- strokeColor: string;
208
- backgroundColor: string;
209
- width: number;
210
- height: number;
211
- groupIds: string[];
212
- strokeSharpness: string;
213
- points: number[][];
214
- roughness?: undefined;
215
- opacity?: undefined;
216
- angle?: undefined;
217
- seed?: undefined;
218
- } | {
219
- type: string;
220
- fillStyle: string;
221
- strokeWidth: number;
222
- strokeStyle: string;
223
- roughness: number;
224
- opacity: number;
225
- angle: number;
226
- x: number;
227
- y: number;
228
- strokeColor: string;
229
- backgroundColor: string;
230
- width: number;
231
- height: number;
232
- groupIds: string[];
233
- strokeSharpness: string;
234
- points: number[][];
235
- seed?: undefined;
236
- } | {
237
- type: string;
238
- fillStyle: string;
239
- strokeWidth: number;
240
- strokeStyle: string;
241
- opacity: number;
242
- x: number;
243
- y: number;
244
- strokeColor: string;
245
- backgroundColor: string;
246
- width: number;
247
- height: number;
248
- seed: number;
249
- groupIds: string[];
250
- strokeSharpness: string;
251
- points: number[][];
252
- roughness?: undefined;
253
- angle?: undefined;
254
- })[] | ({
255
- type: string;
256
- fillStyle: string;
257
- strokeWidth: number;
258
- strokeStyle: string;
259
- roughness: number;
260
- opacity: number;
261
- angle: number;
262
- x: number;
263
- y: number;
264
- strokeColor: string;
265
- backgroundColor: string;
266
- width: number;
267
- height: number;
268
- seed: number;
269
- groupIds: string[];
270
- strokeSharpness: string;
271
- } | {
272
- type: string;
273
- fillStyle: string;
274
- strokeWidth: number;
275
- strokeStyle: string;
276
- x: number;
277
- y: number;
278
- strokeColor: string;
279
- backgroundColor: string;
280
- width: number;
281
- height: number;
282
- seed: number;
283
- groupIds: string[];
284
- strokeSharpness: string;
285
- roughness?: undefined;
286
- opacity?: undefined;
287
- angle?: undefined;
288
- })[])[];
289
- };
290
- export default _default;
@@ -1,4 +0,0 @@
1
- import "./ExampleSidebar.scss";
2
- export default function Sidebar({ children }: {
3
- children: React.ReactNode;
4
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,23 +0,0 @@
1
- import { RoughSVG } from "roughjs/bin/svg";
2
- import { BinaryFiles } from "../types";
3
- import { NonDeletedExcalidrawElement } from "../element/types";
4
- import { InteractiveSceneRenderConfig, SVGRenderConfig, StaticSceneRenderConfig, RenderableElementsMap } from "../scene/types";
5
- /**
6
- * Interactive scene is the ui-canvas where we render boundinb boxes, selections
7
- * and other ui stuff.
8
- */
9
- export declare const renderInteractiveScene: <U extends ({ canvas, elementsMap, visibleElements, selectedElements, scale, appState, renderConfig, }: InteractiveSceneRenderConfig) => {
10
- atLeastOneVisibleElement: boolean;
11
- elementsMap: RenderableElementsMap;
12
- scrollBars?: undefined;
13
- } | {
14
- scrollBars: import("../scene/types").ScrollBars | undefined;
15
- atLeastOneVisibleElement: boolean;
16
- elementsMap: RenderableElementsMap;
17
- }, T extends boolean = false>(renderConfig: InteractiveSceneRenderConfig, throttle?: T | undefined) => T extends true ? void : ReturnType<U>;
18
- /**
19
- * Static scene is the non-ui canvas where we render elements.
20
- */
21
- export declare const renderStaticScene: (renderConfig: StaticSceneRenderConfig, throttle?: boolean) => void;
22
- export declare const cancelRender: () => void;
23
- export declare const renderSceneToSvg: (elements: readonly NonDeletedExcalidrawElement[], elementsMap: RenderableElementsMap, rsvg: RoughSVG, svgRoot: SVGElement, files: BinaryFiles, renderConfig: SVGRenderConfig) => void;
@@ -1,2 +0,0 @@
1
- declare const _default: import("vite").UserConfig;
2
- export default _default;