refactor(editor): history as a store extension (#12214)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Improved history and undo/redo management across the app by introducing a dedicated history extension. Undo/redo operations now use a more focused undo manager, resulting in clearer and more consistent behavior. - **Documentation** - Updated API documentation to reflect changes in history management, including revised method signatures and removal of outdated event references. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
16 files changed
+124
-78
No files matched your search
@@ -56,6 +56,6 @@ export function initDocFromProps(
|
||||
paragraphId: paragraphBlockId,
|
||||
surfaceId,
|
||||
});
|
||||
doc.history.clear();
|
||||
doc.history.undoManager.clear();
|
||||
});
|
||||
}
|
||||
+1
-1
@@ -31,7 +31,7 @@ const renderRichText = ({
|
||||
|
||||
const richText = new RichText();
|
||||
richText.yText = text;
|
||||
richText.undoManager = doc.history;
|
||||
richText.undoManager = doc.history.undoManager;
|
||||
richText.readonly = doc.readonly;
|
||||
richText.attributesSchema = inlineManager.getSchema() as any;
|
||||
richText.attributeRenderer = inlineManager.getRenderer();
|
||||
|
||||
Reference in new issue
Block a user