refactor(editor): align rich text util apis (#11039)

This commit is contained in:
Saul-Mirone
2025-03-20 10:40:11 +00:00
parent 77e659d0b0
commit 66ea3038af
18 changed files with 57 additions and 73 deletions

View File

@@ -86,7 +86,7 @@ export const updateBlockType: Command<
if (!id) return;
const model = doc.getModelById(id);
if (!model) return;
asyncSetInlineRange(host, model, {
asyncSetInlineRange(std, model, {
index: model.text?.length ?? 0,
length: 0,
}).catch(console.error);
@@ -132,7 +132,7 @@ export const updateBlockType: Command<
const lastNewModel = updatedBlocks[updatedBlocks.length - 1];
const allTextUpdated = updatedBlocks.map(model =>
onModelTextUpdated(host, model)
onModelTextUpdated(std, model)
);
const selectionManager = host.selection;
const textSelection = selectionManager.find(TextSelection);

View File

@@ -119,7 +119,7 @@ class NoteKeymap {
}
const [codeModel] = newModels;
asyncGetBlockComponent(ctx.std.host, codeModel.id)
asyncGetBlockComponent(ctx.std, codeModel.id)
.then(codeElement => {
if (!codeElement) {
return;