@zsviczian/excalidraw 0.14.2-obsidian-3 → 0.14.2-obsidian-5

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 (34) hide show
  1. package/dist/excalidraw.development.js +37 -37
  2. package/dist/excalidraw.production.min.js +1 -1
  3. package/package.json +1 -1
  4. package/types/actions/actionAddToLibrary.d.ts +3 -0
  5. package/types/actions/actionBoundText.d.ts +129 -9
  6. package/types/actions/actionCanvas.d.ts +10 -0
  7. package/types/actions/actionClipboard.d.ts +5 -0
  8. package/types/actions/actionDeleteSelected.d.ts +3 -0
  9. package/types/actions/actionExport.d.ts +9 -0
  10. package/types/actions/actionFinalize.d.ts +2 -0
  11. package/types/actions/actionLinearEditor.d.ts +1 -0
  12. package/types/actions/actionMenu.d.ts +3 -0
  13. package/types/actions/actionProperties.d.ts +14 -1
  14. package/types/actions/actionStyles.d.ts +1 -0
  15. package/types/actions/actionToggleGridMode.d.ts +1 -0
  16. package/types/actions/actionToggleLock.d.ts +1 -0
  17. package/types/actions/actionToggleStats.d.ts +1 -0
  18. package/types/actions/actionToggleViewMode.d.ts +1 -0
  19. package/types/actions/actionToggleZenMode.d.ts +1 -0
  20. package/types/components/ButtonIconSelect.d.ts +11 -3
  21. package/types/components/Modal.d.ts +1 -0
  22. package/types/components/icons.d.ts +1 -0
  23. package/types/element/Hyperlink.d.ts +1 -0
  24. package/types/element/linearElementEditor.d.ts +1 -0
  25. package/types/element/newElement.d.ts +2 -1
  26. package/types/element/textElement.d.ts +6 -0
  27. package/types/element/types.d.ts +2 -1
  28. package/types/packages/common.webpack.dev.config.d.ts +1 -0
  29. package/types/packages/common.webpack.prod.config.d.ts +1 -0
  30. package/types/packages/excalidraw/webpack.dev.config.d.ts +1 -0
  31. package/types/packages/excalidraw/webpack.prod.config.d.ts +1 -0
  32. package/types/renderer/renderElement.d.ts +2 -2
  33. package/types/types.d.ts +1 -0
  34. package/types/utils.d.ts +0 -1
@@ -131,6 +131,7 @@ export declare const actionLink: {
131
131
  currentStrokeOptions?: any;
132
132
  resetCustomPen?: any;
133
133
  gridColor: string;
134
+ dynamicStyle: string;
134
135
  selectedLinearElement: import("./linearElementEditor").LinearElementEditor | null;
135
136
  };
136
137
  commitToHistory: true;
@@ -240,6 +240,7 @@ export declare class LinearElementEditor {
240
240
  currentStrokeOptions?: any;
241
241
  resetCustomPen?: any;
242
242
  gridColor: string;
243
+ dynamicStyle: string;
243
244
  selectedLinearElement: LinearElementEditor | null;
244
245
  };
245
246
  };
