@zsviczian/excalidraw 0.17.1-obsidian-12 → 0.17.1-obsidian-14

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 (74) hide show
  1. package/dist/excalidraw.development.js +66 -55
  2. package/dist/excalidraw.production.min.js +1 -1
  3. package/dist/styles.development.css +633 -627
  4. package/dist/styles.production.css +4 -4
  5. package/package.json +1 -1
  6. package/types/excalidraw/actions/actionAddToLibrary.d.ts +3 -3
  7. package/types/excalidraw/actions/actionAlign.d.ts +6 -6
  8. package/types/excalidraw/actions/actionBoundText.d.ts +2 -2
  9. package/types/excalidraw/actions/actionCanvas.d.ts +28 -28
  10. package/types/excalidraw/actions/actionClipboard.d.ts +7 -7
  11. package/types/excalidraw/actions/actionDeleteSelected.d.ts +3 -3
  12. package/types/excalidraw/actions/actionDistribute.d.ts +2 -2
  13. package/types/excalidraw/actions/actionElementLock.d.ts +2 -2
  14. package/types/excalidraw/actions/actionExport.d.ts +8 -8
  15. package/types/excalidraw/actions/actionFinalize.d.ts +2 -2
  16. package/types/excalidraw/actions/actionFlip.d.ts +2 -2
  17. package/types/excalidraw/actions/actionFrame.d.ts +4 -4
  18. package/types/excalidraw/actions/actionGroup.d.ts +2 -2
  19. package/types/excalidraw/actions/actionLinearEditor.d.ts +1 -1
  20. package/types/excalidraw/actions/actionMenu.d.ts +2 -2
  21. package/types/excalidraw/actions/actionNavigate.d.ts +2 -2
  22. package/types/excalidraw/actions/actionProperties.d.ts +26 -26
  23. package/types/excalidraw/actions/actionSelectAll.d.ts +1 -1
  24. package/types/excalidraw/actions/actionStyles.d.ts +3 -3
  25. package/types/excalidraw/actions/actionToggleGridMode.d.ts +1 -1
  26. package/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +1 -1
  27. package/types/excalidraw/actions/actionToggleStats.d.ts +1 -1
  28. package/types/excalidraw/actions/actionToggleViewMode.d.ts +1 -1
  29. package/types/excalidraw/actions/actionToggleZenMode.d.ts +1 -1
  30. package/types/excalidraw/align.d.ts +2 -2
  31. package/types/excalidraw/components/Actions.d.ts +3 -3
  32. package/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +2 -2
  33. package/types/excalidraw/components/canvases/StaticCanvas.d.ts +4 -3
  34. package/types/excalidraw/constants.d.ts +1 -0
  35. package/types/excalidraw/distribute.d.ts +2 -2
  36. package/types/excalidraw/element/Hyperlink.d.ts +1 -1
  37. package/types/excalidraw/element/bounds.d.ts +2 -2
  38. package/types/excalidraw/element/collision.d.ts +3 -3
  39. package/types/excalidraw/element/containerCache.d.ts +11 -0
  40. package/types/excalidraw/element/embeddable.d.ts +7 -8
  41. package/types/excalidraw/element/index.d.ts +0 -1
  42. package/types/excalidraw/element/linearElementEditor.d.ts +8 -8
  43. package/types/excalidraw/element/newElement.d.ts +2 -2
  44. package/types/excalidraw/element/resizeElements.d.ts +5 -5
  45. package/types/excalidraw/element/textElement.d.ts +9 -12
  46. package/types/excalidraw/element/textWysiwyg.d.ts +1 -6
  47. package/types/excalidraw/element/transformHandles.d.ts +2 -2
  48. package/types/excalidraw/element/types.d.ts +24 -2
  49. package/types/excalidraw/frame.d.ts +16 -10
  50. package/types/excalidraw/groups.d.ts +3 -3
  51. package/types/excalidraw/index.d.ts +1 -1
  52. package/types/excalidraw/renderer/renderElement.d.ts +4 -4
  53. package/types/excalidraw/renderer/renderScene.d.ts +5 -7
  54. package/types/excalidraw/scene/Renderer.d.ts +1 -1
  55. package/types/excalidraw/scene/Scene.d.ts +9 -3
  56. package/types/excalidraw/scene/index.d.ts +0 -1
  57. package/types/excalidraw/scene/scrollbars.d.ts +2 -3
  58. package/types/excalidraw/scene/selection.d.ts +3 -3
  59. package/types/excalidraw/scene/types.d.ts +7 -4
  60. package/types/excalidraw/types.d.ts +2 -1
  61. package/types/excalidraw/utility-types.d.ts +5 -0
  62. package/types/excalidraw/utils.d.ts +16 -1
  63. package/types/excalidraw/components/LaserTool/LaserPathManager.d.ts +0 -28
  64. package/types/excalidraw/components/LaserTool/LaserPointerButton.d.ts +0 -10
  65. package/types/excalidraw/components/LaserTool/LaserTool.d.ts +0 -7
  66. package/types/excalidraw/example/App.d.ts +0 -14
  67. package/types/excalidraw/example/CustomFooter.d.ts +0 -5
  68. package/types/excalidraw/example/MobileFooter.d.ts +0 -5
  69. package/types/excalidraw/example/index.d.ts +0 -1
  70. package/types/excalidraw/example/initialData.d.ts +0 -290
  71. package/types/excalidraw/example/sidebar/ExampleSidebar.d.ts +0 -4
  72. package/types/excalidraw/rollup.config.d.ts +0 -10
  73. package/types/excalidraw/vite.config.d.mts +0 -2
  74. package/types/utils/index.d.ts +0 -1
