mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
refactor(editor): align rich text util apis (#11039)
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user