@zsviczian/excalidraw 0.18.0-16 → 0.18.0-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 (40) hide show
  1. package/dist/excalidraw.development.js +53 -31
  2. package/dist/excalidraw.production.min.js +1 -1
  3. package/dist/styles.development.css +32 -0
  4. package/dist/styles.production.css +1 -0
  5. package/package.json +1 -1
  6. package/types/element/src/linearElementEditor.d.ts +1 -8
  7. package/types/element/src/sizeHelpers.d.ts +1 -0
  8. package/types/element/src/typeChecks.d.ts +9 -1
  9. package/types/excalidraw/actions/actionAddToLibrary.d.ts +12 -0
  10. package/types/excalidraw/actions/actionBoundText.d.ts +8 -0
  11. package/types/excalidraw/actions/actionCanvas.d.ts +75 -15
  12. package/types/excalidraw/actions/actionClipboard.d.ts +24 -0
  13. package/types/excalidraw/actions/actionCropEditor.d.ts +4 -0
  14. package/types/excalidraw/actions/actionDeleteSelected.d.ts +12 -0
  15. package/types/excalidraw/actions/actionElementLink.d.ts +4 -0
  16. package/types/excalidraw/actions/actionElementLock.d.ts +23 -16
  17. package/types/excalidraw/actions/actionEmbeddable.d.ts +4 -0
  18. package/types/excalidraw/actions/actionExport.d.ts +36 -0
  19. package/types/excalidraw/actions/actionFinalize.d.ts +55 -8
  20. package/types/excalidraw/actions/actionFrame.d.ts +16 -0
  21. package/types/excalidraw/actions/actionGroup.d.ts +8 -0
  22. package/types/excalidraw/actions/actionLinearEditor.d.ts +5 -2
  23. package/types/excalidraw/actions/actionLink.d.ts +4 -0
  24. package/types/excalidraw/actions/actionMenu.d.ts +12 -0
  25. package/types/excalidraw/actions/actionNavigate.d.ts +8 -0
  26. package/types/excalidraw/actions/actionProperties.d.ts +60 -0
  27. package/types/excalidraw/actions/actionSelectAll.d.ts +4 -0
  28. package/types/excalidraw/actions/actionStyles.d.ts +4 -0
  29. package/types/excalidraw/actions/actionToggleGridMode.d.ts +4 -0
  30. package/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +4 -0
  31. package/types/excalidraw/actions/actionToggleSearchMenu.d.ts +4 -0
  32. package/types/excalidraw/actions/actionToggleStats.d.ts +4 -0
  33. package/types/excalidraw/actions/actionToggleViewMode.d.ts +4 -0
  34. package/types/excalidraw/actions/actionToggleZenMode.d.ts +4 -0
  35. package/types/excalidraw/appState.d.ts +9 -0
  36. package/types/excalidraw/components/UnlockPopup.d.ts +8 -0
  37. package/types/excalidraw/components/icons.d.ts +1 -0
  38. package/types/excalidraw/index.d.ts +1 -1
  39. package/types/excalidraw/obsidianUtils.d.ts +9 -1
  40. package/types/excalidraw/types.d.ts +8 -0
@@ -211,6 +211,10 @@ export declare const actionToggleObjectsSnapMode: {
211
211
  focusedId: string | null;
212
212
  matches: readonly import("../types").SearchMatch[];
213
213
  }> | null;
214
+ activeLockedId: string | null;
215
+ lockedMultiSelections: {
216
+ [groupId: string]: true;
217
+ };
214
218
  };
215
219
  captureUpdate: "EVENTUALLY";
216
220
  };
@@ -204,6 +204,10 @@ export declare const actionToggleSearchMenu: {
204
204
  focusedId: string | null;
205
205
  matches: readonly import("../types").SearchMatch[];
206
206
  }> | null;
207
+ activeLockedId: string | null;
208
+ lockedMultiSelections: {
209
+ [groupId: string]: true;
210
+ };
207
211
  };
208
212
  captureUpdate: "EVENTUALLY";
