Skip to content

Commit 2c5be8c

Browse files
committed
♻️(frontend) using file block mapping for pdf block
Because PDF blocks are not supported, we are using what we already have in blocknote Signed-off-by: dakshesh14 <[email protected]>
1 parent 37ba337 commit 2c5be8c

File tree

5 files changed

+8
-99
lines changed

5 files changed

+8
-99
lines changed

src/frontend/apps/impress/src/features/docs/doc-export/blocks-mapping/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ export * from './headingPDF';
66
export * from './imageDocx';
77
export * from './imagePDF';
88
export * from './paragraphPDF';
9-
export * from './pdfDocx';
10-
export * from './pdfPDF';
119
export * from './quoteDocx';
1210
export * from './quotePDF';
1311
export * from './tablePDF';

src/frontend/apps/impress/src/features/docs/doc-export/blocks-mapping/pdfDocx.tsx

Lines changed: 0 additions & 62 deletions
This file was deleted.

src/frontend/apps/impress/src/features/docs/doc-export/blocks-mapping/pdfPDF.tsx

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/frontend/apps/impress/src/features/docs/doc-export/mappingDocx.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
blockMappingCalloutDocx,
66
blockMappingDividerDocx,
77
blockMappingImageDocx,
8-
blockMappingPdfDocx,
98
blockMappingQuoteDocx,
109
} from './blocks-mapping';
1110
import { inlineContentMappingInterlinkingLinkDocx } from './inline-content-mapping';
@@ -17,7 +16,10 @@ export const docxDocsSchemaMappings: DocsExporterDocx['mappings'] = {
1716
...docxDefaultSchemaMappings.blockMapping,
1817
callout: blockMappingCalloutDocx,
1918
divider: blockMappingDividerDocx,
20-
pdf: blockMappingPdfDocx,
19+
// We're using the file block mapping for PDF blocks
20+
// The types don't match exactly but the implementation is compatible
21+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment
22+
pdf: docxDefaultSchemaMappings.blockMapping.file as any,
2123
quote: blockMappingQuoteDocx,
2224
image: blockMappingImageDocx,
2325
},

src/frontend/apps/impress/src/features/docs/doc-export/mappingPDF.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
blockMappingHeadingPDF,
77
blockMappingImagePDF,
88
blockMappingParagraphPDF,
9-
blockMappingPdfPDF,
109
blockMappingQuotePDF,
1110
blockMappingTablePDF,
1211
} from './blocks-mapping';
@@ -24,7 +23,10 @@ export const pdfDocsSchemaMappings: DocsExporterPDF['mappings'] = {
2423
divider: blockMappingDividerPDF,
2524
quote: blockMappingQuotePDF,
2625
table: blockMappingTablePDF,
27-
pdf: blockMappingPdfPDF,
26+
// We're using the file block mapping for PDF blocks
27+
// The types don't match exactly but the implementation is compatible
28+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment
29+
pdf: pdfDefaultSchemaMappings.blockMapping.file as any,
2830
},
2931
inlineContentMapping: {
3032
...pdfDefaultSchemaMappings.inlineContentMapping,

0 commit comments

Comments
 (0)