diff --git a/packages/editor/api-report.md b/packages/editor/api-report.md index 95c359eba..e3a6d8906 100644 --- a/packages/editor/api-report.md +++ b/packages/editor/api-report.md @@ -1964,7 +1964,6 @@ export type TLCollaboratorHintProps = { // @public (undocumented) export type TLCommand = { type: 'command'; - id: string; data: Data; name: Name; preservesRedoStack?: boolean; diff --git a/packages/editor/api/api.json b/packages/editor/api/api.json index 990b2e8f7..0b38a1d21 100644 --- a/packages/editor/api/api.json +++ b/packages/editor/api/api.json @@ -35941,7 +35941,7 @@ }, { "kind": "Content", - "text": "{\n type: 'command';\n id: string;\n data: Data;\n name: Name;\n preservesRedoStack?: boolean;\n}" + "text": "{\n type: 'command';\n data: Data;\n name: Name;\n preservesRedoStack?: boolean;\n}" }, { "kind": "Content", diff --git a/packages/editor/src/lib/editor/managers/HistoryManager.ts b/packages/editor/src/lib/editor/managers/HistoryManager.ts index a223df9a3..2b0511598 100644 --- a/packages/editor/src/lib/editor/managers/HistoryManager.ts +++ b/packages/editor/src/lib/editor/managers/HistoryManager.ts @@ -82,7 +82,6 @@ export class HistoryManager< this._undos.update((undos) => undos.tail.push({ ...prev, - id: uniqueId(), data: devFreeze(handle.squash!(prev.data, data)), }) ) @@ -93,7 +92,6 @@ export class HistoryManager< type: 'command', name, data: devFreeze(data), - id: uniqueId(), preservesRedoStack: preservesRedoStack, }) ) @@ -117,9 +115,9 @@ export class HistoryManager< this._batchDepth++ if (this._batchDepth === 1) { transact(() => { - const mostRecentActionId = this._undos.get().head?.id + const mostRecentAction = this._undos.get().head fn() - if (mostRecentActionId !== this._undos.get().head?.id) { + if (mostRecentAction !== this._undos.get().head) { this.onBatchComplete() } }) diff --git a/packages/editor/src/lib/editor/types/history-types.ts b/packages/editor/src/lib/editor/types/history-types.ts index 0ab03b479..6adfa2de7 100644 --- a/packages/editor/src/lib/editor/types/history-types.ts +++ b/packages/editor/src/lib/editor/types/history-types.ts @@ -25,7 +25,6 @@ export type TLHistoryMark = { /** @public */ export type TLCommand = { type: 'command' - id: string data: Data name: Name /**