209
213
  };
@@ -211,6 +211,10 @@ export declare const actionToggleStats: {
211
211
  focusedId: string | null;
212
212
  matches: readonly import("../types").SearchMatch[];
213
213
  }> | null;
214
+ activeLockedId: string | null;
215
+ lockedMultiSelections: {
216
+ [groupId: string]: true;
217
+ };
214
218
  };
215
219
  captureUpdate: "EVENTUALLY";
216
220
  };
@@ -211,6 +211,10 @@ export declare const actionToggleViewMode: {
211
211
  focusedId: string | null;
212
212
  matches: readonly import("../types").SearchMatch[];
213
213
  }> | null;
214
+ activeLockedId: string | null;
215
+ lockedMultiSelections: {
216
+ [groupId: string]: true;
217
+ };
214
218
  };
215
219
  captureUpdate: "EVENTUALLY";
216
220
  };
@@ -211,6 +211,10 @@ export declare const actionToggleZenMode: {
211
211
  focusedId: string | null;
212
212
  matches: readonly import("../types").SearchMatch[];
213
213
  }> | null;
214
+ activeLockedId: string | null;
215
+ lockedMultiSelections: {
216
+ [groupId: string]: true;
217
+ };
214
218
  };
215
219
  captureUpdate: "EVENTUALLY";
216
220
  };
@@ -66,18 +66,27 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
66
66
  currentChartType?: import("@excalidraw/element/types").ChartType | undefined;
67
67
  selectedLinearElement?: import("@excalidraw/element").LinearElementEditor | null | undefined;
68
68
  objectsSnapModeEnabled?: boolean | undefined;
69
+ lockedMultiSelections?: {
70
+ [groupId: string]: true;
71
+ } | undefined;
69
72
  };
70
73
  export declare const cleanAppStateForExport: (appState: Partial<AppState>) => {
71
74
  viewBackgroundColor?: string | undefined;
72
75
  gridSize?: number | undefined;
73
76
  gridStep?: number | undefined;
74
77
  gridModeEnabled?: boolean | undefined;
78
+ lockedMultiSelections?: {
79
+ [groupId: string]: true;
80
+ } | undefined;
75
81
  };
76
82
  export declare const clearAppStateForDatabase: (appState: Partial<AppState>) => {
77
83
  viewBackgroundColor?: string | undefined;
78
84
  gridSize?: number | undefined;
79
85
  gridStep?: number | undefined;
80
86
  gridModeEnabled?: boolean | undefined;
87
+ lockedMultiSelections?: {
88
+ [groupId: string]: true;
89
+ } | undefined;
81
90
  };
