@excalidraw/math 0.18.0-dda3affcb-8fc71066d → 0.18.0-de715913e

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.
@@ -32,13 +32,13 @@ export declare class Delta<T> {
32
32
  /**
33
33
  * Merges two deltas into a new one.
34
34
  */
35
- static merge<T>(delta1: Delta<T>, delta2: Delta<T>): Delta<T>;
35
+ static merge<T>(delta1: Delta<T>, delta2: Delta<T>, delta3?: Delta<T>): Delta<T>;
36
36
  /**
37
37
  * Merges deleted and inserted object partials.
38
38
  */
39
39
  static mergeObjects<T extends {
40
40
  [key: string]: unknown;
41
- }>(prev: T, added: T, removed: T): T;
41
+ }>(prev: T, added: T, removed?: T): T;
42
42
  /**
43
43
  * Merges deleted and inserted array partials.
44
44
  */
@@ -146,7 +146,6 @@ export declare class AppStateDelta implements DeltaContainer<AppState> {
146
146
  type ElementPartial<TElement extends ExcalidrawElement = ExcalidrawElement> = Omit<Partial<Ordered<TElement>>, "id" | "updated" | "seed">;
147
147
  export type ApplyToOptions = {
148
148
  excludedProperties?: Set<keyof ElementPartial>;
149
- skipRedraw?: true;
150
149
  };
151
150
  /**
152
151
  * Elements change is a low level primitive to capture a change between two sets of elements.
@@ -170,6 +170,10 @@ export declare class StoreDelta {
170
170
  * Parse and load the delta from the remote payload.
171
171
  */
172
172
  static load({ id, elements: { added, removed, updated }, appState: { delta: appStateDelta }, }: DTO<StoreDelta>): StoreDelta;
173
+ /**
174
+ * Squash the passed delta into the current instance.
175
+ */
176
+ squash(delta: StoreDelta): this;
173
177
  /**
174
178
  * Inverse store delta, creates new instance of `StoreDelta`.
175
179
  */
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { type EXPORT_IMAGE_TYPES, Emitter } from "@excalidraw/common";
3
- import { LinearElementEditor, FlowChartCreator, Scene, Store, type ElementUpdate, StoreDelta } from "@excalidraw/element";
3
+ import { LinearElementEditor, FlowChartCreator, Scene, Store, type ElementUpdate, StoreDelta, type ApplyToOptions } from "@excalidraw/element";
4
4
  import type { ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement, ExcalidrawFrameLikeElement, ExcalidrawIframeElement, ExcalidrawEmbeddableElement, Ordered, OrderedExcalidrawElement, SceneElementsMap } from "@excalidraw/element/types";
5
5
  import type { Mutable } from "@excalidraw/common/utility-types";
6
6
  import { ActionManager } from "../actions/manager";
@@ -14,7 +14,7 @@ import { LassoTrail } from "../lasso";
14
14
  import { EraserTrail } from "../eraser";
15
15
  import type { ExportedElements } from "../data";
16
16
  import type { FileSystemHandle } from "../data/filesystem";
17
- import type { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, Device, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType, OnUserFollowedPayload, GenerateDiagramToCode, NullableGridSize, Offsets, ApplyDeltasOptions } from "../types";
17
+ import type { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, Device, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType, OnUserFollowedPayload, GenerateDiagramToCode, NullableGridSize, Offsets } from "../types";
18
18
  import type { RoughCanvas } from "roughjs/bin/canvas";
19
19
  import type { ActionResult } from "../actions/types";
20
20
  export declare const ExcalidrawContainerContext: React.Context<{
@@ -397,7 +397,7 @@ declare class App extends React.Component<AppProps, AppState> {
397
397
  */
398
398
  captureUpdate?: SceneData["captureUpdate"];
399
399
  }) => void;
400
- applyDeltas: (deltas: StoreDelta[], options?: ApplyDeltasOptions) => [SceneElementsMap, AppState, boolean];
400
+ applyDeltas: (deltas: StoreDelta[], options?: ApplyToOptions) => [SceneElementsMap, AppState, boolean];
401
401
  mutateElement: <TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, informMutation?: boolean) => TElement;
402
402
  private triggerRender;
403
403
  /**
@@ -1,5 +1,5 @@
1
1
  import type { IMAGE_MIME_TYPES, UserIdleState, throttleRAF, MIME_TYPES } from "@excalidraw/common";
2
- import type { ApplyToOptions, SuggestedBinding } from "@excalidraw/element";
2
+ import type { SuggestedBinding } from "@excalidraw/element";
3
3
  import type { LinearElementEditor } from "@excalidraw/element";
4
4
  import type { MaybeTransformHandleType } from "@excalidraw/element";
5
5
  import type { PointerType, ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, TextAlign, ExcalidrawElement, GroupId, ExcalidrawBindableElement, Arrowhead, ChartType, FontFamilyValues, FileId, Theme, StrokeRoundness, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeLikeElement, OrderedExcalidrawElement, ExcalidrawNonSelectionElement } from "@excalidraw/element/types";
@@ -478,7 +478,6 @@ export type SceneData = {
478
478
  collaborators?: Map<SocketId, Collaborator>;
479
479
  captureUpdate?: CaptureUpdateActionType;
480
480
  };
481
- export type ApplyDeltasOptions = Omit<ApplyToOptions, "skipRedraw">;
482
481
  export type ExportOpts = {
483
482
  saveFileToDisk?: boolean;
484
483
  onExportToBackend?: (exportedElements: readonly NonDeletedExcalidrawElement[], appState: UIAppState, files: BinaryFiles) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@excalidraw/math",
3
- "version": "0.18.0-dda3affcb-8fc71066d",
3
+ "version": "0.18.0-de715913e",
4
4
  "type": "module",
5
5
  "types": "./dist/types/math/src/index.d.ts",
6
6
  "main": "./dist/prod/index.js",
@@ -61,6 +61,6 @@
61
61
  "build:esm": "rimraf dist && node ../../scripts/buildBase.js && yarn gen:types"
62
62
  },
63
63
  "dependencies": {
64
- "@excalidraw/common": "0.18.0-dda3affcb-8fc71066d"
64
+ "@excalidraw/common": "0.18.0-de715913e"
65
65
  }
66
66
  }