@@ -22,3 +22,8 @@ export type ExtractSetType<T extends Set<any>> = T extends Set<infer U> ? U : ne
22
22
  export type SameType<T, U> = T extends U ? (U extends T ? true : false) : false;
23
23
  export type Assert<T extends true> = T;
24
24
  export type NestedKeyOf<T, K = keyof T> = K extends keyof T & (string | number) ? `${K}` | (T[K] extends object ? `${K}.${NestedKeyOf<T[K]>}` : never) : never;
25
+ export type SetLike<T> = Set<T> | T[];
26
+ export type ReadonlySetLike<T> = ReadonlySet<T> | readonly T[];
27
+ export type MakeBrand<T extends string> = {
28
+ [K in `~brand~${T}`]: T;
29
+ };
@@ -155,7 +155,7 @@ export declare const getUpdatedTimestamp: () => number;
155
155
  */
156
156
  export declare const arrayToMap: <T extends string | {
157
157
  id: string;
158
- }>(items: readonly T[]) => Map<string, T>;
158
+ }>(items: Map<string, T> | readonly T[]) => Map<string, T>;
159
159
  export declare const arrayToMapWithIndex: <T extends {
160
160
  id: string;
161
161
  }>(elements: readonly T[]) => Map<string, [element: T, index: number]>;
@@ -205,3 +205,18 @@ export declare function addEventListener<K extends keyof FontFaceSetEventMap>(ta
205
205
  export declare function addEventListener<K extends keyof HTMLElementEventMap>(target: Document | (Window & typeof globalThis) | HTMLElement | undefined | null | false, type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): UnsubscribeCallback;
206
206
  export declare function getSvgPathFromStroke(points: number[][], closed?: boolean): string;
207
207
  export declare const normalizeEOL: (str: string) => string;
208
+ type HasBrand<T> = {
209
+ [K in keyof T]: K extends `~brand${infer _}` ? true : never;
210
+ }[keyof T];
211
+ type RemoveAllBrands<T> = HasBrand<T> extends true ? {
212
+ [K in keyof T as K extends `~brand~${infer _}` ? never : K]: T[K];
213
+ } : never;
214
+ type Unbrand<T> = T extends Map<infer E, infer F> ? Map<E, F> : T extends Set<infer E> ? Set<E> : T extends Array<infer E> ? Array<E> : RemoveAllBrands<T>;
215
+ /**
216
+ * Makes type into a branded type, ensuring that value is assignable to
217
+ * the base ubranded type. Optionally you can explicitly supply current value
218
+ * type to combine both (useful for composite branded types. Make sure you
219
+ * compose branded types which are not composite themselves.)
220
+ */
221
+ export declare const toBrandedType: <BrandedType, CurrentType = BrandedType>(value: Unbrand<BrandedType>) => CurrentType & BrandedType;
222
+ export {};
@@ -1,28 +0,0 @@
1
- import { LaserPointer } from "@excalidraw/laser-pointer";
2
- import App from "../App";
3
- declare global {
4
- interface Window {
5
- LPM: LaserPathManager;
6
- }
7
- }
8
- export declare class LaserPathManager {
9
- private app;
10
- private ownState;
11
- private collaboratorsState;
12
- private rafId;
13
- private isDrawing;
14
- private container;
15
- constructor(app: App);
16
- destroy(): void;
17
- startPath(x: number, y: number): void;
18
- addPointToPath(x: number, y: number): void;
19
- endPath(): void;
20
- private updatePath;
21
- private isRunning;
22
- start(svg?: SVGSVGElement): void;
23
- stop(): void;
24
- loop(): void;
25
- draw(path: LaserPointer): string;
26
- updateCollabolatorsState(): void;
27
- update(): void;
28
- }
@@ -1,10 +0,0 @@
1
- import "../ToolIcon.scss";
2
- type LaserPointerIconProps = {
3
- title?: string;
4
- name?: string;
5
- checked: boolean;
6
- onChange?(): void;
7
- isMobile?: boolean;
8
- };
9
- export declare const LaserPointerButton: (props: LaserPointerIconProps) => import("react/jsx-runtime").JSX.Element;
10
- export {};
@@ -1,7 +0,0 @@
1
- import { LaserPathManager } from "./LaserPathManager";
2
- import "./LaserToolOverlay.scss";
3
- type LaserToolOverlayProps = {
4
- manager: LaserPathManager;
5
- };
6
- export declare const LaserToolOverlay: ({ manager }: LaserToolOverlayProps) => import("react/jsx-runtime").JSX.Element;
7
- export {};
@@ -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,10 +0,0 @@
1
- declare namespace _default {
2
- const input: string;
3
- namespace output {
4
- const file: string;
5
- const format: string;
6
- const name: string;
7
- }
8
- const plugins: import("rollup").Plugin[];
9
- }
10
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import("vite").UserConfig;
2
- export default _default;
@@ -1 +0,0 @@
1
- export * from "./export";