chore(editor): rename std.doc to std.store (#9596)

This commit is contained in:
Saul-Mirone
2025-01-09 04:16:28 +00:00
parent 58ce86533e
commit d21ef47ae8
89 changed files with 359 additions and 348 deletions
@@ -130,7 +130,7 @@ export class NoteBlockService extends BlockService {
private _focusBlock: BlockComponent | null = null;
private readonly _getClosestNoteByBlockId = (blockId: string) => {
const doc = this._std.doc;
const doc = this._std.store;
let parent = doc.getBlock(blockId)?.model ?? null;
while (parent) {
if (matchFlavours(parent, [NoteBlockSchema.model.flavour])) {
@@ -423,7 +423,7 @@ export class NoteBlockService extends BlockService {
return;
}
const { view, doc, selection } = ctx.std;
const { view, store, selection } = ctx.std;
const element = view.getBlock(blockSelection.blockId);
if (!element) {
@@ -431,14 +431,19 @@ export class NoteBlockService extends BlockService {
}
const { model } = element;
const parent = doc.getParent(model);
const parent = store.getParent(model);
if (!parent) {
return;
}
const index = parent.children.indexOf(model) ?? undefined;
const blockId = doc.addBlock('affine:paragraph', {}, parent, index + 1);
const blockId = store.addBlock(
'affine:paragraph',
{},
parent,
index + 1
);
const sel = selection.create(TextSelection, {
from: {