refactor(editor): job should not rely on doc collection directly (#9488)

This commit is contained in:
Saul-Mirone
2025-01-02 10:50:15 +00:00
parent f2906bc6d0
commit edb5e1d87a
34 changed files with 565 additions and 337 deletions
@@ -27,7 +27,7 @@ export const embedSyncedDocBlockHtmlAdapterMatcher: BlockHtmlAdapterMatcher = {
if (type === 'content') {
const syncedDocId = o.node.props.pageId as string;
const syncedDoc = job.collection.getDoc(syncedDocId);
const syncedDoc = job.docCRUD.get(syncedDocId);
walkerContext.setGlobalContext('hast:html-root-doc', false);
if (!syncedDoc) return;
@@ -29,7 +29,7 @@ export const embedSyncedDocBlockMarkdownAdapterMatcher: BlockMarkdownAdapterMatc
if (type === 'content') {
const syncedDocId = o.node.props.pageId as string;
const syncedDoc = job.collection.getDoc(syncedDocId);
const syncedDoc = job.docCRUD.get(syncedDocId);
if (!syncedDoc) return;
if (counter === 1) {
@@ -31,7 +31,7 @@ export const embedSyncedDocBlockPlainTextAdapterMatcher: BlockPlainTextAdapterMa
if (type === 'content') {
const syncedDocId = o.node.props.pageId as string;
const syncedDoc = job.collection.getDoc(syncedDocId);
const syncedDoc = job.docCRUD.get(syncedDocId);
if (!syncedDoc) return;
if (counter === 1) {