ProposedChange
Represents a single, reviewable proposed document change. Holds both the information about the change and its current status.
Properties
afterRange: ModelRangeinheritedmodule:ai/toolkit/proposedchange~ProposedChange#afterRangeWhat the covered content becomes, represented as a range inside the processed data. The range covers existing elements which were modified or new elements.
In other words, the document change says that
beforeRangecontent becomesafterRangecontent.Note, that the range is placed inside the processed data represented as a model document fragment, not in the actual model document. One processed data model fragment is shared between all document changes in a given set.
Collapsed for a change that only removes content.
aiSource?: AIOperationSourceinheritedmodule:ai/toolkit/proposedchange~ProposedChange#aiSourceWhich AI feature produced the change or not set if the change did not come from AI.
See
aiSource.beforeRange: ModelRangeinheritedmodule:ai/toolkit/proposedchange~ProposedChange#beforeRangeWhat the change covers, represented as a range inside the captured snapshot. The range covers the existing elements which were either removed or modified.
Note, that the range is placed inside the snapshot represented as a model document fragment, not in the actual model document. One snapshot model fragment is shared between all document changes in a given set.
Collapsed for a change that only adds content.
channelId: stringinheritedmodule:ai/toolkit/proposedchange~ProposedChange#channelIdThe ID of the document the change was captured from.
module:ai/toolkit/proposedchange~ProposedChange#emptyReasonIf set, holds a reason why the proposed change yields nothing (no preview to show, and nothing an apply would do).
index: numbermodule:ai/toolkit/proposedchange~ProposedChange#indexThe change's position in the set.
Assigned when the set of changes is built, does not change later on.
isReadOnly?: booleanmodule:ai/toolkit/proposedchange~ProposedChange#isReadOnlyIf
true, the change relates to content that is current in read-only mode and thus the change cannot be applied.module:ai/toolkit/proposedchange~ProposedChange#outdatedStateIf set, holds a reason why the proposed change cannot be applied to the current state of the document.
If not set, the change is not outdated and can be applied to the document.
rootName: stringinheritedmodule:ai/toolkit/proposedchange~ProposedChange#rootNameThe name of the editor root the change applies to.
sessionId: stringinheritedmodule:ai/toolkit/proposedchange~ProposedChange#sessionIdThe editing session ID during which the change was captured.
module:ai/toolkit/proposedchange~ProposedChange#stateHolds information whether the user has interacted with the proposed document change.
version: numberinheritedmodule:ai/toolkit/proposedchange~ProposedChange#versionThe document version for which the change is proposed.