diff --git a/excalidraw-app/tests/collab.test.tsx b/excalidraw-app/tests/collab.test.tsx index ed19c96e8..ee67b156f 100644 --- a/excalidraw-app/tests/collab.test.tsx +++ b/excalidraw-app/tests/collab.test.tsx @@ -205,6 +205,7 @@ describe("collaboration", () => { // with explicit undo (as addition) we expect our item to be restored from the snapshot! await waitFor(() => { expect(API.getUndoStack().length).toBe(1); + expect(API.getRedoStack().length).toBe(1); expect(API.getSnapshot()).toEqual([ expect.objectContaining(rect1Props), expect.objectContaining({ ...rect2Props, isDeleted: false }), @@ -236,7 +237,7 @@ describe("collaboration", () => { // with explicit redo (as removal) we again restore the element from the snapshot! await waitFor(() => { - expect(API.getUndoStack().length).toBe(2); + expect(API.getUndoStack().length).toBe(1); expect(API.getRedoStack().length).toBe(0); expect(API.getSnapshot()).toEqual([ expect.objectContaining(rect1Props), @@ -248,13 +249,11 @@ describe("collaboration", () => { ]); }); - act(() => h.app.actionManager.executeAction(undoAction)); - // simulate local update API.updateScene({ elements: syncInvalidIndices([ h.elements[0], - newElementWith(h.elements[1], { x: 100 }), + newElementWith(h.elements[1], { x: 100, isDeleted: false }), ]), captureUpdate: CaptureUpdateAction.IMMEDIATELY, }); @@ -271,55 +270,5 @@ describe("collaboration", () => { expect.objectContaining({ ...rect2Props, isDeleted: false, x: 100 }), ]); }); - - act(() => h.app.actionManager.executeAction(undoAction)); - - // we expect to iterate the stack to the first visible change - await waitFor(() => { - expect(API.getUndoStack().length).toBe(1); - expect(API.getRedoStack().length).toBe(1); - expect(API.getSnapshot()).toEqual([ - expect.objectContaining(rect1Props), - expect.objectContaining({ ...rect2Props, isDeleted: false, x: 0 }), - ]); - expect(h.elements).toEqual([ - expect.objectContaining(rect1Props), - expect.objectContaining({ ...rect2Props, isDeleted: false, x: 0 }), - ]); - }); - - // simulate force deleting the element remotely - API.updateScene({ - elements: syncInvalidIndices([rect1]), - captureUpdate: CaptureUpdateAction.NEVER, - }); - - // snapshot was correctly updated and marked the element as deleted - await waitFor(() => { - expect(API.getUndoStack().length).toBe(1); - expect(API.getRedoStack().length).toBe(1); - expect(API.getSnapshot()).toEqual([ - expect.objectContaining(rect1Props), - expect.objectContaining({ ...rect2Props, isDeleted: true, x: 0 }), - ]); - expect(h.elements).toEqual([expect.objectContaining(rect1Props)]); - }); - - act(() => h.app.actionManager.executeAction(redoAction)); - - // with explicit redo (as update) we again restored the element from the snapshot! - await waitFor(() => { - expect(API.getUndoStack().length).toBe(2); - expect(API.getRedoStack().length).toBe(0); - expect(API.getSnapshot()).toEqual([ - expect.objectContaining({ id: "A", isDeleted: false }), - expect.objectContaining({ id: "B", isDeleted: true, x: 100 }), - ]); - expect(h.history.isRedoStackEmpty).toBeTruthy(); - expect(h.elements).toEqual([ - expect.objectContaining({ id: "A", isDeleted: false }), - expect.objectContaining({ id: "B", isDeleted: true, x: 100 }), - ]); - }); }); }); diff --git a/packages/element/src/delta.ts b/packages/element/src/delta.ts index c3d9edb55..5db4daa5e 100644 --- a/packages/element/src/delta.ts +++ b/packages/element/src/delta.ts @@ -7,12 +7,9 @@ import { isTestEnv, } from "@excalidraw/common"; -import type { LocalPoint } from "@excalidraw/math/types"; - import type { ExcalidrawElement, ExcalidrawFreeDrawElement, - ExcalidrawImageElement, ExcalidrawLinearElement, ExcalidrawTextElement, NonDeleted, @@ -266,12 +263,14 @@ export class Delta { arrayToObject(deletedArray, groupBy), arrayToObject(insertedArray, groupBy), ), + (x) => x, ); const insertedDifferences = arrayToObject( Delta.getRightDifferences( arrayToObject(deletedArray, groupBy), arrayToObject(insertedArray, groupBy), ), + (x) => x, ); if ( @@ -871,13 +870,6 @@ export class AppStateDelta implements DeltaContainer { type ElementPartial = Omit>, "id" | "updated" | "seed">; -type ElementPartialWithPoints = Omit< - ElementPartial, - "points" -> & { - points: { [key: string]: LocalPoint }; -}; - export type ApplyToOptions = { excludedProperties: Set; }; @@ -1108,6 +1100,70 @@ export class ElementsDelta implements DeltaContainer { ); } + /** + * Update delta/s based on the existing elements. + * + * @param elements current elements + * @param modifierOptions defines which of the delta (`deleted` or `inserted`) will be updated + * @returns new instance with modified delta/s + */ + public applyLatestChanges( + elements: SceneElementsMap, + modifierOptions: "deleted" | "inserted", + ): ElementsDelta { + const modifier = + (element: OrderedExcalidrawElement) => (partial: ElementPartial) => { + const latestPartial: { [key: string]: unknown } = {}; + + for (const key of Object.keys(partial) as Array) { + // do not update following props: + // - `boundElements`, as it is a reference value which is postprocessed to contain only deleted/inserted keys + switch (key) { + case "boundElements": + latestPartial[key] = partial[key]; + break; + default: + latestPartial[key] = element[key]; + } + } + + return latestPartial; + }; + + const applyLatestChangesInternal = ( + deltas: Record>, + ) => { + const modifiedDeltas: Record> = {}; + + for (const [id, delta] of Object.entries(deltas)) { + const existingElement = elements.get(id); + + if (existingElement) { + const modifiedDelta = Delta.create( + delta.deleted, + delta.inserted, + modifier(existingElement), + modifierOptions, + ); + + modifiedDeltas[id] = modifiedDelta; + } else { + modifiedDeltas[id] = delta; + } + } + + return modifiedDeltas; + }; + + const added = applyLatestChangesInternal(this.added); + const removed = applyLatestChangesInternal(this.removed); + const updated = applyLatestChangesInternal(this.updated); + + return ElementsDelta.create(added, removed, updated, { + shouldRedistribute: true, // redistribute the deltas as `isDeleted` could have been updated + }); + } + public applyTo( elements: SceneElementsMap, snapshot: StoreSnapshot["elements"] = StoreSnapshot.empty().elements, @@ -1266,14 +1322,13 @@ export class ElementsDelta implements DeltaContainer { ) { const directlyApplicablePartial: Mutable = {}; + // some properties are not directly applicable, such as: + // - boundElements which contains only diff) + // - version & versionNonce, if we don't want to return to previous versions for (const key of Object.keys(delta.inserted) as Array< keyof typeof delta.inserted >) { - if ( - key === "boundElements" || - (key as keyof ExcalidrawFreeDrawElement | ExcalidrawLinearElement) === - "points" - ) { + if (key === "boundElements") { continue; } @@ -1301,32 +1356,6 @@ export class ElementsDelta implements DeltaContainer { }); } - const deletedPoints = (delta.deleted as ElementPartialWithPoints).points; - const insertedPoints = (delta.inserted as ElementPartialWithPoints).points; - - if (insertedPoints && deletedPoints) { - const mergedPoints = Delta.mergeObjects( - arrayToObject( - (element as ExcalidrawFreeDrawElement | ExcalidrawLinearElement) - .points, - ), - insertedPoints, - deletedPoints, - ); - - const sortedPoints = Object.entries(mergedPoints) - .sort((aKey, bKey) => { - const a = Number(aKey); - const b = Number(bKey); - return a - b; - }) - .map(([_, value]) => value); - - Object.assign(directlyApplicablePartial, { - points: sortedPoints, - }); - } - if (!flags.containsVisibleDifference) { // strip away fractional index, as even if it would be different, it doesn't have to result in visible change const { index, ...rest } = directlyApplicablePartial; @@ -1634,18 +1663,31 @@ export class ElementsDelta implements DeltaContainer { try { Delta.diffArrays(deleted, inserted, "boundElements", (x) => x.id); - // points depend on the order, so we diff them as objects and group by index - // creates `ElementPartialWithPoints` - Delta.diffObjects( - deleted as ElementPartial< - ExcalidrawFreeDrawElement | ExcalidrawLinearElement - >, - inserted as ElementPartial< - ExcalidrawFreeDrawElement | ExcalidrawLinearElement - >, - "points", - (prevValue) => prevValue!, - ); + // don't diff the points as: + // - we can't ensure the multiplayer order consistency without fractional index on each point + // - we prefer to not merge the points, as it might just lead to unexpected / incosistent results + const deletedPoints = + ( + deleted as ElementPartial< + ExcalidrawFreeDrawElement | ExcalidrawLinearElement + > + ).points ?? []; + + const insertedPoints = + ( + inserted as ElementPartial< + ExcalidrawFreeDrawElement | ExcalidrawLinearElement + > + ).points ?? []; + + if ( + !Delta.isLeftDifferent(deletedPoints, insertedPoints) && + !Delta.isRightDifferent(deletedPoints, insertedPoints) + ) { + // delete the points from delta if there is no difference, otherwise leave them as they were captured due to consistency + Reflect.deleteProperty(deleted, "points"); + Reflect.deleteProperty(inserted, "points"); + } } catch (e) { // if postprocessing fails, it does not make sense to bubble up, but let's make sure we know about it console.error(`Couldn't postprocess elements delta.`); diff --git a/packages/element/src/fractionalIndex.ts b/packages/element/src/fractionalIndex.ts index 84505365e..3632cf6f4 100644 --- a/packages/element/src/fractionalIndex.ts +++ b/packages/element/src/fractionalIndex.ts @@ -2,7 +2,9 @@ import { generateNKeysBetween } from "fractional-indexing"; import { arrayToMap } from "@excalidraw/common"; -import { mutateElement } from "./mutateElement"; +import type { Mutable } from "@excalidraw/common/utility-types"; + +import { mutateElement, newElementWith } from "./mutateElement"; import { getBoundTextElement } from "./textElement"; import { hasBoundTextElement } from "./typeChecks"; @@ -161,9 +163,15 @@ export const syncMovedIndices = ( // try generatating indices, throws on invalid movedElements const elementsUpdates = generateIndices(elements, indicesGroups); - const elementsCandidates = elements.map((x) => - elementsUpdates.has(x) ? { ...x, ...elementsUpdates.get(x) } : x, - ); + const elementsCandidates = elements.map((x) => { + const elementUpdates = elementsUpdates.get(x); + + if (elementUpdates) { + return { ...x, index: elementUpdates.index }; + } + + return x; + }); // ensure next indices are valid before mutation, throws on invalid ones validateFractionalIndices( @@ -177,8 +185,8 @@ export const syncMovedIndices = ( ); // split mutation so we don't end up in an incosistent state - for (const [element, update] of elementsUpdates) { - mutateElement(element, elementsMap, update); + for (const [element, { index }] of elementsUpdates) { + mutateElement(element, elementsMap, { index }); } } catch (e) { // fallback to default sync @@ -189,19 +197,33 @@ export const syncMovedIndices = ( }; /** - * Synchronizes all invalid fractional indices with the array order by mutating passed elements. + * Synchronizes all invalid fractional indices with the array order by mutating passed elements array. + * + * When `shouldCreateNewInstances` is true, it creates new instances of the elements, instead of mutating the existing ones. * * WARN: in edge cases it could modify the elements which were not moved, as it's impossible to guess the actually moved elements from the elements array itself. */ export const syncInvalidIndices = ( elements: readonly ExcalidrawElement[], + { + shouldCreateNewInstances = false, + }: { + shouldCreateNewInstances?: boolean; + } = {}, ): OrderedExcalidrawElement[] => { - const elementsMap = arrayToMap(elements); const indicesGroups = getInvalidIndicesGroups(elements); const elementsUpdates = generateIndices(elements, indicesGroups); - for (const [element, update] of elementsUpdates) { - mutateElement(element, elementsMap, update); + for (const [element, { index, arrayIndex }] of elementsUpdates) { + if (shouldCreateNewInstances) { + const updatedElement = newElementWith(element, { index }); + + // mutate the element in the array with the new updated instance + (elements as Mutable)[arrayIndex] = updatedElement; + } else { + const elementsMap = arrayToMap(elements); + mutateElement(element, elementsMap, { index }); + } } return elements as OrderedExcalidrawElement[]; @@ -380,7 +402,7 @@ const generateIndices = ( ) => { const elementsUpdates = new Map< ExcalidrawElement, - { index: FractionalIndex } + { index: FractionalIndex; arrayIndex: number } >(); for (const indices of indicesGroups) { @@ -398,6 +420,7 @@ const generateIndices = ( elementsUpdates.set(element, { index: fractionalIndices[i], + arrayIndex: indices[i], }); } } diff --git a/packages/element/src/store.ts b/packages/element/src/store.ts index cd18bee18..67cfa3330 100644 --- a/packages/element/src/store.ts +++ b/packages/element/src/store.ts @@ -533,9 +533,7 @@ export class StoreDelta { id, elements: { added, removed, updated }, }: DTO) { - const elements = ElementsDelta.create(added, removed, updated, { - shouldRedistribute: false, - }); + const elements = ElementsDelta.create(added, removed, updated); return new this(id, elements, AppStateDelta.empty()); } @@ -676,11 +674,10 @@ export class StoreSnapshot { nextElements.set(id, changedElement); } - const nextAppState = Object.assign( - {}, - this.appState, - change.appState, - ) as ObservedAppState; + const nextAppState = getObservedAppState({ + ...this.appState, + ...change.appState, + }); return StoreSnapshot.create(nextElements, nextAppState, { // by default we assume that change is different from what we have in the snapshot @@ -933,18 +930,26 @@ const getDefaultObservedAppState = (): ObservedAppState => { }; }; -export const getObservedAppState = (appState: AppState): ObservedAppState => { +export const getObservedAppState = ( + appState: AppState | ObservedAppState, +): ObservedAppState => { const observedAppState = { name: appState.name, editingGroupId: appState.editingGroupId, viewBackgroundColor: appState.viewBackgroundColor, selectedElementIds: appState.selectedElementIds, selectedGroupIds: appState.selectedGroupIds, - editingLinearElementId: appState.editingLinearElement?.elementId || null, - selectedLinearElementId: appState.selectedLinearElement?.elementId || null, croppingElementId: appState.croppingElementId, activeLockedId: appState.activeLockedId, lockedMultiSelections: appState.lockedMultiSelections, + editingLinearElementId: + (appState as AppState).editingLinearElement?.elementId ?? // prefer app state, as it's likely newer + (appState as ObservedAppState).editingLinearElementId ?? // fallback to observed app state, as it's likely older coming from a previous snapshot + null, + selectedLinearElementId: + (appState as AppState).selectedLinearElement?.elementId ?? + (appState as ObservedAppState).selectedLinearElementId ?? + null, }; Reflect.defineProperty(observedAppState, hiddenObservedAppStateProp, { diff --git a/packages/element/tests/duplicate.test.tsx b/packages/element/tests/duplicate.test.tsx index ed2508390..10b9346a6 100644 --- a/packages/element/tests/duplicate.test.tsx +++ b/packages/element/tests/duplicate.test.tsx @@ -505,8 +505,6 @@ describe("group-related duplication", () => { mouse.up(frame.x + frame.width + 50, frame.y + frame.height + 50); }); - // console.log(h.elements); - assertElements(h.elements, [ { id: frame.id }, { id: rectangle1.id, frameId: frame.id }, diff --git a/packages/excalidraw/components/App.tsx b/packages/excalidraw/components/App.tsx index 8bef9703d..0eb5ec12e 100644 --- a/packages/excalidraw/components/App.tsx +++ b/packages/excalidraw/components/App.tsx @@ -104,7 +104,11 @@ import { Emitter, } from "@excalidraw/common"; -import { getCommonBounds, getElementAbsoluteCoords } from "@excalidraw/element"; +import { + getCommonBounds, + getElementAbsoluteCoords, + getObservedAppState, +} from "@excalidraw/element"; import { bindOrUnbindLinearElement, @@ -3993,22 +3997,30 @@ class App extends React.Component { }) => { const { elements, appState, collaborators, captureUpdate } = sceneData; - const nextElements = elements ? syncInvalidIndices(elements) : undefined; + const nextElements = elements + ? syncInvalidIndices(elements, { + // we have to create new instances here, otherwise scheduled micro action below won't be able to + // detect the fractional index change and won't update the store snapshot + shouldCreateNewInstances: true, + }) + : undefined; if (captureUpdate) { const nextElementsMap = elements ? (arrayToMap(nextElements ?? []) as SceneElementsMap) : undefined; - const nextAppState = appState - ? // new instance, with partial appstate applied to previously captured one, including hidden prop inside `prevCommittedAppState` - Object.assign({}, this.store.snapshot.appState, appState) + const nextObservedAppState = appState + ? getObservedAppState({ + ...this.store.snapshot.appState, + ...appState, + }) : undefined; this.store.scheduleMicroAction({ action: captureUpdate, elements: nextElementsMap, - appState: nextAppState, + appState: nextObservedAppState, }); } diff --git a/packages/excalidraw/history.ts b/packages/excalidraw/history.ts index cb11966b2..3f8623d56 100644 --- a/packages/excalidraw/history.ts +++ b/packages/excalidraw/history.ts @@ -13,7 +13,7 @@ import type { SceneElementsMap } from "@excalidraw/element/types"; import type { AppState } from "./types"; -class HistoryDelta extends StoreDelta { +export class HistoryDelta extends StoreDelta { /** * Apply the delta to the passed elements and appState, does not modify the snapshot. */ @@ -27,7 +27,9 @@ class HistoryDelta extends StoreDelta { // used to fallback into local snapshot in case we couldn't apply the delta // due to a missing elements in the scene (force deleted) snapshot.elements, - // we don't want to apply the version and versionNonce properties for history + // we don't want to apply the `version` and `versionNonce` properties for history + // as we always need to end up with a new version due to collaboration, + // approaching each undo / redo as a new user operation { excludedProperties: new Set(["version", "versionNonce"]), }, @@ -221,6 +223,10 @@ export class History { } private static push(stack: HistoryDelta[], entry: HistoryDelta) { + if (entry.isEmpty()) { + return; + } + const inversedEntry = HistoryDelta.inverse(entry); return stack.push(inversedEntry); } diff --git a/packages/excalidraw/tests/__snapshots__/contextmenu.test.tsx.snap b/packages/excalidraw/tests/__snapshots__/contextmenu.test.tsx.snap index 23f4ccb4f..e37afa189 100644 --- a/packages/excalidraw/tests/__snapshots__/contextmenu.test.tsx.snap +++ b/packages/excalidraw/tests/__snapshots__/contextmenu.test.tsx.snap @@ -1277,6 +1277,7 @@ exports[`contextMenu element > selecting 'Add to library' in context menu adds e "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 20, "x": -10, "y": 0, @@ -1525,6 +1526,7 @@ exports[`contextMenu element > selecting 'Bring forward' in context menu brings "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 20, "x": -10, "y": 0, @@ -1579,6 +1581,7 @@ exports[`contextMenu element > selecting 'Bring forward' in context menu brings "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 20, "x": 20, "y": 30, @@ -1614,9 +1617,11 @@ exports[`contextMenu element > selecting 'Bring forward' in context menu brings "id0": { "deleted": { "index": "a2", + "version": 4, }, "inserted": { "index": "a0", + "version": 3, }, }, }, @@ -1858,6 +1863,7 @@ exports[`contextMenu element > selecting 'Bring to front' in context menu brings "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 20, "x": -10, "y": 0, @@ -1912,6 +1918,7 @@ exports[`contextMenu element > selecting 'Bring to front' in context menu brings "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 20, "x": 20, "y": 30, @@ -1947,9 +1954,11 @@ exports[`contextMenu element > selecting 'Bring to front' in context menu brings "id0": { "deleted": { "index": "a2", + "version": 4, }, "inserted": { "index": "a0", + "version": 3, }, }, }, @@ -2159,6 +2168,7 @@ exports[`contextMenu element > selecting 'Copy styles' in context menu copies st "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 20, "x": -10, "y": 0, @@ -2371,6 +2381,7 @@ exports[`contextMenu element > selecting 'Delete' in context menu deletes elemen "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 20, "x": -10, "y": 0, @@ -2402,9 +2413,11 @@ exports[`contextMenu element > selecting 'Delete' in context menu deletes elemen "id0": { "deleted": { "isDeleted": true, + "version": 4, }, "inserted": { "isDeleted": false, + "version": 3, }, }, }, @@ -2648,6 +2661,7 @@ exports[`contextMenu element > selecting 'Duplicate' in context menu duplicates "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 20, "x": -10, "y": 0, @@ -2702,6 +2716,7 @@ exports[`contextMenu element > selecting 'Duplicate' in context menu duplicates "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 5, "width": 20, "x": 0, "y": 10, @@ -2959,6 +2974,7 @@ exports[`contextMenu element > selecting 'Group selection' in context menu group "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 20, "x": -10, "y": 0, @@ -3013,6 +3029,7 @@ exports[`contextMenu element > selecting 'Group selection' in context menu group "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 20, "x": 20, "y": 30, @@ -3068,9 +3085,11 @@ exports[`contextMenu element > selecting 'Group selection' in context menu group "groupIds": [ "id9", ], + "version": 4, }, "inserted": { "groupIds": [], + "version": 3, }, }, "id3": { @@ -3078,9 +3097,11 @@ exports[`contextMenu element > selecting 'Group selection' in context menu group "groupIds": [ "id9", ], + "version": 4, }, "inserted": { "groupIds": [], + "version": 3, }, }, }, @@ -3324,6 +3345,7 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 20, "x": -10, "y": 0, @@ -3378,6 +3400,7 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 20, "x": 20, "y": 30, @@ -3405,9 +3428,11 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s "id3": { "deleted": { "strokeColor": "#e03131", + "version": 4, }, "inserted": { "strokeColor": "#1e1e1e", + "version": 3, }, }, }, @@ -3428,9 +3453,11 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s "id3": { "deleted": { "backgroundColor": "#a5d8ff", + "version": 5, }, "inserted": { "backgroundColor": "transparent", + "version": 4, }, }, }, @@ -3451,9 +3478,11 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s "id3": { "deleted": { "fillStyle": "cross-hatch", + "version": 6, }, "inserted": { "fillStyle": "solid", + "version": 5, }, }, }, @@ -3474,9 +3503,11 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s "id3": { "deleted": { "strokeStyle": "dotted", + "version": 7, }, "inserted": { "strokeStyle": "solid", + "version": 6, }, }, }, @@ -3497,9 +3528,11 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s "id3": { "deleted": { "roughness": 2, + "version": 8, }, "inserted": { "roughness": 1, + "version": 7, }, }, }, @@ -3520,9 +3553,11 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s "id3": { "deleted": { "opacity": 60, + "version": 9, }, "inserted": { "opacity": 100, + "version": 8, }, }, }, @@ -3556,6 +3591,7 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s "roughness": 2, "strokeColor": "#e03131", "strokeStyle": "dotted", + "version": 4, }, "inserted": { "backgroundColor": "transparent", @@ -3564,6 +3600,7 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s "roughness": 1, "strokeColor": "#1e1e1e", "strokeStyle": "solid", + "version": 3, }, }, }, @@ -3805,6 +3842,7 @@ exports[`contextMenu element > selecting 'Send backward' in context menu sends e "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 20, "x": -10, "y": 0, @@ -3859,6 +3897,7 @@ exports[`contextMenu element > selecting 'Send backward' in context menu sends e "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 20, "x": 20, "y": 30, @@ -3886,9 +3925,11 @@ exports[`contextMenu element > selecting 'Send backward' in context menu sends e "id3": { "deleted": { "index": "Zz", + "version": 4, }, "inserted": { "index": "a1", + "version": 3, }, }, }, @@ -4130,6 +4171,7 @@ exports[`contextMenu element > selecting 'Send to back' in context menu sends el "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 20, "x": -10, "y": 0, @@ -4184,6 +4226,7 @@ exports[`contextMenu element > selecting 'Send to back' in context menu sends el "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 20, "x": 20, "y": 30, @@ -4211,9 +4254,11 @@ exports[`contextMenu element > selecting 'Send to back' in context menu sends el "id3": { "deleted": { "index": "Zz", + "version": 4, }, "inserted": { "index": "a1", + "version": 3, }, }, }, @@ -4458,6 +4503,7 @@ exports[`contextMenu element > selecting 'Ungroup selection' in context menu ung "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 20, "x": -10, "y": 0, @@ -4512,6 +4558,7 @@ exports[`contextMenu element > selecting 'Ungroup selection' in context menu ung "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 20, "x": 20, "y": 30, @@ -4567,9 +4614,11 @@ exports[`contextMenu element > selecting 'Ungroup selection' in context menu ung "groupIds": [ "id9", ], + "version": 4, }, "inserted": { "groupIds": [], + "version": 3, }, }, "id3": { @@ -4577,9 +4626,11 @@ exports[`contextMenu element > selecting 'Ungroup selection' in context menu ung "groupIds": [ "id9", ], + "version": 4, }, "inserted": { "groupIds": [], + "version": 3, }, }, }, @@ -4606,21 +4657,25 @@ exports[`contextMenu element > selecting 'Ungroup selection' in context menu ung "id0": { "deleted": { "groupIds": [], + "version": 5, }, "inserted": { "groupIds": [ "id9", ], + "version": 4, }, }, "id3": { "deleted": { "groupIds": [], + "version": 5, }, "inserted": { "groupIds": [ "id9", ], + "version": 4, }, }, }, @@ -5739,6 +5794,7 @@ exports[`contextMenu element > shows 'Group selection' in context menu for multi "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": -10, "y": 0, @@ -5793,6 +5849,7 @@ exports[`contextMenu element > shows 'Group selection' in context menu for multi "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 12, "y": 0, @@ -6966,6 +7023,7 @@ exports[`contextMenu element > shows 'Ungroup selection' in context menu for gro "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": -10, "y": 0, @@ -7020,6 +7078,7 @@ exports[`contextMenu element > shows 'Ungroup selection' in context menu for gro "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 12, "y": 0, @@ -7097,9 +7156,11 @@ exports[`contextMenu element > shows 'Ungroup selection' in context menu for gro "groupIds": [ "id12", ], + "version": 4, }, "inserted": { "groupIds": [], + "version": 3, }, }, "id3": { @@ -7107,9 +7168,11 @@ exports[`contextMenu element > shows 'Ungroup selection' in context menu for gro "groupIds": [ "id12", ], + "version": 4, }, "inserted": { "groupIds": [], + "version": 3, }, }, }, @@ -9926,6 +9989,7 @@ exports[`contextMenu element > shows context menu for element > [end of test] un "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 20, "x": -10, "y": 0, diff --git a/packages/excalidraw/tests/__snapshots__/history.test.tsx.snap b/packages/excalidraw/tests/__snapshots__/history.test.tsx.snap index 080d8fbf0..c9d697b9b 100644 --- a/packages/excalidraw/tests/__snapshots__/history.test.tsx.snap +++ b/packages/excalidraw/tests/__snapshots__/history.test.tsx.snap @@ -81,14 +81,14 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id691": true, + "id877": true, }, "resizingElement": null, "scrollX": 0, "scrollY": 0, "searchMatches": null, "selectedElementIds": { - "id691": true, + "id877": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -126,7 +126,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 100, - "id": "id687", + "id": "id873", "index": "a0", "isDeleted": false, "link": null, @@ -158,7 +158,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 100, - "id": "id688", + "id": "id874", "index": "a1", "isDeleted": false, "link": null, @@ -189,7 +189,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "elbowed": false, "endArrowhead": "arrow", "endBinding": { - "elementId": "id702", + "elementId": "id890", "fixedPoint": [ "0.50000", 1, @@ -200,8 +200,8 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "fillStyle": "solid", "frameId": null, "groupIds": [], - "height": "102.45605", - "id": "id691", + "height": "102.35417", + "id": "id877", "index": "a2", "isDeleted": false, "lastCommittedPoint": null, @@ -214,8 +214,8 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl 0, ], [ - "102.80179", - "102.45605", + "101.77517", + "102.35417", ], ], "roughness": 1, @@ -230,8 +230,8 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "type": "arrow", "updated": 1, "version": 37, - "width": "102.80179", - "x": "-0.42182", + "width": "101.77517", + "x": "0.70711", "y": 0, } `; @@ -242,7 +242,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "backgroundColor": "transparent", "boundElements": [ { - "id": "id691", + "id": "id877", "type": "arrow", }, ], @@ -251,7 +251,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 50, - "id": "id702", + "id": "id890", "index": "a3", "isDeleted": false, "link": null, @@ -290,23 +290,33 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "added": {}, "removed": {}, "updated": { - "id688": { + "id873": { + "deleted": { + "version": 17, + }, + "inserted": { + "version": 15, + }, + }, + "id874": { "deleted": { "boundElements": [], + "version": 9, }, "inserted": { "boundElements": [ { - "id": "id691", + "id": "id877", "type": "arrow", }, ], + "version": 8, }, }, - "id691": { + "id877": { "deleted": { "endBinding": { - "elementId": "id702", + "elementId": "id890", "fixedPoint": [ "0.50000", 1, @@ -314,30 +324,34 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "focus": 0, "gap": 1, }, - "height": "70.45017", + "height": "70.48135", "points": [ [ 0, 0, ], [ - "100.70774", - "70.45017", + "100.70974", + "70.48135", ], ], "startBinding": { - "elementId": "id687", + "elementId": "id873", "focus": "0.02970", "gap": 1, }, + "version": 35, + "width": "100.70974", + "x": "-0.93029", + "y": "36.86579", }, "inserted": { "endBinding": { - "elementId": "id688", + "elementId": "id874", "focus": "-0.02000", "gap": 1, }, - "height": "0.09250", + "height": "0.09787", "points": [ [ 0, @@ -345,32 +359,38 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl ], [ "98.58579", - "0.09250", + "0.09787", ], ], "startBinding": { - "elementId": "id687", + "elementId": "id873", "focus": "0.02000", "gap": 1, }, + "version": 32, + "width": "98.58579", + "x": "0.70711", + "y": "0.85260", }, }, - "id702": { + "id890": { "deleted": { "boundElements": [ { - "id": "id691", + "id": "id877", "type": "arrow", }, ], + "version": 12, }, "inserted": { "boundElements": [], + "version": 11, }, }, }, }, - "id": "id709", + "id": "id904", }, { "appState": AppStateDelta { @@ -383,58 +403,92 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "added": {}, "removed": {}, "updated": { - "id687": { + "id873": { "deleted": { "boundElements": [], + "version": 18, }, "inserted": { "boundElements": [ { - "id": "id691", + "id": "id877", "type": "arrow", }, ], + "version": 17, }, }, - "id691": { + "id877": { "deleted": { - "height": "102.45584", + "endBinding": { + "elementId": "id890", + "fixedPoint": [ + "0.50000", + 1, + ], + "focus": 0, + "gap": 1, + }, + "height": "102.35417", "points": [ [ 0, 0, ], [ - "102.79971", - "102.45584", + "101.77517", + "102.35417", ], ], "startBinding": null, + "version": 37, + "width": "101.77517", + "x": "0.70711", "y": 0, }, "inserted": { - "height": "70.33521", + "endBinding": { + "elementId": "id890", + "fixedPoint": [ + "0.50000", + 1, + ], + "focus": 0, + "gap": 1, + }, + "height": "70.48135", "points": [ [ 0, 0, ], [ - "100.78887", - "70.33521", + "100.70974", + "70.48135", ], ], "startBinding": { - "elementId": "id687", + "elementId": "id873", "focus": "0.02970", "gap": 1, }, - "y": "35.20327", + "version": 35, + "width": "100.70974", + "x": "-0.93029", + "y": "36.86579", + }, + }, + "id890": { + "deleted": { + "version": 14, + }, + "inserted": { + "version": 12, }, }, }, }, - "id": "id710", + "id": "id906", }, ] `; @@ -451,7 +505,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "elements": { "added": {}, "removed": { - "id687": { + "id873": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -474,6 +528,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 100, "x": -100, "y": -50, @@ -482,7 +537,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "isDeleted": true, }, }, - "id688": { + "id874": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -505,6 +560,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 100, "x": 100, "y": -50, @@ -516,16 +572,16 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl }, "updated": {}, }, - "id": "id690", + "id": "id876", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id691": true, + "id877": true, }, - "selectedLinearElementId": "id691", + "selectedLinearElementId": "id877", }, "inserted": { "selectedElementIds": {}, @@ -536,7 +592,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "elements": { "added": {}, "removed": { - "id691": { + "id877": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -575,6 +631,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "strokeStyle": "solid", "strokeWidth": 2, "type": "arrow", + "version": 4, "width": 100, "x": 0, "y": 0, @@ -586,7 +643,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl }, "updated": {}, }, - "id": "id693", + "id": "id879", }, ] `; @@ -672,14 +729,14 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id668": true, + "id844": true, }, "resizingElement": null, "scrollX": 0, "scrollY": 0, "searchMatches": null, "selectedElementIds": { - "id668": true, + "id844": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -717,7 +774,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 100, - "id": "id664", + "id": "id840", "index": "a0", "isDeleted": false, "link": null, @@ -749,7 +806,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 100, - "id": "id665", + "id": "id841", "index": "a1", "isDeleted": false, "link": null, @@ -784,7 +841,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 0, - "id": "id668", + "id": "id844", "index": "a2", "isDeleted": false, "lastCommittedPoint": null, @@ -797,7 +854,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl 0, ], [ - 100, + "99.29289", 0, ], ], @@ -813,8 +870,8 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "type": "arrow", "updated": 1, "version": 33, - "width": 100, - "x": "149.29289", + "width": "99.29289", + "x": 150, "y": 0, } `; @@ -836,20 +893,30 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "added": {}, "removed": {}, "updated": { - "id665": { + "id840": { + "deleted": { + "version": 18, + }, + "inserted": { + "version": 16, + }, + }, + "id841": { "deleted": { "boundElements": [], + "version": 9, }, "inserted": { "boundElements": [ { - "id": "id668", + "id": "id844", "type": "arrow", }, ], + "version": 8, }, }, - "id668": { + "id844": { "deleted": { "endBinding": null, "points": [ @@ -862,10 +929,12 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl 0, ], ], + "version": 32, + "width": 100, }, "inserted": { "endBinding": { - "elementId": "id665", + "elementId": "id841", "focus": -0, "gap": 1, }, @@ -879,11 +948,13 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl 0, ], ], + "version": 30, + "width": 0, }, }, }, }, - "id": "id685", + "id": "id870", }, { "appState": AppStateDelta { @@ -896,20 +967,22 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "added": {}, "removed": {}, "updated": { - "id664": { + "id840": { "deleted": { "boundElements": [], + "version": 19, }, "inserted": { "boundElements": [ { - "id": "id668", + "id": "id844", "type": "arrow", }, ], + "version": 18, }, }, - "id668": { + "id844": { "deleted": { "points": [ [ @@ -917,11 +990,14 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl 0, ], [ - 100, + "99.29289", 0, ], ], "startBinding": null, + "version": 33, + "width": "99.29289", + "x": 150, }, "inserted": { "points": [ @@ -935,15 +1011,18 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl ], ], "startBinding": { - "elementId": "id664", + "elementId": "id840", "focus": 0, "gap": 1, }, + "version": 32, + "width": 100, + "x": "149.29289", }, }, }, }, - "id": "id686", + "id": "id872", }, ] `; @@ -960,7 +1039,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "elements": { "added": {}, "removed": { - "id664": { + "id840": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -983,6 +1062,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 100, "x": -100, "y": -50, @@ -991,7 +1071,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "isDeleted": true, }, }, - "id665": { + "id841": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -1014,6 +1094,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 100, "x": 100, "y": -50, @@ -1025,16 +1106,16 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl }, "updated": {}, }, - "id": "id667", + "id": "id843", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id668": true, + "id844": true, }, - "selectedLinearElementId": "id668", + "selectedLinearElementId": "id844", }, "inserted": { "selectedElementIds": {}, @@ -1045,7 +1126,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "elements": { "added": {}, "removed": { - "id668": { + "id844": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -1084,6 +1165,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "strokeStyle": "solid", "strokeWidth": 2, "type": "arrow", + "version": 4, "width": 100, "x": 0, "y": 0, @@ -1095,7 +1177,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl }, "updated": {}, }, - "id": "id670", + "id": "id846", }, ] `; @@ -1224,7 +1306,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "elbowed": false, "endArrowhead": null, "endBinding": { - "elementId": "id712", + "elementId": "id908", "fixedPoint": [ "0.50000", 1, @@ -1236,7 +1318,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": "1.30038", - "id": "id715", + "id": "id911", "index": "Zz", "isDeleted": false, "lastCommittedPoint": null, @@ -1259,7 +1341,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl }, "startArrowhead": null, "startBinding": { - "elementId": "id711", + "elementId": "id907", "fixedPoint": [ 1, "0.50000", @@ -1285,7 +1367,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "backgroundColor": "transparent", "boundElements": [ { - "id": "id715", + "id": "id911", "type": "arrow", }, ], @@ -1294,7 +1376,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 100, - "id": "id711", + "id": "id907", "index": "a0", "isDeleted": false, "link": null, @@ -1322,7 +1404,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "backgroundColor": "transparent", "boundElements": [ { - "id": "id715", + "id": "id911", "type": "arrow", }, ], @@ -1331,7 +1413,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 100, - "id": "id712", + "id": "id908", "index": "a1", "isDeleted": false, "link": null, @@ -1371,74 +1453,32 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "elements": { "added": {}, "removed": { - "id711": { + "id907": { "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, + "version": 7, }, "inserted": { "isDeleted": true, + "version": 6, }, }, - "id712": { + "id908": { "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, + "version": 7, }, "inserted": { "isDeleted": true, + "version": 6, }, }, }, "updated": { - "id715": { + "id911": { "deleted": { "endBinding": { - "elementId": "id712", + "elementId": "id908", "fixedPoint": [ "0.50000", 1, @@ -1446,8 +1486,19 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "focus": 0, "gap": 1, }, + "height": "1.30038", + "points": [ + [ + 0, + 0, + ], + [ + "98.58579", + "1.30038", + ], + ], "startBinding": { - "elementId": "id711", + "elementId": "id907", "fixedPoint": [ 1, "0.50000", @@ -1455,15 +1506,32 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "focus": 0, "gap": 1, }, + "version": 11, + "width": "98.58579", + "x": "0.70711", }, "inserted": { "endBinding": null, + "height": 100, + "points": [ + [ + 0, + 0, + ], + [ + 100, + 100, + ], + ], "startBinding": null, + "version": 8, + "width": 100, + "x": 0, }, }, }, }, - "id": "id719", + "id": "id919", }, ] `; @@ -1592,7 +1660,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "elbowed": false, "endArrowhead": null, "endBinding": { - "elementId": "id721", + "elementId": "id921", "fixedPoint": [ 1, "0.50000", @@ -1604,7 +1672,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": "1.30038", - "id": "id725", + "id": "id926", "index": "a0", "isDeleted": false, "lastCommittedPoint": null, @@ -1627,7 +1695,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl }, "startArrowhead": null, "startBinding": { - "elementId": "id720", + "elementId": "id920", "fixedPoint": [ "0.50000", 1, @@ -1653,7 +1721,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "backgroundColor": "transparent", "boundElements": [ { - "id": "id725", + "id": "id926", "type": "arrow", }, ], @@ -1662,8 +1730,8 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 100, - "id": "id720", - "index": "a0V", + "id": "id920", + "index": "a1", "isDeleted": false, "link": null, "locked": false, @@ -1677,7 +1745,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "strokeWidth": 2, "type": "rectangle", "updated": 1, - "version": 12, + "version": 11, "width": 100, "x": -100, "y": -50, @@ -1690,7 +1758,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "backgroundColor": "transparent", "boundElements": [ { - "id": "id725", + "id": "id926", "type": "arrow", }, ], @@ -1699,8 +1767,8 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 100, - "id": "id721", - "index": "a1", + "id": "id921", + "index": "a2", "isDeleted": false, "link": null, "locked": false, @@ -1739,16 +1807,10 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "elements": { "added": {}, "removed": { - "id725": { + "id926": { "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "elbowed": false, - "endArrowhead": null, "endBinding": { - "elementId": "id721", + "elementId": "id921", "fixedPoint": [ 1, "0.50000", @@ -1756,16 +1818,8 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "focus": 0, "gap": 1, }, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": "11.27227", - "index": "a0", + "height": "1.30038", "isDeleted": false, - "lastCommittedPoint": null, - "link": null, - "locked": false, - "opacity": 100, "points": [ [ 0, @@ -1773,16 +1827,11 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl ], [ "98.58579", - "11.27227", + "1.30038", ], ], - "roughness": 1, - "roundness": { - "type": 2, - }, - "startArrowhead": null, "startBinding": { - "elementId": "id720", + "elementId": "id920", "fixedPoint": [ "0.50000", 1, @@ -1790,49 +1839,81 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "focus": 0, "gap": 1, }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "arrow", + "version": 11, "width": "98.58579", "x": "0.70711", - "y": 0, }, "inserted": { + "endBinding": { + "elementId": "id921", + "fixedPoint": [ + 1, + "0.50000", + ], + "focus": 0, + "gap": 1, + }, + "height": 100, "isDeleted": true, + "points": [ + [ + 0, + 0, + ], + [ + 100, + 100, + ], + ], + "startBinding": { + "elementId": "id920", + "fixedPoint": [ + "0.50000", + 1, + ], + "focus": 0, + "gap": 1, + }, + "version": 8, + "width": 100, + "x": 0, }, }, }, "updated": { - "id720": { + "id920": { "deleted": { "boundElements": [ { - "id": "id725", + "id": "id926", "type": "arrow", }, ], + "version": 11, }, "inserted": { "boundElements": [], + "version": 8, }, }, - "id721": { + "id921": { "deleted": { "boundElements": [ { - "id": "id725", + "id": "id926", "type": "arrow", }, ], + "version": 11, }, "inserted": { "boundElements": [], + "version": 8, }, }, }, }, - "id": "id731", + "id": "id936", }, ] `; @@ -1962,7 +2043,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 100, - "id": "id732", + "id": "id937", "index": "a0", "isDeleted": false, "link": null, @@ -1994,7 +2075,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 100, - "id": "id733", + "id": "id938", "index": "a1", "isDeleted": false, "link": null, @@ -2034,7 +2115,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "elements": { "added": {}, "removed": { - "id732": { + "id937": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -2057,6 +2138,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 100, "x": -100, "y": -50, @@ -2065,7 +2147,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "isDeleted": true, }, }, - "id733": { + "id938": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -2088,6 +2170,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 100, "x": 100, "y": -50, @@ -2099,7 +2182,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl }, "updated": {}, }, - "id": "id735", + "id": "id940", }, ] `; @@ -2190,7 +2273,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "scrollY": 0, "searchMatches": null, "selectedElementIds": { - "id740": true, + "id945": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -2224,7 +2307,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "backgroundColor": "transparent", "boundElements": [ { - "id": "id740", + "id": "id945", "type": "arrow", }, ], @@ -2233,7 +2316,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 100, - "id": "id736", + "id": "id941", "index": "a0", "isDeleted": false, "link": null, @@ -2261,7 +2344,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "backgroundColor": "transparent", "boundElements": [ { - "id": "id740", + "id": "id945", "type": "arrow", }, ], @@ -2270,7 +2353,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": 100, - "id": "id737", + "id": "id942", "index": "a1", "isDeleted": false, "link": null, @@ -2301,7 +2384,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "elbowed": false, "endArrowhead": "arrow", "endBinding": { - "elementId": "id737", + "elementId": "id942", "focus": -0, "gap": 1, }, @@ -2309,7 +2392,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "frameId": null, "groupIds": [], "height": "374.05754", - "id": "id740", + "id": "id945", "index": "a2", "isDeleted": false, "lastCommittedPoint": null, @@ -2332,7 +2415,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl }, "startArrowhead": null, "startBinding": { - "elementId": "id736", + "elementId": "id941", "focus": 0, "gap": 1, }, @@ -2366,7 +2449,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "elements": { "added": {}, "removed": { - "id736": { + "id941": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -2389,6 +2472,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 100, "x": -100, "y": -50, @@ -2397,7 +2481,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "isDeleted": true, }, }, - "id737": { + "id942": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -2420,6 +2504,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 100, "x": 100, "y": -50, @@ -2431,16 +2516,16 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl }, "updated": {}, }, - "id": "id739", + "id": "id944", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id740": true, + "id945": true, }, - "selectedLinearElementId": "id740", + "selectedLinearElementId": "id945", }, "inserted": { "selectedElementIds": {}, @@ -2451,29 +2536,28 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "elements": { "added": {}, "removed": { - "id740": { + "id945": { "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "elbowed": false, - "endArrowhead": "arrow", - "endBinding": { - "elementId": "id737", - "focus": -0, - "gap": 1, - }, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 0, - "index": "a2", + "height": "374.05754", "isDeleted": false, - "lastCommittedPoint": null, - "link": null, - "locked": false, - "opacity": 100, + "points": [ + [ + 0, + 0, + ], + [ + "502.78936", + "-374.05754", + ], + ], + "version": 10, + "width": "502.78936", + "x": "-0.83465", + "y": "-36.58211", + }, + "inserted": { + "height": 0, + "isDeleted": true, "points": [ [ 0, @@ -2484,59 +2568,47 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl 0, ], ], - "roughness": 1, - "roundness": { - "type": 2, - }, - "startArrowhead": null, - "startBinding": { - "elementId": "id736", - "focus": 0, - "gap": 1, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "arrow", + "version": 7, "width": 100, "x": 0, "y": 0, }, - "inserted": { - "isDeleted": true, - }, }, }, "updated": { - "id736": { + "id941": { "deleted": { "boundElements": [ { - "id": "id740", + "id": "id945", "type": "arrow", }, ], + "version": 7, }, "inserted": { "boundElements": [], + "version": 4, }, }, - "id737": { + "id942": { "deleted": { "boundElements": [ { - "id": "id740", + "id": "id945", "type": "arrow", }, ], + "version": 8, }, "inserted": { "boundElements": [], + "version": 5, }, }, }, }, - "id": "id744", + "id": "id951", }, ] `; @@ -2662,7 +2734,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "backgroundColor": "transparent", "boundElements": [ { - "id": "id618", + "id": "id774", "type": "text", }, ], @@ -2671,7 +2743,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id613", + "id": "id768", "index": "a0", "isDeleted": false, "link": null, @@ -2686,7 +2758,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "strokeWidth": 2, "type": "rectangle", "updated": 1, - "version": 7, + "version": 5, "width": 100, "x": 10, "y": 10, @@ -2707,7 +2779,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id614", + "id": "id769", "index": "a1", "isDeleted": false, "lineHeight": "1.25000", @@ -2740,7 +2812,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id613", + "containerId": "id768", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -2748,7 +2820,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 25, - "id": "id618", + "id": "id774", "index": "a2", "isDeleted": false, "lineHeight": "1.25000", @@ -2767,7 +2839,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "textAlign": "left", "type": "text", "updated": 1, - "version": 11, + "version": 7, "verticalAlign": "top", "width": 30, "x": 15, @@ -2777,7 +2849,7 @@ 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] 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] number of renders 1`] = `9`; 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`] = ` [ @@ -2792,48 +2864,17 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "added": {}, "removed": {}, "updated": { - "id613": { + "id774": { "deleted": { - "isDeleted": false, + "version": 7, }, "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, - }, - }, - "id614": { - "deleted": { - "containerId": null, - }, - "inserted": { - "containerId": null, + "version": 5, }, }, }, }, - "id": "id622", + "id": "id778", }, ] `; @@ -2961,7 +3002,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "backgroundColor": "transparent", "boundElements": [ { - "id": "id628", + "id": "id785", "type": "text", }, ], @@ -2970,7 +3011,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id623", + "id": "id779", "index": "Zz", "isDeleted": false, "link": null, @@ -2985,7 +3026,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "strokeWidth": 2, "type": "rectangle", "updated": 1, - "version": 11, + "version": 7, "width": 100, "x": 10, "y": 10, @@ -2998,7 +3039,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id623", + "containerId": "id779", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -3006,7 +3047,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id624", + "id": "id780", "index": "a0", "isDeleted": true, "lineHeight": "1.25000", @@ -3039,7 +3080,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id623", + "containerId": "id779", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -3047,7 +3088,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 25, - "id": "id628", + "id": "id785", "index": "a1", "isDeleted": false, "lineHeight": "1.25000", @@ -3066,7 +3107,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "textAlign": "left", "type": "text", "updated": 1, - "version": 11, + "version": 7, "verticalAlign": "top", "width": 30, "x": 15, @@ -3089,35 +3130,23 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and }, "elements": { "added": { - "id624": { + "id780": { "deleted": { - "containerId": "id623", + "containerId": "id779", "isDeleted": true, + "version": 9, }, "inserted": { "containerId": null, "isDeleted": false, + "version": 8, }, }, }, "removed": {}, - "updated": { - "id623": { - "deleted": { - "boundElements": [], - }, - "inserted": { - "boundElements": [ - { - "id": "id624", - "type": "text", - }, - ], - }, - }, - }, + "updated": {}, }, - "id": "id632", + "id": "id793", }, ] `; @@ -3245,7 +3274,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "backgroundColor": "transparent", "boundElements": [ { - "id": "id582", + "id": "id720", "type": "text", }, ], @@ -3254,7 +3283,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id577", + "id": "id714", "index": "a0", "isDeleted": false, "link": null, @@ -3282,7 +3311,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id577", + "containerId": "id714", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -3290,7 +3319,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 25, - "id": "id582", + "id": "id720", "index": "a0V", "isDeleted": false, "lineHeight": "1.25000", @@ -3330,8 +3359,8 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "fontSize": 20, "frameId": null, "groupIds": [], - "height": 25, - "id": "id578", + "height": 100, + "id": "id715", "index": "a1", "isDeleted": false, "lineHeight": "1.25000", @@ -3352,7 +3381,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "updated": 1, "version": 9, "verticalAlign": "top", - "width": 80, + "width": 100, "x": 15, "y": 15, } @@ -3375,43 +3404,61 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "added": {}, "removed": {}, "updated": { - "id577": { + "id714": { "deleted": { "boundElements": [ { - "id": "id582", + "id": "id720", "type": "text", }, ], + "version": 10, }, "inserted": { "boundElements": [ { - "id": "id578", + "id": "id715", "type": "text", }, ], + "version": 9, }, }, - "id578": { + "id715": { "deleted": { "containerId": null, + "height": 100, + "version": 9, + "width": 100, }, "inserted": { - "containerId": "id577", + "containerId": "id714", + "height": 25, + "version": 8, + "width": 80, }, }, - "id582": { + "id720": { "deleted": { - "containerId": "id577", + "containerId": "id714", + "height": 25, + "version": 7, + "width": 30, + "x": 15, + "y": 15, }, "inserted": { "containerId": null, + "height": 100, + "version": 6, + "width": 100, + "x": 0, + "y": 0, }, }, }, }, - "id": "id586", + "id": "id728", }, ] `; @@ -3543,7 +3590,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id587", + "id": "id729", "index": "a0", "isDeleted": false, "link": null, @@ -3571,7 +3618,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "backgroundColor": "transparent", "boundElements": [ { - "id": "id588", + "id": "id730", "type": "text", }, ], @@ -3580,7 +3627,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 60, - "id": "id592", + "id": "id735", "index": "a0V", "isDeleted": false, "link": null, @@ -3608,7 +3655,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id592", + "containerId": "id735", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -3616,7 +3663,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 50, - "id": "id588", + "id": "id730", "index": "a1", "isDeleted": false, "lineHeight": "1.25000", @@ -3636,7 +3683,7 @@ pasa", "textAlign": "left", "type": "text", "updated": 1, - "version": 13, + "version": 11, "verticalAlign": "top", "width": 40, "x": 105, @@ -3661,43 +3708,62 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "added": {}, "removed": {}, "updated": { - "id587": { + "id729": { "deleted": { "boundElements": [], + "version": 8, }, "inserted": { "boundElements": [ { - "id": "id588", + "id": "id730", "type": "text", }, ], + "version": 7, }, }, - "id588": { + "id730": { "deleted": { - "containerId": "id592", + "containerId": "id735", + "height": 50, + "text": "que +pasa", + "version": 11, + "width": 40, + "x": 105, + "y": 105, }, "inserted": { - "containerId": "id587", + "containerId": "id729", + "height": 25, + "text": "que pasa", + "version": 10, + "width": 80, + "x": 15, + "y": 15, }, }, - "id592": { + "id735": { "deleted": { "boundElements": [ { - "id": "id588", + "id": "id730", "type": "text", }, ], + "height": 60, + "version": 8, }, "inserted": { "boundElements": [], + "height": 50, + "version": 7, }, }, }, }, - "id": "id596", + "id": "id743", }, ] `; @@ -3829,7 +3895,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id568", + "id": "id700", "index": "a0", "isDeleted": false, "link": null, @@ -3864,8 +3930,8 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "fontSize": 20, "frameId": null, "groupIds": [], - "height": 25, - "id": "id569", + "height": 100, + "id": "id701", "index": "a1", "isDeleted": false, "lineHeight": "1.25000", @@ -3886,8 +3952,8 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "updated": 1, "version": 10, "verticalAlign": "top", - "width": 80, - "x": 40, + "width": 100, + "x": 25, "y": 15, } `; @@ -3909,30 +3975,40 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "added": {}, "removed": {}, "updated": { - "id568": { + "id700": { "deleted": { "boundElements": [], + "version": 9, }, "inserted": { "boundElements": [ { - "id": "id569", + "id": "id701", "type": "text", }, ], + "version": 8, }, }, - "id569": { + "id701": { "deleted": { "containerId": null, + "height": 100, + "version": 10, + "width": 100, + "x": 25, }, "inserted": { - "containerId": "id568", + "containerId": "id700", + "height": 25, + "version": 9, + "width": 80, + "x": 40, }, }, }, }, - "id": "id576", + "id": "id713", }, ] `; @@ -4060,7 +4136,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "backgroundColor": "transparent", "boundElements": [ { - "id": "id598", + "id": "id745", "type": "text", }, ], @@ -4069,7 +4145,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id597", + "id": "id744", "index": "a0", "isDeleted": false, "link": null, @@ -4097,7 +4173,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id597", + "containerId": "id744", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -4105,7 +4181,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 25, - "id": "id598", + "id": "id745", "index": "a1", "isDeleted": false, "lineHeight": "1.25000", @@ -4150,50 +4226,35 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "elements": { "added": {}, "removed": { - "id597": { + "id744": { "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, + "version": 7, }, "inserted": { "isDeleted": true, + "version": 6, }, }, }, "updated": { - "id598": { + "id745": { "deleted": { - "containerId": "id597", + "containerId": "id744", + "height": 25, + "version": 12, + "width": 80, }, "inserted": { "containerId": null, + "height": 100, + "version": 9, + "width": 100, }, }, }, }, - "id": "id604", + "id": "id755", }, ] `; @@ -4319,7 +4380,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "backgroundColor": "transparent", "boundElements": [ { - "id": "id606", + "id": "id757", "type": "text", }, ], @@ -4328,8 +4389,8 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id605", - "index": "Zz", + "id": "id756", + "index": "a0", "isDeleted": false, "link": null, "locked": false, @@ -4356,7 +4417,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id605", + "containerId": "id756", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -4364,8 +4425,8 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 25, - "id": "id606", - "index": "a0", + "id": "id757", + "index": "a1", "isDeleted": false, "lineHeight": "1.25000", "link": null, @@ -4409,64 +4470,40 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "elements": { "added": {}, "removed": { - "id606": { + "id757": { "deleted": { - "angle": 0, - "autoResize": true, - "backgroundColor": "transparent", - "boundElements": null, - "containerId": "id605", - "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", + "version": 8, "width": 80, - "x": 15, - "y": 15, }, "inserted": { + "height": 100, "isDeleted": true, + "version": 7, + "width": 100, }, }, }, "updated": { - "id605": { + "id756": { "deleted": { "boundElements": [ { - "id": "id606", + "id": "id757", "type": "text", }, ], + "version": 11, }, "inserted": { "boundElements": [], + "version": 8, }, }, }, }, - "id": "id612", + "id": "id767", }, ] `; @@ -4592,7 +4629,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "backgroundColor": "transparent", "boundElements": [ { - "id": "id658", + "id": "id831", "type": "text", }, ], @@ -4601,7 +4638,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id657", + "id": "id830", "index": "Zz", "isDeleted": false, "link": null, @@ -4629,7 +4666,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id657", + "containerId": "id830", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -4637,7 +4674,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 25, - "id": "id658", + "id": "id831", "index": "a0", "isDeleted": false, "lineHeight": "1.25000", @@ -4656,7 +4693,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "textAlign": "left", "type": "text", "updated": 1, - "version": 7, + "version": 9, "verticalAlign": "top", "width": 80, "x": 15, @@ -4681,21 +4718,17 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "added": {}, "removed": {}, "updated": { - "id658": { + "id831": { "deleted": { - "angle": 0, - "x": 15, - "y": 15, + "version": 9, }, "inserted": { - "angle": 0, - "x": 15, - "y": 15, + "version": 7, }, }, }, }, - "id": "id663", + "id": "id839", }, ] `; @@ -4823,7 +4856,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "backgroundColor": "transparent", "boundElements": [ { - "id": "id650", + "id": "id819", "type": "text", }, ], @@ -4832,7 +4865,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id649", + "id": "id818", "index": "a0", "isDeleted": false, "link": null, @@ -4860,7 +4893,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id649", + "containerId": "id818", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -4868,7 +4901,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 25, - "id": "id650", + "id": "id819", "index": "a1", "isDeleted": false, "lineHeight": "1.25000", @@ -4887,7 +4920,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "textAlign": "left", "type": "text", "updated": 1, - "version": 6, + "version": 7, "verticalAlign": "top", "width": 80, "x": 205, @@ -4914,21 +4947,37 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "added": {}, "removed": {}, "updated": { - "id649": { + "id818": { "deleted": { "angle": 90, + "version": 8, "x": 200, "y": 200, }, "inserted": { "angle": 0, + "version": 7, "x": 10, "y": 10, }, }, + "id819": { + "deleted": { + "angle": 90, + "version": 7, + "x": 205, + "y": 205, + }, + "inserted": { + "angle": 0, + "version": 6, + "x": 15, + "y": 15, + }, + }, }, }, - "id": "id656", + "id": "id829", }, ] `; @@ -5058,7 +5107,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id633", + "id": "id794", "index": "a0", "isDeleted": false, "link": null, @@ -5086,7 +5135,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id633", + "containerId": "id794", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -5094,7 +5143,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id634", + "id": "id795", "index": "a1", "isDeleted": true, "lineHeight": "1.25000", @@ -5139,25 +5188,27 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "elements": { "added": {}, "removed": { - "id633": { + "id794": { "deleted": { "boundElements": [], "isDeleted": false, + "version": 8, }, "inserted": { "boundElements": [ { - "id": "id634", + "id": "id795", "type": "text", }, ], "isDeleted": true, + "version": 7, }, }, }, "updated": {}, }, - "id": "id640", + "id": "id805", }, ] `; @@ -5283,7 +5334,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "backgroundColor": "transparent", "boundElements": [ { - "id": "id642", + "id": "id807", "type": "text", }, ], @@ -5292,7 +5343,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id641", + "id": "id806", "index": "Zz", "isDeleted": true, "link": null, @@ -5328,7 +5379,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "frameId": null, "groupIds": [], "height": 100, - "id": "id642", + "id": "id807", "index": "a0", "isDeleted": false, "lineHeight": "1.25000", @@ -5373,20 +5424,22 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and "elements": { "added": {}, "removed": { - "id642": { + "id807": { "deleted": { "containerId": null, "isDeleted": false, + "version": 8, }, "inserted": { - "containerId": "id641", + "containerId": "id806", "isDeleted": true, + "version": 7, }, }, }, "updated": {}, }, - "id": "id648", + "id": "id817", }, ] `; @@ -5516,7 +5569,7 @@ exports[`history > multiplayer undo/redo > conflicts in frames and their childre "frameId": null, "groupIds": [], "height": 100, - "id": "id746", + "id": "id953", "index": "Zz", "isDeleted": false, "link": null, @@ -5548,7 +5601,7 @@ exports[`history > multiplayer undo/redo > conflicts in frames and their childre "frameId": null, "groupIds": [], "height": 500, - "id": "id745", + "id": "id952", "index": "a0", "isDeleted": true, "link": null, @@ -5589,41 +5642,20 @@ exports[`history > multiplayer undo/redo > conflicts in frames and their childre "elements": { "added": {}, "removed": { - "id746": { + "id953": { "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, + "version": 8, }, "inserted": { "isDeleted": true, + "version": 7, }, }, }, "updated": {}, }, - "id": "id755", + "id": "id967", }, { "appState": AppStateDelta { @@ -5636,17 +5668,17 @@ exports[`history > multiplayer undo/redo > conflicts in frames and their childre "added": {}, "removed": {}, "updated": { - "id746": { + "id953": { "deleted": { - "frameId": "id745", + "version": 10, }, "inserted": { - "frameId": null, + "version": 8, }, }, }, }, - "id": "id756", + "id": "id969", }, ] `; @@ -5732,7 +5764,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id469": true, + "id583": true, }, "resizingElement": null, "scrollX": 0, @@ -5777,9 +5809,9 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "A", ], "height": 100, - "id": "id468", + "id": "id582", "index": "a0", - "isDeleted": false, + "isDeleted": true, "link": null, "locked": false, "opacity": 100, @@ -5792,7 +5824,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "strokeWidth": 2, "type": "rectangle", "updated": 1, - "version": 5, + "version": 3, "width": 100, "x": 0, "y": 0, @@ -5811,7 +5843,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "A", ], "height": 100, - "id": "id469", + "id": "id583", "index": "a1", "isDeleted": true, "link": null, @@ -5826,7 +5858,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "strokeWidth": 2, "type": "rectangle", "updated": 1, - "version": 4, + "version": 3, "width": 100, "x": 100, "y": 100, @@ -5835,154 +5867,11 @@ 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] 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] number of renders 1`] = `9`; 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`] = ` -[ - { - "appState": AppStateDelta { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id468": true, - "id469": true, - }, - "selectedGroupIds": { - "A": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - "selectedGroupIds": {}, - }, - }, - }, - "elements": { - "added": {}, - "removed": {}, - "updated": { - "id468": { - "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, - }, - }, - "id469": { - "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, - }, - }, - }, - }, - "id": "id481", - }, - { - "appState": AppStateDelta { - "delta": Delta { - "deleted": { - "editingGroupId": "A", - "selectedElementIds": {}, - "selectedGroupIds": {}, - }, - "inserted": { - "editingGroupId": null, - "selectedElementIds": { - "id468": true, - }, - "selectedGroupIds": { - "A": true, - }, - }, - }, - }, - "elements": { - "added": {}, - "removed": {}, - "updated": {}, - }, - "id": "id482", - }, - { - "appState": AppStateDelta { - "delta": Delta { - "deleted": { - "editingGroupId": null, - "selectedElementIds": {}, - }, - "inserted": { - "editingGroupId": "A", - "selectedElementIds": { - "id469": true, - }, - }, - }, - }, - "elements": { - "added": {}, - "removed": {}, - "updated": {}, - }, - "id": "id485", - }, -] -`; +exports[`history > multiplayer undo/redo > should iterate through the history when editing group contains only remotely deleted elements > [end of test] undo stack 1`] = `[]`; exports[`history > multiplayer undo/redo > should iterate through the history when element changes relate only to remotely deleted elements > [end of test] appState 1`] = ` { @@ -6065,7 +5954,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id418": true, + "id525": true, }, "resizingElement": null, "scrollX": 0, @@ -6108,7 +5997,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "frameId": null, "groupIds": [], "height": 10, - "id": "id410", + "id": "id517", "index": "a0", "isDeleted": false, "link": null, @@ -6140,7 +6029,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "frameId": null, "groupIds": [], "height": 10, - "id": "id413", + "id": "id520", "index": "a1", "isDeleted": true, "link": null, @@ -6172,7 +6061,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "frameId": null, "groupIds": [], "height": 10, - "id": "id418", + "id": "id525", "index": "a2", "isDeleted": true, "link": null, @@ -6196,7 +6085,7 @@ 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] 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] number of renders 1`] = `18`; 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`] = `[]`; @@ -6207,7 +6096,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "delta": Delta { "deleted": { "selectedElementIds": { - "id410": true, + "id517": true, }, }, "inserted": { @@ -6218,7 +6107,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "elements": { "added": {}, "removed": { - "id410": { + "id517": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -6241,6 +6130,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 10, "y": 0, @@ -6252,19 +6142,17 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh }, "updated": {}, }, - "id": "id412", + "id": "id519", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { - "selectedElementIds": { - "id413": true, - }, + "selectedElementIds": {}, }, "inserted": { "selectedElementIds": { - "id410": true, + "id517": true, }, }, }, @@ -6272,41 +6160,9 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "elements": { "added": {}, "removed": {}, - "updated": { - "id413": { - "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, - }, - }, - }, + "updated": {}, }, - "id": "id428", + "id": "id540", }, { "appState": AppStateDelta { @@ -6319,71 +6175,19 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "added": {}, "removed": {}, "updated": { - "id413": { + "id520": { "deleted": { "backgroundColor": "#ffc9c9", + "version": 7, }, "inserted": { "backgroundColor": "transparent", + "version": 6, }, }, }, }, - "id": "id429", - }, - { - "appState": AppStateDelta { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id418": true, - }, - }, - "inserted": { - "selectedElementIds": { - "id413": true, - }, - }, - }, - }, - "elements": { - "added": {}, - "removed": {}, - "updated": { - "id418": { - "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, - }, - }, - }, - }, - "id": "id430", + "id": "id542", }, { "appState": AppStateDelta { @@ -6396,19 +6200,21 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "added": {}, "removed": {}, "updated": { - "id418": { + "id525": { "deleted": { + "version": 7, "x": 50, "y": 50, }, "inserted": { + "version": 6, "x": 30, "y": 30, }, }, }, }, - "id": "id431", + "id": "id545", }, ] `; @@ -6494,15 +6300,15 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id433": true, + "id547": true, }, "resizingElement": null, "scrollX": 0, "scrollY": 0, "searchMatches": null, "selectedElementIds": { - "id433": true, - "id434": true, + "id547": true, + "id548": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -6540,7 +6346,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "frameId": null, "groupIds": [], "height": 100, - "id": "id432", + "id": "id546", "index": "a0", "isDeleted": false, "link": null, @@ -6572,7 +6378,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "frameId": null, "groupIds": [], "height": 100, - "id": "id433", + "id": "id547", "index": "a1", "isDeleted": false, "link": null, @@ -6604,7 +6410,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "frameId": null, "groupIds": [], "height": 100, - "id": "id434", + "id": "id548", "index": "a2", "isDeleted": false, "link": null, @@ -6639,7 +6445,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "delta": Delta { "deleted": { "selectedElementIds": { - "id432": true, + "id546": true, }, }, "inserted": { @@ -6650,7 +6456,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "elements": { "added": {}, "removed": { - "id432": { + "id546": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -6673,6 +6479,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 100, "x": 10, "y": 10, @@ -6681,7 +6488,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "isDeleted": true, }, }, - "id433": { + "id547": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -6704,6 +6511,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 100, "x": 20, "y": 20, @@ -6712,7 +6520,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "isDeleted": true, }, }, - "id434": { + "id548": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -6735,6 +6543,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 100, "x": 30, "y": 30, @@ -6746,19 +6555,17 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh }, "updated": {}, }, - "id": "id437", + "id": "id551", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { - "selectedElementIds": { - "id433": true, - }, + "selectedElementIds": {}, }, "inserted": { "selectedElementIds": { - "id432": true, + "id546": true, }, }, }, @@ -6768,14 +6575,15 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "removed": {}, "updated": {}, }, - "id": "id450", + "id": "id567", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id434": true, + "id547": true, + "id548": true, }, }, "inserted": { @@ -6788,7 +6596,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "removed": {}, "updated": {}, }, - "id": "id451", + "id": "id569", }, ] `; @@ -6881,17 +6689,9 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "scrollX": 0, "scrollY": 0, "searchMatches": null, - "selectedElementIds": { - "id452": true, - "id453": true, - "id454": true, - "id455": true, - }, + "selectedElementIds": {}, "selectedElementsAreBeingDragged": false, - "selectedGroupIds": { - "A": true, - "B": true, - }, + "selectedGroupIds": {}, "selectionElement": null, "shouldCacheIgnoreZoom": false, "showHyperlinkPopup": false, @@ -6928,7 +6728,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "A", ], "height": 100, - "id": "id452", + "id": "id570", "index": "a0", "isDeleted": false, "link": null, @@ -6962,7 +6762,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "A", ], "height": 100, - "id": "id453", + "id": "id571", "index": "a1", "isDeleted": false, "link": null, @@ -6984,134 +6784,13 @@ 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] element 2 1`] = ` -{ - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [ - "B", - ], - "height": 100, - "id": "id454", - "index": "a2", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 2, - "width": 100, - "x": 0, - "y": 0, -} -`; +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`] = `2`; -exports[`history > multiplayer undo/redo > should iterate through the history when selected groups contain only remotely deleted elements > [end of test] element 3 1`] = ` -{ - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [ - "B", - ], - "height": 100, - "id": "id455", - "index": "a3", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 2, - "width": 100, - "x": 0, - "y": 0, -} -`; - -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] number of renders 1`] = `11`; 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`] = ` -[ - { - "appState": AppStateDelta { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id452": true, - "id453": true, - }, - "selectedGroupIds": { - "A": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - "selectedGroupIds": {}, - }, - }, - }, - "elements": { - "added": {}, - "removed": {}, - "updated": {}, - }, - "id": "id466", - }, - { - "appState": AppStateDelta { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id454": true, - "id455": true, - }, - "selectedGroupIds": { - "B": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - "selectedGroupIds": {}, - }, - }, - }, - "elements": { - "added": {}, - "removed": {}, - "updated": {}, - }, - "id": "id467", - }, -] -`; +exports[`history > multiplayer undo/redo > should iterate through the history when selected groups contain only remotely deleted elements > [end of test] undo stack 1`] = `[]`; exports[`history > multiplayer undo/redo > should iterate through the history when selected or editing linear element was remotely deleted > [end of test] appState 1`] = ` { @@ -7199,7 +6878,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "scrollY": 0, "searchMatches": null, "selectedElementIds": { - "id486": true, + "id595": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -7240,7 +6919,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "frameId": null, "groupIds": [], "height": 10, - "id": "id486", + "id": "id595", "index": "a0", "isDeleted": true, "lastCommittedPoint": [ @@ -7291,7 +6970,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "delta": Delta { "deleted": { "selectedElementIds": { - "id486": true, + "id595": true, }, }, "inserted": { @@ -7302,7 +6981,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "elements": { "added": {}, "removed": { - "id486": { + "id595": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -7344,6 +7023,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "strokeStyle": "solid", "strokeWidth": 2, "type": "arrow", + "version": 6, "width": 10, "x": 0, "y": 0, @@ -7355,61 +7035,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh }, "updated": {}, }, - "id": "id488", - }, - { - "appState": AppStateDelta { - "delta": Delta { - "deleted": { - "selectedLinearElementId": "id486", - }, - "inserted": { - "selectedLinearElementId": null, - }, - }, - }, - "elements": { - "added": {}, - "removed": {}, - "updated": {}, - }, - "id": "id498", - }, - { - "appState": AppStateDelta { - "delta": Delta { - "deleted": { - "editingLinearElementId": "id486", - }, - "inserted": { - "editingLinearElementId": null, - }, - }, - }, - "elements": { - "added": {}, - "removed": {}, - "updated": {}, - }, - "id": "id499", - }, - { - "appState": AppStateDelta { - "delta": Delta { - "deleted": { - "editingLinearElementId": null, - }, - "inserted": { - "editingLinearElementId": "id486", - }, - }, - }, - "elements": { - "added": {}, - "removed": {}, - "updated": {}, - }, - "id": "id500", + "id": "id597", }, ] `; @@ -7536,7 +7162,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "frameId": null, "groupIds": [], "height": 10, - "id": "id401", + "id": "id505", "index": "a0", "isDeleted": true, "link": null, @@ -7566,58 +7192,6 @@ 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] undo stack 1`] = ` [ - { - "appState": AppStateDelta { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id401": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elements": { - "added": {}, - "removed": {}, - "updated": { - "id401": { - "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, - }, - }, - }, - }, - "id": "id408", - }, { "appState": AppStateDelta { "delta": Delta { @@ -7629,377 +7203,23 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "added": {}, "removed": {}, "updated": { - "id401": { + "id505": { "deleted": { "backgroundColor": "#ffec99", + "version": 7, }, "inserted": { "backgroundColor": "transparent", + "version": 6, }, }, }, }, - "id": "id409", + "id": "id516", }, ] `; -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, - "activeLockedId": null, - "activeTool": { - "customType": null, - "fromSelection": false, - "lastActiveTool": null, - "locked": false, - "type": "selection", - }, - "collaborators": Map {}, - "contextMenu": null, - "croppingElementId": null, - "currentChartType": "bar", - "currentHoveredFontFamily": null, - "currentItemArrowType": "round", - "currentItemBackgroundColor": "transparent", - "currentItemEndArrowhead": "arrow", - "currentItemFillStyle": "solid", - "currentItemFontFamily": 5, - "currentItemFontSize": 20, - "currentItemOpacity": 100, - "currentItemRoughness": 1, - "currentItemRoundness": "round", - "currentItemStartArrowhead": null, - "currentItemStrokeColor": "#1e1e1e", - "currentItemStrokeStyle": "solid", - "currentItemStrokeWidth": 2, - "currentItemTextAlign": "left", - "cursorButton": "up", - "defaultSidebarDockedPreference": false, - "editingFrame": null, - "editingGroupId": null, - "editingLinearElement": null, - "editingTextElement": null, - "elementsToHighlight": null, - "errorMessage": null, - "exportBackground": true, - "exportEmbedScene": false, - "exportScale": 1, - "exportWithDarkMode": false, - "fileHandle": null, - "followedBy": Set {}, - "frameRendering": { - "clip": true, - "enabled": true, - "name": true, - "outline": true, - }, - "frameToHighlight": null, - "gridModeEnabled": false, - "gridSize": 20, - "gridStep": 5, - "height": 0, - "hoveredElementIds": {}, - "isBindingEnabled": true, - "isCropping": false, - "isLoading": false, - "isResizing": false, - "isRotating": false, - "lastPointerDownWith": "mouse", - "lockedMultiSelections": {}, - "multiElement": null, - "newElement": null, - "objectsSnapModeEnabled": false, - "offsetLeft": 0, - "offsetTop": 0, - "openDialog": null, - "openMenu": null, - "openPopup": null, - "openSidebar": null, - "originSnapOffset": null, - "pasteDialog": { - "data": null, - "shown": false, - }, - "penDetected": false, - "penMode": false, - "pendingImageElementId": null, - "previousSelectedElementIds": {}, - "resizingElement": null, - "scrollX": 0, - "scrollY": 0, - "searchMatches": null, - "selectedElementIds": {}, - "selectedElementsAreBeingDragged": false, - "selectedGroupIds": {}, - "selectionElement": null, - "shouldCacheIgnoreZoom": false, - "showHyperlinkPopup": false, - "showWelcomeScreen": true, - "snapLines": [], - "startBoundElement": null, - "stats": { - "open": false, - "panels": 3, - }, - "suggestedBindings": [], - "theme": "light", - "toast": null, - "userToFollow": null, - "viewBackgroundColor": "#ffffff", - "viewModeEnabled": false, - "width": 0, - "zenModeEnabled": false, - "zoom": { - "value": 1, - }, -} -`; - -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] element 0 1`] = ` -{ - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "id": "id514", - "index": "a1", - "isDeleted": true, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 8, - "width": 100, - "x": 20, - "y": 20, -} -`; - -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] element 1 1`] = ` -{ - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "id": "id515", - "index": "a3V", - "isDeleted": true, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 4, - "width": 100, - "x": 30, - "y": 30, -} -`; - -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] element 2 1`] = ` -{ - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "id": "id513", - "index": "a4", - "isDeleted": true, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 4, - "width": 100, - "x": 10, - "y": 10, -} -`; - -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`] = ` -[ - { - "appState": AppStateDelta { - "delta": Delta { - "deleted": {}, - "inserted": {}, - }, - }, - "elements": { - "added": {}, - "removed": {}, - "updated": { - "id514": { - "deleted": { - "index": "a1", - }, - "inserted": { - "index": "a3", - }, - }, - }, - }, - "id": "id523", - }, - { - "appState": AppStateDelta { - "delta": Delta { - "deleted": { - "selectedElementIds": {}, - }, - "inserted": { - "selectedElementIds": { - "id514": true, - }, - }, - }, - }, - "elements": { - "added": { - "id513": { - "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, - }, - }, - "id514": { - "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, - }, - }, - "id515": { - "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": {}, - "updated": {}, - }, - "id": "id524", - }, -] -`; - -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, @@ -8122,7 +7342,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "frameId": null, "groupIds": [], "height": 100, - "id": "id501", + "id": "id609", "index": "Zx", "isDeleted": true, "link": null, @@ -8154,7 +7374,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "frameId": null, "groupIds": [], "height": 100, - "id": "id503", + "id": "id611", "index": "Zy", "isDeleted": true, "link": null, @@ -8186,7 +7406,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "frameId": null, "groupIds": [], "height": 100, - "id": "id502", + "id": "id610", "index": "a1", "isDeleted": true, "link": null, @@ -8225,17 +7445,19 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh "added": {}, "removed": {}, "updated": { - "id502": { + "id610": { "deleted": { "index": "a1", + "version": 6, }, "inserted": { "index": "Zz", + "version": 5, }, }, }, }, - "id": "id511", + "id": "id622", }, { "appState": AppStateDelta { @@ -8245,111 +7467,48 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh }, "inserted": { "selectedElementIds": { - "id502": true, + "id610": true, }, }, }, }, "elements": { "added": { - "id501": { + "id609": { "deleted": { "isDeleted": true, + "version": 4, }, "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, + "version": 3, }, }, - "id502": { + "id610": { "deleted": { "isDeleted": true, + "version": 7, }, "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, + "version": 6, }, }, - "id503": { + "id611": { "deleted": { "isDeleted": true, + "version": 4, }, "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, + "version": 3, }, }, }, "removed": {}, "updated": {}, }, - "id": "id512", + "id": "id624", }, ] `; @@ -8437,16 +7596,16 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id542": true, - "id545": true, + "id664": true, + "id667": true, }, "resizingElement": null, "scrollX": 0, "scrollY": 0, "searchMatches": null, "selectedElementIds": { - "id542": true, - "id545": true, + "id664": true, + "id667": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -8484,7 +7643,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "frameId": null, "groupIds": [], "height": 10, - "id": "id542", + "id": "id664", "index": "a0", "isDeleted": false, "link": null, @@ -8516,7 +7675,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "frameId": null, "groupIds": [], "height": 10, - "id": "id545", + "id": "id667", "index": "a1", "isDeleted": false, "link": null, @@ -8548,7 +7707,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "frameId": null, "groupIds": [], "height": 100, - "id": "id555", + "id": "id677", "index": "a2", "isDeleted": false, "link": null, @@ -8583,7 +7742,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "delta": Delta { "deleted": { "selectedElementIds": { - "id542": true, + "id664": true, }, }, "inserted": { @@ -8594,53 +7753,32 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "elements": { "added": {}, "removed": { - "id542": { + "id664": { "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, + "version": 8, }, "inserted": { "isDeleted": true, + "version": 7, }, }, }, "updated": {}, }, - "id": "id563", + "id": "id691", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id545": true, + "id667": true, }, }, "inserted": { "selectedElementIds": { - "id542": true, + "id664": true, }, }, }, @@ -8648,53 +7786,32 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "elements": { "added": {}, "removed": { - "id545": { + "id667": { "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, + "version": 8, }, "inserted": { "isDeleted": true, + "version": 7, }, }, }, "updated": {}, }, - "id": "id564", + "id": "id693", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id542": true, + "id664": true, }, }, "inserted": { "selectedElementIds": { - "id545": true, + "id667": true, }, }, }, @@ -8704,14 +7821,14 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "removed": {}, "updated": {}, }, - "id": "id565", + "id": "id695", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id545": true, + "id667": true, }, }, "inserted": { @@ -8724,7 +7841,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "removed": {}, "updated": {}, }, - "id": "id566", + "id": "id697", }, { "appState": AppStateDelta { @@ -8737,29 +7854,33 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "added": {}, "removed": {}, "updated": { - "id542": { + "id664": { "deleted": { + "version": 9, "x": 90, "y": 90, }, "inserted": { + "version": 8, "x": 10, "y": 10, }, }, - "id545": { + "id667": { "deleted": { + "version": 9, "x": 110, "y": 110, }, "inserted": { + "version": 8, "x": 30, "y": 30, }, }, }, }, - "id": "id567", + "id": "id699", }, ] `; @@ -8886,7 +8007,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "frameId": null, "groupIds": [], "height": 50, - "id": "id525", + "id": "id641", "index": "a0", "isDeleted": false, "lastCommittedPoint": [ @@ -8945,7 +8066,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "frameId": null, "groupIds": [], "height": 100, - "id": "id526", + "id": "id642", "index": "a1", "isDeleted": false, "link": null, @@ -8985,68 +8106,20 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "elements": { "added": {}, "removed": { - "id525": { + "id641": { "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, + "version": 7, }, "inserted": { "isDeleted": true, + "version": 6, }, }, }, "updated": {}, }, - "id": "id530", + "id": "id648", }, ] `; @@ -9137,7 +8210,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "scrollY": 0, "searchMatches": null, "selectedElementIds": { - "id531": true, + "id649": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -9175,7 +8248,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "frameId": null, "groupIds": [], "height": 90, - "id": "id531", + "id": "id649", "index": "a0", "isDeleted": false, "link": null, @@ -9207,7 +8280,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "frameId": null, "groupIds": [], "height": 100, - "id": "id535", + "id": "id653", "index": "a1", "isDeleted": false, "link": null, @@ -9242,7 +8315,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "delta": Delta { "deleted": { "selectedElementIds": { - "id531": true, + "id649": true, }, }, "inserted": { @@ -9253,41 +8326,20 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "elements": { "added": {}, "removed": { - "id531": { + "id649": { "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, + "version": 8, }, "inserted": { "isDeleted": true, + "version": 7, }, }, }, "updated": {}, }, - "id": "id540", + "id": "id661", }, { "appState": AppStateDelta { @@ -9300,19 +8352,21 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte "added": {}, "removed": {}, "updated": { - "id531": { + "id649": { "deleted": { "height": 90, + "version": 9, "width": 90, }, "inserted": { "height": 10, + "version": 8, "width": 10, }, }, }, }, - "id": "id541", + "id": "id663", }, ] `; @@ -9403,7 +8457,7 @@ exports[`history > multiplayer undo/redo > should not override remote changes on "scrollY": 0, "searchMatches": null, "selectedElementIds": { - "id333": true, + "id412": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -9441,7 +8495,7 @@ exports[`history > multiplayer undo/redo > should not override remote changes on "frameId": null, "groupIds": [], "height": 10, - "id": "id333", + "id": "id412", "index": "a0", "isDeleted": false, "link": null, @@ -9473,7 +8527,7 @@ exports[`history > multiplayer undo/redo > should not override remote changes on "frameId": null, "groupIds": [], "height": 100, - "id": "id338", + "id": "id417", "index": "a1", "isDeleted": false, "link": null, @@ -9512,17 +8566,19 @@ exports[`history > multiplayer undo/redo > should not override remote changes on "added": {}, "removed": {}, "updated": { - "id333": { + "id412": { "deleted": { "backgroundColor": "transparent", + "version": 7, }, "inserted": { "backgroundColor": "#ffc9c9", + "version": 6, }, }, }, }, - "id": "id341", + "id": "id423", }, ] `; @@ -9534,7 +8590,7 @@ exports[`history > multiplayer undo/redo > should not override remote changes on "delta": Delta { "deleted": { "selectedElementIds": { - "id333": true, + "id412": true, }, }, "inserted": { @@ -9545,7 +8601,7 @@ exports[`history > multiplayer undo/redo > should not override remote changes on "elements": { "added": {}, "removed": { - "id333": { + "id412": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -9568,6 +8624,7 @@ exports[`history > multiplayer undo/redo > should not override remote changes on "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 10, "y": 0, @@ -9579,7 +8636,7 @@ exports[`history > multiplayer undo/redo > should not override remote changes on }, "updated": {}, }, - "id": "id335", + "id": "id414", }, ] `; @@ -9670,7 +8727,7 @@ exports[`history > multiplayer undo/redo > should not override remote changes on "scrollY": 0, "searchMatches": null, "selectedElementIds": { - "id342": true, + "id424": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -9708,7 +8765,7 @@ exports[`history > multiplayer undo/redo > should not override remote changes on "frameId": null, "groupIds": [], "height": 10, - "id": "id342", + "id": "id424", "index": "a0", "isDeleted": false, "link": null, @@ -9743,7 +8800,7 @@ exports[`history > multiplayer undo/redo > should not override remote changes on "delta": Delta { "deleted": { "selectedElementIds": { - "id342": true, + "id424": true, }, }, "inserted": { @@ -9754,7 +8811,7 @@ exports[`history > multiplayer undo/redo > should not override remote changes on "elements": { "added": {}, "removed": { - "id342": { + "id424": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -9777,6 +8834,7 @@ exports[`history > multiplayer undo/redo > should not override remote changes on "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 10, "y": 0, @@ -9788,7 +8846,7 @@ exports[`history > multiplayer undo/redo > should not override remote changes on }, "updated": {}, }, - "id": "id344", + "id": "id426", }, { "appState": AppStateDelta { @@ -9801,17 +8859,19 @@ exports[`history > multiplayer undo/redo > should not override remote changes on "added": {}, "removed": {}, "updated": { - "id342": { + "id424": { "deleted": { "backgroundColor": "#ffc9c9", + "version": 7, }, "inserted": { "backgroundColor": "transparent", + "version": 6, }, }, }, }, - "id": "id348", + "id": "id432", }, ] `; @@ -9944,7 +9004,7 @@ exports[`history > multiplayer undo/redo > should override remotely added groups "B", ], "height": 100, - "id": "id371", + "id": "id463", "index": "a0", "isDeleted": false, "link": null, @@ -9979,7 +9039,7 @@ exports[`history > multiplayer undo/redo > should override remotely added groups "B", ], "height": 100, - "id": "id372", + "id": "id464", "index": "a1", "isDeleted": false, "link": null, @@ -10013,7 +9073,7 @@ exports[`history > multiplayer undo/redo > should override remotely added groups "B", ], "height": 100, - "id": "id375", + "id": "id467", "index": "a2", "isDeleted": false, "link": null, @@ -10047,7 +9107,7 @@ exports[`history > multiplayer undo/redo > should override remotely added groups "B", ], "height": 100, - "id": "id376", + "id": "id468", "index": "a3", "isDeleted": false, "link": null, @@ -10088,31 +9148,35 @@ exports[`history > multiplayer undo/redo > should override remotely added groups "added": {}, "removed": {}, "updated": { - "id371": { + "id463": { "deleted": { "groupIds": [ "A", "B", ], + "version": 6, }, "inserted": { "groupIds": [], + "version": 5, }, }, - "id372": { + "id464": { "deleted": { "groupIds": [ "A", "B", ], + "version": 6, }, "inserted": { "groupIds": [], + "version": 5, }, }, }, }, - "id": "id378", + "id": "id472", }, ] `; @@ -10203,7 +9267,7 @@ exports[`history > multiplayer undo/redo > should override remotely added points "scrollY": 0, "searchMatches": null, "selectedElementIds": { - "id379": true, + "id473": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -10244,7 +9308,7 @@ exports[`history > multiplayer undo/redo > should override remotely added points "frameId": null, "groupIds": [], "height": 30, - "id": "id379", + "id": "id473", "index": "a0", "isDeleted": false, "lastCommittedPoint": [ @@ -10307,7 +9371,7 @@ exports[`history > multiplayer undo/redo > should override remotely added points "delta": Delta { "deleted": { "selectedElementIds": { - "id379": true, + "id473": true, }, }, "inserted": { @@ -10318,60 +9382,20 @@ exports[`history > multiplayer undo/redo > should override remotely added points "elements": { "added": {}, "removed": { - "id379": { + "id473": { "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, + "version": 12, }, "inserted": { "isDeleted": true, + "version": 11, }, }, }, "updated": {}, }, - "id": "id389", + "id": "id487", }, { "appState": AppStateDelta { @@ -10384,7 +9408,7 @@ exports[`history > multiplayer undo/redo > should override remotely added points "added": {}, "removed": {}, "updated": { - "id379": { + "id473": { "deleted": { "height": 30, "lastCommittedPoint": [ @@ -10413,6 +9437,7 @@ exports[`history > multiplayer undo/redo > should override remotely added points 20, ], ], + "version": 13, "width": 30, }, "inserted": { @@ -10431,18 +9456,19 @@ exports[`history > multiplayer undo/redo > should override remotely added points 10, ], ], + "version": 12, "width": 10, }, }, }, }, - "id": "id390", + "id": "id489", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { - "selectedLinearElementId": "id379", + "selectedLinearElementId": "id473", }, "inserted": { "selectedLinearElementId": null, @@ -10454,7 +9480,7 @@ exports[`history > multiplayer undo/redo > should override remotely added points "removed": {}, "updated": {}, }, - "id": "id391", + "id": "id491", }, ] `; @@ -10581,7 +9607,7 @@ exports[`history > multiplayer undo/redo > should redistribute deltas when eleme "frameId": null, "groupIds": [], "height": 10, - "id": "id392", + "id": "id492", "index": "a0", "isDeleted": false, "link": null, @@ -10616,7 +9642,7 @@ exports[`history > multiplayer undo/redo > should redistribute deltas when eleme "delta": Delta { "deleted": { "selectedElementIds": { - "id392": true, + "id492": true, }, }, "inserted": { @@ -10627,41 +9653,20 @@ exports[`history > multiplayer undo/redo > should redistribute deltas when eleme "elements": { "added": {}, "removed": { - "id392": { + "id492": { "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, + "version": 7, }, "inserted": { "isDeleted": true, + "version": 6, }, }, }, "updated": {}, }, - "id": "id399", + "id": "id502", }, { "appState": AppStateDelta { @@ -10671,7 +9676,7 @@ exports[`history > multiplayer undo/redo > should redistribute deltas when eleme }, "inserted": { "selectedElementIds": { - "id392": true, + "id492": true, }, }, }, @@ -10679,18 +9684,9 @@ exports[`history > multiplayer undo/redo > should redistribute deltas when eleme "elements": { "added": {}, "removed": {}, - "updated": { - "id392": { - "deleted": { - "isDeleted": false, - }, - "inserted": { - "isDeleted": false, - }, - }, - }, + "updated": {}, }, - "id": "id400", + "id": "id504", }, ] `; @@ -10962,15 +9958,6 @@ exports[`history > multiplayer undo/redo > should redraw arrows on undo > [end o "added": { "6Rm4g567UQM4WjLwej2Vc": { "deleted": { - "isDeleted": true, - }, - "inserted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "elbowed": true, - "endArrowhead": null, "endBinding": { "elementId": "u2JGnnmoJ0VATV4vCNJE5", "fixedPoint": [ @@ -10980,37 +9967,7 @@ exports[`history > multiplayer undo/redo > should redraw arrows on undo > [end o "focus": "-0.00161", "gap": "3.53708", }, - "endIsSpecial": false, - "fillStyle": "solid", - "fixedSegments": [], - "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, + "isDeleted": true, "startBinding": { "elementId": "KPrBI4g_v9qUB1XxYLgSz", "fixedPoint": [ @@ -11020,14 +9977,29 @@ exports[`history > multiplayer undo/redo > should redraw arrows on undo > [end o "focus": "-0.00159", "gap": 5, }, - "startIsSpecial": false, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "arrow", - "width": "178.90000", - "x": 1035, - "y": "274.90000", + "version": 3, + }, + "inserted": { + "endBinding": { + "elementId": "u2JGnnmoJ0VATV4vCNJE5", + "fixedPoint": [ + "0.49919", + "-0.03875", + ], + "focus": "-0.00161", + "gap": "3.53708", + }, + "isDeleted": false, + "startBinding": { + "elementId": "KPrBI4g_v9qUB1XxYLgSz", + "fixedPoint": [ + "1.03185", + "0.49921", + ], + "focus": "-0.00159", + "gap": 5, + }, + "version": 2, }, }, }, @@ -11035,33 +10007,23 @@ exports[`history > multiplayer undo/redo > should redraw arrows on undo > [end o "updated": { "KPrBI4g_v9qUB1XxYLgSz": { "deleted": { - "boundElements": [], + "version": 3, }, "inserted": { - "boundElements": [ - { - "id": "6Rm4g567UQM4WjLwej2Vc", - "type": "arrow", - }, - ], + "version": 2, }, }, "u2JGnnmoJ0VATV4vCNJE5": { "deleted": { - "boundElements": [], + "version": 3, }, "inserted": { - "boundElements": [ - { - "id": "6Rm4g567UQM4WjLwej2Vc", - "type": "arrow", - }, - ], + "version": 2, }, }, }, }, - "id": "id369", + "id": "id460", }, { "appState": AppStateDelta { @@ -11075,8 +10037,274 @@ exports[`history > multiplayer undo/redo > should redraw arrows on undo > [end o "KPrBI4g_v9qUB1XxYLgSz": { "deleted": { "isDeleted": true, + "version": 4, + "x": 600, + "y": 0, }, "inserted": { + "isDeleted": false, + "version": 3, + "x": 873, + "y": 212, + }, + }, + "u2JGnnmoJ0VATV4vCNJE5": { + "deleted": { + "isDeleted": true, + "version": 4, + }, + "inserted": { + "isDeleted": false, + "version": 3, + }, + }, + }, + "removed": {}, + "updated": {}, + }, + "id": "id462", + }, +] +`; + +exports[`history > multiplayer undo/redo > should redraw arrows on undo > [end of test] undo stack 1`] = `[]`; + +exports[`history > multiplayer undo/redo > should tolerate remote z-index changes with incorrect fractional indices > [end of test] appState 1`] = ` +{ + "activeEmbeddable": null, + "activeLockedId": null, + "activeTool": { + "customType": null, + "fromSelection": false, + "lastActiveTool": null, + "locked": false, + "type": "selection", + }, + "collaborators": Map {}, + "contextMenu": null, + "croppingElementId": null, + "currentChartType": "bar", + "currentHoveredFontFamily": null, + "currentItemArrowType": "round", + "currentItemBackgroundColor": "transparent", + "currentItemEndArrowhead": "arrow", + "currentItemFillStyle": "solid", + "currentItemFontFamily": 5, + "currentItemFontSize": 20, + "currentItemOpacity": 100, + "currentItemRoughness": 1, + "currentItemRoundness": "round", + "currentItemStartArrowhead": null, + "currentItemStrokeColor": "#1e1e1e", + "currentItemStrokeStyle": "solid", + "currentItemStrokeWidth": 2, + "currentItemTextAlign": "left", + "cursorButton": "up", + "defaultSidebarDockedPreference": false, + "editingFrame": null, + "editingGroupId": null, + "editingLinearElement": null, + "editingTextElement": null, + "elementsToHighlight": null, + "errorMessage": null, + "exportBackground": true, + "exportEmbedScene": false, + "exportScale": 1, + "exportWithDarkMode": false, + "fileHandle": null, + "followedBy": Set {}, + "frameRendering": { + "clip": true, + "enabled": true, + "name": true, + "outline": true, + }, + "frameToHighlight": null, + "gridModeEnabled": false, + "gridSize": 20, + "gridStep": 5, + "height": 0, + "hoveredElementIds": {}, + "isBindingEnabled": true, + "isCropping": false, + "isLoading": false, + "isResizing": false, + "isRotating": false, + "lastPointerDownWith": "mouse", + "lockedMultiSelections": {}, + "multiElement": null, + "newElement": null, + "objectsSnapModeEnabled": false, + "offsetLeft": 0, + "offsetTop": 0, + "openDialog": null, + "openMenu": null, + "openPopup": null, + "openSidebar": null, + "originSnapOffset": null, + "pasteDialog": { + "data": null, + "shown": false, + }, + "penDetected": false, + "penMode": false, + "pendingImageElementId": null, + "previousSelectedElementIds": {}, + "resizingElement": null, + "scrollX": 0, + "scrollY": 0, + "searchMatches": null, + "selectedElementIds": { + "id626": true, + }, + "selectedElementsAreBeingDragged": false, + "selectedGroupIds": {}, + "selectionElement": null, + "shouldCacheIgnoreZoom": false, + "showHyperlinkPopup": false, + "showWelcomeScreen": true, + "snapLines": [], + "startBoundElement": null, + "stats": { + "open": false, + "panels": 3, + }, + "suggestedBindings": [], + "theme": "light", + "toast": null, + "userToFollow": null, + "viewBackgroundColor": "#ffffff", + "viewModeEnabled": false, + "width": 0, + "zenModeEnabled": false, + "zoom": { + "value": 1, + }, +} +`; + +exports[`history > multiplayer undo/redo > should tolerate remote z-index changes with incorrect fractional indices > [end of test] element 0 1`] = ` +{ + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "id": "id627", + "index": "a2", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "updated": 1, + "version": 2, + "width": 100, + "x": 30, + "y": 30, +} +`; + +exports[`history > multiplayer undo/redo > should tolerate remote z-index changes with incorrect fractional indices > [end of test] element 1 1`] = ` +{ + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "id": "id625", + "index": "a4", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "updated": 1, + "version": 3, + "width": 100, + "x": 10, + "y": 10, +} +`; + +exports[`history > multiplayer undo/redo > should tolerate remote z-index changes with incorrect fractional indices > [end of test] element 2 1`] = ` +{ + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 100, + "id": "id626", + "index": "a5", + "isDeleted": false, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "updated": 1, + "version": 9, + "width": 100, + "x": 20, + "y": 20, +} +`; + +exports[`history > multiplayer undo/redo > should tolerate remote z-index changes with incorrect fractional indices > [end of test] number of elements 1`] = `3`; + +exports[`history > multiplayer undo/redo > should tolerate remote z-index changes with incorrect fractional indices > [end of test] number of renders 1`] = `12`; + +exports[`history > multiplayer undo/redo > should tolerate remote z-index changes with incorrect fractional indices > [end of test] redo stack 1`] = `[]`; + +exports[`history > multiplayer undo/redo > should tolerate remote z-index changes with incorrect fractional indices > [end of test] undo stack 1`] = ` +[ + { + "appState": AppStateDelta { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id626": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elements": { + "added": {}, + "removed": { + "id625": { + "deleted": { "angle": 0, "backgroundColor": "transparent", "boundElements": null, @@ -11084,7 +10312,7 @@ exports[`history > multiplayer undo/redo > should redraw arrows on undo > [end o "fillStyle": "solid", "frameId": null, "groupIds": [], - "height": 126, + "height": 100, "index": "a0", "isDeleted": false, "link": null, @@ -11098,16 +10326,17 @@ exports[`history > multiplayer undo/redo > should redraw arrows on undo > [end o "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", - "width": 157, - "x": 600, - "y": 0, - }, - }, - "u2JGnnmoJ0VATV4vCNJE5": { - "deleted": { - "isDeleted": true, + "version": 2, + "width": 100, + "x": 10, + "y": 10, }, "inserted": { + "isDeleted": true, + }, + }, + "id626": { + "deleted": { "angle": 0, "backgroundColor": "transparent", "boundElements": null, @@ -11115,7 +10344,7 @@ exports[`history > multiplayer undo/redo > should redraw arrows on undo > [end o "fillStyle": "solid", "frameId": null, "groupIds": [], - "height": 129, + "height": 100, "index": "a1", "isDeleted": false, "link": null, @@ -11128,23 +10357,81 @@ exports[`history > multiplayer undo/redo > should redraw arrows on undo > [end o "strokeColor": "#1e1e1e", "strokeStyle": "solid", "strokeWidth": 2, - "type": "diamond", - "width": 124, - "x": 1152, - "y": 516, + "type": "rectangle", + "version": 2, + "width": 100, + "x": 20, + "y": 20, + }, + "inserted": { + "isDeleted": true, + }, + }, + "id627": { + "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", + "version": 2, + "width": 100, + "x": 30, + "y": 30, + }, + "inserted": { + "isDeleted": true, }, }, }, - "removed": {}, "updated": {}, }, - "id": "id370", + "id": "id630", + }, + { + "appState": AppStateDelta { + "delta": Delta { + "deleted": {}, + "inserted": {}, + }, + }, + "elements": { + "added": {}, + "removed": {}, + "updated": { + "id626": { + "deleted": { + "index": "a5", + "version": 9, + }, + "inserted": { + "index": "a1", + "version": 8, + }, + }, + }, + }, + "id": "id640", }, ] `; -exports[`history > multiplayer undo/redo > should redraw arrows on undo > [end of test] undo stack 1`] = `[]`; - exports[`history > multiplayer undo/redo > should update history entries after remote changes on the same properties > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -11231,7 +10518,7 @@ exports[`history > multiplayer undo/redo > should update history entries after r "scrollY": 0, "searchMatches": null, "selectedElementIds": { - "id349": true, + "id433": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -11269,7 +10556,7 @@ exports[`history > multiplayer undo/redo > should update history entries after r "frameId": null, "groupIds": [], "height": 10, - "id": "id349", + "id": "id433", "index": "a0", "isDeleted": false, "link": null, @@ -11308,17 +10595,19 @@ exports[`history > multiplayer undo/redo > should update history entries after r "added": {}, "removed": {}, "updated": { - "id349": { + "id433": { "deleted": { "backgroundColor": "#d0bfff", + "version": 12, }, "inserted": { "backgroundColor": "#ffec99", + "version": 11, }, }, }, }, - "id": "id360", + "id": "id449", }, { "appState": AppStateDelta { @@ -11331,17 +10620,19 @@ exports[`history > multiplayer undo/redo > should update history entries after r "added": {}, "removed": {}, "updated": { - "id349": { + "id433": { "deleted": { "backgroundColor": "transparent", + "version": 13, }, "inserted": { "backgroundColor": "#d0bfff", + "version": 12, }, }, }, }, - "id": "id361", + "id": "id451", }, ] `; @@ -11353,7 +10644,7 @@ exports[`history > multiplayer undo/redo > should update history entries after r "delta": Delta { "deleted": { "selectedElementIds": { - "id349": true, + "id433": true, }, }, "inserted": { @@ -11364,7 +10655,7 @@ exports[`history > multiplayer undo/redo > should update history entries after r "elements": { "added": {}, "removed": { - "id349": { + "id433": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -11387,6 +10678,7 @@ exports[`history > multiplayer undo/redo > should update history entries after r "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 10, "y": 0, @@ -11398,7 +10690,7 @@ exports[`history > multiplayer undo/redo > should update history entries after r }, "updated": {}, }, - "id": "id351", + "id": "id435", }, ] `; @@ -11557,7 +10849,7 @@ exports[`history > singleplayer undo/redo > remounting undo/redo buttons should "frameId": null, "groupIds": [], "height": 10, - "id": "id329", + "id": "id407", "index": "a1", "isDeleted": true, "link": null, @@ -11593,49 +10885,28 @@ exports[`history > singleplayer undo/redo > remounting undo/redo buttons should }, "inserted": { "selectedElementIds": { - "id329": true, + "id407": true, }, }, }, }, "elements": { "added": { - "id329": { + "id407": { "deleted": { "isDeleted": true, + "version": 4, }, "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, + "version": 3, }, }, }, "removed": {}, "updated": {}, }, - "id": "id332", + "id": "id411", }, ] `; @@ -11728,7 +10999,7 @@ exports[`history > singleplayer undo/redo > should clear the redo stack on eleme "scrollY": 0, "searchMatches": null, "selectedElementIds": { - "id50": true, + "id61": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -11766,7 +11037,7 @@ exports[`history > singleplayer undo/redo > should clear the redo stack on eleme "frameId": null, "groupIds": [], "height": 10, - "id": "id46", + "id": "id56", "index": "a0", "isDeleted": true, "link": null, @@ -11798,7 +11069,7 @@ exports[`history > singleplayer undo/redo > should clear the redo stack on eleme "frameId": null, "groupIds": [], "height": 10, - "id": "id50", + "id": "id61", "index": "a1", "isDeleted": false, "link": null, @@ -11833,7 +11104,7 @@ exports[`history > singleplayer undo/redo > should clear the redo stack on eleme "delta": Delta { "deleted": { "selectedElementIds": { - "id50": true, + "id61": true, }, }, "inserted": { @@ -11844,7 +11115,7 @@ exports[`history > singleplayer undo/redo > should clear the redo stack on eleme "elements": { "added": {}, "removed": { - "id50": { + "id61": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -11867,6 +11138,7 @@ exports[`history > singleplayer undo/redo > should clear the redo stack on eleme "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 20, "y": 0, @@ -11878,7 +11150,7 @@ exports[`history > singleplayer undo/redo > should clear the redo stack on eleme }, "updated": {}, }, - "id": "id52", + "id": "id63", }, ] `; @@ -12005,7 +11277,7 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f "frameId": null, "groupIds": [], "height": 10, - "id": "id148", + "id": "id195", "index": "a0", "isDeleted": false, "link": null, @@ -12037,7 +11309,7 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f "frameId": null, "groupIds": [], "height": 10, - "id": "id153", + "id": "id200", "index": "a1", "isDeleted": true, "lastCommittedPoint": [ @@ -12091,7 +11363,7 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f "frameId": null, "groupIds": [], "height": 10, - "id": "id157", + "id": "id205", "index": "a2", "isDeleted": false, "lastCommittedPoint": [ @@ -12148,7 +11420,7 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f "delta": Delta { "deleted": { "selectedElementIds": { - "id148": true, + "id195": true, }, }, "inserted": { @@ -12159,7 +11431,7 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f "elements": { "added": {}, "removed": { - "id148": { + "id195": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -12182,6 +11454,7 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": -10, "y": -10, @@ -12193,7 +11466,7 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f }, "updated": {}, }, - "id": "id150", + "id": "id197", }, { "appState": AppStateDelta { @@ -12203,7 +11476,7 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f }, "inserted": { "selectedElementIds": { - "id148": true, + "id195": true, }, }, }, @@ -12213,7 +11486,7 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f "removed": {}, "updated": {}, }, - "id": "id152", + "id": "id199", }, { "appState": AppStateDelta { @@ -12225,7 +11498,7 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f "elements": { "added": {}, "removed": { - "id157": { + "id205": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -12270,6 +11543,7 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f "strokeStyle": "solid", "strokeWidth": 2, "type": "freedraw", + "version": 4, "width": 50, "x": 130, "y": -30, @@ -12281,7 +11555,7 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f }, "updated": {}, }, - "id": "id159", + "id": "id207", }, ] `; @@ -12488,47 +11762,29 @@ exports[`history > singleplayer undo/redo > should create new history entry on s "A": { "deleted": { "isDeleted": true, + "version": 5, }, "inserted": { "isDeleted": false, + "version": 4, }, }, }, "removed": { "B": { "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, + "version": 5, }, "inserted": { "isDeleted": true, + "version": 4, }, }, }, "updated": {}, }, - "id": "id80", + "id": "id99", }, ] `; @@ -12619,7 +11875,7 @@ exports[`history > singleplayer undo/redo > should disable undo/redo buttons whe "scrollY": 0, "searchMatches": null, "selectedElementIds": { - "id323": true, + "id399": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -12689,7 +11945,7 @@ exports[`history > singleplayer undo/redo > should disable undo/redo buttons whe "frameId": null, "groupIds": [], "height": 10, - "id": "id323", + "id": "id399", "index": "a1", "isDeleted": false, "link": null, @@ -12724,7 +11980,7 @@ exports[`history > singleplayer undo/redo > should disable undo/redo buttons whe "delta": Delta { "deleted": { "selectedElementIds": { - "id323": true, + "id399": true, }, }, "inserted": { @@ -12735,41 +11991,20 @@ exports[`history > singleplayer undo/redo > should disable undo/redo buttons whe "elements": { "added": {}, "removed": { - "id323": { + "id399": { "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, + "version": 5, }, "inserted": { "isDeleted": true, + "version": 4, }, }, }, "updated": {}, }, - "id": "id327", + "id": "id405", }, ] `; @@ -12860,7 +12095,7 @@ exports[`history > singleplayer undo/redo > should end up with no history entry "scrollY": 0, "searchMatches": null, "selectedElementIds": { - "id70": true, + "id85": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -12930,7 +12165,7 @@ exports[`history > singleplayer undo/redo > should end up with no history entry "frameId": null, "groupIds": [], "height": 10, - "id": "id70", + "id": "id85", "index": "a1", "isDeleted": false, "link": null, @@ -12965,7 +12200,7 @@ exports[`history > singleplayer undo/redo > should end up with no history entry "delta": Delta { "deleted": { "selectedElementIds": { - "id70": true, + "id85": true, }, }, "inserted": { @@ -12976,294 +12211,24 @@ exports[`history > singleplayer undo/redo > should end up with no history entry "elements": { "added": {}, "removed": { - "id70": { + "id85": { "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, + "version": 5, }, "inserted": { "isDeleted": true, + "version": 4, }, }, }, "updated": {}, }, - "id": "id74", + "id": "id91", }, ] `; -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, - "activeLockedId": null, - "activeTool": { - "customType": null, - "fromSelection": false, - "lastActiveTool": null, - "locked": false, - "type": "selection", - }, - "collaborators": Map {}, - "contextMenu": null, - "croppingElementId": null, - "currentChartType": "bar", - "currentHoveredFontFamily": null, - "currentItemArrowType": "round", - "currentItemBackgroundColor": "transparent", - "currentItemEndArrowhead": "arrow", - "currentItemFillStyle": "solid", - "currentItemFontFamily": 5, - "currentItemFontSize": 20, - "currentItemOpacity": 100, - "currentItemRoughness": 1, - "currentItemRoundness": "round", - "currentItemStartArrowhead": null, - "currentItemStrokeColor": "#1e1e1e", - "currentItemStrokeStyle": "solid", - "currentItemStrokeWidth": 2, - "currentItemTextAlign": "left", - "cursorButton": "up", - "defaultSidebarDockedPreference": false, - "editingFrame": null, - "editingGroupId": null, - "editingLinearElement": null, - "editingTextElement": null, - "elementsToHighlight": null, - "errorMessage": null, - "exportBackground": true, - "exportEmbedScene": false, - "exportScale": 1, - "exportWithDarkMode": false, - "fileHandle": null, - "followedBy": Set {}, - "frameRendering": { - "clip": true, - "enabled": true, - "name": true, - "outline": true, - }, - "frameToHighlight": null, - "gridModeEnabled": false, - "gridSize": 20, - "gridStep": 5, - "height": 0, - "hoveredElementIds": {}, - "isBindingEnabled": true, - "isCropping": false, - "isLoading": false, - "isResizing": false, - "isRotating": false, - "lastPointerDownWith": "mouse", - "lockedMultiSelections": {}, - "multiElement": null, - "newElement": null, - "objectsSnapModeEnabled": false, - "offsetLeft": 0, - "offsetTop": 0, - "openDialog": null, - "openMenu": null, - "openPopup": null, - "openSidebar": null, - "originSnapOffset": null, - "pasteDialog": { - "data": null, - "shown": false, - }, - "penDetected": false, - "penMode": false, - "pendingImageElementId": null, - "previousSelectedElementIds": { - "id53": true, - }, - "resizingElement": null, - "scrollX": 0, - "scrollY": 0, - "searchMatches": null, - "selectedElementIds": {}, - "selectedElementsAreBeingDragged": false, - "selectedGroupIds": {}, - "selectionElement": null, - "shouldCacheIgnoreZoom": false, - "showHyperlinkPopup": false, - "showWelcomeScreen": true, - "snapLines": [], - "startBoundElement": null, - "stats": { - "open": false, - "panels": 3, - }, - "suggestedBindings": [], - "theme": "light", - "toast": null, - "userToFollow": null, - "viewBackgroundColor": "#ffffff", - "viewModeEnabled": false, - "width": 0, - "zenModeEnabled": false, - "zoom": { - "value": 1, - }, -} -`; - -exports[`history > singleplayer undo/redo > should iterate through the history when selection changes do not produce visible change > [end of test] element 0 1`] = ` -{ - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "id": "id53", - "index": "a0", - "isDeleted": true, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 4, - "width": 10, - "x": 10, - "y": 0, -} -`; - -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`] = ` -[ - { - "appState": AppStateDelta { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id53": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elements": { - "added": {}, - "removed": {}, - "updated": {}, - }, - "id": "id66", - }, - { - "appState": AppStateDelta { - "delta": Delta { - "deleted": { - "selectedElementIds": { - "id53": true, - }, - }, - "inserted": { - "selectedElementIds": {}, - }, - }, - }, - "elements": { - "added": {}, - "removed": {}, - "updated": {}, - }, - "id": "id67", - }, - { - "appState": AppStateDelta { - "delta": Delta { - "deleted": { - "selectedElementIds": {}, - }, - "inserted": { - "selectedElementIds": { - "id53": true, - }, - }, - }, - }, - "elements": { - "added": { - "id53": { - "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": {}, - "updated": {}, - }, - "id": "id68", - }, -] -`; - -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, @@ -13350,7 +12315,7 @@ exports[`history > singleplayer undo/redo > should not clear the redo stack on s "scrollY": 0, "searchMatches": null, "selectedElementIds": { - "id18": true, + "id19": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -13388,7 +12353,7 @@ exports[`history > singleplayer undo/redo > should not clear the redo stack on s "frameId": null, "groupIds": [], "height": 10, - "id": "id15", + "id": "id16", "index": "a0", "isDeleted": false, "link": null, @@ -13420,7 +12385,7 @@ exports[`history > singleplayer undo/redo > should not clear the redo stack on s "frameId": null, "groupIds": [], "height": 10, - "id": "id18", + "id": "id19", "index": "a1", "isDeleted": false, "link": null, @@ -13455,7 +12420,7 @@ exports[`history > singleplayer undo/redo > should not clear the redo stack on s "delta": Delta { "deleted": { "selectedElementIds": { - "id15": true, + "id16": true, }, }, "inserted": { @@ -13466,7 +12431,7 @@ exports[`history > singleplayer undo/redo > should not clear the redo stack on s "elements": { "added": {}, "removed": { - "id15": { + "id16": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -13489,6 +12454,7 @@ exports[`history > singleplayer undo/redo > should not clear the redo stack on s "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 10, "y": 0, @@ -13500,7 +12466,7 @@ exports[`history > singleplayer undo/redo > should not clear the redo stack on s }, "updated": {}, }, - "id": "id17", + "id": "id18", }, { "appState": AppStateDelta { @@ -13510,7 +12476,7 @@ exports[`history > singleplayer undo/redo > should not clear the redo stack on s }, "inserted": { "selectedElementIds": { - "id15": true, + "id16": true, }, }, }, @@ -13520,14 +12486,14 @@ exports[`history > singleplayer undo/redo > should not clear the redo stack on s "removed": {}, "updated": {}, }, - "id": "id24", + "id": "id26", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id15": true, + "id16": true, }, }, "inserted": { @@ -13540,19 +12506,19 @@ exports[`history > singleplayer undo/redo > should not clear the redo stack on s "removed": {}, "updated": {}, }, - "id": "id27", + "id": "id29", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id18": true, + "id19": true, }, }, "inserted": { "selectedElementIds": { - "id15": true, + "id16": true, }, }, }, @@ -13560,41 +12526,20 @@ exports[`history > singleplayer undo/redo > should not clear the redo stack on s "elements": { "added": {}, "removed": { - "id18": { + "id19": { "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, + "version": 5, }, "inserted": { "isDeleted": true, + "version": 4, }, }, }, "updated": {}, }, - "id": "id28", + "id": "id31", }, ] `; @@ -13757,16 +12702,57 @@ exports[`history > singleplayer undo/redo > should not collapse when applying co { "appState": AppStateDelta { "delta": Delta { - "deleted": {}, - "inserted": {}, + "deleted": { + "name": null, + "selectedElementIds": { + "id0": true, + }, + }, + "inserted": { + "name": "Untitled-2025-05-24-2324", + "selectedElementIds": {}, + }, }, }, "elements": { "added": {}, - "removed": {}, + "removed": { + "id0": { + "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", + "version": 2, + "width": 100, + "x": 0, + "y": 0, + }, + "inserted": { + "isDeleted": true, + }, + }, + }, "updated": {}, }, - "id": "id3", + "id": "id4", }, ] `; @@ -13857,8 +12843,8 @@ exports[`history > singleplayer undo/redo > should not end up with history entry "scrollY": 0, "searchMatches": null, "selectedElementIds": { - "id4": true, "id5": true, + "id6": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": { @@ -13900,7 +12886,7 @@ exports[`history > singleplayer undo/redo > should not end up with history entry "A", ], "height": 100, - "id": "id4", + "id": "id5", "index": "a0", "isDeleted": false, "link": null, @@ -13934,7 +12920,7 @@ exports[`history > singleplayer undo/redo > should not end up with history entry "A", ], "height": 100, - "id": "id5", + "id": "id6", "index": "a1", "isDeleted": false, "link": null, @@ -13969,8 +12955,8 @@ exports[`history > singleplayer undo/redo > should not end up with history entry "delta": Delta { "deleted": { "selectedElementIds": { - "id4": true, "id5": true, + "id6": true, }, "selectedGroupIds": { "A": true, @@ -13985,7 +12971,7 @@ exports[`history > singleplayer undo/redo > should not end up with history entry "elements": { "added": {}, "removed": { - "id4": { + "id5": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -14010,6 +12996,7 @@ exports[`history > singleplayer undo/redo > should not end up with history entry "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 100, "x": 0, "y": 0, @@ -14018,7 +13005,7 @@ exports[`history > singleplayer undo/redo > should not end up with history entry "isDeleted": true, }, }, - "id5": { + "id6": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -14043,6 +13030,7 @@ exports[`history > singleplayer undo/redo > should not end up with history entry "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 100, "x": 0, "y": 0, @@ -14054,7 +13042,7 @@ exports[`history > singleplayer undo/redo > should not end up with history entry }, "updated": {}, }, - "id": "id8", + "id": "id9", }, ] `; @@ -14184,7 +13172,7 @@ exports[`history > singleplayer undo/redo > should not end up with history entry "frameId": null, "groupIds": [], "height": 100, - "id": "id10", + "id": "id11", "index": "a0", "isDeleted": false, "link": null, @@ -14216,7 +13204,7 @@ exports[`history > singleplayer undo/redo > should not end up with history entry "frameId": null, "groupIds": [], "height": 100, - "id": "id11", + "id": "id12", "index": "a1", "isDeleted": false, "link": null, @@ -14256,7 +13244,7 @@ exports[`history > singleplayer undo/redo > should not end up with history entry "elements": { "added": {}, "removed": { - "id10": { + "id11": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -14279,6 +13267,7 @@ exports[`history > singleplayer undo/redo > should not end up with history entry "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 100, "x": 0, "y": 0, @@ -14287,7 +13276,7 @@ exports[`history > singleplayer undo/redo > should not end up with history entry "isDeleted": true, }, }, - "id11": { + "id12": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -14310,6 +13299,7 @@ exports[`history > singleplayer undo/redo > should not end up with history entry "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 100, "x": 0, "y": 0, @@ -14321,7 +13311,7 @@ exports[`history > singleplayer undo/redo > should not end up with history entry }, "updated": {}, }, - "id": "id13", + "id": "id14", }, ] `; @@ -14407,14 +13397,14 @@ exports[`history > singleplayer undo/redo > should not override appstate changes "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id29": true, + "id32": true, }, "resizingElement": null, "scrollX": 0, "scrollY": 0, "searchMatches": null, "selectedElementIds": { - "id29": true, + "id32": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -14452,7 +13442,7 @@ exports[`history > singleplayer undo/redo > should not override appstate changes "frameId": null, "groupIds": [], "height": 10, - "id": "id29", + "id": "id32", "index": "a0", "isDeleted": false, "link": null, @@ -14491,17 +13481,19 @@ exports[`history > singleplayer undo/redo > should not override appstate changes "added": {}, "removed": {}, "updated": { - "id29": { + "id32": { "deleted": { "backgroundColor": "#ffc9c9", + "version": 10, }, "inserted": { "backgroundColor": "#a5d8ff", + "version": 9, }, }, }, }, - "id": "id43", + "id": "id51", }, { "appState": AppStateDelta { @@ -14514,24 +13506,26 @@ exports[`history > singleplayer undo/redo > should not override appstate changes "added": {}, "removed": {}, "updated": { - "id29": { + "id32": { "deleted": { "backgroundColor": "transparent", + "version": 11, }, "inserted": { "backgroundColor": "#ffc9c9", + "version": 10, }, }, }, }, - "id": "id44", + "id": "id53", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id29": true, + "id32": true, }, }, "inserted": { @@ -14544,7 +13538,7 @@ exports[`history > singleplayer undo/redo > should not override appstate changes "removed": {}, "updated": {}, }, - "id": "id45", + "id": "id55", }, ] `; @@ -14556,7 +13550,7 @@ exports[`history > singleplayer undo/redo > should not override appstate changes "delta": Delta { "deleted": { "selectedElementIds": { - "id29": true, + "id32": true, }, }, "inserted": { @@ -14567,7 +13561,7 @@ exports[`history > singleplayer undo/redo > should not override appstate changes "elements": { "added": {}, "removed": { - "id29": { + "id32": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -14590,6 +13584,7 @@ exports[`history > singleplayer undo/redo > should not override appstate changes "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 10, "y": 0, @@ -14601,11 +13596,219 @@ exports[`history > singleplayer undo/redo > should not override appstate changes }, "updated": {}, }, - "id": "id31", + "id": "id34", }, ] `; +exports[`history > singleplayer undo/redo > should not push into redo stack when selection changes dooes not produce a visible change > [end of test] appState 1`] = ` +{ + "activeEmbeddable": null, + "activeLockedId": null, + "activeTool": { + "customType": null, + "fromSelection": false, + "lastActiveTool": null, + "locked": false, + "type": "selection", + }, + "collaborators": Map {}, + "contextMenu": null, + "croppingElementId": null, + "currentChartType": "bar", + "currentHoveredFontFamily": null, + "currentItemArrowType": "round", + "currentItemBackgroundColor": "transparent", + "currentItemEndArrowhead": "arrow", + "currentItemFillStyle": "solid", + "currentItemFontFamily": 5, + "currentItemFontSize": 20, + "currentItemOpacity": 100, + "currentItemRoughness": 1, + "currentItemRoundness": "round", + "currentItemStartArrowhead": null, + "currentItemStrokeColor": "#1e1e1e", + "currentItemStrokeStyle": "solid", + "currentItemStrokeWidth": 2, + "currentItemTextAlign": "left", + "cursorButton": "up", + "defaultSidebarDockedPreference": false, + "editingFrame": null, + "editingGroupId": null, + "editingLinearElement": null, + "editingTextElement": null, + "elementsToHighlight": null, + "errorMessage": null, + "exportBackground": true, + "exportEmbedScene": false, + "exportScale": 1, + "exportWithDarkMode": false, + "fileHandle": null, + "followedBy": Set {}, + "frameRendering": { + "clip": true, + "enabled": true, + "name": true, + "outline": true, + }, + "frameToHighlight": null, + "gridModeEnabled": false, + "gridSize": 20, + "gridStep": 5, + "height": 0, + "hoveredElementIds": {}, + "isBindingEnabled": true, + "isCropping": false, + "isLoading": false, + "isResizing": false, + "isRotating": false, + "lastPointerDownWith": "mouse", + "lockedMultiSelections": {}, + "multiElement": null, + "newElement": null, + "objectsSnapModeEnabled": false, + "offsetLeft": 0, + "offsetTop": 0, + "openDialog": null, + "openMenu": null, + "openPopup": null, + "openSidebar": null, + "originSnapOffset": null, + "pasteDialog": { + "data": null, + "shown": false, + }, + "penDetected": false, + "penMode": false, + "pendingImageElementId": null, + "previousSelectedElementIds": { + "id64": true, + }, + "resizingElement": null, + "scrollX": 0, + "scrollY": 0, + "searchMatches": null, + "selectedElementIds": {}, + "selectedElementsAreBeingDragged": false, + "selectedGroupIds": {}, + "selectionElement": null, + "shouldCacheIgnoreZoom": false, + "showHyperlinkPopup": false, + "showWelcomeScreen": true, + "snapLines": [], + "startBoundElement": null, + "stats": { + "open": false, + "panels": 3, + }, + "suggestedBindings": [], + "theme": "light", + "toast": null, + "userToFollow": null, + "viewBackgroundColor": "#ffffff", + "viewModeEnabled": false, + "width": 0, + "zenModeEnabled": false, + "zoom": { + "value": 1, + }, +} +`; + +exports[`history > singleplayer undo/redo > should not push into redo stack when selection changes dooes not produce a visible change > [end of test] element 0 1`] = ` +{ + "angle": 0, + "backgroundColor": "transparent", + "boundElements": null, + "customData": undefined, + "fillStyle": "solid", + "frameId": null, + "groupIds": [], + "height": 10, + "id": "id64", + "index": "a0", + "isDeleted": true, + "link": null, + "locked": false, + "opacity": 100, + "roughness": 1, + "roundness": { + "type": 3, + }, + "strokeColor": "#1e1e1e", + "strokeStyle": "solid", + "strokeWidth": 2, + "type": "rectangle", + "updated": 1, + "version": 4, + "width": 10, + "x": 10, + "y": 0, +} +`; + +exports[`history > singleplayer undo/redo > should not push into redo stack when selection changes dooes not produce a visible change > [end of test] number of elements 1`] = `1`; + +exports[`history > singleplayer undo/redo > should not push into redo stack when selection changes dooes not produce a visible change > [end of test] number of renders 1`] = `13`; + +exports[`history > singleplayer undo/redo > should not push into redo stack when selection changes dooes not produce a visible change > [end of test] redo stack 1`] = ` +[ + { + "appState": AppStateDelta { + "delta": Delta { + "deleted": { + "selectedElementIds": { + "id64": true, + }, + }, + "inserted": { + "selectedElementIds": {}, + }, + }, + }, + "elements": { + "added": {}, + "removed": {}, + "updated": {}, + }, + "id": "id81", + }, + { + "appState": AppStateDelta { + "delta": Delta { + "deleted": { + "selectedElementIds": {}, + }, + "inserted": { + "selectedElementIds": { + "id64": true, + }, + }, + }, + }, + "elements": { + "added": { + "id64": { + "deleted": { + "isDeleted": true, + "version": 4, + }, + "inserted": { + "isDeleted": false, + "version": 3, + }, + }, + }, + "removed": {}, + "updated": {}, + }, + "id": "id83", + }, +] +`; + +exports[`history > singleplayer undo/redo > should not push into redo stack when selection changes dooes not produce a visible change > [end of test] undo stack 1`] = `[]`; + exports[`history > singleplayer undo/redo > should support appstate name or viewBackgroundColor change > [end of test] appState 1`] = ` { "activeEmbeddable": null, @@ -14745,7 +13948,7 @@ exports[`history > singleplayer undo/redo > should support appstate name or view "removed": {}, "updated": {}, }, - "id": "id88", + "id": "id110", }, { "appState": AppStateDelta { @@ -14763,7 +13966,7 @@ exports[`history > singleplayer undo/redo > should support appstate name or view "removed": {}, "updated": {}, }, - "id": "id89", + "id": "id112", }, ] `; @@ -14849,14 +14052,14 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id230": true, + "id293": true, }, "resizingElement": null, "scrollX": 0, "scrollY": 0, "searchMatches": null, "selectedElementIds": { - "id243": true, + "id306": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -14890,11 +14093,11 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "backgroundColor": "transparent", "boundElements": [ { - "id": "id231", + "id": "id294", "type": "text", }, { - "id": "id243", + "id": "id306", "type": "arrow", }, ], @@ -14903,7 +14106,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 100, - "id": "id230", + "id": "id293", "index": "a0", "isDeleted": false, "link": null, @@ -14931,7 +14134,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id230", + "containerId": "id293", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -14939,7 +14142,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 25, - "id": "id231", + "id": "id294", "index": "a1", "isDeleted": false, "lineHeight": "1.25000", @@ -14972,7 +14175,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "backgroundColor": "transparent", "boundElements": [ { - "id": "id243", + "id": "id306", "type": "arrow", }, ], @@ -14981,7 +14184,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 100, - "id": "id232", + "id": "id295", "index": "a2", "isDeleted": false, "link": null, @@ -15012,7 +14215,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "elbowed": false, "endArrowhead": "arrow", "endBinding": { - "elementId": "id232", + "elementId": "id295", "focus": -0, "gap": 1, }, @@ -15020,7 +14223,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 0, - "id": "id243", + "id": "id306", "index": "a3", "isDeleted": false, "lastCommittedPoint": null, @@ -15043,7 +14246,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, "startArrowhead": null, "startBinding": { - "elementId": "id230", + "elementId": "id293", "focus": 0, "gap": 1, }, @@ -15070,9 +14273,9 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "delta": Delta { "deleted": { "selectedElementIds": { - "id243": true, + "id306": true, }, - "selectedLinearElementId": "id243", + "selectedLinearElementId": "id306", }, "inserted": { "selectedElementIds": {}, @@ -15083,7 +14286,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "elements": { "added": {}, "removed": { - "id243": { + "id306": { "deleted": { "isDeleted": false, "points": [ @@ -15092,10 +14295,13 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding 0, ], [ - 100, + "98.58579", 0, ], ], + "version": 10, + "width": "98.58579", + "x": "0.70711", }, "inserted": { "isDeleted": true, @@ -15109,39 +14315,54 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding 0, ], ], + "version": 7, + "width": 100, + "x": 0, }, }, }, "updated": { - "id230": { + "id293": { "deleted": { "boundElements": [ { - "id": "id243", + "id": "id306", "type": "arrow", }, ], + "version": 8, }, "inserted": { "boundElements": [], + "version": 5, }, }, - "id232": { + "id294": { + "deleted": { + "version": 6, + }, + "inserted": { + "version": 4, + }, + }, + "id295": { "deleted": { "boundElements": [ { - "id": "id243", + "id": "id306", "type": "arrow", }, ], + "version": 7, }, "inserted": { "boundElements": [], + "version": 4, }, }, }, }, - "id": "id248", + "id": "id312", }, ] `; @@ -15158,7 +14379,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "elements": { "added": {}, "removed": { - "id230": { + "id293": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -15181,6 +14402,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 100, "x": -100, "y": -50, @@ -15189,7 +14411,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "isDeleted": true, }, }, - "id231": { + "id294": { "deleted": { "angle": 0, "autoResize": true, @@ -15220,6 +14442,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "text": "ola", "textAlign": "left", "type": "text", + "version": 2, "verticalAlign": "top", "width": 100, "x": -200, @@ -15229,7 +14452,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "isDeleted": true, }, }, - "id232": { + "id295": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -15252,6 +14475,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 100, "x": 100, "y": -50, @@ -15263,14 +14487,14 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, "updated": {}, }, - "id": "id234", + "id": "id297", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id230": true, + "id293": true, }, }, "inserted": { @@ -15283,14 +14507,14 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "removed": {}, "updated": {}, }, - "id": "id237", + "id": "id300", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id231": true, + "id294": true, }, }, "inserted": { @@ -15303,7 +14527,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "removed": {}, "updated": {}, }, - "id": "id240", + "id": "id303", }, { "appState": AppStateDelta { @@ -15313,7 +14537,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, "inserted": { "selectedElementIds": { - "id231": true, + "id294": true, }, }, }, @@ -15322,24 +14546,27 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "added": {}, "removed": {}, "updated": { - "id230": { + "id293": { "deleted": { "boundElements": [ { - "id": "id231", + "id": "id294", "type": "text", }, ], + "version": 3, }, "inserted": { "boundElements": [], + "version": 2, }, }, - "id231": { + "id294": { "deleted": { - "containerId": "id230", + "containerId": "id293", "height": 25, "textAlign": "center", + "version": 4, "verticalAlign": "middle", "width": 30, "x": -65, @@ -15349,6 +14576,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "containerId": null, "height": 100, "textAlign": "left", + "version": 2, "verticalAlign": "top", "width": 100, "x": -200, @@ -15357,20 +14585,20 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, }, }, - "id": "id242", + "id": "id305", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id243": true, + "id306": true, }, - "selectedLinearElementId": "id243", + "selectedLinearElementId": "id306", }, "inserted": { "selectedElementIds": { - "id230": true, + "id293": true, }, "selectedLinearElementId": null, }, @@ -15379,7 +14607,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "elements": { "added": {}, "removed": { - "id243": { + "id306": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -15388,7 +14616,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "elbowed": false, "endArrowhead": "arrow", "endBinding": { - "elementId": "id232", + "elementId": "id295", "focus": -0, "gap": 1, }, @@ -15418,7 +14646,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, "startArrowhead": null, "startBinding": { - "elementId": "id230", + "elementId": "id293", "focus": 0, "gap": 1, }, @@ -15426,6 +14654,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "strokeStyle": "solid", "strokeWidth": 2, "type": "arrow", + "version": 6, "width": 100, "x": 0, "y": 0, @@ -15436,35 +14665,39 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, }, "updated": { - "id230": { + "id293": { "deleted": { "boundElements": [ { - "id": "id243", + "id": "id306", "type": "arrow", }, ], + "version": 4, }, "inserted": { "boundElements": [], + "version": 3, }, }, - "id232": { + "id295": { "deleted": { "boundElements": [ { - "id": "id243", + "id": "id306", "type": "arrow", }, ], + "version": 3, }, "inserted": { "boundElements": [], + "version": 2, }, }, }, }, - "id": "id245", + "id": "id308", }, ] `; @@ -15550,14 +14783,14 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id212": true, + "id273": true, }, "resizingElement": null, "scrollX": 0, "scrollY": 0, "searchMatches": null, "selectedElementIds": { - "id225": true, + "id286": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -15591,11 +14824,11 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "backgroundColor": "transparent", "boundElements": [ { - "id": "id213", + "id": "id274", "type": "text", }, { - "id": "id225", + "id": "id286", "type": "arrow", }, ], @@ -15604,7 +14837,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 100, - "id": "id212", + "id": "id273", "index": "a0", "isDeleted": false, "link": null, @@ -15632,7 +14865,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id212", + "containerId": "id273", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -15640,7 +14873,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 25, - "id": "id213", + "id": "id274", "index": "a1", "isDeleted": false, "lineHeight": "1.25000", @@ -15673,7 +14906,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "backgroundColor": "transparent", "boundElements": [ { - "id": "id225", + "id": "id286", "type": "arrow", }, ], @@ -15682,7 +14915,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 100, - "id": "id214", + "id": "id275", "index": "a2", "isDeleted": false, "link": null, @@ -15713,7 +14946,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "elbowed": false, "endArrowhead": "arrow", "endBinding": { - "elementId": "id214", + "elementId": "id275", "focus": -0, "gap": 1, }, @@ -15721,7 +14954,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 0, - "id": "id225", + "id": "id286", "index": "a3", "isDeleted": false, "lastCommittedPoint": null, @@ -15744,7 +14977,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, "startArrowhead": null, "startBinding": { - "elementId": "id212", + "elementId": "id273", "focus": 0, "gap": 1, }, @@ -15778,7 +15011,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "elements": { "added": {}, "removed": { - "id212": { + "id273": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -15801,6 +15034,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 100, "x": -100, "y": -50, @@ -15809,7 +15043,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "isDeleted": true, }, }, - "id213": { + "id274": { "deleted": { "angle": 0, "autoResize": true, @@ -15840,6 +15074,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "text": "ola", "textAlign": "left", "type": "text", + "version": 2, "verticalAlign": "top", "width": 100, "x": -200, @@ -15849,7 +15084,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "isDeleted": true, }, }, - "id214": { + "id275": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -15872,6 +15107,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 100, "x": 100, "y": -50, @@ -15883,14 +15119,14 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, "updated": {}, }, - "id": "id216", + "id": "id277", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id212": true, + "id273": true, }, }, "inserted": { @@ -15903,14 +15139,14 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "removed": {}, "updated": {}, }, - "id": "id219", + "id": "id280", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id213": true, + "id274": true, }, }, "inserted": { @@ -15923,7 +15159,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "removed": {}, "updated": {}, }, - "id": "id222", + "id": "id283", }, { "appState": AppStateDelta { @@ -15933,7 +15169,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, "inserted": { "selectedElementIds": { - "id213": true, + "id274": true, }, }, }, @@ -15942,24 +15178,27 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "added": {}, "removed": {}, "updated": { - "id212": { + "id273": { "deleted": { "boundElements": [ { - "id": "id213", + "id": "id274", "type": "text", }, ], + "version": 3, }, "inserted": { "boundElements": [], + "version": 2, }, }, - "id213": { + "id274": { "deleted": { - "containerId": "id212", + "containerId": "id273", "height": 25, "textAlign": "center", + "version": 4, "verticalAlign": "middle", "width": 30, "x": -65, @@ -15969,6 +15208,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "containerId": null, "height": 100, "textAlign": "left", + "version": 2, "verticalAlign": "top", "width": 100, "x": -200, @@ -15977,20 +15217,20 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, }, }, - "id": "id224", + "id": "id285", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id225": true, + "id286": true, }, - "selectedLinearElementId": "id225", + "selectedLinearElementId": "id286", }, "inserted": { "selectedElementIds": { - "id212": true, + "id273": true, }, "selectedLinearElementId": null, }, @@ -15999,29 +15239,25 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "elements": { "added": {}, "removed": { - "id225": { + "id286": { "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "elbowed": false, - "endArrowhead": "arrow", - "endBinding": { - "elementId": "id214", - "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, + ], + [ + "98.58579", + 0, + ], + ], + "version": 10, + "width": "98.58579", + "x": "0.70711", + }, + "inserted": { + "isDeleted": true, "points": [ [ 0, @@ -16032,59 +15268,54 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding 0, ], ], - "roughness": 1, - "roundness": { - "type": 2, - }, - "startArrowhead": null, - "startBinding": { - "elementId": "id212", - "focus": 0, - "gap": 1, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "arrow", + "version": 7, "width": 100, "x": 0, - "y": 0, - }, - "inserted": { - "isDeleted": true, }, }, }, "updated": { - "id212": { + "id273": { "deleted": { "boundElements": [ { - "id": "id225", + "id": "id286", "type": "arrow", }, ], + "version": 8, }, "inserted": { "boundElements": [], + "version": 5, }, }, - "id214": { + "id274": { + "deleted": { + "version": 8, + }, + "inserted": { + "version": 6, + }, + }, + "id275": { "deleted": { "boundElements": [ { - "id": "id225", + "id": "id286", "type": "arrow", }, ], + "version": 7, }, "inserted": { "boundElements": [], + "version": 4, }, }, }, }, - "id": "id229", + "id": "id292", }, ] `; @@ -16170,14 +15401,14 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id249": true, + "id313": true, }, "resizingElement": null, "scrollX": 0, "scrollY": 0, "searchMatches": null, "selectedElementIds": { - "id262": true, + "id326": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -16211,11 +15442,11 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "backgroundColor": "transparent", "boundElements": [ { - "id": "id250", + "id": "id314", "type": "text", }, { - "id": "id262", + "id": "id326", "type": "arrow", }, ], @@ -16224,7 +15455,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 100, - "id": "id249", + "id": "id313", "index": "a0", "isDeleted": false, "link": null, @@ -16252,7 +15483,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id249", + "containerId": "id313", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -16260,7 +15491,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 25, - "id": "id250", + "id": "id314", "index": "a1", "isDeleted": false, "lineHeight": "1.25000", @@ -16293,7 +15524,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "backgroundColor": "transparent", "boundElements": [ { - "id": "id262", + "id": "id326", "type": "arrow", }, ], @@ -16302,7 +15533,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 100, - "id": "id251", + "id": "id315", "index": "a2", "isDeleted": false, "link": null, @@ -16333,7 +15564,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "elbowed": false, "endArrowhead": "arrow", "endBinding": { - "elementId": "id251", + "elementId": "id315", "focus": -0, "gap": 1, }, @@ -16341,7 +15572,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 0, - "id": "id262", + "id": "id326", "index": "a3", "isDeleted": false, "lastCommittedPoint": null, @@ -16364,7 +15595,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, "startArrowhead": null, "startBinding": { - "elementId": "id249", + "elementId": "id313", "focus": 0, "gap": 1, }, @@ -16398,119 +15629,47 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "elements": { "added": {}, "removed": { - "id249": { + "id313": { "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, + "version": 8, }, "inserted": { "isDeleted": true, + "version": 7, }, }, - "id250": { + "id314": { "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, + "version": 9, }, "inserted": { "isDeleted": true, + "version": 8, }, }, - "id251": { + "id315": { "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, + "version": 6, }, "inserted": { "isDeleted": true, + "version": 5, }, }, }, "updated": {}, }, - "id": "id270", + "id": "id340", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id249": true, + "id313": true, }, }, "inserted": { @@ -16523,14 +15682,14 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "removed": {}, "updated": {}, }, - "id": "id271", + "id": "id342", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id250": true, + "id314": true, }, }, "inserted": { @@ -16543,7 +15702,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "removed": {}, "updated": {}, }, - "id": "id272", + "id": "id344", }, { "appState": AppStateDelta { @@ -16553,7 +15712,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, "inserted": { "selectedElementIds": { - "id250": true, + "id314": true, }, }, }, @@ -16562,24 +15721,27 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "added": {}, "removed": {}, "updated": { - "id249": { + "id313": { "deleted": { "boundElements": [ { - "id": "id250", + "id": "id314", "type": "text", }, ], + "version": 9, }, "inserted": { "boundElements": [], + "version": 8, }, }, - "id250": { + "id314": { "deleted": { - "containerId": "id249", + "containerId": "id313", "height": 25, "textAlign": "center", + "version": 10, "verticalAlign": "middle", "width": 30, "x": -65, @@ -16589,6 +15751,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "containerId": null, "height": 100, "textAlign": "left", + "version": 9, "verticalAlign": "top", "width": 100, "x": -200, @@ -16597,20 +15760,20 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, }, }, - "id": "id273", + "id": "id346", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id262": true, + "id326": true, }, - "selectedLinearElementId": "id262", + "selectedLinearElementId": "id326", }, "inserted": { "selectedElementIds": { - "id249": true, + "id313": true, }, "selectedLinearElementId": null, }, @@ -16619,29 +15782,25 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "elements": { "added": {}, "removed": { - "id262": { + "id326": { "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "elbowed": false, - "endArrowhead": "arrow", - "endBinding": { - "elementId": "id251", - "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, + ], + [ + "98.58579", + 0, + ], + ], + "version": 10, + "width": "98.58579", + "x": "0.70711", + }, + "inserted": { + "isDeleted": true, "points": [ [ 0, @@ -16652,59 +15811,54 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding 0, ], ], - "roughness": 1, - "roundness": { - "type": 2, - }, - "startArrowhead": null, - "startBinding": { - "elementId": "id249", - "focus": 0, - "gap": 1, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "arrow", + "version": 7, "width": 100, "x": 0, - "y": 0, - }, - "inserted": { - "isDeleted": true, }, }, }, "updated": { - "id249": { + "id313": { "deleted": { "boundElements": [ { - "id": "id262", + "id": "id326", "type": "arrow", }, ], + "version": 12, }, "inserted": { "boundElements": [], + "version": 9, }, }, - "id251": { + "id314": { + "deleted": { + "version": 12, + }, + "inserted": { + "version": 10, + }, + }, + "id315": { "deleted": { "boundElements": [ { - "id": "id262", + "id": "id326", "type": "arrow", }, ], + "version": 9, }, "inserted": { "boundElements": [], + "version": 6, }, }, }, }, - "id": "id274", + "id": "id348", }, ] `; @@ -16795,7 +15949,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "scrollY": 0, "searchMatches": null, "selectedElementIds": { - "id275": true, + "id349": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -16829,11 +15983,11 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "backgroundColor": "transparent", "boundElements": [ { - "id": "id288", + "id": "id362", "type": "arrow", }, { - "id": "id276", + "id": "id350", "type": "text", }, ], @@ -16842,7 +15996,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 100, - "id": "id275", + "id": "id349", "index": "a0", "isDeleted": false, "link": null, @@ -16870,7 +16024,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id275", + "containerId": "id349", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -16878,7 +16032,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 25, - "id": "id276", + "id": "id350", "index": "a1", "isDeleted": false, "lineHeight": "1.25000", @@ -16911,7 +16065,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "backgroundColor": "transparent", "boundElements": [ { - "id": "id288", + "id": "id362", "type": "arrow", }, ], @@ -16920,7 +16074,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 100, - "id": "id277", + "id": "id351", "index": "a2", "isDeleted": false, "link": null, @@ -16951,7 +16105,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "elbowed": false, "endArrowhead": "arrow", "endBinding": { - "elementId": "id277", + "elementId": "id351", "focus": -0, "gap": 1, }, @@ -16959,7 +16113,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 0, - "id": "id288", + "id": "id362", "index": "a3", "isDeleted": false, "lastCommittedPoint": null, @@ -16982,7 +16136,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, "startArrowhead": null, "startBinding": { - "elementId": "id275", + "elementId": "id349", "focus": 0, "gap": 1, }, @@ -17009,7 +16163,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "delta": Delta { "deleted": { "selectedElementIds": { - "id275": true, + "id349": true, }, }, "inserted": { @@ -17020,25 +16174,37 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "elements": { "added": {}, "removed": { - "id275": { + "id349": { "deleted": { "isDeleted": false, + "version": 8, }, "inserted": { "isDeleted": true, + "version": 5, }, }, - "id276": { + "id350": { "deleted": { "isDeleted": false, + "version": 8, }, "inserted": { "isDeleted": true, + "version": 5, }, }, }, "updated": { - "id288": { + "id351": { + "deleted": { + "version": 5, + }, + "inserted": { + "version": 3, + }, + }, + "id362": { "deleted": { "points": [ [ @@ -17046,15 +16212,18 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding 0, ], [ - 100, + "98.58579", 0, ], ], "startBinding": { - "elementId": "id275", + "elementId": "id349", "focus": 0, "gap": 1, }, + "version": 10, + "width": "98.58579", + "x": "0.70711", }, "inserted": { "points": [ @@ -17068,11 +16237,14 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding ], ], "startBinding": null, + "version": 7, + "width": 100, + "x": 0, }, }, }, }, - "id": "id296", + "id": "id371", }, ] `; @@ -17089,7 +16261,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "elements": { "added": {}, "removed": { - "id275": { + "id349": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -17112,6 +16284,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 100, "x": -100, "y": -50, @@ -17120,7 +16293,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "isDeleted": true, }, }, - "id276": { + "id350": { "deleted": { "angle": 0, "autoResize": true, @@ -17151,6 +16324,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "text": "ola", "textAlign": "left", "type": "text", + "version": 2, "verticalAlign": "top", "width": 100, "x": -200, @@ -17160,7 +16334,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "isDeleted": true, }, }, - "id277": { + "id351": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -17183,6 +16357,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 100, "x": 100, "y": -50, @@ -17194,14 +16369,14 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, "updated": {}, }, - "id": "id279", + "id": "id353", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id275": true, + "id349": true, }, }, "inserted": { @@ -17214,14 +16389,14 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "removed": {}, "updated": {}, }, - "id": "id282", + "id": "id356", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id276": true, + "id350": true, }, }, "inserted": { @@ -17234,7 +16409,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "removed": {}, "updated": {}, }, - "id": "id285", + "id": "id359", }, { "appState": AppStateDelta { @@ -17244,7 +16419,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, "inserted": { "selectedElementIds": { - "id276": true, + "id350": true, }, }, }, @@ -17253,24 +16428,27 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "added": {}, "removed": {}, "updated": { - "id275": { + "id349": { "deleted": { "boundElements": [ { - "id": "id276", + "id": "id350", "type": "text", }, ], + "version": 3, }, "inserted": { "boundElements": [], + "version": 2, }, }, - "id276": { + "id350": { "deleted": { - "containerId": "id275", + "containerId": "id349", "height": 25, "textAlign": "center", + "version": 4, "verticalAlign": "middle", "width": 30, "x": -65, @@ -17280,6 +16458,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "containerId": null, "height": 100, "textAlign": "left", + "version": 2, "verticalAlign": "top", "width": 100, "x": -200, @@ -17288,20 +16467,20 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, }, }, - "id": "id287", + "id": "id361", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id288": true, + "id362": true, }, - "selectedLinearElementId": "id288", + "selectedLinearElementId": "id362", }, "inserted": { "selectedElementIds": { - "id275": true, + "id349": true, }, "selectedLinearElementId": null, }, @@ -17310,7 +16489,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "elements": { "added": {}, "removed": { - "id288": { + "id362": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -17319,7 +16498,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "elbowed": false, "endArrowhead": "arrow", "endBinding": { - "elementId": "id277", + "elementId": "id351", "focus": -0, "gap": 1, }, @@ -17349,7 +16528,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, "startArrowhead": null, "startBinding": { - "elementId": "id275", + "elementId": "id349", "focus": 0, "gap": 1, }, @@ -17357,6 +16536,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "strokeStyle": "solid", "strokeWidth": 2, "type": "arrow", + "version": 6, "width": 100, "x": 0, "y": 0, @@ -17367,50 +16547,54 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, }, "updated": { - "id275": { + "id349": { "deleted": { "boundElements": [ { - "id": "id288", + "id": "id362", "type": "arrow", }, ], + "version": 4, }, "inserted": { "boundElements": [], + "version": 3, }, }, - "id277": { + "id351": { "deleted": { "boundElements": [ { - "id": "id288", + "id": "id362", "type": "arrow", }, ], + "version": 3, }, "inserted": { "boundElements": [], + "version": 2, }, }, }, }, - "id": "id290", + "id": "id364", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id275": true, + "id349": true, }, "selectedLinearElementId": null, }, "inserted": { "selectedElementIds": { - "id288": true, + "id362": true, }, - "selectedLinearElementId": "id288", + "selectedLinearElementId": "id362", }, }, }, @@ -17419,7 +16603,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "removed": {}, "updated": {}, }, - "id": "id293", + "id": "id367", }, ] `; @@ -17505,15 +16689,15 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id297": true, + "id372": true, }, "resizingElement": null, "scrollX": 0, "scrollY": 0, "searchMatches": null, "selectedElementIds": { - "id297": true, - "id299": true, + "id372": true, + "id374": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -17547,11 +16731,11 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "backgroundColor": "transparent", "boundElements": [ { - "id": "id310", + "id": "id385", "type": "arrow", }, { - "id": "id298", + "id": "id373", "type": "text", }, ], @@ -17560,7 +16744,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 100, - "id": "id297", + "id": "id372", "index": "a0", "isDeleted": false, "link": null, @@ -17588,7 +16772,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "autoResize": true, "backgroundColor": "transparent", "boundElements": null, - "containerId": "id297", + "containerId": "id372", "customData": undefined, "fillStyle": "solid", "fontFamily": 5, @@ -17596,7 +16780,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 25, - "id": "id298", + "id": "id373", "index": "a1", "isDeleted": false, "lineHeight": "1.25000", @@ -17629,7 +16813,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "backgroundColor": "transparent", "boundElements": [ { - "id": "id310", + "id": "id385", "type": "arrow", }, ], @@ -17638,7 +16822,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 100, - "id": "id299", + "id": "id374", "index": "a2", "isDeleted": false, "link": null, @@ -17669,7 +16853,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "elbowed": false, "endArrowhead": "arrow", "endBinding": { - "elementId": "id299", + "elementId": "id374", "focus": -0, "gap": 1, }, @@ -17677,7 +16861,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "frameId": null, "groupIds": [], "height": 0, - "id": "id310", + "id": "id385", "index": "a3", "isDeleted": false, "lastCommittedPoint": null, @@ -17700,7 +16884,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, "startArrowhead": null, "startBinding": { - "elementId": "id297", + "elementId": "id372", "focus": 0, "gap": 1, }, @@ -17727,8 +16911,8 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "delta": Delta { "deleted": { "selectedElementIds": { - "id297": true, - "id299": true, + "id372": true, + "id374": true, }, }, "inserted": { @@ -17739,36 +16923,42 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "elements": { "added": {}, "removed": { - "id297": { + "id372": { "deleted": { "isDeleted": false, + "version": 8, }, "inserted": { "isDeleted": true, + "version": 5, }, }, - "id298": { + "id373": { "deleted": { "isDeleted": false, + "version": 8, }, "inserted": { "isDeleted": true, + "version": 5, }, }, - "id299": { + "id374": { "deleted": { "isDeleted": false, + "version": 5, }, "inserted": { "isDeleted": true, + "version": 4, }, }, }, "updated": { - "id310": { + "id385": { "deleted": { "endBinding": { - "elementId": "id299", + "elementId": "id374", "focus": -0, "gap": 1, }, @@ -17778,15 +16968,18 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding 0, ], [ - 100, + "98.58579", 0, ], ], "startBinding": { - "elementId": "id297", + "elementId": "id372", "focus": 0, "gap": 1, }, + "version": 11, + "width": "98.58579", + "x": "0.70711", }, "inserted": { "endBinding": null, @@ -17801,11 +16994,14 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding ], ], "startBinding": null, + "version": 8, + "width": 100, + "x": 0, }, }, }, }, - "id": "id321", + "id": "id397", }, ] `; @@ -17822,7 +17018,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "elements": { "added": {}, "removed": { - "id297": { + "id372": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -17845,6 +17041,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 100, "x": -100, "y": -50, @@ -17853,7 +17050,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "isDeleted": true, }, }, - "id298": { + "id373": { "deleted": { "angle": 0, "autoResize": true, @@ -17884,6 +17081,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "text": "ola", "textAlign": "left", "type": "text", + "version": 2, "verticalAlign": "top", "width": 100, "x": -200, @@ -17893,7 +17091,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "isDeleted": true, }, }, - "id299": { + "id374": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -17916,6 +17114,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 100, "x": 100, "y": -50, @@ -17927,14 +17126,14 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, "updated": {}, }, - "id": "id301", + "id": "id376", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id297": true, + "id372": true, }, }, "inserted": { @@ -17947,14 +17146,14 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "removed": {}, "updated": {}, }, - "id": "id304", + "id": "id379", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id298": true, + "id373": true, }, }, "inserted": { @@ -17967,7 +17166,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "removed": {}, "updated": {}, }, - "id": "id307", + "id": "id382", }, { "appState": AppStateDelta { @@ -17977,7 +17176,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, "inserted": { "selectedElementIds": { - "id298": true, + "id373": true, }, }, }, @@ -17986,24 +17185,27 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "added": {}, "removed": {}, "updated": { - "id297": { + "id372": { "deleted": { "boundElements": [ { - "id": "id298", + "id": "id373", "type": "text", }, ], + "version": 3, }, "inserted": { "boundElements": [], + "version": 2, }, }, - "id298": { + "id373": { "deleted": { - "containerId": "id297", + "containerId": "id372", "height": 25, "textAlign": "center", + "version": 4, "verticalAlign": "middle", "width": 30, "x": -65, @@ -18013,6 +17215,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "containerId": null, "height": 100, "textAlign": "left", + "version": 2, "verticalAlign": "top", "width": 100, "x": -200, @@ -18021,20 +17224,20 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, }, }, - "id": "id309", + "id": "id384", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id310": true, + "id385": true, }, - "selectedLinearElementId": "id310", + "selectedLinearElementId": "id385", }, "inserted": { "selectedElementIds": { - "id297": true, + "id372": true, }, "selectedLinearElementId": null, }, @@ -18043,7 +17246,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "elements": { "added": {}, "removed": { - "id310": { + "id385": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -18052,7 +17255,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "elbowed": false, "endArrowhead": "arrow", "endBinding": { - "elementId": "id299", + "elementId": "id374", "focus": -0, "gap": 1, }, @@ -18082,7 +17285,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, "startArrowhead": null, "startBinding": { - "elementId": "id297", + "elementId": "id372", "focus": 0, "gap": 1, }, @@ -18090,6 +17293,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "strokeStyle": "solid", "strokeWidth": 2, "type": "arrow", + "version": 6, "width": 100, "x": 0, "y": 0, @@ -18100,50 +17304,54 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding }, }, "updated": { - "id297": { + "id372": { "deleted": { "boundElements": [ { - "id": "id310", + "id": "id385", "type": "arrow", }, ], + "version": 4, }, "inserted": { "boundElements": [], + "version": 3, }, }, - "id299": { + "id374": { "deleted": { "boundElements": [ { - "id": "id310", + "id": "id385", "type": "arrow", }, ], + "version": 3, }, "inserted": { "boundElements": [], + "version": 2, }, }, }, }, - "id": "id312", + "id": "id387", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id297": true, + "id372": true, }, "selectedLinearElementId": null, }, "inserted": { "selectedElementIds": { - "id310": true, + "id385": true, }, - "selectedLinearElementId": "id310", + "selectedLinearElementId": "id385", }, }, }, @@ -18152,14 +17360,14 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "removed": {}, "updated": {}, }, - "id": "id315", + "id": "id390", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id299": true, + "id374": true, }, }, "inserted": { @@ -18172,7 +17380,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "removed": {}, "updated": {}, }, - "id": "id318", + "id": "id393", }, ] `; @@ -18258,15 +17466,15 @@ exports[`history > singleplayer undo/redo > should support changes in elements' "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id189": true, + "id246": true, }, "resizingElement": null, "scrollX": 0, "scrollY": 0, "searchMatches": null, "selectedElementIds": { - "id189": true, - "id195": true, + "id246": true, + "id252": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -18304,7 +17512,7 @@ exports[`history > singleplayer undo/redo > should support changes in elements' "frameId": null, "groupIds": [], "height": 10, - "id": "id192", + "id": "id249", "index": "a1", "isDeleted": false, "link": null, @@ -18336,7 +17544,7 @@ exports[`history > singleplayer undo/redo > should support changes in elements' "frameId": null, "groupIds": [], "height": 10, - "id": "id189", + "id": "id246", "index": "a2", "isDeleted": false, "link": null, @@ -18368,7 +17576,7 @@ exports[`history > singleplayer undo/redo > should support changes in elements' "frameId": null, "groupIds": [], "height": 10, - "id": "id195", + "id": "id252", "index": "a3", "isDeleted": false, "link": null, @@ -18403,7 +17611,7 @@ exports[`history > singleplayer undo/redo > should support changes in elements' "delta": Delta { "deleted": { "selectedElementIds": { - "id189": true, + "id246": true, }, }, "inserted": { @@ -18414,7 +17622,7 @@ exports[`history > singleplayer undo/redo > should support changes in elements' "elements": { "added": {}, "removed": { - "id189": { + "id246": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -18437,6 +17645,7 @@ exports[`history > singleplayer undo/redo > should support changes in elements' "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 10, "y": 0, @@ -18448,19 +17657,19 @@ exports[`history > singleplayer undo/redo > should support changes in elements' }, "updated": {}, }, - "id": "id191", + "id": "id248", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id192": true, + "id249": true, }, }, "inserted": { "selectedElementIds": { - "id189": true, + "id246": true, }, }, }, @@ -18468,7 +17677,7 @@ exports[`history > singleplayer undo/redo > should support changes in elements' "elements": { "added": {}, "removed": { - "id192": { + "id249": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -18491,6 +17700,7 @@ exports[`history > singleplayer undo/redo > should support changes in elements' "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 20, "y": 20, @@ -18502,19 +17712,19 @@ exports[`history > singleplayer undo/redo > should support changes in elements' }, "updated": {}, }, - "id": "id194", + "id": "id251", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id195": true, + "id252": true, }, }, "inserted": { "selectedElementIds": { - "id192": true, + "id249": true, }, }, }, @@ -18522,7 +17732,7 @@ exports[`history > singleplayer undo/redo > should support changes in elements' "elements": { "added": {}, "removed": { - "id195": { + "id252": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -18545,6 +17755,7 @@ exports[`history > singleplayer undo/redo > should support changes in elements' "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 40, "y": 40, @@ -18556,7 +17767,7 @@ exports[`history > singleplayer undo/redo > should support changes in elements' }, "updated": {}, }, - "id": "id197", + "id": "id254", }, { "appState": AppStateDelta { @@ -18569,29 +17780,31 @@ exports[`history > singleplayer undo/redo > should support changes in elements' "added": {}, "removed": {}, "updated": { - "id195": { + "id252": { "deleted": { "index": "a0V", + "version": 6, }, "inserted": { "index": "a2", + "version": 5, }, }, }, }, - "id": "id201", + "id": "id260", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id189": true, + "id246": true, }, }, "inserted": { "selectedElementIds": { - "id195": true, + "id252": true, }, }, }, @@ -18601,14 +17814,14 @@ exports[`history > singleplayer undo/redo > should support changes in elements' "removed": {}, "updated": {}, }, - "id": "id204", + "id": "id263", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id195": true, + "id252": true, }, }, "inserted": { @@ -18621,7 +17834,7 @@ exports[`history > singleplayer undo/redo > should support changes in elements' "removed": {}, "updated": {}, }, - "id": "id207", + "id": "id266", }, { "appState": AppStateDelta { @@ -18634,25 +17847,29 @@ exports[`history > singleplayer undo/redo > should support changes in elements' "added": {}, "removed": {}, "updated": { - "id189": { + "id246": { "deleted": { "index": "a2", + "version": 7, }, "inserted": { "index": "Zz", + "version": 6, }, }, - "id195": { + "id252": { "deleted": { "index": "a3", + "version": 10, }, "inserted": { "index": "a0", + "version": 9, }, }, }, }, - "id": "id211", + "id": "id272", }, ] `; @@ -18738,19 +17955,19 @@ exports[`history > singleplayer undo/redo > should support duplication of groups "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id161": true, + "id209": true, }, "resizingElement": null, "scrollX": 0, "scrollY": 0, "searchMatches": null, "selectedElementIds": { - "id184": true, - "id186": true, + "id241": true, + "id243": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": { - "id185": true, + "id242": true, }, "selectionElement": null, "shouldCacheIgnoreZoom": false, @@ -18788,7 +18005,7 @@ exports[`history > singleplayer undo/redo > should support duplication of groups "A", ], "height": 100, - "id": "id160", + "id": "id208", "index": "a0", "isDeleted": false, "link": null, @@ -18822,7 +18039,7 @@ exports[`history > singleplayer undo/redo > should support duplication of groups "A", ], "height": 100, - "id": "id161", + "id": "id209", "index": "a1", "isDeleted": false, "link": null, @@ -18853,10 +18070,10 @@ exports[`history > singleplayer undo/redo > should support duplication of groups "fillStyle": "solid", "frameId": null, "groupIds": [ - "id185", + "id242", ], "height": 100, - "id": "id184", + "id": "id241", "index": "a1G", "isDeleted": false, "link": null, @@ -18887,10 +18104,10 @@ exports[`history > singleplayer undo/redo > should support duplication of groups "fillStyle": "solid", "frameId": null, "groupIds": [ - "id185", + "id242", ], "height": 100, - "id": "id186", + "id": "id243", "index": "a1V", "isDeleted": false, "link": null, @@ -18921,10 +18138,10 @@ exports[`history > singleplayer undo/redo > should support duplication of groups "fillStyle": "solid", "frameId": null, "groupIds": [ - "id177", + "id231", ], "height": 100, - "id": "id176", + "id": "id230", "index": "a2", "isDeleted": true, "link": null, @@ -18955,10 +18172,10 @@ exports[`history > singleplayer undo/redo > should support duplication of groups "fillStyle": "solid", "frameId": null, "groupIds": [ - "id177", + "id231", ], "height": 100, - "id": "id178", + "id": "id232", "index": "a3", "isDeleted": true, "link": null, @@ -18993,8 +18210,8 @@ exports[`history > singleplayer undo/redo > should support duplication of groups "delta": Delta { "deleted": { "selectedElementIds": { - "id160": true, - "id161": true, + "id208": true, + "id209": true, }, "selectedGroupIds": { "A": true, @@ -19009,7 +18226,7 @@ exports[`history > singleplayer undo/redo > should support duplication of groups "elements": { "added": {}, "removed": { - "id160": { + "id208": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -19034,6 +18251,7 @@ exports[`history > singleplayer undo/redo > should support duplication of groups "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 100, "x": 0, "y": 0, @@ -19042,7 +18260,7 @@ exports[`history > singleplayer undo/redo > should support duplication of groups "isDeleted": true, }, }, - "id161": { + "id209": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -19067,6 +18285,7 @@ exports[`history > singleplayer undo/redo > should support duplication of groups "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 100, "x": 100, "y": 100, @@ -19078,24 +18297,24 @@ exports[`history > singleplayer undo/redo > should support duplication of groups }, "updated": {}, }, - "id": "id164", + "id": "id212", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id184": true, - "id186": true, + "id241": true, + "id243": true, }, "selectedGroupIds": { - "id185": true, + "id242": true, }, }, "inserted": { "selectedElementIds": { - "id160": true, - "id161": true, + "id208": true, + "id209": true, }, "selectedGroupIds": { "A": true, @@ -19106,7 +18325,7 @@ exports[`history > singleplayer undo/redo > should support duplication of groups "elements": { "added": {}, "removed": { - "id184": { + "id241": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -19115,7 +18334,7 @@ exports[`history > singleplayer undo/redo > should support duplication of groups "fillStyle": "solid", "frameId": null, "groupIds": [ - "id185", + "id242", ], "height": 100, "index": "a1G", @@ -19131,6 +18350,7 @@ exports[`history > singleplayer undo/redo > should support duplication of groups "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 4, "width": 100, "x": 10, "y": 10, @@ -19139,7 +18359,7 @@ exports[`history > singleplayer undo/redo > should support duplication of groups "isDeleted": true, }, }, - "id186": { + "id243": { "deleted": { "angle": 0, "backgroundColor": "transparent", @@ -19148,7 +18368,7 @@ exports[`history > singleplayer undo/redo > should support duplication of groups "fillStyle": "solid", "frameId": null, "groupIds": [ - "id185", + "id242", ], "height": 100, "index": "a1V", @@ -19164,6 +18384,7 @@ exports[`history > singleplayer undo/redo > should support duplication of groups "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 4, "width": 100, "x": 110, "y": 110, @@ -19175,7 +18396,7 @@ exports[`history > singleplayer undo/redo > should support duplication of groups }, "updated": {}, }, - "id": "id188", + "id": "id245", }, ] `; @@ -19261,7 +18482,7 @@ exports[`history > singleplayer undo/redo > should support element creation, del "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id93": true, + "id116": true, }, "resizingElement": null, "scrollX": 0, @@ -19304,7 +18525,7 @@ exports[`history > singleplayer undo/redo > should support element creation, del "frameId": null, "groupIds": [], "height": 10, - "id": "id90", + "id": "id113", "index": "a0", "isDeleted": false, "link": null, @@ -19336,7 +18557,7 @@ exports[`history > singleplayer undo/redo > should support element creation, del "frameId": null, "groupIds": [], "height": 10, - "id": "id93", + "id": "id116", "index": "a1", "isDeleted": true, "link": null, @@ -19368,7 +18589,7 @@ exports[`history > singleplayer undo/redo > should support element creation, del "frameId": null, "groupIds": [], "height": 10, - "id": "id96", + "id": "id119", "index": "a2", "isDeleted": true, "link": null, @@ -19403,7 +18624,7 @@ exports[`history > singleplayer undo/redo > should support element creation, del "delta": Delta { "deleted": { "selectedElementIds": { - "id90": true, + "id113": true, }, }, "inserted": { @@ -19414,53 +18635,32 @@ exports[`history > singleplayer undo/redo > should support element creation, del "elements": { "added": {}, "removed": { - "id90": { + "id113": { "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, + "version": 5, }, "inserted": { "isDeleted": true, + "version": 4, }, }, }, "updated": {}, }, - "id": "id113", + "id": "id143", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id93": true, + "id116": true, }, }, "inserted": { "selectedElementIds": { - "id90": true, + "id113": true, }, }, }, @@ -19468,53 +18668,32 @@ exports[`history > singleplayer undo/redo > should support element creation, del "elements": { "added": {}, "removed": { - "id93": { + "id116": { "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, + "version": 7, }, "inserted": { "isDeleted": true, + "version": 6, }, }, }, "updated": {}, }, - "id": "id114", + "id": "id145", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id96": true, + "id119": true, }, }, "inserted": { "selectedElementIds": { - "id93": true, + "id116": true, }, }, }, @@ -19522,53 +18701,32 @@ exports[`history > singleplayer undo/redo > should support element creation, del "elements": { "added": {}, "removed": { - "id96": { + "id119": { "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, + "version": 7, }, "inserted": { "isDeleted": true, + "version": 6, }, }, }, "updated": {}, }, - "id": "id115", + "id": "id147", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id93": true, + "id116": true, }, }, "inserted": { "selectedElementIds": { - "id96": true, + "id119": true, }, }, }, @@ -19578,14 +18736,14 @@ exports[`history > singleplayer undo/redo > should support element creation, del "removed": {}, "updated": {}, }, - "id": "id116", + "id": "id149", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { "selectedElementIds": { - "id96": true, + "id119": true, }, }, "inserted": { @@ -19598,7 +18756,7 @@ exports[`history > singleplayer undo/redo > should support element creation, del "removed": {}, "updated": {}, }, - "id": "id117", + "id": "id151", }, { "appState": AppStateDelta { @@ -19608,35 +18766,39 @@ exports[`history > singleplayer undo/redo > should support element creation, del }, "inserted": { "selectedElementIds": { - "id93": true, - "id96": true, + "id116": true, + "id119": true, }, }, }, }, "elements": { "added": { - "id93": { + "id116": { "deleted": { "isDeleted": true, + "version": 8, }, "inserted": { "isDeleted": false, + "version": 7, }, }, - "id96": { + "id119": { "deleted": { "isDeleted": true, + "version": 8, }, "inserted": { "isDeleted": false, + "version": 7, }, }, }, "removed": {}, "updated": {}, }, - "id": "id118", + "id": "id153", }, ] `; @@ -19722,14 +18884,14 @@ exports[`history > singleplayer undo/redo > should support linear element creati "penMode": false, "pendingImageElementId": null, "previousSelectedElementIds": { - "id119": true, + "id154": true, }, "resizingElement": null, "scrollX": 0, "scrollY": 0, "searchMatches": null, "selectedElementIds": { - "id119": true, + "id154": true, }, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, @@ -19770,7 +18932,7 @@ exports[`history > singleplayer undo/redo > should support linear element creati "frameId": null, "groupIds": [], "height": 20, - "id": "id119", + "id": "id154", "index": "a0", "isDeleted": false, "lastCommittedPoint": [ @@ -19825,7 +18987,7 @@ exports[`history > singleplayer undo/redo > should support linear element creati "delta": Delta { "deleted": { "selectedElementIds": { - "id119": true, + "id154": true, }, }, "inserted": { @@ -19836,60 +18998,20 @@ exports[`history > singleplayer undo/redo > should support linear element creati "elements": { "added": {}, "removed": { - "id119": { + "id154": { "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, + "version": 13, }, "inserted": { "isDeleted": true, + "version": 12, }, }, }, "updated": {}, }, - "id": "id142", + "id": "id184", }, { "appState": AppStateDelta { @@ -19902,7 +19024,7 @@ exports[`history > singleplayer undo/redo > should support linear element creati "added": {}, "removed": {}, "updated": { - "id119": { + "id154": { "deleted": { "lastCommittedPoint": [ 20, @@ -19922,6 +19044,7 @@ exports[`history > singleplayer undo/redo > should support linear element creati 0, ], ], + "version": 14, "width": 20, }, "inserted": { @@ -19939,18 +19062,19 @@ exports[`history > singleplayer undo/redo > should support linear element creati 10, ], ], + "version": 13, "width": 10, }, }, }, }, - "id": "id143", + "id": "id186", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { - "selectedLinearElementId": "id119", + "selectedLinearElementId": "id154", }, "inserted": { "selectedLinearElementId": null, @@ -19962,13 +19086,13 @@ exports[`history > singleplayer undo/redo > should support linear element creati "removed": {}, "updated": {}, }, - "id": "id144", + "id": "id188", }, { "appState": AppStateDelta { "delta": Delta { "deleted": { - "editingLinearElementId": "id119", + "editingLinearElementId": "id154", }, "inserted": { "editingLinearElementId": null, @@ -19980,7 +19104,7 @@ exports[`history > singleplayer undo/redo > should support linear element creati "removed": {}, "updated": {}, }, - "id": "id145", + "id": "id190", }, { "appState": AppStateDelta { @@ -19993,7 +19117,7 @@ exports[`history > singleplayer undo/redo > should support linear element creati "added": {}, "removed": {}, "updated": { - "id119": { + "id154": { "deleted": { "height": 20, "points": [ @@ -20010,6 +19134,7 @@ exports[`history > singleplayer undo/redo > should support linear element creati 20, ], ], + "version": 15, }, "inserted": { "height": 10, @@ -20027,11 +19152,12 @@ exports[`history > singleplayer undo/redo > should support linear element creati 0, ], ], + "version": 14, }, }, }, }, - "id": "id146", + "id": "id192", }, { "appState": AppStateDelta { @@ -20040,7 +19166,7 @@ exports[`history > singleplayer undo/redo > should support linear element creati "editingLinearElementId": null, }, "inserted": { - "editingLinearElementId": "id119", + "editingLinearElementId": "id154", }, }, }, @@ -20049,7 +19175,7 @@ exports[`history > singleplayer undo/redo > should support linear element creati "removed": {}, "updated": {}, }, - "id": "id147", + "id": "id194", }, ] `; diff --git a/packages/excalidraw/tests/__snapshots__/regressionTests.test.tsx.snap b/packages/excalidraw/tests/__snapshots__/regressionTests.test.tsx.snap index 11447c731..e3c8af8da 100644 --- a/packages/excalidraw/tests/__snapshots__/regressionTests.test.tsx.snap +++ b/packages/excalidraw/tests/__snapshots__/regressionTests.test.tsx.snap @@ -171,6 +171,7 @@ exports[`given element A and group of elements B and given both are selected whe "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 0, "y": 0, @@ -225,6 +226,7 @@ exports[`given element A and group of elements B and given both are selected whe "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 0, "y": 30, @@ -279,6 +281,7 @@ exports[`given element A and group of elements B and given both are selected whe "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 0, "y": 60, @@ -357,10 +360,12 @@ exports[`given element A and group of elements B and given both are selected whe "id15", ], "index": "a2", + "version": 5, }, "inserted": { "groupIds": [], "index": "a0", + "version": 3, }, }, "id6": { @@ -369,10 +374,12 @@ exports[`given element A and group of elements B and given both are selected whe "id15", ], "index": "a3", + "version": 5, }, "inserted": { "groupIds": [], "index": "a2", + "version": 3, }, }, }, @@ -595,6 +602,7 @@ exports[`given element A and group of elements B and given both are selected whe "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 100, "x": 0, "y": 0, @@ -649,6 +657,7 @@ exports[`given element A and group of elements B and given both are selected whe "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 100, "x": 110, "y": 110, @@ -703,6 +712,7 @@ exports[`given element A and group of elements B and given both are selected whe "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 100, "x": 220, "y": 220, @@ -759,10 +769,12 @@ exports[`given element A and group of elements B and given both are selected whe "id12", ], "index": "a2", + "version": 5, }, "inserted": { "groupIds": [], "index": "a0", + "version": 3, }, }, "id6": { @@ -771,10 +783,12 @@ exports[`given element A and group of elements B and given both are selected whe "id12", ], "index": "a3", + "version": 5, }, "inserted": { "groupIds": [], "index": "a2", + "version": 3, }, }, }, @@ -998,6 +1012,7 @@ exports[`regression tests > Cmd/Ctrl-click exclusively select element under poin "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 0, "y": 0, @@ -1052,6 +1067,7 @@ exports[`regression tests > Cmd/Ctrl-click exclusively select element under poin "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 30, "y": 0, @@ -1129,9 +1145,11 @@ exports[`regression tests > Cmd/Ctrl-click exclusively select element under poin "groupIds": [ "id12", ], + "version": 4, }, "inserted": { "groupIds": [], + "version": 3, }, }, "id3": { @@ -1139,9 +1157,11 @@ exports[`regression tests > Cmd/Ctrl-click exclusively select element under poin "groupIds": [ "id12", ], + "version": 4, }, "inserted": { "groupIds": [], + "version": 3, }, }, }, @@ -1217,6 +1237,7 @@ exports[`regression tests > Cmd/Ctrl-click exclusively select element under poin "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 60, "y": 0, @@ -1302,11 +1323,13 @@ exports[`regression tests > Cmd/Ctrl-click exclusively select element under poin "id12", "id28", ], + "version": 5, }, "inserted": { "groupIds": [ "id12", ], + "version": 4, }, }, "id19": { @@ -1314,9 +1337,11 @@ exports[`regression tests > Cmd/Ctrl-click exclusively select element under poin "groupIds": [ "id28", ], + "version": 4, }, "inserted": { "groupIds": [], + "version": 3, }, }, "id3": { @@ -1325,11 +1350,13 @@ exports[`regression tests > Cmd/Ctrl-click exclusively select element under poin "id12", "id28", ], + "version": 5, }, "inserted": { "groupIds": [ "id12", ], + "version": 4, }, }, }, @@ -1554,6 +1581,7 @@ exports[`regression tests > Drags selected element when hitting only bounding bo "strokeStyle": "solid", "strokeWidth": 2, "type": "ellipse", + "version": 3, "width": 10, "x": 0, "y": 0, @@ -1580,10 +1608,12 @@ exports[`regression tests > Drags selected element when hitting only bounding bo "updated": { "id0": { "deleted": { + "version": 4, "x": 25, "y": 25, }, "inserted": { + "version": 3, "x": 0, "y": 0, }, @@ -1764,6 +1794,7 @@ exports[`regression tests > adjusts z order when grouping > [end of test] undo s "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 10, "y": 10, @@ -1818,6 +1849,7 @@ exports[`regression tests > adjusts z order when grouping > [end of test] undo s "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 30, "y": 10, @@ -1872,6 +1904,7 @@ exports[`regression tests > adjusts z order when grouping > [end of test] undo s "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 50, "y": 10, @@ -1950,10 +1983,12 @@ exports[`regression tests > adjusts z order when grouping > [end of test] undo s "id15", ], "index": "a2", + "version": 5, }, "inserted": { "groupIds": [], "index": "a0", + "version": 3, }, }, "id6": { @@ -1962,10 +1997,12 @@ exports[`regression tests > adjusts z order when grouping > [end of test] undo s "id15", ], "index": "a3", + "version": 5, }, "inserted": { "groupIds": [], "index": "a2", + "version": 3, }, }, }, @@ -2141,6 +2178,7 @@ exports[`regression tests > alt-drag duplicates an element > [end of test] undo "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 10, "y": 10, @@ -2195,6 +2233,7 @@ exports[`regression tests > alt-drag duplicates an element > [end of test] undo "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 6, "width": 10, "x": 20, "y": 20, @@ -2204,7 +2243,16 @@ exports[`regression tests > alt-drag duplicates an element > [end of test] undo }, }, }, - "updated": {}, + "updated": { + "id0": { + "deleted": { + "version": 5, + }, + "inserted": { + "version": 3, + }, + }, + }, }, "id": "id6", }, @@ -2375,6 +2423,7 @@ exports[`regression tests > arrow keys > [end of test] undo stack 1`] = ` "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 10, "y": 10, @@ -2557,6 +2606,7 @@ exports[`regression tests > can drag element that covers another element, while "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 200, "x": 100, "y": 100, @@ -2611,6 +2661,7 @@ exports[`regression tests > can drag element that covers another element, while "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 200, "x": 100, "y": 100, @@ -2665,6 +2716,7 @@ exports[`regression tests > can drag element that covers another element, while "strokeStyle": "solid", "strokeWidth": 2, "type": "ellipse", + "version": 3, "width": 350, "x": 300, "y": 300, @@ -2699,10 +2751,12 @@ exports[`regression tests > can drag element that covers another element, while "updated": { "id3": { "deleted": { + "version": 4, "x": 300, "y": 300, }, "inserted": { + "version": 3, "x": 100, "y": 100, }, @@ -2878,6 +2932,7 @@ exports[`regression tests > change the properties of a shape > [end of test] und "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 10, "y": 10, @@ -2905,9 +2960,11 @@ exports[`regression tests > change the properties of a shape > [end of test] und "id0": { "deleted": { "backgroundColor": "#ffec99", + "version": 4, }, "inserted": { "backgroundColor": "transparent", + "version": 3, }, }, }, @@ -2928,9 +2985,11 @@ exports[`regression tests > change the properties of a shape > [end of test] und "id0": { "deleted": { "backgroundColor": "#ffc9c9", + "version": 5, }, "inserted": { "backgroundColor": "#ffec99", + "version": 4, }, }, }, @@ -2951,9 +3010,11 @@ exports[`regression tests > change the properties of a shape > [end of test] und "id0": { "deleted": { "strokeColor": "#1971c2", + "version": 6, }, "inserted": { "strokeColor": "#1e1e1e", + "version": 5, }, }, }, @@ -3163,6 +3224,7 @@ exports[`regression tests > click on an element and drag it > [dragged] undo sta "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 10, "y": 10, @@ -3189,10 +3251,12 @@ exports[`regression tests > click on an element and drag it > [dragged] undo sta "updated": { "id0": { "deleted": { + "version": 4, "x": 20, "y": 20, }, "inserted": { + "version": 3, "x": 10, "y": 10, }, @@ -3370,6 +3434,7 @@ exports[`regression tests > click on an element and drag it > [end of test] undo "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 10, "y": 10, @@ -3396,10 +3461,12 @@ exports[`regression tests > click on an element and drag it > [end of test] undo "updated": { "id0": { "deleted": { + "version": 4, "x": 20, "y": 20, }, "inserted": { + "version": 3, "x": 10, "y": 10, }, @@ -3421,10 +3488,12 @@ exports[`regression tests > click on an element and drag it > [end of test] undo "updated": { "id0": { "deleted": { + "version": 5, "x": 10, "y": 10, }, "inserted": { + "version": 4, "x": 20, "y": 20, }, @@ -3602,6 +3671,7 @@ exports[`regression tests > click to select a shape > [end of test] undo stack 1 "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 10, "y": 10, @@ -3656,6 +3726,7 @@ exports[`regression tests > click to select a shape > [end of test] undo stack 1 "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 30, "y": 10, @@ -3861,6 +3932,7 @@ exports[`regression tests > click-drag to select a group > [end of test] undo st "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 10, "y": 10, @@ -3915,6 +3987,7 @@ exports[`regression tests > click-drag to select a group > [end of test] undo st "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 30, "y": 10, @@ -3969,6 +4042,7 @@ exports[`regression tests > click-drag to select a group > [end of test] undo st "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 50, "y": 10, @@ -4174,6 +4248,7 @@ exports[`regression tests > deleting last but one element in editing group shoul "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 10, "y": 0, @@ -4228,6 +4303,7 @@ exports[`regression tests > deleting last but one element in editing group shoul "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 50, "y": 0, @@ -4305,9 +4381,11 @@ exports[`regression tests > deleting last but one element in editing group shoul "groupIds": [ "id12", ], + "version": 4, }, "inserted": { "groupIds": [], + "version": 3, }, }, "id3": { @@ -4315,9 +4393,11 @@ exports[`regression tests > deleting last but one element in editing group shoul "groupIds": [ "id12", ], + "version": 4, }, "inserted": { "groupIds": [], + "version": 3, }, }, }, @@ -4376,9 +4456,11 @@ exports[`regression tests > deleting last but one element in editing group shoul "id0": { "deleted": { "isDeleted": true, + "version": 5, }, "inserted": { "isDeleted": false, + "version": 4, }, }, }, @@ -4633,6 +4715,7 @@ exports[`regression tests > deselects group of selected elements on pointer down "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 0, "y": 0, @@ -4687,6 +4770,7 @@ exports[`regression tests > deselects group of selected elements on pointer down "strokeStyle": "solid", "strokeWidth": 2, "type": "ellipse", + "version": 3, "width": 10, "x": 110, "y": 110, @@ -4888,6 +4972,7 @@ exports[`regression tests > deselects group of selected elements on pointer up w "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 0, "y": 0, @@ -4942,6 +5027,7 @@ exports[`regression tests > deselects group of selected elements on pointer up w "strokeStyle": "solid", "strokeWidth": 2, "type": "ellipse", + "version": 3, "width": 10, "x": 110, "y": 110, @@ -5193,6 +5279,7 @@ exports[`regression tests > deselects selected element on pointer down when poin "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 0, "y": 0, @@ -5373,6 +5460,7 @@ exports[`regression tests > deselects selected element, on pointer up, when clic "strokeStyle": "solid", "strokeWidth": 2, "type": "ellipse", + "version": 3, "width": 100, "x": 0, "y": 0, @@ -5573,6 +5661,7 @@ exports[`regression tests > double click to edit a group > [end of test] undo st "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 10, "y": 10, @@ -5627,6 +5716,7 @@ exports[`regression tests > double click to edit a group > [end of test] undo st "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 30, "y": 10, @@ -5681,6 +5771,7 @@ exports[`regression tests > double click to edit a group > [end of test] undo st "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 50, "y": 10, @@ -5737,9 +5828,11 @@ exports[`regression tests > double click to edit a group > [end of test] undo st "groupIds": [ "id11", ], + "version": 4, }, "inserted": { "groupIds": [], + "version": 3, }, }, "id3": { @@ -5747,9 +5840,11 @@ exports[`regression tests > double click to edit a group > [end of test] undo st "groupIds": [ "id11", ], + "version": 4, }, "inserted": { "groupIds": [], + "version": 3, }, }, "id6": { @@ -5757,9 +5852,11 @@ exports[`regression tests > double click to edit a group > [end of test] undo st "groupIds": [ "id11", ], + "version": 4, }, "inserted": { "groupIds": [], + "version": 3, }, }, }, @@ -5964,6 +6061,7 @@ exports[`regression tests > drags selected elements from point inside common bou "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 0, "y": 0, @@ -6018,6 +6116,7 @@ exports[`regression tests > drags selected elements from point inside common bou "strokeStyle": "solid", "strokeWidth": 2, "type": "ellipse", + "version": 3, "width": 10, "x": 110, "y": 110, @@ -6064,20 +6163,24 @@ exports[`regression tests > drags selected elements from point inside common bou "updated": { "id0": { "deleted": { + "version": 4, "x": 25, "y": 25, }, "inserted": { + "version": 3, "x": 0, "y": 0, }, }, "id3": { "deleted": { + "version": 4, "x": 135, "y": 135, }, "inserted": { + "version": 3, "x": 110, "y": 110, }, @@ -6251,6 +6354,7 @@ exports[`regression tests > draw every type of shape > [end of test] undo stack "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 20, "x": 10, "y": -10, @@ -6305,6 +6409,7 @@ exports[`regression tests > draw every type of shape > [end of test] undo stack "strokeStyle": "solid", "strokeWidth": 2, "type": "diamond", + "version": 3, "width": 20, "x": 40, "y": -10, @@ -6359,6 +6464,7 @@ exports[`regression tests > draw every type of shape > [end of test] undo stack "strokeStyle": "solid", "strokeWidth": 2, "type": "ellipse", + "version": 3, "width": 20, "x": 70, "y": -10, @@ -6431,6 +6537,7 @@ exports[`regression tests > draw every type of shape > [end of test] undo stack "strokeStyle": "solid", "strokeWidth": 2, "type": "arrow", + "version": 4, "width": 50, "x": 130, "y": -10, @@ -6502,6 +6609,7 @@ exports[`regression tests > draw every type of shape > [end of test] undo stack "strokeStyle": "solid", "strokeWidth": 2, "type": "line", + "version": 4, "width": 50, "x": 220, "y": -10, @@ -6577,6 +6685,7 @@ exports[`regression tests > draw every type of shape > [end of test] undo stack "strokeStyle": "solid", "strokeWidth": 2, "type": "arrow", + "version": 6, "width": 50, "x": 310, "y": -10, @@ -6622,6 +6731,7 @@ exports[`regression tests > draw every type of shape > [end of test] undo stack 20, ], ], + "version": 8, "width": 80, }, "inserted": { @@ -6640,6 +6750,7 @@ exports[`regression tests > draw every type of shape > [end of test] undo stack 10, ], ], + "version": 6, "width": 50, }, }, @@ -6726,6 +6837,7 @@ exports[`regression tests > draw every type of shape > [end of test] undo stack "strokeStyle": "solid", "strokeWidth": 2, "type": "line", + "version": 6, "width": 50, "x": 430, "y": -10, @@ -6771,6 +6883,7 @@ exports[`regression tests > draw every type of shape > [end of test] undo stack 20, ], ], + "version": 8, "width": 80, }, "inserted": { @@ -6789,6 +6902,7 @@ exports[`regression tests > draw every type of shape > [end of test] undo stack 10, ], ], + "version": 6, "width": 50, }, }, @@ -6893,6 +7007,7 @@ exports[`regression tests > draw every type of shape > [end of test] undo stack "strokeStyle": "solid", "strokeWidth": 2, "type": "freedraw", + "version": 4, "width": 50, "x": 550, "y": -10, @@ -7076,6 +7191,7 @@ exports[`regression tests > given a group of selected elements with an element t "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 0, "y": 0, @@ -7130,6 +7246,7 @@ exports[`regression tests > given a group of selected elements with an element t "strokeStyle": "solid", "strokeWidth": 2, "type": "ellipse", + "version": 3, "width": 100, "x": 110, "y": 110, @@ -7184,6 +7301,7 @@ exports[`regression tests > given a group of selected elements with an element t "strokeStyle": "solid", "strokeWidth": 2, "type": "diamond", + "version": 3, "width": 100, "x": 310, "y": 310, @@ -7410,6 +7528,7 @@ exports[`regression tests > given a selected element A and a not selected elemen "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 1000, "x": 0, "y": 0, @@ -7464,6 +7583,7 @@ exports[`regression tests > given a selected element A and a not selected elemen "strokeStyle": "solid", "strokeWidth": 2, "type": "ellipse", + "version": 3, "width": 1000, "x": 500, "y": 500, @@ -7688,6 +7808,7 @@ exports[`regression tests > given selected element A with lower z-index than uns "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 1000, "x": 0, "y": 0, @@ -7719,6 +7840,7 @@ exports[`regression tests > given selected element A with lower z-index than uns "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 500, "x": 500, "y": 500, @@ -7923,6 +8045,7 @@ exports[`regression tests > given selected element A with lower z-index than uns "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 1000, "x": 0, "y": 0, @@ -7954,6 +8077,7 @@ exports[`regression tests > given selected element A with lower z-index than uns "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 2, "width": 500, "x": 500, "y": 500, @@ -7980,10 +8104,12 @@ exports[`regression tests > given selected element A with lower z-index than uns "updated": { "id0": { "deleted": { + "version": 3, "x": 100, "y": 100, }, "inserted": { + "version": 2, "x": 0, "y": 0, }, @@ -8159,6 +8285,7 @@ exports[`regression tests > key 2 selects rectangle tool > [end of test] undo st "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 10, "y": 10, @@ -8339,6 +8466,7 @@ exports[`regression tests > key 3 selects diamond tool > [end of test] undo stac "strokeStyle": "solid", "strokeWidth": 2, "type": "diamond", + "version": 3, "width": 10, "x": 10, "y": 10, @@ -8519,6 +8647,7 @@ exports[`regression tests > key 4 selects ellipse tool > [end of test] undo stac "strokeStyle": "solid", "strokeWidth": 2, "type": "ellipse", + "version": 3, "width": 10, "x": 10, "y": 10, @@ -8742,6 +8871,7 @@ exports[`regression tests > key 5 selects arrow tool > [end of test] undo stack "strokeStyle": "solid", "strokeWidth": 2, "type": "arrow", + "version": 4, "width": 10, "x": 10, "y": 10, @@ -8964,6 +9094,7 @@ exports[`regression tests > key 6 selects line tool > [end of test] undo stack 1 "strokeStyle": "solid", "strokeWidth": 2, "type": "line", + "version": 4, "width": 10, "x": 10, "y": 10, @@ -9158,6 +9289,7 @@ exports[`regression tests > key 7 selects freedraw tool > [end of test] undo sta "strokeStyle": "solid", "strokeWidth": 2, "type": "freedraw", + "version": 4, "width": 10, "x": 10, "y": 10, @@ -9381,6 +9513,7 @@ exports[`regression tests > key a selects arrow tool > [end of test] undo stack "strokeStyle": "solid", "strokeWidth": 2, "type": "arrow", + "version": 4, "width": 10, "x": 10, "y": 10, @@ -9561,6 +9694,7 @@ exports[`regression tests > key d selects diamond tool > [end of test] undo stac "strokeStyle": "solid", "strokeWidth": 2, "type": "diamond", + "version": 3, "width": 10, "x": 10, "y": 10, @@ -9783,6 +9917,7 @@ exports[`regression tests > key l selects line tool > [end of test] undo stack 1 "strokeStyle": "solid", "strokeWidth": 2, "type": "line", + "version": 4, "width": 10, "x": 10, "y": 10, @@ -9963,6 +10098,7 @@ exports[`regression tests > key o selects ellipse tool > [end of test] undo stac "strokeStyle": "solid", "strokeWidth": 2, "type": "ellipse", + "version": 3, "width": 10, "x": 10, "y": 10, @@ -10157,6 +10293,7 @@ exports[`regression tests > key p selects freedraw tool > [end of test] undo sta "strokeStyle": "solid", "strokeWidth": 2, "type": "freedraw", + "version": 4, "width": 10, "x": 10, "y": 10, @@ -10337,6 +10474,7 @@ exports[`regression tests > key r selects rectangle tool > [end of test] undo st "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 10, "y": 10, @@ -10525,6 +10663,7 @@ exports[`regression tests > make a group and duplicate it > [end of test] undo s "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 10, "y": 10, @@ -10579,6 +10718,7 @@ exports[`regression tests > make a group and duplicate it > [end of test] undo s "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 30, "y": 10, @@ -10633,6 +10773,7 @@ exports[`regression tests > make a group and duplicate it > [end of test] undo s "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 50, "y": 10, @@ -10689,9 +10830,11 @@ exports[`regression tests > make a group and duplicate it > [end of test] undo s "groupIds": [ "id12", ], + "version": 4, }, "inserted": { "groupIds": [], + "version": 3, }, }, "id3": { @@ -10699,9 +10842,11 @@ exports[`regression tests > make a group and duplicate it > [end of test] undo s "groupIds": [ "id12", ], + "version": 4, }, "inserted": { "groupIds": [], + "version": 3, }, }, "id6": { @@ -10709,9 +10854,11 @@ exports[`regression tests > make a group and duplicate it > [end of test] undo s "groupIds": [ "id12", ], + "version": 4, }, "inserted": { "groupIds": [], + "version": 3, }, }, }, @@ -10771,6 +10918,7 @@ exports[`regression tests > make a group and duplicate it > [end of test] undo s "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 7, "width": 10, "x": 20, "y": 20, @@ -10804,6 +10952,7 @@ exports[`regression tests > make a group and duplicate it > [end of test] undo s "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 7, "width": 10, "x": 40, "y": 20, @@ -10837,6 +10986,7 @@ exports[`regression tests > make a group and duplicate it > [end of test] undo s "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 7, "width": 10, "x": 60, "y": 20, @@ -10846,7 +10996,32 @@ exports[`regression tests > make a group and duplicate it > [end of test] undo s }, }, }, - "updated": {}, + "updated": { + "id0": { + "deleted": { + "version": 6, + }, + "inserted": { + "version": 4, + }, + }, + "id3": { + "deleted": { + "version": 6, + }, + "inserted": { + "version": 4, + }, + }, + "id6": { + "deleted": { + "version": 6, + }, + "inserted": { + "version": 4, + }, + }, + }, }, "id": "id21", }, @@ -11019,6 +11194,7 @@ exports[`regression tests > noop interaction after undo shouldn't create history "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 10, "y": 10, @@ -11052,39 +11228,18 @@ exports[`regression tests > noop interaction after undo shouldn't create history "removed": { "id3": { "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": 10, + "version": 5, }, "inserted": { "isDeleted": true, + "version": 4, }, }, }, "updated": {}, }, - "id": "id8", + "id": "id10", }, { "appState": AppStateDelta { @@ -11106,7 +11261,7 @@ exports[`regression tests > noop interaction after undo shouldn't create history "removed": {}, "updated": {}, }, - "id": "id11", + "id": "id13", }, { "appState": AppStateDelta { @@ -11128,7 +11283,7 @@ exports[`regression tests > noop interaction after undo shouldn't create history "removed": {}, "updated": {}, }, - "id": "id14", + "id": "id16", }, ] `; @@ -11420,6 +11575,7 @@ exports[`regression tests > shift click on selected element should deselect it o "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 0, "y": 0, @@ -11624,6 +11780,7 @@ exports[`regression tests > shift-click to multiselect, then drag > [end of test "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 10, "y": 10, @@ -11678,6 +11835,7 @@ exports[`regression tests > shift-click to multiselect, then drag > [end of test "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 30, "y": 10, @@ -11746,20 +11904,24 @@ exports[`regression tests > shift-click to multiselect, then drag > [end of test "updated": { "id0": { "deleted": { + "version": 4, "x": 20, "y": 20, }, "inserted": { + "version": 3, "x": 10, "y": 10, }, }, "id3": { "deleted": { + "version": 4, "x": 40, "y": 20, }, "inserted": { + "version": 3, "x": 30, "y": 10, }, @@ -11941,6 +12103,7 @@ exports[`regression tests > should group elements and ungroup them > [end of tes "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 10, "y": 10, @@ -11995,6 +12158,7 @@ exports[`regression tests > should group elements and ungroup them > [end of tes "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 30, "y": 10, @@ -12049,6 +12213,7 @@ exports[`regression tests > should group elements and ungroup them > [end of tes "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 50, "y": 10, @@ -12105,9 +12270,11 @@ exports[`regression tests > should group elements and ungroup them > [end of tes "groupIds": [ "id12", ], + "version": 4, }, "inserted": { "groupIds": [], + "version": 3, }, }, "id3": { @@ -12115,9 +12282,11 @@ exports[`regression tests > should group elements and ungroup them > [end of tes "groupIds": [ "id12", ], + "version": 4, }, "inserted": { "groupIds": [], + "version": 3, }, }, "id6": { @@ -12125,9 +12294,11 @@ exports[`regression tests > should group elements and ungroup them > [end of tes "groupIds": [ "id12", ], + "version": 4, }, "inserted": { "groupIds": [], + "version": 3, }, }, }, @@ -12154,31 +12325,37 @@ exports[`regression tests > should group elements and ungroup them > [end of tes "id0": { "deleted": { "groupIds": [], + "version": 5, }, "inserted": { "groupIds": [ "id12", ], + "version": 4, }, }, "id3": { "deleted": { "groupIds": [], + "version": 5, }, "inserted": { "groupIds": [ "id12", ], + "version": 4, }, }, "id6": { "deleted": { "groupIds": [], + "version": 5, }, "inserted": { "groupIds": [ "id12", ], + "version": 4, }, }, }, @@ -12362,6 +12539,7 @@ exports[`regression tests > single-clicking on a subgroup of a selected group sh "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 10, "y": 0, @@ -12416,6 +12594,7 @@ exports[`regression tests > single-clicking on a subgroup of a selected group sh "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 50, "y": 0, @@ -12493,9 +12672,11 @@ exports[`regression tests > single-clicking on a subgroup of a selected group sh "groupIds": [ "id12", ], + "version": 4, }, "inserted": { "groupIds": [], + "version": 3, }, }, "id3": { @@ -12503,9 +12684,11 @@ exports[`regression tests > single-clicking on a subgroup of a selected group sh "groupIds": [ "id12", ], + "version": 4, }, "inserted": { "groupIds": [], + "version": 3, }, }, }, @@ -12558,6 +12741,7 @@ exports[`regression tests > single-clicking on a subgroup of a selected group sh "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 10, "y": 50, @@ -12612,6 +12796,7 @@ exports[`regression tests > single-clicking on a subgroup of a selected group sh "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 50, "y": 50, @@ -12689,9 +12874,11 @@ exports[`regression tests > single-clicking on a subgroup of a selected group sh "groupIds": [ "id27", ], + "version": 4, }, "inserted": { "groupIds": [], + "version": 3, }, }, "id18": { @@ -12699,9 +12886,11 @@ exports[`regression tests > single-clicking on a subgroup of a selected group sh "groupIds": [ "id27", ], + "version": 4, }, "inserted": { "groupIds": [], + "version": 3, }, }, }, @@ -12759,11 +12948,13 @@ exports[`regression tests > single-clicking on a subgroup of a selected group sh "id12", "id32", ], + "version": 5, }, "inserted": { "groupIds": [ "id12", ], + "version": 4, }, }, "id15": { @@ -12772,11 +12963,13 @@ exports[`regression tests > single-clicking on a subgroup of a selected group sh "id27", "id32", ], + "version": 5, }, "inserted": { "groupIds": [ "id27", ], + "version": 4, }, }, "id18": { @@ -12785,11 +12978,13 @@ exports[`regression tests > single-clicking on a subgroup of a selected group sh "id27", "id32", ], + "version": 5, }, "inserted": { "groupIds": [ "id27", ], + "version": 4, }, }, "id3": { @@ -12798,11 +12993,13 @@ exports[`regression tests > single-clicking on a subgroup of a selected group sh "id12", "id32", ], + "version": 5, }, "inserted": { "groupIds": [ "id12", ], + "version": 4, }, }, }, @@ -13104,6 +13301,7 @@ exports[`regression tests > supports nested groups > [end of test] undo stack 1` "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 50, "x": 0, "y": 0, @@ -13158,6 +13356,7 @@ exports[`regression tests > supports nested groups > [end of test] undo stack 1` "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 50, "x": 100, "y": 100, @@ -13212,6 +13411,7 @@ exports[`regression tests > supports nested groups > [end of test] undo stack 1` "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 50, "x": 200, "y": 200, @@ -13268,9 +13468,11 @@ exports[`regression tests > supports nested groups > [end of test] undo stack 1` "groupIds": [ "id11", ], + "version": 4, }, "inserted": { "groupIds": [], + "version": 3, }, }, "id3": { @@ -13278,9 +13480,11 @@ exports[`regression tests > supports nested groups > [end of test] undo stack 1` "groupIds": [ "id11", ], + "version": 4, }, "inserted": { "groupIds": [], + "version": 3, }, }, "id6": { @@ -13288,9 +13492,11 @@ exports[`regression tests > supports nested groups > [end of test] undo stack 1` "groupIds": [ "id11", ], + "version": 4, }, "inserted": { "groupIds": [], + "version": 3, }, }, }, @@ -13368,12 +13574,14 @@ exports[`regression tests > supports nested groups > [end of test] undo stack 1` "id11", ], "index": "a2", + "version": 6, }, "inserted": { "groupIds": [ "id11", ], "index": "a0", + "version": 4, }, }, "id6": { @@ -13383,12 +13591,14 @@ exports[`regression tests > supports nested groups > [end of test] undo stack 1` "id11", ], "index": "a3", + "version": 6, }, "inserted": { "groupIds": [ "id11", ], "index": "a2", + "version": 4, }, }, }, @@ -13756,6 +13966,7 @@ exports[`regression tests > switches from group of selected elements to another "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 0, "y": 0, @@ -13810,6 +14021,7 @@ exports[`regression tests > switches from group of selected elements to another "strokeStyle": "solid", "strokeWidth": 2, "type": "ellipse", + "version": 3, "width": 100, "x": 110, "y": 110, @@ -13864,6 +14076,7 @@ exports[`regression tests > switches from group of selected elements to another "strokeStyle": "solid", "strokeWidth": 2, "type": "diamond", + "version": 3, "width": 100, "x": 310, "y": 310, @@ -14096,6 +14309,7 @@ exports[`regression tests > switches selected element on pointer down > [end of "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 10, "x": 0, "y": 0, @@ -14150,6 +14364,7 @@ exports[`regression tests > switches selected element on pointer down > [end of "strokeStyle": "solid", "strokeWidth": 2, "type": "ellipse", + "version": 3, "width": 10, "x": 20, "y": 20, @@ -14428,7 +14643,7 @@ exports[`regression tests > undo/redo drawing an element > [end of test] redo st "removed": {}, "updated": {}, }, - "id": "id13", + "id": "id14", }, { "appState": AppStateDelta { @@ -14458,6 +14673,7 @@ exports[`regression tests > undo/redo drawing an element > [end of test] redo st 10, ], ], + "version": 9, "width": 60, }, "inserted": { @@ -14480,12 +14696,13 @@ exports[`regression tests > undo/redo drawing an element > [end of test] redo st 20, ], ], + "version": 8, "width": 100, }, }, }, }, - "id": "id14", + "id": "id16", }, { "appState": AppStateDelta { @@ -14507,58 +14724,18 @@ exports[`regression tests > undo/redo drawing an element > [end of test] redo st "id6": { "deleted": { "isDeleted": true, + "version": 10, }, "inserted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "elbowed": false, - "endArrowhead": "arrow", - "endBinding": null, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 10, - "index": "a2", "isDeleted": false, - "lastCommittedPoint": [ - 60, - 10, - ], - "link": null, - "locked": false, - "opacity": 100, - "points": [ - [ - 0, - 0, - ], - [ - 60, - 10, - ], - ], - "roughness": 1, - "roundness": { - "type": 2, - }, - "startArrowhead": null, - "startBinding": null, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "arrow", - "width": 60, - "x": 130, - "y": 10, + "version": 9, }, }, }, "removed": {}, "updated": {}, }, - "id": "id15", + "id": "id18", }, ] `; @@ -14604,6 +14781,7 @@ exports[`regression tests > undo/redo drawing an element > [end of test] undo st "strokeStyle": "solid", "strokeWidth": 2, "type": "rectangle", + "version": 3, "width": 20, "x": 10, "y": -10, @@ -14637,39 +14815,18 @@ exports[`regression tests > undo/redo drawing an element > [end of test] undo st "removed": { "id3": { "deleted": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": null, - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 20, - "index": "a1", "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": { - "type": 3, - }, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "width": 30, - "x": 40, - "y": 0, + "version": 5, }, "inserted": { "isDeleted": true, + "version": 4, }, }, }, "updated": {}, }, - "id": "id17", + "id": "id22", }, ] `; diff --git a/packages/excalidraw/tests/history.test.tsx b/packages/excalidraw/tests/history.test.tsx index 328dab7c4..574e58cc5 100644 --- a/packages/excalidraw/tests/history.test.tsx +++ b/packages/excalidraw/tests/history.test.tsx @@ -25,7 +25,7 @@ import "@excalidraw/utils/test-utils"; import { ElementsDelta, AppStateDelta } from "@excalidraw/element"; -import { CaptureUpdateAction, StoreDelta } from "@excalidraw/element"; +import { CaptureUpdateAction } from "@excalidraw/element"; import type { LocalPoint, Radians } from "@excalidraw/math"; @@ -34,6 +34,7 @@ import type { ExcalidrawFrameElement, ExcalidrawGenericElement, ExcalidrawLinearElement, + ExcalidrawRectangleElement, ExcalidrawTextElement, FixedPointBinding, FractionalIndex, @@ -53,6 +54,8 @@ import { getDefaultAppState } from "../appState"; import { Excalidraw } from "../index"; import * as StaticScene from "../renderer/staticScene"; +import { HistoryDelta } from "../history"; + import { API } from "./helpers/api"; import { Keyboard, Pointer, UI } from "./helpers/ui"; import { @@ -120,9 +123,19 @@ describe("history", () => { API.setElements([rect]); - const corrupedEntry = StoreDelta.create( + const corrupedEntry = HistoryDelta.create( ElementsDelta.empty(), - AppStateDelta.empty(), + // delta can't be empty, otherwise it won't be pushed into the undo stack + AppStateDelta.restore({ + delta: { + inserted: { + selectedElementIds: {}, + }, + deleted: { + selectedElementIds: { [rect.id]: true }, + }, + }, + }), ); vi.spyOn(corrupedEntry.elements, "applyTo").mockImplementation(() => { @@ -389,7 +402,7 @@ describe("history", () => { ]); }); - it("should iterate through the history when selection changes do not produce visible change", async () => { + it("should not push into redo stack when selection changes dooes not produce a visible change", async () => { await render(); const rect = UI.createElement("rectangle", { x: 10 }); @@ -420,18 +433,18 @@ describe("history", () => { expect(API.getSelectedElements().length).toBe(0); Keyboard.redo(); // acceptable empty redo - expect(API.getUndoStack().length).toBe(3); + expect(API.getUndoStack().length).toBe(2); // empty change, nothing goes into undo stack expect(API.getRedoStack().length).toBe(0); expect(API.getSelectedElements().length).toBe(0); Keyboard.undo(); - expect(API.getUndoStack().length).toBe(2); + expect(API.getUndoStack().length).toBe(1); expect(API.getRedoStack().length).toBe(1); assertSelectedElements(rect); Keyboard.undo(); - expect(API.getUndoStack().length).toBe(0); // now we iterated through the same undos! - expect(API.getRedoStack().length).toBe(3); + expect(API.getUndoStack().length).toBe(0); + expect(API.getRedoStack().length).toBe(2); expect(API.getSelectedElements().length).toBe(0); expect(h.elements).toEqual([ expect.objectContaining({ id: rect.id, isDeleted: true }), @@ -1313,6 +1326,10 @@ describe("history", () => { captureUpdate: CaptureUpdateAction.IMMEDIATELY, }); + rect1 = h.elements[0] as ExcalidrawRectangleElement; + text = h.elements[1] as ExcalidrawTextElement; + rect2 = h.elements[2] as ExcalidrawRectangleElement; + // bind text1 to rect1 mouse.select([rect1, text]); fireEvent.contextMenu(GlobalTestState.interactiveCanvas); @@ -2362,10 +2379,10 @@ describe("history", () => { }), ]); - // We reached the bottom, again we iterate through invisible changes and reach the top Keyboard.redo(); assertSelectedElements(); - expect(API.getUndoStack().length).toBe(2); + // We reached the bottom, now there is only one non-empty history delta, which will be pushed to the undo stack + expect(API.getUndoStack().length).toBe(1); expect(API.getRedoStack().length).toBe(0); expect(h.elements).toEqual([ expect.objectContaining({ @@ -2430,7 +2447,31 @@ describe("history", () => { ]); Keyboard.redo(); - expect(API.getUndoStack().length).toBe(5); + expect(API.getUndoStack().length).toBe(2); + expect(API.getRedoStack().length).toBe(3); + // visible change detected, so we don't iterate up again + expect(API.getSelectedElements()).toEqual([]); + expect(h.elements).toEqual([ + expect.objectContaining({ + id: rect1.id, + isDeleted: false, + }), + expect.objectContaining({ + id: rect2.id, + isDeleted: true, + backgroundColor: transparent, + }), + expect.objectContaining({ + id: rect3.id, + isDeleted: true, + x: 30, + y: 30, + }), + ]); + + Keyboard.redo(); + // we iterate all the way up, as there are no visible changes + expect(API.getUndoStack().length).toBe(4); expect(API.getRedoStack().length).toBe(0); expect(API.getSelectedElements()).toEqual([]); expect(h.elements).toEqual([ @@ -2489,8 +2530,8 @@ describe("history", () => { ]); Keyboard.redo(); - expect(API.getUndoStack().length).toBe(3); - expect(API.getRedoStack().length).toBe(0); + expect(API.getUndoStack().length).toBe(2); + expect(API.getRedoStack().length).toBe(1); // do not expect any selectedElementIds, as all relate to deleted elements expect(API.getSelectedElements()).toEqual([]); expect(h.elements).toEqual([ @@ -2506,7 +2547,6 @@ describe("history", () => { expect.objectContaining({ id: rect1.id, isDeleted: false }), ]); - // Simulate remote update API.updateScene({ elements: [ h.elements[0], @@ -2523,14 +2563,13 @@ describe("history", () => { Keyboard.redo(); expect(API.getUndoStack().length).toBe(2); expect(API.getRedoStack().length).toBe(1); - expect(API.getSelectedElements()).toEqual([ - expect.objectContaining({ id: rect2.id, isDeleted: false }), - ]); + // redo entry was calculated again with the latest undo, which goes back to nothing being selected + expect(API.getSelectedElements()).toEqual([]); Keyboard.redo(); expect(API.getUndoStack().length).toBe(3); expect(API.getRedoStack().length).toBe(0); - // now we again expect these as selected, as they got restored remotely + // now we again expect these as selected, as they got restored remotely and this redo entry was calculated in the beginning expect(API.getSelectedElements()).toEqual([ expect.objectContaining({ id: rect2.id }), expect.objectContaining({ id: rect3.id }), @@ -2599,16 +2638,14 @@ describe("history", () => { Keyboard.undo(); expect(API.getUndoStack().length).toBe(0); - expect(API.getRedoStack().length).toBe(2); // iterated two steps back! + expect(API.getRedoStack().length).toBe(1); // iterated two steps back and reduce two empty entries into one! expect(h.state.selectedGroupIds).toEqual({}); Keyboard.redo(); - expect(API.getUndoStack().length).toBe(2); // iterated two steps forward! + expect(API.getUndoStack().length).toBe(0); // no changes applied, so there is no new entry expect(API.getRedoStack().length).toBe(0); expect(h.state.selectedGroupIds).toEqual({}); - Keyboard.undo(); - // Simulate remote update API.updateScene({ elements: [ @@ -2621,22 +2658,6 @@ describe("history", () => { ], captureUpdate: CaptureUpdateAction.NEVER, }); - - Keyboard.redo(); - expect(API.getUndoStack().length).toBe(1); - expect(API.getRedoStack().length).toBe(1); - expect(h.state.selectedGroupIds).toEqual({ A: true }); - - // Simulate remote update - API.updateScene({ - elements: [h.elements[0], h.elements[1], rect3, rect4], - captureUpdate: CaptureUpdateAction.NEVER, - }); - - Keyboard.redo(); - expect(API.getUndoStack().length).toBe(2); - expect(API.getRedoStack().length).toBe(0); - expect(h.state.selectedGroupIds).toEqual({ A: true, B: true }); }); it("should iterate through the history when editing group contains only remotely deleted elements", async () => { @@ -2681,33 +2702,7 @@ describe("history", () => { Keyboard.undo(); expect(API.getUndoStack().length).toBe(0); - expect(API.getRedoStack().length).toBe(3); - expect(h.state.editingGroupId).toBeNull(); - - Keyboard.redo(); - expect(API.getUndoStack().length).toBe(3); - expect(API.getRedoStack().length).toBe(0); - expect(h.state.editingGroupId).toBeNull(); - - // Simulate remote update - API.updateScene({ - elements: [ - newElementWith(h.elements[0], { - isDeleted: false, - }), - h.elements[1], - ], - captureUpdate: CaptureUpdateAction.NEVER, - }); - - Keyboard.undo(); - expect(API.getUndoStack().length).toBe(2); - expect(API.getRedoStack().length).toBe(1); - expect(h.state.editingGroupId).toBe("A"); - - Keyboard.redo(); - expect(API.getUndoStack().length).toBe(3); - expect(API.getRedoStack().length).toBe(0); + expect(API.getRedoStack().length).toBe(0); // all changes relate to remotely deleted elements, there is no change and thus nothing to redo expect(h.state.editingGroupId).toBeNull(); }); @@ -2744,13 +2739,13 @@ describe("history", () => { }); Keyboard.undo(); - expect(API.getUndoStack().length).toBe(1); - expect(API.getRedoStack().length).toBe(3); + expect(API.getUndoStack().length).toBe(1); // iterated few entries back + expect(API.getRedoStack().length).toBe(1); // added just one non-empty entry into redo stack expect(h.state.editingLinearElement).toBeNull(); expect(h.state.selectedLinearElement).toBeNull(); Keyboard.redo(); - expect(API.getUndoStack().length).toBe(4); + expect(API.getUndoStack().length).toBe(1); expect(API.getRedoStack().length).toBe(0); expect(h.state.editingLinearElement).toBeNull(); expect(h.state.selectedLinearElement).toBeNull(); @@ -2838,7 +2833,7 @@ describe("history", () => { // We iterated two steps as there was no change in order! expect(API.getUndoStack().length).toBe(0); expect(API.getRedoStack().length).toBe(2); - expect(API.getSelectedElements().length).toBe(0); + assertSelectedElements([]); expect(h.elements).toEqual([ expect.objectContaining({ id: rect1.id }), // a "Zx" expect.objectContaining({ id: rect3.id }), // c "Zy" @@ -2846,7 +2841,7 @@ describe("history", () => { ]); }); - it("should iterate through the history when z-index changes do not produce visible change and we synced all indices", async () => { + it("should tolerate remote z-index changes with incorrect fractional indices", async () => { const rect1 = API.createElement({ type: "rectangle", x: 10, y: 10 }); const rect2 = API.createElement({ type: "rectangle", x: 20, y: 20 }); const rect3 = API.createElement({ type: "rectangle", x: 30, y: 30 }); @@ -2899,22 +2894,32 @@ describe("history", () => { // Simulate remote update API.updateScene({ elements: [ - h.elements[1], // rect2 h.elements[0], // rect3 h.elements[2], // rect1 + h.elements[1], // rect2 ], captureUpdate: CaptureUpdateAction.NEVER, }); Keyboard.undo(); - expect(API.getUndoStack().length).toBe(0); - expect(API.getRedoStack().length).toBe(2); // now we iterated two steps back! - assertSelectedElements([]); + expect(API.getUndoStack().length).toBe(1); + expect(API.getRedoStack().length).toBe(1); + assertSelectedElements([rect2]); expect(h.elements).toEqual([ expect.objectContaining({ id: rect2.id }), expect.objectContaining({ id: rect3.id }), expect.objectContaining({ id: rect1.id }), ]); + + Keyboard.redo(); + expect(API.getUndoStack().length).toBe(2); + expect(API.getRedoStack().length).toBe(0); + assertSelectedElements([rect2]); + expect(h.elements).toEqual([ + expect.objectContaining({ id: rect3.id }), + expect.objectContaining({ id: rect1.id }), + expect.objectContaining({ id: rect2.id }), + ]); }); it("should not let remote changes to interfere with in progress freedraw", async () => { @@ -3724,54 +3729,52 @@ describe("history", () => { captureUpdate: CaptureUpdateAction.NEVER, }); - runTwice(() => { - Keyboard.redo(); - expect(API.getUndoStack().length).toBe(1); - expect(API.getRedoStack().length).toBe(0); - expect(h.elements).toEqual([ - expect.objectContaining({ - id: container.id, - // previously bound text is preserved - // text bindings are not duplicated - boundElements: [{ id: remoteText.id, type: "text" }], - isDeleted: false, - }), - expect.objectContaining({ - id: text.id, - // unbound - containerId: null, - isDeleted: false, - }), - expect.objectContaining({ - id: remoteText.id, - // preserved existing binding! - containerId: container.id, - isDeleted: false, - }), - ]); + Keyboard.redo(); + expect(API.getUndoStack().length).toBe(1); + expect(API.getRedoStack().length).toBe(0); + expect(h.elements).toEqual([ + expect.objectContaining({ + id: container.id, + // previously bound text is preserved + // text bindings are not duplicated + boundElements: [{ id: remoteText.id, type: "text" }], + isDeleted: false, + }), + expect.objectContaining({ + id: text.id, + // unbound + containerId: null, + isDeleted: false, + }), + expect.objectContaining({ + id: remoteText.id, + // preserved existing binding! + containerId: container.id, + isDeleted: false, + }), + ]); - Keyboard.undo(); - expect(API.getUndoStack().length).toBe(0); - expect(API.getRedoStack().length).toBe(1); - expect(h.elements).toEqual([ - expect.objectContaining({ - id: container.id, - boundElements: [{ id: remoteText.id, type: "text" }], - isDeleted: false, // isDeleted got remotely updated to false - }), - expect.objectContaining({ - id: text.id, - containerId: null, - isDeleted: false, - }), - expect.objectContaining({ - id: remoteText.id, - // unbound - containerId: container.id, - isDeleted: false, - }), - ]); - }); + Keyboard.undo(); + expect(API.getUndoStack().length).toBe(0); + expect(API.getRedoStack().length).toBe(1); + expect(h.elements).toEqual([ + expect.objectContaining({ + id: container.id, + boundElements: [{ id: remoteText.id, type: "text" }], + isDeleted: false, // isDeleted got remotely updated to false + }), + expect.objectContaining({ + id: text.id, + containerId: null, + isDeleted: false, + }), + expect.objectContaining({ + id: remoteText.id, + // unbound + containerId: container.id, + isDeleted: false, + }), + ]); }); it("should preserve latest remotely added binding and unbind previous one when the text is added through history", async () => { diff --git a/packages/excalidraw/tests/test-utils.ts b/packages/excalidraw/tests/test-utils.ts index bc137a1d8..8fddde8bd 100644 --- a/packages/excalidraw/tests/test-utils.ts +++ b/packages/excalidraw/tests/test-utils.ts @@ -435,12 +435,17 @@ export const assertElements = >( expect(h.state.selectedElementIds).toEqual(selectedElementIds); }; -const stripSeed = (deltas: Record) => +const stripProps = ( + deltas: Record, + props: string[], +) => Object.entries(deltas).reduce((acc, curr) => { const { inserted, deleted, ...rest } = curr[1]; - delete inserted.seed; - delete deleted.seed; + for (const prop of props) { + delete inserted[prop]; + delete deleted[prop]; + } acc[curr[0]] = { inserted, @@ -457,9 +462,9 @@ export const checkpointHistory = (history: History, name: string) => { ...x, elements: { ...x.elements, - added: stripSeed(x.elements.added), - removed: stripSeed(x.elements.removed), - updated: stripSeed(x.elements.updated), + added: stripProps(x.elements.added, ["seed", "versionNonce"]), + removed: stripProps(x.elements.removed, ["seed", "versionNonce"]), + updated: stripProps(x.elements.updated, ["seed", "versionNonce"]), }, })), ).toMatchSnapshot(`[${name}] undo stack`); @@ -469,9 +474,9 @@ export const checkpointHistory = (history: History, name: string) => { ...x, elements: { ...x.elements, - added: stripSeed(x.elements.added), - removed: stripSeed(x.elements.removed), - updated: stripSeed(x.elements.updated), + added: stripProps(x.elements.added, ["seed", "versionNonce"]), + removed: stripProps(x.elements.removed, ["seed", "versionNonce"]), + updated: stripProps(x.elements.updated, ["seed", "versionNonce"]), }, })), ).toMatchSnapshot(`[${name}] redo stack`);