mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 04:48:53 +00:00
@@ -1,3 +1,4 @@
|
||||
import { getStoreManager } from '@affine/core/blocksuite/manager/migrating-store';
|
||||
import { MarkdownTransformer } from '@blocksuite/affine/widgets/linked-doc';
|
||||
import { Service } from '@toeverything/infra';
|
||||
|
||||
@@ -34,6 +35,7 @@ export class ImportClipperService extends Service {
|
||||
collection: workspace.docCollection,
|
||||
schema: getAFFiNEWorkspaceSchema(),
|
||||
markdown: clipperInput.contentMarkdown,
|
||||
extensions: getStoreManager().get('store'),
|
||||
});
|
||||
const docsService = workspace.scope.get(DocsService);
|
||||
if (docId) {
|
||||
@@ -67,6 +69,7 @@ export class ImportClipperService extends Service {
|
||||
collection: docCollection,
|
||||
schema: getAFFiNEWorkspaceSchema(),
|
||||
markdown: clipperInput.contentMarkdown,
|
||||
extensions: getStoreManager().get('store'),
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { getStoreManager } from '@affine/core/blocksuite/manager/migrating-store';
|
||||
import { MarkdownTransformer } from '@blocksuite/affine/widgets/linked-doc';
|
||||
import { Entity } from '@toeverything/infra';
|
||||
|
||||
@@ -60,6 +61,7 @@ export class IntegrationWriter extends Entity {
|
||||
schema: getAFFiNEWorkspaceSchema(),
|
||||
markdown,
|
||||
fileName: title,
|
||||
extensions: getStoreManager().get('store'),
|
||||
});
|
||||
|
||||
if (!newDocId) throw new Error('Failed to create a new doc');
|
||||
@@ -87,6 +89,7 @@ export class IntegrationWriter extends Entity {
|
||||
doc,
|
||||
blockId: noteBlockId,
|
||||
markdown,
|
||||
extensions: getStoreManager().get('store'),
|
||||
});
|
||||
} else if (updateStrategy === 'append') {
|
||||
const pageBlockId = doc.getBlocksByFlavour('affine:page')[0]?.id;
|
||||
@@ -95,6 +98,7 @@ export class IntegrationWriter extends Entity {
|
||||
doc,
|
||||
blockId,
|
||||
markdown: `---\n${markdown}`,
|
||||
extensions: getStoreManager().get('store'),
|
||||
});
|
||||
} else {
|
||||
throw new Error('Invalid update strategy');
|
||||
|
||||
Reference in New Issue
Block a user