@hirokisakabe/pom 5.4.0 → 5.5.1

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.
Files changed (94) hide show
  1. package/README.md +6 -5
  2. package/dist/autoFit/autoFit.d.ts +2 -1
  3. package/dist/autoFit/autoFit.d.ts.map +1 -1
  4. package/dist/autoFit/autoFit.js +33 -17
  5. package/dist/buildContext.d.ts +2 -0
  6. package/dist/buildContext.d.ts.map +1 -1
  7. package/dist/buildContext.js +2 -0
  8. package/dist/buildPptx.d.ts +7 -1
  9. package/dist/buildPptx.d.ts.map +1 -1
  10. package/dist/buildPptx.js +14 -5
  11. package/dist/calcYogaLayout/calcYogaLayout.d.ts +4 -2
  12. package/dist/calcYogaLayout/calcYogaLayout.d.ts.map +1 -1
  13. package/dist/calcYogaLayout/calcYogaLayout.js +76 -16
  14. package/dist/calcYogaLayout/fontLoader.d.ts +4 -0
  15. package/dist/calcYogaLayout/fontLoader.d.ts.map +1 -1
  16. package/dist/calcYogaLayout/fontLoader.js +8 -0
  17. package/dist/calcYogaLayout/measureText.d.ts.map +1 -1
  18. package/dist/calcYogaLayout/measureText.js +4 -3
  19. package/dist/calcYogaLayout/types.d.ts +16 -0
  20. package/dist/calcYogaLayout/types.d.ts.map +1 -0
  21. package/dist/calcYogaLayout/types.js +14 -0
  22. package/dist/diagnostics.d.ts +14 -0
  23. package/dist/diagnostics.d.ts.map +1 -0
  24. package/dist/diagnostics.js +17 -0
  25. package/dist/index.d.ts +3 -1
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +1 -0
  28. package/dist/parseXml/parseXml.d.ts +1 -1
  29. package/dist/parseXml/parseXml.d.ts.map +1 -1
  30. package/dist/parseXml/parseXml.js +16 -16
  31. package/dist/registry/definitions/icon.d.ts.map +1 -1
  32. package/dist/registry/definitions/icon.js +26 -14
  33. package/dist/registry/definitions/image.d.ts.map +1 -1
  34. package/dist/registry/definitions/image.js +2 -3
  35. package/dist/registry/definitions/layer.d.ts.map +1 -1
  36. package/dist/registry/definitions/layer.js +9 -6
  37. package/dist/registry/definitions/line.d.ts.map +1 -1
  38. package/dist/registry/definitions/line.js +1 -2
  39. package/dist/registry/definitions/list.d.ts.map +1 -1
  40. package/dist/registry/definitions/list.js +3 -1
  41. package/dist/registry/definitions/shape.d.ts.map +1 -1
  42. package/dist/registry/definitions/shape.js +2 -0
  43. package/dist/registry/definitions/text.d.ts.map +1 -1
  44. package/dist/registry/definitions/text.js +3 -1
  45. package/dist/registry/types.d.ts +2 -1
  46. package/dist/registry/types.d.ts.map +1 -1
  47. package/dist/renderPptx/nodes/chart.d.ts.map +1 -1
  48. package/dist/renderPptx/nodes/chart.js +6 -4
  49. package/dist/renderPptx/nodes/flow.d.ts.map +1 -1
  50. package/dist/renderPptx/nodes/flow.js +14 -4
  51. package/dist/renderPptx/nodes/image.d.ts.map +1 -1
  52. package/dist/renderPptx/nodes/image.js +9 -7
  53. package/dist/renderPptx/nodes/list.d.ts.map +1 -1
  54. package/dist/renderPptx/nodes/list.js +19 -16
  55. package/dist/renderPptx/nodes/matrix.d.ts.map +1 -1
  56. package/dist/renderPptx/nodes/matrix.js +11 -9
  57. package/dist/renderPptx/nodes/processArrow.d.ts.map +1 -1
  58. package/dist/renderPptx/nodes/processArrow.js +14 -4
  59. package/dist/renderPptx/nodes/pyramid.d.ts.map +1 -1
  60. package/dist/renderPptx/nodes/pyramid.js +6 -4
  61. package/dist/renderPptx/nodes/shape.d.ts.map +1 -1
  62. package/dist/renderPptx/nodes/shape.js +7 -5
  63. package/dist/renderPptx/nodes/table.d.ts.map +1 -1
  64. package/dist/renderPptx/nodes/table.js +7 -5
  65. package/dist/renderPptx/nodes/timeline.d.ts.map +1 -1
  66. package/dist/renderPptx/nodes/timeline.js +14 -4
  67. package/dist/renderPptx/nodes/tree.d.ts.map +1 -1
  68. package/dist/renderPptx/nodes/tree.js +6 -4
  69. package/dist/renderPptx/textOptions.d.ts +6 -6
  70. package/dist/renderPptx/textOptions.d.ts.map +1 -1
  71. package/dist/renderPptx/textOptions.js +6 -4
  72. package/dist/renderPptx/utils/backgroundBorder.js +1 -1
  73. package/dist/renderPptx/utils/contentArea.d.ts +26 -0
  74. package/dist/renderPptx/utils/contentArea.d.ts.map +1 -0
  75. package/dist/renderPptx/utils/contentArea.js +26 -0
  76. package/dist/renderPptx/utils/scaleToFit.d.ts +3 -2
  77. package/dist/renderPptx/utils/scaleToFit.d.ts.map +1 -1
  78. package/dist/renderPptx/utils/scaleToFit.js +3 -3
  79. package/dist/shared/freeYogaTree.d.ts +3 -3
  80. package/dist/shared/freeYogaTree.d.ts.map +1 -1
  81. package/dist/shared/freeYogaTree.js +16 -21
  82. package/dist/shared/measureImage.d.ts +3 -2
  83. package/dist/shared/measureImage.d.ts.map +1 -1
  84. package/dist/shared/measureImage.js +5 -5
  85. package/dist/toPositioned/toPositioned.d.ts +3 -6
  86. package/dist/toPositioned/toPositioned.d.ts.map +1 -1
  87. package/dist/toPositioned/toPositioned.js +11 -19
  88. package/dist/types.d.ts +12 -445
  89. package/dist/types.d.ts.map +1 -1
  90. package/dist/types.js +43 -50
  91. package/package.json +6 -3
  92. package/dist/parseXml/inputSchema.d.ts +0 -1622
  93. package/dist/parseXml/inputSchema.d.ts.map +0 -1
  94. package/dist/parseXml/inputSchema.js +0 -257
