@hirokisakabe/pom 8.5.1 → 8.7.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/README.md +37 -24
- package/dist/autoFit/strategies/reduceFontSize.js +23 -7
- package/dist/autoFit/strategies/reduceFontSize.js.map +1 -1
- package/dist/autoFit/strategies/uniformScale.js +19 -4
- package/dist/autoFit/strategies/uniformScale.js.map +1 -1
- package/dist/parseXml/coercionRules.js +9 -1
- package/dist/parseXml/coercionRules.js.map +1 -1
- package/dist/parseXml/parseXml.d.ts.map +1 -1
- package/dist/parseXml/parseXml.js +10 -5
- package/dist/parseXml/parseXml.js.map +1 -1
- package/dist/parseXml/serializeXml.d.ts +3 -2
- package/dist/parseXml/serializeXml.d.ts.map +1 -1
- package/dist/parseXml/serializeXml.js +4 -2
- package/dist/parseXml/serializeXml.js.map +1 -1
- package/dist/registry/definitions/list.js +2 -1
- package/dist/registry/definitions/list.js.map +1 -1
- package/dist/registry/definitions/text.js +2 -1
- package/dist/registry/definitions/text.js.map +1 -1
- package/dist/registry/xmlChildRules.js +11 -1
- package/dist/registry/xmlChildRules.js.map +1 -1
- package/dist/renderPptx/nodes/chart.js +43 -3
- package/dist/renderPptx/nodes/chart.js.map +1 -1
- package/dist/renderPptx/nodes/list.js +15 -2
- package/dist/renderPptx/nodes/list.js.map +1 -1
- package/dist/renderPptx/nodes/shape.js +2 -0
- package/dist/renderPptx/nodes/shape.js.map +1 -1
- package/dist/renderPptx/nodes/table.js +22 -15
- package/dist/renderPptx/nodes/table.js.map +1 -1
- package/dist/renderPptx/nodes/text.js +6 -2
- package/dist/renderPptx/nodes/text.js.map +1 -1
- package/dist/renderPptx/textOptions.js +19 -1
- package/dist/renderPptx/textOptions.js.map +1 -1
- package/dist/types.d.ts +27 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +17 -1
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { pxToPt } from "../units.js";
|
|
2
2
|
import { getContentAreaIn } from "../utils/contentArea.js";
|
|
3
|
-
import { convertStrike, convertUnderline } from "../textOptions.js";
|
|
3
|
+
import { convertStrike, convertUnderline, resolveSubSup } from "../textOptions.js";
|
|
4
4
|
//#region src/renderPptx/nodes/list.ts
|
|
5
5
|
function resolveStyle(li, parent) {
|
|
6
|
+
const subSup = resolveSubSup(li, parent);
|
|
6
7
|
return {
|
|
7
8
|
fontSize: li.fontSize ?? parent.fontSize ?? 24,
|
|
8
9
|
color: li.color ?? parent.color,
|
|
@@ -10,6 +11,8 @@ function resolveStyle(li, parent) {
|
|
|
10
11
|
italic: li.italic ?? parent.italic,
|
|
11
12
|
underline: li.underline ?? parent.underline,
|
|
12
13
|
strike: li.strike ?? parent.strike,
|
|
14
|
+
subscript: subSup.subscript,
|
|
15
|
+
superscript: subSup.superscript,
|
|
13
16
|
highlight: li.highlight ?? parent.highlight,
|
|
14
17
|
fontFamily: li.fontFamily ?? parent.fontFamily ?? "Noto Sans JP"
|
|
15
18
|
};
|
|
@@ -26,6 +29,8 @@ function buildListTextItems(items, parent, bullet) {
|
|
|
26
29
|
color: style.color,
|
|
27
30
|
underline: convertUnderline(style.underline),
|
|
28
31
|
strike: convertStrike(style.strike),
|
|
32
|
+
subscript: style.subscript,
|
|
33
|
+
superscript: style.superscript,
|
|
29
34
|
highlight: style.highlight
|
|
30
35
|
};
|
|
31
36
|
if (li.runs && li.runs.length > 0) for (let j = 0; j < li.runs.length; j++) {
|
|
@@ -33,16 +38,20 @@ function buildListTextItems(items, parent, bullet) {
|
|
|
33
38
|
const isLastRun = j === li.runs.length - 1;
|
|
34
39
|
let text = run.text;
|
|
35
40
|
if (isLastRun && !isLast) text += "\n";
|
|
41
|
+
const runSubSup = resolveSubSup(run, style);
|
|
36
42
|
textItems.push({
|
|
37
43
|
text,
|
|
38
44
|
options: {
|
|
39
45
|
...baseOptions,
|
|
46
|
+
fontSize: pxToPt(run.fontSize ?? style.fontSize),
|
|
40
47
|
fontFace: run.fontFamily ?? style.fontFamily,
|
|
41
48
|
color: run.color ?? style.color,
|
|
42
49
|
bold: run.bold ?? style.bold,
|
|
43
50
|
italic: run.italic ?? style.italic,
|
|
44
51
|
underline: convertUnderline(run.underline ?? style.underline),
|
|
45
52
|
strike: convertStrike(run.strike ?? style.strike),
|
|
53
|
+
subscript: runSubSup.subscript,
|
|
54
|
+
superscript: runSubSup.superscript,
|
|
46
55
|
highlight: run.highlight ?? style.highlight,
|
|
47
56
|
bullet: j === 0 ? bullet : false,
|
|
48
57
|
...run.href ? { hyperlink: { url: run.href } } : {}
|
|
@@ -62,7 +71,7 @@ function buildListTextItems(items, parent, bullet) {
|
|
|
62
71
|
return textItems;
|
|
63
72
|
}
|
|
64
73
|
function hasItemStyleOverride(items) {
|
|
65
|
-
return items.some((li) => li.fontSize !== void 0 || li.color !== void 0 || li.bold !== void 0 || li.italic !== void 0 || li.underline !== void 0 || li.strike !== void 0 || li.highlight !== void 0 || li.fontFamily !== void 0 || li.runs !== void 0);
|
|
74
|
+
return items.some((li) => li.fontSize !== void 0 || li.color !== void 0 || li.bold !== void 0 || li.italic !== void 0 || li.underline !== void 0 || li.strike !== void 0 || li.subscript !== void 0 || li.superscript !== void 0 || li.highlight !== void 0 || li.fontFamily !== void 0 || li.runs !== void 0);
|
|
66
75
|
}
|
|
67
76
|
function renderUlNode(node, ctx) {
|
|
68
77
|
const fontSizePx = node.fontSize ?? 24;
|
|
@@ -93,6 +102,8 @@ function renderUlNode(node, ctx) {
|
|
|
93
102
|
italic: node.italic,
|
|
94
103
|
underline: convertUnderline(node.underline),
|
|
95
104
|
strike: convertStrike(node.strike),
|
|
105
|
+
subscript: node.subscript,
|
|
106
|
+
superscript: node.superscript,
|
|
96
107
|
highlight: node.highlight,
|
|
97
108
|
bullet: true
|
|
98
109
|
});
|
|
@@ -130,6 +141,8 @@ function renderOlNode(node, ctx) {
|
|
|
130
141
|
italic: node.italic,
|
|
131
142
|
underline: convertUnderline(node.underline),
|
|
132
143
|
strike: convertStrike(node.strike),
|
|
144
|
+
subscript: node.subscript,
|
|
145
|
+
superscript: node.superscript,
|
|
133
146
|
highlight: node.highlight,
|
|
134
147
|
bullet: bulletOptions
|
|
135
148
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","names":[],"sources":["../../../src/renderPptx/nodes/list.ts"],"sourcesContent":["import type { PositionedNode, LiNode } from \"../../types.ts\";\nimport type { RenderContext } from \"../types.ts\";\nimport { pxToPt } from \"../units.ts\";\nimport {
|
|
1
|
+
{"version":3,"file":"list.js","names":[],"sources":["../../../src/renderPptx/nodes/list.ts"],"sourcesContent":["import type { PositionedNode, LiNode } from \"../../types.ts\";\nimport type { RenderContext } from \"../types.ts\";\nimport { pxToPt } from \"../units.ts\";\nimport {\n convertUnderline,\n convertStrike,\n resolveSubSup,\n} from \"../textOptions.ts\";\nimport { getContentAreaIn } from \"../utils/contentArea.ts\";\n\ntype UlPositionedNode = Extract<PositionedNode, { type: \"ul\" }>;\ntype OlPositionedNode = Extract<PositionedNode, { type: \"ol\" }>;\n\nfunction resolveStyle(li: LiNode, parent: UlPositionedNode | OlPositionedNode) {\n const subSup = resolveSubSup(li, parent);\n return {\n fontSize: li.fontSize ?? parent.fontSize ?? 24,\n color: li.color ?? parent.color,\n bold: li.bold ?? parent.bold,\n italic: li.italic ?? parent.italic,\n underline: li.underline ?? parent.underline,\n strike: li.strike ?? parent.strike,\n subscript: subSup.subscript,\n superscript: subSup.superscript,\n highlight: li.highlight ?? parent.highlight,\n fontFamily: li.fontFamily ?? parent.fontFamily ?? \"Noto Sans JP\",\n };\n}\n\nfunction buildListTextItems(\n items: LiNode[],\n parent: UlPositionedNode | OlPositionedNode,\n bullet: boolean | Record<string, unknown>,\n) {\n const textItems: { text: string; options: Record<string, unknown> }[] = [];\n for (let i = 0; i < items.length; i++) {\n const li = items[i];\n const style = resolveStyle(li, parent);\n const isLast = i === items.length - 1;\n const baseOptions = {\n fontSize: pxToPt(style.fontSize),\n fontFace: style.fontFamily,\n color: style.color,\n underline: convertUnderline(style.underline),\n strike: convertStrike(style.strike),\n subscript: style.subscript,\n superscript: style.superscript,\n highlight: style.highlight,\n };\n\n if (li.runs && li.runs.length > 0) {\n for (let j = 0; j < li.runs.length; j++) {\n const run = li.runs[j];\n const isLastRun = j === li.runs.length - 1;\n let text = run.text;\n if (isLastRun && !isLast) text += \"\\n\";\n const runSubSup = resolveSubSup(run, style);\n textItems.push({\n text,\n options: {\n ...baseOptions,\n fontSize: pxToPt(run.fontSize ?? style.fontSize),\n fontFace: run.fontFamily ?? style.fontFamily,\n color: run.color ?? style.color,\n bold: run.bold ?? style.bold,\n italic: run.italic ?? style.italic,\n underline: convertUnderline(run.underline ?? style.underline),\n strike: convertStrike(run.strike ?? style.strike),\n subscript: runSubSup.subscript,\n superscript: runSubSup.superscript,\n highlight: run.highlight ?? style.highlight,\n bullet: j === 0 ? bullet : false,\n ...(run.href ? { hyperlink: { url: run.href } } : {}),\n },\n });\n }\n } else {\n textItems.push({\n text: isLast ? li.text : li.text + \"\\n\",\n options: {\n ...baseOptions,\n bold: style.bold,\n italic: style.italic,\n bullet,\n },\n });\n }\n }\n return textItems;\n}\n\nfunction hasItemStyleOverride(items: LiNode[]): boolean {\n return items.some(\n (li) =>\n li.fontSize !== undefined ||\n li.color !== undefined ||\n li.bold !== undefined ||\n li.italic !== undefined ||\n li.underline !== undefined ||\n li.strike !== undefined ||\n li.subscript !== undefined ||\n li.superscript !== undefined ||\n li.highlight !== undefined ||\n li.fontFamily !== undefined ||\n li.runs !== undefined,\n );\n}\n\nexport function renderUlNode(node: UlPositionedNode, ctx: RenderContext): void {\n const fontSizePx = node.fontSize ?? 24;\n const fontFamily = node.fontFamily ?? \"Noto Sans JP\";\n const lineHeight = node.lineHeight ?? 1.3;\n const contentIn = getContentAreaIn(node);\n\n if (hasItemStyleOverride(node.items)) {\n // Li に個別スタイルがある場合は配列形式を使用\n const textItems = buildListTextItems(node.items, node, true);\n\n ctx.slide.addText(textItems, {\n ...contentIn,\n align: node.textAlign ?? \"left\",\n valign: \"top\" as const,\n margin: 0,\n lineSpacingMultiple: lineHeight,\n });\n } else {\n // Li にスタイルオーバーライドがない場合は単一文字列形式を使用\n const text = node.items.map((li) => li.text).join(\"\\n\");\n\n ctx.slide.addText(text, {\n ...contentIn,\n fontSize: pxToPt(fontSizePx),\n fontFace: fontFamily,\n align: node.textAlign ?? \"left\",\n valign: \"top\" as const,\n margin: 0,\n lineSpacingMultiple: lineHeight,\n color: node.color,\n bold: node.bold,\n italic: node.italic,\n underline: convertUnderline(node.underline),\n strike: convertStrike(node.strike),\n subscript: node.subscript,\n superscript: node.superscript,\n highlight: node.highlight,\n bullet: true,\n });\n }\n}\n\nexport function renderOlNode(node: OlPositionedNode, ctx: RenderContext): void {\n const fontSizePx = node.fontSize ?? 24;\n const fontFamily = node.fontFamily ?? \"Noto Sans JP\";\n const lineHeight = node.lineHeight ?? 1.3;\n const contentIn = getContentAreaIn(node);\n\n const bulletOptions: Record<string, unknown> = { type: \"number\" };\n if (node.numberType !== undefined) {\n bulletOptions.numberType = node.numberType;\n }\n if (node.numberStartAt !== undefined) {\n bulletOptions.numberStartAt = node.numberStartAt;\n }\n\n if (hasItemStyleOverride(node.items)) {\n const textItems = buildListTextItems(node.items, node, bulletOptions);\n\n ctx.slide.addText(textItems, {\n ...contentIn,\n align: node.textAlign ?? \"left\",\n valign: \"top\" as const,\n margin: 0,\n lineSpacingMultiple: lineHeight,\n });\n } else {\n const text = node.items.map((li) => li.text).join(\"\\n\");\n\n ctx.slide.addText(text, {\n ...contentIn,\n fontSize: pxToPt(fontSizePx),\n fontFace: fontFamily,\n align: node.textAlign ?? \"left\",\n valign: \"top\" as const,\n margin: 0,\n lineSpacingMultiple: lineHeight,\n color: node.color,\n bold: node.bold,\n italic: node.italic,\n underline: convertUnderline(node.underline),\n strike: convertStrike(node.strike),\n subscript: node.subscript,\n superscript: node.superscript,\n highlight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,MAAM,KAAK;GACX,QAAQ,KAAK;GACb,WAAW,iBAAiB,KAAK,SAAS;GAC1C,QAAQ,cAAc,KAAK,MAAM;GACjC,WAAW,KAAK;GAChB,aAAa,KAAK;GAClB,WAAW,KAAK;GAChB,QAAQ;EACV,CAAC;CACH;AACF"}
|
|
@@ -27,6 +27,8 @@ function renderShapeNode(node, ctx) {
|
|
|
27
27
|
italic: node.italic,
|
|
28
28
|
underline: convertUnderline(node.underline),
|
|
29
29
|
strike: convertStrike(node.strike),
|
|
30
|
+
subscript: node.subscript,
|
|
31
|
+
superscript: node.superscript,
|
|
30
32
|
highlight: node.highlight,
|
|
31
33
|
align: node.textAlign ?? "center",
|
|
32
34
|
valign: "middle",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shape.js","names":[],"sources":["../../../src/renderPptx/nodes/shape.ts"],"sourcesContent":["import type { PositionedNode } from \"../../types.ts\";\nimport type { RenderContext } from \"../types.ts\";\nimport { pxToPt } from \"../units.ts\";\nimport { convertUnderline, convertStrike } from \"../textOptions.ts\";\nimport { getContentAreaIn } from \"../utils/contentArea.ts\";\nimport { convertBorderLine, convertShadow } from \"../utils/visualStyle.ts\";\n\ntype ShapePositionedNode = Extract<PositionedNode, { type: \"shape\" }>;\n\nexport function renderShapeNode(\n node: ShapePositionedNode,\n ctx: RenderContext,\n): void {\n const shapeOptions = {\n ...getContentAreaIn(node),\n fill: node.fill\n ? {\n color: node.fill.color,\n transparency: node.fill.transparency,\n }\n : undefined,\n line: node.line ? convertBorderLine(node.line) : undefined,\n shadow: convertShadow(node.shadow),\n rotate: node.rotate,\n };\n\n if (node.text) {\n const fontSizePx = node.fontSize ?? 24;\n const lineHeight = node.lineHeight ?? 1.3;\n // テキストがある場合:addTextでshapeを指定\n ctx.slide.addText(node.text, {\n ...shapeOptions,\n shape: node.shapeType,\n fontSize: pxToPt(fontSizePx),\n fontFace: node.fontFamily ?? \"Noto Sans JP\",\n color: node.color,\n bold: node.bold,\n italic: node.italic,\n underline: convertUnderline(node.underline),\n strike: convertStrike(node.strike),\n highlight: node.highlight,\n align: node.textAlign ?? \"center\",\n valign: \"middle\" as const,\n // Text と同じく行送りを固定値 (spcPts) で指定し、計測高さ\n // (行数 × fontSize × lineHeight) と実描画の行高さを一致させる (#846)。\n // valign middle のためテキストブロックは枠内中央に配置され、\n // Text のような描画 y 補正は不要\n lineSpacing: pxToPt(fontSizePx * lineHeight),\n });\n } else {\n // テキストがない場合:addShapeを使用\n ctx.slide.addShape(node.shapeType, shapeOptions);\n }\n}\n"],"mappings":";;;;;AASA,SAAgB,gBACd,MACA,KACM;CACN,MAAM,eAAe;EACnB,GAAG,iBAAiB,IAAI;EACxB,MAAM,KAAK,OACP;GACE,OAAO,KAAK,KAAK;GACjB,cAAc,KAAK,KAAK;EAC1B,IACA,KAAA;EACJ,MAAM,KAAK,OAAO,kBAAkB,KAAK,IAAI,IAAI,KAAA;EACjD,QAAQ,cAAc,KAAK,MAAM;EACjC,QAAQ,KAAK;CACf;CAEA,IAAI,KAAK,MAAM;EACb,MAAM,aAAa,KAAK,YAAY;EACpC,MAAM,aAAa,KAAK,cAAc;EAEtC,IAAI,MAAM,QAAQ,KAAK,MAAM;GAC3B,GAAG;GACH,OAAO,KAAK;GACZ,UAAU,OAAO,UAAU;GAC3B,UAAU,KAAK,cAAc;GAC7B,OAAO,KAAK;GACZ,MAAM,KAAK;GACX,QAAQ,KAAK;GACb,WAAW,iBAAiB,KAAK,SAAS;GAC1C,QAAQ,cAAc,KAAK,MAAM;GACjC,WAAW,KAAK;GAChB,OAAO,KAAK,aAAa;GACzB,QAAQ;GAKR,aAAa,OAAO,aAAa,UAAU;EAC7C,CAAC;CACH,OAEE,IAAI,MAAM,SAAS,KAAK,WAAW,YAAY;AAEnD"}
|
|
1
|
+
{"version":3,"file":"shape.js","names":[],"sources":["../../../src/renderPptx/nodes/shape.ts"],"sourcesContent":["import type { PositionedNode } from \"../../types.ts\";\nimport type { RenderContext } from \"../types.ts\";\nimport { pxToPt } from \"../units.ts\";\nimport { convertUnderline, convertStrike } from \"../textOptions.ts\";\nimport { getContentAreaIn } from \"../utils/contentArea.ts\";\nimport { convertBorderLine, convertShadow } from \"../utils/visualStyle.ts\";\n\ntype ShapePositionedNode = Extract<PositionedNode, { type: \"shape\" }>;\n\nexport function renderShapeNode(\n node: ShapePositionedNode,\n ctx: RenderContext,\n): void {\n const shapeOptions = {\n ...getContentAreaIn(node),\n fill: node.fill\n ? {\n color: node.fill.color,\n transparency: node.fill.transparency,\n }\n : undefined,\n line: node.line ? convertBorderLine(node.line) : undefined,\n shadow: convertShadow(node.shadow),\n rotate: node.rotate,\n };\n\n if (node.text) {\n const fontSizePx = node.fontSize ?? 24;\n const lineHeight = node.lineHeight ?? 1.3;\n // テキストがある場合:addTextでshapeを指定\n ctx.slide.addText(node.text, {\n ...shapeOptions,\n shape: node.shapeType,\n fontSize: pxToPt(fontSizePx),\n fontFace: node.fontFamily ?? \"Noto Sans JP\",\n color: node.color,\n bold: node.bold,\n italic: node.italic,\n underline: convertUnderline(node.underline),\n strike: convertStrike(node.strike),\n subscript: node.subscript,\n superscript: node.superscript,\n highlight: node.highlight,\n align: node.textAlign ?? \"center\",\n valign: \"middle\" as const,\n // Text と同じく行送りを固定値 (spcPts) で指定し、計測高さ\n // (行数 × fontSize × lineHeight) と実描画の行高さを一致させる (#846)。\n // valign middle のためテキストブロックは枠内中央に配置され、\n // Text のような描画 y 補正は不要\n lineSpacing: pxToPt(fontSizePx * lineHeight),\n });\n } else {\n // テキストがない場合:addShapeを使用\n ctx.slide.addShape(node.shapeType, shapeOptions);\n }\n}\n"],"mappings":";;;;;AASA,SAAgB,gBACd,MACA,KACM;CACN,MAAM,eAAe;EACnB,GAAG,iBAAiB,IAAI;EACxB,MAAM,KAAK,OACP;GACE,OAAO,KAAK,KAAK;GACjB,cAAc,KAAK,KAAK;EAC1B,IACA,KAAA;EACJ,MAAM,KAAK,OAAO,kBAAkB,KAAK,IAAI,IAAI,KAAA;EACjD,QAAQ,cAAc,KAAK,MAAM;EACjC,QAAQ,KAAK;CACf;CAEA,IAAI,KAAK,MAAM;EACb,MAAM,aAAa,KAAK,YAAY;EACpC,MAAM,aAAa,KAAK,cAAc;EAEtC,IAAI,MAAM,QAAQ,KAAK,MAAM;GAC3B,GAAG;GACH,OAAO,KAAK;GACZ,UAAU,OAAO,UAAU;GAC3B,UAAU,KAAK,cAAc;GAC7B,OAAO,KAAK;GACZ,MAAM,KAAK;GACX,QAAQ,KAAK;GACb,WAAW,iBAAiB,KAAK,SAAS;GAC1C,QAAQ,cAAc,KAAK,MAAM;GACjC,WAAW,KAAK;GAChB,aAAa,KAAK;GAClB,WAAW,KAAK;GAChB,OAAO,KAAK,aAAa;GACzB,QAAQ;GAKR,aAAa,OAAO,aAAa,UAAU;EAC7C,CAAC;CACH,OAEE,IAAI,MAAM,SAAS,KAAK,WAAW,YAAY;AAEnD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { pxToIn, pxToPt, rectPxToIn } from "../units.js";
|
|
2
2
|
import { getContentArea } from "../utils/contentArea.js";
|
|
3
|
-
import { convertStrike, convertUnderline } from "../textOptions.js";
|
|
3
|
+
import { convertStrike, convertUnderline, resolveSubSup } from "../textOptions.js";
|
|
4
4
|
import { resolveColumnWidths, resolveRowHeights } from "../../shared/tableUtils.js";
|
|
5
5
|
//#region src/renderPptx/nodes/table.ts
|
|
6
6
|
function renderTableNode(node, ctx) {
|
|
@@ -14,6 +14,8 @@ function renderTableNode(node, ctx) {
|
|
|
14
14
|
italic: cell.italic,
|
|
15
15
|
underline: convertUnderline(cell.underline),
|
|
16
16
|
strike: convertStrike(cell.strike),
|
|
17
|
+
subscript: cell.subscript,
|
|
18
|
+
superscript: cell.superscript,
|
|
17
19
|
highlight: cell.highlight,
|
|
18
20
|
align: cell.textAlign ?? "left",
|
|
19
21
|
fill: cell.backgroundColor ? { color: cell.backgroundColor } : void 0,
|
|
@@ -21,20 +23,25 @@ function renderTableNode(node, ctx) {
|
|
|
21
23
|
rowspan: cell.rowspan
|
|
22
24
|
};
|
|
23
25
|
if (cell.runs && cell.runs.length > 0) return {
|
|
24
|
-
text: cell.runs.map((run) =>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
text: cell.runs.map((run) => {
|
|
27
|
+
const runSubSup = resolveSubSup(run, cell);
|
|
28
|
+
return {
|
|
29
|
+
text: run.text,
|
|
30
|
+
options: {
|
|
31
|
+
fontSize: pxToPt(run.fontSize ?? cell.fontSize ?? 18),
|
|
32
|
+
fontFace: run.fontFamily ?? cellFontFace,
|
|
33
|
+
color: run.color ?? cell.color,
|
|
34
|
+
bold: run.bold ?? cell.bold,
|
|
35
|
+
italic: run.italic ?? cell.italic,
|
|
36
|
+
underline: convertUnderline(run.underline ?? cell.underline),
|
|
37
|
+
strike: convertStrike(run.strike ?? cell.strike),
|
|
38
|
+
subscript: runSubSup.subscript,
|
|
39
|
+
superscript: runSubSup.superscript,
|
|
40
|
+
highlight: run.highlight ?? cell.highlight,
|
|
41
|
+
...run.href ? { hyperlink: { url: run.href } } : {}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}),
|
|
38
45
|
options: {
|
|
39
46
|
align: cell.textAlign ?? "left",
|
|
40
47
|
fill: cell.backgroundColor ? { color: cell.backgroundColor } : void 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.js","names":[],"sources":["../../../src/renderPptx/nodes/table.ts"],"sourcesContent":["import type { PositionedNode } from \"../../types.ts\";\nimport type { RenderContext } from \"../types.ts\";\nimport {\n resolveColumnWidths,\n resolveRowHeights,\n} from \"../../shared/tableUtils.ts\";\nimport { pxToIn, pxToPt, rectPxToIn } from \"../units.ts\";\nimport {
|
|
1
|
+
{"version":3,"file":"table.js","names":[],"sources":["../../../src/renderPptx/nodes/table.ts"],"sourcesContent":["import type { PositionedNode } from \"../../types.ts\";\nimport type { RenderContext } from \"../types.ts\";\nimport {\n resolveColumnWidths,\n resolveRowHeights,\n} from \"../../shared/tableUtils.ts\";\nimport { pxToIn, pxToPt, rectPxToIn } from \"../units.ts\";\nimport {\n convertUnderline,\n convertStrike,\n resolveSubSup,\n} from \"../textOptions.ts\";\nimport { getContentArea } from \"../utils/contentArea.ts\";\n\ntype TablePositionedNode = Extract<PositionedNode, { type: \"table\" }>;\n\nexport function renderTableNode(\n node: TablePositionedNode,\n ctx: RenderContext,\n): void {\n const tableRows = node.rows.map((row) =>\n row.cells.map((cell) => {\n const cellFontFace = cell.fontFamily;\n const cellOptions: Record<string, unknown> = {\n fontSize: pxToPt(cell.fontSize ?? 18),\n fontFace: cellFontFace,\n color: cell.color,\n bold: cell.bold,\n italic: cell.italic,\n underline: convertUnderline(cell.underline),\n strike: convertStrike(cell.strike),\n subscript: cell.subscript,\n superscript: cell.superscript,\n highlight: cell.highlight,\n align: cell.textAlign ?? \"left\",\n fill: cell.backgroundColor\n ? { color: cell.backgroundColor }\n : undefined,\n colspan: cell.colspan,\n rowspan: cell.rowspan,\n };\n\n if (cell.runs && cell.runs.length > 0) {\n const textItems = cell.runs.map((run) => {\n const runSubSup = resolveSubSup(run, cell);\n return {\n text: run.text,\n options: {\n fontSize: pxToPt(run.fontSize ?? cell.fontSize ?? 18),\n fontFace: run.fontFamily ?? cellFontFace,\n color: run.color ?? cell.color,\n bold: run.bold ?? cell.bold,\n italic: run.italic ?? cell.italic,\n underline: convertUnderline(run.underline ?? cell.underline),\n strike: convertStrike(run.strike ?? cell.strike),\n subscript: runSubSup.subscript,\n superscript: runSubSup.superscript,\n highlight: run.highlight ?? cell.highlight,\n ...(run.href ? { hyperlink: { url: run.href } } : {}),\n },\n };\n });\n return {\n text: textItems,\n options: {\n align: cell.textAlign ?? \"left\",\n fill: cell.backgroundColor\n ? { color: cell.backgroundColor }\n : undefined,\n colspan: cell.colspan,\n rowspan: cell.rowspan,\n },\n };\n }\n\n return {\n text: cell.text,\n options: cellOptions,\n };\n }),\n );\n\n const content = getContentArea(node);\n const tableOptions: Record<string, unknown> = {\n ...rectPxToIn(content),\n colW: resolveColumnWidths(node, content.w).map((width) => pxToIn(width)),\n rowH: resolveRowHeights(node).map((height) => pxToIn(height)),\n margin: 0,\n };\n\n if (node.cellBorder) {\n tableOptions.border = {\n color: node.cellBorder.color ?? \"000000\",\n pt:\n node.cellBorder.width !== undefined ? pxToPt(node.cellBorder.width) : 1,\n type: node.cellBorder.dashType ?? \"solid\",\n };\n }\n\n ctx.slide.addTable(tableRows, tableOptions);\n}\n"],"mappings":";;;;;AAgBA,SAAgB,gBACd,MACA,KACM;CACN,MAAM,YAAY,KAAK,KAAK,KAAK,QAC/B,IAAI,MAAM,KAAK,SAAS;EACtB,MAAM,eAAe,KAAK;EAC1B,MAAM,cAAuC;GAC3C,UAAU,OAAO,KAAK,YAAY,EAAE;GACpC,UAAU;GACV,OAAO,KAAK;GACZ,MAAM,KAAK;GACX,QAAQ,KAAK;GACb,WAAW,iBAAiB,KAAK,SAAS;GAC1C,QAAQ,cAAc,KAAK,MAAM;GACjC,WAAW,KAAK;GAChB,aAAa,KAAK;GAClB,WAAW,KAAK;GAChB,OAAO,KAAK,aAAa;GACzB,MAAM,KAAK,kBACP,EAAE,OAAO,KAAK,gBAAgB,IAC9B,KAAA;GACJ,SAAS,KAAK;GACd,SAAS,KAAK;EAChB;EAEA,IAAI,KAAK,QAAQ,KAAK,KAAK,SAAS,GAoBlC,OAAO;GACL,MApBgB,KAAK,KAAK,KAAK,QAAQ;IACvC,MAAM,YAAY,cAAc,KAAK,IAAI;IACzC,OAAO;KACL,MAAM,IAAI;KACV,SAAS;MACP,UAAU,OAAO,IAAI,YAAY,KAAK,YAAY,EAAE;MACpD,UAAU,IAAI,cAAc;MAC5B,OAAO,IAAI,SAAS,KAAK;MACzB,MAAM,IAAI,QAAQ,KAAK;MACvB,QAAQ,IAAI,UAAU,KAAK;MAC3B,WAAW,iBAAiB,IAAI,aAAa,KAAK,SAAS;MAC3D,QAAQ,cAAc,IAAI,UAAU,KAAK,MAAM;MAC/C,WAAW,UAAU;MACrB,aAAa,UAAU;MACvB,WAAW,IAAI,aAAa,KAAK;MACjC,GAAI,IAAI,OAAO,EAAE,WAAW,EAAE,KAAK,IAAI,KAAK,EAAE,IAAI,CAAC;KACrD;IACF;GACF,CAEgB;GACd,SAAS;IACP,OAAO,KAAK,aAAa;IACzB,MAAM,KAAK,kBACP,EAAE,OAAO,KAAK,gBAAgB,IAC9B,KAAA;IACJ,SAAS,KAAK;IACd,SAAS,KAAK;GAChB;EACF;EAGF,OAAO;GACL,MAAM,KAAK;GACX,SAAS;EACX;CACF,CAAC,CACH;CAEA,MAAM,UAAU,eAAe,IAAI;CACnC,MAAM,eAAwC;EAC5C,GAAG,WAAW,OAAO;EACrB,MAAM,oBAAoB,MAAM,QAAQ,CAAC,CAAC,CAAC,KAAK,UAAU,OAAO,KAAK,CAAC;EACvE,MAAM,kBAAkB,IAAI,CAAC,CAAC,KAAK,WAAW,OAAO,MAAM,CAAC;EAC5D,QAAQ;CACV;CAEA,IAAI,KAAK,YACP,aAAa,SAAS;EACpB,OAAO,KAAK,WAAW,SAAS;EAChC,IACE,KAAK,WAAW,UAAU,KAAA,IAAY,OAAO,KAAK,WAAW,KAAK,IAAI;EACxE,MAAM,KAAK,WAAW,YAAY;CACpC;CAGF,IAAI,MAAM,SAAS,WAAW,YAAY;AAC5C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { pxToPt } from "../units.js";
|
|
2
|
-
import { convertGlow, convertOutline, convertStrike, convertUnderline, createTextOptions } from "../textOptions.js";
|
|
2
|
+
import { convertGlow, convertOutline, convertStrike, convertUnderline, createTextOptions, resolveSubSup } from "../textOptions.js";
|
|
3
3
|
//#region src/renderPptx/nodes/text.ts
|
|
4
4
|
function renderTextNode(node, ctx) {
|
|
5
5
|
const textOptions = createTextOptions(node);
|
|
@@ -8,16 +8,20 @@ function renderTextNode(node, ctx) {
|
|
|
8
8
|
const fontFamily = node.fontFamily ?? "Noto Sans JP";
|
|
9
9
|
const textItems = node.runs.map((run) => {
|
|
10
10
|
const letterSpacingPx = run.letterSpacing ?? node.letterSpacing;
|
|
11
|
+
const runFontSizePx = run.fontSize ?? fontSizePx;
|
|
12
|
+
const subSup = resolveSubSup(run, node);
|
|
11
13
|
return {
|
|
12
14
|
text: run.text,
|
|
13
15
|
options: {
|
|
14
|
-
fontSize: pxToPt(
|
|
16
|
+
fontSize: pxToPt(runFontSizePx),
|
|
15
17
|
fontFace: run.fontFamily ?? fontFamily,
|
|
16
18
|
color: run.color ?? node.color,
|
|
17
19
|
bold: run.bold ?? node.bold,
|
|
18
20
|
italic: run.italic ?? node.italic,
|
|
19
21
|
underline: convertUnderline(run.underline ?? node.underline),
|
|
20
22
|
strike: convertStrike(run.strike ?? node.strike),
|
|
23
|
+
subscript: subSup.subscript,
|
|
24
|
+
superscript: subSup.superscript,
|
|
21
25
|
highlight: run.highlight ?? node.highlight,
|
|
22
26
|
glow: convertGlow(node.glow),
|
|
23
27
|
outline: convertOutline(node.outline),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","names":[],"sources":["../../../src/renderPptx/nodes/text.ts"],"sourcesContent":["import type { PositionedNode } from \"../../types.ts\";\nimport type { RenderContext } from \"../types.ts\";\nimport {\n createTextOptions,\n convertUnderline,\n convertStrike,\n convertGlow,\n convertOutline,\n} from \"../textOptions.ts\";\nimport { pxToPt } from \"../units.ts\";\n\ntype TextPositionedNode = Extract<PositionedNode, { type: \"text\" }>;\n\nexport function renderTextNode(\n node: TextPositionedNode,\n ctx: RenderContext,\n): void {\n const textOptions = createTextOptions(node);\n\n if (node.runs && node.runs.length > 0) {\n const fontSizePx = node.fontSize ?? 24;\n const fontFamily = node.fontFamily ?? \"Noto Sans JP\";\n const textItems = node.runs.map((run) => {\n const letterSpacingPx = run.letterSpacing ?? node.letterSpacing;\n return {\n text: run.text,\n options: {\n fontSize: pxToPt(
|
|
1
|
+
{"version":3,"file":"text.js","names":[],"sources":["../../../src/renderPptx/nodes/text.ts"],"sourcesContent":["import type { PositionedNode } from \"../../types.ts\";\nimport type { RenderContext } from \"../types.ts\";\nimport {\n createTextOptions,\n convertUnderline,\n convertStrike,\n convertGlow,\n convertOutline,\n resolveSubSup,\n} from \"../textOptions.ts\";\nimport { pxToPt } from \"../units.ts\";\n\ntype TextPositionedNode = Extract<PositionedNode, { type: \"text\" }>;\n\nexport function renderTextNode(\n node: TextPositionedNode,\n ctx: RenderContext,\n): void {\n const textOptions = createTextOptions(node);\n\n if (node.runs && node.runs.length > 0) {\n const fontSizePx = node.fontSize ?? 24;\n const fontFamily = node.fontFamily ?? \"Noto Sans JP\";\n const textItems = node.runs.map((run) => {\n const letterSpacingPx = run.letterSpacing ?? node.letterSpacing;\n const runFontSizePx = run.fontSize ?? fontSizePx;\n const subSup = resolveSubSup(run, node);\n return {\n text: run.text,\n options: {\n fontSize: pxToPt(runFontSizePx),\n fontFace: run.fontFamily ?? fontFamily,\n color: run.color ?? node.color,\n bold: run.bold ?? node.bold,\n italic: run.italic ?? node.italic,\n underline: convertUnderline(run.underline ?? node.underline),\n strike: convertStrike(run.strike ?? node.strike),\n subscript: subSup.subscript,\n superscript: subSup.superscript,\n highlight: run.highlight ?? node.highlight,\n // glow / outline はノード単位指定のみ (run 単位はスコープ外)\n glow: convertGlow(node.glow),\n outline: convertOutline(node.outline),\n charSpacing:\n letterSpacingPx !== undefined ? pxToPt(letterSpacingPx) : undefined,\n ...(run.href ? { hyperlink: { url: run.href } } : {}),\n },\n };\n });\n ctx.slide.addText(textItems, {\n x: textOptions.x,\n y: textOptions.y,\n w: textOptions.w,\n h: textOptions.h,\n rotate: textOptions.rotate,\n align: textOptions.align,\n valign: textOptions.valign,\n margin: textOptions.margin,\n lineSpacing: textOptions.lineSpacing,\n });\n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convertStrike(strike) {
|
|
|
21
21
|
if (strike) return "sngStrike";
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
+
* run と親 (node / cell / li) の subscript / superscript を相互排他に解決する。
|
|
25
|
+
* OOXML の baseline 値で表現される性質上、両方 true は意味を持たないため、
|
|
26
|
+
* run 側で sub/sup のいずれかが指定された場合は親の指定をまるごと無効化する
|
|
27
|
+
* (片方だけ指定して反対側を親から漏らさない)。
|
|
28
|
+
*/
|
|
29
|
+
function resolveSubSup(run, parent) {
|
|
30
|
+
if (run.subscript !== void 0 || run.superscript !== void 0) return {
|
|
31
|
+
subscript: run.subscript,
|
|
32
|
+
superscript: run.superscript
|
|
33
|
+
};
|
|
34
|
+
return {
|
|
35
|
+
subscript: parent.subscript,
|
|
36
|
+
superscript: parent.superscript
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
24
40
|
* glow プロパティを pptxgenjs 形式に変換する
|
|
25
41
|
* size はユーザー入力 px、pptxgenjs の glow.size は pt。
|
|
26
42
|
* pptxgenjs は省略時デフォルトを Object.assign で合成するため undefined を
|
|
@@ -81,6 +97,8 @@ function createTextOptions(node) {
|
|
|
81
97
|
italic: node.italic,
|
|
82
98
|
underline: convertUnderline(node.underline),
|
|
83
99
|
strike: convertStrike(node.strike),
|
|
100
|
+
subscript: node.subscript,
|
|
101
|
+
superscript: node.superscript,
|
|
84
102
|
highlight: node.highlight,
|
|
85
103
|
glow: convertGlow(node.glow),
|
|
86
104
|
outline: convertOutline(node.outline),
|
|
@@ -88,6 +106,6 @@ function createTextOptions(node) {
|
|
|
88
106
|
};
|
|
89
107
|
}
|
|
90
108
|
//#endregion
|
|
91
|
-
export { convertGlow, convertOutline, convertStrike, convertUnderline, createTextOptions };
|
|
109
|
+
export { convertGlow, convertOutline, convertStrike, convertUnderline, createTextOptions, resolveSubSup };
|
|
92
110
|
|
|
93
111
|
//# sourceMappingURL=textOptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textOptions.js","names":[],"sources":["../../src/renderPptx/textOptions.ts"],"sourcesContent":["import type {\n PositionedNode,\n TextGlow,\n TextOutline,\n Underline,\n UnderlineStyle,\n} from \"../types.ts\";\nimport { pxToIn, pxToPt } from \"./units.ts\";\nimport { getContentAreaIn } from \"./utils/contentArea.ts\";\nimport { measureFontVerticalMetricsRatio } from \"../calcYogaLayout/fontLoader.ts\";\n\ntype TextNode = Extract<PositionedNode, { type: \"text\" }>;\n\n/**\n * underline プロパティを pptxgenjs 形式に変換する\n */\nexport function convertUnderline(\n underline: Underline | undefined,\n): { style?: UnderlineStyle; color?: string } | undefined {\n if (underline === undefined) return undefined;\n if (underline === false) return undefined;\n if (underline === true) return { style: \"sng\" };\n return {\n style: underline.style,\n color: underline.color,\n };\n}\n\n/**\n * strike プロパティを pptxgenjs 形式に変換する\n */\nexport function convertStrike(\n strike: boolean | undefined,\n): \"sngStrike\" | undefined {\n if (strike) return \"sngStrike\";\n return undefined;\n}\n\n/**\n * glow プロパティを pptxgenjs 形式に変換する\n * size はユーザー入力 px、pptxgenjs の glow.size は pt。\n * pptxgenjs は省略時デフォルトを Object.assign で合成するため undefined を\n * 渡すとデフォルトが消える。ここで pom 側のデフォルトを確定させる。\n */\nexport function convertGlow(\n glow: TextGlow | undefined,\n): { size: number; opacity: number; color: string } | undefined {\n if (glow === undefined) return undefined;\n return {\n size: pxToPt(glow.size ?? 8),\n opacity: glow.opacity ?? 0.75,\n color: glow.color ?? \"FFFFFF\",\n };\n}\n\n/**\n * outline プロパティを pptxgenjs 形式に変換する\n * size はユーザー入力 px、pptxgenjs の outline.size は pt\n */\nexport function convertOutline(\n outline: TextOutline | undefined,\n): { size: number; color: string } | undefined {\n if (outline === undefined) return undefined;\n return {\n size: pxToPt(outline.size ?? 1),\n color: outline.color ?? \"FFFFFF\",\n };\n}\n\n/**\n * 行内でグリフ ink が上下中央に来るようにするための描画 y 補正量 (px)\n *\n * レンダラ (LibreOffice / PowerPoint) は固定行送り (spcPts) のとき\n * baseline を「行下端 − winDescent × fontSize」に置くため、グリフ ink\n * (typoAscender + typoDescender) は行内で下寄りになり、同じ gap でも\n * テキスト上側の視覚余白が広く下側が狭く見える (#846)。\n * baseline の実位置と「ink を行内中央に置いたときの baseline 位置」の\n * 差分を返し、呼び出し側でテキストフレームをその分だけ上へずらす。\n */\nexport function calcGlyphCenteringShiftPx(\n fontSizePx: number,\n lineHeight: number,\n fontWeight: \"normal\" | \"bold\",\n): number {\n const lineHeightPx = fontSizePx * lineHeight;\n const metrics = measureFontVerticalMetricsRatio(fontWeight);\n const baselineFromTopPx = lineHeightPx - metrics.winDescent * fontSizePx;\n const inkHeightPx =\n (metrics.typoAscender + metrics.typoDescender) * fontSizePx;\n const centeredBaselineFromTopPx =\n (lineHeightPx - inkHeightPx) / 2 + metrics.typoAscender * fontSizePx;\n return baselineFromTopPx - centeredBaselineFromTopPx;\n}\n\nexport function createTextOptions(node: TextNode) {\n const fontSizePx = node.fontSize ?? 24;\n const fontFamily = node.fontFamily ?? \"Noto Sans JP\";\n const lineHeight = node.lineHeight ?? 1.3;\n\n const area = getContentAreaIn(node);\n const glyphShiftPx = calcGlyphCenteringShiftPx(\n fontSizePx,\n lineHeight,\n node.bold ? \"bold\" : \"normal\",\n );\n\n return {\n ...area,\n y: area.y - pxToIn(glyphShiftPx),\n fontSize: pxToPt(fontSizePx),\n fontFace: fontFamily,\n align: node.textAlign ?? \"left\",\n valign: \"top\" as const,\n margin: 0,\n // 行送りを固定値 (spcPts) で指定する。倍率指定 (spcPct) はレンダラがフォント\n // メトリクスに対する倍率として解釈するため、計測高さ (行数 × fontSize ×\n // lineHeight) と実描画の行高さが一致せず、グリフがボックスからはみ出して\n // 上下余白が非対称になる (#846)\n lineSpacing: pxToPt(fontSizePx * lineHeight),\n rotate: node.rotate,\n color: node.color,\n bold: node.bold,\n italic: node.italic,\n underline: convertUnderline(node.underline),\n strike: convertStrike(node.strike),\n highlight: node.highlight,\n glow: convertGlow(node.glow),\n outline: convertOutline(node.outline),\n // letterSpacing はユーザー入力 px、pptxgenjs の charSpacing は pt\n charSpacing:\n node.letterSpacing !== undefined ? pxToPt(node.letterSpacing) : undefined,\n };\n}\n"],"mappings":";;;;;;;AAgBA,SAAgB,iBACd,WACwD;CACxD,IAAI,cAAc,KAAA,GAAW,OAAO,KAAA;CACpC,IAAI,cAAc,OAAO,OAAO,KAAA;CAChC,IAAI,cAAc,MAAM,OAAO,EAAE,OAAO,MAAM;CAC9C,OAAO;EACL,OAAO,UAAU;EACjB,OAAO,UAAU;CACnB;AACF;;;;AAKA,SAAgB,cACd,QACyB;CACzB,IAAI,QAAQ,OAAO;AAErB;;;;;;;AAQA,SAAgB,YACd,MAC8D;CAC9D,IAAI,SAAS,KAAA,GAAW,OAAO,KAAA;CAC/B,OAAO;EACL,MAAM,OAAO,KAAK,QAAQ,CAAC;EAC3B,SAAS,KAAK,WAAW;EACzB,OAAO,KAAK,SAAS;CACvB;AACF;;;;;AAMA,SAAgB,eACd,SAC6C;CAC7C,IAAI,YAAY,KAAA,GAAW,OAAO,KAAA;CAClC,OAAO;EACL,MAAM,OAAO,QAAQ,QAAQ,CAAC;EAC9B,OAAO,QAAQ,SAAS;CAC1B;AACF;;;;;;;;;;;AAYA,SAAgB,0BACd,YACA,YACA,YACQ;CACR,MAAM,eAAe,aAAa;CAClC,MAAM,UAAU,gCAAgC,UAAU;CAM1D,OAL0B,eAAe,QAAQ,aAAa,eAI3D,gBAFA,QAAQ,eAAe,QAAQ,iBAAiB,cAElB,IAAI,QAAQ,eAAe;AAE9D;AAEA,SAAgB,kBAAkB,MAAgB;CAChD,MAAM,aAAa,KAAK,YAAY;CACpC,MAAM,aAAa,KAAK,cAAc;CACtC,MAAM,aAAa,KAAK,cAAc;CAEtC,MAAM,OAAO,iBAAiB,IAAI;CAClC,MAAM,eAAe,0BACnB,YACA,YACA,KAAK,OAAO,SAAS,QACvB;CAEA,OAAO;EACL,GAAG;EACH,GAAG,KAAK,IAAI,OAAO,YAAY;EAC/B,UAAU,OAAO,UAAU;EAC3B,UAAU;EACV,OAAO,KAAK,aAAa;EACzB,QAAQ;EACR,QAAQ;EAKR,aAAa,OAAO,aAAa,UAAU;EAC3C,QAAQ,KAAK;EACb,OAAO,KAAK;EACZ,MAAM,KAAK;EACX,QAAQ,KAAK;EACb,WAAW,iBAAiB,KAAK,SAAS;EAC1C,QAAQ,cAAc,KAAK,MAAM;EACjC,WAAW,KAAK;EAChB,MAAM,YAAY,KAAK,IAAI;EAC3B,SAAS,eAAe,KAAK,OAAO;EAEpC,aACE,KAAK,kBAAkB,KAAA,IAAY,OAAO,KAAK,aAAa,IAAI,KAAA;CACpE;AACF"}
|
|
1
|
+
{"version":3,"file":"textOptions.js","names":[],"sources":["../../src/renderPptx/textOptions.ts"],"sourcesContent":["import type {\n PositionedNode,\n TextGlow,\n TextOutline,\n Underline,\n UnderlineStyle,\n} from \"../types.ts\";\nimport { pxToIn, pxToPt } from \"./units.ts\";\nimport { getContentAreaIn } from \"./utils/contentArea.ts\";\nimport { measureFontVerticalMetricsRatio } from \"../calcYogaLayout/fontLoader.ts\";\n\ntype TextNode = Extract<PositionedNode, { type: \"text\" }>;\n\n/**\n * underline プロパティを pptxgenjs 形式に変換する\n */\nexport function convertUnderline(\n underline: Underline | undefined,\n): { style?: UnderlineStyle; color?: string } | undefined {\n if (underline === undefined) return undefined;\n if (underline === false) return undefined;\n if (underline === true) return { style: \"sng\" };\n return {\n style: underline.style,\n color: underline.color,\n };\n}\n\n/**\n * strike プロパティを pptxgenjs 形式に変換する\n */\nexport function convertStrike(\n strike: boolean | undefined,\n): \"sngStrike\" | undefined {\n if (strike) return \"sngStrike\";\n return undefined;\n}\n\n/**\n * run と親 (node / cell / li) の subscript / superscript を相互排他に解決する。\n * OOXML の baseline 値で表現される性質上、両方 true は意味を持たないため、\n * run 側で sub/sup のいずれかが指定された場合は親の指定をまるごと無効化する\n * (片方だけ指定して反対側を親から漏らさない)。\n */\nexport function resolveSubSup(\n run: { subscript?: boolean; superscript?: boolean },\n parent: { subscript?: boolean; superscript?: boolean },\n): { subscript: boolean | undefined; superscript: boolean | undefined } {\n if (run.subscript !== undefined || run.superscript !== undefined) {\n return { subscript: run.subscript, superscript: run.superscript };\n }\n return { subscript: parent.subscript, superscript: parent.superscript };\n}\n\n/**\n * glow プロパティを pptxgenjs 形式に変換する\n * size はユーザー入力 px、pptxgenjs の glow.size は pt。\n * pptxgenjs は省略時デフォルトを Object.assign で合成するため undefined を\n * 渡すとデフォルトが消える。ここで pom 側のデフォルトを確定させる。\n */\nexport function convertGlow(\n glow: TextGlow | undefined,\n): { size: number; opacity: number; color: string } | undefined {\n if (glow === undefined) return undefined;\n return {\n size: pxToPt(glow.size ?? 8),\n opacity: glow.opacity ?? 0.75,\n color: glow.color ?? \"FFFFFF\",\n };\n}\n\n/**\n * outline プロパティを pptxgenjs 形式に変換する\n * size はユーザー入力 px、pptxgenjs の outline.size は pt\n */\nexport function convertOutline(\n outline: TextOutline | undefined,\n): { size: number; color: string } | undefined {\n if (outline === undefined) return undefined;\n return {\n size: pxToPt(outline.size ?? 1),\n color: outline.color ?? \"FFFFFF\",\n };\n}\n\n/**\n * 行内でグリフ ink が上下中央に来るようにするための描画 y 補正量 (px)\n *\n * レンダラ (LibreOffice / PowerPoint) は固定行送り (spcPts) のとき\n * baseline を「行下端 − winDescent × fontSize」に置くため、グリフ ink\n * (typoAscender + typoDescender) は行内で下寄りになり、同じ gap でも\n * テキスト上側の視覚余白が広く下側が狭く見える (#846)。\n * baseline の実位置と「ink を行内中央に置いたときの baseline 位置」の\n * 差分を返し、呼び出し側でテキストフレームをその分だけ上へずらす。\n */\nexport function calcGlyphCenteringShiftPx(\n fontSizePx: number,\n lineHeight: number,\n fontWeight: \"normal\" | \"bold\",\n): number {\n const lineHeightPx = fontSizePx * lineHeight;\n const metrics = measureFontVerticalMetricsRatio(fontWeight);\n const baselineFromTopPx = lineHeightPx - metrics.winDescent * fontSizePx;\n const inkHeightPx =\n (metrics.typoAscender + metrics.typoDescender) * fontSizePx;\n const centeredBaselineFromTopPx =\n (lineHeightPx - inkHeightPx) / 2 + metrics.typoAscender * fontSizePx;\n return baselineFromTopPx - centeredBaselineFromTopPx;\n}\n\nexport function createTextOptions(node: TextNode) {\n const fontSizePx = node.fontSize ?? 24;\n const fontFamily = node.fontFamily ?? \"Noto Sans JP\";\n const lineHeight = node.lineHeight ?? 1.3;\n\n const area = getContentAreaIn(node);\n const glyphShiftPx = calcGlyphCenteringShiftPx(\n fontSizePx,\n lineHeight,\n node.bold ? \"bold\" : \"normal\",\n );\n\n return {\n ...area,\n y: area.y - pxToIn(glyphShiftPx),\n fontSize: pxToPt(fontSizePx),\n fontFace: fontFamily,\n align: node.textAlign ?? \"left\",\n valign: \"top\" as const,\n margin: 0,\n // 行送りを固定値 (spcPts) で指定する。倍率指定 (spcPct) はレンダラがフォント\n // メトリクスに対する倍率として解釈するため、計測高さ (行数 × fontSize ×\n // lineHeight) と実描画の行高さが一致せず、グリフがボックスからはみ出して\n // 上下余白が非対称になる (#846)\n lineSpacing: pxToPt(fontSizePx * lineHeight),\n rotate: node.rotate,\n color: node.color,\n bold: node.bold,\n italic: node.italic,\n underline: convertUnderline(node.underline),\n strike: convertStrike(node.strike),\n subscript: node.subscript,\n superscript: node.superscript,\n highlight: node.highlight,\n glow: convertGlow(node.glow),\n outline: convertOutline(node.outline),\n // letterSpacing はユーザー入力 px、pptxgenjs の charSpacing は pt\n charSpacing:\n node.letterSpacing !== undefined ? pxToPt(node.letterSpacing) : undefined,\n };\n}\n"],"mappings":";;;;;;;AAgBA,SAAgB,iBACd,WACwD;CACxD,IAAI,cAAc,KAAA,GAAW,OAAO,KAAA;CACpC,IAAI,cAAc,OAAO,OAAO,KAAA;CAChC,IAAI,cAAc,MAAM,OAAO,EAAE,OAAO,MAAM;CAC9C,OAAO;EACL,OAAO,UAAU;EACjB,OAAO,UAAU;CACnB;AACF;;;;AAKA,SAAgB,cACd,QACyB;CACzB,IAAI,Q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AQ,KAAK;EACb,WAAW,iBAAiB,KAAK,SAAS;EAC1C,QAAQ,cAAc,KAAK,MAAM;EACjC,WAAW,KAAK;EAChB,aAAa,KAAK;EAClB,WAAW,KAAK;EAChB,MAAM,YAAY,KAAK,IAAI;EAC3B,SAAS,eAAe,KAAK,OAAO;EAEpC,aACE,KAAK,kBAAkB,KAAA,IAAY,OAAO,KAAK,aAAa,IAAI,KAAA;CACpE;AACF"}
|
package/dist/types.d.ts
CHANGED
|
@@ -291,10 +291,13 @@ declare const textNodeSchema: z.ZodObject<{
|
|
|
291
291
|
italic: z.ZodOptional<z.ZodBoolean>;
|
|
292
292
|
underline: z.ZodOptional<z.ZodBoolean>;
|
|
293
293
|
strike: z.ZodOptional<z.ZodBoolean>;
|
|
294
|
+
subscript: z.ZodOptional<z.ZodBoolean>;
|
|
295
|
+
superscript: z.ZodOptional<z.ZodBoolean>;
|
|
294
296
|
highlight: z.ZodOptional<z.ZodString>;
|
|
295
297
|
color: z.ZodOptional<z.ZodString>;
|
|
296
298
|
href: z.ZodOptional<z.ZodString>;
|
|
297
299
|
fontFamily: z.ZodOptional<z.ZodString>;
|
|
300
|
+
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
298
301
|
letterSpacing: z.ZodOptional<z.ZodNumber>;
|
|
299
302
|
}, z.core.$strip>>>;
|
|
300
303
|
rotate: z.ZodOptional<z.ZodNumber>;
|
|
@@ -328,6 +331,8 @@ declare const textNodeSchema: z.ZodObject<{
|
|
|
328
331
|
color: z.ZodOptional<z.ZodString>;
|
|
329
332
|
}, z.core.$strip>]>>;
|
|
330
333
|
strike: z.ZodOptional<z.ZodBoolean>;
|
|
334
|
+
subscript: z.ZodOptional<z.ZodBoolean>;
|
|
335
|
+
superscript: z.ZodOptional<z.ZodBoolean>;
|
|
331
336
|
highlight: z.ZodOptional<z.ZodString>;
|
|
332
337
|
fontFamily: z.ZodOptional<z.ZodString>;
|
|
333
338
|
lineHeight: z.ZodOptional<z.ZodNumber>;
|
|
@@ -480,10 +485,13 @@ declare const ulNodeSchema: z.ZodObject<{
|
|
|
480
485
|
italic: z.ZodOptional<z.ZodBoolean>;
|
|
481
486
|
underline: z.ZodOptional<z.ZodBoolean>;
|
|
482
487
|
strike: z.ZodOptional<z.ZodBoolean>;
|
|
488
|
+
subscript: z.ZodOptional<z.ZodBoolean>;
|
|
489
|
+
superscript: z.ZodOptional<z.ZodBoolean>;
|
|
483
490
|
highlight: z.ZodOptional<z.ZodString>;
|
|
484
491
|
color: z.ZodOptional<z.ZodString>;
|
|
485
492
|
href: z.ZodOptional<z.ZodString>;
|
|
486
493
|
fontFamily: z.ZodOptional<z.ZodString>;
|
|
494
|
+
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
487
495
|
letterSpacing: z.ZodOptional<z.ZodNumber>;
|
|
488
496
|
}, z.core.$strip>>>;
|
|
489
497
|
bold: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -509,6 +517,8 @@ declare const ulNodeSchema: z.ZodObject<{
|
|
|
509
517
|
color: z.ZodOptional<z.ZodString>;
|
|
510
518
|
}, z.core.$strip>]>>;
|
|
511
519
|
strike: z.ZodOptional<z.ZodBoolean>;
|
|
520
|
+
subscript: z.ZodOptional<z.ZodBoolean>;
|
|
521
|
+
superscript: z.ZodOptional<z.ZodBoolean>;
|
|
512
522
|
highlight: z.ZodOptional<z.ZodString>;
|
|
513
523
|
color: z.ZodOptional<z.ZodString>;
|
|
514
524
|
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
@@ -544,6 +554,8 @@ declare const ulNodeSchema: z.ZodObject<{
|
|
|
544
554
|
color: z.ZodOptional<z.ZodString>;
|
|
545
555
|
}, z.core.$strip>]>>;
|
|
546
556
|
strike: z.ZodOptional<z.ZodBoolean>;
|
|
557
|
+
subscript: z.ZodOptional<z.ZodBoolean>;
|
|
558
|
+
superscript: z.ZodOptional<z.ZodBoolean>;
|
|
547
559
|
highlight: z.ZodOptional<z.ZodString>;
|
|
548
560
|
fontFamily: z.ZodOptional<z.ZodString>;
|
|
549
561
|
lineHeight: z.ZodOptional<z.ZodNumber>;
|
|
@@ -686,10 +698,13 @@ declare const olNodeSchema: z.ZodObject<{
|
|
|
686
698
|
italic: z.ZodOptional<z.ZodBoolean>;
|
|
687
699
|
underline: z.ZodOptional<z.ZodBoolean>;
|
|
688
700
|
strike: z.ZodOptional<z.ZodBoolean>;
|
|
701
|
+
subscript: z.ZodOptional<z.ZodBoolean>;
|
|
702
|
+
superscript: z.ZodOptional<z.ZodBoolean>;
|
|
689
703
|
highlight: z.ZodOptional<z.ZodString>;
|
|
690
704
|
color: z.ZodOptional<z.ZodString>;
|
|
691
705
|
href: z.ZodOptional<z.ZodString>;
|
|
692
706
|
fontFamily: z.ZodOptional<z.ZodString>;
|
|
707
|
+
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
693
708
|
letterSpacing: z.ZodOptional<z.ZodNumber>;
|
|
694
709
|
}, z.core.$strip>>>;
|
|
695
710
|
bold: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -715,6 +730,8 @@ declare const olNodeSchema: z.ZodObject<{
|
|
|
715
730
|
color: z.ZodOptional<z.ZodString>;
|
|
716
731
|
}, z.core.$strip>]>>;
|
|
717
732
|
strike: z.ZodOptional<z.ZodBoolean>;
|
|
733
|
+
subscript: z.ZodOptional<z.ZodBoolean>;
|
|
734
|
+
superscript: z.ZodOptional<z.ZodBoolean>;
|
|
718
735
|
highlight: z.ZodOptional<z.ZodString>;
|
|
719
736
|
color: z.ZodOptional<z.ZodString>;
|
|
720
737
|
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
@@ -750,6 +767,8 @@ declare const olNodeSchema: z.ZodObject<{
|
|
|
750
767
|
color: z.ZodOptional<z.ZodString>;
|
|
751
768
|
}, z.core.$strip>]>>;
|
|
752
769
|
strike: z.ZodOptional<z.ZodBoolean>;
|
|
770
|
+
subscript: z.ZodOptional<z.ZodBoolean>;
|
|
771
|
+
superscript: z.ZodOptional<z.ZodBoolean>;
|
|
753
772
|
highlight: z.ZodOptional<z.ZodString>;
|
|
754
773
|
fontFamily: z.ZodOptional<z.ZodString>;
|
|
755
774
|
lineHeight: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1338,10 +1357,13 @@ declare const tableNodeSchema: z.ZodObject<{
|
|
|
1338
1357
|
italic: z.ZodOptional<z.ZodBoolean>;
|
|
1339
1358
|
underline: z.ZodOptional<z.ZodBoolean>;
|
|
1340
1359
|
strike: z.ZodOptional<z.ZodBoolean>;
|
|
1360
|
+
subscript: z.ZodOptional<z.ZodBoolean>;
|
|
1361
|
+
superscript: z.ZodOptional<z.ZodBoolean>;
|
|
1341
1362
|
highlight: z.ZodOptional<z.ZodString>;
|
|
1342
1363
|
color: z.ZodOptional<z.ZodString>;
|
|
1343
1364
|
href: z.ZodOptional<z.ZodString>;
|
|
1344
1365
|
fontFamily: z.ZodOptional<z.ZodString>;
|
|
1366
|
+
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
1345
1367
|
letterSpacing: z.ZodOptional<z.ZodNumber>;
|
|
1346
1368
|
}, z.core.$strip>>>;
|
|
1347
1369
|
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1369,6 +1391,8 @@ declare const tableNodeSchema: z.ZodObject<{
|
|
|
1369
1391
|
color: z.ZodOptional<z.ZodString>;
|
|
1370
1392
|
}, z.core.$strip>]>>;
|
|
1371
1393
|
strike: z.ZodOptional<z.ZodBoolean>;
|
|
1394
|
+
subscript: z.ZodOptional<z.ZodBoolean>;
|
|
1395
|
+
superscript: z.ZodOptional<z.ZodBoolean>;
|
|
1372
1396
|
highlight: z.ZodOptional<z.ZodString>;
|
|
1373
1397
|
fontFamily: z.ZodOptional<z.ZodString>;
|
|
1374
1398
|
textAlign: z.ZodOptional<z.ZodEnum<{
|
|
@@ -1758,6 +1782,8 @@ declare const shapeNodeSchema: z.ZodObject<{
|
|
|
1758
1782
|
color: z.ZodOptional<z.ZodString>;
|
|
1759
1783
|
}, z.core.$strip>]>>;
|
|
1760
1784
|
strike: z.ZodOptional<z.ZodBoolean>;
|
|
1785
|
+
subscript: z.ZodOptional<z.ZodBoolean>;
|
|
1786
|
+
superscript: z.ZodOptional<z.ZodBoolean>;
|
|
1761
1787
|
highlight: z.ZodOptional<z.ZodString>;
|
|
1762
1788
|
fontFamily: z.ZodOptional<z.ZodString>;
|
|
1763
1789
|
lineHeight: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1914,6 +1940,7 @@ declare const chartNodeSchema: z.ZodObject<{
|
|
|
1914
1940
|
marker: "marker";
|
|
1915
1941
|
filled: "filled";
|
|
1916
1942
|
}>>;
|
|
1943
|
+
sparkline: z.ZodOptional<z.ZodBoolean>;
|
|
1917
1944
|
}, z.core.$strip>;
|
|
1918
1945
|
type TextNode = z.infer<typeof textNodeSchema>;
|
|
1919
1946
|
type UlNode = z.infer<typeof ulNodeSchema>;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../src/types.ts"],"mappings":";;;cA4GM,gBAAA,EAAgB,CAAA,CAAA,OAAA;;;;;;cAMhB,cAAA,EAAc,CAAA,CAAA,OAAA;;;;;cAEd,oBAAA,EAAoB,CAAA,CAAA,OAAA;;;;;;;;KAiMd,UAAA,GAAa,CAAA,CAAE,KAAK,QAAQ,gBAAA;AAAA,KAC5B,QAAA,GAAW,CAAA,CAAE,KAAK,QAAQ,cAAA;AAAA,KAC1B,cAAA,GAAiB,CAAA,CAAE,KAAK,QAAQ,oBAAA;AAAA,cAuBtC,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+BlB,WAAA,GAAc,CAAA,CAAE,KAAK,QAAQ,iBAAA;AAAA,
|
|
1
|
+
{"version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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAQzB,gBAAA,GAAmB,CAAA,CAAE,KAAK,QAAQ,sBAAA;AAAA,KAClC,iBAAA,GAAoB,CAAA,CAAE,KAAK,QAAQ,uBAAA;AAAA,KACnC,gBAAA,GAAmB,CAAA,CAAE,KAAK,QAAQ,sBAAA;AAAA,KAClC,gBAAA,GAAmB,CAAA,CAAE,KAAK,QAAQ,sBAAA;AAAA,KAClC,YAAA,GAAe,CAAA,CAAE,KAAK,QAAQ,kBAAA;AAAA,KAC9B,kBAAA,GAAqB,CAAA,CAAE,KAAK,QAAQ,wBAAA;AAAA,KACpC,qBAAA,GAAwB,CAAA,CAAE,KAAK,QAAQ,2BAAA;AAAA,KACvC,iBAAA,GAAoB,CAAA,CAAE,KAAK,QAAQ,uBAAA;AAAA,KACnC,kBAAA,GAAqB,CAAA,CAAE,KAAK,QAAQ,wBAAA"}
|
package/dist/types.js
CHANGED
|
@@ -337,10 +337,13 @@ const textRunSchema = z.object({
|
|
|
337
337
|
italic: z.boolean().optional(),
|
|
338
338
|
underline: z.boolean().optional(),
|
|
339
339
|
strike: z.boolean().optional(),
|
|
340
|
+
subscript: z.boolean().optional(),
|
|
341
|
+
superscript: z.boolean().optional(),
|
|
340
342
|
highlight: z.string().optional(),
|
|
341
343
|
color: z.string().optional(),
|
|
342
344
|
href: z.string().optional(),
|
|
343
345
|
fontFamily: z.string().optional(),
|
|
346
|
+
fontSize: z.number().optional(),
|
|
344
347
|
letterSpacing: z.number().optional()
|
|
345
348
|
});
|
|
346
349
|
const textNodeSchema = basePOMNodeSchema.extend({
|
|
@@ -359,6 +362,8 @@ const textNodeSchema = basePOMNodeSchema.extend({
|
|
|
359
362
|
italic: z.boolean().optional(),
|
|
360
363
|
underline: underlineSchema.optional(),
|
|
361
364
|
strike: z.boolean().optional(),
|
|
365
|
+
subscript: z.boolean().optional(),
|
|
366
|
+
superscript: z.boolean().optional(),
|
|
362
367
|
highlight: z.string().optional(),
|
|
363
368
|
fontFamily: z.string().optional(),
|
|
364
369
|
lineHeight: z.number().optional(),
|
|
@@ -373,6 +378,8 @@ const liNodeSchema = z.object({
|
|
|
373
378
|
italic: z.boolean().optional(),
|
|
374
379
|
underline: underlineSchema.optional(),
|
|
375
380
|
strike: z.boolean().optional(),
|
|
381
|
+
subscript: z.boolean().optional(),
|
|
382
|
+
superscript: z.boolean().optional(),
|
|
376
383
|
highlight: z.string().optional(),
|
|
377
384
|
color: z.string().optional(),
|
|
378
385
|
fontSize: z.number().optional(),
|
|
@@ -392,6 +399,8 @@ const ulNodeSchema = basePOMNodeSchema.extend({
|
|
|
392
399
|
italic: z.boolean().optional(),
|
|
393
400
|
underline: underlineSchema.optional(),
|
|
394
401
|
strike: z.boolean().optional(),
|
|
402
|
+
subscript: z.boolean().optional(),
|
|
403
|
+
superscript: z.boolean().optional(),
|
|
395
404
|
highlight: z.string().optional(),
|
|
396
405
|
fontFamily: z.string().optional(),
|
|
397
406
|
lineHeight: z.number().optional()
|
|
@@ -410,6 +419,8 @@ const olNodeSchema = basePOMNodeSchema.extend({
|
|
|
410
419
|
italic: z.boolean().optional(),
|
|
411
420
|
underline: underlineSchema.optional(),
|
|
412
421
|
strike: z.boolean().optional(),
|
|
422
|
+
subscript: z.boolean().optional(),
|
|
423
|
+
superscript: z.boolean().optional(),
|
|
413
424
|
highlight: z.string().optional(),
|
|
414
425
|
fontFamily: z.string().optional(),
|
|
415
426
|
lineHeight: z.number().optional(),
|
|
@@ -466,6 +477,8 @@ const tableCellSchema = z.object({
|
|
|
466
477
|
italic: z.boolean().optional(),
|
|
467
478
|
underline: underlineSchema.optional(),
|
|
468
479
|
strike: z.boolean().optional(),
|
|
480
|
+
subscript: z.boolean().optional(),
|
|
481
|
+
superscript: z.boolean().optional(),
|
|
469
482
|
highlight: z.string().optional(),
|
|
470
483
|
fontFamily: z.string().optional(),
|
|
471
484
|
textAlign: z.enum([
|
|
@@ -507,6 +520,8 @@ const shapeNodeSchema = basePOMNodeSchema.extend({
|
|
|
507
520
|
italic: z.boolean().optional(),
|
|
508
521
|
underline: underlineSchema.optional(),
|
|
509
522
|
strike: z.boolean().optional(),
|
|
523
|
+
subscript: z.boolean().optional(),
|
|
524
|
+
superscript: z.boolean().optional(),
|
|
510
525
|
highlight: z.string().optional(),
|
|
511
526
|
fontFamily: z.string().optional(),
|
|
512
527
|
lineHeight: z.number().optional()
|
|
@@ -537,7 +552,8 @@ const chartNodeSchema = basePOMNodeSchema.extend({
|
|
|
537
552
|
showTitle: z.boolean().optional(),
|
|
538
553
|
title: z.string().optional(),
|
|
539
554
|
chartColors: z.array(z.string()).optional(),
|
|
540
|
-
radarStyle: radarStyleSchema.optional()
|
|
555
|
+
radarStyle: radarStyleSchema.optional(),
|
|
556
|
+
sparkline: z.boolean().optional()
|
|
541
557
|
});
|
|
542
558
|
const timelineDirectionSchema = z.enum(["horizontal", "vertical"]);
|
|
543
559
|
const timelineItemSchema = z.object({
|