🔥(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:
@@ -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),
|
||||
};
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -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 };
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user