🔥(frontend) remove fix about color in export

The last version of Blocknote fixed the issue
with colors in exports.
We can remove our workaround now.
This commit is contained in:
Anthony LC
2025-11-18 16:19:21 +01:00
parent b5dcbbb057
commit aeac49d760
4 changed files with 5 additions and 98 deletions

View File

@@ -8,7 +8,7 @@ and this project adheres to
### Added ### Added
- ✨(frontend) enable ODT export for documents #1524 - ✨(export) enable ODT export for documents #1524
- ✨(frontend) improve mobile UX by showing subdocs count #1540 - ✨(frontend) improve mobile UX by showing subdocs count #1540
### Fixed ### Fixed
@@ -17,13 +17,14 @@ and this project adheres to
- ♿(frontend) improve ARIA in doc grid and editor for a11y #1519 - ♿(frontend) improve ARIA in doc grid and editor for a11y #1519
- ♿(frontend) improve accessibility and styling of summary table #1528 - ♿(frontend) improve accessibility and styling of summary table #1528
- ♿(frontend) add focus trap and enter key support to remove doc modal #1531 - ♿(frontend) add focus trap and enter key support to remove doc modal #1531
- 🐛(docx) fix image overflow by limiting width to 600px during export #1525
- 🐛(frontend) preserve @ character when esc is pressed after typing it #1512 - 🐛(frontend) preserve @ character when esc is pressed after typing it #1512
- 🐛(frontend) make summary button fixed to remain visible during scroll #1581 - 🐛(frontend) make summary button fixed to remain visible during scroll #1581
- 🐛(frontend) fix pdf embed to use full width #1526 - 🐛(frontend) fix pdf embed to use full width #1526
- 🐛(frontend) fix fallback translations with Trans #1620 - 🐛(frontend) fix fallback translations with Trans #1620
- 🐛(pdf) fix table cell alignment issue in exported documents #1582 - 🐛(export) fix image overflow by limiting width to 600px during export #1525
- 🐛(pdf) preserve image aspect ratio in PDF export #1622 - 🐛(export) fix table cell alignment issue in exported documents #1582
- 🐛(export) preserve image aspect ratio in PDF export #1622
- 🐛(export) Export fails when paste with style #1552
### Security ### Security

View File

@@ -39,39 +39,5 @@ export const docxDocsSchemaMappings: DocsExporterDocx['mappings'] = {
shading: { fill: 'DCDCDC' }, shading: { fill: 'DCDCDC' },
} }
: {}, : {},
// If the color is not defined, we fall back to default colors
backgroundColor: (val, exporter) => {
if (!val) {
return {};
}
const backgroundColor = exporter.options.colors?.[val]?.background;
if (!backgroundColor) {
return {};
}
return {
shading: {
fill: backgroundColor.slice(1),
},
};
},
// If the color is not defined, we fall back to default colors
textColor: (val, exporter) => {
if (!val) {
return {};
}
const color = exporter.options.colors?.[val]?.text;
if (!color) {
return {};
}
return {
color: color.slice(1),
};
},
}, },
}; };

View File

@@ -30,32 +30,4 @@ export const odtDocsSchemaMappings: DocsExporterODT['mappings'] = {
interlinkingSearchInline: () => null, interlinkingSearchInline: () => null,
interlinkingLinkInline: inlineContentMappingInterlinkingLinkODT, interlinkingLinkInline: inlineContentMappingInterlinkingLinkODT,
}, },
styleMapping: {
...odtDefaultSchemaMappings.styleMapping,
textColor: (val, exporter): Record<string, string> => {
if (!val) {
return {};
}
const color = exporter.options.colors?.[val]?.text;
if (!color) {
return {};
}
return { 'fo:color': color };
},
backgroundColor: (val, exporter): Record<string, string> => {
if (!val) {
return {};
}
const color = exporter.options.colors?.[val]?.background;
if (!color) {
return {};
}
return { 'fo:background-color': color };
},
},
}; };

View File

@@ -39,37 +39,5 @@ export const pdfDocsSchemaMappings: DocsExporterPDF['mappings'] = {
// that is not available in italics // that is not available in italics
code: (enabled?: boolean) => code: (enabled?: boolean) =>
enabled ? { fontFamily: 'Courier', backgroundColor: '#dcdcdc' } : {}, enabled ? { fontFamily: 'Courier', backgroundColor: '#dcdcdc' } : {},
// If the color is not defined, we fall back to default colors
textColor: (val, exporter) => {
if (!val) {
return {};
}
const color = exporter.options.colors?.[val]?.text;
if (!color) {
return {};
}
return {
color,
};
},
// If the color is not defined, we fall back to default colors
backgroundColor: (val, exporter) => {
if (!val) {
return {};
}
const backgroundColor = exporter.options.colors?.[val]?.background;
if (!backgroundColor) {
return {};
}
return {
backgroundColor,
};
},
}, },
}; };