@excalidraw/excalidraw 0.18.0-864353b → 0.18.0-9036812b6

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 (113) hide show
  1. package/dist/dev/{chunk-BBNNHA7I.js → chunk-CP5DND7P.js} +2 -2
  2. package/dist/dev/{chunk-BBNNHA7I.js.map → chunk-CP5DND7P.js.map} +1 -1
  3. package/dist/dev/chunk-FRLWKCNE.js +5668 -0
  4. package/dist/dev/chunk-FRLWKCNE.js.map +7 -0
  5. package/dist/dev/{chunk-7YMZV3TY.js → chunk-QF5FRM6O.js} +2 -2
  6. package/dist/dev/{chunk-7YMZV3TY.js.map → chunk-QF5FRM6O.js.map} +2 -2
  7. package/dist/dev/data/{image-OFYK7EOY.js → image-T2LJEHDP.js} +3 -3
  8. package/dist/dev/index.css +4 -0
  9. package/dist/dev/index.css.map +2 -2
  10. package/dist/dev/index.js +6280 -4106
  11. package/dist/dev/index.js.map +4 -4
  12. package/dist/dev/locales/{en-KIY5SGI3.js → en-SMAPCEOQ.js} +2 -2
  13. package/dist/dev/subset-shared.chunk.js +1 -1
  14. package/dist/dev/subset-worker.chunk.js +1 -1
  15. package/dist/prod/{chunk-UH6Q3EIV.js → chunk-A66AFZZU.js} +1 -1
  16. package/dist/prod/{chunk-OUULIERA.js → chunk-I4UNSFV6.js} +3 -3
  17. package/dist/prod/chunk-YZO7PSYQ.js +4 -0
  18. package/dist/prod/data/image-53OPA26C.js +1 -0
  19. package/dist/prod/index.css +1 -1
  20. package/dist/prod/index.js +25 -18
  21. package/dist/prod/locales/{en-GCLCIHXH.js → en-TYY6KWIJ.js} +1 -1
  22. package/dist/prod/subset-shared.chunk.js +1 -1
  23. package/dist/prod/subset-worker.chunk.js +1 -1
  24. package/dist/types/common/src/constants.d.ts +12 -2
  25. package/dist/types/common/src/utils.d.ts +3 -5
  26. package/dist/types/element/src/Scene.d.ts +1 -1
  27. package/dist/types/element/src/align.d.ts +2 -1
  28. package/dist/types/element/src/binding.d.ts +10 -7
  29. package/dist/types/element/src/bounds.d.ts +11 -3
  30. package/dist/types/element/src/collision.d.ts +18 -12
  31. package/dist/types/element/src/cropElement.d.ts +1 -1
  32. package/dist/types/element/src/delta.d.ts +37 -8
  33. package/dist/types/element/src/distance.d.ts +2 -2
  34. package/dist/types/element/src/distribute.d.ts +2 -1
  35. package/dist/types/element/src/fractionalIndex.d.ts +8 -2
  36. package/dist/types/element/src/frame.d.ts +2 -2
  37. package/dist/types/element/src/groups.d.ts +1 -0
  38. package/dist/types/element/src/index.d.ts +1 -3
  39. package/dist/types/element/src/linearElementEditor.d.ts +5 -7
  40. package/dist/types/element/src/mutateElement.d.ts +1 -1
  41. package/dist/types/element/src/resizeElements.d.ts +1 -0
  42. package/dist/types/element/src/selection.d.ts +1 -1
  43. package/dist/types/element/src/shape.d.ts +42 -0
  44. package/dist/types/element/src/store.d.ts +13 -8
  45. package/dist/types/element/src/transformHandles.d.ts +4 -4
  46. package/dist/types/element/src/typeChecks.d.ts +4 -0
  47. package/dist/types/element/src/types.d.ts +1 -1
  48. package/dist/types/element/src/utils.d.ts +16 -6
  49. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +9 -15
  50. package/dist/types/excalidraw/actions/actionAlign.d.ts +8 -8
  51. package/dist/types/excalidraw/actions/actionBoundText.d.ts +6 -10
  52. package/dist/types/excalidraw/actions/actionCanvas.d.ts +129 -155
  53. package/dist/types/excalidraw/actions/actionClipboard.d.ts +25 -36
  54. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +3 -5
  55. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +14 -20
  56. package/dist/types/excalidraw/actions/actionDistribute.d.ts +4 -4
  57. package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +2 -2
  58. package/dist/types/excalidraw/actions/actionElementLink.d.ts +2 -4
  59. package/dist/types/excalidraw/actions/actionElementLock.d.ts +8 -12
  60. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +3 -5
  61. package/dist/types/excalidraw/actions/actionExport.d.ts +112 -130
  62. package/dist/types/excalidraw/actions/actionFinalize.d.ts +9 -12
  63. package/dist/types/excalidraw/actions/actionFlip.d.ts +4 -4
  64. package/dist/types/excalidraw/actions/actionFrame.d.ts +62 -70
  65. package/dist/types/excalidraw/actions/actionGroup.d.ts +12 -16
  66. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +84 -55
  67. package/dist/types/excalidraw/actions/actionLink.d.ts +4 -6
  68. package/dist/types/excalidraw/actions/actionMenu.d.ts +10 -16
  69. package/dist/types/excalidraw/actions/actionNavigate.d.ts +6 -10
  70. package/dist/types/excalidraw/actions/actionProperties.d.ts +49 -79
  71. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +6 -8
  72. package/dist/types/excalidraw/actions/actionStyles.d.ts +7 -9
  73. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +5 -7
  74. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +5 -7
  75. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +4 -6
  76. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +5 -7
  77. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +5 -7
  78. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +5 -7
  79. package/dist/types/excalidraw/actions/actionZindex.d.ts +8 -8
  80. package/dist/types/excalidraw/appState.d.ts +20 -20
  81. package/dist/types/excalidraw/components/Actions.d.ts +0 -4
  82. package/dist/types/excalidraw/components/App.d.ts +14 -16
  83. package/dist/types/excalidraw/components/Ellipsify.d.ts +4 -0
  84. package/dist/types/excalidraw/components/Stats/DragInput.d.ts +11 -1
  85. package/dist/types/excalidraw/components/shapes.d.ts +1 -1
  86. package/dist/types/excalidraw/data/blob.d.ts +1 -1
  87. package/dist/types/excalidraw/data/reconcile.d.ts +1 -0
  88. package/dist/types/excalidraw/eraser/index.d.ts +0 -2
  89. package/dist/types/excalidraw/history.d.ts +21 -5
  90. package/dist/types/excalidraw/index.d.ts +1 -0
  91. package/dist/types/excalidraw/lasso/utils.d.ts +2 -1
  92. package/dist/types/excalidraw/renderer/helpers.d.ts +3 -3
  93. package/dist/types/excalidraw/renderer/staticScene.d.ts +4 -1
  94. package/dist/types/excalidraw/scene/Renderer.d.ts +0 -1
  95. package/dist/types/excalidraw/types.d.ts +6 -8
  96. package/dist/types/math/src/constants.d.ts +3 -0
  97. package/dist/types/math/src/curve.d.ts +32 -0
  98. package/dist/types/math/src/index.d.ts +1 -0
  99. package/dist/types/math/src/rectangle.d.ts +2 -0
  100. package/dist/types/math/src/vector.d.ts +4 -2
  101. package/history.ts +108 -45
  102. package/package.json +12 -9
  103. package/dist/dev/chunk-LL55DS44.js +0 -23677
  104. package/dist/dev/chunk-LL55DS44.js.map +0 -7
  105. package/dist/prod/chunk-F44EGBV2.js +0 -33
  106. package/dist/prod/data/image-CUOH64HE.js +0 -1
  107. package/dist/types/element/src/Shape.d.ts +0 -17
  108. package/dist/types/element/src/ShapeCache.d.ts +0 -25
  109. package/dist/types/element/src/shapes.d.ts +0 -27
  110. package/dist/types/excalidraw/visualdebug.d.ts +0 -41
  111. package/dist/types/utils/src/collision.d.ts +0 -8
  112. /package/dist/dev/data/{image-OFYK7EOY.js.map → image-T2LJEHDP.js.map} +0 -0
  113. /package/dist/dev/locales/{en-KIY5SGI3.js.map → en-SMAPCEOQ.js.map} +0 -0
