@zsviczian/excalidraw 0.17.1-obsidian-25 → 0.17.1-obsidian-26

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zsviczian/excalidraw",
3
- "version": "0.17.1-obsidian-25",
3
+ "version": "0.17.1-obsidian-26",
4
4
  "main": "main.js",
5
5
  "types": "types/excalidraw/index.d.ts",
6
6
  "files": [
@@ -2,13 +2,14 @@ import React from "react";
2
2
  import type { DOMAttributes } from "react";
3
3
  import type { Device, InteractiveCanvasAppState } from "../../types";
4
4
  import type { RenderableElementsMap, RenderInteractiveSceneCallback } from "../../scene/types";
5
- import type { NonDeletedExcalidrawElement } from "../../element/types";
5
+ import type { NonDeletedExcalidrawElement, NonDeletedSceneElementsMap } from "../../element/types";
6
6
  type InteractiveCanvasProps = {
7
7
  containerRef: React.RefObject<HTMLDivElement>;
8
8
  canvas: HTMLCanvasElement | null;
9
9
  elementsMap: RenderableElementsMap;
10
10
  visibleElements: readonly NonDeletedExcalidrawElement[];
11
11
  selectedElements: readonly NonDeletedExcalidrawElement[];
12
+ allElementsMap: NonDeletedSceneElementsMap;
12
13
  sceneNonce: number | undefined;
13
14
  selectionNonce: number | undefined;
14
15
  scale: number;
@@ -10,6 +10,7 @@ export declare const isIOS: boolean;
10
10
  export declare const isBrave: () => boolean;
11
11
  export declare const supportsResizeObserver: boolean;
12
12
  export declare const APP_NAME = "Excalidraw";
13
+ export declare const TEXT_AUTOWRAP_THRESHOLD = 36;
13
14
  export declare const DRAGGING_THRESHOLD = 10;
14
15
  export declare const LINE_CONFIRM_THRESHOLD = 8;
15
16
  export declare const ELEMENT_SHIFT_TRANSLATE_AMOUNT = 5;
@@ -1,5 +1,5 @@
1
1
  import type { NonDeletedExcalidrawElement } from "./types";
2
- import type { AppState, PointerDownState } from "../types";
2
+ import type { AppState, NormalizedZoomValue, PointerDownState } from "../types";
3
3
  import type Scene from "../scene/Scene";
4
4
  export declare const dragSelectedElements: (pointerDownState: PointerDownState, selectedElements: NonDeletedExcalidrawElement[], offset: {
5
5
  x: number;
@@ -9,7 +9,7 @@ export declare const dragSelectedElements: (pointerDownState: PointerDownState,
9
9
  y: number;
10
10
  }, gridSize: AppState["gridSize"]) => void;
11
11
  export declare const getDragOffsetXY: (selectedElements: NonDeletedExcalidrawElement[], x: number, y: number) => [number, number];
12
- export declare const dragNewElement: (draggingElement: NonDeletedExcalidrawElement, elementType: AppState["activeTool"]["type"], originX: number, originY: number, x: number, y: number, width: number, height: number, shouldMaintainAspectRatio: boolean, shouldResizeFromCenter: boolean, widthAspectRatio?: number | null, originOffset?: {
12
+ export declare const dragNewElement: (draggingElement: NonDeletedExcalidrawElement, elementType: AppState["activeTool"]["type"], originX: number, originY: number, x: number, y: number, width: number, height: number, shouldMaintainAspectRatio: boolean, shouldResizeFromCenter: boolean, zoom: NormalizedZoomValue, widthAspectRatio?: number | null, originOffset?: {
13
13
  x: number;
14
14
  y: number;
15
15
  } | null) => void;
@@ -87,4 +87,5 @@ export declare const FONT_METRICS: Record<number, {
87
87
  export declare const getDefaultLineHeight: (fontFamily: FontFamilyValues) => number & {
88
88
  _brand: "unitlessLineHeight";
89
89
  };
90
+ export declare const getMinTextElementWidth: (font: FontString, lineHeight: ExcalidrawTextElement["lineHeight"]) => number;
90
91
  export {};
@@ -1,6 +1,6 @@
1
1
  import type { ExcalidrawElement, ExcalidrawTextElement } from "./types";
2
2
  import type App from "../components/App";
3
- export declare const textWysiwyg: ({ id, onChange, onSubmit, getViewportCoords, element, canvas, excalidrawContainer, app, }: {
3
+ export declare const textWysiwyg: ({ id, onChange, onSubmit, getViewportCoords, element, canvas, excalidrawContainer, app, autoSelect, }: {
4
4
  id: ExcalidrawElement["id"];
5
5
  /**
6
6
  * textWysiwyg only deals with `originalText`
@@ -18,4 +18,5 @@ export declare const textWysiwyg: ({ id, onChange, onSubmit, getViewportCoords,
18
18
  canvas: HTMLCanvasElement;
19
19
  excalidrawContainer: HTMLDivElement | null;
20
20
  app: App;
21
+ autoSelect?: boolean | undefined;
21
22
  }) => void;
@@ -9,7 +9,7 @@ export declare const renderInteractiveSceneThrottled: {
9
9
  * Interactive scene is the ui-canvas where we render bounding boxes, selections
10
10
  * and other ui stuff.
11
11
  */
12
- export declare const renderInteractiveScene: <U extends ({ canvas, elementsMap, visibleElements, selectedElements, scale, appState, renderConfig, device, }: InteractiveSceneRenderConfig) => {
12
+ export declare const renderInteractiveScene: <U extends ({ canvas, elementsMap, visibleElements, selectedElements, allElementsMap, scale, appState, renderConfig, device, }: InteractiveSceneRenderConfig) => {
13
13
  atLeastOneVisibleElement: boolean;
14
14
  elementsMap: RenderableElementsMap;
15
15
  scrollBars?: undefined;
@@ -1,6 +1,6 @@
1
1
  import type { ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawFrameLikeElement, NonDeletedSceneElementsMap } from "../element/types";
2
2
  import type { RoughCanvas } from "roughjs/bin/canvas";
3
- import type { StaticCanvasRenderConfig, RenderableElementsMap } from "../scene/types";
3
+ import type { StaticCanvasRenderConfig, RenderableElementsMap, InteractiveCanvasRenderConfig } from "../scene/types";
4
4
  import type { AppState, StaticCanvasAppState, InteractiveCanvasAppState, ElementsPendingErasure } from "../types";
5
5
  export declare const IMAGE_INVERT_FILTER = "invert(100%) hue-rotate(180deg) saturate(1.25)";
6
6
  export declare const getRenderOpacity: (element: ExcalidrawElement, containingFrame: ExcalidrawFrameLikeElement | null, elementsPendingErasure: ElementsPendingErasure) => number;
@@ -17,7 +17,7 @@ export interface ExcalidrawElementWithCanvas {
17
17
  }
18
18
  export declare const DEFAULT_LINK_SIZE = 14;
19
19
  export declare const elementWithCanvasCache: WeakMap<ExcalidrawElement, ExcalidrawElementWithCanvas>;
20
- export declare const renderSelectionElement: (element: NonDeletedExcalidrawElement, context: CanvasRenderingContext2D, appState: InteractiveCanvasAppState) => void;
20
+ export declare const renderSelectionElement: (element: NonDeletedExcalidrawElement, context: CanvasRenderingContext2D, appState: InteractiveCanvasAppState, selectionColor: InteractiveCanvasRenderConfig["selectionColor"]) => void;
21
21
  export declare const renderElement: (element: NonDeletedExcalidrawElement, elementsMap: RenderableElementsMap, allElementsMap: NonDeletedSceneElementsMap, rc: RoughCanvas, context: CanvasRenderingContext2D, renderConfig: StaticCanvasRenderConfig, appState: StaticCanvasAppState) => void;
22
22
  export declare const pathsCache: WeakMap<ExcalidrawFreeDrawElement, Path2D>;
23
23
  export declare function generateFreeDrawShape(element: ExcalidrawFreeDrawElement): Path2D;
@@ -34,7 +34,7 @@ export type InteractiveCanvasRenderConfig = {
34
34
  remotePointerUserStates: Map<SocketId, UserIdleState>;
35
35
  remotePointerUsernames: Map<SocketId, string>;
36
36
  remotePointerButton: Map<SocketId, string | undefined>;
37
- selectionColor?: string;
37
+ selectionColor: string;
38
38
  renderScrollbars?: boolean;
39
39
  };
40
40
  export type RenderInteractiveSceneCallback = {
@@ -57,6 +57,7 @@ export type InteractiveSceneRenderConfig = {
57
57
  elementsMap: RenderableElementsMap;
58
58
  visibleElements: readonly NonDeletedExcalidrawElement[];
59
59
  selectedElements: readonly NonDeletedExcalidrawElement[];
60
+ allElementsMap: NonDeletedSceneElementsMap;
60
61
  scale: number;
61
62
  appState: InteractiveCanvasAppState;
62
63
  renderConfig: InteractiveCanvasRenderConfig;
@@ -138,6 +138,7 @@ export type InteractiveCanvasAppState = Readonly<_CommonCanvasAppState & {
138
138
  collaborators: AppState["collaborators"];
139
139
  snapLines: AppState["snapLines"];
140
140
  zenModeEnabled: AppState["zenModeEnabled"];
141
+ editingElement: AppState["editingElement"];
141
142
  }>;
142
143
  export type ObservedAppState = ObservedStandaloneAppState & ObservedElementsAppState;
143
144
  export type ObservedStandaloneAppState = {