🔥(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

@@ -39,39 +39,5 @@ export const docxDocsSchemaMappings: DocsExporterDocx['mappings'] = {
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,
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
code: (enabled?: boolean) =>
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,
};
},
},
};