@json-to-office/core-pptx 0.33.0 → 0.35.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.
- package/dist/components/chart.d.ts +5 -0
- package/dist/components/chart.d.ts.map +1 -1
- package/dist/components/table.d.ts +1 -0
- package/dist/components/table.d.ts.map +1 -1
- package/dist/core/fontResolution.d.ts.map +1 -1
- package/dist/index.js +75 -15
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +3 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/warn.d.ts +1 -0
- package/dist/utils/warn.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -22,6 +22,7 @@ interface ChartComponentProps {
|
|
|
22
22
|
titleFontSize?: number;
|
|
23
23
|
titleColor?: string;
|
|
24
24
|
titleFontFace?: string;
|
|
25
|
+
titleFontWeight?: number;
|
|
25
26
|
chartColors?: string[];
|
|
26
27
|
dataBorder?: {
|
|
27
28
|
pt: number;
|
|
@@ -30,6 +31,7 @@ interface ChartComponentProps {
|
|
|
30
31
|
legendPos?: string;
|
|
31
32
|
legendFontSize?: number;
|
|
32
33
|
legendFontFace?: string;
|
|
34
|
+
legendFontWeight?: number;
|
|
33
35
|
legendColor?: string;
|
|
34
36
|
catAxisTitle?: string;
|
|
35
37
|
catAxisHidden?: boolean;
|
|
@@ -37,6 +39,7 @@ interface ChartComponentProps {
|
|
|
37
39
|
catAxisLabelFontSize?: number;
|
|
38
40
|
catAxisLabelColor?: string;
|
|
39
41
|
catAxisLabelFontFace?: string;
|
|
42
|
+
catAxisLabelFontWeight?: number;
|
|
40
43
|
catGridLine?: {
|
|
41
44
|
style?: string;
|
|
42
45
|
size?: number;
|
|
@@ -50,6 +53,7 @@ interface ChartComponentProps {
|
|
|
50
53
|
valAxisMajorUnit?: number;
|
|
51
54
|
valAxisLabelColor?: string;
|
|
52
55
|
valAxisLabelFontFace?: string;
|
|
56
|
+
valAxisLabelFontWeight?: number;
|
|
53
57
|
valAxisLabelFontSize?: number;
|
|
54
58
|
valGridLine?: {
|
|
55
59
|
style?: string;
|
|
@@ -72,6 +76,7 @@ interface ChartComponentProps {
|
|
|
72
76
|
dataLabelColor?: string;
|
|
73
77
|
dataLabelFontSize?: number;
|
|
74
78
|
dataLabelFontFace?: string;
|
|
79
|
+
dataLabelFontWeight?: number;
|
|
75
80
|
dataLabelFontBold?: boolean;
|
|
76
81
|
dataLabelPosition?: string;
|
|
77
82
|
x?: number | string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../src/components/chart.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,SAAS,MAAM,WAAW,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../src/components/chart.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,SAAS,MAAM,WAAW,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAKjE,UAAU,eAAe;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,UAAU,mBAAmB;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,eAAe,EAAE,CAAC;IAExB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,C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,eAAe,EACtB,IAAI,CAAC,EAAE,SAAS,EAChB,QAAQ,CAAC,EAAE,eAAe,EAAE,GAC3B,IAAI,CA+QN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fontResolution.d.ts","sourceRoot":"","sources":["../../src/core/fontResolution.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"fontResolution.d.ts","sourceRoot":"","sources":["../../src/core/fontResolution.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAc5E,OAAO,KAAK,EACV,eAAe,EACf,+BAA+B,EAChC,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhD,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,+BAA+B,EACzC,KAAK,EAAE,eAAe,EACtB,QAAQ,EAAE,eAAe,EAAE,EAC3B,KAAK,CAAC,EAAE,eAAe,GACtB,OAAO,CAAC,YAAY,EAAE,CAAC,CAoEzB"}
|
package/dist/index.js
CHANGED
|
@@ -17,6 +17,7 @@ var W = {
|
|
|
17
17
|
CHART_NO_DATA: "CHART_NO_DATA",
|
|
18
18
|
CHART_INVALID_SERIES: "CHART_INVALID_SERIES",
|
|
19
19
|
CHART_MULTI_SERIES: "CHART_MULTI_SERIES",
|
|
20
|
+
CHART_FONT_WEIGHT_DROPPED: "CHART_FONT_WEIGHT_DROPPED",
|
|
20
21
|
IMAGE_NO_SOURCE: "IMAGE_NO_SOURCE",
|
|
21
22
|
IMAGE_PROBE_FAILED: "IMAGE_PROBE_FAILED",
|
|
22
23
|
IMAGE_PATH_OUTSIDE_ROOTS: "IMAGE_PATH_OUTSIDE_ROOTS",
|
|
@@ -1258,9 +1259,9 @@ function renderTableComponent(slide, props, theme, pptx, warnings) {
|
|
|
1258
1259
|
}
|
|
1259
1260
|
if (cell.fontSize) cellOpts.fontSize = cell.fontSize;
|
|
1260
1261
|
if (cell.fontFace) cellOpts.fontFace = cell.fontFace;
|
|
1261
|
-
if (cell.bold) cellOpts.bold =
|
|
1262
|
+
if (cell.bold !== void 0) cellOpts.bold = cell.bold;
|
|
1262
1263
|
if (cell.italic) cellOpts.italic = true;
|
|
1263
|
-
if (cell.fontWeight != null || cell.bold
|
|
1264
|
+
if (cell.fontWeight != null || cell.bold !== void 0) {
|
|
1264
1265
|
const w = applyFontWeight({
|
|
1265
1266
|
family: cellOpts.fontFace ?? props.fontFace ?? theme.fonts.body,
|
|
1266
1267
|
fontWeight: cell.fontWeight,
|
|
@@ -1297,6 +1298,14 @@ function renderTableComponent(slide, props, theme, pptx, warnings) {
|
|
|
1297
1298
|
opts.fill = { color: resolveColor(props.fill, theme, warnings) };
|
|
1298
1299
|
opts.fontSize = props.fontSize ?? theme.defaults.fontSize;
|
|
1299
1300
|
opts.fontFace = props.fontFace ?? theme.fonts.body;
|
|
1301
|
+
if (props.fontWeight != null) {
|
|
1302
|
+
const w = applyFontWeight({
|
|
1303
|
+
family: opts.fontFace,
|
|
1304
|
+
fontWeight: props.fontWeight
|
|
1305
|
+
});
|
|
1306
|
+
if (w.fontFace !== void 0) opts.fontFace = w.fontFace;
|
|
1307
|
+
if (w.bold === true) opts.bold = true;
|
|
1308
|
+
}
|
|
1300
1309
|
if (props.color) opts.color = resolveColor(props.color, theme, warnings);
|
|
1301
1310
|
if (props.align) opts.align = props.align;
|
|
1302
1311
|
opts.valign = props.valign ?? "middle";
|
|
@@ -1539,6 +1548,27 @@ function renderChartComponent(slide, props, theme, _pptx, warnings) {
|
|
|
1539
1548
|
color: resolveColor(props.dataBorder.color, theme, warnings)
|
|
1540
1549
|
};
|
|
1541
1550
|
}
|
|
1551
|
+
const applyLabelFont = (faceKey, boldKey, face, weight) => {
|
|
1552
|
+
if (weight === void 0) {
|
|
1553
|
+
if (face !== void 0) opts[faceKey] = face;
|
|
1554
|
+
return;
|
|
1555
|
+
}
|
|
1556
|
+
const w = applyFontWeight({
|
|
1557
|
+
family: face ?? theme.fonts?.body,
|
|
1558
|
+
fontWeight: weight
|
|
1559
|
+
});
|
|
1560
|
+
if (w.fontFace !== void 0) opts[faceKey] = w.fontFace;
|
|
1561
|
+
if (boldKey !== void 0) {
|
|
1562
|
+
opts[boldKey] = w.bold === true;
|
|
1563
|
+
} else if (w.bold === true) {
|
|
1564
|
+
warn(
|
|
1565
|
+
warnings,
|
|
1566
|
+
W.CHART_FONT_WEIGHT_DROPPED,
|
|
1567
|
+
`Chart ${faceKey} weight ${weight} renders as Regular \u2014 PowerPoint gives the legend no bold toggle, and only non-RIBBI weights resolve to a sub-family face`,
|
|
1568
|
+
{ component: "chart" }
|
|
1569
|
+
);
|
|
1570
|
+
}
|
|
1571
|
+
};
|
|
1542
1572
|
if (props.showLegend !== void 0) opts.showLegend = props.showLegend;
|
|
1543
1573
|
if (props.showTitle !== void 0) opts.showTitle = props.showTitle;
|
|
1544
1574
|
if (props.showValue !== void 0) opts.showValue = props.showValue;
|
|
@@ -1548,13 +1578,21 @@ function renderChartComponent(slide, props, theme, _pptx, warnings) {
|
|
|
1548
1578
|
if (props.title !== void 0) opts.title = props.title;
|
|
1549
1579
|
if (props.titleFontSize !== void 0)
|
|
1550
1580
|
opts.titleFontSize = props.titleFontSize;
|
|
1551
|
-
|
|
1552
|
-
|
|
1581
|
+
applyLabelFont(
|
|
1582
|
+
"titleFontFace",
|
|
1583
|
+
"titleBold",
|
|
1584
|
+
props.titleFontFace,
|
|
1585
|
+
props.titleFontWeight
|
|
1586
|
+
);
|
|
1553
1587
|
if (props.legendPos !== void 0) opts.legendPos = props.legendPos;
|
|
1554
1588
|
if (props.legendFontSize !== void 0)
|
|
1555
1589
|
opts.legendFontSize = props.legendFontSize;
|
|
1556
|
-
|
|
1557
|
-
|
|
1590
|
+
applyLabelFont(
|
|
1591
|
+
"legendFontFace",
|
|
1592
|
+
void 0,
|
|
1593
|
+
props.legendFontFace,
|
|
1594
|
+
props.legendFontWeight
|
|
1595
|
+
);
|
|
1558
1596
|
if (props.catAxisTitle !== void 0) {
|
|
1559
1597
|
opts.catAxisTitle = props.catAxisTitle;
|
|
1560
1598
|
opts.showCatAxisTitle = true;
|
|
@@ -1565,8 +1603,12 @@ function renderChartComponent(slide, props, theme, _pptx, warnings) {
|
|
|
1565
1603
|
opts.catAxisLabelRotate = props.catAxisLabelRotate;
|
|
1566
1604
|
if (props.catAxisLabelFontSize !== void 0)
|
|
1567
1605
|
opts.catAxisLabelFontSize = props.catAxisLabelFontSize;
|
|
1568
|
-
|
|
1569
|
-
|
|
1606
|
+
applyLabelFont(
|
|
1607
|
+
"catAxisLabelFontFace",
|
|
1608
|
+
"catAxisLabelFontBold",
|
|
1609
|
+
props.catAxisLabelFontFace,
|
|
1610
|
+
props.catAxisLabelFontWeight
|
|
1611
|
+
);
|
|
1570
1612
|
if (props.catGridLine !== void 0)
|
|
1571
1613
|
opts.catGridLine = resolveGridLine(props.catGridLine, theme, warnings);
|
|
1572
1614
|
if (props.valAxisTitle !== void 0) {
|
|
@@ -1583,8 +1625,12 @@ function renderChartComponent(slide, props, theme, _pptx, warnings) {
|
|
|
1583
1625
|
opts.valAxisLabelFormatCode = props.valAxisLabelFormatCode;
|
|
1584
1626
|
if (props.valAxisMajorUnit !== void 0)
|
|
1585
1627
|
opts.valAxisMajorUnit = props.valAxisMajorUnit;
|
|
1586
|
-
|
|
1587
|
-
|
|
1628
|
+
applyLabelFont(
|
|
1629
|
+
"valAxisLabelFontFace",
|
|
1630
|
+
"valAxisLabelFontBold",
|
|
1631
|
+
props.valAxisLabelFontFace,
|
|
1632
|
+
props.valAxisLabelFontWeight
|
|
1633
|
+
);
|
|
1588
1634
|
if (props.valGridLine !== void 0)
|
|
1589
1635
|
opts.valGridLine = resolveGridLine(props.valGridLine, theme, warnings);
|
|
1590
1636
|
if (props.barDir !== void 0) opts.barDir = props.barDir;
|
|
@@ -1606,10 +1652,14 @@ function renderChartComponent(slide, props, theme, _pptx, warnings) {
|
|
|
1606
1652
|
opts.dataLabelColor = props.dataLabelColor ? resolveColor(props.dataLabelColor, theme, warnings) : themeTextColor;
|
|
1607
1653
|
if (props.dataLabelFontSize !== void 0)
|
|
1608
1654
|
opts.dataLabelFontSize = props.dataLabelFontSize;
|
|
1609
|
-
if (props.dataLabelFontFace !== void 0)
|
|
1610
|
-
opts.dataLabelFontFace = props.dataLabelFontFace;
|
|
1611
1655
|
if (props.dataLabelFontBold !== void 0)
|
|
1612
1656
|
opts.dataLabelFontBold = props.dataLabelFontBold;
|
|
1657
|
+
applyLabelFont(
|
|
1658
|
+
"dataLabelFontFace",
|
|
1659
|
+
"dataLabelFontBold",
|
|
1660
|
+
props.dataLabelFontFace,
|
|
1661
|
+
props.dataLabelFontWeight
|
|
1662
|
+
);
|
|
1613
1663
|
if (props.dataLabelPosition !== void 0)
|
|
1614
1664
|
opts.dataLabelPosition = props.dataLabelPosition;
|
|
1615
1665
|
slide.addChart(chartType, data, opts);
|
|
@@ -1922,7 +1972,10 @@ async function renderPresentation(processed, warnings, pendingFills) {
|
|
|
1922
1972
|
import {
|
|
1923
1973
|
collectFontNamesFromPptx,
|
|
1924
1974
|
validateFontReferences,
|
|
1925
|
-
FontRegistry
|
|
1975
|
+
FontRegistry,
|
|
1976
|
+
documentFontRegistry,
|
|
1977
|
+
themeFontRegistry,
|
|
1978
|
+
mergeFontRegistries
|
|
1926
1979
|
} from "@json-to-office/shared";
|
|
1927
1980
|
import {
|
|
1928
1981
|
loadFileFontSource,
|
|
@@ -1934,9 +1987,14 @@ async function resolveDocumentFonts(document, theme, warnings, fonts) {
|
|
|
1934
1987
|
for (const n of collectFontNamesFromPptx(document)) names.add(n);
|
|
1935
1988
|
for (const n of collectFontNamesFromPptx(theme)) names.add(n);
|
|
1936
1989
|
if (names.size === 0) return [];
|
|
1990
|
+
const registryEntries = mergeFontRegistries(
|
|
1991
|
+
themeFontRegistry(theme),
|
|
1992
|
+
documentFontRegistry(document),
|
|
1993
|
+
fonts?.extraEntries
|
|
1994
|
+
);
|
|
1937
1995
|
const validation = validateFontReferences({
|
|
1938
1996
|
referencedNames: names,
|
|
1939
|
-
registeredEntries:
|
|
1997
|
+
registeredEntries: registryEntries
|
|
1940
1998
|
});
|
|
1941
1999
|
if (validation.warnings.length > 0) {
|
|
1942
2000
|
if (fonts?.strict) {
|
|
@@ -1953,7 +2011,9 @@ async function resolveDocumentFonts(document, theme, warnings, fonts) {
|
|
|
1953
2011
|
}
|
|
1954
2012
|
if (!fonts?.onResolved) return [];
|
|
1955
2013
|
const registry = new FontRegistry({
|
|
1956
|
-
|
|
2014
|
+
// Spread keeps baseDir/googleFonts/mode/substitution intact for
|
|
2015
|
+
// materializeSource; extraEntries carries the merged registry.
|
|
2016
|
+
opts: { ...fonts, extraEntries: registryEntries },
|
|
1957
2017
|
fileLoader: loadFileFontSource,
|
|
1958
2018
|
variableLoader: fetchVariableFontSource,
|
|
1959
2019
|
diskCache: fonts?.googleFonts?.cacheDir ? new FontDiskCache(fonts.googleFonts.cacheDir) : void 0
|