82
91
  export declare const isEraserActive: ({ activeTool, }: {
83
92
  activeTool: AppState["activeTool"];
@@ -0,0 +1,8 @@
1
+ import "./UnlockPopup.scss";
2
+ import type App from "./App";
3
+ import type { AppState } from "../types";
4
+ declare const UnlockPopup: ({ app, activeLockedId, }: {
5
+ app: App;
6
+ activeLockedId: NonNullable<AppState["activeLockedId"]>;
7
+ }) => import("react/jsx-runtime").JSX.Element | null;
8
+ export default UnlockPopup;
@@ -15,6 +15,7 @@ export declare const PinIcon: import("react/jsx-runtime").JSX.Element;
15
15
  export declare const polygonIcon: import("react/jsx-runtime").JSX.Element;
16
16
  export declare const UnlockedIcon: import("react/jsx-runtime").JSX.Element;
17
17
  export declare const LockedIcon: import("react/jsx-runtime").JSX.Element;
18
+ export declare const LockedIconFilled: import("react/jsx-runtime").JSX.Element;
18
19
  export declare const WelcomeScreenMenuArrow: import("react/jsx-runtime").JSX.Element;
19
20
  export declare const WelcomeScreenHelpArrow: import("react/jsx-runtime").JSX.Element;
20
21
  export declare const WelcomeScreenTopToolbarArrow: import("react/jsx-runtime").JSX.Element;
@@ -24,7 +24,7 @@ export { getLineHeight } from "@excalidraw/common";
24
24
  export { getFontString, getFontFamilyString } from "@excalidraw/common";
25
25
  export { getBoundTextMaxWidth } from "@excalidraw/element/textElement";
26
26
  export { mermaidToExcalidraw } from "./components/TTDDialog/MermaidToExcalidrawLib";
27
- export { destroyObsidianUtils, registerLocalFont, getFontFamilies, registerFontsInCSS, getCSSFontDefinition, loadSceneFonts, getSharedMermaidInstance, loadMermaid, intersectElementWithLine, } from "../excalidraw/obsidianUtils";
27
+ export { destroyObsidianUtils, registerLocalFont, getFontMetrics, getFontFamilies, registerFontsInCSS, getCSSFontDefinition, loadSceneFonts, getSharedMermaidInstance, loadMermaid, intersectElementWithLine, } from "../excalidraw/obsidianUtils";
28
28
  export { refreshTextDimensions } from "@excalidraw/element/newElement";
29
29
  export { getContainerElement } from "@excalidraw/element/textElement";
30
30
  export { serializeAsJSON, serializeLibraryAsJSON } from "./data/json";
@@ -1,6 +1,6 @@
1
1
  import { GlobalPoint } from "@excalidraw/math/types";
2
2
  import type { MermaidToExcalidrawLibProps } from "./components/TTDDialog/common";
3
- import type { ElementsMap, ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
3
+ import type { ElementsMap, ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
4
4
  import type { FontMetadata } from "@excalidraw/common";
5
5
  import type { AppState } from "./types";
6
6
  export declare let hostPlugin: any;
@@ -14,6 +14,14 @@ export declare function isExcaliBrainView(): any;
14
14
  export declare function getExcalidrawContentEl(): HTMLElement;
15
15
  export declare function hideFreedrawPenmodeCursor(): boolean;
16
16
  export declare function getOpenAIDefaultVisionModel(): any;
17
+ export declare function getFontMetrics(fontFamily: ExcalidrawTextElement["fontFamily"], fontSize?: number): {
18
+ unitsPerEm: number;
19
+ ascender: number;
20
+ descender: number;
21
+ lineHeight: number;
22
+ baseline: number;
23
+ fontString: string;
24
+ };
17
25
  export declare function registerLocalFont(fontMetrics: FontMetadata & {
18
26
  name: string;
19
27
  }, uri: string): void;
@@ -153,6 +153,7 @@ export type InteractiveCanvasAppState = Readonly<_CommonCanvasAppState & {
153
153
  isCropping: AppState["isCropping"];
154
154
  croppingElementId: AppState["croppingElementId"];
155
155
  searchMatches: AppState["searchMatches"];
156
+ activeLockedId: AppState["activeLockedId"];
156
157
  }>;
157
158
  export type ObservedAppState = ObservedStandaloneAppState & ObservedElementsAppState;
158
159
  export type ObservedStandaloneAppState = {
@@ -166,6 +167,8 @@ export type ObservedElementsAppState = {
166
167
  editingLinearElementId: LinearElementEditor["elementId"] | null;
167
168
  selectedLinearElementId: LinearElementEditor["elementId"] | null;
168
169
  croppingElementId: AppState["croppingElementId"];
170
+ lockedMultiSelections: AppState["lockedMultiSelections"];
171
+ activeLockedId: AppState["activeLockedId"];
169
172
  };
170
173
  export interface AppState {
171
174
  contextMenu: {
@@ -389,6 +392,11 @@ export interface AppState {
389
392
  focusedId: ExcalidrawElement["id"] | null;
390
393
  matches: readonly SearchMatch[];
391
394
  }> | null;
395
+ /** the locked element/group that's active and shows unlock popup */
396
+ activeLockedId: string | null;
397
+ lockedMultiSelections: {
398
+ [groupId: string]: true;
399
+ };
392
400
  }
393
401
  export type SearchMatch = {
394
402
  id: string;