@zsviczian/excalidraw 0.18.0-17 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zsviczian/excalidraw",
3
- "version": "0.18.0-17",
3
+ "version": "0.18.0-18",
4
4
  "main": "main.js",
5
5
  "module": "./dist/prod/index.js",
6
6
  "types": "types/excalidraw/index.d.ts",
@@ -1,5 +1,6 @@
1
1
  import type { AppState, Offsets, Zoom } from "@excalidraw/excalidraw/types";
2
2
  import type { ElementsMap, ExcalidrawElement } from "./types";
3
+ export declare const INVISIBLY_SMALL_ELEMENT_SIZE = 0.1;
3
4
  export declare const isInvisiblySmallElement: (element: ExcalidrawElement) => boolean;
4
5
  export declare const isElementInViewport: (element: ExcalidrawElement, width: number, height: number, viewTransformations: {
5
6
  zoom: Zoom;
@@ -42,4 +42,12 @@ export declare const getDefaultRoundnessTypeForElement: (element: ExcalidrawElem
42
42
  export declare const isFixedPointBinding: (binding: PointBinding | FixedPointBinding) => binding is FixedPointBinding;
43
43
  export declare const isBounds: (box: unknown) => box is Bounds;
44
44
  export declare const getLinearElementSubType: (element: ExcalidrawLinearElement) => ExcalidrawLinearElementSubType;
45
- export declare const isEligiblePolygon: (element: ExcalidrawElement) => element is ExcalidrawLineElement;
45
+ /**
46
+ * Checks if current element points meet all the conditions for polygon=true
47
+ * (this isn't a element type check, for that use isLineElement).
48
+ *
49
+ * If you want to check if points *can* be turned into a polygon, use
50
+ * canBecomePolygon(points).
51
+ */
52
+ export declare const isValidPolygon: (points: ExcalidrawLineElement["points"]) => boolean;
53
+ export declare const canBecomePolygon: (points: ExcalidrawLineElement["points"]) => boolean;
@@ -1,10 +1,49 @@
1
1
  import { LinearElementEditor } from "@excalidraw/element";
2
+ import type { LocalPoint } from "@excalidraw/math";
3
+ import type { ExcalidrawElement, ExcalidrawLinearElement, NonDeleted } from "@excalidraw/element/types";
2
4
  import type { AppState } from "../types";
3
5
  export declare const actionFinalize: {
4
6
  name: "finalize";
5
7
  label: string;
6
8
  trackEvent: false;
7
- perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, _: any, app: import("../types").AppClassProperties) => {
9
+ perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, data: any, app: import("../types").AppClassProperties) => {
10
+ elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[];
11
+ appState: {
12
+ selectedLinearElement: {
13
+ selectedPointsIndices: null;
14
+ elementId: string & {
15
+ _brand: "excalidrawLinearElementId";
16
+ };
17
+ pointerDownState: Readonly<{
18
+ prevSelectedPointsIndices: readonly number[] | null;
19
+ lastClickedPoint: number;
20
+ lastClickedIsEndPoint: boolean;
21
+ origin: Readonly<{
22
+ x: number;
23
+ y: number;
24
+ }> | null;
25
+ segmentMidpoint: {
26
+ value: import("@excalidraw/math").GlobalPoint | null;
27
+ index: number | null;
28
+ added: boolean;
29
+ };
30
+ }>;
31
+ isDragging: boolean;
32
+ lastUncommittedPoint: LocalPoint | null;
33
+ pointerOffset: Readonly<{
34
+ x: number;
35
+ y: number;
36
+ }>;
37
+ startBindingElement: import("@excalidraw/element/types").ExcalidrawBindableElement | "keep" | null;
38
+ endBindingElement: import("@excalidraw/element/types").ExcalidrawBindableElement | "keep" | null;
39
+ hoverPointIndex: number;
40
+ segmentMidPointHoveredCoords: import("@excalidraw/math").GlobalPoint | null;
41
+ elbowed: boolean;
42
+ };
43
+ suggestedBindings: never[];
44
+ };
45
+ captureUpdate: "IMMEDIATELY";
46
+ } | {
8
47
  elements: import("@excalidraw/element/types").OrderedExcalidrawElement[] | undefined;
9
48
  appState: {
10
49
  cursorButton: "up";
@@ -21,14 +60,14 @@ export declare const actionFinalize: {
21
60
  element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
22
61
  state: "active" | "hover";
23
62
  } | null;
24
- newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
63
+ newElement: NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
25
64
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
26
- multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
65
+ multiElement: NonDeleted<ExcalidrawLinearElement> | null;
27
66
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
28
67
  isBindingEnabled: boolean;
29
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
68
+ startBoundElement: NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
30
69
  suggestedBindings: import("@excalidraw/element").SuggestedBinding[];
31
- frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
70
+ frameToHighlight: NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
32
71
  frameRendering: {
33
72
  enabled: boolean;
34
73
  name: boolean;
@@ -36,7 +75,7 @@ export declare const actionFinalize: {
36
75
  clip: boolean;
37
76
  };
38
77
  editingFrame: string | null;
39
- elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
78
+ elementsToHighlight: NonDeleted<ExcalidrawElement>[] | null;
40
79
  editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
41
80
  activeTool: {
42
81
  lastActiveTool: import("../types").ActiveTool | null;
@@ -246,7 +285,7 @@ export declare const actionFinalize: {
246
285
  errorMessage: import("react").ReactNode;
247
286
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
248
287
  isBindingEnabled: boolean;
249
- frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
288
+ frameToHighlight: NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
250
289
  frameRendering: {
251
290
  enabled: boolean;
252
291
  name: boolean;
@@ -254,7 +293,7 @@ export declare const actionFinalize: {
254
293
  clip: boolean;
255
294
  };
256
295
  editingFrame: string | null;
257
- elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
296
+ elementsToHighlight: NonDeleted<ExcalidrawElement>[] | null;
258
297
  editingLinearElement: LinearElementEditor | null;
259
298
  penMode: boolean;
260
299
  penDetected: boolean;