@hirokisakabe/pom 9.1.2 → 10.1.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 +1 -1
- package/dist/autoFit/autoFit.js +55 -15
- package/dist/autoFit/autoFit.js.map +1 -1
- package/dist/autoFit/strategies/reduceFontSize.js.map +1 -1
- package/dist/buildContext.js +5 -3
- package/dist/buildContext.js.map +1 -1
- package/dist/buildPptx.d.ts +5 -3
- package/dist/buildPptx.d.ts.map +1 -1
- package/dist/buildPptx.js +5 -4
- package/dist/buildPptx.js.map +1 -1
- package/dist/calcYogaLayout/calcYogaLayout.js +1 -1
- package/dist/calcYogaLayout/calcYogaLayout.js.map +1 -1
- package/dist/calcYogaLayout/fontLoader.d.ts +13 -0
- package/dist/calcYogaLayout/fontLoader.d.ts.map +1 -0
- package/dist/calcYogaLayout/fontLoader.js +70 -3
- package/dist/calcYogaLayout/fontLoader.js.map +1 -1
- package/dist/calcYogaLayout/measureText.d.ts.map +1 -1
- package/dist/calcYogaLayout/measureText.js +6 -6
- package/dist/calcYogaLayout/measureText.js.map +1 -1
- package/dist/diagnostics.d.ts.map +1 -1
- package/dist/extractSlideMastersAsPptx.d.ts.map +1 -1
- package/dist/extractThemeTokensFromPptx.d.ts +0 -1
- package/dist/extractThemeTokensFromPptx.d.ts.map +1 -1
- package/dist/icons/renderIcon.js +12 -10
- package/dist/icons/renderIcon.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/parseXml/coercionRules.js.map +1 -1
- package/dist/parseXml/parseXml.d.ts +0 -1
- package/dist/parseXml/parseXml.d.ts.map +1 -1
- package/dist/parseXml/parseXml.js.map +1 -1
- package/dist/parseXml/serializeXml.d.ts +0 -1
- package/dist/parseXml/serializeXml.d.ts.map +1 -1
- package/dist/parseXml/serializeXml.js.map +1 -1
- package/dist/registry/definitions/icon.js +1 -1
- package/dist/registry/definitions/list.js +1 -1
- package/dist/registry/definitions/list.js.map +1 -1
- package/dist/registry/definitions/shape.js +1 -1
- package/dist/registry/definitions/shape.js.map +1 -1
- package/dist/registry/definitions/text.js +1 -1
- package/dist/registry/definitions/text.js.map +1 -1
- package/dist/renderPptx/nodes/chart.js +172 -47
- package/dist/renderPptx/nodes/chart.js.map +1 -1
- package/dist/renderPptx/nodes/flow.js +4 -1
- package/dist/renderPptx/nodes/flow.js.map +1 -1
- package/dist/renderPptx/nodes/icon.js +5 -2
- package/dist/renderPptx/nodes/icon.js.map +1 -1
- package/dist/renderPptx/nodes/list.js +7 -9
- package/dist/renderPptx/nodes/list.js.map +1 -1
- package/dist/renderPptx/nodes/matrix.js +4 -1
- package/dist/renderPptx/nodes/matrix.js.map +1 -1
- package/dist/renderPptx/nodes/processArrow.js +8 -2
- package/dist/renderPptx/nodes/processArrow.js.map +1 -1
- package/dist/renderPptx/nodes/pyramid.js +4 -1
- package/dist/renderPptx/nodes/pyramid.js.map +1 -1
- package/dist/renderPptx/nodes/shape.js +5 -2
- package/dist/renderPptx/nodes/shape.js.map +1 -1
- package/dist/renderPptx/nodes/table.js +89 -59
- package/dist/renderPptx/nodes/table.js.map +1 -1
- package/dist/renderPptx/nodes/text.js +1 -18
- package/dist/renderPptx/nodes/text.js.map +1 -1
- package/dist/renderPptx/nodes/timeline.js +9 -3
- package/dist/renderPptx/nodes/timeline.js.map +1 -1
- package/dist/renderPptx/nodes/tree.js +4 -1
- package/dist/renderPptx/nodes/tree.js.map +1 -1
- package/dist/renderPptx/pptxAuthoring.js +381 -0
- package/dist/renderPptx/pptxAuthoring.js.map +1 -0
- package/dist/renderPptx/renderPptx.js +157 -126
- package/dist/renderPptx/renderPptx.js.map +1 -1
- package/dist/renderPptx/textOptions.js +7 -8
- package/dist/renderPptx/textOptions.js.map +1 -1
- package/dist/renderPptx/units.js +3 -3
- package/dist/renderPptx/units.js.map +1 -1
- package/dist/renderPptx/utils/backgroundBorder.js +30 -44
- package/dist/renderPptx/utils/backgroundBorder.js.map +1 -1
- package/dist/renderPptx/utils/contentArea.js +1 -1
- package/dist/renderPptx/utils/contentArea.js.map +1 -1
- package/dist/renderPptx/utils/glimpsePicture.js +3 -22
- package/dist/renderPptx/utils/glimpsePicture.js.map +1 -1
- package/dist/renderPptx/utils/glimpseShape.js +6 -25
- package/dist/renderPptx/utils/glimpseShape.js.map +1 -1
- package/dist/renderPptx/utils/glimpseTextBox.js +41 -60
- package/dist/renderPptx/utils/glimpseTextBox.js.map +1 -1
- package/dist/renderPptx/utils/straightLine.js +5 -2
- package/dist/renderPptx/utils/straightLine.js.map +1 -1
- package/dist/renderPptx/utils/visualStyle.js +3 -33
- package/dist/renderPptx/utils/visualStyle.js.map +1 -1
- package/dist/renderPptx/writablePptx.d.ts +23 -0
- package/dist/renderPptx/writablePptx.d.ts.map +1 -0
- package/dist/renderPptx/writablePptx.js +74 -0
- package/dist/renderPptx/writablePptx.js.map +1 -0
- package/dist/shared/measureImage.js.map +1 -1
- package/dist/types.d.ts +0 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +12 -9
- package/dist/renderPptx/glimpseTextBoxes.js +0 -646
- package/dist/renderPptx/glimpseTextBoxes.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"measureText.js","names":["measureTextWidthOpentype"],"sources":["../../src/calcYogaLayout/measureText.ts"],"sourcesContent":["import {\n measureTextWidth as measureTextWidthOpentype,\n isBundledFont,\n} from \"./fontLoader.ts\";\n\ntype MeasureOptions = {\n fontFamily: string;\n fontSizePx: number;\n fontWeight?: \"normal\" | \"bold\" | number;\n lineHeight?: number;\n letterSpacingPx?: number;\n};\n\nexport type TextMeasurementMode = \"opentype\" | \"fallback\" | \"auto\";\n\n/**\n * 文字がCJK(日本語・中国語・韓国語)文字かどうかを判定する\n */\nfunction isCJKChar(char: string): boolean {\n const code = char.codePointAt(0);\n if (code === undefined) return false;\n\n // CJK統合漢字\n if (code >= 0x4e00 && code <= 0x9fff) return true;\n // CJK統合漢字拡張A\n if (code >= 0x3400 && code <= 0x4dbf) return true;\n // CJK統合漢字拡張B-F\n if (code >= 0x20000 && code <= 0x2ebef) return true;\n // ひらがな\n if (code >= 0x3040 && code <= 0x309f) return true;\n // カタカナ\n if (code >= 0x30a0 && code <= 0x30ff) return true;\n // 全角英数字・記号\n if (code >= 0xff00 && code <= 0xffef) return true;\n // CJK記号\n if (code >= 0x3000 && code <= 0x303f) return true;\n\n return false;\n}\n\n/**\n * フォールバック計算で文字の幅を推定する\n * - CJK文字: 1em(= fontSizePx)\n * - 英数字・半角記号: 0.5em\n */\nfunction estimateCharWidth(char: string, fontSizePx: number): number {\n if (isCJKChar(char)) {\n return fontSizePx; // 1em\n }\n return fontSizePx * 0.5; // 0.5em\n}\n\n/**\n * フォールバック計算でテキスト幅を推定する\n */\nfunction estimateTextWidth(text: string, fontSizePx: number): number {\n let width = 0;\n for (const char of text) {\n width += estimateCharWidth(char, fontSizePx);\n }\n return width;\n}\n\n/**\n * テキスト幅計測関数の型\n */\ntype MeasureTextWidthFn = (text: string) => number;\n\n/**\n * 計測関数に letterSpacing(文字数 × 字間 px)の加算を合成する\n */\nfunction withLetterSpacing(\n measureWidth: MeasureTextWidthFn,\n letterSpacingPx: number | undefined,\n): MeasureTextWidthFn {\n if (!letterSpacingPx) return measureWidth;\n return (text) =>\n measureWidth(text) + Array.from(text).length * letterSpacingPx;\n}\n\n/**\n * テキストを折り返して行ごとの幅を計算する\n */\nfunction wrapText(\n text: string,\n maxWidthPx: number,\n measureWidth: MeasureTextWidthFn,\n): { widthPx: number }[] {\n const paragraphs = text.split(\"\\n\");\n const lines: { widthPx: number }[] = [];\n\n for (const paragraph of paragraphs) {\n if (paragraph === \"\") {\n lines.push({ widthPx: 0 });\n continue;\n }\n\n const words = splitForWrap(paragraph);\n let current = \"\";\n let currentWidth = 0;\n\n for (const word of words) {\n const candidate = current ? current + word : word;\n const w = measureWidth(candidate);\n\n if (w <= maxWidthPx || !current) {\n current = candidate;\n currentWidth = w;\n } else {\n lines.push({ widthPx: currentWidth });\n current = word;\n currentWidth = measureWidth(word);\n }\n }\n\n if (current) {\n lines.push({ widthPx: currentWidth });\n }\n }\n\n return lines;\n}\n\n/**\n * 行情報から最終的なサイズを計算する\n */\nfunction calculateResult(\n lines: { widthPx: number }[],\n opts: MeasureOptions,\n): { widthPx: number; heightPx: number } {\n const lineHeightRatio = opts.lineHeight ?? 1.3;\n const lineHeightPx = opts.fontSizePx * lineHeightRatio;\n const widthPx = lines.length ? Math.max(...lines.map((l) => l.widthPx)) : 0;\n const heightPx = lines.length * lineHeightPx;\n // 端数切り上げ+余裕分 10px を足す\n return { widthPx: widthPx + 10, heightPx };\n}\n\n/**\n * fontWeight を \"normal\" | \"bold\" に正規化する\n */\nfunction normalizeFontWeight(\n weight: \"normal\" | \"bold\" | number | undefined,\n): \"normal\" | \"bold\" {\n if (weight === \"bold\" || weight ===
|
|
1
|
+
{"version":3,"file":"measureText.js","names":["measureTextWidthOpentype"],"sources":["../../src/calcYogaLayout/measureText.ts"],"sourcesContent":["import {\n measureTextWidth as measureTextWidthOpentype,\n isBundledFont,\n type FontRegistry,\n} from \"./fontLoader.ts\";\n\ntype MeasureOptions = {\n fontFamily: string;\n fontSizePx: number;\n fontWeight?: \"normal\" | \"bold\" | number;\n lineHeight?: number;\n letterSpacingPx?: number;\n};\n\nexport type TextMeasurementMode = \"opentype\" | \"fallback\" | \"auto\";\n\n/**\n * 文字がCJK(日本語・中国語・韓国語)文字かどうかを判定する\n */\nfunction isCJKChar(char: string): boolean {\n const code = char.codePointAt(0);\n if (code === undefined) return false;\n\n // CJK統合漢字\n if (code >= 0x4e00 && code <= 0x9fff) return true;\n // CJK統合漢字拡張A\n if (code >= 0x3400 && code <= 0x4dbf) return true;\n // CJK統合漢字拡張B-F\n if (code >= 0x20000 && code <= 0x2ebef) return true;\n // ひらがな\n if (code >= 0x3040 && code <= 0x309f) return true;\n // カタカナ\n if (code >= 0x30a0 && code <= 0x30ff) return true;\n // 全角英数字・記号\n if (code >= 0xff00 && code <= 0xffef) return true;\n // CJK記号\n if (code >= 0x3000 && code <= 0x303f) return true;\n\n return false;\n}\n\n/**\n * フォールバック計算で文字の幅を推定する\n * - CJK文字: 1em(= fontSizePx)\n * - 英数字・半角記号: 0.5em\n */\nfunction estimateCharWidth(char: string, fontSizePx: number): number {\n if (isCJKChar(char)) {\n return fontSizePx; // 1em\n }\n return fontSizePx * 0.5; // 0.5em\n}\n\n/**\n * フォールバック計算でテキスト幅を推定する\n */\nfunction estimateTextWidth(text: string, fontSizePx: number): number {\n let width = 0;\n for (const char of text) {\n width += estimateCharWidth(char, fontSizePx);\n }\n return width;\n}\n\n/**\n * テキスト幅計測関数の型\n */\ntype MeasureTextWidthFn = (text: string) => number;\n\n/**\n * 計測関数に letterSpacing(文字数 × 字間 px)の加算を合成する\n */\nfunction withLetterSpacing(\n measureWidth: MeasureTextWidthFn,\n letterSpacingPx: number | undefined,\n): MeasureTextWidthFn {\n if (!letterSpacingPx) return measureWidth;\n return (text) =>\n measureWidth(text) + Array.from(text).length * letterSpacingPx;\n}\n\n/**\n * テキストを折り返して行ごとの幅を計算する\n */\nfunction wrapText(\n text: string,\n maxWidthPx: number,\n measureWidth: MeasureTextWidthFn,\n): { widthPx: number }[] {\n const paragraphs = text.split(\"\\n\");\n const lines: { widthPx: number }[] = [];\n\n for (const paragraph of paragraphs) {\n if (paragraph === \"\") {\n lines.push({ widthPx: 0 });\n continue;\n }\n\n const words = splitForWrap(paragraph);\n let current = \"\";\n let currentWidth = 0;\n\n for (const word of words) {\n const candidate = current ? current + word : word;\n const w = measureWidth(candidate);\n\n if (w <= maxWidthPx || !current) {\n current = candidate;\n currentWidth = w;\n } else {\n lines.push({ widthPx: currentWidth });\n current = word;\n currentWidth = measureWidth(word);\n }\n }\n\n if (current) {\n lines.push({ widthPx: currentWidth });\n }\n }\n\n return lines;\n}\n\n/**\n * 行情報から最終的なサイズを計算する\n */\nfunction calculateResult(\n lines: { widthPx: number }[],\n opts: MeasureOptions,\n): { widthPx: number; heightPx: number } {\n const lineHeightRatio = opts.lineHeight ?? 1.3;\n const lineHeightPx = opts.fontSizePx * lineHeightRatio;\n const widthPx = lines.length ? Math.max(...lines.map((l) => l.widthPx)) : 0;\n const heightPx = lines.length * lineHeightPx;\n // 端数切り上げ+余裕分 10px を足す\n return { widthPx: widthPx + 10, heightPx };\n}\n\n/**\n * fontWeight を \"normal\" | \"bold\" に正規化する\n */\nfunction normalizeFontWeight(\n weight: \"normal\" | \"bold\" | number | undefined,\n): \"normal\" | \"bold\" {\n if (weight === \"bold\" || (typeof weight === \"number\" && weight >= 600)) {\n return \"bold\";\n }\n return \"normal\";\n}\n\n/**\n * テキストを折り返し付きでレイアウトし、そのサイズを測定する\n */\nexport function measureText(\n text: string,\n maxWidthPx: number,\n opts: MeasureOptions,\n mode: TextMeasurementMode = \"auto\",\n fontRegistry?: FontRegistry,\n): {\n widthPx: number;\n heightPx: number;\n} {\n // 計測方法を決定\n // \"opentype\" / \"fallback\" が明示指定された場合はそれを優先\n // \"auto\" の場合はバンドル外フォントならフォールバック計測を使用\n const shouldUseFallback = (() => {\n switch (mode) {\n case \"opentype\":\n return false;\n case \"fallback\":\n return true;\n case \"auto\":\n return (\n !isBundledFont(opts.fontFamily) &&\n !fontRegistry?.hasFont(\n opts.fontFamily,\n normalizeFontWeight(opts.fontWeight),\n )\n );\n }\n })();\n\n if (shouldUseFallback) {\n return measureTextFallback(text, maxWidthPx, opts);\n }\n\n return measureTextWithOpentype(text, maxWidthPx, opts, fontRegistry);\n}\n\n/**\n * opentype.js を使ったテキスト計測\n */\nfunction measureTextWithOpentype(\n text: string,\n maxWidthPx: number,\n opts: MeasureOptions,\n fontRegistry?: FontRegistry,\n): { widthPx: number; heightPx: number } {\n const fontWeight = normalizeFontWeight(opts.fontWeight);\n const lines = wrapText(\n text,\n maxWidthPx,\n withLetterSpacing(\n (t) =>\n fontRegistry?.measureTextWidth(\n t,\n opts.fontFamily,\n opts.fontSizePx,\n fontWeight,\n ) ?? measureTextWidthOpentype(t, opts.fontSizePx, fontWeight),\n opts.letterSpacingPx,\n ),\n );\n return calculateResult(lines, opts);\n}\n\n/**\n * フォールバック計算を使ったテキスト計測\n */\nfunction measureTextFallback(\n text: string,\n maxWidthPx: number,\n opts: MeasureOptions,\n): { widthPx: number; heightPx: number } {\n const { fontSizePx } = opts;\n const lines = wrapText(\n text,\n maxWidthPx,\n withLetterSpacing(\n (t) => estimateTextWidth(t, fontSizePx),\n opts.letterSpacingPx,\n ),\n );\n return calculateResult(lines, opts);\n}\n\n// ラップ用の分割ロジック\n// - 英文: 空白で分割しつつ、空白も行末に残す\n// - 日本語: とりあえず 1 文字ずつ(必要なら賢くする)\nfunction splitForWrap(text: string): string[] {\n // 超雑実装:全角ひらがな・カタカナ・漢字が多そうなら 1 文字ずつ、それ以外は空白区切り\n const hasCJK = /[\\p{Script=Hiragana}\\p{Script=Katakana}\\p{Script=Han}]/u.test(\n text,\n );\n\n if (hasCJK) {\n return Array.from(text); // 1 glyph ≒ 1 文字として扱う\n }\n\n // 英文用:単語 + 後続スペースをトークンにする\n const tokens: string[] = [];\n const re = /(\\S+\\s*|\\s+)/g;\n let m: RegExpExecArray | null;\n while ((m = re.exec(text))) {\n tokens.push(m[0]);\n }\n return tokens;\n}\n"],"mappings":";;;;;AAmBA,SAAS,UAAU,MAAuB;CACxC,MAAM,OAAO,KAAK,YAAY,CAAC;CAC/B,IAAI,SAAS,KAAA,GAAW,OAAO;CAG/B,IAAI,QAAQ,SAAU,QAAQ,OAAQ,OAAO;CAE7C,IAAI,QAAQ,SAAU,QAAQ,OAAQ,OAAO;CAE7C,IAAI,QAAQ,UAAW,QAAQ,QAAS,OAAO;CAE/C,IAAI,QAAQ,SAAU,QAAQ,OAAQ,OAAO;CAE7C,IAAI,QAAQ,SAAU,QAAQ,OAAQ,OAAO;CAE7C,IAAI,QAAQ,SAAU,QAAQ,OAAQ,OAAO;CAE7C,IAAI,QAAQ,SAAU,QAAQ,OAAQ,OAAO;CAE7C,OAAO;AAC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AU;EAAI;CAAS;AAC3C;;;;AAKA,SAAS,oBACP,QACmB;CACnB,IAAI,WAAW,UAAW,OAAO,WAAW,YAAY,UAAU,KAChE,OAAO;CAET,OAAO;AACT;;;;AAKA,SAAgB,YACd,MACA,YACA,MACA,OAA4B,QAC5B,cAIA;CAqBA,WAjBiC;EAC/B,QAAQ,MAAR;GACE,KAAK,YACH,OAAO;GACT,KAAK,YACH,OAAO;GACT,KAAK,QACH,OACE,CAAC,cAAc,KAAK,UAAU,KAC9B,CAAC,cAAc,QACb,KAAK,YACL,oBAAoB,KAAK,UAAU,CACrC;EAEN;CACF,EAAA,CAEoB,GAClB,OAAO,oBAAoB,MAAM,YAAY,IAAI;CAGnD,OAAO,wBAAwB,MAAM,YAAY,MAAM,YAAY;AACrE;;;;AAKA,SAAS,wBACP,MACA,YACA,MACA,cACuC;CACvC,MAAM,aAAa,oBAAoB,KAAK,UAAU;CAetD,OAAO,gBAdO,SACZ,MACA,YACA,mBACG,MACC,cAAc,iBACZ,GACA,KAAK,YACL,KAAK,YACL,UACF,KAAKA,iBAAyB,GAAG,KAAK,YAAY,UAAU,GAC9D,KAAK,eACP,CAEyB,GAAG,IAAI;AACpC;;;;AAKA,SAAS,oBACP,MACA,YACA,MACuC;CACvC,MAAM,EAAE,eAAe;CASvB,OAAO,gBARO,SACZ,MACA,YACA,mBACG,MAAM,kBAAkB,GAAG,UAAU,GACtC,KAAK,eACP,CAEyB,GAAG,IAAI;AACpC;AAKA,SAAS,aAAa,MAAwB;CAM5C,IAJe,0DAA0D,KACvE,IAGO,GACP,OAAO,MAAM,KAAK,IAAI;CAIxB,MAAM,SAAmB,CAAC;CAC1B,MAAM,KAAK;CACX,IAAI;CACJ,OAAQ,IAAI,GAAG,KAAK,IAAI,GACtB,OAAO,KAAK,EAAE,EAAE;CAElB,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostics.d.ts","names":[],"sources":["../src/diagnostics.ts"],"mappings":";KAAY
|
|
1
|
+
{"version":3,"file":"diagnostics.d.ts","names":[],"sources":["../src/diagnostics.ts"],"mappings":";KAAY;UAYK;EACf,MAAM;EACN;;cAWW,yBAAyB;WACR,aAAa;EAAb,YAAA,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractSlideMastersAsPptx.d.ts","names":[],"sources":["../src/extractSlideMastersAsPptx.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"extractSlideMastersAsPptx.d.ts","names":[],"sources":["../src/extractSlideMastersAsPptx.ts"],"mappings":";;;;;;;;;iBAyMsB,0BACpB,YAAY,cAAc,aACzB,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractThemeTokensFromPptx.d.ts","names":[],"sources":["../src/extractThemeTokensFromPptx.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"extractThemeTokensFromPptx.d.ts","names":[],"sources":["../src/extractThemeTokensFromPptx.ts"],"mappings":";;;;;;;;iBA0MgB,2BACd,YAAY,cAAc,aACzB,QAAQ"}
|
package/dist/icons/renderIcon.js
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import { ICON_DATA } from "./iconData.js";
|
|
2
|
-
import { createRequire } from "node:module";
|
|
3
|
-
import { existsSync } from "node:fs";
|
|
4
|
-
import { readFile } from "node:fs/promises";
|
|
5
|
-
import { dirname, join } from "node:path";
|
|
6
|
-
import { fileURLToPath } from "node:url";
|
|
7
2
|
//#region src/icons/renderIcon.ts
|
|
8
3
|
const RESVG_PKG = ["@resvg", "resvg-wasm"].join("/");
|
|
9
4
|
let resvgModule;
|
|
10
5
|
let wasmInitPromise;
|
|
11
|
-
function getNodeRequire() {
|
|
6
|
+
function getNodeRequire(createRequire) {
|
|
12
7
|
return new Function("url", "createRequire", "return createRequire(url)")(import.meta.url, createRequire);
|
|
13
8
|
}
|
|
14
9
|
/**
|
|
@@ -16,10 +11,15 @@ function getNodeRequire() {
|
|
|
16
11
|
* バンドル環境(esbuild)では同ディレクトリの index_bg.wasm を参照し、
|
|
17
12
|
* 非バンドル環境では createRequire で node_modules から解決する。
|
|
18
13
|
*/
|
|
19
|
-
function resolveWasmPath() {
|
|
14
|
+
async function resolveWasmPath(require) {
|
|
15
|
+
const [{ existsSync }, { dirname, join }, { fileURLToPath }] = await Promise.all([
|
|
16
|
+
import("node:fs"),
|
|
17
|
+
import("node:path"),
|
|
18
|
+
import("node:url")
|
|
19
|
+
]);
|
|
20
20
|
const localPath = join(dirname(fileURLToPath(import.meta.url)), "index_bg.wasm");
|
|
21
21
|
if (existsSync(localPath)) return localPath;
|
|
22
|
-
return
|
|
22
|
+
return require.resolve(`${RESVG_PKG}/index_bg.wasm`);
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* WASM モジュールを初期化し、Resvg クラスを返す。
|
|
@@ -27,8 +27,10 @@ function resolveWasmPath() {
|
|
|
27
27
|
*/
|
|
28
28
|
function ensureWasmInitialized() {
|
|
29
29
|
if (!wasmInitPromise) wasmInitPromise = (async () => {
|
|
30
|
-
const
|
|
31
|
-
const
|
|
30
|
+
const [{ createRequire }, { readFile }] = await Promise.all([import("node:module"), import("node:fs/promises")]);
|
|
31
|
+
const require = getNodeRequire(createRequire);
|
|
32
|
+
const mod = require(RESVG_PKG);
|
|
33
|
+
const wasmBuffer = await readFile(await resolveWasmPath(require));
|
|
32
34
|
await mod.initWasm(wasmBuffer);
|
|
33
35
|
resvgModule = mod;
|
|
34
36
|
})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderIcon.js","names":[],"sources":["../../src/icons/renderIcon.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"renderIcon.js","names":[],"sources":["../../src/icons/renderIcon.ts"],"sourcesContent":["import { ICON_DATA } from \"./iconData.ts\";\n\n// @resvg/resvg-wasm を遅延ロードする。\n// バンドラ(webpack / Turbopack)のスタティック解析が require / require.resolve を\n// 追跡してエラーにするのを避けるため、Function コンストラクタで Node.js の require を\n// 取得し、モジュール名は文字列結合で構築する。\n// Turbopack が動的 require / import を Webpack 同等に解析できるようになれば\n// 隠蔽自体が不要になり、apps/website 側の outputFileTracingIncludes 設定もまとめて\n// 撤去できる。\n// 上流 issue: https://github.com/vercel/next.js/issues/85238\ntype ResvgWasm = typeof import(\"@resvg/resvg-wasm\");\nconst RESVG_PKG = [\"@resvg\", \"resvg-wasm\"].join(\"/\");\nlet resvgModule: ResvgWasm | undefined;\nlet wasmInitPromise: Promise<void> | undefined;\n\n// Function コンストラクタを使って require を取得することでバンドラの静的解析から\n// 完全に隠蔽する。実行時は createRequire で生成した require が利用される。\nfunction getNodeRequire(\n createRequire: typeof import(\"node:module\").createRequire,\n): NodeJS.Require {\n // eslint-disable-next-line @typescript-eslint/no-implied-eval\n const factory = new Function(\n \"url\",\n \"createRequire\",\n \"return createRequire(url)\",\n ) as (\n url: string,\n createRequire: typeof import(\"node:module\").createRequire,\n ) => NodeJS.Require;\n return factory(import.meta.url, createRequire);\n}\n\n/**\n * WASM バイナリのパスを解決する。\n * バンドル環境(esbuild)では同ディレクトリの index_bg.wasm を参照し、\n * 非バンドル環境では createRequire で node_modules から解決する。\n */\nasync function resolveWasmPath(require: NodeJS.Require): Promise<string> {\n const [{ existsSync }, { dirname, join }, { fileURLToPath }] =\n await Promise.all([\n import(\"node:fs\"),\n import(\"node:path\"),\n import(\"node:url\"),\n ]);\n const dir = dirname(fileURLToPath(import.meta.url));\n const localPath = join(dir, \"index_bg.wasm\");\n if (existsSync(localPath)) return localPath;\n return require.resolve(`${RESVG_PKG}/index_bg.wasm`);\n}\n\n/**\n * WASM モジュールを初期化し、Resvg クラスを返す。\n * 並行呼び出しでも安全(Promise をキャッシュ)。\n */\nfunction ensureWasmInitialized(): Promise<void> {\n if (!wasmInitPromise) {\n wasmInitPromise = (async () => {\n const [{ createRequire }, { readFile }] = await Promise.all([\n import(\"node:module\"),\n import(\"node:fs/promises\"),\n ]);\n const require = getNodeRequire(createRequire);\n const mod = require(RESVG_PKG) as ResvgWasm;\n const wasmPath = await resolveWasmPath(require);\n const wasmBuffer = await readFile(wasmPath);\n await mod.initWasm(wasmBuffer);\n resvgModule = mod;\n })();\n }\n return wasmInitPromise;\n}\n\nfunction getResvg() {\n if (!resvgModule) throw new Error(\"WASM not initialized\");\n return resvgModule.Resvg;\n}\n\nfunction buildIconSvg(name: string, size: number, color: string): string {\n const pathData = ICON_DATA[name];\n if (!pathData) {\n throw new Error(`Unknown icon name: \"${name}\"`);\n }\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${size}\" height=\"${size}\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"${color}\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">${pathData}</svg>`;\n}\n\nexport async function rasterizeIcon(\n name: string,\n size: number,\n color: string,\n cache: Map<string, string>,\n): Promise<string> {\n const key = `${name}|${size}|${color}`;\n const cached = cache.get(key);\n if (cached) return cached;\n\n await ensureWasmInitialized();\n const Resvg = getResvg();\n const svg = buildIconSvg(name, size, color);\n const resvg = new Resvg(svg, { fitTo: { mode: \"width\", value: size } });\n const pngData = resvg.render();\n const pngBuffer = pngData.asPng();\n const result = `image/png;base64,${Buffer.from(pngBuffer).toString(\"base64\")}`;\n cache.set(key, result);\n return result;\n}\n\n/**\n * インライン SVG 文字列を指定サイズでラスタライズし、base64 PNG を返す。\n * color が指定された場合、SVG ルートに stroke / fill 属性を設定する。\n */\nexport async function rasterizeSvgContent(\n svgContent: string,\n width: number,\n color: string | undefined,\n cache: Map<string, string>,\n height?: number,\n): Promise<string> {\n const h = height ?? width;\n const key = `svg:${svgContent}|${width}|${h}|${color ?? \"\"}`;\n const cached = cache.get(key);\n if (cached) return cached;\n\n // SVG に xmlns / width / height を設定し、color があれば stroke / fill を注入\n let svg = svgContent;\n\n // xmlns が無ければ追加\n if (!svg.includes(\"xmlns\")) {\n svg = svg.replace(\"<svg\", '<svg xmlns=\"http://www.w3.org/2000/svg\"');\n }\n\n // width / height を上書き\n svg = svg.replace(/<svg([^>]*)>/, (match, attrs: string) => {\n let newAttrs = attrs\n .replace(/\\bwidth\\s*=\\s*\"[^\"]*\"/g, \"\")\n .replace(/\\bheight\\s*=\\s*\"[^\"]*\"/g, \"\");\n newAttrs += ` width=\"${width}\" height=\"${h}\"`;\n\n // color 指定時は stroke / fill を設定(プリセットアイコンとの一貫性)\n if (color) {\n if (!attrs.includes(\"stroke=\")) {\n newAttrs += ` stroke=\"${color}\"`;\n }\n if (!attrs.includes(\"fill=\")) {\n newAttrs += ` fill=\"none\"`;\n }\n }\n\n return `<svg${newAttrs}>`;\n });\n\n await ensureWasmInitialized();\n const Resvg = getResvg();\n const resvg = new Resvg(svg, { fitTo: { mode: \"width\", value: width } });\n const pngData = resvg.render();\n const pngBuffer = pngData.asPng();\n const result = `image/png;base64,${Buffer.from(pngBuffer).toString(\"base64\")}`;\n cache.set(key, result);\n return result;\n}\n"],"mappings":";;AAWA,MAAM,YAAY,CAAC,UAAU,YAAY,CAAC,CAAC,KAAK,GAAG;AACnD,IAAI;AACJ,IAAI;AAIJ,SAAS,eACP,eACgB;CAUhB,OAAO,IARa,SAClB,OACA,iBACA,2BAKW,CAAC,CAAC,OAAO,KAAK,KAAK,aAAa;AAC/C;;;;;;AAOA,eAAe,gBAAgB,SAA0C;CACvE,MAAM,CAAC,EAAE,cAAc,EAAE,SAAS,QAAQ,EAAE,mBAC1C,MAAM,QAAQ,IAAI;EAChB,OAAO;EACP,OAAO;EACP,OAAO;CACT,CAAC;CAEH,MAAM,YAAY,KADN,QAAQ,cAAc,OAAO,KAAK,GAAG,CACxB,GAAG,eAAe;CAC3C,IAAI,WAAW,SAAS,GAAG,OAAO;CAClC,OAAO,QAAQ,QAAQ,GAAG,UAAU,eAAe;AACrD;;;;;AAMA,SAAS,wBAAuC;CAC9C,IAAI,CAAC,iBACH,mBAAmB,YAAY;EAC7B,MAAM,CAAC,EAAE,iBAAiB,EAAE,cAAc,MAAM,QA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S,OAAO,GACvB,MAAM,IAAI,QAAQ,QAAQ,2CAAyC;CAIrE,MAAM,IAAI,QAAQ,iBAAiB,OAAO,UAAkB;EAC1D,IAAI,WAAW,MACZ,QAAQ,0BAA0B,EAAE,CAAC,CACrC,QAAQ,2BAA2B,EAAE;EACxC,YAAY,WAAW,MAAM,YAAY,EAAE;EAG3C,IAAI,OAAO;GACT,IAAI,CAAC,MAAM,SAAS,SAAS,GAC3B,YAAY,YAAY,MAAM;GAEhC,IAAI,CAAC,MAAM,SAAS,OAAO,GACzB,YAAY;EAEhB;EAEA,OAAO,OAAO,SAAS;CACzB,CAAC;CAED,MAAM,sBAAsB;CAI5B,MAAM,YADU,KAFF,SACQ,GAAE,KAAK,EAAE,OAAO;EAAE,MAAM;EAAS,OAAO;CAAM,EAAE,CAClD,CAAC,CAAC,OACE,CAAC,CAAC,MAAM;CAChC,MAAM,SAAS,oBAAoB,OAAO,KAAK,SAAS,CAAC,CAAC,SAAS,QAAQ;CAC3E,MAAM,IAAI,KAAK,MAAM;CACrB,OAAO;AACT"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { FALLBACK_THEME_TOKENS, MasterImageObject, MasterLineObject, MasterObject, MasterRectObject, MasterTextObject, POMNode, SlideMasterBackground, SlideMasterMargin, SlideMasterOptions, SlideNumberOptions, ThemeTokens } from "./types.js";
|
|
2
2
|
import { ParseXmlError, parseXml } from "./parseXml/parseXml.js";
|
|
3
3
|
import { serializeXml } from "./parseXml/serializeXml.js";
|
|
4
|
+
import { FontInput } from "./calcYogaLayout/fontLoader.js";
|
|
4
5
|
import { TextMeasurementMode } from "./calcYogaLayout/measureText.js";
|
|
5
6
|
import { Diagnostic, DiagnosticCode, DiagnosticsError } from "./diagnostics.js";
|
|
7
|
+
import { PptxOutputType, PptxWriteFileOptions, PptxWriteOptions, WritablePptx } from "./renderPptx/writablePptx.js";
|
|
6
8
|
import { BuildPptxResult, buildPptx } from "./buildPptx.js";
|
|
7
9
|
import { extractThemeTokensFromPptx } from "./extractThemeTokensFromPptx.js";
|
|
8
10
|
import { extractSlideMastersAsPptx } from "./extractSlideMastersAsPptx.js";
|
|
9
|
-
export { type BuildPptxResult, type Diagnostic, type DiagnosticCode, DiagnosticsError, FALLBACK_THEME_TOKENS, type MasterImageObject, type MasterLineObject, type MasterObject, type MasterRectObject, type MasterTextObject, type POMNode, ParseXmlError, type SlideMasterBackground, type SlideMasterMargin, type SlideMasterOptions, type SlideNumberOptions, type TextMeasurementMode, type ThemeTokens, buildPptx, extractSlideMastersAsPptx, extractThemeTokensFromPptx, parseXml, serializeXml };
|
|
11
|
+
export { type BuildPptxResult, type Diagnostic, type DiagnosticCode, DiagnosticsError, FALLBACK_THEME_TOKENS, type FontInput, type MasterImageObject, type MasterLineObject, type MasterObject, type MasterRectObject, type MasterTextObject, type POMNode, ParseXmlError, type PptxOutputType, type PptxWriteFileOptions, type PptxWriteOptions, type SlideMasterBackground, type SlideMasterMargin, type SlideMasterOptions, type SlideNumberOptions, type TextMeasurementMode, type ThemeTokens, type WritablePptx, buildPptx, extractSlideMastersAsPptx, extractThemeTokensFromPptx, parseXml, serializeXml };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coercionRules.js","names":[],"sources":["../../src/parseXml/coercionRules.ts"],"sourcesContent":["/**\n * 明示的な型変換ルール定義\n *\n * Zod の内部構造(_def)に依存せず、XML 属性値の文字列→適切な型への変換ルールを\n * 静的に定義する。各ノードタイプ・子要素タイプごとに変換テーブルを持つ。\n */\n\n// ===== CoercionRule 型定義 =====\nexport type CoercionRule =\n | \"number\"\n | \"boolean\"\n | \"string\" // string, enum を含む\n | \"json\" // array, object, record, tuple → JSON.parse\n | { type: \"literal\"; value: string | number | boolean }\n | { type: \"union\"; options: CoercionRule[] }\n | { type: \"object\"; shape: Record<string, CoercionRule> };\n\n// ===== 変換関数 =====\n\nexport function coerceWithRule(\n value: string,\n rule: CoercionRule,\n): { value: unknown; error: string | null } {\n if (rule === \"number\") {\n if (value === \"\") {\n return {\n value: undefined,\n error: `Cannot convert \"${value}\" to number`,\n };\n }\n const num = Number(value);\n if (isNaN(num)) {\n return {\n value: undefined,\n error: `Cannot convert \"${value}\" to number`,\n };\n }\n return { value: num, error: null };\n }\n if (rule === \"boolean\") {\n if (value !== \"true\" && value !== \"false\") {\n return {\n value: undefined,\n error: `Cannot convert \"${value}\" to boolean (expected \"true\" or \"false\")`,\n };\n }\n return { value: value === \"true\", error: null };\n }\n if (rule === \"string\") {\n return { value, error: null };\n }\n if (rule === \"json\") {\n try {\n return { value: JSON.parse(value), error: null };\n } catch {\n return {\n value: undefined,\n error: `Cannot parse JSON value: \"${value}\"`,\n };\n }\n }\n // オブジェクト型のルール\n if (rule.type === \"literal\") {\n return { value: rule.value, error: null };\n }\n if (rule.type === \"union\") {\n return { value: coerceUnionWithRules(value, rule.options), error: null };\n }\n if (rule.type === \"object\") {\n try {\n return { value: JSON.parse(value), error: null };\n } catch {\n return {\n value: undefined,\n error: `Cannot parse JSON value: \"${value}\"`,\n };\n }\n }\n return { value: coerceFallback(value), error: null };\n}\n\nexport function coerceUnionWithRules(\n value: string,\n options: CoercionRule[],\n): unknown {\n // boolean を試行\n if ((value === \"true\" || value === \"false\") && options.includes(\"boolean\")) {\n return value === \"true\";\n }\n\n // number を試行\n if (options.includes(\"number\")) {\n const num = Number(value);\n if (!isNaN(num) && value !== \"\") {\n return num;\n }\n }\n\n // literal を試行\n for (const opt of options) {\n if (typeof opt === \"object\" && opt.type === \"literal\") {\n if (`${opt.value as string | number}` === value) return opt.value;\n }\n }\n\n // object/json を試行(JSON パース)\n if (\n options.some(\n (opt) =>\n opt === \"json\" || (typeof opt === \"object\" && opt.type === \"object\"),\n )\n ) {\n if (value.startsWith(\"{\") || value.startsWith(\"[\")) {\n try {\n return JSON.parse(value);\n } catch {\n /* ignore */\n }\n }\n }\n\n // string にフォールバック\n return value;\n}\n\nexport function coerceFallback(value: string): unknown {\n if (value === \"true\") return true;\n if (value === \"false\") return false;\n const num = Number(value);\n if (value !== \"\" && !isNaN(num)) return num;\n if (value.startsWith(\"{\") || value.startsWith(\"[\")) {\n try {\n return JSON.parse(value);\n } catch {\n /* ignore */\n }\n }\n return value;\n}\n\n/**\n * CoercionRule からオブジェクト型の shape を取得する。\n * dot notation の展開で使用。\n */\nexport function getObjectShapeFromRule(\n rule: CoercionRule,\n): Record<string, CoercionRule> | undefined {\n if (typeof rule === \"object\" && rule.type === \"object\") {\n return rule.shape;\n }\n if (typeof rule === \"object\" && rule.type === \"union\") {\n const objectOpt = rule.options.find(\n (opt): opt is { type: \"object\"; shape: Record<string, CoercionRule> } =>\n typeof opt === \"object\" && opt.type === \"object\",\n );\n return objectOpt?.shape;\n }\n return undefined;\n}\n\n/**\n * boolean と object の union かどうかを判定する。\n * endArrow=\"true\" と endArrow.type=\"triangle\" の共存を許可するために使用。\n */\nexport function isBooleanObjectUnionRule(rule: CoercionRule): boolean {\n if (typeof rule === \"string\") return false;\n if (rule.type !== \"union\") return false;\n const hasBoolean = rule.options.includes(\"boolean\");\n const hasObject = rule.options.some(\n (opt) => typeof opt === \"object\" && opt.type === \"object\",\n );\n return hasBoolean && hasObject;\n}\n\ntype ResolvedMixedNotationShorthand =\n | { mode: \"merge\"; value: Record<string, unknown> }\n | { mode: \"ignore\" }\n | { mode: \"conflict\" };\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction isDirectionalBoxShape(shape: Record<string, CoercionRule>): boolean {\n const keys = Object.keys(shape).sort();\n return (\n keys.length === 4 &&\n keys[0] === \"bottom\" &&\n keys[1] === \"left\" &&\n keys[2] === \"right\" &&\n keys[3] === \"top\"\n );\n}\n\n/**\n * 同一属性で shorthand と dot notation を併用したときに、\n * shorthand 側をどのように扱うかを解決する。\n *\n * - merge: shorthand をオブジェクト化して dot notation 側で上書き\n * - ignore: boolean shorthand を無視して dot notation を優先\n * - conflict: 併用不可(従来どおりエラー)\n */\nexport function resolveMixedNotationShorthand(\n value: string,\n rule: CoercionRule,\n): ResolvedMixedNotationShorthand {\n const objectShape = getObjectShapeFromRule(rule);\n if (!objectShape) return { mode: \"conflict\" };\n\n if (\n isBooleanObjectUnionRule(rule) &&\n (value === \"true\" || value === \"false\")\n ) {\n return { mode: \"ignore\" };\n }\n\n const coerced = coerceWithRule(value, rule);\n if (coerced.error !== null) return { mode: \"conflict\" };\n\n if (isPlainObject(coerced.value)) {\n return { mode: \"merge\", value: coerced.value };\n }\n\n if (typeof coerced.value === \"number\" && isDirectionalBoxShape(objectShape)) {\n return {\n mode: \"merge\",\n value: {\n top: coerced.value,\n right: coerced.value,\n bottom: coerced.value,\n left: coerced.value,\n },\n };\n }\n\n return { mode: \"conflict\" };\n}\n\n// ===== 共通変換ルール =====\n\nconst LENGTH_RULE: CoercionRule = {\n type: \"union\",\n options: [\"number\", { type: \"literal\", value: \"max\" }, \"string\"],\n};\n\nconst PADDING_RULE: CoercionRule = {\n type: \"union\",\n options: [\n \"number\",\n {\n type: \"object\",\n shape: {\n top: \"number\",\n right: \"number\",\n bottom: \"number\",\n left: \"number\",\n },\n },\n ],\n};\n\nconst BORDER_STYLE_RULE: CoercionRule = {\n type: \"object\",\n shape: { color: \"string\", width: \"number\", dashType: \"string\" },\n};\n\nconst FILL_STYLE_RULE: CoercionRule = {\n type: \"object\",\n shape: { color: \"string\", transparency: \"number\" },\n};\n\nconst SHADOW_STYLE_RULE: CoercionRule = {\n type: \"object\",\n shape: {\n type: \"string\",\n opacity: \"number\",\n blur: \"number\",\n angle: \"number\",\n offset: \"number\",\n color: \"string\",\n },\n};\n\nconst UNDERLINE_RULE: CoercionRule = {\n type: \"union\",\n options: [\n \"boolean\",\n { type: \"object\", shape: { style: \"string\", color: \"string\" } },\n ],\n};\n\nconst TEXT_GLOW_RULE: CoercionRule = {\n type: \"object\",\n shape: { size: \"number\", opacity: \"number\", color: \"string\" },\n};\n\nconst TEXT_OUTLINE_RULE: CoercionRule = {\n type: \"object\",\n shape: { size: \"number\", color: \"string\" },\n};\n\nconst LINE_ARROW_RULE: CoercionRule = {\n type: \"union\",\n options: [\"boolean\", { type: \"object\", shape: { type: \"string\" } }],\n};\n\nconst BACKGROUND_IMAGE_RULE: CoercionRule = {\n type: \"object\",\n shape: { src: \"string\", sizing: \"string\" },\n};\n\nconst TREE_CONNECTOR_STYLE_RULE: CoercionRule = {\n type: \"object\",\n shape: { color: \"string\", width: \"number\" },\n};\n\nconst FLOW_CONNECTOR_STYLE_RULE: CoercionRule = {\n type: \"object\",\n shape: {\n color: \"string\",\n width: \"number\",\n arrowType: \"string\",\n labelColor: \"string\",\n },\n};\n\nconst IMAGE_SIZING_RULE: CoercionRule = {\n type: \"object\",\n shape: {\n type: \"string\",\n w: \"number\",\n h: \"number\",\n x: \"number\",\n y: \"number\",\n },\n};\n\n// ===== Base node 属性 =====\nconst BASE_RULES: Record<string, CoercionRule> = {\n id: \"string\",\n w: LENGTH_RULE,\n h: LENGTH_RULE,\n grow: \"number\",\n minW: \"number\",\n maxW: \"number\",\n minH: \"number\",\n maxH: \"number\",\n padding: PADDING_RULE,\n margin: PADDING_RULE,\n backgroundColor: \"string\",\n backgroundGradient: \"string\",\n backgroundImage: BACKGROUND_IMAGE_RULE,\n border: BORDER_STYLE_RULE,\n borderTop: BORDER_STYLE_RULE,\n borderRight: BORDER_STYLE_RULE,\n borderBottom: BORDER_STYLE_RULE,\n borderLeft: BORDER_STYLE_RULE,\n borderRadius: \"number\",\n opacity: \"number\",\n zIndex: \"number\",\n position: \"string\",\n top: \"number\",\n right: \"number\",\n bottom: \"number\",\n left: \"number\",\n alignSelf: \"string\",\n shadow: SHADOW_STYLE_RULE,\n};\n\n// テキスト系の共通属性\nconst TEXT_STYLE_RULES: Record<string, CoercionRule> = {\n fontSize: \"number\",\n color: \"string\",\n textAlign: \"string\",\n bold: \"boolean\",\n italic: \"boolean\",\n underline: UNDERLINE_RULE,\n strike: \"boolean\",\n subscript: \"boolean\",\n superscript: \"boolean\",\n highlight: \"string\",\n fontFamily: \"string\",\n lineHeight: \"number\",\n};\n\n// ===== ノードタイプ別の変換ルールマップ =====\nexport const NODE_COERCION_MAP: Record<string, Record<string, CoercionRule>> = {\n text: {\n ...BASE_RULES,\n text: \"string\",\n rotate: \"number\",\n ...TEXT_STYLE_RULES,\n textGradient: \"string\",\n letterSpacing: \"number\",\n glow: TEXT_GLOW_RULE,\n outline: TEXT_OUTLINE_RULE,\n },\n ul: {\n ...BASE_RULES,\n items: \"json\",\n ...TEXT_STYLE_RULES,\n },\n ol: {\n ...BASE_RULES,\n items: \"json\",\n ...TEXT_STYLE_RULES,\n numberType: \"string\",\n numberStartAt: \"number\",\n },\n image: {\n ...BASE_RULES,\n src: \"string\",\n sizing: IMAGE_SIZING_RULE,\n rotate: \"number\",\n },\n icon: {\n ...BASE_RULES,\n name: \"string\",\n size: \"number\",\n color: \"string\",\n variant: \"string\",\n bgColor: \"string\",\n glow: TEXT_GLOW_RULE,\n outline: TEXT_OUTLINE_RULE,\n rotate: \"number\",\n },\n svg: {\n ...BASE_RULES,\n color: \"string\",\n },\n table: {\n ...BASE_RULES,\n columns: \"json\",\n rows: \"json\",\n defaultRowHeight: \"number\",\n cellBorder: BORDER_STYLE_RULE,\n },\n shape: {\n ...BASE_RULES,\n shapeType: \"string\",\n text: \"string\",\n rotate: \"number\",\n fill: FILL_STYLE_RULE,\n line: BORDER_STYLE_RULE,\n glow: TEXT_GLOW_RULE,\n outline: TEXT_OUTLINE_RULE,\n ...TEXT_STYLE_RULES,\n },\n chart: {\n ...BASE_RULES,\n chartType: \"string\",\n data: \"json\",\n showLegend: \"boolean\",\n showTitle: \"boolean\",\n title: \"string\",\n chartColors: \"json\",\n radarStyle: \"string\",\n sparkline: \"boolean\",\n },\n timeline: {\n ...BASE_RULES,\n direction: \"string\",\n items: \"json\",\n dateColor: \"string\",\n titleColor: \"string\",\n descriptionColor: \"string\",\n connectorColor: \"string\",\n connectorGradient: \"string\",\n useColorForDate: \"boolean\",\n fontFamily: \"string\",\n },\n matrix: {\n ...BASE_RULES,\n axes: \"json\",\n quadrants: \"json\",\n items: \"json\",\n axisLabelColor: \"string\",\n quadrantLabelColor: \"string\",\n itemLabelColor: \"string\",\n },\n tree: {\n ...BASE_RULES,\n layout: \"string\",\n nodeShape: \"string\",\n data: \"json\",\n textColor: \"string\",\n connectorStyle: TREE_CONNECTOR_STYLE_RULE,\n nodeWidth: \"number\",\n nodeHeight: \"number\",\n levelGap: \"number\",\n siblingGap: \"number\",\n },\n flow: {\n ...BASE_RULES,\n direction: \"string\",\n nodes: \"json\",\n connections: \"json\",\n connectorStyle: FLOW_CONNECTOR_STYLE_RULE,\n nodeWidth: \"number\",\n nodeHeight: \"number\",\n nodeGap: \"number\",\n },\n processArrow: {\n ...BASE_RULES,\n direction: \"string\",\n steps: \"json\",\n itemWidth: \"number\",\n itemHeight: \"number\",\n gap: \"number\",\n fontSize: \"number\",\n bold: \"boolean\",\n italic: \"boolean\",\n underline: UNDERLINE_RULE,\n strike: \"boolean\",\n highlight: \"string\",\n fontFamily: \"string\",\n },\n pyramid: {\n ...BASE_RULES,\n direction: \"string\",\n levels: \"json\",\n fontSize: \"number\",\n bold: \"boolean\",\n fontFamily: \"string\",\n },\n line: {\n ...BASE_RULES,\n x1: \"number\",\n y1: \"number\",\n x2: \"number\",\n y2: \"number\",\n color: \"string\",\n lineWidth: \"number\",\n dashType: \"string\",\n beginArrow: LINE_ARROW_RULE,\n endArrow: LINE_ARROW_RULE,\n },\n arrow: {\n ...BASE_RULES,\n from: \"string\",\n to: \"string\",\n color: \"string\",\n lineWidth: \"number\",\n dashType: \"string\",\n beginArrow: LINE_ARROW_RULE,\n endArrow: LINE_ARROW_RULE,\n },\n // コンテナノード\n vstack: {\n ...BASE_RULES,\n gap: \"number\",\n alignItems: \"string\",\n justifyContent: \"string\",\n flexWrap: \"string\",\n },\n hstack: {\n ...BASE_RULES,\n gap: \"number\",\n alignItems: \"string\",\n justifyContent: \"string\",\n flexWrap: \"string\",\n },\n layer: {\n ...BASE_RULES,\n },\n};\n\n// ===== 子要素の変換ルールマップ =====\nexport const CHILD_ELEMENT_COERCION_MAP: Record<\n string,\n Record<string, CoercionRule>\n> = {\n ProcessArrowStep: {\n label: \"string\",\n color: \"string\",\n textColor: \"string\",\n },\n PyramidLevel: {\n label: \"string\",\n color: \"string\",\n textColor: \"string\",\n },\n TimelineItem: {\n date: \"string\",\n title: \"string\",\n description: \"string\",\n color: \"string\",\n dateColor: \"string\",\n },\n MatrixAxes: {\n x: \"string\",\n y: \"string\",\n },\n MatrixQuadrants: {\n topLeft: \"string\",\n topRight: \"string\",\n bottomLeft: \"string\",\n bottomRight: \"string\",\n },\n MatrixItem: {\n label: \"string\",\n x: \"number\",\n y: \"number\",\n color: \"string\",\n textColor: \"string\",\n },\n FlowNode: {\n id: \"string\",\n shape: \"string\",\n text: \"string\",\n color: \"string\",\n textColor: \"string\",\n width: \"number\",\n height: \"number\",\n },\n FlowConnection: {\n from: \"string\",\n to: \"string\",\n label: \"string\",\n color: \"string\",\n labelColor: \"string\",\n },\n Col: {\n width: \"number\",\n },\n Td: {\n text: \"string\",\n fontSize: \"number\",\n color: \"string\",\n bold: \"boolean\",\n italic: \"boolean\",\n underline: UNDERLINE_RULE,\n strike: \"boolean\",\n subscript: \"boolean\",\n superscript: \"boolean\",\n highlight: \"string\",\n fontFamily: \"string\",\n textAlign: \"string\",\n backgroundColor: \"string\",\n colspan: \"number\",\n rowspan: \"number\",\n },\n Li: {\n text: \"string\",\n bold: \"boolean\",\n italic: \"boolean\",\n underline: UNDERLINE_RULE,\n strike: \"boolean\",\n subscript: \"boolean\",\n superscript: \"boolean\",\n highlight: \"string\",\n color: \"string\",\n fontSize: \"number\",\n fontFamily: \"string\",\n },\n B: {},\n I: {},\n Span: {\n color: \"string\",\n fontFamily: \"string\",\n fontSize: \"number\",\n letterSpacing: \"number\",\n },\n};\n"],"mappings":";AAmBA,SAAgB,eAC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;CACA,UAAU;EACR,IAAI;EACJ,OAAO;EACP,MAAM;EACN,OAAO;EACP,WAAW;EACX,OAAO;EACP,QAAQ;CACV;CACA,gBAAgB;EACd,MAAM;EACN,IAAI;EACJ,OAAO;EACP,OAAO;EACP,YAAY;CACd;CACA,KAAK,EACH,OAAO,SACT;CACA,IAAI;EACF,MAAM;EACN,UAAU;EACV,OAAO;EACP,MAAM;EACN,QAAQ;EACR,WAAW;EACX,QAAQ;EACR,WAAW;EACX,aAAa;EACb,WAAW;EACX,YAAY;EACZ,WAAW;EACX,iBAAiB;EACjB,SAAS;EACT,SAAS;CACX;CACA,IAAI;EACF,MAAM;EACN,MAAM;EACN,QAAQ;EACR,WAAW;EACX,QAAQ;EACR,WAAW;EACX,aAAa;EACb,WAAW;EACX,OAAO;EACP,UAAU;EACV,YAAY;CACd;CACA,GAAG,CAAC;CACJ,GAAG,CAAC;CACJ,MAAM;EACJ,OAAO;EACP,YAAY;EACZ,UAAU;EACV,eAAe;CACjB;AACF"}
|
|
1
|
+
{"version":3,"file":"coercionRules.js","names":[],"sources":["../../src/parseXml/coercionRules.ts"],"sourcesContent":["/**\n * 明示的な型変換ルール定義\n *\n * Zod の内部構造(_def)に依存せず、XML 属性値の文字列→適切な型への変換ルールを\n * 静的に定義する。各ノードタイプ・子要素タイプごとに変換テーブルを持つ。\n */\n\n// ===== CoercionRule 型定義 =====\nexport type CoercionRule =\n | \"number\"\n | \"boolean\"\n | \"string\" // string, enum を含む\n | \"json\" // array, object, record, tuple → JSON.parse\n | { type: \"literal\"; value: string | number | boolean }\n | { type: \"union\"; options: CoercionRule[] }\n | { type: \"object\"; shape: Record<string, CoercionRule> };\n\n// ===== 変換関数 =====\n\nexport function coerceWithRule(\n value: string,\n rule: CoercionRule,\n): { value: unknown; error: string | null } {\n if (rule === \"number\") {\n if (value === \"\") {\n return {\n value: undefined,\n error: `Cannot convert \"${value}\" to number`,\n };\n }\n const num = Number(value);\n if (isNaN(num)) {\n return {\n value: undefined,\n error: `Cannot convert \"${value}\" to number`,\n };\n }\n return { value: num, error: null };\n }\n if (rule === \"boolean\") {\n if (value !== \"true\" && value !== \"false\") {\n return {\n value: undefined,\n error: `Cannot convert \"${value}\" to boolean (expected \"true\" or \"false\")`,\n };\n }\n return { value: value === \"true\", error: null };\n }\n if (rule === \"string\") {\n return { value, error: null };\n }\n if (rule === \"json\") {\n try {\n return { value: JSON.parse(value), error: null };\n } catch {\n return {\n value: undefined,\n error: `Cannot parse JSON value: \"${value}\"`,\n };\n }\n }\n // オブジェクト型のルール\n if (rule.type === \"literal\") {\n return { value: rule.value, error: null };\n }\n if (rule.type === \"union\") {\n return { value: coerceUnionWithRules(value, rule.options), error: null };\n }\n if (rule.type === \"object\") {\n try {\n return { value: JSON.parse(value), error: null };\n } catch {\n return {\n value: undefined,\n error: `Cannot parse JSON value: \"${value}\"`,\n };\n }\n }\n return { value: coerceFallback(value), error: null };\n}\n\nexport function coerceUnionWithRules(\n value: string,\n options: CoercionRule[],\n): unknown {\n // boolean を試行\n if ((value === \"true\" || value === \"false\") && options.includes(\"boolean\")) {\n return value === \"true\";\n }\n\n // number を試行\n if (options.includes(\"number\")) {\n const num = Number(value);\n if (!isNaN(num) && value !== \"\") {\n return num;\n }\n }\n\n // literal を試行\n for (const opt of options) {\n if (typeof opt === \"object\" && opt.type === \"literal\") {\n if (`${opt.value as string | number}` === value) return opt.value;\n }\n }\n\n // object/json を試行(JSON パース)\n if (\n options.some(\n (opt) =>\n opt === \"json\" || (typeof opt === \"object\" && opt.type === \"object\"),\n )\n ) {\n if (value.startsWith(\"{\") || value.startsWith(\"[\")) {\n try {\n return JSON.parse(value);\n } catch {\n /* ignore */\n }\n }\n }\n\n // string にフォールバック\n return value;\n}\n\nexport function coerceFallback(value: string): unknown {\n if (value === \"true\") return true;\n if (value === \"false\") return false;\n const num = Number(value);\n if (value !== \"\" && !isNaN(num)) return num;\n if (value.startsWith(\"{\") || value.startsWith(\"[\")) {\n try {\n return JSON.parse(value);\n } catch {\n /* ignore */\n }\n }\n return value;\n}\n\n/**\n * CoercionRule からオブジェクト型の shape を取得する。\n * dot notation の展開で使用。\n */\nexport function getObjectShapeFromRule(\n rule: CoercionRule,\n): Record<string, CoercionRule> | undefined {\n if (typeof rule === \"object\" && rule.type === \"object\") {\n return rule.shape;\n }\n if (typeof rule === \"object\" && rule.type === \"union\") {\n const objectOpt = rule.options.find(\n (opt): opt is { type: \"object\"; shape: Record<string, CoercionRule> } =>\n typeof opt === \"object\" && opt.type === \"object\",\n );\n return objectOpt?.shape;\n }\n return undefined;\n}\n\n/**\n * boolean と object の union かどうかを判定する。\n * endArrow=\"true\" と endArrow.type=\"triangle\" の共存を許可するために使用。\n */\nexport function isBooleanObjectUnionRule(rule: CoercionRule): boolean {\n if (typeof rule === \"string\") return false;\n if (rule.type !== \"union\") return false;\n const hasBoolean = rule.options.includes(\"boolean\");\n const hasObject = rule.options.some(\n (opt) => typeof opt === \"object\" && opt.type === \"object\",\n );\n return hasBoolean && hasObject;\n}\n\ntype ResolvedMixedNotationShorthand =\n | { mode: \"merge\"; value: Record<string, unknown> }\n | { mode: \"ignore\" }\n | { mode: \"conflict\" };\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction isDirectionalBoxShape(shape: Record<string, CoercionRule>): boolean {\n const keys = Object.keys(shape).sort();\n return (\n keys.length === 4 &&\n keys[0] === \"bottom\" &&\n keys[1] === \"left\" &&\n keys[2] === \"right\" &&\n keys[3] === \"top\"\n );\n}\n\n/**\n * 同一属性で shorthand と dot notation を併用したときに、\n * shorthand 側をどのように扱うかを解決する。\n *\n * - merge: shorthand をオブジェクト化して dot notation 側で上書き\n * - ignore: boolean shorthand を無視して dot notation を優先\n * - conflict: 併用不可(従来どおりエラー)\n */\nexport function resolveMixedNotationShorthand(\n value: string,\n rule: CoercionRule,\n): ResolvedMixedNotationShorthand {\n const objectShape = getObjectShapeFromRule(rule);\n if (!objectShape) return { mode: \"conflict\" };\n\n if (\n isBooleanObjectUnionRule(rule) &&\n (value === \"true\" || value === \"false\")\n ) {\n return { mode: \"ignore\" };\n }\n\n const coerced = coerceWithRule(value, rule);\n if (coerced.error !== null) return { mode: \"conflict\" };\n\n if (isPlainObject(coerced.value)) {\n return { mode: \"merge\", value: coerced.value };\n }\n\n if (typeof coerced.value === \"number\" && isDirectionalBoxShape(objectShape)) {\n return {\n mode: \"merge\",\n value: {\n top: coerced.value,\n right: coerced.value,\n bottom: coerced.value,\n left: coerced.value,\n },\n };\n }\n\n return { mode: \"conflict\" };\n}\n\n// ===== 共通変換ルール =====\n\nconst LENGTH_RULE: CoercionRule = {\n type: \"union\",\n options: [\"number\", { type: \"literal\", value: \"max\" }, \"string\"],\n};\n\nconst PADDING_RULE: CoercionRule = {\n type: \"union\",\n options: [\n \"number\",\n {\n type: \"object\",\n shape: {\n top: \"number\",\n right: \"number\",\n bottom: \"number\",\n left: \"number\",\n },\n },\n ],\n};\n\nconst BORDER_STYLE_RULE: CoercionRule = {\n type: \"object\",\n shape: { color: \"string\", width: \"number\", dashType: \"string\" },\n};\n\nconst FILL_STYLE_RULE: CoercionRule = {\n type: \"object\",\n shape: { color: \"string\", transparency: \"number\" },\n};\n\nconst SHADOW_STYLE_RULE: CoercionRule = {\n type: \"object\",\n shape: {\n type: \"string\",\n opacity: \"number\",\n blur: \"number\",\n angle: \"number\",\n offset: \"number\",\n color: \"string\",\n },\n};\n\nconst UNDERLINE_RULE: CoercionRule = {\n type: \"union\",\n options: [\n \"boolean\",\n { type: \"object\", shape: { style: \"string\", color: \"string\" } },\n ],\n};\n\nconst TEXT_GLOW_RULE: CoercionRule = {\n type: \"object\",\n shape: { size: \"number\", opacity: \"number\", color: \"string\" },\n};\n\nconst TEXT_OUTLINE_RULE: CoercionRule = {\n type: \"object\",\n shape: { size: \"number\", color: \"string\" },\n};\n\nconst LINE_ARROW_RULE: CoercionRule = {\n type: \"union\",\n options: [\"boolean\", { type: \"object\", shape: { type: \"string\" } }],\n};\n\nconst BACKGROUND_IMAGE_RULE: CoercionRule = {\n type: \"object\",\n shape: { src: \"string\", sizing: \"string\" },\n};\n\nconst TREE_CONNECTOR_STYLE_RULE: CoercionRule = {\n type: \"object\",\n shape: { color: \"string\", width: \"number\" },\n};\n\nconst FLOW_CONNECTOR_STYLE_RULE: CoercionRule = {\n type: \"object\",\n shape: {\n color: \"string\",\n width: \"number\",\n arrowType: \"string\",\n labelColor: \"string\",\n },\n};\n\nconst IMAGE_SIZING_RULE: CoercionRule = {\n type: \"object\",\n shape: {\n type: \"string\",\n w: \"number\",\n h: \"number\",\n x: \"number\",\n y: \"number\",\n },\n};\n\n// ===== Base node 属性 =====\nconst BASE_RULES: Record<string, CoercionRule> = {\n id: \"string\",\n w: LENGTH_RULE,\n h: LENGTH_RULE,\n grow: \"number\",\n minW: \"number\",\n maxW: \"number\",\n minH: \"number\",\n maxH: \"number\",\n padding: PADDING_RULE,\n margin: PADDING_RULE,\n backgroundColor: \"string\",\n backgroundGradient: \"string\",\n backgroundImage: BACKGROUND_IMAGE_RULE,\n border: BORDER_STYLE_RULE,\n borderTop: BORDER_STYLE_RULE,\n borderRight: BORDER_STYLE_RULE,\n borderBottom: BORDER_STYLE_RULE,\n borderLeft: BORDER_STYLE_RULE,\n borderRadius: \"number\",\n opacity: \"number\",\n zIndex: \"number\",\n position: \"string\",\n top: \"number\",\n right: \"number\",\n bottom: \"number\",\n left: \"number\",\n alignSelf: \"string\",\n shadow: SHADOW_STYLE_RULE,\n};\n\n// テキスト系の共通属性\nconst TEXT_STYLE_RULES: Record<string, CoercionRule> = {\n fontSize: \"number\",\n color: \"string\",\n textAlign: \"string\",\n bold: \"boolean\",\n italic: \"boolean\",\n underline: UNDERLINE_RULE,\n strike: \"boolean\",\n subscript: \"boolean\",\n superscript: \"boolean\",\n highlight: \"string\",\n fontFamily: \"string\",\n lineHeight: \"number\",\n};\n\n// ===== ノードタイプ別の変換ルールマップ =====\nexport const NODE_COERCION_MAP: Record<string, Record<string, CoercionRule>> = {\n text: {\n ...BASE_RULES,\n text: \"string\",\n rotate: \"number\",\n ...TEXT_STYLE_RULES,\n textGradient: \"string\",\n letterSpacing: \"number\",\n glow: TEXT_GLOW_RULE,\n outline: TEXT_OUTLINE_RULE,\n },\n ul: {\n ...BASE_RULES,\n items: \"json\",\n ...TEXT_STYLE_RULES,\n },\n ol: {\n ...BASE_RULES,\n items: \"json\",\n ...TEXT_STYLE_RULES,\n numberType: \"string\",\n numberStartAt: \"number\",\n },\n image: {\n ...BASE_RULES,\n src: \"string\",\n sizing: IMAGE_SIZING_RULE,\n rotate: \"number\",\n },\n icon: {\n ...BASE_RULES,\n name: \"string\",\n size: \"number\",\n color: \"string\",\n variant: \"string\",\n bgColor: \"string\",\n glow: TEXT_GLOW_RULE,\n outline: TEXT_OUTLINE_RULE,\n rotate: \"number\",\n },\n svg: {\n ...BASE_RULES,\n color: \"string\",\n },\n table: {\n ...BASE_RULES,\n columns: \"json\",\n rows: \"json\",\n defaultRowHeight: \"number\",\n cellBorder: BORDER_STYLE_RULE,\n },\n shape: {\n ...BASE_RULES,\n shapeType: \"string\",\n text: \"string\",\n rotate: \"number\",\n fill: FILL_STYLE_RULE,\n line: BORDER_STYLE_RULE,\n glow: TEXT_GLOW_RULE,\n outline: TEXT_OUTLINE_RULE,\n ...TEXT_STYLE_RULES,\n },\n chart: {\n ...BASE_RULES,\n chartType: \"string\",\n data: \"json\",\n showLegend: \"boolean\",\n showTitle: \"boolean\",\n title: \"string\",\n chartColors: \"json\",\n radarStyle: \"string\",\n sparkline: \"boolean\",\n },\n timeline: {\n ...BASE_RULES,\n direction: \"string\",\n items: \"json\",\n dateColor: \"string\",\n titleColor: \"string\",\n descriptionColor: \"string\",\n connectorColor: \"string\",\n connectorGradient: \"string\",\n useColorForDate: \"boolean\",\n fontFamily: \"string\",\n },\n matrix: {\n ...BASE_RULES,\n axes: \"json\",\n quadrants: \"json\",\n items: \"json\",\n axisLabelColor: \"string\",\n quadrantLabelColor: \"string\",\n itemLabelColor: \"string\",\n },\n tree: {\n ...BASE_RULES,\n layout: \"string\",\n nodeShape: \"string\",\n data: \"json\",\n textColor: \"string\",\n connectorStyle: TREE_CONNECTOR_STYLE_RULE,\n nodeWidth: \"number\",\n nodeHeight: \"number\",\n levelGap: \"number\",\n siblingGap: \"number\",\n },\n flow: {\n ...BASE_RULES,\n direction: \"string\",\n nodes: \"json\",\n connections: \"json\",\n connectorStyle: FLOW_CONNECTOR_STYLE_RULE,\n nodeWidth: \"number\",\n nodeHeight: \"number\",\n nodeGap: \"number\",\n },\n processArrow: {\n ...BASE_RULES,\n direction: \"string\",\n steps: \"json\",\n itemWidth: \"number\",\n itemHeight: \"number\",\n gap: \"number\",\n fontSize: \"number\",\n bold: \"boolean\",\n italic: \"boolean\",\n underline: UNDERLINE_RULE,\n strike: \"boolean\",\n highlight: \"string\",\n fontFamily: \"string\",\n },\n pyramid: {\n ...BASE_RULES,\n direction: \"string\",\n levels: \"json\",\n fontSize: \"number\",\n bold: \"boolean\",\n fontFamily: \"string\",\n },\n line: {\n ...BASE_RULES,\n x1: \"number\",\n y1: \"number\",\n x2: \"number\",\n y2: \"number\",\n color: \"string\",\n lineWidth: \"number\",\n dashType: \"string\",\n beginArrow: LINE_ARROW_RULE,\n endArrow: LINE_ARROW_RULE,\n },\n arrow: {\n ...BASE_RULES,\n from: \"string\",\n to: \"string\",\n color: \"string\",\n lineWidth: \"number\",\n dashType: \"string\",\n beginArrow: LINE_ARROW_RULE,\n endArrow: LINE_ARROW_RULE,\n },\n // コンテナノード\n vstack: {\n ...BASE_RULES,\n gap: \"number\",\n alignItems: \"string\",\n justifyContent: \"string\",\n flexWrap: \"string\",\n },\n hstack: {\n ...BASE_RULES,\n gap: \"number\",\n alignItems: \"string\",\n justifyContent: \"string\",\n flexWrap: \"string\",\n },\n layer: {\n ...BASE_RULES,\n },\n};\n\n// ===== 子要素の変換ルールマップ =====\nexport const CHILD_ELEMENT_COERCION_MAP: Record<\n string,\n Record<string, CoercionRule>\n> = {\n ProcessArrowStep: {\n label: \"string\",\n color: \"string\",\n textColor: \"string\",\n },\n PyramidLevel: {\n label: \"string\",\n color: \"string\",\n textColor: \"string\",\n },\n TimelineItem: {\n date: \"string\",\n title: \"string\",\n description: \"string\",\n color: \"string\",\n dateColor: \"string\",\n },\n MatrixAxes: {\n x: \"string\",\n y: \"string\",\n },\n MatrixQuadrants: {\n topLeft: \"string\",\n topRight: \"string\",\n bottomLeft: \"string\",\n bottomRight: \"string\",\n },\n MatrixItem: {\n label: \"string\",\n x: \"number\",\n y: \"number\",\n color: \"string\",\n textColor: \"string\",\n },\n FlowNode: {\n id: \"string\",\n shape: \"string\",\n text: \"string\",\n color: \"string\",\n textColor: \"string\",\n width: \"number\",\n height: \"number\",\n },\n FlowConnection: {\n from: \"string\",\n to: \"string\",\n label: \"string\",\n color: \"string\",\n labelColor: \"string\",\n },\n Col: {\n width: \"number\",\n },\n Td: {\n text: \"string\",\n fontSize: \"number\",\n color: \"string\",\n bold: \"boolean\",\n italic: \"boolean\",\n underline: UNDERLINE_RULE,\n strike: \"boolean\",\n subscript: \"boolean\",\n superscript: \"boolean\",\n highlight: \"string\",\n fontFamily: \"string\",\n textAlign: \"string\",\n backgroundColor: \"string\",\n colspan: \"number\",\n rowspan: \"number\",\n },\n Li: {\n text: \"string\",\n bold: \"boolean\",\n italic: \"boolean\",\n underline: UNDERLINE_RULE,\n strike: \"boolean\",\n subscript: \"boolean\",\n superscript: \"boolean\",\n highlight: \"string\",\n color: \"string\",\n fontSize: \"number\",\n fontFamily: \"string\",\n },\n B: {},\n I: {},\n Span: {\n color: \"string\",\n fontFamily: \"string\",\n fontSize: \"number\",\n letterSpacing: \"number\",\n },\n};\n"],"mappings":";AAmBA,SAAgB,eACd,OACA,MAC0C;CAC1C,IAAI,SAAS,UAAU;EACrB,IAAI,UAAU,IACZ,OAAO;GACL,OAAO,KAAA;GACP,OAAO,mBAAmB,MAAM;EAClC;EAEF,MA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AAM;EACN,IAAI;EACJ,OAAO;EACP,OAAO;EACP,YAAY;CACd;CACA,KAAK,EACH,OAAO,SACT;CACA,IAAI;EACF,MAAM;EACN,UAAU;EACV,OAAO;EACP,MAAM;EACN,QAAQ;EACR,WAAW;EACX,QAAQ;EACR,WAAW;EACX,aAAa;EACb,WAAW;EACX,YAAY;EACZ,WAAW;EACX,iBAAiB;EACjB,SAAS;EACT,SAAS;CACX;CACA,IAAI;EACF,MAAM;EACN,MAAM;EACN,QAAQ;EACR,WAAW;EACX,QAAQ;EACR,WAAW;EACX,aAAa;EACb,WAAW;EACX,OAAO;EACP,UAAU;EACV,YAAY;CACd;CACA,GAAG,CAAC;CACJ,GAAG,CAAC;CACJ,MAAM;EACJ,OAAO;EACP,YAAY;EACZ,UAAU;EACV,eAAe;CACjB;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseXml.d.ts","names":[],"sources":["../../src/parseXml/parseXml.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"parseXml.d.ts","names":[],"sources":["../../src/parseXml/parseXml.ts"],"mappings":";;cAiCa,sBAAsB;WACjB;EACJ,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0sCE,SAAS,oBAAoB"}
|