diff --git a/excalidraw-app/App.tsx b/excalidraw-app/App.tsx index 1bb1cb48d5..18a44766d6 100644 --- a/excalidraw-app/App.tsx +++ b/excalidraw-app/App.tsx @@ -109,7 +109,7 @@ import Trans from "../packages/excalidraw/components/Trans"; import { ShareDialog, shareDialogStateAtom } from "./share/ShareDialog"; import CollabError, { collabErrorIndicatorAtom } from "./collab/CollabError"; import type { RemoteExcalidrawElement } from "../packages/excalidraw/data/reconcile"; -import type { StoreIncrementEvent } from "../packages/excalidraw/store"; +import type { StoreIncrement } from "../packages/excalidraw/store"; import { CommandPalette, DEFAULT_CATEGORIES, @@ -689,13 +689,14 @@ const ExcalidrawWrapper = () => { } }; - const onIncrement = (increment: StoreIncrementEvent) => { + const onIncrement = (increment: StoreIncrement) => { // ephemerals are not part of this (which is alright) // - wysiwyg, dragging elements / points, mouse movements, etc. const { elementsChange } = increment; // some appState like selections should also be transfered (we could even persist it) if (!elementsChange.isEmpty()) { + console.log(elementsChange) syncAPI?.push("durable", [elementsChange]); } }; diff --git a/excalidraw-app/tests/collab.test.tsx b/excalidraw-app/tests/collab.test.tsx index 4a712f784a..be33995482 100644 --- a/excalidraw-app/tests/collab.test.tsx +++ b/excalidraw-app/tests/collab.test.tsx @@ -125,7 +125,7 @@ describe("collaboration", () => { expect(h.elements).toEqual([expect.objectContaining(rect1Props)]); }); - const undoAction = createUndoAction(h.history, h.store); + const undoAction = createUndoAction(h.history); act(() => h.app.actionManager.executeAction(undoAction)); // with explicit undo (as addition) we expect our item to be restored from the snapshot! @@ -157,7 +157,7 @@ describe("collaboration", () => { expect(h.elements).toEqual([expect.objectContaining(rect1Props)]); }); - const redoAction = createRedoAction(h.history, h.store); + const redoAction = createRedoAction(h.history); act(() => h.app.actionManager.executeAction(redoAction)); // with explicit redo (as removal) we again restore the element from the snapshot! diff --git a/packages/excalidraw/actions/actionHistory.tsx b/packages/excalidraw/actions/actionHistory.tsx index eb52381cea..b62869904b 100644 --- a/packages/excalidraw/actions/actionHistory.tsx +++ b/packages/excalidraw/actions/actionHistory.tsx @@ -46,9 +46,9 @@ const executeHistoryAction = ( return { storeAction: StoreAction.NONE }; }; -type ActionCreator = (history: History, store: Store) => Action; +type ActionCreator = (history: History) => Action; -export const createUndoAction: ActionCreator = (history, store) => ({ +export const createUndoAction: ActionCreator = (history) => ({ name: "undo", label: "buttons.undo", icon: UndoIcon, @@ -56,11 +56,7 @@ export const createUndoAction: ActionCreator = (history, store) => ({ viewMode: false, perform: (elements, appState, value, app) => executeHistoryAction(app, appState, () => - history.undo( - arrayToMap(elements) as SceneElementsMap, // TODO: #7348 refactor action manager to already include `SceneElementsMap` - appState, - store.snapshot, - ), + history.undo(arrayToMap(elements) as SceneElementsMap, appState), ), keyTest: (event) => event[KEYS.CTRL_OR_CMD] && matchKey(event, KEYS.Z) && !event.shiftKey, @@ -87,19 +83,15 @@ export const createUndoAction: ActionCreator = (history, store) => ({ }, }); -export const createRedoAction: ActionCreator = (history, store) => ({ +export const createRedoAction: ActionCreator = (history) => ({ name: "redo", label: "buttons.redo", icon: RedoIcon, trackEvent: { category: "history" }, viewMode: false, - perform: (elements, appState, _, app) => + perform: (elements, appState, __, app) => executeHistoryAction(app, appState, () => - history.redo( - arrayToMap(elements) as SceneElementsMap, // TODO: #7348 refactor action manager to already include `SceneElementsMap` - appState, - store.snapshot, - ), + history.redo(arrayToMap(elements) as SceneElementsMap, appState), ), keyTest: (event) => (event[KEYS.CTRL_OR_CMD] && event.shiftKey && matchKey(event, KEYS.Z)) || diff --git a/packages/excalidraw/change.ts b/packages/excalidraw/change.ts index 2ab3fd1ff3..871f62879b 100644 --- a/packages/excalidraw/change.ts +++ b/packages/excalidraw/change.ts @@ -370,6 +370,7 @@ class Delta { ); } + // TODO: order the keys based on the most common ones to change (i.e. x/y, width/height, isDeleted, etc.) for (const key of keys) { const object1Value = object1[key as keyof T]; const object2Value = object2[key as keyof T]; @@ -796,37 +797,41 @@ export class AppStateChange implements Change { } } -type ElementPartial = - ElementUpdate>; +type ElementPartial = Omit< + ElementUpdate>, + "seed" +>; + +type ElementsChangeOptions = { + id: string; + shouldRedistribute: boolean; +}; /** * Elements change is a low level primitive to capture a change between two sets of elements. * It does so by encapsulating forward and backward `Delta`s, allowing to time-travel in both directions. */ export class ElementsChange implements Change { - public readonly id: string; - private constructor( + public readonly id: string, private readonly added: Record>, private readonly removed: Record>, private readonly updated: Record>, - options: { changeId: string }, - ) { - this.id = options.changeId; - } + ) {} public static create( added: Record>, removed: Record>, updated: Record>, - options: { changeId: string; shouldRedistribute: boolean } = { - changeId: randomId(), + options: ElementsChangeOptions = { + id: randomId(), shouldRedistribute: false, }, ) { + const { id, shouldRedistribute } = options; let change: ElementsChange; - if (options.shouldRedistribute) { + if (shouldRedistribute) { const nextAdded: Record> = {}; const nextRemoved: Record> = {}; const nextUpdated: Record> = {}; @@ -847,13 +852,9 @@ export class ElementsChange implements Change { } } - change = new ElementsChange(nextAdded, nextRemoved, nextUpdated, { - changeId: options.changeId, - }); + change = new ElementsChange(id, nextAdded, nextRemoved, nextUpdated); } else { - change = new ElementsChange(added, removed, updated, { - changeId: options.changeId, - }); + change = new ElementsChange(id, added, removed, updated); } if (import.meta.env.DEV || import.meta.env.MODE === ENV.TEST) { @@ -1000,7 +1001,7 @@ export class ElementsChange implements Change { const { id, added, removed, updated } = JSON.parse(payload); return ElementsChange.create(added, removed, updated, { - changeId: id, + id, shouldRedistribute: false, }); } @@ -1021,6 +1022,7 @@ export class ElementsChange implements Change { const updated = inverseInternal(this.updated); // notice we inverse removed with added not to break the invariants + // notice we force generate a new id return ElementsChange.create(removed, added, updated); } @@ -1089,7 +1091,7 @@ export class ElementsChange implements Change { const updated = applyLatestChangesInternal(this.updated); return ElementsChange.create(added, removed, updated, { - changeId: this.id, + id: this.id, shouldRedistribute: true, // redistribute the deltas as `isDeleted` could have been updated }); } @@ -1232,7 +1234,7 @@ export class ElementsChange implements Change { } } else if (type === "added") { // for additions the element does not have to exist (i.e. remote update) - // TODO: the version itself might be different! + // CFDO: the version itself might be different! element = newElementWith( { id, version: 1 } as OrderedExcalidrawElement, { @@ -1602,7 +1604,8 @@ export class ElementsChange implements Change { private static stripIrrelevantProps( partial: Partial, ): ElementPartial { - const { id, updated, version, versionNonce, ...strippedPartial } = partial; + const { id, updated, version, versionNonce, seed, ...strippedPartial } = + partial; return strippedPartial; } diff --git a/packages/excalidraw/cloudflare/changes.ts b/packages/excalidraw/cloudflare/changes.ts index 83b1fd9f8e..eb9dfdbe16 100644 --- a/packages/excalidraw/cloudflare/changes.ts +++ b/packages/excalidraw/cloudflare/changes.ts @@ -4,7 +4,7 @@ import type { SERVER_CHANGE, } from "../sync/protocol"; -// TODO: add senderId, possibly roomId as well +// CFDO: add senderId, possibly roomId as well export class DurableChangesRepository implements ChangesRepository { constructor(private storage: DurableObjectStorage) { // #region DEV ONLY @@ -24,7 +24,7 @@ export class DurableChangesRepository implements ChangesRepository { const prevVersion = this.getLastVersion(); const nextVersion = prevVersion + changes.length; - // TODO: in theory payload could contain array of changes, if we would need to optimize writes + // CFDO: in theory payload could contain array of changes, if we would need to optimize writes for (const [index, change] of changes.entries()) { const version = prevVersion + index + 1; // unique id ensures that we don't acknowledge the same change twice diff --git a/packages/excalidraw/cloudflare/room.ts b/packages/excalidraw/cloudflare/room.ts index 3ed20ca000..30b0a88f06 100644 --- a/packages/excalidraw/cloudflare/room.ts +++ b/packages/excalidraw/cloudflare/room.ts @@ -21,11 +21,11 @@ export class DurableRoom extends DurableObject { super(ctx, env); this.ctx.blockConcurrencyWhile(async () => { - // TODO: snapshot should likely be a transient store - // TODO: loaded the latest state from the db + // CFDO: snapshot should likely be a transient store + // CFDO: loaded the latest state from the db this.snapshot = { - // TODO: start persisting acknowledged version (not a scene version!) - // TODO: we don't persist appState, should we? + // CFDO: start persisting acknowledged version (not a scene version!) + // CFDO: we don't persist appState, should we? appState: {}, elements: new Map(), version: 0, diff --git a/packages/excalidraw/cloudflare/worker.ts b/packages/excalidraw/cloudflare/worker.ts index 3adbe32768..6da9acf5b5 100644 --- a/packages/excalidraw/cloudflare/worker.ts +++ b/packages/excalidraw/cloudflare/worker.ts @@ -4,13 +4,12 @@ export { DurableRoom } from "./room"; * Worker relay for Durable Room. */ export default { - // TODO: ensure it's wss in the prod async fetch( request: Request, env: Env, ctx: ExecutionContext, ): Promise { - // TODO: only auth user should reach this + // CFDO: only auth user should reach this const upgrade = request.headers.get("upgrade"); if (!upgrade || upgrade !== "websocket") { return new Response(null, { status: 426 /* upgrade required */ }); @@ -25,7 +24,7 @@ export default { return new Response(null, { status: 403 /* forbidden */ }); } - // TODO: double check that the scene exists + // CFDO: double check that the scene exists const roomId = url.searchParams.get("roomId"); if (!roomId) { return new Response(null, { status: 400 /* bad request */ }); diff --git a/packages/excalidraw/components/App.tsx b/packages/excalidraw/components/App.tsx index 248e99eaa7..157e313225 100644 --- a/packages/excalidraw/components/App.tsx +++ b/packages/excalidraw/components/App.tsx @@ -710,7 +710,7 @@ class App extends React.Component { this.visibleElements = []; this.store = new Store(); - this.history = new History(); + this.history = new History(this.store); if (excalidrawAPI) { const api: ExcalidrawImperativeAPI = { @@ -759,15 +759,11 @@ class App extends React.Component { }; this.fonts = new Fonts(this.scene); - this.history = new History(); + this.history = new History(this.store); this.actionManager.registerAll(actions); - this.actionManager.registerAction( - createUndoAction(this.history, this.store), - ); - this.actionManager.registerAction( - createRedoAction(this.history, this.store), - ); + this.actionManager.registerAction(createUndoAction(this.history)); + this.actionManager.registerAction(createRedoAction(this.history)); } private onWindowMessage(event: MessageEvent) { @@ -1821,6 +1817,10 @@ class App extends React.Component { return this.scene.getElementsIncludingDeleted(); }; + public getSceneElementsMapIncludingDeleted = () => { + return this.scene.getElementsMapIncludingDeleted(); + } + public getSceneElements = () => { return this.scene.getNonDeletedElements(); }; @@ -2463,7 +2463,7 @@ class App extends React.Component { } this.store.onStoreIncrementEmitter.on((increment) => { - this.history.record(increment.elementsChange, increment.appStateChange); + this.history.record(increment); this.props.onIncrement?.(increment); }); diff --git a/packages/excalidraw/history.ts b/packages/excalidraw/history.ts index daed2a3940..0c6966230c 100644 --- a/packages/excalidraw/history.ts +++ b/packages/excalidraw/history.ts @@ -1,9 +1,12 @@ -import type { AppStateChange, ElementsChange } from "./change"; -import type { SceneElementsMap } from "./element/types"; import { Emitter } from "./emitter"; -import type { Snapshot } from "./store"; +import type { SceneElementsMap } from "./element/types"; +import type { Store, StoreIncrement } from "./store"; import type { AppState } from "./types"; +type HistoryEntry = StoreIncrement & { + skipRecording?: true; +}; + type HistoryStack = HistoryEntry[]; export class HistoryChangedEvent { @@ -18,8 +21,8 @@ export class History { [HistoryChangedEvent] >(); - private readonly undoStack: HistoryStack = []; - private readonly redoStack: HistoryStack = []; + public readonly undoStack: HistoryStack = []; + public readonly redoStack: HistoryStack = []; public get isUndoStackEmpty() { return this.undoStack.length === 0; @@ -29,6 +32,8 @@ export class History { return this.redoStack.length === 0; } + constructor(private readonly store: Store) {} + public clear() { this.undoStack.length = 0; this.redoStack.length = 0; @@ -37,13 +42,8 @@ export class History { /** * Record a local change which will go into the history */ - public record( - elementsChange: ElementsChange, - appStateChange: AppStateChange, - ) { - const entry = HistoryEntry.create(appStateChange, elementsChange); - - if (!entry.isEmpty()) { + public record(entry: HistoryEntry) { + if (!entry.skipRecording && !entry.isEmpty()) { // we have the latest changes, no need to `applyLatest`, which is done within `History.push` this.undoStack.push(entry.inverse()); @@ -60,29 +60,19 @@ export class History { } } - public undo( - elements: SceneElementsMap, - appState: AppState, - snapshot: Readonly, - ) { + public undo(elements: SceneElementsMap, appState: AppState) { return this.perform( elements, appState, - snapshot, () => History.pop(this.undoStack), (entry: HistoryEntry) => History.push(this.redoStack, entry, elements), ); } - public redo( - elements: SceneElementsMap, - appState: AppState, - snapshot: Readonly, - ) { + public redo(elements: SceneElementsMap, appState: AppState) { return this.perform( elements, appState, - snapshot, () => History.pop(this.redoStack), (entry: HistoryEntry) => History.push(this.undoStack, entry, elements), ); @@ -91,7 +81,6 @@ export class History { private perform( elements: SceneElementsMap, appState: AppState, - snapshot: Readonly, pop: () => HistoryEntry | null, push: (entry: HistoryEntry) => void, ): [SceneElementsMap, AppState] | void { @@ -109,10 +98,17 @@ export class History { // iterate through the history entries in case they result in no visible changes while (historyEntry) { try { + // skip re-recording the history entry, as it gets emitted and is manually pushed to the undo / redo stack + Object.assign(historyEntry, { skipRecording: true }); + // CFDO: consider encapsulating element & appState update inside applyIncrement [nextElements, nextAppState, containsVisibleChange] = - historyEntry.applyTo(nextElements, nextAppState, snapshot); + this.store.applyIncrementTo( + historyEntry, + nextElements, + nextAppState, + ); } finally { - // make sure to always push / pop, even if the increment is corrupted + // make sure to always push, even if the increment is corrupted push(historyEntry); } @@ -123,6 +119,10 @@ export class History { historyEntry = pop(); } + if (nextElements === null || nextAppState === null) { + return; + } + return [nextElements, nextAppState]; } finally { // trigger the history change event before returning completely @@ -156,55 +156,3 @@ export class History { return stack.push(updatedEntry); } } - -export class HistoryEntry { - private constructor( - public readonly appStateChange: AppStateChange, - public readonly elementsChange: ElementsChange, - ) {} - - public static create( - appStateChange: AppStateChange, - elementsChange: ElementsChange, - ) { - return new HistoryEntry(appStateChange, elementsChange); - } - - public inverse(): HistoryEntry { - return new HistoryEntry( - this.appStateChange.inverse(), - this.elementsChange.inverse(), - ); - } - - public applyTo( - elements: SceneElementsMap, - appState: AppState, - snapshot: Readonly, - ): [SceneElementsMap, AppState, boolean] { - const [nextElements, elementsContainVisibleChange] = - this.elementsChange.applyTo(elements, snapshot.elements); - - const [nextAppState, appStateContainsVisibleChange] = - this.appStateChange.applyTo(appState, nextElements); - - const appliedVisibleChanges = - elementsContainVisibleChange || appStateContainsVisibleChange; - - return [nextElements, nextAppState, appliedVisibleChanges]; - } - - /** - * Apply latest (remote) changes to the history entry, creates new instance of `HistoryEntry`. - */ - public applyLatestChanges(elements: SceneElementsMap): HistoryEntry { - const updatedElementsChange = - this.elementsChange.applyLatestChanges(elements); - - return HistoryEntry.create(this.appStateChange, updatedElementsChange); - } - - public isEmpty(): boolean { - return this.appStateChange.isEmpty() && this.elementsChange.isEmpty(); - } -} diff --git a/packages/excalidraw/package.json b/packages/excalidraw/package.json index b22d647654..7087667189 100644 --- a/packages/excalidraw/package.json +++ b/packages/excalidraw/package.json @@ -62,7 +62,7 @@ "@excalidraw/random-username": "1.1.0", "@radix-ui/react-popover": "1.0.3", "@radix-ui/react-tabs": "1.0.2", - "@types/async-lock": "1.4.2", + "@types/async-lock": "^1.4.2", "async-lock": "^1.4.1", "browser-fs-access": "0.29.1", "canvas-roundrect-polyfill": "0.0.1", diff --git a/packages/excalidraw/store.ts b/packages/excalidraw/store.ts index 67c1ee743f..e65aaf993e 100644 --- a/packages/excalidraw/store.ts +++ b/packages/excalidraw/store.ts @@ -3,7 +3,10 @@ import { AppStateChange, ElementsChange } from "./change"; import { ENV } from "./constants"; import { newElementWith } from "./element/mutateElement"; import { deepCopyElement } from "./element/newElement"; -import type { OrderedExcalidrawElement } from "./element/types"; +import type { + OrderedExcalidrawElement, + SceneElementsMap, +} from "./element/types"; import { Emitter } from "./emitter"; import type { AppState, ObservedAppState } from "./types"; import type { ValueOf } from "./utility-types"; @@ -73,82 +76,33 @@ export const StoreAction = { export type StoreActionType = ValueOf; /** - * Represent an increment to the Store. + * Store which captures the observed changes and emits them as `StoreIncrement` events. */ -export class StoreIncrementEvent { - constructor( - public readonly elementsChange: ElementsChange, - public readonly appStateChange: AppStateChange, - ) {} -} - -/** - * Store which captures the observed changes and emits them as `StoreIncrementEvent` events. - * - * @experimental this interface is experimental and subject to change. - */ -export interface IStore { - onStoreIncrementEmitter: Emitter<[StoreIncrementEvent]>; - get snapshot(): Snapshot; - set snapshot(snapshot: Snapshot); - - /** - * Use to schedule update of the snapshot, useful on updates for which we don't need to calculate increments (i.e. remote updates). - */ - shouldUpdateSnapshot(): void; - - /** - * Use to schedule calculation of a store increment. - */ - shouldCaptureIncrement(): void; - - /** - * Based on the scheduled operation, either only updates store snapshot or also calculates increment and emits the result as a `StoreIncrementEvent`. - * - * @emits StoreIncrementEvent when increment is calculated. - */ - commit( - elements: Map | undefined, - appState: AppState | ObservedAppState | undefined, - ): void; - - /** - * Clears the store instance. - */ - clear(): void; - - /** - * Filters out yet uncomitted elements from `nextElements`, which are part of in-progress local async actions (ephemerals) and thus were not yet commited to the snapshot. - * - * This is necessary in updates in which we receive reconciled elements, already containing elements which were not yet captured by the local store (i.e. collab). - */ - filterUncomittedElements( - prevElements: Map, - nextElements: Map, - ): Map; -} - -export class Store implements IStore { - public readonly onStoreIncrementEmitter = new Emitter< - [StoreIncrementEvent] - >(); +export class Store { + public readonly onStoreIncrementEmitter = new Emitter<[StoreIncrement]>(); private scheduledActions: Set = new Set(); - private _snapshot = Snapshot.empty(); + private _snapshot = StoreSnapshot.empty(); public get snapshot() { return this._snapshot; } - public set snapshot(snapshot: Snapshot) { + public set snapshot(snapshot: StoreSnapshot) { this._snapshot = snapshot; } + /** + * Use to schedule calculation of a store increment. + */ // TODO: Suspicious that this is called so many places. Seems error-prone. public shouldCaptureIncrement = () => { this.scheduleAction(StoreAction.CAPTURE); }; + /** + * Use to schedule update of the snapshot, useful on updates for which we don't need to calculate increments (i.e. remote updates). + */ public shouldUpdateSnapshot = () => { this.scheduleAction(StoreAction.UPDATE); }; @@ -158,6 +112,11 @@ export class Store implements IStore { this.satisfiesScheduledActionsInvariant(); }; + /** + * Based on the scheduled operation, either only updates store snapshot or also calculates increment and emits the result as a `StoreIncrement`. + * + * @emits StoreIncrement when increment is calculated. + */ public commit = ( elements: Map | undefined, appState: AppState | ObservedAppState | undefined, @@ -176,6 +135,11 @@ export class Store implements IStore { } }; + /** + * Performs diff calculation, calculates and emits the increment. + * + * @emits StoreIncrement when increment is calculated. + */ public captureIncrement = ( elements: Map | undefined, appState: AppState | ObservedAppState | undefined, @@ -186,18 +150,18 @@ export class Store implements IStore { // Optimisation, don't continue if nothing has changed if (prevSnapshot !== nextSnapshot) { // Calculate and record the changes based on the previous and next snapshot - const elementsChange = nextSnapshot.meta.didElementsChange + const elementsChange = nextSnapshot.metadata.didElementsChange ? ElementsChange.calculate(prevSnapshot.elements, nextSnapshot.elements) : ElementsChange.empty(); - const appStateChange = nextSnapshot.meta.didAppStateChange + const appStateChange = nextSnapshot.metadata.didAppStateChange ? AppStateChange.calculate(prevSnapshot.appState, nextSnapshot.appState) : AppStateChange.empty(); if (!elementsChange.isEmpty() || !appStateChange.isEmpty()) { // Notify listeners with the increment this.onStoreIncrementEmitter.trigger( - new StoreIncrementEvent(elementsChange, appStateChange), + new StoreIncrement(elementsChange, appStateChange), ); } @@ -206,6 +170,9 @@ export class Store implements IStore { } }; + /** + * Updates the snapshot without performing any diff calculation. + */ public updateSnapshot = ( elements: Map | undefined, appState: AppState | ObservedAppState | undefined, @@ -218,6 +185,11 @@ export class Store implements IStore { } }; + /** + * Filters out yet uncomitted elements from `nextElements`, which are part of in-progress local async actions (ephemerals) and thus were not yet commited to the snapshot. + * + * This is necessary in updates in which we receive reconciled elements, already containing elements which were not yet captured by the local store (i.e. collab). + */ public filterUncomittedElements = ( prevElements: Map, nextElements: Map, @@ -245,8 +217,35 @@ export class Store implements IStore { return nextElements; }; + /** + * Apply and emit increment. + * + * @emits StoreIncrement when increment is applied. + */ + public applyIncrementTo = ( + increment: StoreIncrement, + elements: SceneElementsMap, + appState: AppState, + ): [SceneElementsMap, AppState, boolean] => { + const [nextElements, elementsContainVisibleChange] = + increment.elementsChange.applyTo(elements, this.snapshot.elements); + + const [nextAppState, appStateContainsVisibleChange] = + increment.appStateChange.applyTo(appState, nextElements); + + const appliedVisibleChanges = + elementsContainVisibleChange || appStateContainsVisibleChange; + + this.onStoreIncrementEmitter.trigger(increment); + + return [nextElements, nextAppState, appliedVisibleChanges]; + }; + + /** + * Clears the store instance. + */ public clear = (): void => { - this.snapshot = Snapshot.empty(); + this.snapshot = StoreSnapshot.empty(); this.scheduledActions = new Set(); }; @@ -262,11 +261,42 @@ export class Store implements IStore { }; } -export class Snapshot { +/** + * Represent an increment to the Store. + */ +export class StoreIncrement { + constructor( + public readonly elementsChange: ElementsChange, + public readonly appStateChange: AppStateChange, + ) {} + + public inverse(): StoreIncrement { + return new StoreIncrement( + this.elementsChange.inverse(), + this.appStateChange.inverse(), + ); + } + + /** + * Apply latest (remote) changes to the increment, creates new instance of `StoreIncrement`. + */ + public applyLatestChanges(elements: SceneElementsMap): StoreIncrement { + const updatedElementsChange = + this.elementsChange.applyLatestChanges(elements); + + return new StoreIncrement(updatedElementsChange, this.appStateChange); + } + + public isEmpty() { + return this.elementsChange.isEmpty() && this.appStateChange.isEmpty(); + } +} + +export class StoreSnapshot { private constructor( public readonly elements: Map, public readonly appState: ObservedAppState, - public readonly meta: { + public readonly metadata: { didElementsChange: boolean; didAppStateChange: boolean; isEmpty?: boolean; @@ -278,7 +308,7 @@ export class Snapshot { ) {} public static empty() { - return new Snapshot( + return new StoreSnapshot( new Map(), getObservedAppState(getDefaultAppState() as AppState), { didElementsChange: false, didAppStateChange: false, isEmpty: true }, @@ -286,7 +316,7 @@ export class Snapshot { } public isEmpty() { - return this.meta.isEmpty; + return this.metadata.isEmpty; } /** @@ -316,10 +346,14 @@ export class Snapshot { return this; } - const snapshot = new Snapshot(nextElementsSnapshot, nextAppStateSnapshot, { - didElementsChange, - didAppStateChange, - }); + const snapshot = new StoreSnapshot( + nextElementsSnapshot, + nextAppStateSnapshot, + { + didElementsChange, + didAppStateChange, + }, + ); return snapshot; } diff --git a/packages/excalidraw/sync/client.ts b/packages/excalidraw/sync/client.ts index a54599d18f..a933b86718 100644 --- a/packages/excalidraw/sync/client.ts +++ b/packages/excalidraw/sync/client.ts @@ -7,7 +7,6 @@ import type { CLIENT_CHANGE, PUSH_PAYLOAD, SERVER_CHANGE } from "./protocol"; import throttle from "lodash.throttle"; export class ExcalidrawSyncClient { - // TODO: add prod url private static readonly HOST_URL = import.meta.env.DEV ? "ws://localhost:8787" : "https://excalidraw-sync.marcel-529.workers.dev"; @@ -46,11 +45,11 @@ export class ExcalidrawSyncClient { this.api = api; this.roomId = roomId; - // TODO: persist in idb + // CFDO: persist in idb this.lastAcknowledgedVersion = 0; } - // TODO: throttle does not work that well here (after some period it tries to reconnect too often) + // CFDO: throttle does not work that well here (after some period it tries to reconnect too often) public reconnect = throttle( async () => { try { @@ -164,7 +163,7 @@ export class ExcalidrawSyncClient { ); }; - // TODO: could be an array buffer + // CFDO: could be an array buffer private onMessage = (event: MessageEvent) => { const [result, error] = Utils.try(() => JSON.parse(event.data as string)); @@ -202,7 +201,7 @@ export class ExcalidrawSyncClient { const payload: PUSH_PAYLOAD = { type, changes: [] }; if (type === "durable") { - // TODO: persist in idb (with insertion order) + // CFDO: persist in idb (with insertion order) for (const change of changes) { this.queuedChanges.set(change.id, { queuedAt: Date.now(), @@ -231,7 +230,7 @@ export class ExcalidrawSyncClient { }); } - // TODO: refactor by applying all operations to store, not to the elements + // CFDO: refactor by applying all operations to store, not to the elements private handleAcknowledged(payload: { changes: Array }) { const { changes: remoteChanges } = payload; @@ -254,7 +253,7 @@ export class ExcalidrawSyncClient { // local change acknowledge by the server, safe to remove this.queuedChanges.delete(remoteChange.id); } else { - // TODO: we might not need to be that strict here + // CFDO: we might not need to be that strict here if (this.lastAcknowledgedVersion + 1 !== remoteChange.version) { throw new Error( `Received out of order change, expected "${ @@ -282,7 +281,7 @@ export class ExcalidrawSyncClient { ); // apply local changes - // TODO: only necessary when remote changes modified same element properties! + // CFDO: only necessary when remote changes modified same element properties! for (const localChange of this.localChanges) { [elements] = localChange.applyTo( elements, diff --git a/packages/excalidraw/sync/protocol.ts b/packages/excalidraw/sync/protocol.ts index 48b3559d99..629c6a76e4 100644 --- a/packages/excalidraw/sync/protocol.ts +++ b/packages/excalidraw/sync/protocol.ts @@ -32,7 +32,7 @@ export interface ChangesRepository { getLastVersion(): number; } -// TODO: should come from the shared types package +// CFDO: should come from the shared types package export type ExcalidrawElement = { id: string; type: any; diff --git a/packages/excalidraw/sync/server.ts b/packages/excalidraw/sync/server.ts index 59dd6c0d5c..4887d728f2 100644 --- a/packages/excalidraw/sync/server.ts +++ b/packages/excalidraw/sync/server.ts @@ -11,7 +11,7 @@ import type { SERVER_MESSAGE, } from "./protocol"; -// TODO: message could be binary (cbor, protobuf, etc.) +// CFDO: message could be binary (cbor, protobuf, etc.) /** * Core excalidraw sync logic. @@ -48,7 +48,7 @@ export class ExcalidrawSyncServer { return this.pull(client, payload); case "push": // apply each one-by-one to avoid race conditions - // TODO: in theory we do not need to block ephemeral appState changes + // CFDO: in theory we do not need to block ephemeral appState changes return this.lock.acquire("push", () => this.push(client, payload)); default: console.error(`Unknown message type: ${type}`); @@ -56,7 +56,7 @@ export class ExcalidrawSyncServer { } private pull(client: WebSocket, payload: PULL_PAYLOAD) { - // TODO: test for invalid payload + // CFDO: test for invalid payload const lastAcknowledgedClientVersion = payload.lastAcknowledgedVersion; const lastAcknowledgedServerVersion = this.changesRepository.getLastVersion(); @@ -70,7 +70,7 @@ export class ExcalidrawSyncServer { } if (versionĪ” < 0) { - // TODO: restore the client from the snapshot / deltas? + // CFDO: restore the client from the snapshot / deltas? console.error( `Panic! Client claims to have higher acknowledged version than the latest one on the server!`, ); @@ -78,7 +78,7 @@ export class ExcalidrawSyncServer { } if (versionĪ” > 0) { - // TODO: for versioning we need deletions, but not for the "snapshot" update + // CFDO: for versioning we need deletions, but not for the "snapshot" update const changes = this.changesRepository.getSinceVersion( lastAcknowledgedClientVersion, ); @@ -99,7 +99,7 @@ export class ExcalidrawSyncServer { return this.relay(client, { changes }); case "durable": const [acknowledged, error] = Utils.try(() => { - // TODO: try to apply the changes to the snapshot + // CFDO: try to apply the changes to the snapshot return this.changesRepository.saveAll(changes); }); diff --git a/packages/excalidraw/tests/__snapshots__/history.test.tsx.snap b/packages/excalidraw/tests/__snapshots__/history.test.tsx.snap index 58bc9303e5..4332fa7769 100644 --- a/packages/excalidraw/tests/__snapshots__/history.test.tsx.snap +++ b/packages/excalidraw/tests/__snapshots__/history.test.tsx.snap @@ -78,14 +78,14 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id166": true, + "id914": true, }, "resizingElement": null, "scrollX": 0, "scrollY": 0, "searchMatches": [], "selectedElementIds": { - "id166": true, + "id914": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -123,7 +123,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 100, - "id": "id164", + "id": "id910", "index": "a0", "isDeleted": false, "link": null, @@ -155,7 +155,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 100, - "id": "id165", + "id": "id911", "index": "a1", "isDeleted": false, "link": null, @@ -186,7 +186,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "elbowed": false, "endArrowhead": "arrow", "endBinding": { - "elementId": "id169", + "elementId": "id927", "fixedPoint": [ "0.50000", 1, @@ -198,7 +198,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 99, - "id": "id166", + "id": "id914", "index": "a2", "isDeleted": false, "lastCommittedPoint": null, @@ -239,7 +239,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "backgroundColor": "transparent", "boundElements": [ { - "id": "id166", + "id": "id914", "type": "arrow", }, ], @@ -248,7 +248,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 50, - "id": "id169", + "id": "id927", "index": "a3", "isDeleted": false, "link": null, @@ -270,341 +270,340 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl } `; -exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind bindings when both are updated through the history and the arrow got bound to a different element in the meantime > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id166" => Delta { - "deleted": { - "endBinding": { - "elementId": "id165", - "fixedPoint": null, - "focus": "0.00990", - "gap": 1, - }, - "height": "0.98017", - "points": [ - [ - 0, - 0, - ], - [ - 98, - "-0.98017", - ], - ], - "startBinding": { - "elementId": "id164", - "fixedPoint": null, - "focus": "0.02970", - "gap": 1, - }, - }, - "inserted": { - "endBinding": { - "elementId": "id165", - "fixedPoint": null, - "focus": "-0.02000", - "gap": 1, - }, - "height": "0.00169", - "points": [ - [ - 0, - 0, - ], - [ - 98, - "0.00169", - ], - ], - "startBinding": { - "elementId": "id164", - "fixedPoint": null, - "focus": "0.02000", - "gap": 1, - }, - }, - }, - }, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id164" => Delta { - "deleted": { - "boundElements": [], - }, - "inserted": { - "boundElements": [ - { - "id": "id166", - "type": "arrow", - }, - ], - }, - }, - "id165" => Delta { - "deleted": { - "boundElements": [], - }, - "inserted": { - "boundElements": [ - { - "id": "id166", - "type": "arrow", - }, - ], - }, - }, - "id166" => Delta { - "deleted": { - "endBinding": { - "elementId": "id169", - "fixedPoint": [ - "0.50000", - 1, - ], - "focus": 0, - "gap": 1, - }, - "height": 99, - "points": [ - [ - 0, - 0, - ], - [ - "98.20800", - 99, - ], - ], - "startBinding": null, - "y": 0, - }, - "inserted": { - "endBinding": { - "elementId": "id165", - "fixedPoint": null, - "focus": "0.00990", - "gap": 1, - }, - "height": "0.98161", - "points": [ - [ - 0, - 0, - ], - [ - 98, - "-0.98161", - ], - ], - "startBinding": { - "elementId": "id164", - "fixedPoint": null, - "focus": "0.02970", - "gap": 1, - }, - "y": "0.99245", - }, - }, - "id169" => Delta { - "deleted": { - "boundElements": [ - { - "id": "id166", - "type": "arrow", - }, - ], - }, - "inserted": { - "boundElements": [], - }, - }, - }, - }, - }, - ], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id164" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": -100, - "y": -50, - }, - "inserted": { - "isDeleted": true, - }, - }, - "id165" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a1", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 100, - "y": -50, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id166": true, - }, - "selectedLinearElementId": "id166", - }, - "inserted": { - "selectedElementIds": {}, - "selectedLinearElementId": null, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id166" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "elbowed": false, - "endArrowhead": "arrow", - "endBinding": null, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 0, - "index": "a2", - "isDeleted": false, - "lastCommittedPoint": null, - "link": null, - "locked": false, - "opacity": 100, - "points": [ - [ - 0, - 0, - ], - [ - 100, - 0, - ], - ], - "roughness": 1, - "roundness": { - "type": 2, - }, - "startArrowhead": null, - "startBinding": null, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "arrow", - "width": 100, - "x": 0, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind bindings when both are updated through the history and the arrow got bound to a different element in the meantime > [end of test] number of elements 1`] = `4`; exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind bindings when both are updated through the history and the arrow got bound to a different element in the meantime > [end of test] number of renders 1`] = `21`; +exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind bindings when both are updated through the history and the arrow got bound to a different element in the meantime > [end of test] redo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id941", + "removed": {}, + "updated": { + "id914": Delta { + "deleted": { + "endBinding": { + "elementId": "id911", + "fixedPoint": null, + "focus": "0.00990", + "gap": 1, + }, + "height": "0.98017", + "points": [ + [ + 0, + 0, + ], + [ + 98, + "-0.98017", + ], + ], + "startBinding": { + "elementId": "id910", + "fixedPoint": null, + "focus": "0.02970", + "gap": 1, + }, + }, + "inserted": { + "endBinding": { + "elementId": "id911", + "fixedPoint": null, + "focus": "-0.02000", + "gap": 1, + }, + "height": "0.00169", + "points": [ + [ + 0, + 0, + ], + [ + 98, + "0.00169", + ], + ], + "startBinding": { + "elementId": "id910", + "fixedPoint": null, + "focus": "0.02000", + "gap": 1, + }, + }, + }, + }, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id943", + "removed": {}, + "updated": { + "id910": Delta { + "deleted": { + "boundElements": [], + }, + "inserted": { + "boundElements": [ + { + "id": "id914", + "type": "arrow", + }, + ], + }, + }, + "id911": Delta { + "deleted": { + "boundElements": [], + }, + "inserted": { + "boundElements": [ + { + "id": "id914", + "type": "arrow", + }, + ], + }, + }, + "id914": Delta { + "deleted": { + "endBinding": { + "elementId": "id927", + "fixedPoint": [ + "0.50000", + 1, + ], + "focus": 0, + "gap": 1, + }, + "height": 99, + "points": [ + [ + 0, + 0, + ], + [ + "98.20800", + 99, + ], + ], + "startBinding": null, + "y": 0, + }, + "inserted": { + "endBinding": { + "elementId": "id911", + "fixedPoint": null, + "focus": "0.00990", + "gap": 1, + }, + "height": "0.98161", + "points": [ + [ + 0, + 0, + ], + [ + 98, + "-0.98161", + ], + ], + "startBinding": { + "elementId": "id910", + "fixedPoint": null, + "focus": "0.02970", + "gap": 1, + }, + "y": "0.99245", + }, + }, + "id927": Delta { + "deleted": { + "boundElements": [ + { + "id": "id914", + "type": "arrow", + }, + ], + }, + "inserted": { + "boundElements": [], + }, + }, + }, + }, + }, +] +`; + +exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind bindings when both are updated through the history and the arrow got bound to a different element in the meantime > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id913", + "removed": { + "id910": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": -100, + "y": -50, + }, + "inserted": { + "isDeleted": true, + }, + }, + "id911": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a1", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 100, + "y": -50, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id914": true, + }, + "selectedLinearElementId": "id914", + }, + "inserted": { + "selectedElementIds": {}, + "selectedLinearElementId": null, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id916", + "removed": { + "id914": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "elbowed": false, + "endArrowhead": "arrow", + "endBinding": null, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 0, + "index": "a2", + "isDeleted": false, + "lastCommittedPoint": null, + "link": null, + "locked": false, + "opacity": 100, + "points": [ + [ + 0, + 0, + ], + [ + 100, + 0, + ], + ], + "roughness": 1, + "roundness": { + "type": 2, + }, + "startArrowhead": null, + "startBinding": null, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "arrow", + "width": 100, + "x": 0, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, +] +`; + exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind bindings when both are updated through the history and there are no conflicting updates in the meantime > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -683,14 +682,14 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id161": true, + "id881": true, }, "resizingElement": null, "scrollX": 0, "scrollY": 0, "searchMatches": [], "selectedElementIds": { - "id161": true, + "id881": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -728,7 +727,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 100, - "id": "id159", + "id": "id877", "index": "a0", "isDeleted": false, "link": null, @@ -760,7 +759,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 100, - "id": "id160", + "id": "id878", "index": "a1", "isDeleted": false, "link": null, @@ -795,7 +794,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 0, - "id": "id161", + "id": "id881", "index": "a2", "isDeleted": false, "lastCommittedPoint": null, @@ -830,290 +829,289 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl } `; -exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind bindings when both are updated through the history and there are no conflicting updates in the meantime > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id161" => Delta { - "deleted": { - "points": [ - [ - 0, - 0, - ], - [ - 0, - 0, - ], - ], - }, - "inserted": { - "points": [ - [ - 0, - 0, - ], - [ - 100, - 0, - ], - ], - }, - }, - }, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id159" => Delta { - "deleted": { - "boundElements": [], - }, - "inserted": { - "boundElements": [ - { - "id": "id161", - "type": "arrow", - }, - ], - }, - }, - "id160" => Delta { - "deleted": { - "boundElements": [], - }, - "inserted": { - "boundElements": [ - { - "id": "id161", - "type": "arrow", - }, - ], - }, - }, - "id161" => Delta { - "deleted": { - "endBinding": null, - "points": [ - [ - 0, - 0, - ], - [ - 100, - 0, - ], - ], - "startBinding": null, - }, - "inserted": { - "endBinding": { - "elementId": "id160", - "fixedPoint": null, - "focus": 0, - "gap": 1, - }, - "points": [ - [ - 0, - 0, - ], - [ - 0, - 0, - ], - ], - "startBinding": { - "elementId": "id159", - "fixedPoint": null, - "focus": 0, - "gap": 1, - }, - }, - }, - }, - }, - }, - ], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id159" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": -100, - "y": -50, - }, - "inserted": { - "isDeleted": true, - }, - }, - "id160" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a1", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 100, - "y": -50, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id161": true, - }, - "selectedLinearElementId": "id161", - }, - "inserted": { - "selectedElementIds": {}, - "selectedLinearElementId": null, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id161" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "elbowed": false, - "endArrowhead": "arrow", - "endBinding": null, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 0, - "index": "a2", - "isDeleted": false, - "lastCommittedPoint": null, - "link": null, - "locked": false, - "opacity": 100, - "points": [ - [ - 0, - 0, - ], - [ - 100, - 0, - ], - ], - "roughness": 1, - "roundness": { - "type": 2, - }, - "startArrowhead": null, - "startBinding": null, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "arrow", - "width": 100, - "x": 0, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind bindings when both are updated through the history and there are no conflicting updates in the meantime > [end of test] number of elements 1`] = `3`; exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind bindings when both are updated through the history and there are no conflicting updates in the meantime > [end of test] number of renders 1`] = `23`; +exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind bindings when both are updated through the history and there are no conflicting updates in the meantime > [end of test] redo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id907", + "removed": {}, + "updated": { + "id881": Delta { + "deleted": { + "points": [ + [ + 0, + 0, + ], + [ + 0, + 0, + ], + ], + }, + "inserted": { + "points": [ + [ + 0, + 0, + ], + [ + 100, + 0, + ], + ], + }, + }, + }, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id909", + "removed": {}, + "updated": { + "id877": Delta { + "deleted": { + "boundElements": [], + }, + "inserted": { + "boundElements": [ + { + "id": "id881", + "type": "arrow", + }, + ], + }, + }, + "id878": Delta { + "deleted": { + "boundElements": [], + }, + "inserted": { + "boundElements": [ + { + "id": "id881", + "type": "arrow", + }, + ], + }, + }, + "id881": Delta { + "deleted": { + "endBinding": null, + "points": [ + [ + 0, + 0, + ], + [ + 100, + 0, + ], + ], + "startBinding": null, + }, + "inserted": { + "endBinding": { + "elementId": "id878", + "fixedPoint": null, + "focus": 0, + "gap": 1, + }, + "points": [ + [ + 0, + 0, + ], + [ + 0, + 0, + ], + ], + "startBinding": { + "elementId": "id877", + "fixedPoint": null, + "focus": 0, + "gap": 1, + }, + }, + }, + }, + }, + }, +] +`; + +exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind bindings when both are updated through the history and there are no conflicting updates in the meantime > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id880", + "removed": { + "id877": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": -100, + "y": -50, + }, + "inserted": { + "isDeleted": true, + }, + }, + "id878": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a1", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 100, + "y": -50, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id881": true, + }, + "selectedLinearElementId": "id881", + }, + "inserted": { + "selectedElementIds": {}, + "selectedLinearElementId": null, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id883", + "removed": { + "id881": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "elbowed": false, + "endArrowhead": "arrow", + "endBinding": null, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 0, + "index": "a2", + "isDeleted": false, + "lastCommittedPoint": null, + "link": null, + "locked": false, + "opacity": 100, + "points": [ + [ + 0, + 0, + ], + [ + 100, + 0, + ], + ], + "roughness": 1, + "roundness": { + "type": 2, + }, + "startArrowhead": null, + "startBinding": null, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "arrow", + "width": 100, + "x": 0, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, +] +`; + exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind remotely added arrow when it's bindable elements are added through the history > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -1235,7 +1233,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "elbowed": false, "endArrowhead": null, "endBinding": { - "elementId": "id171", + "elementId": "id945", "fixedPoint": [ "0.50000", 1, @@ -1247,7 +1245,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": "2.61991", - "id": "id172", + "id": "id948", "index": "Zz", "isDeleted": false, "lastCommittedPoint": null, @@ -1270,7 +1268,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl }, "startArrowhead": null, "startBinding": { - "elementId": "id170", + "elementId": "id944", "fixedPoint": [ 1, "0.50000", @@ -1296,7 +1294,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "backgroundColor": "transparent", "boundElements": [ { - "id": "id172", + "id": "id948", "type": "arrow", }, ], @@ -1305,7 +1303,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 100, - "id": "id170", + "id": "id944", "index": "a0", "isDeleted": false, "link": null, @@ -1333,7 +1331,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "backgroundColor": "transparent", "boundElements": [ { - "id": "id172", + "id": "id948", "type": "arrow", }, ], @@ -1342,7 +1340,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 100, - "id": "id171", + "id": "id945", "index": "a1", "isDeleted": false, "link": null, @@ -1364,127 +1362,121 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl } `; -exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind remotely added arrow when it's bindable elements are added through the history > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, +exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind remotely added arrow when it's bindable elements are added through the history > [end of test] number of elements 1`] = `3`; + +exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind remotely added arrow when it's bindable elements are added through the history > [end of test] number of renders 1`] = `9`; + +exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind remotely added arrow when it's bindable elements are added through the history > [end of test] redo stack 1`] = `[]`; + +exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind remotely added arrow when it's bindable elements are added through the history > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id956", + "removed": { + "id944": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": -100, + "y": -50, + }, + "inserted": { + "isDeleted": true, + }, + }, + "id945": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a1", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 100, + "y": -50, + }, + "inserted": { + "isDeleted": true, + }, }, }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id170" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": -100, - "y": -50, + "updated": { + "id948": Delta { + "deleted": { + "endBinding": { + "elementId": "id945", + "fixedPoint": [ + "0.50000", + 1, + ], + "focus": 0, + "gap": 1, }, - "inserted": { - "isDeleted": true, + "startBinding": { + "elementId": "id944", + "fixedPoint": [ + 1, + "0.50000", + ], + "focus": 0, + "gap": 1, }, }, - "id171" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a1", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 100, - "y": -50, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map { - "id172" => Delta { - "deleted": { - "endBinding": { - "elementId": "id171", - "fixedPoint": [ - "0.50000", - 1, - ], - "focus": 0, - "gap": 1, - }, - "startBinding": { - "elementId": "id170", - "fixedPoint": [ - 1, - "0.50000", - ], - "focus": 0, - "gap": 1, - }, - }, - "inserted": { - "endBinding": null, - "startBinding": null, - }, + "inserted": { + "endBinding": null, + "startBinding": null, }, }, }, }, - ], -} + }, +] `; -exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind remotely added arrow when it's bindable elements are added through the history > [end of test] number of elements 1`] = `3`; - -exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind remotely added arrow when it's bindable elements are added through the history > [end of test] number of renders 1`] = `9`; - exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind remotely added bindable elements when it's arrow is added through the history > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -1606,7 +1598,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "elbowed": false, "endArrowhead": null, "endBinding": { - "elementId": "id174", + "elementId": "id958", "fixedPoint": [ 1, "0.50000", @@ -1618,7 +1610,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": "2.61991", - "id": "id175", + "id": "id963", "index": "a0", "isDeleted": false, "lastCommittedPoint": null, @@ -1641,7 +1633,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl }, "startArrowhead": null, "startBinding": { - "elementId": "id173", + "elementId": "id957", "fixedPoint": [ "0.50000", 1, @@ -1667,7 +1659,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "backgroundColor": "transparent", "boundElements": [ { - "id": "id175", + "id": "id963", "type": "arrow", }, ], @@ -1676,7 +1668,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 100, - "id": "id173", + "id": "id957", "index": "a0V", "isDeleted": false, "link": null, @@ -1704,7 +1696,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "backgroundColor": "transparent", "boundElements": [ { - "id": "id175", + "id": "id963", "type": "arrow", }, ], @@ -1713,7 +1705,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 100, - "id": "id174", + "id": "id958", "index": "a1", "isDeleted": false, "link": null, @@ -1735,128 +1727,122 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl } `; -exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind remotely added bindable elements when it's arrow is added through the history > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, +exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind remotely added bindable elements when it's arrow is added through the history > [end of test] number of elements 1`] = `3`; + +exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind remotely added bindable elements when it's arrow is added through the history > [end of test] number of renders 1`] = `11`; + +exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind remotely added bindable elements when it's arrow is added through the history > [end of test] redo stack 1`] = `[]`; + +exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind remotely added bindable elements when it's arrow is added through the history > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id973", + "removed": { + "id963": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "elbowed": false, + "endArrowhead": null, + "endBinding": { + "elementId": "id958", + "fixedPoint": [ + 1, + "0.50000", + ], + "focus": 0, + "gap": 1, + }, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": "22.36242", + "index": "a0", + "isDeleted": false, + "lastCommittedPoint": null, + "link": null, + "locked": false, + "opacity": 100, + "points": [ + [ + 0, + 0, + ], + [ + "98.00000", + "-22.36242", + ], + ], + "roughness": 1, + "roundness": { + "type": 2, + }, + "startArrowhead": null, + "startBinding": { + "elementId": "id957", + "fixedPoint": [ + "0.50000", + 1, + ], + "focus": 0, + "gap": 1, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "arrow", + "width": "98.00000", + "x": 1, + "y": 34, + }, + "inserted": { + "isDeleted": true, + }, }, }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id175" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "elbowed": false, - "endArrowhead": null, - "endBinding": { - "elementId": "id174", - "fixedPoint": [ - 1, - "0.50000", - ], - "focus": 0, - "gap": 1, + "updated": { + "id957": Delta { + "deleted": { + "boundElements": [ + { + "id": "id963", + "type": "arrow", }, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": "22.36242", - "index": "a0", - "isDeleted": false, - "lastCommittedPoint": null, - "link": null, - "locked": false, - "opacity": 100, - "points": [ - [ - 0, - 0, - ], - [ - "98.00000", - "-22.36242", - ], - ], - "roughness": 1, - "roundness": { - "type": 2, - }, - "startArrowhead": null, - "startBinding": { - "elementId": "id173", - "fixedPoint": [ - "0.50000", - 1, - ], - "focus": 0, - "gap": 1, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "arrow", - "width": "98.00000", - "x": 1, - "y": 34, - }, - "inserted": { - "isDeleted": true, - }, + ], + }, + "inserted": { + "boundElements": [], }, }, - "updated": Map { - "id173" => Delta { - "deleted": { - "boundElements": [ - { - "id": "id175", - "type": "arrow", - }, - ], - }, - "inserted": { - "boundElements": [], - }, + "id958": Delta { + "deleted": { + "boundElements": [ + { + "id": "id963", + "type": "arrow", + }, + ], }, - "id174" => Delta { - "deleted": { - "boundElements": [ - { - "id": "id175", - "type": "arrow", - }, - ], - }, - "inserted": { - "boundElements": [], - }, + "inserted": { + "boundElements": [], }, }, }, }, - ], -} + }, +] `; -exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind remotely added bindable elements when it's arrow is added through the history > [end of test] number of elements 1`] = `3`; - -exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind remotely added bindable elements when it's arrow is added through the history > [end of test] number of renders 1`] = `11`; - exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should unbind remotely deleted bindable elements from arrow when the arrow is added through the history > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -1979,7 +1965,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 100, - "id": "id176", + "id": "id974", "index": "a0", "isDeleted": false, "link": null, @@ -2011,7 +1997,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 100, - "id": "id177", + "id": "id975", "index": "a1", "isDeleted": false, "link": null, @@ -2033,100 +2019,94 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl } `; -exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should unbind remotely deleted bindable elements from arrow when the arrow is added through the history > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id176" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": -100, - "y": -50, - }, - "inserted": { - "isDeleted": true, - }, - }, - "id177" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a1", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 100, - "y": -50, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should unbind remotely deleted bindable elements from arrow when the arrow is added through the history > [end of test] number of elements 1`] = `2`; exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should unbind remotely deleted bindable elements from arrow when the arrow is added through the history > [end of test] number of renders 1`] = `4`; +exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should unbind remotely deleted bindable elements from arrow when the arrow is added through the history > [end of test] redo stack 1`] = `[]`; + +exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should unbind remotely deleted bindable elements from arrow when the arrow is added through the history > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id977", + "removed": { + "id974": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": -100, + "y": -50, + }, + "inserted": { + "isDeleted": true, + }, + }, + "id975": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a1", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 100, + "y": -50, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, +] +`; + exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should update bound element points when rectangle was remotely moved and arrow is added back through the history > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -2210,7 +2190,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "scrollY": 0, "searchMatches": [], "selectedElementIds": { - "id180": true, + "id982": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -2244,7 +2224,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "backgroundColor": "transparent", "boundElements": [ { - "id": "id180", + "id": "id982", "type": "arrow", }, ], @@ -2253,7 +2233,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 100, - "id": "id178", + "id": "id978", "index": "a0", "isDeleted": false, "link": null, @@ -2281,7 +2261,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "backgroundColor": "transparent", "boundElements": [ { - "id": "id180", + "id": "id982", "type": "arrow", }, ], @@ -2290,7 +2270,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 100, - "id": "id179", + "id": "id979", "index": "a1", "isDeleted": false, "link": null, @@ -2321,7 +2301,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "elbowed": false, "endArrowhead": "arrow", "endBinding": { - "elementId": "id179", + "elementId": "id979", "fixedPoint": null, "focus": 0, "gap": 1, @@ -2330,7 +2310,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": "408.19672", - "id": "id180", + "id": "id982", "index": "a2", "isDeleted": false, "lastCommittedPoint": null, @@ -2353,7 +2333,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl }, "startArrowhead": null, "startBinding": { - "elementId": "id178", + "elementId": "id978", "fixedPoint": null, "focus": 0, "gap": 1, @@ -2370,206 +2350,201 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl } `; -exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should update bound element points when rectangle was remotely moved and arrow is added back through the history > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id178" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": -100, - "y": -50, - }, - "inserted": { - "isDeleted": true, - }, - }, - "id179" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a1", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 100, - "y": -50, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id180": true, - }, - "selectedLinearElementId": "id180", - }, - "inserted": { - "selectedElementIds": {}, - "selectedLinearElementId": null, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id180" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "elbowed": false, - "endArrowhead": "arrow", - "endBinding": { - "elementId": "id179", - "fixedPoint": null, - "focus": 0, - "gap": 1, - }, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 0, - "index": "a2", - "isDeleted": false, - "lastCommittedPoint": null, - "link": null, - "locked": false, - "opacity": 100, - "points": [ - [ - 0, - 0, - ], - [ - 100, - 0, - ], - ], - "roughness": 1, - "roundness": { - "type": 2, - }, - "startArrowhead": null, - "startBinding": { - "elementId": "id178", - "fixedPoint": null, - "focus": 0, - "gap": 1, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "arrow", - "width": 100, - "x": 0, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map { - "id178" => Delta { - "deleted": { - "boundElements": [ - { - "id": "id180", - "type": "arrow", - }, - ], - }, - "inserted": { - "boundElements": [], - }, - }, - "id179" => Delta { - "deleted": { - "boundElements": [ - { - "id": "id180", - "type": "arrow", - }, - ], - }, - "inserted": { - "boundElements": [], - }, - }, - }, - }, - }, - ], -} -`; - exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should update bound element points when rectangle was remotely moved and arrow is added back through the history > [end of test] number of elements 1`] = `3`; exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should update bound element points when rectangle was remotely moved and arrow is added back through the history > [end of test] number of renders 1`] = `9`; +exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should update bound element points when rectangle was remotely moved and arrow is added back through the history > [end of test] redo stack 1`] = `[]`; + +exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should update bound element points when rectangle was remotely moved and arrow is added back through the history > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id981", + "removed": { + "id978": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": -100, + "y": -50, + }, + "inserted": { + "isDeleted": true, + }, + }, + "id979": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a1", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 100, + "y": -50, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id982": true, + }, + "selectedLinearElementId": "id982", + }, + "inserted": { + "selectedElementIds": {}, + "selectedLinearElementId": null, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id988", + "removed": { + "id982": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "elbowed": false, + "endArrowhead": "arrow", + "endBinding": { + "elementId": "id979", + "fixedPoint": null, + "focus": 0, + "gap": 1, + }, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 0, + "index": "a2", + "isDeleted": false, + "lastCommittedPoint": null, + "link": null, + "locked": false, + "opacity": 100, + "points": [ + [ + 0, + 0, + ], + [ + 100, + 0, + ], + ], + "roughness": 1, + "roundness": { + "type": 2, + }, + "startArrowhead": null, + "startBinding": { + "elementId": "id978", + "fixedPoint": null, + "focus": 0, + "gap": 1, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "arrow", + "width": 100, + "x": 0, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": { + "id978": Delta { + "deleted": { + "boundElements": [ + { + "id": "id982", + "type": "arrow", + }, + ], + }, + "inserted": { + "boundElements": [], + }, + }, + "id979": Delta { + "deleted": { + "boundElements": [ + { + "id": "id982", + "type": "arrow", + }, + ], + }, + "inserted": { + "boundElements": [], + }, + }, + }, + }, + }, +] +`; + exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should preserve latest remotely added binding and unbind previous one when the container is added through the history > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -2688,7 +2663,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "backgroundColor": "transparent", "boundElements": [ { - "id": "id147", + "id": "id807", "type": "text", }, ], @@ -2697,7 +2672,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id145", + "id": "id801", "index": "a0", "isDeleted": false, "link": null, @@ -2733,7 +2708,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id146", + "id": "id802", "index": "a1", "isDeleted": false, "lineHeight": "1.25000", @@ -2766,7 +2741,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id145", + "containerId": "id801", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -2774,7 +2749,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 25, - "id": "id147", + "id": "id807", "index": "a2", "isDeleted": false, "lineHeight": "1.25000", @@ -2801,76 +2776,70 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and } `; -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should preserve latest remotely added binding and unbind previous one when the container is added through the history > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should preserve latest remotely added binding and unbind previous one when the container is added through the history > [end of test] number of elements 1`] = `3`; + +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should preserve latest remotely added binding and unbind previous one when the container is added through the history > [end of test] number of renders 1`] = `11`; + +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should preserve latest remotely added binding and unbind previous one when the container is added through the history > [end of test] redo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id145" => Delta { - "deleted": { - "isDeleted": false, - }, - "inserted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 10, - "y": 10, - }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id815", + "removed": {}, + "updated": { + "id801": Delta { + "deleted": { + "isDeleted": false, }, - "id146" => Delta { - "deleted": { - "containerId": null, - }, - "inserted": { - "containerId": null, + "inserted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 10, + "y": 10, + }, + }, + "id802": Delta { + "deleted": { + "containerId": null, + }, + "inserted": { + "containerId": null, }, }, }, }, - ], - "undoStack": [], -} + }, +] `; -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should preserve latest remotely added binding and unbind previous one when the container is added through the history > [end of test] number of elements 1`] = `3`; - -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should preserve latest remotely added binding and unbind previous one when the container is added through the history > [end of test] number of renders 1`] = `11`; +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should preserve latest remotely added binding and unbind previous one when the container is added through the history > [end of test] undo stack 1`] = `[]`; exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should preserve latest remotely added binding and unbind previous one when the text is added through history > [end of test] appState 1`] = ` { @@ -2990,7 +2959,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "backgroundColor": "transparent", "boundElements": [ { - "id": "id150", + "id": "id822", "type": "text", }, ], @@ -2999,7 +2968,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id148", + "id": "id816", "index": "Zz", "isDeleted": false, "link": null, @@ -3027,7 +2996,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id148", + "containerId": "id816", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -3035,7 +3004,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id149", + "id": "id817", "index": "a0", "isDeleted": true, "lineHeight": "1.25000", @@ -3068,7 +3037,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id148", + "containerId": "id816", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -3076,7 +3045,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 25, - "id": "id150", + "id": "id822", "index": "a1", "isDeleted": false, "lineHeight": "1.25000", @@ -3103,61 +3072,55 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and } `; -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should preserve latest remotely added binding and unbind previous one when the text is added through history > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should preserve latest remotely added binding and unbind previous one when the text is added through history > [end of test] number of elements 1`] = `3`; + +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should preserve latest remotely added binding and unbind previous one when the text is added through history > [end of test] number of renders 1`] = `11`; + +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should preserve latest remotely added binding and unbind previous one when the text is added through history > [end of test] redo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, }, - "elementsChange": ElementsChange { - "added": Map { - "id149" => Delta { - "deleted": { - "containerId": "id148", - "isDeleted": true, - }, - "inserted": { - "containerId": null, - "isDeleted": false, - }, + }, + "elementsChange": ElementsChange { + "added": { + "id817": Delta { + "deleted": { + "containerId": "id816", + "isDeleted": true, + }, + "inserted": { + "containerId": null, + "isDeleted": false, }, }, - "removed": Map {}, - "updated": Map { - "id148" => Delta { - "deleted": { - "boundElements": [], - }, - "inserted": { - "boundElements": [ - { - "id": "id149", - "type": "text", - }, - ], - }, + }, + "id": "id830", + "removed": {}, + "updated": { + "id816": Delta { + "deleted": { + "boundElements": [], + }, + "inserted": { + "boundElements": [ + { + "id": "id817", + "type": "text", + }, + ], }, }, }, }, - ], - "undoStack": [], -} + }, +] `; -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should preserve latest remotely added binding and unbind previous one when the text is added through history > [end of test] number of elements 1`] = `3`; - -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should preserve latest remotely added binding and unbind previous one when the text is added through history > [end of test] number of renders 1`] = `11`; +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should preserve latest remotely added binding and unbind previous one when the text is added through history > [end of test] undo stack 1`] = `[]`; exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and the container got bound to a different text in the meantime > [end of test] appState 1`] = ` { @@ -3277,7 +3240,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "backgroundColor": "transparent", "boundElements": [ { - "id": "id137", + "id": "id753", "type": "text", }, ], @@ -3286,7 +3249,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id135", + "id": "id747", "index": "a0", "isDeleted": false, "link": null, @@ -3314,7 +3277,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id135", + "containerId": "id747", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -3322,7 +3285,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 25, - "id": "id137", + "id": "id753", "index": "a0V", "isDeleted": false, "lineHeight": "1.25000", @@ -3363,7 +3326,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 25, - "id": "id136", + "id": "id748", "index": "a1", "isDeleted": false, "lineHeight": "1.25000", @@ -3390,71 +3353,65 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and } `; -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and the container got bound to a different text in the meantime > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and the container got bound to a different text in the meantime > [end of test] number of elements 1`] = `3`; + +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and the container got bound to a different text in the meantime > [end of test] number of renders 1`] = `11`; + +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and the container got bound to a different text in the meantime > [end of test] redo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id135" => Delta { - "deleted": { - "boundElements": [ - { - "id": "id137", - "type": "text", - }, - ], - }, - "inserted": { - "boundElements": [ - { - "id": "id136", - "type": "text", - }, - ], - }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id761", + "removed": {}, + "updated": { + "id747": Delta { + "deleted": { + "boundElements": [ + { + "id": "id753", + "type": "text", + }, + ], }, - "id136" => Delta { - "deleted": { - "containerId": null, - }, - "inserted": { - "containerId": "id135", - }, + "inserted": { + "boundElements": [ + { + "id": "id748", + "type": "text", + }, + ], }, - "id137" => Delta { - "deleted": { - "containerId": "id135", - }, - "inserted": { - "containerId": null, - }, + }, + "id748": Delta { + "deleted": { + "containerId": null, + }, + "inserted": { + "containerId": "id747", + }, + }, + "id753": Delta { + "deleted": { + "containerId": "id747", + }, + "inserted": { + "containerId": null, }, }, }, }, - ], - "undoStack": [], -} + }, +] `; -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and the container got bound to a different text in the meantime > [end of test] number of elements 1`] = `3`; - -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and the container got bound to a different text in the meantime > [end of test] number of renders 1`] = `11`; +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and the container got bound to a different text in the meantime > [end of test] undo stack 1`] = `[]`; exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and the text got bound to a different container in the meantime > [end of test] appState 1`] = ` { @@ -3578,7 +3535,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id138", + "id": "id762", "index": "a0", "isDeleted": false, "link": null, @@ -3606,7 +3563,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "backgroundColor": "transparent", "boundElements": [ { - "id": "id139", + "id": "id763", "type": "text", }, ], @@ -3615,7 +3572,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 60, - "id": "id140", + "id": "id768", "index": "a0V", "isDeleted": false, "link": null, @@ -3643,7 +3600,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id140", + "containerId": "id768", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -3651,7 +3608,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 50, - "id": "id139", + "id": "id763", "index": "a1", "isDeleted": false, "lineHeight": "1.25000", @@ -3679,71 +3636,65 @@ pasa", } `; -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and the text got bound to a different container in the meantime > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and the text got bound to a different container in the meantime > [end of test] number of elements 1`] = `3`; + +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and the text got bound to a different container in the meantime > [end of test] number of renders 1`] = `11`; + +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and the text got bound to a different container in the meantime > [end of test] redo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id138" => Delta { - "deleted": { - "boundElements": [], - }, - "inserted": { - "boundElements": [ - { - "id": "id139", - "type": "text", - }, - ], - }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id776", + "removed": {}, + "updated": { + "id762": Delta { + "deleted": { + "boundElements": [], }, - "id139" => Delta { - "deleted": { - "containerId": "id140", - }, - "inserted": { - "containerId": "id138", - }, + "inserted": { + "boundElements": [ + { + "id": "id763", + "type": "text", + }, + ], }, - "id140" => Delta { - "deleted": { - "boundElements": [ - { - "id": "id139", - "type": "text", - }, - ], - }, - "inserted": { - "boundElements": [], - }, + }, + "id763": Delta { + "deleted": { + "containerId": "id768", + }, + "inserted": { + "containerId": "id762", + }, + }, + "id768": Delta { + "deleted": { + "boundElements": [ + { + "id": "id763", + "type": "text", + }, + ], + }, + "inserted": { + "boundElements": [], }, }, }, }, - ], - "undoStack": [], -} + }, +] `; -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and the text got bound to a different container in the meantime > [end of test] number of elements 1`] = `3`; - -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and the text got bound to a different container in the meantime > [end of test] number of renders 1`] = `11`; +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and the text got bound to a different container in the meantime > [end of test] undo stack 1`] = `[]`; exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and there no conflicting updates in the meantime > [end of test] appState 1`] = ` { @@ -3867,7 +3818,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id133", + "id": "id733", "index": "a0", "isDeleted": false, "link": null, @@ -3903,7 +3854,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 25, - "id": "id134", + "id": "id734", "index": "a1", "isDeleted": false, "lineHeight": "1.25000", @@ -3930,58 +3881,52 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and } `; -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and there no conflicting updates in the meantime > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and there no conflicting updates in the meantime > [end of test] number of elements 1`] = `2`; + +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and there no conflicting updates in the meantime > [end of test] number of renders 1`] = `11`; + +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and there no conflicting updates in the meantime > [end of test] redo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id133" => Delta { - "deleted": { - "boundElements": [], - }, - "inserted": { - "boundElements": [ - { - "id": "id134", - "type": "text", - }, - ], - }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id746", + "removed": {}, + "updated": { + "id733": Delta { + "deleted": { + "boundElements": [], }, - "id134" => Delta { - "deleted": { - "containerId": null, - }, - "inserted": { - "containerId": "id133", - }, + "inserted": { + "boundElements": [ + { + "id": "id734", + "type": "text", + }, + ], + }, + }, + "id734": Delta { + "deleted": { + "containerId": null, + }, + "inserted": { + "containerId": "id733", }, }, }, }, - ], - "undoStack": [], -} + }, +] `; -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and there no conflicting updates in the meantime > [end of test] number of elements 1`] = `2`; - -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and there no conflicting updates in the meantime > [end of test] number of renders 1`] = `11`; +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and there no conflicting updates in the meantime > [end of test] undo stack 1`] = `[]`; exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind remotely added bound text when it's container is added through the history > [end of test] appState 1`] = ` { @@ -4101,7 +4046,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "backgroundColor": "transparent", "boundElements": [ { - "id": "id142", + "id": "id778", "type": "text", }, ], @@ -4110,7 +4055,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id141", + "id": "id777", "index": "a0", "isDeleted": false, "link": null, @@ -4138,7 +4083,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id141", + "containerId": "id777", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -4146,7 +4091,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 25, - "id": "id142", + "id": "id778", "index": "a1", "isDeleted": false, "lineHeight": "1.25000", @@ -4173,78 +4118,72 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and } `; -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind remotely added bound text when it's container is added through the history > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind remotely added bound text when it's container is added through the history > [end of test] number of elements 1`] = `2`; + +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind remotely added bound text when it's container is added through the history > [end of test] number of renders 1`] = `9`; + +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind remotely added bound text when it's container is added through the history > [end of test] redo stack 1`] = `[]`; + +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind remotely added bound text when it's container is added through the history > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id141" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 10, - "y": 10, - }, - "inserted": { - "isDeleted": true, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id788", + "removed": { + "id777": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 10, + "y": 10, + }, + "inserted": { + "isDeleted": true, }, }, - "updated": Map { - "id142" => Delta { - "deleted": { - "containerId": "id141", - }, - "inserted": { - "containerId": null, - }, + }, + "updated": { + "id778": Delta { + "deleted": { + "containerId": "id777", + }, + "inserted": { + "containerId": null, }, }, }, }, - ], -} + }, +] `; -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind remotely added bound text when it's container is added through the history > [end of test] number of elements 1`] = `2`; - -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind remotely added bound text when it's container is added through the history > [end of test] number of renders 1`] = `9`; - exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind remotely added container when it's bound text is added through the history > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -4363,7 +4302,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "backgroundColor": "transparent", "boundElements": [ { - "id": "id144", + "id": "id790", "type": "text", }, ], @@ -4372,7 +4311,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id143", + "id": "id789", "index": "Zz", "isDeleted": false, "link": null, @@ -4400,7 +4339,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id143", + "containerId": "id789", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -4408,7 +4347,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 25, - "id": "id144", + "id": "id790", "index": "a0", "isDeleted": false, "lineHeight": "1.25000", @@ -4435,92 +4374,86 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and } `; -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind remotely added container when it's bound text is added through the history > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind remotely added container when it's bound text is added through the history > [end of test] number of elements 1`] = `2`; + +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind remotely added container when it's bound text is added through the history > [end of test] number of renders 1`] = `9`; + +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind remotely added container when it's bound text is added through the history > [end of test] redo stack 1`] = `[]`; + +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind remotely added container when it's bound text is added through the history > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id144" => Delta { - "deleted": { - "angle": 0, - "autoResize": true, - "backgroundColor": "transparent", - "boundElements": null, - "containerId": "id143", - "customData": undefined, - "fillStyle": "solid", - "fontFamily": 5, - "fontSize": 20, - "frameId": null, - "groupIds": [], - "height": 25, - "index": "a0", - "isDeleted": false, - "lineHeight": "1.25000", - "link": null, - "locked": false, - "opacity": 100, - "originalText": "que pasa", - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "text": "que pasa", - "textAlign": "left", - "type": "text", - "verticalAlign": "top", - "width": 80, - "x": 15, - "y": 15, - }, - "inserted": { - "isDeleted": true, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id800", + "removed": { + "id790": Delta { + "deleted": { + "angle": 0, + "autoResize": true, + "backgroundColor": "transparent", + "boundElements": null, + "containerId": "id789", + "customData": undefined, + "fillStyle": "solid", + "fontFamily": 5, + "fontSize": 20, + "frameId": null, + "groupIds": [], + "height": 25, + "index": "a0", + "isDeleted": false, + "lineHeight": "1.25000", + "link": null, + "locked": false, + "opacity": 100, + "originalText": "que pasa", + "roughness": 1, + "roundness": { + "type": 3, }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "text": "que pasa", + "textAlign": "left", + "type": "text", + "verticalAlign": "top", + "width": 80, + "x": 15, + "y": 15, + }, + "inserted": { + "isDeleted": true, }, }, - "updated": Map { - "id143" => Delta { - "deleted": { - "boundElements": [ - { - "id": "id144", - "type": "text", - }, - ], - }, - "inserted": { - "boundElements": [], - }, + }, + "updated": { + "id789": Delta { + "deleted": { + "boundElements": [ + { + "id": "id790", + "type": "text", + }, + ], + }, + "inserted": { + "boundElements": [], }, }, }, }, - ], -} + }, +] `; -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind remotely added container when it's bound text is added through the history > [end of test] number of elements 1`] = `2`; - -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind remotely added container when it's bound text is added through the history > [end of test] number of renders 1`] = `9`; - exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should redraw bound text to match container dimensions when the bound text is updated through the history > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -4639,7 +4572,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "backgroundColor": "transparent", "boundElements": [ { - "id": "id158", + "id": "id868", "type": "text", }, ], @@ -4648,7 +4581,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id157", + "id": "id867", "index": "Zz", "isDeleted": false, "link": null, @@ -4676,7 +4609,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id157", + "containerId": "id867", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -4684,7 +4617,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 25, - "id": "id158", + "id": "id868", "index": "a0", "isDeleted": false, "lineHeight": "1.25000", @@ -4711,49 +4644,43 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and } `; -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should redraw bound text to match container dimensions when the bound text is updated through the history > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should redraw bound text to match container dimensions when the bound text is updated through the history > [end of test] number of elements 1`] = `2`; + +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should redraw bound text to match container dimensions when the bound text is updated through the history > [end of test] number of renders 1`] = `9`; + +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should redraw bound text to match container dimensions when the bound text is updated through the history > [end of test] redo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id158" => Delta { - "deleted": { - "angle": 0, - "x": 15, - "y": 15, - }, - "inserted": { - "angle": 0, - "x": 15, - "y": 15, - }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id876", + "removed": {}, + "updated": { + "id868": Delta { + "deleted": { + "angle": 0, + "x": 15, + "y": 15, + }, + "inserted": { + "angle": 0, + "x": 15, + "y": 15, }, }, }, }, - ], - "undoStack": [], -} + }, +] `; -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should redraw bound text to match container dimensions when the bound text is updated through the history > [end of test] number of elements 1`] = `2`; - -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should redraw bound text to match container dimensions when the bound text is updated through the history > [end of test] number of renders 1`] = `9`; +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should redraw bound text to match container dimensions when the bound text is updated through the history > [end of test] undo stack 1`] = `[]`; exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should redraw remotely added bound text when it's container is updated through the history > [end of test] appState 1`] = ` { @@ -4873,7 +4800,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "backgroundColor": "transparent", "boundElements": [ { - "id": "id156", + "id": "id856", "type": "text", }, ], @@ -4882,7 +4809,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id155", + "id": "id855", "index": "a0", "isDeleted": false, "link": null, @@ -4910,7 +4837,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id155", + "containerId": "id855", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -4918,7 +4845,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 25, - "id": "id156", + "id": "id856", "index": "a1", "isDeleted": false, "lineHeight": "1.25000", @@ -4945,50 +4872,44 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and } `; -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should redraw remotely added bound text when it's container is updated through the history > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should redraw remotely added bound text when it's container is updated through the history > [end of test] number of elements 1`] = `2`; + +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should redraw remotely added bound text when it's container is updated through the history > [end of test] number of renders 1`] = `10`; + +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should redraw remotely added bound text when it's container is updated through the history > [end of test] redo stack 1`] = `[]`; + +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should redraw remotely added bound text when it's container is updated through the history > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id155" => Delta { - "deleted": { - "angle": 90, - "x": 200, - "y": 200, - }, - "inserted": { - "angle": 0, - "x": 10, - "y": 10, - }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id866", + "removed": {}, + "updated": { + "id855": Delta { + "deleted": { + "angle": 90, + "x": 200, + "y": 200, + }, + "inserted": { + "angle": 0, + "x": 10, + "y": 10, }, }, }, }, - ], -} + }, +] `; -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should redraw remotely added bound text when it's container is updated through the history > [end of test] number of elements 1`] = `2`; - -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should redraw remotely added bound text when it's container is updated through the history > [end of test] number of renders 1`] = `10`; - exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should unbind remotely deleted bound text from container when the container is added through the history > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -5111,7 +5032,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id151", + "id": "id831", "index": "a0", "isDeleted": false, "link": null, @@ -5139,7 +5060,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id151", + "containerId": "id831", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -5147,7 +5068,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id152", + "id": "id832", "index": "a1", "isDeleted": true, "lineHeight": "1.25000", @@ -5174,53 +5095,47 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and } `; -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should unbind remotely deleted bound text from container when the container is added through the history > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id151" => Delta { - "deleted": { - "boundElements": [], - "isDeleted": false, - }, - "inserted": { - "boundElements": [ - { - "id": "id152", - "type": "text", - }, - ], - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should unbind remotely deleted bound text from container when the container is added through the history > [end of test] number of elements 1`] = `2`; exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should unbind remotely deleted bound text from container when the container is added through the history > [end of test] number of renders 1`] = `9`; +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should unbind remotely deleted bound text from container when the container is added through the history > [end of test] redo stack 1`] = `[]`; + +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should unbind remotely deleted bound text from container when the container is added through the history > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id842", + "removed": { + "id831": Delta { + "deleted": { + "boundElements": [], + "isDeleted": false, + }, + "inserted": { + "boundElements": [ + { + "id": "id832", + "type": "text", + }, + ], + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, +] +`; + exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should unbind remotely deleted container from bound text when the text is added through the history > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -5339,7 +5254,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "backgroundColor": "transparent", "boundElements": [ { - "id": "id154", + "id": "id844", "type": "text", }, ], @@ -5348,7 +5263,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id153", + "id": "id843", "index": "Zz", "isDeleted": true, "link": null, @@ -5384,7 +5299,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id154", + "id": "id844", "index": "a0", "isDeleted": false, "lineHeight": "1.25000", @@ -5411,48 +5326,42 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and } `; -exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should unbind remotely deleted container from bound text when the text is added through the history > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id154" => Delta { - "deleted": { - "containerId": null, - "isDeleted": false, - }, - "inserted": { - "containerId": "id153", - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should unbind remotely deleted container from bound text when the text is added through the history > [end of test] number of elements 1`] = `2`; exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should unbind remotely deleted container from bound text when the text is added through the history > [end of test] number of renders 1`] = `9`; +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should unbind remotely deleted container from bound text when the text is added through the history > [end of test] redo stack 1`] = `[]`; + +exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should unbind remotely deleted container from bound text when the text is added through the history > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id854", + "removed": { + "id844": Delta { + "deleted": { + "containerId": null, + "isDeleted": false, + }, + "inserted": { + "containerId": "id843", + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, +] +`; + exports[`history > multiplayer undo/redo > conflicts in frames and their children > should not rebind frame child with frame when frame was remotely deleted and frame child is added back through the history > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -5575,7 +5484,7 @@ exports[`history > multiplayer undo/redo > conflicts in frames and their childre "frameId": null, "groupIds": [], "height": 100, - "id": "id182", + "id": "id990", "index": "Zz", "isDeleted": false, "link": null, @@ -5607,7 +5516,7 @@ exports[`history > multiplayer undo/redo > conflicts in frames and their childre "frameId": null, "groupIds": [], "height": 500, - "id": "id181", + "id": "id989", "index": "a0", "isDeleted": true, "link": null, @@ -5630,91 +5539,86 @@ exports[`history > multiplayer undo/redo > conflicts in frames and their childre } `; -exports[`history > multiplayer undo/redo > conflicts in frames and their children > should not rebind frame child with frame when frame was remotely deleted and frame child is added back through the history > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id182" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "Zz", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 10, - "y": 10, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id182" => Delta { - "deleted": { - "frameId": "id181", - }, - "inserted": { - "frameId": null, - }, - }, - }, - }, - }, - ], -} -`; - exports[`history > multiplayer undo/redo > conflicts in frames and their children > should not rebind frame child with frame when frame was remotely deleted and frame child is added back through the history > [end of test] number of elements 1`] = `2`; exports[`history > multiplayer undo/redo > conflicts in frames and their children > should not rebind frame child with frame when frame was remotely deleted and frame child is added back through the history > [end of test] number of renders 1`] = `13`; +exports[`history > multiplayer undo/redo > conflicts in frames and their children > should not rebind frame child with frame when frame was remotely deleted and frame child is added back through the history > [end of test] redo stack 1`] = `[]`; + +exports[`history > multiplayer undo/redo > conflicts in frames and their children > should not rebind frame child with frame when frame was remotely deleted and frame child is added back through the history > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id1004", + "removed": { + "id990": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "Zz", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 10, + "y": 10, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id1006", + "removed": {}, + "updated": { + "id990": Delta { + "deleted": { + "frameId": "id989", + }, + "inserted": { + "frameId": null, + }, + }, + }, + }, + }, +] +`; + exports[`history > multiplayer undo/redo > should iterate through the history when editing group contains only remotely deleted elements > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -5793,7 +5697,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id110": true, + "id596": true, }, "resizingElement": null, "scrollX": 0, @@ -5838,7 +5742,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "A", ], "height": 100, - "id": "id109", + "id": "id595", "index": "a0", "isDeleted": false, "link": null, @@ -5872,7 +5776,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "A", ], "height": 100, - "id": "id110", + "id": "id596", "index": "a1", "isDeleted": true, "link": null, @@ -5894,161 +5798,157 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh } `; -exports[`history > multiplayer undo/redo > should iterate through the history when editing group contains only remotely deleted elements > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id109": true, - "id110": true, - }, - "selectedGroupIds": { - "A": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - "selectedGroupIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id109" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [ - "A", - ], - "height": 100, - "index": "a0", - "isDeleted": true, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 0, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - "id110" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [ - "A", - ], - "height": 100, - "index": "a1", - "isDeleted": true, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 100, - "y": 100, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "editingGroupId": "A", - "selectedElementIds": {}, - "selectedGroupIds": {}, - }, - "inserted": { - "editingGroupId": null, - "selectedElementIds": { - "id109": true, - }, - "selectedGroupIds": { - "A": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "editingGroupId": null, - "selectedElementIds": {}, - }, - "inserted": { - "editingGroupId": "A", - "selectedElementIds": { - "id110": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > multiplayer undo/redo > should iterate through the history when editing group contains only remotely deleted elements > [end of test] number of elements 1`] = `2`; exports[`history > multiplayer undo/redo > should iterate through the history when editing group contains only remotely deleted elements > [end of test] number of renders 1`] = `13`; +exports[`history > multiplayer undo/redo > should iterate through the history when editing group contains only remotely deleted elements > [end of test] redo stack 1`] = `[]`; + +exports[`history > multiplayer undo/redo > should iterate through the history when editing group contains only remotely deleted elements > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id595": true, + "id596": true, + }, + "selectedGroupIds": { + "A": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + "selectedGroupIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id612", + "removed": {}, + "updated": { + "id595": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [ + "A", + ], + "height": 100, + "index": "a0", + "isDeleted": true, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 0, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + "id596": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [ + "A", + ], + "height": 100, + "index": "a1", + "isDeleted": true, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 100, + "y": 100, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "editingGroupId": "A", + "selectedElementIds": {}, + "selectedGroupIds": {}, + }, + "inserted": { + "editingGroupId": null, + "selectedElementIds": { + "id595": true, + }, + "selectedGroupIds": { + "A": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id614", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "editingGroupId": null, + "selectedElementIds": {}, + }, + "inserted": { + "editingGroupId": "A", + "selectedElementIds": { + "id596": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id620", + "removed": {}, + "updated": {}, + }, + }, +] +`; + exports[`history > multiplayer undo/redo > should iterate through the history when element changes relate only to remotely deleted elements > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -6127,7 +6027,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id97": true, + "id521": true, }, "resizingElement": null, "scrollX": 0, @@ -6170,7 +6070,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "frameId": null, "groupIds": [], "height": 10, - "id": "id95", + "id": "id513", "index": "a0", "isDeleted": false, "link": null, @@ -6202,7 +6102,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "frameId": null, "groupIds": [], "height": 10, - "id": "id96", + "id": "id516", "index": "a1", "isDeleted": true, "link": null, @@ -6234,7 +6134,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "frameId": null, "groupIds": [], "height": 10, - "id": "id97", + "id": "id521", "index": "a2", "isDeleted": true, "link": null, @@ -6256,227 +6156,225 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh } `; -exports[`history > multiplayer undo/redo > should iterate through the history when element changes relate only to remotely deleted elements > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id95": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id95" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 10, - "x": 10, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id96": true, - }, - }, - "inserted": { - "selectedElementIds": { - "id95": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id96" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "#ffc9c9", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a1", - "isDeleted": true, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 10, - "x": 20, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id96" => Delta { - "deleted": { - "backgroundColor": "#ffc9c9", - }, - "inserted": { - "backgroundColor": "transparent", - }, - }, - }, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id97": true, - }, - }, - "inserted": { - "selectedElementIds": { - "id96": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id97" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "#ffc9c9", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a2", - "isDeleted": true, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 10, - "x": 50, - "y": 50, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id97" => Delta { - "deleted": { - "x": 50, - "y": 50, - }, - "inserted": { - "x": 30, - "y": 30, - }, - }, - }, - }, - }, - ], -} -`; - exports[`history > multiplayer undo/redo > should iterate through the history when element changes relate only to remotely deleted elements > [end of test] number of elements 1`] = `3`; exports[`history > multiplayer undo/redo > should iterate through the history when element changes relate only to remotely deleted elements > [end of test] number of renders 1`] = `17`; +exports[`history > multiplayer undo/redo > should iterate through the history when element changes relate only to remotely deleted elements > [end of test] redo stack 1`] = `[]`; + +exports[`history > multiplayer undo/redo > should iterate through the history when element changes relate only to remotely deleted elements > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id513": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id515", + "removed": { + "id513": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 10, + "x": 10, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id516": true, + }, + }, + "inserted": { + "selectedElementIds": { + "id513": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id536", + "removed": {}, + "updated": { + "id516": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "#ffc9c9", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a1", + "isDeleted": true, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 10, + "x": 20, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id538", + "removed": {}, + "updated": { + "id516": Delta { + "deleted": { + "backgroundColor": "#ffc9c9", + }, + "inserted": { + "backgroundColor": "transparent", + }, + }, + }, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id521": true, + }, + }, + "inserted": { + "selectedElementIds": { + "id516": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id540", + "removed": {}, + "updated": { + "id521": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "#ffc9c9", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a2", + "isDeleted": true, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 10, + "x": 50, + "y": 50, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id542", + "removed": {}, + "updated": { + "id521": Delta { + "deleted": { + "x": 50, + "y": 50, + }, + "inserted": { + "x": 30, + "y": 30, + }, + }, + }, + }, + }, +] +`; + exports[`history > multiplayer undo/redo > should iterate through the history when selected elements relate only to remotely deleted elements > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -6555,15 +6453,15 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id100": true, + "id544": true, }, "resizingElement": null, "scrollX": 0, "scrollY": 0, "searchMatches": [], "selectedElementIds": { - "id100": true, - "id101": true, + "id544": true, + "id545": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -6601,7 +6499,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "frameId": null, "groupIds": [], "height": 100, - "id": "id99", + "id": "id543", "index": "a0", "isDeleted": false, "link": null, @@ -6633,7 +6531,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "frameId": null, "groupIds": [], "height": 100, - "id": "id100", + "id": "id544", "index": "a1", "isDeleted": false, "link": null, @@ -6665,7 +6563,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "frameId": null, "groupIds": [], "height": 100, - "id": "id101", + "id": "id545", "index": "a2", "isDeleted": false, "link": null, @@ -6687,177 +6585,173 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh } `; -exports[`history > multiplayer undo/redo > should iterate through the history when selected elements relate only to remotely deleted elements > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id99": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id99" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 10, - "y": 10, - }, - "inserted": { - "isDeleted": true, - }, - }, - "id100" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a1", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 20, - "y": 20, - }, - "inserted": { - "isDeleted": true, - }, - }, - "id101" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a2", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 30, - "y": 30, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id100": true, - }, - }, - "inserted": { - "selectedElementIds": { - "id99": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id101": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > multiplayer undo/redo > should iterate through the history when selected elements relate only to remotely deleted elements > [end of test] number of elements 1`] = `3`; exports[`history > multiplayer undo/redo > should iterate through the history when selected elements relate only to remotely deleted elements > [end of test] number of renders 1`] = `15`; +exports[`history > multiplayer undo/redo > should iterate through the history when selected elements relate only to remotely deleted elements > [end of test] redo stack 1`] = `[]`; + +exports[`history > multiplayer undo/redo > should iterate through the history when selected elements relate only to remotely deleted elements > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id543": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id548", + "removed": { + "id543": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 10, + "y": 10, + }, + "inserted": { + "isDeleted": true, + }, + }, + "id544": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a1", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 20, + "y": 20, + }, + "inserted": { + "isDeleted": true, + }, + }, + "id545": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a2", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 30, + "y": 30, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id544": true, + }, + }, + "inserted": { + "selectedElementIds": { + "id543": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id568", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id545": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id570", + "removed": {}, + "updated": {}, + }, + }, +] +`; + exports[`history > multiplayer undo/redo > should iterate through the history when selected groups contain only remotely deleted elements > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -6944,10 +6838,10 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "scrollY": 0, "searchMatches": [], "selectedElementIds": { - "id105": true, - "id106": true, - "id107": true, - "id108": true, + "id571": true, + "id572": true, + "id573": true, + "id574": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": { @@ -6990,7 +6884,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "A", ], "height": 100, - "id": "id105", + "id": "id571", "index": "a0", "isDeleted": false, "link": null, @@ -7024,7 +6918,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "A", ], "height": 100, - "id": "id106", + "id": "id572", "index": "a1", "isDeleted": false, "link": null, @@ -7058,7 +6952,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "B", ], "height": 100, - "id": "id107", + "id": "id573", "index": "a2", "isDeleted": false, "link": null, @@ -7092,7 +6986,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "B", ], "height": 100, - "id": "id108", + "id": "id574", "index": "a3", "isDeleted": false, "link": null, @@ -7114,72 +7008,67 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh } `; -exports[`history > multiplayer undo/redo > should iterate through the history when selected groups contain only remotely deleted elements > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id105": true, - "id106": true, - }, - "selectedGroupIds": { - "A": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - "selectedGroupIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id107": true, - "id108": true, - }, - "selectedGroupIds": { - "B": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - "selectedGroupIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > multiplayer undo/redo > should iterate through the history when selected groups contain only remotely deleted elements > [end of test] number of elements 1`] = `4`; exports[`history > multiplayer undo/redo > should iterate through the history when selected groups contain only remotely deleted elements > [end of test] number of renders 1`] = `15`; +exports[`history > multiplayer undo/redo > should iterate through the history when selected groups contain only remotely deleted elements > [end of test] redo stack 1`] = `[]`; + +exports[`history > multiplayer undo/redo > should iterate through the history when selected groups contain only remotely deleted elements > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id571": true, + "id572": true, + }, + "selectedGroupIds": { + "A": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + "selectedGroupIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id592", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id573": true, + "id574": true, + }, + "selectedGroupIds": { + "B": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + "selectedGroupIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id594", + "removed": {}, + "updated": {}, + }, + }, +] +`; + exports[`history > multiplayer undo/redo > should iterate through the history when selected or editing linear element was remotely deleted > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -7263,7 +7152,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "scrollY": 0, "searchMatches": [], "selectedElementIds": { - "id113": true, + "id621": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -7304,7 +7193,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "frameId": null, "groupIds": [], "height": 10, - "id": "id113", + "id": "id621", "index": "a0", "isDeleted": true, "lastCommittedPoint": [ @@ -7342,145 +7231,142 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh } `; -exports[`history > multiplayer undo/redo > should iterate through the history when selected or editing linear element was remotely deleted > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id113": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id113" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "elbowed": false, - "endArrowhead": "arrow", - "endBinding": null, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a0", - "isDeleted": false, - "lastCommittedPoint": [ - 10, - 10, - ], - "link": null, - "locked": false, - "opacity": 100, - "points": [ - [ - 0, - 0, - ], - [ - 10, - 10, - ], - ], - "roughness": 1, - "roundness": { - "type": 2, - }, - "startArrowhead": null, - "startBinding": null, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "arrow", - "width": 10, - "x": -10, - "y": -10, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedLinearElementId": "id113", - }, - "inserted": { - "selectedLinearElementId": null, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "editingLinearElementId": "id113", - }, - "inserted": { - "editingLinearElementId": null, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "editingLinearElementId": null, - }, - "inserted": { - "editingLinearElementId": "id113", - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > multiplayer undo/redo > should iterate through the history when selected or editing linear element was remotely deleted > [end of test] number of elements 1`] = `1`; exports[`history > multiplayer undo/redo > should iterate through the history when selected or editing linear element was remotely deleted > [end of test] number of renders 1`] = `10`; +exports[`history > multiplayer undo/redo > should iterate through the history when selected or editing linear element was remotely deleted > [end of test] redo stack 1`] = `[]`; + +exports[`history > multiplayer undo/redo > should iterate through the history when selected or editing linear element was remotely deleted > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id621": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id623", + "removed": { + "id621": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "elbowed": false, + "endArrowhead": "arrow", + "endBinding": null, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a0", + "isDeleted": false, + "lastCommittedPoint": [ + 10, + 10, + ], + "link": null, + "locked": false, + "opacity": 100, + "points": [ + [ + 0, + 0, + ], + [ + 10, + 10, + ], + ], + "roughness": 1, + "roundness": { + "type": 2, + }, + "startArrowhead": null, + "startBinding": null, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "arrow", + "width": 10, + "x": -10, + "y": -10, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedLinearElementId": "id621", + }, + "inserted": { + "selectedLinearElementId": null, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id637", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "editingLinearElementId": "id621", + }, + "inserted": { + "editingLinearElementId": null, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id639", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "editingLinearElementId": null, + }, + "inserted": { + "editingLinearElementId": "id621", + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id641", + "removed": {}, + "updated": {}, + }, + }, +] +`; + exports[`history > multiplayer undo/redo > should iterate through the history when when element change relates to remotely deleted element > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -7600,7 +7486,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "frameId": null, "groupIds": [], "height": 10, - "id": "id94", + "id": "id500", "index": "a0", "isDeleted": true, "link": null, @@ -7622,97 +7508,92 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh } `; -exports[`history > multiplayer undo/redo > should iterate through the history when when element change relates to remotely deleted element > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id94": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id94" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "#ffec99", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a0", - "isDeleted": true, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 10, - "x": 10, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id94" => Delta { - "deleted": { - "backgroundColor": "#ffec99", - }, - "inserted": { - "backgroundColor": "transparent", - }, - }, - }, - }, - }, - ], -} -`; - exports[`history > multiplayer undo/redo > should iterate through the history when when element change relates to remotely deleted element > [end of test] number of elements 1`] = `1`; exports[`history > multiplayer undo/redo > should iterate through the history when when element change relates to remotely deleted element > [end of test] number of renders 1`] = `9`; +exports[`history > multiplayer undo/redo > should iterate through the history when when element change relates to remotely deleted element > [end of test] redo stack 1`] = `[]`; + +exports[`history > multiplayer undo/redo > should iterate through the history when when element change relates to remotely deleted element > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id500": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id510", + "removed": {}, + "updated": { + "id500": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "#ffec99", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a0", + "isDeleted": true, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 10, + "x": 10, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id512", + "removed": {}, + "updated": { + "id500": Delta { + "deleted": { + "backgroundColor": "#ffec99", + }, + "inserted": { + "backgroundColor": "transparent", + }, + }, + }, + }, + }, +] +`; + exports[`history > multiplayer undo/redo > should iterate through the history when z-index changes do not produce visible change and we synced all indices > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -7832,7 +7713,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "frameId": null, "groupIds": [], "height": 100, - "id": "id119", + "id": "id659", "index": "a1", "isDeleted": true, "link": null, @@ -7864,7 +7745,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "frameId": null, "groupIds": [], "height": 100, - "id": "id120", + "id": "id660", "index": "a3V", "isDeleted": true, "link": null, @@ -7896,7 +7777,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "frameId": null, "groupIds": [], "height": 100, - "id": "id118", + "id": "id658", "index": "a4", "isDeleted": true, "link": null, @@ -7918,159 +7799,154 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh } `; -exports[`history > multiplayer undo/redo > should iterate through the history when z-index changes do not produce visible change and we synced all indices > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id119" => Delta { - "deleted": { - "index": "a1", - }, - "inserted": { - "index": "a3", - }, - }, - }, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": {}, - }, - "inserted": { - "selectedElementIds": { - "id119": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map { - "id118" => Delta { - "deleted": { - "isDeleted": true, - }, - "inserted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a4", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 10, - "y": 10, - }, - }, - "id119" => Delta { - "deleted": { - "isDeleted": true, - }, - "inserted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a3", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 20, - "y": 20, - }, - }, - "id120" => Delta { - "deleted": { - "isDeleted": true, - }, - "inserted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a3V", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 30, - "y": 30, - }, - }, - }, - "removed": Map {}, - "updated": Map {}, - }, - }, - ], - "undoStack": [], -} -`; - exports[`history > multiplayer undo/redo > should iterate through the history when z-index changes do not produce visible change and we synced all indices > [end of test] number of elements 1`] = `3`; exports[`history > multiplayer undo/redo > should iterate through the history when z-index changes do not produce visible change and we synced all indices > [end of test] number of renders 1`] = `11`; +exports[`history > multiplayer undo/redo > should iterate through the history when z-index changes do not produce visible change and we synced all indices > [end of test] redo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id671", + "removed": {}, + "updated": { + "id659": Delta { + "deleted": { + "index": "a1", + }, + "inserted": { + "index": "a3", + }, + }, + }, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": {}, + }, + "inserted": { + "selectedElementIds": { + "id659": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": { + "id658": Delta { + "deleted": { + "isDeleted": true, + }, + "inserted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a4", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 10, + "y": 10, + }, + }, + "id659": Delta { + "deleted": { + "isDeleted": true, + }, + "inserted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a3", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 20, + "y": 20, + }, + }, + "id660": Delta { + "deleted": { + "isDeleted": true, + }, + "inserted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a3V", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 30, + "y": 30, + }, + }, + }, + "id": "id673", + "removed": {}, + "updated": {}, + }, + }, +] +`; + +exports[`history > multiplayer undo/redo > should iterate through the history when z-index changes do not produce visible change and we synced all indices > [end of test] undo stack 1`] = `[]`; + exports[`history > multiplayer undo/redo > should iterate through the history when z-index changes do not produce visible change and we synced changed indices > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -8190,7 +8066,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "frameId": null, "groupIds": [], "height": 100, - "id": "id114", + "id": "id642", "index": "Zx", "isDeleted": true, "link": null, @@ -8222,7 +8098,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "frameId": null, "groupIds": [], "height": 100, - "id": "id116", + "id": "id644", "index": "Zy", "isDeleted": true, "link": null, @@ -8254,7 +8130,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "frameId": null, "groupIds": [], "height": 100, - "id": "id115", + "id": "id643", "index": "a1", "isDeleted": true, "link": null, @@ -8276,159 +8152,154 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh } `; -exports[`history > multiplayer undo/redo > should iterate through the history when z-index changes do not produce visible change and we synced changed indices > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id115" => Delta { - "deleted": { - "index": "a1", - }, - "inserted": { - "index": "Zz", - }, - }, - }, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": {}, - }, - "inserted": { - "selectedElementIds": { - "id115": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map { - "id114" => Delta { - "deleted": { - "isDeleted": true, - }, - "inserted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "Zx", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 10, - "y": 10, - }, - }, - "id115" => Delta { - "deleted": { - "isDeleted": true, - }, - "inserted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "Zz", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 20, - "y": 20, - }, - }, - "id116" => Delta { - "deleted": { - "isDeleted": true, - }, - "inserted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "Zy", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 30, - "y": 30, - }, - }, - }, - "removed": Map {}, - "updated": Map {}, - }, - }, - ], - "undoStack": [], -} -`; - exports[`history > multiplayer undo/redo > should iterate through the history when z-index changes do not produce visible change and we synced changed indices > [end of test] number of elements 1`] = `3`; exports[`history > multiplayer undo/redo > should iterate through the history when z-index changes do not produce visible change and we synced changed indices > [end of test] number of renders 1`] = `11`; +exports[`history > multiplayer undo/redo > should iterate through the history when z-index changes do not produce visible change and we synced changed indices > [end of test] redo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id655", + "removed": {}, + "updated": { + "id643": Delta { + "deleted": { + "index": "a1", + }, + "inserted": { + "index": "Zz", + }, + }, + }, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": {}, + }, + "inserted": { + "selectedElementIds": { + "id643": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": { + "id642": Delta { + "deleted": { + "isDeleted": true, + }, + "inserted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "Zx", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 10, + "y": 10, + }, + }, + "id643": Delta { + "deleted": { + "isDeleted": true, + }, + "inserted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "Zz", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 20, + "y": 20, + }, + }, + "id644": Delta { + "deleted": { + "isDeleted": true, + }, + "inserted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "Zy", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 30, + "y": 30, + }, + }, + }, + "id": "id657", + "removed": {}, + "updated": {}, + }, + }, +] +`; + +exports[`history > multiplayer undo/redo > should iterate through the history when z-index changes do not produce visible change and we synced changed indices > [end of test] undo stack 1`] = `[]`; + exports[`history > multiplayer undo/redo > should not let remote changes to interfere with in progress dragging > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -8507,16 +8378,16 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id127": true, - "id128": true, + "id697": true, + "id700": true, }, "resizingElement": null, "scrollX": 0, "scrollY": 0, "searchMatches": [], "selectedElementIds": { - "id127": true, - "id128": true, + "id697": true, + "id700": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -8554,7 +8425,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "frameId": null, "groupIds": [], "height": 10, - "id": "id127", + "id": "id697", "index": "a0", "isDeleted": false, "link": null, @@ -8586,7 +8457,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "frameId": null, "groupIds": [], "height": 10, - "id": "id128", + "id": "id700", "index": "a1", "isDeleted": false, "link": null, @@ -8618,7 +8489,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "frameId": null, "groupIds": [], "height": 100, - "id": "id132", + "id": "id710", "index": "a2", "isDeleted": false, "link": null, @@ -8640,202 +8511,200 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte } `; -exports[`history > multiplayer undo/redo > should not let remote changes to interfere with in progress dragging > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id127": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id127" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 10, - "x": 10, - "y": 10, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id128": true, - }, - }, - "inserted": { - "selectedElementIds": { - "id127": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id128" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a1", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 10, - "x": 30, - "y": 30, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id127": true, - }, - }, - "inserted": { - "selectedElementIds": { - "id128": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id128": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id127" => Delta { - "deleted": { - "x": 90, - "y": 90, - }, - "inserted": { - "x": 10, - "y": 10, - }, - }, - "id128" => Delta { - "deleted": { - "x": 110, - "y": 110, - }, - "inserted": { - "x": 30, - "y": 30, - }, - }, - }, - }, - }, - ], -} -`; - exports[`history > multiplayer undo/redo > should not let remote changes to interfere with in progress dragging > [end of test] number of elements 1`] = `3`; exports[`history > multiplayer undo/redo > should not let remote changes to interfere with in progress dragging > [end of test] number of renders 1`] = `25`; +exports[`history > multiplayer undo/redo > should not let remote changes to interfere with in progress dragging > [end of test] redo stack 1`] = `[]`; + +exports[`history > multiplayer undo/redo > should not let remote changes to interfere with in progress dragging > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id697": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id724", + "removed": { + "id697": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 10, + "x": 10, + "y": 10, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id700": true, + }, + }, + "inserted": { + "selectedElementIds": { + "id697": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id726", + "removed": { + "id700": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a1", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 10, + "x": 30, + "y": 30, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id697": true, + }, + }, + "inserted": { + "selectedElementIds": { + "id700": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id728", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id700": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id730", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id732", + "removed": {}, + "updated": { + "id697": Delta { + "deleted": { + "x": 90, + "y": 90, + }, + "inserted": { + "x": 10, + "y": 10, + }, + }, + "id700": Delta { + "deleted": { + "x": 110, + "y": 110, + }, + "inserted": { + "x": 30, + "y": 30, + }, + }, + }, + }, + }, +] +`; + exports[`history > multiplayer undo/redo > should not let remote changes to interfere with in progress freedraw > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -8955,7 +8824,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "frameId": null, "groupIds": [], "height": 50, - "id": "id122", + "id": "id674", "index": "a0", "isDeleted": false, "lastCommittedPoint": [ @@ -9014,7 +8883,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "frameId": null, "groupIds": [], "height": 100, - "id": "id123", + "id": "id675", "index": "a1", "isDeleted": false, "link": null, @@ -9036,96 +8905,90 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte } `; -exports[`history > multiplayer undo/redo > should not let remote changes to interfere with in progress freedraw > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id122" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 50, - "index": "a0", - "isDeleted": false, - "lastCommittedPoint": [ - 50, - 50, - ], - "link": null, - "locked": false, - "opacity": 100, - "points": [ - [ - 0, - 0, - ], - [ - 20, - 20, - ], - [ - 50, - 50, - ], - [ - 50, - 50, - ], - ], - "pressures": [ - 0, - 0, - 0, - 0, - ], - "roughness": 1, - "roundness": null, - "simulatePressure": false, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "freedraw", - "width": 50, - "x": 10, - "y": 10, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > multiplayer undo/redo > should not let remote changes to interfere with in progress freedraw > [end of test] number of elements 1`] = `2`; exports[`history > multiplayer undo/redo > should not let remote changes to interfere with in progress freedraw > [end of test] number of renders 1`] = `8`; +exports[`history > multiplayer undo/redo > should not let remote changes to interfere with in progress freedraw > [end of test] redo stack 1`] = `[]`; + +exports[`history > multiplayer undo/redo > should not let remote changes to interfere with in progress freedraw > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id681", + "removed": { + "id674": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 50, + "index": "a0", + "isDeleted": false, + "lastCommittedPoint": [ + 50, + 50, + ], + "link": null, + "locked": false, + "opacity": 100, + "points": [ + [ + 0, + 0, + ], + [ + 20, + 20, + ], + [ + 50, + 50, + ], + [ + 50, + 50, + ], + ], + "pressures": [ + 0, + 0, + 0, + 0, + ], + "roughness": 1, + "roundness": null, + "simulatePressure": false, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "freedraw", + "width": 50, + "x": 10, + "y": 10, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, +] +`; + exports[`history > multiplayer undo/redo > should not let remote changes to interfere with in progress resizing > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -9209,7 +9072,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "scrollY": 0, "searchMatches": [], "selectedElementIds": { - "id124": true, + "id682": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -9247,7 +9110,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "frameId": null, "groupIds": [], "height": 90, - "id": "id124", + "id": "id682", "index": "a0", "isDeleted": false, "link": null, @@ -9279,7 +9142,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "frameId": null, "groupIds": [], "height": 100, - "id": "id126", + "id": "id686", "index": "a1", "isDeleted": false, "link": null, @@ -9301,99 +9164,94 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte } `; -exports[`history > multiplayer undo/redo > should not let remote changes to interfere with in progress resizing > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id124": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id124" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 10, - "x": 10, - "y": 10, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id124" => Delta { - "deleted": { - "height": 90, - "width": 90, - }, - "inserted": { - "height": 10, - "width": 10, - }, - }, - }, - }, - }, - ], -} -`; - exports[`history > multiplayer undo/redo > should not let remote changes to interfere with in progress resizing > [end of test] number of elements 1`] = `2`; exports[`history > multiplayer undo/redo > should not let remote changes to interfere with in progress resizing > [end of test] number of renders 1`] = `13`; +exports[`history > multiplayer undo/redo > should not let remote changes to interfere with in progress resizing > [end of test] redo stack 1`] = `[]`; + +exports[`history > multiplayer undo/redo > should not let remote changes to interfere with in progress resizing > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id682": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id694", + "removed": { + "id682": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 10, + "x": 10, + "y": 10, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id696", + "removed": {}, + "updated": { + "id682": Delta { + "deleted": { + "height": 90, + "width": 90, + }, + "inserted": { + "height": 10, + "width": 10, + }, + }, + }, + }, + }, +] +`; + exports[`history > multiplayer undo/redo > should not override remote changes on different elements > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -9477,7 +9335,7 @@ exports[`history > multiplayer undo/redo > should not override remote changes on "scrollY": 0, "searchMatches": [], "selectedElementIds": { - "id81": true, + "id407": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -9515,7 +9373,7 @@ exports[`history > multiplayer undo/redo > should not override remote changes on "frameId": null, "groupIds": [], "height": 10, - "id": "id81", + "id": "id407", "index": "a0", "isDeleted": false, "link": null, @@ -9547,7 +9405,7 @@ exports[`history > multiplayer undo/redo > should not override remote changes on "frameId": null, "groupIds": [], "height": 100, - "id": "id82", + "id": "id412", "index": "a1", "isDeleted": false, "link": null, @@ -9569,98 +9427,95 @@ exports[`history > multiplayer undo/redo > should not override remote changes on } `; -exports[`history > multiplayer undo/redo > should not override remote changes on different elements > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id81" => Delta { - "deleted": { - "backgroundColor": "transparent", - }, - "inserted": { - "backgroundColor": "#ffc9c9", - }, - }, - }, - }, - }, - ], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id81": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id81" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 10, - "x": 10, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > multiplayer undo/redo > should not override remote changes on different elements > [end of test] number of elements 1`] = `2`; exports[`history > multiplayer undo/redo > should not override remote changes on different elements > [end of test] number of renders 1`] = `10`; +exports[`history > multiplayer undo/redo > should not override remote changes on different elements > [end of test] redo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id418", + "removed": {}, + "updated": { + "id407": Delta { + "deleted": { + "backgroundColor": "transparent", + }, + "inserted": { + "backgroundColor": "#ffc9c9", + }, + }, + }, + }, + }, +] +`; + +exports[`history > multiplayer undo/redo > should not override remote changes on different elements > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id407": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id409", + "removed": { + "id407": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 10, + "x": 10, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, +] +`; + exports[`history > multiplayer undo/redo > should not override remote changes on different properties > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -9744,7 +9599,7 @@ exports[`history > multiplayer undo/redo > should not override remote changes on "scrollY": 0, "searchMatches": [], "selectedElementIds": { - "id83": true, + "id419": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -9782,7 +9637,7 @@ exports[`history > multiplayer undo/redo > should not override remote changes on "frameId": null, "groupIds": [], "height": 10, - "id": "id83", + "id": "id419", "index": "a0", "isDeleted": false, "link": null, @@ -9804,97 +9659,92 @@ exports[`history > multiplayer undo/redo > should not override remote changes on } `; -exports[`history > multiplayer undo/redo > should not override remote changes on different properties > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id83": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id83" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 10, - "x": 10, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id83" => Delta { - "deleted": { - "backgroundColor": "#ffc9c9", - }, - "inserted": { - "backgroundColor": "transparent", - }, - }, - }, - }, - }, - ], -} -`; - exports[`history > multiplayer undo/redo > should not override remote changes on different properties > [end of test] number of elements 1`] = `1`; exports[`history > multiplayer undo/redo > should not override remote changes on different properties > [end of test] number of renders 1`] = `9`; +exports[`history > multiplayer undo/redo > should not override remote changes on different properties > [end of test] redo stack 1`] = `[]`; + +exports[`history > multiplayer undo/redo > should not override remote changes on different properties > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id419": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id421", + "removed": { + "id419": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 10, + "x": 10, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id427", + "removed": {}, + "updated": { + "id419": Delta { + "deleted": { + "backgroundColor": "#ffc9c9", + }, + "inserted": { + "backgroundColor": "transparent", + }, + }, + }, + }, + }, +] +`; + exports[`history > multiplayer undo/redo > should override remotely added groups on undo, but restore them on redo > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -10020,7 +9870,7 @@ exports[`history > multiplayer undo/redo > should override remotely added groups "B", ], "height": 100, - "id": "id88", + "id": "id458", "index": "a0", "isDeleted": false, "link": null, @@ -10055,7 +9905,7 @@ exports[`history > multiplayer undo/redo > should override remotely added groups "B", ], "height": 100, - "id": "id89", + "id": "id459", "index": "a1", "isDeleted": false, "link": null, @@ -10089,7 +9939,7 @@ exports[`history > multiplayer undo/redo > should override remotely added groups "B", ], "height": 100, - "id": "id90", + "id": "id462", "index": "a2", "isDeleted": false, "link": null, @@ -10123,7 +9973,7 @@ exports[`history > multiplayer undo/redo > should override remotely added groups "B", ], "height": 100, - "id": "id91", + "id": "id463", "index": "a3", "isDeleted": false, "link": null, @@ -10145,60 +9995,54 @@ exports[`history > multiplayer undo/redo > should override remotely added groups } `; -exports[`history > multiplayer undo/redo > should override remotely added groups on undo, but restore them on redo > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, +exports[`history > multiplayer undo/redo > should override remotely added groups on undo, but restore them on redo > [end of test] number of elements 1`] = `4`; + +exports[`history > multiplayer undo/redo > should override remotely added groups on undo, but restore them on redo > [end of test] number of renders 1`] = `8`; + +exports[`history > multiplayer undo/redo > should override remotely added groups on undo, but restore them on redo > [end of test] redo stack 1`] = `[]`; + +exports[`history > multiplayer undo/redo > should override remotely added groups on undo, but restore them on redo > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id88" => Delta { - "deleted": { - "groupIds": [ - "A", - "B", - ], - }, - "inserted": { - "groupIds": [], - }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id467", + "removed": {}, + "updated": { + "id458": Delta { + "deleted": { + "groupIds": [ + "A", + "B", + ], }, - "id89" => Delta { - "deleted": { - "groupIds": [ - "A", - "B", - ], - }, - "inserted": { - "groupIds": [], - }, + "inserted": { + "groupIds": [], + }, + }, + "id459": Delta { + "deleted": { + "groupIds": [ + "A", + "B", + ], + }, + "inserted": { + "groupIds": [], }, }, }, }, - ], -} + }, +] `; -exports[`history > multiplayer undo/redo > should override remotely added groups on undo, but restore them on redo > [end of test] number of elements 1`] = `4`; - -exports[`history > multiplayer undo/redo > should override remotely added groups on undo, but restore them on redo > [end of test] number of renders 1`] = `8`; - exports[`history > multiplayer undo/redo > should override remotely added points on undo, but restore them on redo > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -10282,7 +10126,7 @@ exports[`history > multiplayer undo/redo > should override remotely added points "scrollY": 0, "searchMatches": [], "selectedElementIds": { - "id92": true, + "id468": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -10323,7 +10167,7 @@ exports[`history > multiplayer undo/redo > should override remotely added points "frameId": null, "groupIds": [], "height": 30, - "id": "id92", + "id": "id468", "index": "a0", "isDeleted": false, "lastCommittedPoint": [ @@ -10373,175 +10217,171 @@ exports[`history > multiplayer undo/redo > should override remotely added points } `; -exports[`history > multiplayer undo/redo > should override remotely added points on undo, but restore them on redo > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id92": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id92" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "elbowed": false, - "endArrowhead": "arrow", - "endBinding": null, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a0", - "isDeleted": false, - "lastCommittedPoint": [ - 10, - 10, - ], - "link": null, - "locked": false, - "opacity": 100, - "points": [ - [ - 0, - 0, - ], - [ - 10, - 10, - ], - ], - "roughness": 1, - "roundness": { - "type": 2, - }, - "startArrowhead": null, - "startBinding": null, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "arrow", - "width": 10, - "x": 0, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id92" => Delta { - "deleted": { - "height": 30, - "lastCommittedPoint": [ - 30, - 30, - ], - "points": [ - [ - 0, - 0, - ], - [ - 5, - 5, - ], - [ - 10, - 10, - ], - [ - 15, - 15, - ], - [ - 20, - 20, - ], - ], - "width": 30, - }, - "inserted": { - "height": 10, - "lastCommittedPoint": [ - 10, - 10, - ], - "points": [ - [ - 0, - 0, - ], - [ - 10, - 10, - ], - ], - "width": 10, - }, - }, - }, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedLinearElementId": "id92", - }, - "inserted": { - "selectedLinearElementId": null, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > multiplayer undo/redo > should override remotely added points on undo, but restore them on redo > [end of test] number of elements 1`] = `1`; exports[`history > multiplayer undo/redo > should override remotely added points on undo, but restore them on redo > [end of test] number of renders 1`] = `15`; +exports[`history > multiplayer undo/redo > should override remotely added points on undo, but restore them on redo > [end of test] redo stack 1`] = `[]`; + +exports[`history > multiplayer undo/redo > should override remotely added points on undo, but restore them on redo > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id468": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id482", + "removed": { + "id468": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "elbowed": false, + "endArrowhead": "arrow", + "endBinding": null, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a0", + "isDeleted": false, + "lastCommittedPoint": [ + 10, + 10, + ], + "link": null, + "locked": false, + "opacity": 100, + "points": [ + [ + 0, + 0, + ], + [ + 10, + 10, + ], + ], + "roughness": 1, + "roundness": { + "type": 2, + }, + "startArrowhead": null, + "startBinding": null, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "arrow", + "width": 10, + "x": 0, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id484", + "removed": {}, + "updated": { + "id468": Delta { + "deleted": { + "height": 30, + "lastCommittedPoint": [ + 30, + 30, + ], + "points": [ + [ + 0, + 0, + ], + [ + 5, + 5, + ], + [ + 10, + 10, + ], + [ + 15, + 15, + ], + [ + 20, + 20, + ], + ], + "width": 30, + }, + "inserted": { + "height": 10, + "lastCommittedPoint": [ + 10, + 10, + ], + "points": [ + [ + 0, + 0, + ], + [ + 10, + 10, + ], + ], + "width": 10, + }, + }, + }, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedLinearElementId": "id468", + }, + "inserted": { + "selectedLinearElementId": null, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id486", + "removed": {}, + "updated": {}, + }, + }, +] +`; + exports[`history > multiplayer undo/redo > should redistribute deltas when element gets removed locally but is restored remotely > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -10661,7 +10501,7 @@ exports[`history > multiplayer undo/redo > should redistribute deltas when eleme "frameId": null, "groupIds": [], "height": 10, - "id": "id93", + "id": "id487", "index": "a0", "isDeleted": false, "link": null, @@ -10683,103 +10523,98 @@ exports[`history > multiplayer undo/redo > should redistribute deltas when eleme } `; -exports[`history > multiplayer undo/redo > should redistribute deltas when element gets removed locally but is restored remotely > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id93": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id93" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "#ffec99", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 10, - "x": 10, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": {}, - }, - "inserted": { - "selectedElementIds": { - "id93": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id93" => Delta { - "deleted": { - "isDeleted": false, - }, - "inserted": { - "isDeleted": false, - }, - }, - }, - }, - }, - ], -} -`; - exports[`history > multiplayer undo/redo > should redistribute deltas when element gets removed locally but is restored remotely > [end of test] number of elements 1`] = `1`; exports[`history > multiplayer undo/redo > should redistribute deltas when element gets removed locally but is restored remotely > [end of test] number of renders 1`] = `11`; +exports[`history > multiplayer undo/redo > should redistribute deltas when element gets removed locally but is restored remotely > [end of test] redo stack 1`] = `[]`; + +exports[`history > multiplayer undo/redo > should redistribute deltas when element gets removed locally but is restored remotely > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id487": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id497", + "removed": { + "id487": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "#ffec99", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 10, + "x": 10, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": {}, + }, + "inserted": { + "selectedElementIds": { + "id487": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id499", + "removed": {}, + "updated": { + "id487": Delta { + "deleted": { + "isDeleted": false, + }, + "inserted": { + "isDeleted": false, + }, + }, + }, + }, + }, +] +`; + exports[`history > multiplayer undo/redo > should redraw arrows on undo > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -11232,6 +11067,199 @@ exports[`history > multiplayer undo/redo > should redraw arrows on undo > [end o exports[`history > multiplayer undo/redo > should redraw arrows on undo > [end of test] number of renders 1`] = `8`; +exports[`history > multiplayer undo/redo > should redraw arrows on undo > [end of test] redo stack 1`] = `[]`; + +exports[`history > multiplayer undo/redo > should redraw arrows on undo > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id451", + "removed": { + "KPrBI4g_v9qUB1XxYLgSz": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 126, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 157, + "x": 873, + "y": 212, + }, + "inserted": { + "isDeleted": true, + }, + }, + "u2JGnnmoJ0VATV4vCNJE5": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 129, + "index": "a1", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "diamond", + "width": 124, + "x": 1152, + "y": 516, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id457", + "removed": { + "6Rm4g567UQM4WjLwej2Vc": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "elbowed": true, + "endArrowhead": null, + "endBinding": { + "elementId": "u2JGnnmoJ0VATV4vCNJE5", + "fixedPoint": [ + "0.49919", + "-0.03875", + ], + "focus": "-0.00161", + "gap": "3.53708", + }, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": "236.10000", + "index": "a2", + "isDeleted": false, + "lastCommittedPoint": null, + "link": null, + "locked": false, + "opacity": 100, + "points": [ + [ + 0, + 0, + ], + [ + "178.90000", + 0, + ], + [ + "178.90000", + "236.10000", + ], + ], + "roughness": 1, + "roundness": { + "type": 2, + }, + "startArrowhead": null, + "startBinding": { + "elementId": "KPrBI4g_v9qUB1XxYLgSz", + "fixedPoint": [ + "1.03185", + "0.49921", + ], + "focus": "-0.00159", + "gap": 5, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "arrow", + "width": "178.90000", + "x": 1035, + "y": "274.90000", + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": { + "KPrBI4g_v9qUB1XxYLgSz": Delta { + "deleted": { + "boundElements": [ + { + "id": "6Rm4g567UQM4WjLwej2Vc", + "type": "arrow", + }, + ], + }, + "inserted": { + "boundElements": [], + }, + }, + "u2JGnnmoJ0VATV4vCNJE5": Delta { + "deleted": { + "boundElements": [ + { + "id": "6Rm4g567UQM4WjLwej2Vc", + "type": "arrow", + }, + ], + }, + "inserted": { + "boundElements": [], + }, + }, + }, + }, + }, +] +`; + exports[`history > multiplayer undo/redo > should update history entries after remote changes on the same properties > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -11315,7 +11343,7 @@ exports[`history > multiplayer undo/redo > should update history entries after r "scrollY": 0, "searchMatches": [], "selectedElementIds": { - "id84": true, + "id428": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -11353,7 +11381,7 @@ exports[`history > multiplayer undo/redo > should update history entries after r "frameId": null, "groupIds": [], "height": 10, - "id": "id84", + "id": "id428", "index": "a0", "isDeleted": false, "link": null, @@ -11375,120 +11403,118 @@ exports[`history > multiplayer undo/redo > should update history entries after r } `; -exports[`history > multiplayer undo/redo > should update history entries after remote changes on the same properties > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id84" => Delta { - "deleted": { - "backgroundColor": "#d0bfff", - }, - "inserted": { - "backgroundColor": "#ffec99", - }, - }, - }, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id84" => Delta { - "deleted": { - "backgroundColor": "transparent", - }, - "inserted": { - "backgroundColor": "#d0bfff", - }, - }, - }, - }, - }, - ], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id84": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id84" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 10, - "x": 10, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > multiplayer undo/redo > should update history entries after remote changes on the same properties > [end of test] number of elements 1`] = `1`; exports[`history > multiplayer undo/redo > should update history entries after remote changes on the same properties > [end of test] number of renders 1`] = `15`; +exports[`history > multiplayer undo/redo > should update history entries after remote changes on the same properties > [end of test] redo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id444", + "removed": {}, + "updated": { + "id428": Delta { + "deleted": { + "backgroundColor": "#d0bfff", + }, + "inserted": { + "backgroundColor": "#ffec99", + }, + }, + }, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id446", + "removed": {}, + "updated": { + "id428": Delta { + "deleted": { + "backgroundColor": "transparent", + }, + "inserted": { + "backgroundColor": "#d0bfff", + }, + }, + }, + }, + }, +] +`; + +exports[`history > multiplayer undo/redo > should update history entries after remote changes on the same properties > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id428": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id430", + "removed": { + "id428": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 10, + "x": 10, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, +] +`; + exports[`history > singleplayer undo/redo > remounting undo/redo buttons should initialize undo/redo state correctly > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -11640,7 +11666,7 @@ exports[`history > singleplayer undo/redo > remounting undo/redo buttons should "frameId": null, "groupIds": [], "height": 10, - "id": "id80", + "id": "id402", "index": "a1", "isDeleted": true, "link": null, @@ -11662,75 +11688,69 @@ exports[`history > singleplayer undo/redo > remounting undo/redo buttons should } `; -exports[`history > singleplayer undo/redo > remounting undo/redo buttons should initialize undo/redo state correctly > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": {}, - }, - "inserted": { - "selectedElementIds": { - "id80": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map { - "id80" => Delta { - "deleted": { - "isDeleted": true, - }, - "inserted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a1", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 10, - "x": 0, - "y": 0, - }, - }, - }, - "removed": Map {}, - "updated": Map {}, - }, - }, - ], - "undoStack": [], -} -`; - exports[`history > singleplayer undo/redo > remounting undo/redo buttons should initialize undo/redo state correctly > [end of test] number of elements 1`] = `2`; exports[`history > singleplayer undo/redo > remounting undo/redo buttons should initialize undo/redo state correctly > [end of test] number of renders 1`] = `11`; +exports[`history > singleplayer undo/redo > remounting undo/redo buttons should initialize undo/redo state correctly > [end of test] redo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": {}, + }, + "inserted": { + "selectedElementIds": { + "id402": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": { + "id402": Delta { + "deleted": { + "isDeleted": true, + }, + "inserted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a1", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 10, + "x": 0, + "y": 0, + }, + }, + }, + "id": "id406", + "removed": {}, + "updated": {}, + }, + }, +] +`; + +exports[`history > singleplayer undo/redo > remounting undo/redo buttons should initialize undo/redo state correctly > [end of test] undo stack 1`] = `[]`; + exports[`history > singleplayer undo/redo > should clear the redo stack on elements change > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -11814,7 +11834,7 @@ exports[`history > singleplayer undo/redo > should clear the redo stack on eleme "scrollY": 0, "searchMatches": [], "selectedElementIds": { - "id14": true, + "id60": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -11852,7 +11872,7 @@ exports[`history > singleplayer undo/redo > should clear the redo stack on eleme "frameId": null, "groupIds": [], "height": 10, - "id": "id13", + "id": "id55", "index": "a0", "isDeleted": true, "link": null, @@ -11884,7 +11904,7 @@ exports[`history > singleplayer undo/redo > should clear the redo stack on eleme "frameId": null, "groupIds": [], "height": 10, - "id": "id14", + "id": "id60", "index": "a1", "isDeleted": false, "link": null, @@ -11906,75 +11926,69 @@ exports[`history > singleplayer undo/redo > should clear the redo stack on eleme } `; -exports[`history > singleplayer undo/redo > should clear the redo stack on elements change > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id14": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id14" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a1", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 10, - "x": 20, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > singleplayer undo/redo > should clear the redo stack on elements change > [end of test] number of elements 1`] = `2`; exports[`history > singleplayer undo/redo > should clear the redo stack on elements change > [end of test] number of renders 1`] = `8`; +exports[`history > singleplayer undo/redo > should clear the redo stack on elements change > [end of test] redo stack 1`] = `[]`; + +exports[`history > singleplayer undo/redo > should clear the redo stack on elements change > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id60": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id62", + "removed": { + "id60": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a1", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 10, + "x": 20, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, +] +`; + exports[`history > singleplayer undo/redo > should create entry when selecting freedraw > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -12094,7 +12108,7 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f "frameId": null, "groupIds": [], "height": 10, - "id": "id32", + "id": "id196", "index": "a0", "isDeleted": false, "link": null, @@ -12126,7 +12140,7 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f "frameId": null, "groupIds": [], "height": 10, - "id": "id33", + "id": "id201", "index": "a1", "isDeleted": true, "lastCommittedPoint": [ @@ -12180,7 +12194,7 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f "frameId": null, "groupIds": [], "height": 10, - "id": "id34", + "id": "id206", "index": "a2", "isDeleted": false, "lastCommittedPoint": [ @@ -12224,161 +12238,157 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f } `; -exports[`history > singleplayer undo/redo > should create entry when selecting freedraw > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id32": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id32" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 10, - "x": 10, - "y": 10, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": {}, - }, - "inserted": { - "selectedElementIds": { - "id32": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id34" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a2", - "isDeleted": false, - "lastCommittedPoint": [ - 50, - 10, - ], - "link": null, - "locked": false, - "opacity": 100, - "points": [ - [ - 0, - 0, - ], - [ - 50, - 10, - ], - [ - 50, - 10, - ], - ], - "pressures": [ - 0, - 0, - 0, - ], - "roughness": 1, - "roundness": null, - "simulatePressure": false, - "strokeColor": "#e03131", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "freedraw", - "width": 50, - "x": 150, - "y": -10, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > singleplayer undo/redo > should create entry when selecting freedraw > [end of test] number of elements 1`] = `3`; exports[`history > singleplayer undo/redo > should create entry when selecting freedraw > [end of test] number of renders 1`] = `12`; +exports[`history > singleplayer undo/redo > should create entry when selecting freedraw > [end of test] redo stack 1`] = `[]`; + +exports[`history > singleplayer undo/redo > should create entry when selecting freedraw > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id196": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id198", + "removed": { + "id196": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 10, + "x": 10, + "y": 10, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": {}, + }, + "inserted": { + "selectedElementIds": { + "id196": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id200", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id208", + "removed": { + "id206": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a2", + "isDeleted": false, + "lastCommittedPoint": [ + 50, + 10, + ], + "link": null, + "locked": false, + "opacity": 100, + "points": [ + [ + 0, + 0, + ], + [ + 50, + 10, + ], + [ + 50, + 10, + ], + ], + "pressures": [ + 0, + 0, + 0, + ], + "roughness": 1, + "roundness": null, + "simulatePressure": false, + "strokeColor": "#e03131", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "freedraw", + "width": 50, + "x": 150, + "y": -10, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, +] +`; + exports[`history > singleplayer undo/redo > should create new history entry on scene import via drag&drop > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -12554,81 +12564,75 @@ exports[`history > singleplayer undo/redo > should create new history entry on s } `; -exports[`history > singleplayer undo/redo > should create new history entry on scene import via drag&drop > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "viewBackgroundColor": "#000", - }, - "inserted": { - "viewBackgroundColor": "#FFF", - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map { - "A" => Delta { - "deleted": { - "isDeleted": true, - }, - "inserted": { - "isDeleted": false, - }, - }, - }, - "removed": Map { - "B" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": [], - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a1", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 0, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > singleplayer undo/redo > should create new history entry on scene import via drag&drop > [end of test] number of elements 1`] = `2`; exports[`history > singleplayer undo/redo > should create new history entry on scene import via drag&drop > [end of test] number of renders 1`] = `6`; +exports[`history > singleplayer undo/redo > should create new history entry on scene import via drag&drop > [end of test] redo stack 1`] = `[]`; + +exports[`history > singleplayer undo/redo > should create new history entry on scene import via drag&drop > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "viewBackgroundColor": "#000", + }, + "inserted": { + "viewBackgroundColor": "#FFF", + }, + }, + }, + "elementsChange": ElementsChange { + "added": { + "A": Delta { + "deleted": { + "isDeleted": true, + }, + "inserted": { + "isDeleted": false, + }, + }, + }, + "id": "id101", + "removed": { + "B": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": [], + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a1", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 0, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, +] +`; + exports[`history > singleplayer undo/redo > should disable undo/redo buttons when stacks empty > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -12712,7 +12716,7 @@ exports[`history > singleplayer undo/redo > should disable undo/redo buttons whe "scrollY": 0, "searchMatches": [], "selectedElementIds": { - "id78": true, + "id394": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -12782,7 +12786,7 @@ exports[`history > singleplayer undo/redo > should disable undo/redo buttons whe "frameId": null, "groupIds": [], "height": 10, - "id": "id78", + "id": "id394", "index": "a1", "isDeleted": false, "link": null, @@ -12804,75 +12808,69 @@ exports[`history > singleplayer undo/redo > should disable undo/redo buttons whe } `; -exports[`history > singleplayer undo/redo > should disable undo/redo buttons when stacks empty > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id78": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id78" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a1", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 10, - "x": 0, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > singleplayer undo/redo > should disable undo/redo buttons when stacks empty > [end of test] number of elements 1`] = `2`; exports[`history > singleplayer undo/redo > should disable undo/redo buttons when stacks empty > [end of test] number of renders 1`] = `7`; +exports[`history > singleplayer undo/redo > should disable undo/redo buttons when stacks empty > [end of test] redo stack 1`] = `[]`; + +exports[`history > singleplayer undo/redo > should disable undo/redo buttons when stacks empty > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id394": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id400", + "removed": { + "id394": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a1", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 10, + "x": 0, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, +] +`; + exports[`history > singleplayer undo/redo > should end up with no history entry after initializing scene > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -12956,7 +12954,7 @@ exports[`history > singleplayer undo/redo > should end up with no history entry "scrollY": 0, "searchMatches": [], "selectedElementIds": { - "id19": true, + "id87": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -13026,7 +13024,7 @@ exports[`history > singleplayer undo/redo > should end up with no history entry "frameId": null, "groupIds": [], "height": 10, - "id": "id19", + "id": "id87", "index": "a1", "isDeleted": false, "link": null, @@ -13048,75 +13046,69 @@ exports[`history > singleplayer undo/redo > should end up with no history entry } `; -exports[`history > singleplayer undo/redo > should end up with no history entry after initializing scene > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id19": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id19" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a1", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 10, - "x": 0, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > singleplayer undo/redo > should end up with no history entry after initializing scene > [end of test] number of elements 1`] = `2`; exports[`history > singleplayer undo/redo > should end up with no history entry after initializing scene > [end of test] number of renders 1`] = `7`; +exports[`history > singleplayer undo/redo > should end up with no history entry after initializing scene > [end of test] redo stack 1`] = `[]`; + +exports[`history > singleplayer undo/redo > should end up with no history entry after initializing scene > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id87": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id93", + "removed": { + "id87": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a1", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 10, + "x": 0, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, +] +`; + exports[`history > singleplayer undo/redo > should iterate through the history when selection changes do not produce visible change > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -13195,7 +13187,7 @@ exports[`history > singleplayer undo/redo > should iterate through the history w "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id15": true, + "id63": true, }, "resizingElement": null, "scrollX": 0, @@ -13238,7 +13230,7 @@ exports[`history > singleplayer undo/redo > should iterate through the history w "frameId": null, "groupIds": [], "height": 10, - "id": "id15", + "id": "id63", "index": "a0", "isDeleted": true, "link": null, @@ -13260,113 +13252,109 @@ exports[`history > singleplayer undo/redo > should iterate through the history w } `; -exports[`history > singleplayer undo/redo > should iterate through the history when selection changes do not produce visible change > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id15": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id15": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": {}, - }, - "inserted": { - "selectedElementIds": { - "id15": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map { - "id15" => Delta { - "deleted": { - "isDeleted": true, - }, - "inserted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 10, - "x": 10, - "y": 0, - }, - }, - }, - "removed": Map {}, - "updated": Map {}, - }, - }, - ], - "undoStack": [], -} -`; - exports[`history > singleplayer undo/redo > should iterate through the history when selection changes do not produce visible change > [end of test] number of elements 1`] = `1`; exports[`history > singleplayer undo/redo > should iterate through the history when selection changes do not produce visible change > [end of test] number of renders 1`] = `13`; +exports[`history > singleplayer undo/redo > should iterate through the history when selection changes do not produce visible change > [end of test] redo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id63": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id81", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id63": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id83", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": {}, + }, + "inserted": { + "selectedElementIds": { + "id63": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": { + "id63": Delta { + "deleted": { + "isDeleted": true, + }, + "inserted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 10, + "x": 10, + "y": 0, + }, + }, + }, + "id": "id85", + "removed": {}, + "updated": {}, + }, + }, +] +`; + +exports[`history > singleplayer undo/redo > should iterate through the history when selection changes do not produce visible change > [end of test] undo stack 1`] = `[]`; + exports[`history > singleplayer undo/redo > should not clear the redo stack on standalone appstate change > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -13450,7 +13438,7 @@ exports[`history > singleplayer undo/redo > should not clear the redo stack on s "scrollY": 0, "searchMatches": [], "selectedElementIds": { - "id8": true, + "id18": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -13488,7 +13476,7 @@ exports[`history > singleplayer undo/redo > should not clear the redo stack on s "frameId": null, "groupIds": [], "height": 10, - "id": "id7", + "id": "id15", "index": "a0", "isDeleted": false, "link": null, @@ -13520,7 +13508,7 @@ exports[`history > singleplayer undo/redo > should not clear the redo stack on s "frameId": null, "groupIds": [], "height": 10, - "id": "id8", + "id": "id18", "index": "a1", "isDeleted": false, "link": null, @@ -13542,166 +13530,163 @@ exports[`history > singleplayer undo/redo > should not clear the redo stack on s } `; -exports[`history > singleplayer undo/redo > should not clear the redo stack on standalone appstate change > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id7": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id7" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 10, - "x": 10, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": {}, - }, - "inserted": { - "selectedElementIds": { - "id7": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id7": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id8": true, - }, - }, - "inserted": { - "selectedElementIds": { - "id7": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id8" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a1", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 10, - "x": 20, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > singleplayer undo/redo > should not clear the redo stack on standalone appstate change > [end of test] number of elements 1`] = `2`; exports[`history > singleplayer undo/redo > should not clear the redo stack on standalone appstate change > [end of test] number of renders 1`] = `12`; +exports[`history > singleplayer undo/redo > should not clear the redo stack on standalone appstate change > [end of test] redo stack 1`] = `[]`; + +exports[`history > singleplayer undo/redo > should not clear the redo stack on standalone appstate change > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id15": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id17", + "removed": { + "id15": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 10, + "x": 10, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": {}, + }, + "inserted": { + "selectedElementIds": { + "id15": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id25", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id15": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id28", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id18": true, + }, + }, + "inserted": { + "selectedElementIds": { + "id15": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id30", + "removed": { + "id18": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a1", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 10, + "x": 20, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, +] +`; + exports[`history > singleplayer undo/redo > should not collapse when applying corrupted history entry > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -13846,37 +13831,31 @@ exports[`history > singleplayer undo/redo > should not collapse when applying co } `; -exports[`history > singleplayer undo/redo > should not collapse when applying corrupted history entry > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > singleplayer undo/redo > should not collapse when applying corrupted history entry > [end of test] number of elements 1`] = `1`; exports[`history > singleplayer undo/redo > should not collapse when applying corrupted history entry > [end of test] number of renders 1`] = `4`; +exports[`history > singleplayer undo/redo > should not collapse when applying corrupted history entry > [end of test] redo stack 1`] = `[]`; + +exports[`history > singleplayer undo/redo > should not collapse when applying corrupted history entry > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id4", + "removed": {}, + "updated": {}, + }, + }, +] +`; + exports[`history > singleplayer undo/redo > should not end up with history entry when there are no appstate changes > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -13960,8 +13939,8 @@ exports[`history > singleplayer undo/redo > should not end up with history entry "scrollY": 0, "searchMatches": [], "selectedElementIds": { - "id1": true, - "id2": true, + "id5": true, + "id6": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": { @@ -14003,7 +13982,7 @@ exports[`history > singleplayer undo/redo > should not end up with history entry "A", ], "height": 100, - "id": "id1", + "id": "id5", "index": "a0", "isDeleted": false, "link": null, @@ -14037,7 +14016,7 @@ exports[`history > singleplayer undo/redo > should not end up with history entry "A", ], "height": 100, - "id": "id2", + "id": "id6", "index": "a1", "isDeleted": false, "link": null, @@ -14059,115 +14038,109 @@ exports[`history > singleplayer undo/redo > should not end up with history entry } `; -exports[`history > singleplayer undo/redo > should not end up with history entry when there are no appstate changes > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id1": true, - "id2": true, - }, - "selectedGroupIds": { - "A": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - "selectedGroupIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id1" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [ - "A", - ], - "height": 100, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 0, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - "id2" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [ - "A", - ], - "height": 100, - "index": "a1", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 0, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > singleplayer undo/redo > should not end up with history entry when there are no appstate changes > [end of test] number of elements 1`] = `2`; exports[`history > singleplayer undo/redo > should not end up with history entry when there are no appstate changes > [end of test] number of renders 1`] = `7`; +exports[`history > singleplayer undo/redo > should not end up with history entry when there are no appstate changes > [end of test] redo stack 1`] = `[]`; + +exports[`history > singleplayer undo/redo > should not end up with history entry when there are no appstate changes > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id5": true, + "id6": true, + }, + "selectedGroupIds": { + "A": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + "selectedGroupIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id9", + "removed": { + "id5": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [ + "A", + ], + "height": 100, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 0, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + "id6": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [ + "A", + ], + "height": 100, + "index": "a1", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 0, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, +] +`; + exports[`history > singleplayer undo/redo > should not end up with history entry when there are no elements changes > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -14290,7 +14263,7 @@ exports[`history > singleplayer undo/redo > should not end up with history entry "frameId": null, "groupIds": [], "height": 100, - "id": "id5", + "id": "id11", "index": "a0", "isDeleted": false, "link": null, @@ -14322,7 +14295,7 @@ exports[`history > singleplayer undo/redo > should not end up with history entry "frameId": null, "groupIds": [], "height": 100, - "id": "id6", + "id": "id12", "index": "a1", "isDeleted": false, "link": null, @@ -14344,100 +14317,94 @@ exports[`history > singleplayer undo/redo > should not end up with history entry } `; -exports[`history > singleplayer undo/redo > should not end up with history entry when there are no elements changes > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id5" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 0, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - "id6" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a1", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 0, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > singleplayer undo/redo > should not end up with history entry when there are no elements changes > [end of test] number of elements 1`] = `2`; exports[`history > singleplayer undo/redo > should not end up with history entry when there are no elements changes > [end of test] number of renders 1`] = `5`; +exports[`history > singleplayer undo/redo > should not end up with history entry when there are no elements changes > [end of test] redo stack 1`] = `[]`; + +exports[`history > singleplayer undo/redo > should not end up with history entry when there are no elements changes > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id14", + "removed": { + "id11": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 0, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + "id12": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a1", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 0, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, +] +`; + exports[`history > singleplayer undo/redo > should not override appstate changes when redo stack is not cleared > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -14516,14 +14483,14 @@ exports[`history > singleplayer undo/redo > should not override appstate changes "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id11": true, + "id31": true, }, "resizingElement": null, "scrollX": 0, "scrollY": 0, "searchMatches": [], "selectedElementIds": { - "id11": true, + "id31": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -14561,7 +14528,7 @@ exports[`history > singleplayer undo/redo > should not override appstate changes "frameId": null, "groupIds": [], "height": 10, - "id": "id11", + "id": "id31", "index": "a0", "isDeleted": false, "link": null, @@ -14583,139 +14550,138 @@ exports[`history > singleplayer undo/redo > should not override appstate changes } `; -exports[`history > singleplayer undo/redo > should not override appstate changes when redo stack is not cleared > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id11" => Delta { - "deleted": { - "backgroundColor": "#ffc9c9", - }, - "inserted": { - "backgroundColor": "#a5d8ff", - }, - }, - }, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id11" => Delta { - "deleted": { - "backgroundColor": "transparent", - }, - "inserted": { - "backgroundColor": "#ffc9c9", - }, - }, - }, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id11": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - ], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id11": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id11" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 10, - "x": 10, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > singleplayer undo/redo > should not override appstate changes when redo stack is not cleared > [end of test] number of elements 1`] = `1`; exports[`history > singleplayer undo/redo > should not override appstate changes when redo stack is not cleared > [end of test] number of renders 1`] = `15`; +exports[`history > singleplayer undo/redo > should not override appstate changes when redo stack is not cleared > [end of test] redo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id50", + "removed": {}, + "updated": { + "id31": Delta { + "deleted": { + "backgroundColor": "#ffc9c9", + }, + "inserted": { + "backgroundColor": "#a5d8ff", + }, + }, + }, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id52", + "removed": {}, + "updated": { + "id31": Delta { + "deleted": { + "backgroundColor": "transparent", + }, + "inserted": { + "backgroundColor": "#ffc9c9", + }, + }, + }, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id31": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id54", + "removed": {}, + "updated": {}, + }, + }, +] +`; + +exports[`history > singleplayer undo/redo > should not override appstate changes when redo stack is not cleared > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id31": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id33", + "removed": { + "id31": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 10, + "x": 10, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, +] +`; + exports[`history > singleplayer undo/redo > should support appstate name or viewBackgroundColor change > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -14828,58 +14794,53 @@ exports[`history > singleplayer undo/redo > should support appstate name or view } `; -exports[`history > singleplayer undo/redo > should support appstate name or viewBackgroundColor change > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "name": "New name", - }, - "inserted": { - "name": "Old name", - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "viewBackgroundColor": "#000", - }, - "inserted": { - "viewBackgroundColor": "#FFF", - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > singleplayer undo/redo > should support appstate name or viewBackgroundColor change > [end of test] number of elements 1`] = `0`; exports[`history > singleplayer undo/redo > should support appstate name or viewBackgroundColor change > [end of test] number of renders 1`] = `8`; +exports[`history > singleplayer undo/redo > should support appstate name or viewBackgroundColor change > [end of test] redo stack 1`] = `[]`; + +exports[`history > singleplayer undo/redo > should support appstate name or viewBackgroundColor change > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "name": "New name", + }, + "inserted": { + "name": "Old name", + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id111", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "viewBackgroundColor": "#000", + }, + "inserted": { + "viewBackgroundColor": "#FFF", + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id113", + "removed": {}, + "updated": {}, + }, + }, +] +`; + exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind arrow from non deleted bindable elements on deletion and rebind on undo > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -14958,14 +14919,14 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id50": true, + "id288": true, }, "resizingElement": null, "scrollX": 0, "scrollY": 0, "searchMatches": [], "selectedElementIds": { - "id55": true, + "id301": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -14999,11 +14960,11 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "backgroundColor": "transparent", "boundElements": [ { - "id": "id51", + "id": "id289", "type": "text", }, { - "id": "id55", + "id": "id301", "type": "arrow", }, ], @@ -15012,7 +14973,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 100, - "id": "id50", + "id": "id288", "index": "a0", "isDeleted": false, "link": null, @@ -15040,7 +15001,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id50", + "containerId": "id288", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -15048,7 +15009,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 25, - "id": "id51", + "id": "id289", "index": "a1", "isDeleted": false, "lineHeight": "1.25000", @@ -15081,7 +15042,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "backgroundColor": "transparent", "boundElements": [ { - "id": "id55", + "id": "id301", "type": "arrow", }, ], @@ -15090,7 +15051,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 100, - "id": "id52", + "id": "id290", "index": "a2", "isDeleted": false, "link": null, @@ -15121,7 +15082,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "elbowed": false, "endArrowhead": "arrow", "endBinding": { - "elementId": "id52", + "elementId": "id290", "fixedPoint": null, "focus": 0, "gap": 1, @@ -15130,7 +15091,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 0, - "id": "id55", + "id": "id301", "index": "a3", "isDeleted": false, "lastCommittedPoint": null, @@ -15153,7 +15114,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, "startArrowhead": null, "startBinding": { - "elementId": "id50", + "elementId": "id288", "fixedPoint": null, "focus": 0, "gap": 1, @@ -15170,415 +15131,416 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding } `; -exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind arrow from non deleted bindable elements on deletion and rebind on undo > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id55": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id55" => Delta { - "deleted": { - "isDeleted": false, - "points": [ - [ - 0, - 0, - ], - [ - 100, - 0, - ], - ], - }, - "inserted": { - "isDeleted": true, - "points": [ - [ - 0, - 0, - ], - [ - 100, - 0, - ], - ], - }, - }, - }, - "updated": Map { - "id50" => Delta { - "deleted": { - "boundElements": [ - { - "id": "id55", - "type": "arrow", - }, - ], - }, - "inserted": { - "boundElements": [], - }, - }, - "id52" => Delta { - "deleted": { - "boundElements": [ - { - "id": "id55", - "type": "arrow", - }, - ], - }, - "inserted": { - "boundElements": [], - }, - }, - }, - }, - }, - ], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id50" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": -100, - "y": -50, - }, - "inserted": { - "isDeleted": true, - }, - }, - "id51" => Delta { - "deleted": { - "angle": 0, - "autoResize": true, - "backgroundColor": "transparent", - "boundElements": null, - "containerId": null, - "customData": undefined, - "fillStyle": "solid", - "fontFamily": 5, - "fontSize": 20, - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a1", - "isDeleted": false, - "lineHeight": "1.25000", - "link": null, - "locked": false, - "opacity": 100, - "originalText": "ola", - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "text": "ola", - "textAlign": "left", - "type": "text", - "verticalAlign": "top", - "width": 100, - "x": -200, - "y": -200, - }, - "inserted": { - "isDeleted": true, - }, - }, - "id52" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a2", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 100, - "y": -50, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id50": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id51": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": {}, - }, - "inserted": { - "selectedElementIds": { - "id51": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id50" => Delta { - "deleted": { - "boundElements": [ - { - "id": "id51", - "type": "text", - }, - ], - }, - "inserted": { - "boundElements": [], - }, - }, - "id51" => Delta { - "deleted": { - "containerId": "id50", - "height": 25, - "textAlign": "center", - "verticalAlign": "middle", - "width": 30, - "x": -65, - "y": "-12.50000", - }, - "inserted": { - "containerId": null, - "height": 100, - "textAlign": "left", - "verticalAlign": "top", - "width": 100, - "x": -200, - "y": -200, - }, - }, - }, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id55": true, - }, - "selectedLinearElementId": "id55", - }, - "inserted": { - "selectedElementIds": { - "id50": true, - }, - "selectedLinearElementId": null, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id55" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "elbowed": false, - "endArrowhead": "arrow", - "endBinding": { - "elementId": "id52", - "fixedPoint": null, - "focus": 0, - "gap": 1, - }, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 0, - "index": "a3", - "isDeleted": false, - "lastCommittedPoint": null, - "link": null, - "locked": false, - "opacity": 100, - "points": [ - [ - 0, - 0, - ], - [ - 100, - 0, - ], - ], - "roughness": 1, - "roundness": { - "type": 2, - }, - "startArrowhead": null, - "startBinding": { - "elementId": "id50", - "fixedPoint": null, - "focus": 0, - "gap": 1, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "arrow", - "width": 100, - "x": 0, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map { - "id50" => Delta { - "deleted": { - "boundElements": [ - { - "id": "id55", - "type": "arrow", - }, - ], - }, - "inserted": { - "boundElements": [], - }, - }, - "id52" => Delta { - "deleted": { - "boundElements": [ - { - "id": "id55", - "type": "arrow", - }, - ], - }, - "inserted": { - "boundElements": [], - }, - }, - }, - }, - }, - ], -} -`; - exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind arrow from non deleted bindable elements on deletion and rebind on undo > [end of test] number of elements 1`] = `4`; exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind arrow from non deleted bindable elements on deletion and rebind on undo > [end of test] number of renders 1`] = `12`; +exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind arrow from non deleted bindable elements on deletion and rebind on undo > [end of test] redo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id301": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id307", + "removed": { + "id301": Delta { + "deleted": { + "isDeleted": false, + "points": [ + [ + 0, + 0, + ], + [ + 100, + 0, + ], + ], + }, + "inserted": { + "isDeleted": true, + "points": [ + [ + 0, + 0, + ], + [ + 100, + 0, + ], + ], + }, + }, + }, + "updated": { + "id288": Delta { + "deleted": { + "boundElements": [ + { + "id": "id301", + "type": "arrow", + }, + ], + }, + "inserted": { + "boundElements": [], + }, + }, + "id290": Delta { + "deleted": { + "boundElements": [ + { + "id": "id301", + "type": "arrow", + }, + ], + }, + "inserted": { + "boundElements": [], + }, + }, + }, + }, + }, +] +`; + +exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind arrow from non deleted bindable elements on deletion and rebind on undo > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id292", + "removed": { + "id288": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": -100, + "y": -50, + }, + "inserted": { + "isDeleted": true, + }, + }, + "id289": Delta { + "deleted": { + "angle": 0, + "autoResize": true, + "backgroundColor": "transparent", + "boundElements": null, + "containerId": null, + "customData": undefined, + "fillStyle": "solid", + "fontFamily": 5, + "fontSize": 20, + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a1", + "isDeleted": false, + "lineHeight": "1.25000", + "link": null, + "locked": false, + "opacity": 100, + "originalText": "ola", + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "text": "ola", + "textAlign": "left", + "type": "text", + "verticalAlign": "top", + "width": 100, + "x": -200, + "y": -200, + }, + "inserted": { + "isDeleted": true, + }, + }, + "id290": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a2", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 100, + "y": -50, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id288": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id295", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id289": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id298", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": {}, + }, + "inserted": { + "selectedElementIds": { + "id289": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id300", + "removed": {}, + "updated": { + "id288": Delta { + "deleted": { + "boundElements": [ + { + "id": "id289", + "type": "text", + }, + ], + }, + "inserted": { + "boundElements": [], + }, + }, + "id289": Delta { + "deleted": { + "containerId": "id288", + "height": 25, + "textAlign": "center", + "verticalAlign": "middle", + "width": 30, + "x": -65, + "y": "-12.50000", + }, + "inserted": { + "containerId": null, + "height": 100, + "textAlign": "left", + "verticalAlign": "top", + "width": 100, + "x": -200, + "y": -200, + }, + }, + }, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id301": true, + }, + "selectedLinearElementId": "id301", + }, + "inserted": { + "selectedElementIds": { + "id288": true, + }, + "selectedLinearElementId": null, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id303", + "removed": { + "id301": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "elbowed": false, + "endArrowhead": "arrow", + "endBinding": { + "elementId": "id290", + "fixedPoint": null, + "focus": 0, + "gap": 1, + }, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 0, + "index": "a3", + "isDeleted": false, + "lastCommittedPoint": null, + "link": null, + "locked": false, + "opacity": 100, + "points": [ + [ + 0, + 0, + ], + [ + 100, + 0, + ], + ], + "roughness": 1, + "roundness": { + "type": 2, + }, + "startArrowhead": null, + "startBinding": { + "elementId": "id288", + "fixedPoint": null, + "focus": 0, + "gap": 1, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "arrow", + "width": 100, + "x": 0, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": { + "id288": Delta { + "deleted": { + "boundElements": [ + { + "id": "id301", + "type": "arrow", + }, + ], + }, + "inserted": { + "boundElements": [], + }, + }, + "id290": Delta { + "deleted": { + "boundElements": [ + { + "id": "id301", + "type": "arrow", + }, + ], + }, + "inserted": { + "boundElements": [], + }, + }, + }, + }, + }, +] +`; + exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind arrow from non deleted bindable elements on undo and rebind on redo > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -15657,14 +15619,14 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id44": true, + "id268": true, }, "resizingElement": null, "scrollX": 0, "scrollY": 0, "searchMatches": [], "selectedElementIds": { - "id49": true, + "id281": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -15698,11 +15660,11 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "backgroundColor": "transparent", "boundElements": [ { - "id": "id45", + "id": "id269", "type": "text", }, { - "id": "id49", + "id": "id281", "type": "arrow", }, ], @@ -15711,7 +15673,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 100, - "id": "id44", + "id": "id268", "index": "a0", "isDeleted": false, "link": null, @@ -15739,7 +15701,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id44", + "containerId": "id268", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -15747,7 +15709,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 25, - "id": "id45", + "id": "id269", "index": "a1", "isDeleted": false, "lineHeight": "1.25000", @@ -15780,7 +15742,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "backgroundColor": "transparent", "boundElements": [ { - "id": "id49", + "id": "id281", "type": "arrow", }, ], @@ -15789,7 +15751,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 100, - "id": "id46", + "id": "id270", "index": "a2", "isDeleted": false, "link": null, @@ -15820,7 +15782,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "elbowed": false, "endArrowhead": "arrow", "endBinding": { - "elementId": "id46", + "elementId": "id270", "fixedPoint": null, "focus": 0, "gap": 1, @@ -15829,7 +15791,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 0, - "id": "id49", + "id": "id281", "index": "a3", "isDeleted": false, "lastCommittedPoint": null, @@ -15852,7 +15814,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, "startArrowhead": null, "startBinding": { - "elementId": "id44", + "elementId": "id268", "fixedPoint": null, "focus": 0, "gap": 1, @@ -15869,339 +15831,337 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding } `; -exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind arrow from non deleted bindable elements on undo and rebind on redo > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id44" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": -100, - "y": -50, - }, - "inserted": { - "isDeleted": true, - }, - }, - "id45" => Delta { - "deleted": { - "angle": 0, - "autoResize": true, - "backgroundColor": "transparent", - "boundElements": null, - "containerId": null, - "customData": undefined, - "fillStyle": "solid", - "fontFamily": 5, - "fontSize": 20, - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a1", - "isDeleted": false, - "lineHeight": "1.25000", - "link": null, - "locked": false, - "opacity": 100, - "originalText": "ola", - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "text": "ola", - "textAlign": "left", - "type": "text", - "verticalAlign": "top", - "width": 100, - "x": -200, - "y": -200, - }, - "inserted": { - "isDeleted": true, - }, - }, - "id46" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a2", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 100, - "y": -50, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id44": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id45": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": {}, - }, - "inserted": { - "selectedElementIds": { - "id45": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id44" => Delta { - "deleted": { - "boundElements": [ - { - "id": "id45", - "type": "text", - }, - ], - }, - "inserted": { - "boundElements": [], - }, - }, - "id45" => Delta { - "deleted": { - "containerId": "id44", - "height": 25, - "textAlign": "center", - "verticalAlign": "middle", - "width": 30, - "x": -65, - "y": "-12.50000", - }, - "inserted": { - "containerId": null, - "height": 100, - "textAlign": "left", - "verticalAlign": "top", - "width": 100, - "x": -200, - "y": -200, - }, - }, - }, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id49": true, - }, - "selectedLinearElementId": "id49", - }, - "inserted": { - "selectedElementIds": { - "id44": true, - }, - "selectedLinearElementId": null, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id49" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "elbowed": false, - "endArrowhead": "arrow", - "endBinding": { - "elementId": "id46", - "fixedPoint": null, - "focus": 0, - "gap": 1, - }, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 0, - "index": "a3", - "isDeleted": false, - "lastCommittedPoint": null, - "link": null, - "locked": false, - "opacity": 100, - "points": [ - [ - 0, - 0, - ], - [ - 100, - 0, - ], - ], - "roughness": 1, - "roundness": { - "type": 2, - }, - "startArrowhead": null, - "startBinding": { - "elementId": "id44", - "fixedPoint": null, - "focus": 0, - "gap": 1, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "arrow", - "width": 100, - "x": 0, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map { - "id44" => Delta { - "deleted": { - "boundElements": [ - { - "id": "id49", - "type": "arrow", - }, - ], - }, - "inserted": { - "boundElements": [], - }, - }, - "id46" => Delta { - "deleted": { - "boundElements": [ - { - "id": "id49", - "type": "arrow", - }, - ], - }, - "inserted": { - "boundElements": [], - }, - }, - }, - }, - }, - ], -} -`; - exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind arrow from non deleted bindable elements on undo and rebind on redo > [end of test] number of elements 1`] = `4`; exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind arrow from non deleted bindable elements on undo and rebind on redo > [end of test] number of renders 1`] = `12`; +exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind arrow from non deleted bindable elements on undo and rebind on redo > [end of test] redo stack 1`] = `[]`; + +exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind arrow from non deleted bindable elements on undo and rebind on redo > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id272", + "removed": { + "id268": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": -100, + "y": -50, + }, + "inserted": { + "isDeleted": true, + }, + }, + "id269": Delta { + "deleted": { + "angle": 0, + "autoResize": true, + "backgroundColor": "transparent", + "boundElements": null, + "containerId": null, + "customData": undefined, + "fillStyle": "solid", + "fontFamily": 5, + "fontSize": 20, + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a1", + "isDeleted": false, + "lineHeight": "1.25000", + "link": null, + "locked": false, + "opacity": 100, + "originalText": "ola", + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "text": "ola", + "textAlign": "left", + "type": "text", + "verticalAlign": "top", + "width": 100, + "x": -200, + "y": -200, + }, + "inserted": { + "isDeleted": true, + }, + }, + "id270": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a2", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 100, + "y": -50, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id268": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id275", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id269": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id278", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": {}, + }, + "inserted": { + "selectedElementIds": { + "id269": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id280", + "removed": {}, + "updated": { + "id268": Delta { + "deleted": { + "boundElements": [ + { + "id": "id269", + "type": "text", + }, + ], + }, + "inserted": { + "boundElements": [], + }, + }, + "id269": Delta { + "deleted": { + "containerId": "id268", + "height": 25, + "textAlign": "center", + "verticalAlign": "middle", + "width": 30, + "x": -65, + "y": "-12.50000", + }, + "inserted": { + "containerId": null, + "height": 100, + "textAlign": "left", + "verticalAlign": "top", + "width": 100, + "x": -200, + "y": -200, + }, + }, + }, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id281": true, + }, + "selectedLinearElementId": "id281", + }, + "inserted": { + "selectedElementIds": { + "id268": true, + }, + "selectedLinearElementId": null, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id287", + "removed": { + "id281": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "elbowed": false, + "endArrowhead": "arrow", + "endBinding": { + "elementId": "id270", + "fixedPoint": null, + "focus": 0, + "gap": 1, + }, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 0, + "index": "a3", + "isDeleted": false, + "lastCommittedPoint": null, + "link": null, + "locked": false, + "opacity": 100, + "points": [ + [ + 0, + 0, + ], + [ + 100, + 0, + ], + ], + "roughness": 1, + "roundness": { + "type": 2, + }, + "startArrowhead": null, + "startBinding": { + "elementId": "id268", + "fixedPoint": null, + "focus": 0, + "gap": 1, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "arrow", + "width": 100, + "x": 0, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": { + "id268": Delta { + "deleted": { + "boundElements": [ + { + "id": "id281", + "type": "arrow", + }, + ], + }, + "inserted": { + "boundElements": [], + }, + }, + "id270": Delta { + "deleted": { + "boundElements": [ + { + "id": "id281", + "type": "arrow", + }, + ], + }, + "inserted": { + "boundElements": [], + }, + }, + }, + }, + }, +] +`; + exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind everything from non deleted elements when iterating through the whole undo stack and vice versa rebind everything on redo > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -16280,14 +16240,14 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id56": true, + "id308": true, }, "resizingElement": null, "scrollX": 0, "scrollY": 0, "searchMatches": [], "selectedElementIds": { - "id61": true, + "id321": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -16321,11 +16281,11 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "backgroundColor": "transparent", "boundElements": [ { - "id": "id57", + "id": "id309", "type": "text", }, { - "id": "id61", + "id": "id321", "type": "arrow", }, ], @@ -16334,7 +16294,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 100, - "id": "id56", + "id": "id308", "index": "a0", "isDeleted": false, "link": null, @@ -16362,7 +16322,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id56", + "containerId": "id308", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -16370,7 +16330,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 25, - "id": "id57", + "id": "id309", "index": "a1", "isDeleted": false, "lineHeight": "1.25000", @@ -16403,7 +16363,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "backgroundColor": "transparent", "boundElements": [ { - "id": "id61", + "id": "id321", "type": "arrow", }, ], @@ -16412,7 +16372,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 100, - "id": "id58", + "id": "id310", "index": "a2", "isDeleted": false, "link": null, @@ -16443,7 +16403,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "elbowed": false, "endArrowhead": "arrow", "endBinding": { - "elementId": "id58", + "elementId": "id310", "fixedPoint": null, "focus": 0, "gap": 1, @@ -16452,7 +16412,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 0, - "id": "id61", + "id": "id321", "index": "a3", "isDeleted": false, "lastCommittedPoint": null, @@ -16475,7 +16435,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, "startArrowhead": null, "startBinding": { - "elementId": "id56", + "elementId": "id308", "fixedPoint": null, "focus": 0, "gap": 1, @@ -16492,339 +16452,337 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding } `; -exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind everything from non deleted elements when iterating through the whole undo stack and vice versa rebind everything on redo > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id56" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": -100, - "y": -50, - }, - "inserted": { - "isDeleted": true, - }, - }, - "id57" => Delta { - "deleted": { - "angle": 0, - "autoResize": true, - "backgroundColor": "transparent", - "boundElements": null, - "containerId": null, - "customData": undefined, - "fillStyle": "solid", - "fontFamily": 5, - "fontSize": 20, - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a1", - "isDeleted": false, - "lineHeight": "1.25000", - "link": null, - "locked": false, - "opacity": 100, - "originalText": "ola", - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "text": "ola", - "textAlign": "left", - "type": "text", - "verticalAlign": "top", - "width": 100, - "x": -200, - "y": -200, - }, - "inserted": { - "isDeleted": true, - }, - }, - "id58" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a2", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 100, - "y": -50, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id56": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id57": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": {}, - }, - "inserted": { - "selectedElementIds": { - "id57": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id56" => Delta { - "deleted": { - "boundElements": [ - { - "id": "id57", - "type": "text", - }, - ], - }, - "inserted": { - "boundElements": [], - }, - }, - "id57" => Delta { - "deleted": { - "containerId": "id56", - "height": 25, - "textAlign": "center", - "verticalAlign": "middle", - "width": 30, - "x": -65, - "y": "-12.50000", - }, - "inserted": { - "containerId": null, - "height": 100, - "textAlign": "left", - "verticalAlign": "top", - "width": 100, - "x": -200, - "y": -200, - }, - }, - }, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id61": true, - }, - "selectedLinearElementId": "id61", - }, - "inserted": { - "selectedElementIds": { - "id56": true, - }, - "selectedLinearElementId": null, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id61" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "elbowed": false, - "endArrowhead": "arrow", - "endBinding": { - "elementId": "id58", - "fixedPoint": null, - "focus": 0, - "gap": 1, - }, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 0, - "index": "a3", - "isDeleted": false, - "lastCommittedPoint": null, - "link": null, - "locked": false, - "opacity": 100, - "points": [ - [ - 0, - 0, - ], - [ - 100, - 0, - ], - ], - "roughness": 1, - "roundness": { - "type": 2, - }, - "startArrowhead": null, - "startBinding": { - "elementId": "id56", - "fixedPoint": null, - "focus": 0, - "gap": 1, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "arrow", - "width": 100, - "x": 0, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map { - "id56" => Delta { - "deleted": { - "boundElements": [ - { - "id": "id61", - "type": "arrow", - }, - ], - }, - "inserted": { - "boundElements": [], - }, - }, - "id58" => Delta { - "deleted": { - "boundElements": [ - { - "id": "id61", - "type": "arrow", - }, - ], - }, - "inserted": { - "boundElements": [], - }, - }, - }, - }, - }, - ], -} -`; - exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind everything from non deleted elements when iterating through the whole undo stack and vice versa rebind everything on redo > [end of test] number of elements 1`] = `4`; exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind everything from non deleted elements when iterating through the whole undo stack and vice versa rebind everything on redo > [end of test] number of renders 1`] = `20`; +exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind everything from non deleted elements when iterating through the whole undo stack and vice versa rebind everything on redo > [end of test] redo stack 1`] = `[]`; + +exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind everything from non deleted elements when iterating through the whole undo stack and vice versa rebind everything on redo > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id335", + "removed": { + "id308": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": -100, + "y": -50, + }, + "inserted": { + "isDeleted": true, + }, + }, + "id309": Delta { + "deleted": { + "angle": 0, + "autoResize": true, + "backgroundColor": "transparent", + "boundElements": null, + "containerId": null, + "customData": undefined, + "fillStyle": "solid", + "fontFamily": 5, + "fontSize": 20, + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a1", + "isDeleted": false, + "lineHeight": "1.25000", + "link": null, + "locked": false, + "opacity": 100, + "originalText": "ola", + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "text": "ola", + "textAlign": "left", + "type": "text", + "verticalAlign": "top", + "width": 100, + "x": -200, + "y": -200, + }, + "inserted": { + "isDeleted": true, + }, + }, + "id310": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a2", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 100, + "y": -50, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id308": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id337", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id309": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id339", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": {}, + }, + "inserted": { + "selectedElementIds": { + "id309": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id341", + "removed": {}, + "updated": { + "id308": Delta { + "deleted": { + "boundElements": [ + { + "id": "id309", + "type": "text", + }, + ], + }, + "inserted": { + "boundElements": [], + }, + }, + "id309": Delta { + "deleted": { + "containerId": "id308", + "height": 25, + "textAlign": "center", + "verticalAlign": "middle", + "width": 30, + "x": -65, + "y": "-12.50000", + }, + "inserted": { + "containerId": null, + "height": 100, + "textAlign": "left", + "verticalAlign": "top", + "width": 100, + "x": -200, + "y": -200, + }, + }, + }, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id321": true, + }, + "selectedLinearElementId": "id321", + }, + "inserted": { + "selectedElementIds": { + "id308": true, + }, + "selectedLinearElementId": null, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id343", + "removed": { + "id321": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "elbowed": false, + "endArrowhead": "arrow", + "endBinding": { + "elementId": "id310", + "fixedPoint": null, + "focus": 0, + "gap": 1, + }, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 0, + "index": "a3", + "isDeleted": false, + "lastCommittedPoint": null, + "link": null, + "locked": false, + "opacity": 100, + "points": [ + [ + 0, + 0, + ], + [ + 100, + 0, + ], + ], + "roughness": 1, + "roundness": { + "type": 2, + }, + "startArrowhead": null, + "startBinding": { + "elementId": "id308", + "fixedPoint": null, + "focus": 0, + "gap": 1, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "arrow", + "width": 100, + "x": 0, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": { + "id308": Delta { + "deleted": { + "boundElements": [ + { + "id": "id321", + "type": "arrow", + }, + ], + }, + "inserted": { + "boundElements": [], + }, + }, + "id310": Delta { + "deleted": { + "boundElements": [ + { + "id": "id321", + "type": "arrow", + }, + ], + }, + "inserted": { + "boundElements": [], + }, + }, + }, + }, + }, +] +`; + exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind rectangle from arrow on deletion and rebind on undo > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -16908,7 +16866,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "scrollY": 0, "searchMatches": [], "selectedElementIds": { - "id62": true, + "id344": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -16942,11 +16900,11 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "backgroundColor": "transparent", "boundElements": [ { - "id": "id67", + "id": "id357", "type": "arrow", }, { - "id": "id63", + "id": "id345", "type": "text", }, ], @@ -16955,7 +16913,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 100, - "id": "id62", + "id": "id344", "index": "a0", "isDeleted": false, "link": null, @@ -16983,7 +16941,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id62", + "containerId": "id344", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -16991,7 +16949,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 25, - "id": "id63", + "id": "id345", "index": "a1", "isDeleted": false, "lineHeight": "1.25000", @@ -17024,7 +16982,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "backgroundColor": "transparent", "boundElements": [ { - "id": "id67", + "id": "id357", "type": "arrow", }, ], @@ -17033,7 +16991,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 100, - "id": "id64", + "id": "id346", "index": "a2", "isDeleted": false, "link": null, @@ -17064,7 +17022,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "elbowed": false, "endArrowhead": "arrow", "endBinding": { - "elementId": "id64", + "elementId": "id346", "fixedPoint": null, "focus": 0, "gap": 1, @@ -17073,7 +17031,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 0, - "id": "id67", + "id": "id357", "index": "a3", "isDeleted": false, "lastCommittedPoint": null, @@ -17096,7 +17054,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, "startArrowhead": null, "startBinding": { - "elementId": "id62", + "elementId": "id344", "fixedPoint": null, "focus": 0, "gap": 1, @@ -17113,433 +17071,435 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding } `; -exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind rectangle from arrow on deletion and rebind on undo > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id62": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id62" => Delta { - "deleted": { - "isDeleted": false, - }, - "inserted": { - "isDeleted": true, - }, - }, - "id63" => Delta { - "deleted": { - "isDeleted": false, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map { - "id67" => Delta { - "deleted": { - "points": [ - [ - 0, - 0, - ], - [ - 100, - 0, - ], - ], - "startBinding": { - "elementId": "id62", - "fixedPoint": null, - "focus": 0, - "gap": 1, - }, - }, - "inserted": { - "points": [ - [ - 0, - 0, - ], - [ - 100, - 0, - ], - ], - "startBinding": null, - }, - }, - }, - }, - }, - ], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id62" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": -100, - "y": -50, - }, - "inserted": { - "isDeleted": true, - }, - }, - "id63" => Delta { - "deleted": { - "angle": 0, - "autoResize": true, - "backgroundColor": "transparent", - "boundElements": null, - "containerId": null, - "customData": undefined, - "fillStyle": "solid", - "fontFamily": 5, - "fontSize": 20, - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a1", - "isDeleted": false, - "lineHeight": "1.25000", - "link": null, - "locked": false, - "opacity": 100, - "originalText": "ola", - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "text": "ola", - "textAlign": "left", - "type": "text", - "verticalAlign": "top", - "width": 100, - "x": -200, - "y": -200, - }, - "inserted": { - "isDeleted": true, - }, - }, - "id64" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a2", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 100, - "y": -50, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id62": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id63": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": {}, - }, - "inserted": { - "selectedElementIds": { - "id63": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id62" => Delta { - "deleted": { - "boundElements": [ - { - "id": "id63", - "type": "text", - }, - ], - }, - "inserted": { - "boundElements": [], - }, - }, - "id63" => Delta { - "deleted": { - "containerId": "id62", - "height": 25, - "textAlign": "center", - "verticalAlign": "middle", - "width": 30, - "x": -65, - "y": "-12.50000", - }, - "inserted": { - "containerId": null, - "height": 100, - "textAlign": "left", - "verticalAlign": "top", - "width": 100, - "x": -200, - "y": -200, - }, - }, - }, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id67": true, - }, - "selectedLinearElementId": "id67", - }, - "inserted": { - "selectedElementIds": { - "id62": true, - }, - "selectedLinearElementId": null, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id67" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "elbowed": false, - "endArrowhead": "arrow", - "endBinding": { - "elementId": "id64", - "fixedPoint": null, - "focus": 0, - "gap": 1, - }, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 0, - "index": "a3", - "isDeleted": false, - "lastCommittedPoint": null, - "link": null, - "locked": false, - "opacity": 100, - "points": [ - [ - 0, - 0, - ], - [ - 100, - 0, - ], - ], - "roughness": 1, - "roundness": { - "type": 2, - }, - "startArrowhead": null, - "startBinding": { - "elementId": "id62", - "fixedPoint": null, - "focus": 0, - "gap": 1, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "arrow", - "width": 100, - "x": 0, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map { - "id62" => Delta { - "deleted": { - "boundElements": [ - { - "id": "id67", - "type": "arrow", - }, - ], - }, - "inserted": { - "boundElements": [], - }, - }, - "id64" => Delta { - "deleted": { - "boundElements": [ - { - "id": "id67", - "type": "arrow", - }, - ], - }, - "inserted": { - "boundElements": [], - }, - }, - }, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id62": true, - }, - "selectedLinearElementId": null, - }, - "inserted": { - "selectedElementIds": { - "id67": true, - }, - "selectedLinearElementId": "id67", - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind rectangle from arrow on deletion and rebind on undo > [end of test] number of elements 1`] = `4`; exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind rectangle from arrow on deletion and rebind on undo > [end of test] number of renders 1`] = `14`; +exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind rectangle from arrow on deletion and rebind on undo > [end of test] redo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id344": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id366", + "removed": { + "id344": Delta { + "deleted": { + "isDeleted": false, + }, + "inserted": { + "isDeleted": true, + }, + }, + "id345": Delta { + "deleted": { + "isDeleted": false, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": { + "id357": Delta { + "deleted": { + "points": [ + [ + 0, + 0, + ], + [ + 100, + 0, + ], + ], + "startBinding": { + "elementId": "id344", + "fixedPoint": null, + "focus": 0, + "gap": 1, + }, + }, + "inserted": { + "points": [ + [ + 0, + 0, + ], + [ + 100, + 0, + ], + ], + "startBinding": null, + }, + }, + }, + }, + }, +] +`; + +exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind rectangle from arrow on deletion and rebind on undo > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id348", + "removed": { + "id344": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": -100, + "y": -50, + }, + "inserted": { + "isDeleted": true, + }, + }, + "id345": Delta { + "deleted": { + "angle": 0, + "autoResize": true, + "backgroundColor": "transparent", + "boundElements": null, + "containerId": null, + "customData": undefined, + "fillStyle": "solid", + "fontFamily": 5, + "fontSize": 20, + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a1", + "isDeleted": false, + "lineHeight": "1.25000", + "link": null, + "locked": false, + "opacity": 100, + "originalText": "ola", + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "text": "ola", + "textAlign": "left", + "type": "text", + "verticalAlign": "top", + "width": 100, + "x": -200, + "y": -200, + }, + "inserted": { + "isDeleted": true, + }, + }, + "id346": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a2", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 100, + "y": -50, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id344": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id351", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id345": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id354", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": {}, + }, + "inserted": { + "selectedElementIds": { + "id345": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id356", + "removed": {}, + "updated": { + "id344": Delta { + "deleted": { + "boundElements": [ + { + "id": "id345", + "type": "text", + }, + ], + }, + "inserted": { + "boundElements": [], + }, + }, + "id345": Delta { + "deleted": { + "containerId": "id344", + "height": 25, + "textAlign": "center", + "verticalAlign": "middle", + "width": 30, + "x": -65, + "y": "-12.50000", + }, + "inserted": { + "containerId": null, + "height": 100, + "textAlign": "left", + "verticalAlign": "top", + "width": 100, + "x": -200, + "y": -200, + }, + }, + }, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id357": true, + }, + "selectedLinearElementId": "id357", + }, + "inserted": { + "selectedElementIds": { + "id344": true, + }, + "selectedLinearElementId": null, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id359", + "removed": { + "id357": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "elbowed": false, + "endArrowhead": "arrow", + "endBinding": { + "elementId": "id346", + "fixedPoint": null, + "focus": 0, + "gap": 1, + }, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 0, + "index": "a3", + "isDeleted": false, + "lastCommittedPoint": null, + "link": null, + "locked": false, + "opacity": 100, + "points": [ + [ + 0, + 0, + ], + [ + 100, + 0, + ], + ], + "roughness": 1, + "roundness": { + "type": 2, + }, + "startArrowhead": null, + "startBinding": { + "elementId": "id344", + "fixedPoint": null, + "focus": 0, + "gap": 1, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "arrow", + "width": 100, + "x": 0, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": { + "id344": Delta { + "deleted": { + "boundElements": [ + { + "id": "id357", + "type": "arrow", + }, + ], + }, + "inserted": { + "boundElements": [], + }, + }, + "id346": Delta { + "deleted": { + "boundElements": [ + { + "id": "id357", + "type": "arrow", + }, + ], + }, + "inserted": { + "boundElements": [], + }, + }, + }, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id344": true, + }, + "selectedLinearElementId": null, + }, + "inserted": { + "selectedElementIds": { + "id357": true, + }, + "selectedLinearElementId": "id357", + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id362", + "removed": {}, + "updated": {}, + }, + }, +] +`; + exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind rectangles from arrow on deletion and rebind on undo > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -17618,15 +17578,15 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id69": true, + "id367": true, }, "resizingElement": null, "scrollX": 0, "scrollY": 0, "searchMatches": [], "selectedElementIds": { - "id69": true, - "id71": true, + "id367": true, + "id369": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -17660,11 +17620,11 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "backgroundColor": "transparent", "boundElements": [ { - "id": "id74", + "id": "id380", "type": "arrow", }, { - "id": "id70", + "id": "id368", "type": "text", }, ], @@ -17673,7 +17633,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 100, - "id": "id69", + "id": "id367", "index": "a0", "isDeleted": false, "link": null, @@ -17701,7 +17661,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id69", + "containerId": "id367", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -17709,7 +17669,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 25, - "id": "id70", + "id": "id368", "index": "a1", "isDeleted": false, "lineHeight": "1.25000", @@ -17742,7 +17702,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "backgroundColor": "transparent", "boundElements": [ { - "id": "id74", + "id": "id380", "type": "arrow", }, ], @@ -17751,7 +17711,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 100, - "id": "id71", + "id": "id369", "index": "a2", "isDeleted": false, "link": null, @@ -17782,7 +17742,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "elbowed": false, "endArrowhead": "arrow", "endBinding": { - "elementId": "id71", + "elementId": "id369", "fixedPoint": null, "focus": 0, "gap": 1, @@ -17791,7 +17751,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 0, - "id": "id74", + "id": "id380", "index": "a3", "isDeleted": false, "lastCommittedPoint": null, @@ -17814,7 +17774,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, "startArrowhead": null, "startBinding": { - "elementId": "id69", + "elementId": "id367", "fixedPoint": null, "focus": 0, "gap": 1, @@ -17831,468 +17791,471 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding } `; -exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind rectangles from arrow on deletion and rebind on undo > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id69": true, - "id71": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id69" => Delta { - "deleted": { - "isDeleted": false, - }, - "inserted": { - "isDeleted": true, - }, - }, - "id70" => Delta { - "deleted": { - "isDeleted": false, - }, - "inserted": { - "isDeleted": true, - }, - }, - "id71" => Delta { - "deleted": { - "isDeleted": false, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map { - "id74" => Delta { - "deleted": { - "endBinding": { - "elementId": "id71", - "fixedPoint": null, - "focus": 0, - "gap": 1, - }, - "points": [ - [ - 0, - 0, - ], - [ - 100, - 0, - ], - ], - "startBinding": { - "elementId": "id69", - "fixedPoint": null, - "focus": 0, - "gap": 1, - }, - }, - "inserted": { - "endBinding": null, - "points": [ - [ - 0, - 0, - ], - [ - 100, - 0, - ], - ], - "startBinding": null, - }, - }, - }, - }, - }, - ], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id69" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": -100, - "y": -50, - }, - "inserted": { - "isDeleted": true, - }, - }, - "id70" => Delta { - "deleted": { - "angle": 0, - "autoResize": true, - "backgroundColor": "transparent", - "boundElements": null, - "containerId": null, - "customData": undefined, - "fillStyle": "solid", - "fontFamily": 5, - "fontSize": 20, - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a1", - "isDeleted": false, - "lineHeight": "1.25000", - "link": null, - "locked": false, - "opacity": 100, - "originalText": "ola", - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "text": "ola", - "textAlign": "left", - "type": "text", - "verticalAlign": "top", - "width": 100, - "x": -200, - "y": -200, - }, - "inserted": { - "isDeleted": true, - }, - }, - "id71" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "index": "a2", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 100, - "y": -50, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id69": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id70": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": {}, - }, - "inserted": { - "selectedElementIds": { - "id70": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id69" => Delta { - "deleted": { - "boundElements": [ - { - "id": "id70", - "type": "text", - }, - ], - }, - "inserted": { - "boundElements": [], - }, - }, - "id70" => Delta { - "deleted": { - "containerId": "id69", - "height": 25, - "textAlign": "center", - "verticalAlign": "middle", - "width": 30, - "x": -65, - "y": "-12.50000", - }, - "inserted": { - "containerId": null, - "height": 100, - "textAlign": "left", - "verticalAlign": "top", - "width": 100, - "x": -200, - "y": -200, - }, - }, - }, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id74": true, - }, - "selectedLinearElementId": "id74", - }, - "inserted": { - "selectedElementIds": { - "id69": true, - }, - "selectedLinearElementId": null, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id74" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "elbowed": false, - "endArrowhead": "arrow", - "endBinding": { - "elementId": "id71", - "fixedPoint": null, - "focus": 0, - "gap": 1, - }, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 0, - "index": "a3", - "isDeleted": false, - "lastCommittedPoint": null, - "link": null, - "locked": false, - "opacity": 100, - "points": [ - [ - 0, - 0, - ], - [ - 100, - 0, - ], - ], - "roughness": 1, - "roundness": { - "type": 2, - }, - "startArrowhead": null, - "startBinding": { - "elementId": "id69", - "fixedPoint": null, - "focus": 0, - "gap": 1, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "arrow", - "width": 100, - "x": 0, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map { - "id69" => Delta { - "deleted": { - "boundElements": [ - { - "id": "id74", - "type": "arrow", - }, - ], - }, - "inserted": { - "boundElements": [], - }, - }, - "id71" => Delta { - "deleted": { - "boundElements": [ - { - "id": "id74", - "type": "arrow", - }, - ], - }, - "inserted": { - "boundElements": [], - }, - }, - }, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id69": true, - }, - "selectedLinearElementId": null, - }, - "inserted": { - "selectedElementIds": { - "id74": true, - }, - "selectedLinearElementId": "id74", - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id71": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind rectangles from arrow on deletion and rebind on undo > [end of test] number of elements 1`] = `4`; exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind rectangles from arrow on deletion and rebind on undo > [end of test] number of renders 1`] = `15`; +exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind rectangles from arrow on deletion and rebind on undo > [end of test] redo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id367": true, + "id369": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id392", + "removed": { + "id367": Delta { + "deleted": { + "isDeleted": false, + }, + "inserted": { + "isDeleted": true, + }, + }, + "id368": Delta { + "deleted": { + "isDeleted": false, + }, + "inserted": { + "isDeleted": true, + }, + }, + "id369": Delta { + "deleted": { + "isDeleted": false, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": { + "id380": Delta { + "deleted": { + "endBinding": { + "elementId": "id369", + "fixedPoint": null, + "focus": 0, + "gap": 1, + }, + "points": [ + [ + 0, + 0, + ], + [ + 100, + 0, + ], + ], + "startBinding": { + "elementId": "id367", + "fixedPoint": null, + "focus": 0, + "gap": 1, + }, + }, + "inserted": { + "endBinding": null, + "points": [ + [ + 0, + 0, + ], + [ + 100, + 0, + ], + ], + "startBinding": null, + }, + }, + }, + }, + }, +] +`; + +exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind rectangles from arrow on deletion and rebind on undo > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id371", + "removed": { + "id367": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": -100, + "y": -50, + }, + "inserted": { + "isDeleted": true, + }, + }, + "id368": Delta { + "deleted": { + "angle": 0, + "autoResize": true, + "backgroundColor": "transparent", + "boundElements": null, + "containerId": null, + "customData": undefined, + "fillStyle": "solid", + "fontFamily": 5, + "fontSize": 20, + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a1", + "isDeleted": false, + "lineHeight": "1.25000", + "link": null, + "locked": false, + "opacity": 100, + "originalText": "ola", + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "text": "ola", + "textAlign": "left", + "type": "text", + "verticalAlign": "top", + "width": 100, + "x": -200, + "y": -200, + }, + "inserted": { + "isDeleted": true, + }, + }, + "id369": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "index": "a2", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 100, + "y": -50, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id367": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id374", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id368": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id377", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": {}, + }, + "inserted": { + "selectedElementIds": { + "id368": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id379", + "removed": {}, + "updated": { + "id367": Delta { + "deleted": { + "boundElements": [ + { + "id": "id368", + "type": "text", + }, + ], + }, + "inserted": { + "boundElements": [], + }, + }, + "id368": Delta { + "deleted": { + "containerId": "id367", + "height": 25, + "textAlign": "center", + "verticalAlign": "middle", + "width": 30, + "x": -65, + "y": "-12.50000", + }, + "inserted": { + "containerId": null, + "height": 100, + "textAlign": "left", + "verticalAlign": "top", + "width": 100, + "x": -200, + "y": -200, + }, + }, + }, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id380": true, + }, + "selectedLinearElementId": "id380", + }, + "inserted": { + "selectedElementIds": { + "id367": true, + }, + "selectedLinearElementId": null, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id382", + "removed": { + "id380": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "elbowed": false, + "endArrowhead": "arrow", + "endBinding": { + "elementId": "id369", + "fixedPoint": null, + "focus": 0, + "gap": 1, + }, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 0, + "index": "a3", + "isDeleted": false, + "lastCommittedPoint": null, + "link": null, + "locked": false, + "opacity": 100, + "points": [ + [ + 0, + 0, + ], + [ + 100, + 0, + ], + ], + "roughness": 1, + "roundness": { + "type": 2, + }, + "startArrowhead": null, + "startBinding": { + "elementId": "id367", + "fixedPoint": null, + "focus": 0, + "gap": 1, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "arrow", + "width": 100, + "x": 0, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": { + "id367": Delta { + "deleted": { + "boundElements": [ + { + "id": "id380", + "type": "arrow", + }, + ], + }, + "inserted": { + "boundElements": [], + }, + }, + "id369": Delta { + "deleted": { + "boundElements": [ + { + "id": "id380", + "type": "arrow", + }, + ], + }, + "inserted": { + "boundElements": [], + }, + }, + }, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id367": true, + }, + "selectedLinearElementId": null, + }, + "inserted": { + "selectedElementIds": { + "id380": true, + }, + "selectedLinearElementId": "id380", + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id385", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id369": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id388", + "removed": {}, + "updated": {}, + }, + }, +] +`; + exports[`history > singleplayer undo/redo > should support changes in elements' order > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -18371,15 +18334,15 @@ exports[`history > singleplayer undo/redo > should support changes in elements' "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id39": true, + "id241": true, }, "resizingElement": null, "scrollX": 0, "scrollY": 0, "searchMatches": [], "selectedElementIds": { - "id39": true, - "id41": true, + "id241": true, + "id247": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -18417,7 +18380,7 @@ exports[`history > singleplayer undo/redo > should support changes in elements' "frameId": null, "groupIds": [], "height": 10, - "id": "id40", + "id": "id244", "index": "a1", "isDeleted": false, "link": null, @@ -18449,7 +18412,7 @@ exports[`history > singleplayer undo/redo > should support changes in elements' "frameId": null, "groupIds": [], "height": 10, - "id": "id39", + "id": "id241", "index": "a2", "isDeleted": false, "link": null, @@ -18481,7 +18444,7 @@ exports[`history > singleplayer undo/redo > should support changes in elements' "frameId": null, "groupIds": [], "height": 10, - "id": "id41", + "id": "id247", "index": "a3", "isDeleted": false, "link": null, @@ -18503,273 +18466,273 @@ exports[`history > singleplayer undo/redo > should support changes in elements' } `; -exports[`history > singleplayer undo/redo > should support changes in elements' order > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id39": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id39" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 10, - "x": 10, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id40": true, - }, - }, - "inserted": { - "selectedElementIds": { - "id39": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id40" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a1", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 10, - "x": 20, - "y": 20, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id41": true, - }, - }, - "inserted": { - "selectedElementIds": { - "id40": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id41" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a2", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 10, - "x": 40, - "y": 40, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id41" => Delta { - "deleted": { - "index": "a0V", - }, - "inserted": { - "index": "a2", - }, - }, - }, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id39": true, - }, - }, - "inserted": { - "selectedElementIds": { - "id41": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id41": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id39" => Delta { - "deleted": { - "index": "a2", - }, - "inserted": { - "index": "Zz", - }, - }, - "id41" => Delta { - "deleted": { - "index": "a3", - }, - "inserted": { - "index": "a0", - }, - }, - }, - }, - }, - ], -} -`; - exports[`history > singleplayer undo/redo > should support changes in elements' order > [end of test] number of elements 1`] = `3`; exports[`history > singleplayer undo/redo > should support changes in elements' order > [end of test] number of renders 1`] = `20`; +exports[`history > singleplayer undo/redo > should support changes in elements' order > [end of test] redo stack 1`] = `[]`; + +exports[`history > singleplayer undo/redo > should support changes in elements' order > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id241": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id243", + "removed": { + "id241": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 10, + "x": 10, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id244": true, + }, + }, + "inserted": { + "selectedElementIds": { + "id241": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id246", + "removed": { + "id244": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a1", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 10, + "x": 20, + "y": 20, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id247": true, + }, + }, + "inserted": { + "selectedElementIds": { + "id244": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id249", + "removed": { + "id247": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a2", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 10, + "x": 40, + "y": 40, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id255", + "removed": {}, + "updated": { + "id247": Delta { + "deleted": { + "index": "a0V", + }, + "inserted": { + "index": "a2", + }, + }, + }, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id241": true, + }, + }, + "inserted": { + "selectedElementIds": { + "id247": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id258", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id247": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id261", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id267", + "removed": {}, + "updated": { + "id241": Delta { + "deleted": { + "index": "a2", + }, + "inserted": { + "index": "Zz", + }, + }, + "id247": Delta { + "deleted": { + "index": "a3", + }, + "inserted": { + "index": "a0", + }, + }, + }, + }, + }, +] +`; + exports[`history > singleplayer undo/redo > should support duplication of groups, appstate group selection and editing group > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -18848,15 +18811,15 @@ exports[`history > singleplayer undo/redo > should support duplication of groups "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id36": true, + "id210": true, }, "resizingElement": null, "scrollX": 0, "scrollY": 0, "searchMatches": [], "selectedElementIds": { - "id35_copy_copy": true, - "id36_copy_copy": true, + "id209_copy_copy": true, + "id210_copy_copy": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": { @@ -18898,7 +18861,7 @@ exports[`history > singleplayer undo/redo > should support duplication of groups "A", ], "height": 100, - "id": "id35", + "id": "id209", "index": "a0", "isDeleted": false, "link": null, @@ -18932,7 +18895,7 @@ exports[`history > singleplayer undo/redo > should support duplication of groups "A", ], "height": 100, - "id": "id36", + "id": "id210", "index": "a1", "isDeleted": false, "link": null, @@ -18966,7 +18929,7 @@ exports[`history > singleplayer undo/redo > should support duplication of groups "A_copy", ], "height": 100, - "id": "id35_copy_copy", + "id": "id209_copy_copy", "index": "a1G", "isDeleted": false, "link": null, @@ -19000,7 +18963,7 @@ exports[`history > singleplayer undo/redo > should support duplication of groups "A_copy", ], "height": 100, - "id": "id36_copy_copy", + "id": "id210_copy_copy", "index": "a1V", "isDeleted": false, "link": null, @@ -19034,7 +18997,7 @@ exports[`history > singleplayer undo/redo > should support duplication of groups "A_copy", ], "height": 100, - "id": "id35_copy", + "id": "id209_copy", "index": "a2", "isDeleted": true, "link": null, @@ -19068,7 +19031,7 @@ exports[`history > singleplayer undo/redo > should support duplication of groups "A_copy", ], "height": 100, - "id": "id36_copy", + "id": "id210_copy", "index": "a3", "isDeleted": true, "link": null, @@ -19090,211 +19053,206 @@ exports[`history > singleplayer undo/redo > should support duplication of groups } `; -exports[`history > singleplayer undo/redo > should support duplication of groups, appstate group selection and editing group > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id35": true, - "id36": true, - }, - "selectedGroupIds": { - "A": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - "selectedGroupIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id35" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [ - "A", - ], - "height": 100, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 0, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - "id36" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [ - "A", - ], - "height": 100, - "index": "a1", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 100, - "y": 100, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id35_copy_copy": true, - "id36_copy_copy": true, - }, - "selectedGroupIds": { - "A_copy": true, - }, - }, - "inserted": { - "selectedElementIds": { - "id35": true, - "id36": true, - }, - "selectedGroupIds": { - "A": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id35_copy_copy" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [ - "A_copy", - ], - "height": 100, - "index": "a1G", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 10, - "y": 10, - }, - "inserted": { - "isDeleted": true, - }, - }, - "id36_copy_copy" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [ - "A_copy", - ], - "height": 100, - "index": "a1V", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 100, - "x": 110, - "y": 110, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > singleplayer undo/redo > should support duplication of groups, appstate group selection and editing group > [end of test] number of elements 1`] = `6`; exports[`history > singleplayer undo/redo > should support duplication of groups, appstate group selection and editing group > [end of test] number of renders 1`] = `18`; +exports[`history > singleplayer undo/redo > should support duplication of groups, appstate group selection and editing group > [end of test] redo stack 1`] = `[]`; + +exports[`history > singleplayer undo/redo > should support duplication of groups, appstate group selection and editing group > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id209": true, + "id210": true, + }, + "selectedGroupIds": { + "A": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + "selectedGroupIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id213", + "removed": { + "id209": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [ + "A", + ], + "height": 100, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 0, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + "id210": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [ + "A", + ], + "height": 100, + "index": "a1", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 100, + "y": 100, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id209_copy_copy": true, + "id210_copy_copy": true, + }, + "selectedGroupIds": { + "A_copy": true, + }, + }, + "inserted": { + "selectedElementIds": { + "id209": true, + "id210": true, + }, + "selectedGroupIds": { + "A": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id240", + "removed": { + "id209_copy_copy": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [ + "A_copy", + ], + "height": 100, + "index": "a1G", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 10, + "y": 10, + }, + "inserted": { + "isDeleted": true, + }, + }, + "id210_copy_copy": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [ + "A_copy", + ], + "height": 100, + "index": "a1V", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 100, + "x": 110, + "y": 110, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, +] +`; + exports[`history > singleplayer undo/redo > should support element creation, deletion and appstate element selection change > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -19373,7 +19331,7 @@ exports[`history > singleplayer undo/redo > should support element creation, del "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id23": true, + "id117": true, }, "resizingElement": null, "scrollX": 0, @@ -19416,7 +19374,7 @@ exports[`history > singleplayer undo/redo > should support element creation, del "frameId": null, "groupIds": [], "height": 10, - "id": "id22", + "id": "id114", "index": "a0", "isDeleted": false, "link": null, @@ -19448,7 +19406,7 @@ exports[`history > singleplayer undo/redo > should support element creation, del "frameId": null, "groupIds": [], "height": 10, - "id": "id23", + "id": "id117", "index": "a1", "isDeleted": true, "link": null, @@ -19480,7 +19438,7 @@ exports[`history > singleplayer undo/redo > should support element creation, del "frameId": null, "groupIds": [], "height": 10, - "id": "id24", + "id": "id120", "index": "a2", "isDeleted": true, "link": null, @@ -19502,258 +19460,257 @@ exports[`history > singleplayer undo/redo > should support element creation, del } `; -exports[`history > singleplayer undo/redo > should support element creation, deletion and appstate element selection change > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id22": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id22" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 10, - "x": 10, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id23": true, - }, - }, - "inserted": { - "selectedElementIds": { - "id22": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id23" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a1", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 10, - "x": 20, - "y": 20, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id24": true, - }, - }, - "inserted": { - "selectedElementIds": { - "id23": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id24" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a2", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 10, - "x": 40, - "y": 40, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id23": true, - }, - }, - "inserted": { - "selectedElementIds": { - "id24": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id24": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": {}, - }, - "inserted": { - "selectedElementIds": { - "id23": true, - "id24": true, - }, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map { - "id23" => Delta { - "deleted": { - "isDeleted": true, - }, - "inserted": { - "isDeleted": false, - }, - }, - "id24" => Delta { - "deleted": { - "isDeleted": true, - }, - "inserted": { - "isDeleted": false, - }, - }, - }, - "removed": Map {}, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > singleplayer undo/redo > should support element creation, deletion and appstate element selection change > [end of test] number of elements 1`] = `3`; exports[`history > singleplayer undo/redo > should support element creation, deletion and appstate element selection change > [end of test] number of renders 1`] = `27`; +exports[`history > singleplayer undo/redo > should support element creation, deletion and appstate element selection change > [end of test] redo stack 1`] = `[]`; + +exports[`history > singleplayer undo/redo > should support element creation, deletion and appstate element selection change > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id114": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id144", + "removed": { + "id114": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a0", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 10, + "x": 10, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id117": true, + }, + }, + "inserted": { + "selectedElementIds": { + "id114": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id146", + "removed": { + "id117": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a1", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 10, + "x": 20, + "y": 20, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id120": true, + }, + }, + "inserted": { + "selectedElementIds": { + "id117": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id148", + "removed": { + "id120": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a2", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "width": 10, + "x": 40, + "y": 40, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id117": true, + }, + }, + "inserted": { + "selectedElementIds": { + "id120": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id150", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id120": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id152", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": {}, + }, + "inserted": { + "selectedElementIds": { + "id117": true, + "id120": true, + }, + }, + }, + }, + "elementsChange": ElementsChange { + "added": { + "id117": Delta { + "deleted": { + "isDeleted": true, + }, + "inserted": { + "isDeleted": false, + }, + }, + "id120": Delta { + "deleted": { + "isDeleted": true, + }, + "inserted": { + "isDeleted": false, + }, + }, + }, + "id": "id154", + "removed": {}, + "updated": {}, + }, + }, +] +`; + exports[`history > singleplayer undo/redo > should support linear element creation and points manipulation through the editor > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -19832,14 +19789,14 @@ exports[`history > singleplayer undo/redo > should support linear element creati "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id27": true, + "id155": true, }, "resizingElement": null, "scrollX": 0, "scrollY": 0, "searchMatches": [], "selectedElementIds": { - "id27": true, + "id155": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -19880,7 +19837,7 @@ exports[`history > singleplayer undo/redo > should support linear element creati "frameId": null, "groupIds": [], "height": 20, - "id": "id27", + "id": "id155", "index": "a0", "isDeleted": false, "lastCommittedPoint": [ @@ -19922,245 +19879,244 @@ exports[`history > singleplayer undo/redo > should support linear element creati } `; -exports[`history > singleplayer undo/redo > should support linear element creation and points manipulation through the editor > [end of test] history 1`] = ` -History { - "onHistoryChangedEmitter": Emitter { - "subscribers": [ - [Function], - [Function], - ], - }, - "redoStack": [], - "undoStack": [ - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id27": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map { - "id27" => Delta { - "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "elbowed": false, - "endArrowhead": "arrow", - "endBinding": null, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a0", - "isDeleted": false, - "lastCommittedPoint": [ - 10, - 10, - ], - "link": null, - "locked": false, - "opacity": 100, - "points": [ - [ - 0, - 0, - ], - [ - 10, - 10, - ], - ], - "roughness": 1, - "roundness": { - "type": 2, - }, - "startArrowhead": null, - "startBinding": null, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "arrow", - "width": 10, - "x": 0, - "y": 0, - }, - "inserted": { - "isDeleted": true, - }, - }, - }, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id27" => Delta { - "deleted": { - "lastCommittedPoint": [ - 20, - 0, - ], - "points": [ - [ - 0, - 0, - ], - [ - 10, - 10, - ], - [ - 20, - 0, - ], - ], - "width": 20, - }, - "inserted": { - "lastCommittedPoint": [ - 10, - 10, - ], - "points": [ - [ - 0, - 0, - ], - [ - 10, - 10, - ], - ], - "width": 10, - }, - }, - }, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "selectedLinearElementId": "id27", - }, - "inserted": { - "selectedLinearElementId": null, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "editingLinearElementId": "id27", - }, - "inserted": { - "editingLinearElementId": null, - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map { - "id27" => Delta { - "deleted": { - "height": 20, - "points": [ - [ - 0, - 0, - ], - [ - 10, - 10, - ], - [ - 20, - 20, - ], - ], - }, - "inserted": { - "height": 10, - "points": [ - [ - 0, - 0, - ], - [ - 10, - 10, - ], - [ - 20, - 0, - ], - ], - }, - }, - }, - }, - }, - HistoryEntry { - "appStateChange": AppStateChange { - "delta": Delta { - "deleted": { - "editingLinearElementId": null, - }, - "inserted": { - "editingLinearElementId": "id27", - }, - }, - }, - "elementsChange": ElementsChange { - "added": Map {}, - "removed": Map {}, - "updated": Map {}, - }, - }, - ], -} -`; - exports[`history > singleplayer undo/redo > should support linear element creation and points manipulation through the editor > [end of test] number of elements 1`] = `1`; exports[`history > singleplayer undo/redo > should support linear element creation and points manipulation through the editor > [end of test] number of renders 1`] = `21`; + +exports[`history > singleplayer undo/redo > should support linear element creation and points manipulation through the editor > [end of test] redo stack 1`] = `[]`; + +exports[`history > singleplayer undo/redo > should support linear element creation and points manipulation through the editor > [end of test] undo stack 1`] = ` +[ + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id155": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id185", + "removed": { + "id155": Delta { + "deleted": { + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "elbowed": false, + "endArrowhead": "arrow", + "endBinding": null, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "index": "a0", + "isDeleted": false, + "lastCommittedPoint": [ + 10, + 10, + ], + "link": null, + "locked": false, + "opacity": 100, + "points": [ + [ + 0, + 0, + ], + [ + 10, + 10, + ], + ], + "roughness": 1, + "roundness": { + "type": 2, + }, + "startArrowhead": null, + "startBinding": null, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "arrow", + "width": 10, + "x": 0, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id187", + "removed": {}, + "updated": { + "id155": Delta { + "deleted": { + "lastCommittedPoint": [ + 20, + 0, + ], + "points": [ + [ + 0, + 0, + ], + [ + 10, + 10, + ], + [ + 20, + 0, + ], + ], + "width": 20, + }, + "inserted": { + "lastCommittedPoint": [ + 10, + 10, + ], + "points": [ + [ + 0, + 0, + ], + [ + 10, + 10, + ], + ], + "width": 10, + }, + }, + }, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "selectedLinearElementId": "id155", + }, + "inserted": { + "selectedLinearElementId": null, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id189", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "editingLinearElementId": "id155", + }, + "inserted": { + "editingLinearElementId": null, + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id191", + "removed": {}, + "updated": {}, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id193", + "removed": {}, + "updated": { + "id155": Delta { + "deleted": { + "height": 20, + "points": [ + [ + 0, + 0, + ], + [ + 10, + 10, + ], + [ + 20, + 20, + ], + ], + }, + "inserted": { + "height": 10, + "points": [ + [ + 0, + 0, + ], + [ + 10, + 10, + ], + [ + 20, + 0, + ], + ], + }, + }, + }, + }, + }, + StoreIncrement { + "appStateChange": AppStateChange { + "delta": Delta { + "deleted": { + "editingLinearElementId": null, + }, + "inserted": { + "editingLinearElementId": "id155", + }, + }, + }, + "elementsChange": ElementsChange { + "added": {}, + "id": "id195", + "removed": {}, + "updated": {}, + }, + }, +] +`; diff --git a/packages/excalidraw/tests/history.test.tsx b/packages/excalidraw/tests/history.test.tsx index 9402095ee7..8367b8a309 100644 --- a/packages/excalidraw/tests/history.test.tsx +++ b/packages/excalidraw/tests/history.test.tsx @@ -16,7 +16,6 @@ import { fireEvent, queryByTestId, waitFor } from "@testing-library/react"; import { createUndoAction, createRedoAction } from "../actions/actionHistory"; import { actionToggleViewMode } from "../actions/actionToggleViewMode"; import { EXPORT_DATA_TYPES, MIME_TYPES } from "../constants"; -import type { AppState } from "../types"; import { arrayToMap } from "../utils"; import { COLOR_PALETTE, @@ -42,11 +41,11 @@ import { } from "../actions"; import { vi } from "vitest"; import { queryByText } from "@testing-library/react"; -import { HistoryEntry } from "../history"; import { AppStateChange, ElementsChange } from "../change"; -import { Snapshot, StoreAction } from "../store"; +import { StoreAction, StoreIncrement } from "../store"; import type { LocalPoint, Radians } from "../../math"; import { pointFrom } from "../../math"; +import type { AppState } from "../types.js"; const { h } = window; @@ -65,7 +64,8 @@ const checkpoint = (name: string) => { ...strippedAppState } = h.state; expect(strippedAppState).toMatchSnapshot(`[${name}] appState`); - expect(h.history).toMatchSnapshot(`[${name}] history`); + expect(h.history.undoStack).toMatchSnapshot(`[${name}] undo stack`); + expect(h.history.redoStack).toMatchSnapshot(`[${name}] redo stack`); expect(h.elements.length).toMatchSnapshot(`[${name}] number of elements`); h.elements .map(({ seed, versionNonce, ...strippedElement }) => strippedElement) @@ -99,14 +99,16 @@ describe("history", () => { API.setElements([rect]); - const corrupedEntry = HistoryEntry.create( - AppStateChange.empty(), + const corrupedEntry = new StoreIncrement( ElementsChange.empty(), + AppStateChange.empty(), ); - vi.spyOn(corrupedEntry, "applyTo").mockImplementation(() => { - throw new Error("Oh no, I am corrupted!"); - }); + vi.spyOn(corrupedEntry.elementsChange, "applyTo").mockImplementation( + () => { + throw new Error("Oh no, I am corrupted!"); + }, + ); (h.history as any).undoStack.push(corrupedEntry); @@ -119,7 +121,6 @@ describe("history", () => { h.history.undo( arrayToMap(h.elements) as SceneElementsMap, appState, - Snapshot.empty(), ) as any, ); } catch (e) { @@ -140,7 +141,6 @@ describe("history", () => { h.history.redo( arrayToMap(h.elements) as SceneElementsMap, appState, - Snapshot.empty(), ) as any, ); } catch (e) { @@ -437,8 +437,8 @@ describe("history", () => { expect(h.history.isUndoStackEmpty).toBeTruthy(); }); - const undoAction = createUndoAction(h.history, h.store); - const redoAction = createRedoAction(h.history, h.store); + const undoAction = createUndoAction(h.history); + const redoAction = createRedoAction(h.history); // noop API.executeAction(undoAction); expect(h.elements).toEqual([ @@ -514,8 +514,8 @@ describe("history", () => { expect.objectContaining({ id: "B", isDeleted: false }), ]); - const undoAction = createUndoAction(h.history, h.store); - const redoAction = createRedoAction(h.history, h.store); + const undoAction = createUndoAction(h.history); + const redoAction = createRedoAction(h.history); API.executeAction(undoAction); expect(API.getSnapshot()).toEqual([ @@ -1714,8 +1714,8 @@ describe("history", () => { />, ); - const undoAction = createUndoAction(h.history, h.store); - const redoAction = createRedoAction(h.history, h.store); + const undoAction = createUndoAction(h.history); + const redoAction = createRedoAction(h.history); await waitFor(() => { expect(h.elements).toEqual([expect.objectContaining({ id: "A" })]); @@ -1764,7 +1764,7 @@ describe("history", () => { />, ); - const undoAction = createUndoAction(h.history, h.store); + const undoAction = createUndoAction(h.history); await waitFor(() => { expect(h.elements).toEqual([expect.objectContaining({ id: "A" })]); diff --git a/packages/excalidraw/types.ts b/packages/excalidraw/types.ts index 54c6cf6c59..0904586662 100644 --- a/packages/excalidraw/types.ts +++ b/packages/excalidraw/types.ts @@ -40,7 +40,7 @@ import type { IMAGE_MIME_TYPES, MIME_TYPES } from "./constants"; import type { ContextMenuItems } from "./components/ContextMenu"; import type { SnapLine } from "./snapping"; import type { Merge, MaybePromise, ValueOf, MakeBrand } from "./utility-types"; -import type { StoreActionType, StoreIncrementEvent } from "./store"; +import type { StoreActionType, StoreIncrement } from "./store"; export type SocketId = string & { _brand: "SocketId" }; @@ -498,7 +498,7 @@ export interface ExcalidrawProps { appState: AppState, files: BinaryFiles, ) => void; - onIncrement?: (event: StoreIncrementEvent) => void; + onIncrement?: (event: StoreIncrement) => void; initialData?: | (() => MaybePromise) | MaybePromise; @@ -785,7 +785,7 @@ export interface ExcalidrawImperativeAPI { ) => void, ) => UnsubscribeCallback; onIncrement: ( - callback: (event: StoreIncrementEvent) => void, + callback: (event: StoreIncrement) => void, ) => UnsubscribeCallback; onPointerDown: ( callback: ( diff --git a/yarn.lock b/yarn.lock index 5108787d8d..7cbdf92610 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3273,7 +3273,7 @@ resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-5.0.4.tgz#1a31c3d378850d2778dabb6374d036dcba4ba708" integrity sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw== -"@types/async-lock@1.4.2": +"@types/async-lock@^1.4.2": version "1.4.2" resolved "https://registry.yarnpkg.com/@types/async-lock/-/async-lock-1.4.2.tgz#c2037ba1d6018de766c2505c3abe3b7b6b244ab4" integrity sha512-HlZ6Dcr205BmNhwkdXqrg2vkFMN2PluI7Lgr8In3B3wE5PiQHhjRqtW/lGdVU9gw+sM0JcIDx2AN+cW8oSWIcw==