@@ -20,8 +20,9 @@ export declare const refreshTextDimensions: (textElement: ExcalidrawTextElement,
20
20
  y: number;
21
21
  width: number;
22
22
  height: number;
23
+ baseline: number;
23
24
  text: string;
24
- };
25
+ } | undefined;
25
26
  export declare const updateTextElement: (textElement: ExcalidrawTextElement, { text, isDeleted, originalText, rawText, link, }: {
26
27
  text: string;
27
28
  isDeleted?: boolean | undefined;
@@ -7,10 +7,16 @@ export declare const splitIntoLines: (text: string) => string[];
7
7
  export declare const redrawTextBoundingBox: (textElement: ExcalidrawTextElement, container: ExcalidrawElement | null) => void;
8
8
  export declare const bindTextToShapeAfterDuplication: (sceneElements: ExcalidrawElement[], oldElements: ExcalidrawElement[], oldIdToDuplicatedId: Map<ExcalidrawElement["id"], ExcalidrawElement["id"]>) => void;
9
9
  export declare const handleBindTextResize: (container: NonDeletedExcalidrawElement, transformHandleType: MaybeTransformHandleType) => void;
10
+ export declare const computeBoundTextPosition: (container: ExcalidrawElement, boundTextElement: ExcalidrawTextElementWithContainer) => {
11
+ x: number;
12
+ y: number;
13
+ };
10
14
  export declare const measureText: (text: string, font: FontString, lineHeight: ExcalidrawTextElement["lineHeight"]) => {
11
15
  width: number;
12
16
  height: number;
17
+ baseline: number;
13
18
  };
19
+ export declare const measureBaseline: (text: string, font: FontString, lineHeight: ExcalidrawTextElement["lineHeight"], wrapInContainer?: boolean) => number;
14
20
  /**
15
21
  * To get unitless line-height (if unknown) we can calculate it by dividing
16
22
  * height-per-line by fontSize.
@@ -2,7 +2,7 @@ import { Point } from "../types";
2
2
  import { FONT_FAMILY, ROUNDNESS, TEXT_ALIGN, THEME, VERTICAL_ALIGN } from "../constants";
3
3
  import { MarkNonNullable, ValueOf } from "../utility-types";
4
4
  export declare type ChartType = "bar" | "line";
5
- export declare type FillStyle = "hachure" | "cross-hatch" | "solid";
5
+ export declare type FillStyle = "hachure" | "cross-hatch" | "solid" | "zigzag";
6
6
  export declare type FontFamilyKeys = keyof typeof FONT_FAMILY;
7
7
  export declare type FontFamilyValues = typeof FONT_FAMILY[FontFamilyKeys];
8
8
  export declare type Theme = typeof THEME[keyof typeof THEME];
@@ -101,6 +101,7 @@ export declare type ExcalidrawTextElement = _ExcalidrawElementBase & Readonly<{
101
101
  fontFamily: FontFamilyValues;
102
102
  text: string;
103
103
  rawText: string;
104
+ baseline: number;
104
105
  textAlign: TextAlign;
105
106
  verticalAlign: VerticalAlign;
106
107
  containerId: ExcalidrawGenericElement["id"] | null;
@@ -44,6 +44,7 @@ export namespace module {
44
44
  })[];
45
45
  }
46
46
  export namespace optimization {
47
+ const sideEffects: boolean;
47
48
  namespace splitChunks {
48
49
  const chunks: string;
49
50
  namespace cacheGroups {
@@ -54,6 +54,7 @@ export namespace module {
54
54
  })[];
55
55
  }
56
56
  export namespace optimization {
57
+ const sideEffects: boolean;
57
58
  const minimize: boolean;
58
59
  const minimizer: any[];
59
60
  namespace splitChunks {
@@ -39,6 +39,7 @@ declare const _exports: {
39
39
  })[];
40
40
  };
41
41
  optimization: {
42
+ sideEffects: boolean;
42
43
  splitChunks: {
43
44
  chunks: string;
44
45
  cacheGroups: {
@@ -46,6 +46,7 @@ declare const _exports: {
46
46
  })[];
47
47
  };
48
48
  optimization: {
49
+ sideEffects: boolean;
49
50
  minimize: boolean;
50
51
  minimizer: any[];
51
52
  splitChunks: {
@@ -3,12 +3,12 @@ import { RoughCanvas } from "roughjs/bin/canvas";
3
3
  import { Drawable, Options } from "roughjs/bin/core";
4
4
  import { RoughSVG } from "roughjs/bin/svg";
5
5
  import { RenderConfig } from "../scene/types";
6
- import { AppState, BinaryFiles, Zoom } from "../types";
6
+ import { AppState, BinaryFiles } from "../types";
7
7
  export interface ExcalidrawElementWithCanvas {
8
8
  element: ExcalidrawElement | ExcalidrawTextElement;
9
9
  canvas: HTMLCanvasElement;
10
10
  theme: RenderConfig["theme"];
11
- canvasZoom: Zoom["value"];
11
+ scale: number;
12
12
  canvasOffsetX: number;
13
13
  canvasOffsetY: number;
14
14
  boundTextElementVersion: number | null;
package/types/types.d.ts CHANGED
@@ -185,6 +185,7 @@ export declare type AppState = {
185
185
  currentStrokeOptions?: any;
186
186
  resetCustomPen?: any;
187
187
  gridColor: string;
188
+ dynamicStyle: string;
188
189
  selectedLinearElement: LinearElementEditor | null;
189
190
  };
190
191
  export declare type NormalizedZoomValue = number & {
package/types/utils.d.ts CHANGED
@@ -148,7 +148,6 @@ export declare const arrayToMapWithIndex: <T extends {
148
148
  id: string;
149
149
  }>(elements: readonly T[]) => Map<string, [element: T, index: number]>;
150
150
  export declare const isTestEnv: () => boolean;
151
- export declare const isProdEnv: () => boolean;
152
151
  export declare const wrapEvent: <T extends Event>(name: EVENT, nativeEvent: T) => CustomEvent<{
153
152
  nativeEvent: T;
154
153
  }>;