mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-21 20:11:43 +08:00
feat(editor): unify block props api (#10888)
Closes: [BS-2707](https://linear.app/affine-design/issue/BS-2707/统一使用props获取和更新block-prop)
This commit is contained in:
+4
-4
@@ -459,9 +459,9 @@ export class ExportManager {
|
||||
nodes ?? gfx.getElementsByBound(bound, { type: 'block' }) ?? [];
|
||||
for (const block of blocks) {
|
||||
if (matchModels(block, [ImageBlockModel])) {
|
||||
if (!block.sourceId) return;
|
||||
if (!block.props.sourceId) return;
|
||||
|
||||
const blob = await block.doc.blobSync.get(block.sourceId);
|
||||
const blob = await block.doc.blobSync.get(block.props.sourceId);
|
||||
if (!blob) return;
|
||||
|
||||
const blobToImage = (blob: Blob) =>
|
||||
@@ -564,7 +564,7 @@ export class ExportManager {
|
||||
const pdfBase64 = await pdfDoc.saveAsBase64({ dataUri: true });
|
||||
|
||||
FileExporter.exportFile(
|
||||
(rootModel as RootBlockModel).title.toString() + '.pdf',
|
||||
(rootModel as RootBlockModel).props.title.toString() + '.pdf',
|
||||
pdfBase64
|
||||
);
|
||||
}
|
||||
@@ -578,7 +578,7 @@ export class ExportManager {
|
||||
}
|
||||
|
||||
FileExporter.exportPng(
|
||||
(this.doc.root as RootBlockModel).title.toString(),
|
||||
(this.doc.root as RootBlockModel).props.title.toString(),
|
||||
canvasImage.toDataURL('image/png')
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user