@@ -1,6 +1,7 @@
1
1
  import { pxToIn, pxToPt } from "../units.js";
2
2
  import { measurePyramid } from "../../calcYogaLayout/measureCompositeNodes.js";
3
3
  import { calcScaleFactor } from "../utils/scaleToFit.js";
4
+ import { getContentArea } from "../utils/contentArea.js";
4
5
  export function renderPyramidNode(node, ctx) {
5
6
  const direction = node.direction ?? "up";
6
7
  const levels = node.levels;
@@ -9,15 +10,16 @@ export function renderPyramidNode(node, ctx) {
9
10
  return;
10
11
  const defaultColor = "4472C4";
11
12
  const defaultTextColor = "FFFFFF";
12
- // スケール係数を計算
13
+ // スケール係数を計算(コンテンツ領域基準)
14
+ const content = getContentArea(node);
13
15
  const intrinsic = measurePyramid(node);
14
- const scaleFactor = calcScaleFactor(node.w, node.h, intrinsic.width, intrinsic.height, "pyramid");
16
+ const scaleFactor = calcScaleFactor(content.w, content.h, intrinsic.width, intrinsic.height, "pyramid", ctx.buildContext.diagnostics);
15
17
  const baseWidth = 400 * scaleFactor;
16
18
  const layerHeight = 50 * scaleFactor;
17
19
  const gap = 2 * scaleFactor;
18
20
  const totalHeight = levelCount * layerHeight + (levelCount - 1) * gap;
19
- const startX = node.x + (node.w - baseWidth) / 2;
20
- const startY = node.y + (node.h - totalHeight) / 2;
21
+ const startX = content.x + (content.w - baseWidth) / 2;
22
+ const startY = content.y + (content.h - totalHeight) / 2;
21
23
  for (let i = 0; i < levelCount; i++) {
22
24
  const level = levels[i];
23
25
  const fillColor = level.color?.replace("#", "") ?? defaultColor;
@@ -1 +1 @@
1
- {"version":3,"file":"shape.d.ts","sourceRoot":"","sources":["../../../src/renderPptx/nodes/shape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,KAAK,mBAAmB,GAAG,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAEtE,wBAAgB,eAAe,CAC7B,IAAI,EAAE,mBAAmB,EACzB,GAAG,EAAE,aAAa,GACjB,IAAI,CAqDN"}
1
+ {"version":3,"file":"shape.d.ts","sourceRoot":"","sources":["../../../src/renderPptx/nodes/shape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,KAAK,mBAAmB,GAAG,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAEtE,wBAAgB,eAAe,CAC7B,IAAI,EAAE,mBAAmB,EACzB,GAAG,EAAE,aAAa,GACjB,IAAI,CAsDN"}
@@ -1,11 +1,13 @@
1
1
  import { pxToIn, pxToPt } from "../units.js";
2
2
  import { convertUnderline, convertStrike } from "../textOptions.js";
3
+ import { getContentArea } from "../utils/contentArea.js";
3
4
  export function renderShapeNode(node, ctx) {
5
+ const content = getContentArea(node);
4
6
  const shapeOptions = {
5
- x: pxToIn(node.x),
6
- y: pxToIn(node.y),
7
- w: pxToIn(node.w),
8
- h: pxToIn(node.h),
7
+ x: pxToIn(content.x),
8
+ y: pxToIn(content.y),
9
+ w: pxToIn(content.w),
10
+ h: pxToIn(content.h),
9
11
  fill: node.fill
10
12
  ? {
11
13
  color: node.fill.color,
@@ -21,7 +23,7 @@ export function renderShapeNode(node, ctx) {
21
23
  : undefined,
22
24
  shadow: node.shadow
23
25
  ? {
24
- type: node.shadow.type,
26
+ type: node.shadow.type ?? "outer",
25
27
  opacity: node.shadow.opacity,
26
28
  blur: node.shadow.blur,
27
29
  angle: node.shadow.angle,
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/renderPptx/nodes/table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAQjD,KAAK,mBAAmB,GAAG,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAEtE,wBAAgB,eAAe,CAC7B,IAAI,EAAE,mBAAmB,EACzB,GAAG,EAAE,aAAa,GACjB,IAAI,CAqCN"}
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/renderPptx/nodes/table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AASjD,KAAK,mBAAmB,GAAG,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAEtE,wBAAgB,eAAe,CAC7B,IAAI,EAAE,mBAAmB,EACzB,GAAG,EAAE,aAAa,GACjB,IAAI,CAsCN"}
@@ -1,6 +1,7 @@
1
1
  import { resolveColumnWidths, resolveRowHeights, } from "../../shared/tableUtils.js";
2
2
  import { pxToIn, pxToPt } from "../units.js";
3
3
  import { convertUnderline, convertStrike } from "../textOptions.js";
4
+ import { getContentArea } from "../utils/contentArea.js";
4
5
  export function renderTableNode(node, ctx) {
5
6
  const tableRows = node.rows.map((row) => row.cells.map((cell) => {
6
7
  const cellOptions = {
@@ -23,12 +24,13 @@ export function renderTableNode(node, ctx) {
23
24
  options: cellOptions,
24
25
  };
25
26
  }));
27
+ const content = getContentArea(node);
26
28
  const tableOptions = {
27
- x: pxToIn(node.x),
28
- y: pxToIn(node.y),
29
- w: pxToIn(node.w),
30
- h: pxToIn(node.h),
31
- colW: resolveColumnWidths(node, node.w).map((width) => pxToIn(width)),
29
+ x: pxToIn(content.x),
30
+ y: pxToIn(content.y),
31
+ w: pxToIn(content.w),
32
+ h: pxToIn(content.h),
33
+ colW: resolveColumnWidths(node, content.w).map((width) => pxToIn(width)),
32
34
  rowH: resolveRowHeights(node).map((height) => pxToIn(height)),
33
35
  margin: 0,
34
36
  };
@@ -1 +1 @@
1
- {"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../../../src/renderPptx/nodes/timeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,KAAK,sBAAsB,GAAG,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,CAAC;AAE5E,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,sBAAsB,EAC5B,GAAG,EAAE,aAAa,GACjB,IAAI,CA6CN"}
1
+ {"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../../../src/renderPptx/nodes/timeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAMjD,KAAK,sBAAsB,GAAG,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,CAAC;AAE5E,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,sBAAsB,EAC5B,GAAG,EAAE,aAAa,GACjB,IAAI,CAwDN"}
@@ -1,6 +1,7 @@
1
1
  import { pxToIn, pxToPt } from "../units.js";
2
2
  import { measureTimeline } from "../../calcYogaLayout/measureCompositeNodes.js";
3
3
  import { calcScaleFactor } from "../utils/scaleToFit.js";
4
+ import { getContentArea } from "../utils/contentArea.js";
4
5
  export function renderTimelineNode(node, ctx) {
5
6
  const direction = node.direction ?? "horizontal";
6
7
  const items = node.items;
@@ -10,16 +11,25 @@ export function renderTimelineNode(node, ctx) {
10
11
  const defaultColor = "1D4ED8"; // blue
11
12
  const baseNodeRadius = 12; // px
12
13
  const baseLineWidth = 4; // px
13
- // スケール係数を計算
14
+ // スケール係数を計算(コンテンツ領域基準)
15
+ const content = getContentArea(node);
14
16
  const intrinsic = measureTimeline(node);
15
- const scaleFactor = calcScaleFactor(node.w, node.h, intrinsic.width, intrinsic.height, "timeline");
17
+ const scaleFactor = calcScaleFactor(content.w, content.h, intrinsic.width, intrinsic.height, "timeline", ctx.buildContext.diagnostics);
16
18
  const nodeRadius = baseNodeRadius * scaleFactor;
17
19
  const lineWidth = baseLineWidth * scaleFactor;
20
+ // コンテンツ領域を使用するための仮想ノードを作成
21
+ const contentNode = {
22
+ ...node,
23
+ x: content.x,
24
+ y: content.y,
25
+ w: content.w,
26
+ h: content.h,
27
+ };
18
28
  if (direction === "horizontal") {
19
- renderHorizontalTimeline(node, ctx, items, defaultColor, nodeRadius, lineWidth, scaleFactor);
29
+ renderHorizontalTimeline(contentNode, ctx, items, defaultColor, nodeRadius, lineWidth, scaleFactor);
20
30
  }
21
31
  else {
22
- renderVerticalTimeline(node, ctx, items, defaultColor, nodeRadius, lineWidth, scaleFactor);
32
+ renderVerticalTimeline(contentNode, ctx, items, defaultColor, nodeRadius, lineWidth, scaleFactor);
23
33
  }
24
34
  }
25
35
  function renderHorizontalTimeline(node, ctx, items, defaultColor, nodeRadius, lineWidth, scaleFactor) {
@@ -1 +1 @@
1
- {"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../../src/renderPptx/nodes/tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAIf,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,KAAK,kBAAkB,GAAG,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAWpE,wBAAgB,cAAc,CAC5B,IAAI,EAAE,kBAAkB,EACxB,GAAG,EAAE,aAAa,GACjB,IAAI,CAwSN"}
1
+ {"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../../src/renderPptx/nodes/tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAIf,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,KAAK,kBAAkB,GAAG,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAWpE,wBAAgB,cAAc,CAC5B,IAAI,EAAE,kBAAkB,EACxB,GAAG,EAAE,aAAa,GACjB,IAAI,CA0SN"}
@@ -1,5 +1,6 @@
1
1
  import { pxToIn, pxToPt } from "../units.js";
2
2
  import { calcScaleFactor } from "../utils/scaleToFit.js";
3
+ import { getContentArea } from "../utils/contentArea.js";
3
4
  export function renderTreeNode(node, ctx) {
4
5
  const layout = node.layout ?? "vertical";
5
6
  const nodeShape = node.nodeShape ?? "rect";
@@ -217,13 +218,14 @@ export function renderTreeNode(node, ctx) {
217
218
  }
218
219
  // ツリーのサイズを計算
219
220
  const treeSize = calculateSubtreeSize(node.data);
220
- // スケール係数を計算
221
- const scaleFactor = calcScaleFactor(node.w, node.h, treeSize.width, treeSize.height, "tree");
221
+ // スケール係数を計算(コンテンツ領域基準)
222
+ const content = getContentArea(node);
223
+ const scaleFactor = calcScaleFactor(content.w, content.h, treeSize.width, treeSize.height, "tree", ctx.buildContext.diagnostics);
222
224
  // スケール後のサイズで中央配置オフセットを計算
223
225
  const scaledW = treeSize.width * scaleFactor;
224
226
  const scaledH = treeSize.height * scaleFactor;
225
- const offsetX = node.x + (node.w - scaledW) / 2;
226
- const offsetY = node.y + (node.h - scaledH) / 2;
227
+ const offsetX = content.x + (content.w - scaledW) / 2;
228
+ const offsetY = content.y + (content.h - scaledH) / 2;
227
229
  // レイアウト計算(原点(0,0)からの相対座標)
228
230
  const rootLayout = calculateTreeLayout(node.data, 0, 0);
229
231
  // 描画(接続線を先に、ノードを後に描画)
@@ -24,15 +24,15 @@ export declare function createTextOptions(node: TextNode): {
24
24
  valign: "top";
25
25
  margin: number;
26
26
  lineSpacingMultiple: number;
27
- color: string;
28
- bold: boolean;
29
- italic: boolean;
27
+ color: string | undefined;
28
+ bold: boolean | undefined;
29
+ italic: boolean | undefined;
30
30
  underline: {
31
31
  style?: UnderlineStyle;
32
32
  color?: string;
33
- };
34
- strike: "sngStrike";
35
- highlight: string;
33
+ } | undefined;
34
+ strike: "sngStrike" | undefined;
35
+ highlight: string | undefined;
36
36
  };
37
37
  export {};
38
38
  //# sourceMappingURL=textOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"textOptions.d.ts","sourceRoot":"","sources":["../../src/renderPptx/textOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7E,KAAK,QAAQ,GAAG,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAE1D;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,SAAS,GAAG,SAAS,GAC/B;IAAE,KAAK,CAAC,EAAE,cAAc,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAQxD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,OAAO,GAAG,SAAS,GAC1B,WAAW,GAAG,SAAS,CAGzB;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ;;;;;;;;;;;;;;;gBApBnC,cAAc;gBAAU,MAAM;;;;EA2C1C"}
1
+ {"version":3,"file":"textOptions.d.ts","sourceRoot":"","sources":["../../src/renderPptx/textOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAI7E,KAAK,QAAQ,GAAG,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAE1D;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,SAAS,GAAG,SAAS,GAC/B;IAAE,KAAK,CAAC,EAAE,cAAc,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAQxD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,OAAO,GAAG,SAAS,GAC1B,WAAW,GAAG,SAAS,CAGzB;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ;;;;;;;;;;;;;;;gBApBnC,cAAc;gBAAU,MAAM;;;;EA4C1C"}
@@ -1,4 +1,5 @@
1
1
  import { pxToIn, pxToPt } from "./units.js";
2
+ import { getContentArea } from "./utils/contentArea.js";
2
3
  /**
3
4
  * underline プロパティを pptxgenjs 形式に変換する
4
5
  */
@@ -26,11 +27,12 @@ export function createTextOptions(node) {
26
27
  const fontSizePx = node.fontSize ?? 24;
27
28
  const fontFamily = node.fontFamily ?? "Noto Sans JP";
28
29
  const lineHeight = node.lineHeight ?? 1.3;
30
+ const content = getContentArea(node);
29
31
  return {
30
- x: pxToIn(node.x),
31
- y: pxToIn(node.y),
32
- w: pxToIn(node.w),
33
- h: pxToIn(node.h),
32
+ x: pxToIn(content.x),
33
+ y: pxToIn(content.y),
34
+ w: pxToIn(content.w),
35
+ h: pxToIn(content.h),
34
36
  fontSize: pxToPt(fontSizePx),
35
37
  fontFace: fontFamily,
36
38
  align: node.textAlign ?? "left",
@@ -2,7 +2,7 @@ import { getImageData } from "../../shared/measureImage.js";
2
2
  import { pxToIn, pxToPt } from "../units.js";
3
3
  function convertShadow(shadow) {
4
4
  return {
5
- type: shadow.type,
5
+ type: shadow.type ?? "outer",
6
6
  opacity: shadow.opacity,
7
7
  blur: shadow.blur,
8
8
  angle: shadow.angle,
@@ -0,0 +1,26 @@
1
+ type Padding = number | {
2
+ top?: number;
3
+ right?: number;
4
+ bottom?: number;
5
+ left?: number;
6
+ };
7
+ interface ContentArea {
8
+ x: number;
9
+ y: number;
10
+ w: number;
11
+ h: number;
12
+ }
13
+ /**
14
+ * ノードの padding を考慮したコンテンツ描画領域を計算する。
15
+ * background/border はノード全体の領域 (node.x/y/w/h) に描画し、
16
+ * コンテンツはこの関数で返される領域に描画する。
17
+ */
18
+ export declare function getContentArea(node: {
19
+ x: number;
20
+ y: number;
21
+ w: number;
22
+ h: number;
23
+ padding?: Padding;
24
+ }): ContentArea;
25
+ export {};
26
+ //# sourceMappingURL=contentArea.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contentArea.d.ts","sourceRoot":"","sources":["../../../src/renderPptx/utils/contentArea.ts"],"names":[],"mappings":"AAAA,KAAK,OAAO,GACR,MAAM,GACN;IACE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEN,UAAU,WAAW;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE;IACnC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,WAAW,CAsBd"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * ノードの padding を考慮したコンテンツ描画領域を計算する。
3
+ * background/border はノード全体の領域 (node.x/y/w/h) に描画し、
4
+ * コンテンツはこの関数で返される領域に描画する。
5
+ */
6
+ export function getContentArea(node) {
7
+ if (node.padding === undefined) {
8
+ return { x: node.x, y: node.y, w: node.w, h: node.h };
9
+ }
10
+ let top, right, bottom, left;
11
+ if (typeof node.padding === "number") {
12
+ top = right = bottom = left = node.padding;
13
+ }
14
+ else {
15
+ top = node.padding.top ?? 0;
16
+ right = node.padding.right ?? 0;
17
+ bottom = node.padding.bottom ?? 0;
18
+ left = node.padding.left ?? 0;
19
+ }
20
+ return {
21
+ x: node.x + left,
22
+ y: node.y + top,
23
+ w: Math.max(0, node.w - left - right),
24
+ h: Math.max(0, node.h - top - bottom),
25
+ };
26
+ }
@@ -1,8 +1,9 @@
1
+ import type { DiagnosticCollector } from "../../diagnostics.ts";
1
2
  /**
2
3
  * 割り当てサイズと固有サイズからスケール係数を計算する。
3
4
  *
4
5
  * - scaleFactor = min(allocatedW / intrinsicW, allocatedH / intrinsicH, 1.0)
5
- * - scaleFactor < MIN_SCALE_THRESHOLD の場合、閾値でクランプして console.warn
6
+ * - scaleFactor < MIN_SCALE_THRESHOLD の場合、閾値でクランプして diagnostics に記録
6
7
  */
7
- export declare function calcScaleFactor(allocatedW: number, allocatedH: number, intrinsicW: number, intrinsicH: number, nodeType: string): number;
8
+ export declare function calcScaleFactor(allocatedW: number, allocatedH: number, intrinsicW: number, intrinsicH: number, nodeType: string, diagnostics: DiagnosticCollector): number;
8
9
  //# sourceMappingURL=scaleToFit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scaleToFit.d.ts","sourceRoot":"","sources":["../../../src/renderPptx/utils/scaleToFit.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACf,MAAM,CAeR"}
1
+ {"version":3,"file":"scaleToFit.d.ts","sourceRoot":"","sources":["../../../src/renderPptx/utils/scaleToFit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAIhE;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,mBAAmB,GAC/B,MAAM,CAgBR"}
@@ -3,16 +3,16 @@ const MIN_SCALE_THRESHOLD = 0.5;
3
3
  * 割り当てサイズと固有サイズからスケール係数を計算する。
4
4
  *
5
5
  * - scaleFactor = min(allocatedW / intrinsicW, allocatedH / intrinsicH, 1.0)
6
- * - scaleFactor < MIN_SCALE_THRESHOLD の場合、閾値でクランプして console.warn
6
+ * - scaleFactor < MIN_SCALE_THRESHOLD の場合、閾値でクランプして diagnostics に記録
7
7
  */
8
- export function calcScaleFactor(allocatedW, allocatedH, intrinsicW, intrinsicH, nodeType) {
8
+ export function calcScaleFactor(allocatedW, allocatedH, intrinsicW, intrinsicH, nodeType, diagnostics) {
9
9
  if (intrinsicW <= 0 || intrinsicH <= 0)
10
10
  return 1.0;
11
11
  const scaleX = allocatedW / intrinsicW;
12
12
  const scaleY = allocatedH / intrinsicH;
13
13
  let scaleFactor = Math.min(scaleX, scaleY, 1.0);
14
14
  if (scaleFactor < MIN_SCALE_THRESHOLD) {
15
- console.warn(`[pom] ${nodeType} node: scale factor ${scaleFactor.toFixed(2)} is below threshold ${MIN_SCALE_THRESHOLD}. Content may overflow.`);
15
+ diagnostics.add("SCALE_BELOW_THRESHOLD", `${nodeType} node: scale factor ${scaleFactor.toFixed(2)} is below threshold ${MIN_SCALE_THRESHOLD}. Content may overflow.`);
16
16
  scaleFactor = MIN_SCALE_THRESHOLD;
17
17
  }
18
18
  return scaleFactor;
@@ -1,7 +1,7 @@
1
- import type { POMNode } from "../types.ts";
1
+ import type { YogaNodeMap } from "../calcYogaLayout/types.ts";
2
2
  /**
3
- * POMNode ツリー内の全 yogaNode を解放し、参照をクリアする。
3
+ * YogaNodeMap 内の全 YogaNode を解放する。
4
4
  * calcYogaLayout を再実行する前に呼び出すこと。
5
5
  */
6
- export declare function freeYogaTree(node: POMNode): void;
6
+ export declare function freeYogaTree(map: YogaNodeMap): void;
7
7
  //# sourceMappingURL=freeYogaTree.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"freeYogaTree.d.ts","sourceRoot":"","sources":["../../src/shared/freeYogaTree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAG3C;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAwBhD"}
1
+ {"version":3,"file":"freeYogaTree.d.ts","sourceRoot":"","sources":["../../src/shared/freeYogaTree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAqBnD"}
@@ -1,29 +1,24 @@
1
- import { walkPOMTree } from "./walkTree.js";
2
1
  /**
3
- * POMNode ツリー内の全 yogaNode を解放し、参照をクリアする。
2
+ * YogaNodeMap 内の全 YogaNode を解放する。
4
3
  * calcYogaLayout を再実行する前に呼び出すこと。
5
4
  */
6
- export function freeYogaTree(node) {
7
- // 子から先に解放する(yoga-layout は親が子を参照しているため)
8
- const nodes = [];
9
- walkPOMTree(node, (n) => nodes.push(n));
10
- // 逆順(リーフから)で解放
11
- for (let i = nodes.length - 1; i >= 0; i--) {
12
- const n = nodes[i];
13
- if (n.yogaNode) {
14
- // 親から切り離してから解放
15
- const owner = n.yogaNode.getParent();
16
- if (owner) {
17
- const childCount = owner.getChildCount();
18
- for (let j = 0; j < childCount; j++) {
19
- if (owner.getChild(j) === n.yogaNode) {
20
- owner.removeChild(n.yogaNode);
21
- break;
22
- }
5
+ export function freeYogaTree(map) {
6
+ // Map の insertion order は親→子なので、逆順(リーフから)で解放する
7
+ const yogaNodes = Array.from(map.values());
8
+ for (let i = yogaNodes.length - 1; i >= 0; i--) {
9
+ const yn = yogaNodes[i];
10
+ // 親から切り離してから解放
11
+ const owner = yn.getParent();
12
+ if (owner) {
13
+ const childCount = owner.getChildCount();
14
+ for (let j = 0; j < childCount; j++) {
15
+ if (owner.getChild(j) === yn) {
16
+ owner.removeChild(yn);
17
+ break;
23
18
  }
24
19
  }
25
- n.yogaNode.free();
26
- n.yogaNode = undefined;
27
20
  }
21
+ yn.free();
28
22
  }
23
+ map.clear();
29
24
  }
@@ -1,3 +1,4 @@
1
+ import type { DiagnosticCollector } from "../diagnostics.ts";
1
2
  type ImageSizeCache = Map<string, {
2
3
  widthPx: number;
3
4
  heightPx: number;
@@ -18,7 +19,7 @@ export declare function getImageData(src: string, cache: ImageDataCache): string
18
19
  * @param dataCache 画像データキャッシュ
19
20
  * @returns 画像の幅と高さ(px)
20
21
  */
21
- export declare function prefetchImageSize(src: string, sizeCache: ImageSizeCache, dataCache: ImageDataCache): Promise<{
22
+ export declare function prefetchImageSize(src: string, sizeCache: ImageSizeCache, dataCache: ImageDataCache, diagnostics: DiagnosticCollector): Promise<{
22
23
  widthPx: number;
23
24
  heightPx: number;
24
25
  }>;
@@ -29,7 +30,7 @@ export declare function prefetchImageSize(src: string, sizeCache: ImageSizeCache
29
30
  * @param sizeCache 画像サイズキャッシュ
30
31
  * @returns 画像の幅と高さ(px)
31
32
  */
32
- export declare function measureImage(src: string, sizeCache: ImageSizeCache): {
33
+ export declare function measureImage(src: string, sizeCache: ImageSizeCache, diagnostics: DiagnosticCollector): {
33
34
  widthPx: number;
34
35
  heightPx: number;
35
36
  };
@@ -1 +1 @@
1
- {"version":3,"file":"measureImage.d.ts","sourceRoot":"","sources":["../../src/shared/measureImage.ts"],"names":[],"mappings":"AAYA,KAAK,cAAc,GAAG,GAAG,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AACzE,KAAK,cAAc,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE1C;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,cAAc,GACpB,MAAM,GAAG,SAAS,CAEpB;AAED;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,cAAc,EACzB,SAAS,EAAE,cAAc,GACxB,OAAO,CAAC;IACT,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC,CA0DD;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,cAAc,GACxB;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAqDA"}
1
+ {"version":3,"file":"measureImage.d.ts","sourceRoot":"","sources":["../../src/shared/measureImage.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAW7D,KAAK,cAAc,GAAG,GAAG,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AACzE,KAAK,cAAc,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE1C;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,cAAc,GACpB,MAAM,GAAG,SAAS,CAEpB;AAED;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,cAAc,EACzB,SAAS,EAAE,cAAc,EACzB,WAAW,EAAE,mBAAmB,GAC/B,OAAO,CAAC;IACT,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC,CA6DD;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,cAAc,EACzB,WAAW,EAAE,mBAAmB,GAC/B;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAyDA"}
@@ -23,7 +23,7 @@ export function getImageData(src, cache) {
23
23
  * @param dataCache 画像データキャッシュ
24
24
  * @returns 画像の幅と高さ(px)
25
25
  */
26
- export async function prefetchImageSize(src, sizeCache, dataCache) {
26
+ export async function prefetchImageSize(src, sizeCache, dataCache, diagnostics) {
27
27
  // キャッシュにあればそれを返す
28
28
  const cached = sizeCache.get(src);
29
29
  if (cached) {
@@ -66,7 +66,7 @@ export async function prefetchImageSize(src, sizeCache, dataCache) {
66
66
  }
67
67
  catch (error) {
68
68
  // エラーが発生した場合はデフォルトサイズを返す
69
- console.warn(`Failed to measure image size for ${src}:`, error);
69
+ diagnostics.add("IMAGE_MEASURE_FAILED", `Failed to measure image size for ${src}: ${String(error)}`);
70
70
  const result = {
71
71
  widthPx: 100,
72
72
  heightPx: 100,
@@ -82,7 +82,7 @@ export async function prefetchImageSize(src, sizeCache, dataCache) {
82
82
  * @param sizeCache 画像サイズキャッシュ
83
83
  * @returns 画像の幅と高さ(px)
84
84
  */
85
- export function measureImage(src, sizeCache) {
85
+ export function measureImage(src, sizeCache, diagnostics) {
86
86
  // キャッシュにあればそれを返す
87
87
  const cached = sizeCache.get(src);
88
88
  if (cached) {
@@ -98,7 +98,7 @@ export function measureImage(src, sizeCache) {
98
98
  }
99
99
  // HTTPS/HTTP URLの場合はキャッシュがないとデフォルト値を返す
100
100
  else if (src.startsWith("https://") || src.startsWith("http://")) {
101
- console.warn(`Image size for URL ${src} was not prefetched. Using default size.`);
101
+ diagnostics.add("IMAGE_NOT_PREFETCHED", `Image size for URL ${src} was not prefetched. Using default size.`);
102
102
  return {
103
103
  widthPx: 100,
104
104
  heightPx: 100,
@@ -121,7 +121,7 @@ export function measureImage(src, sizeCache) {
121
121
  }
122
122
  catch (error) {
123
123
  // エラーが発生した場合はデフォルトサイズを返す
124
- console.warn(`Failed to measure image size for ${src}:`, error);
124
+ diagnostics.add("IMAGE_MEASURE_FAILED", `Failed to measure image size for ${src}: ${String(error)}`);
125
125
  return {
126
126
  widthPx: 100,
127
127
  heightPx: 100,
@@ -1,17 +1,14 @@
1
1
  import type { POMNode, PositionedNode } from "../types.ts";
2
2
  import type { BuildContext } from "../buildContext.ts";
3
- /**
4
- * POMNode から yogaNode を除外したオブジェクトを返す。
5
- * PositionedNode に yogaNode 参照が残らないようにするため。
6
- */
7
- export declare function omitYogaNode<T extends POMNode>(pom: T): Omit<T, "yogaNode">;
3
+ import type { LayoutResultMap } from "../calcYogaLayout/types.ts";
8
4
  /**
9
5
  * POMNode ツリーを絶対座標付きの PositionedNode ツリーに変換する
10
6
  * @param pom 入力 POMNode
11
7
  * @param ctx BuildContext
8
+ * @param map LayoutResultMap(POMNode → 計算済みレイアウト結果のマッピング)
12
9
  * @param parentX 親ノードの絶対X座標
13
10
  * @param parentY 親ノードの絶対Y座標
14
11
  * @returns PositionedNode ツリー
15
12
  */
16
- export declare function toPositioned(pom: POMNode, ctx: BuildContext, parentX?: number, parentY?: number): PositionedNode;
13
+ export declare function toPositioned(pom: POMNode, ctx: BuildContext, map: LayoutResultMap, parentX?: number, parentY?: number): PositionedNode;
17
14
  //# sourceMappingURL=toPositioned.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toPositioned.d.ts","sourceRoot":"","sources":["../../src/toPositioned/toPositioned.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,OAAO,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,CAI3E;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,YAAY,EACjB,OAAO,SAAI,EACX,OAAO,SAAI,GACV,cAAc,CA8DhB"}
1
+ {"version":3,"file":"toPositioned.d.ts","sourceRoot":"","sources":["../../src/toPositioned/toPositioned.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAGlE;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,YAAY,EACjB,GAAG,EAAE,eAAe,EACpB,OAAO,SAAI,EACX,OAAO,SAAI,GACV,cAAc,CAmEhB"}
@@ -1,38 +1,30 @@
1
1
  import { getNodeDef } from "../registry/index.js";
2
- /**
3
- * POMNode から yogaNode を除外したオブジェクトを返す。
4
- * PositionedNode に yogaNode 参照が残らないようにするため。
5
- */
6
- export function omitYogaNode(pom) {
7
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
8
- const { yogaNode, ...rest } = pom;
9
- return rest;
10
- }
11
2
  /**
12
3
  * POMNode ツリーを絶対座標付きの PositionedNode ツリーに変換する
13
4
  * @param pom 入力 POMNode
14
5
  * @param ctx BuildContext
6
+ * @param map LayoutResultMap(POMNode → 計算済みレイアウト結果のマッピング)
15
7
  * @param parentX 親ノードの絶対X座標
16
8
  * @param parentY 親ノードの絶対Y座標
17
9
  * @returns PositionedNode ツリー
18
10
  */
19
- export function toPositioned(pom, ctx, parentX = 0, parentY = 0) {
20
- if (!pom.yogaNode) {
21
- throw new Error("yogaNode not set on POMNode");
11
+ export function toPositioned(pom, ctx, map, parentX = 0, parentY = 0) {
12
+ const layout = map.get(pom);
13
+ if (!layout) {
14
+ throw new Error("Layout result not found in map for POMNode");
22
15
  }
23
- const layout = pom.yogaNode.getComputedLayout();
24
16
  const absoluteX = parentX + layout.left;
25
17
  const absoluteY = parentY + layout.top;
26
18
  const def = getNodeDef(pom.type);
27
19
  // ノード固有のカスタム変換がある場合はそれを使用
28
20
  if (def.toPositioned) {
29
- return def.toPositioned(pom, absoluteX, absoluteY, layout, ctx);
21
+ return def.toPositioned(pom, absoluteX, absoluteY, layout, ctx, map);
30
22
  }
31
23
  // category ベースのデフォルト処理
32
24
  switch (def.category) {
33
25
  case "leaf":
34
26
  return {
35
- ...omitYogaNode(pom),
27
+ ...pom,
36
28
  x: absoluteX,
37
29
  y: absoluteY,
38
30
  w: layout.width,
@@ -41,23 +33,23 @@ export function toPositioned(pom, ctx, parentX = 0, parentY = 0) {
41
33
  case "single-child": {
42
34
  const boxNode = pom;
43
35
  return {
44
- ...omitYogaNode(boxNode),
36
+ ...boxNode,
45
37
  x: absoluteX,
46
38
  y: absoluteY,
47
39
  w: layout.width,
48
40
  h: layout.height,
49
- children: toPositioned(boxNode.children, ctx, absoluteX, absoluteY),
41
+ children: toPositioned(boxNode.children, ctx, map, absoluteX, absoluteY),
50
42
  };
51
43
  }
52
44
  case "multi-child": {
53
45
  const containerNode = pom;
54
46
  return {
55
- ...omitYogaNode(containerNode),
47
+ ...containerNode,
56
48
  x: absoluteX,
57
49
  y: absoluteY,
58
50
  w: layout.width,
59
51
  h: layout.height,
60
- children: containerNode.children.map((child) => toPositioned(child, ctx, absoluteX, absoluteY)),
52
+ children: containerNode.children.map((child) => toPositioned(child, ctx, map, absoluteX, absoluteY)),
61
53
  };
62
54
  }
63
55
  case "absolute-child":