@json-to-office/core-docx 0.19.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6619,9 +6619,23 @@ Cause: ${cause}`
|
|
|
6619
6619
|
height
|
|
6620
6620
|
};
|
|
6621
6621
|
}
|
|
6622
|
+
function withThemeColors(config, theme) {
|
|
6623
|
+
const options = config.options;
|
|
6624
|
+
if (!options || options.colors || !theme?.colors) return config;
|
|
6625
|
+
const palette = [
|
|
6626
|
+
theme.colors.primary,
|
|
6627
|
+
theme.colors.secondary,
|
|
6628
|
+
theme.colors.accent
|
|
6629
|
+
].filter((c) => typeof c === "string" && c.length > 0).map((c) => c.startsWith("#") ? c : `#${c}`);
|
|
6630
|
+
if (palette.length === 0) return config;
|
|
6631
|
+
return {
|
|
6632
|
+
...config,
|
|
6633
|
+
options: { ...config.options, colors: palette }
|
|
6634
|
+
};
|
|
6635
|
+
}
|
|
6622
6636
|
async function renderHighchartsComponent(component, theme, themeName, context) {
|
|
6623
6637
|
if (!isHighchartsComponent(component)) return [];
|
|
6624
|
-
const config = component.props;
|
|
6638
|
+
const config = withThemeColors(component.props, theme);
|
|
6625
6639
|
const chartResult = await generateChart(
|
|
6626
6640
|
config,
|
|
6627
6641
|
context?.services?.highcharts
|