@@ -1 +0,0 @@
1
- import{th as a,uh as b,vh as c}from"../chunk-F44EGBV2.js";import"../chunk-UH6Q3EIV.js";import"../chunk-SRAX5OIU.js";export{c as decodePngMetadata,b as encodePngMetadata,a as getTEXtChunk};
@@ -1,17 +0,0 @@
1
- import type { EmbedsValidationStatus } from "@excalidraw/excalidraw/types";
2
- import type { ExcalidrawElement, NonDeletedExcalidrawElement, ExcalidrawSelectionElement } from "./types";
3
- import type { Drawable, Options } from "roughjs/bin/core";
4
- import type { RoughGenerator } from "roughjs/bin/generator";
5
- export declare const generateRoughOptions: (element: ExcalidrawElement, continuousPath?: boolean) => Options;
6
- /**
7
- * Generates the roughjs shape for given element.
8
- *
9
- * Low-level. Use `ShapeCache.generateElementShape` instead.
10
- *
11
- * @private
12
- */
13
- export declare const _generateElementShape: (element: Exclude<NonDeletedExcalidrawElement, ExcalidrawSelectionElement>, generator: RoughGenerator, { isExporting, canvasBackgroundColor, embedsValidationStatus, }: {
14
- isExporting: boolean;
15
- canvasBackgroundColor: string;
16
- embedsValidationStatus: EmbedsValidationStatus | null;
17
- }) => Drawable | Drawable[] | null;
@@ -1,25 +0,0 @@
1
- import type { AppState, EmbedsValidationStatus } from "@excalidraw/excalidraw/types";
2
- import type { ElementShape, ElementShapes } from "@excalidraw/excalidraw/scene/types";
3
- import type { ExcalidrawElement } from "./types";
4
- import type { Drawable } from "roughjs/bin/core";
5
- export declare class ShapeCache {
6
- private static rg;
7
- private static cache;
8
- /**
9
- * Retrieves shape from cache if available. Use this only if shape
10
- * is optional and you have a fallback in case it's not cached.
11
- */
12
- static get: <T extends ExcalidrawElement>(element: T) => T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] | undefined : ElementShape | undefined;
13
- static set: <T extends ExcalidrawElement>(element: T, shape: T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] : Drawable) => WeakMap<ExcalidrawElement, ElementShape>;
14
- static delete: (element: ExcalidrawElement) => boolean;
15
- static destroy: () => void;
16
- /**
17
- * Generates & caches shape for element if not already cached, otherwise
18
- * returns cached shape.
19
- */
20
- static generateElementShape: <T extends import("./types").ExcalidrawRectangleElement | import("./types").ExcalidrawDiamondElement | import("./types").ExcalidrawEllipseElement | import("./types").ExcalidrawTextElement | import("./types").ExcalidrawLinearElement | import("./types").ExcalidrawArrowElement | import("./types").ExcalidrawFreeDrawElement | import("./types").ExcalidrawImageElement | import("./types").ExcalidrawFrameElement | import("./types").ExcalidrawMagicFrameElement | import("./types").ExcalidrawIframeElement | import("./types").ExcalidrawEmbeddableElement>(element: T, renderConfig: {
21
- isExporting: boolean;
22
- canvasBackgroundColor: AppState["viewBackgroundColor"];
23
- embedsValidationStatus: EmbedsValidationStatus;
24
- } | null) => ((T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] | undefined : ElementShape | undefined) & ({} | null)) | (T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] : Drawable | null);
25
- }
@@ -1,27 +0,0 @@
1
- import { type GlobalPoint, type LocalPoint } from "@excalidraw/math";
2
- import { type GeometricShape } from "@excalidraw/utils/shape";
3
- import type { Zoom } from "@excalidraw/excalidraw/types";
4
- import { type Bounds } from "./bounds";
5
- import type { ElementsMap, ExcalidrawElement, ExcalidrawLinearElement, ExcalidrawLineElement, NonDeleted } from "./types";
6
- /**
7
- * get the pure geometric shape of an excalidraw elementw
8
- * which is then used for hit detection
9
- */
10
- export declare const getElementShape: <Point extends GlobalPoint | LocalPoint>(element: ExcalidrawElement, elementsMap: ElementsMap) => GeometricShape<Point>;
11
- export declare const getBoundTextShape: <Point extends GlobalPoint | LocalPoint>(element: ExcalidrawElement, elementsMap: ElementsMap) => GeometricShape<Point> | null;
12
- export declare const getControlPointsForBezierCurve: <P extends GlobalPoint | LocalPoint>(element: NonDeleted<ExcalidrawLinearElement>, endPoint: P) => P[] | null;
13
- export declare const getBezierXY: <P extends GlobalPoint | LocalPoint>(p0: P, p1: P, p2: P, p3: P, t: number) => P;
14
- export declare const getBezierCurveLength: <P extends GlobalPoint | LocalPoint>(element: NonDeleted<ExcalidrawLinearElement>, endPoint: P) => number;
15
- export declare const mapIntervalToBezierT: <P extends GlobalPoint | LocalPoint>(element: NonDeleted<ExcalidrawLinearElement>, endPoint: P, interval: number) => number;
16
- /**
17
- * Get the axis-aligned bounding box for a given element
18
- */
19
- export declare const aabbForElement: (element: Readonly<ExcalidrawElement>, offset?: [number, number, number, number]) => Bounds;
20
- export declare const pointInsideBounds: <P extends GlobalPoint | LocalPoint>(p: P, bounds: Bounds) => boolean;
21
- export declare const aabbsOverlapping: (a: Bounds, b: Bounds) => boolean;
22
- export declare const getCornerRadius: (x: number, element: ExcalidrawElement) => number;
23
- export declare const isPathALoop: (points: ExcalidrawLinearElement["points"], zoomValue?: Zoom["value"]) => boolean;
24
- export declare const toggleLinePolygonState: (element: ExcalidrawLineElement, nextPolygonState: boolean) => {
25
- polygon: ExcalidrawLineElement["polygon"];
26
- points: ExcalidrawLineElement["points"];
27
- } | null;
@@ -1,41 +0,0 @@
1
- import { type GlobalPoint, type LocalPoint } from "@excalidraw/math";
2
- import type { Curve } from "@excalidraw/math";
3
- import type { LineSegment } from "@excalidraw/utils";
4
- import type { Bounds } from "@excalidraw/element";
5
- declare global {
6
- interface Window {
7
- visualDebug?: {
8
- data: DebugElement[][];
9
- currentFrame?: number;
10
- };
11
- }
12
- }
13
- export type DebugElement = {
14
- color: string;
15
- data: LineSegment<GlobalPoint> | Curve<GlobalPoint>;
16
- permanent: boolean;
17
- };
18
- export declare const debugDrawCubicBezier: (c: Curve<GlobalPoint>, opts?: {
19
- color?: string;
20
- permanent?: boolean;
21
- }) => void;
22
- export declare const debugDrawLine: (segment: LineSegment<GlobalPoint> | LineSegment<GlobalPoint>[], opts?: {
23
- color?: string;
24
- permanent?: boolean;
25
- }) => void;
26
- export declare const debugDrawPoint: (p: GlobalPoint, opts?: {
27
- color?: string;
28
- permanent?: boolean;
29
- fuzzy?: boolean;
30
- }) => void;
31
- export declare const debugDrawBounds: (box: Bounds | Bounds[], opts?: {
32
- color?: string;
33
- permanent?: boolean;
34
- }) => void;
35
- export declare const debugDrawPoints: ({ x, y, points, }: {
36
- x: number;
37
- y: number;
38
- points: LocalPoint[];
39
- }, options?: any) => void;
40
- export declare const debugCloseFrame: () => void;
41
- export declare const debugClear: () => void;
@@ -1,8 +0,0 @@
1
- import { type GlobalPoint, type LocalPoint, type Polygon } from "@excalidraw/math";
2
- import type { Curve } from "@excalidraw/math";
3
- import type { Polyline, GeometricShape } from "./shape";
4
- export declare const isPointOnShape: <Point extends GlobalPoint | LocalPoint>(point: Point, shape: GeometricShape<Point>, tolerance?: number) => boolean;
5
- export declare const isPointInShape: <Point extends GlobalPoint | LocalPoint>(point: Point, shape: GeometricShape<Point>) => boolean;
6
- export declare const isPointInBounds: <Point extends GlobalPoint | LocalPoint>(point: Point, bounds: Polygon<Point>) => boolean;
7
- export declare const pointOnCurve: <Point extends GlobalPoint | LocalPoint>(point: Point, curve: Curve<Point>, threshold: number) => boolean;
8
- export declare const pointOnPolyline: <Point extends GlobalPoint | LocalPoint>(point: Point, polyline: Polyline<Point>, threshold?: number) => boolean;