pptx-react-viewer 4.25.0 → 4.26.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.
Files changed (136) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/{AiChatPanel-3NUGL5VN.js → AiChatPanel-PGZDMW4M.js} +28 -28
  3. package/dist/AiChatPanel-PGZDMW4M.js.br +0 -0
  4. package/dist/AiChatPanel-PGZDMW4M.js.gz +0 -0
  5. package/dist/{AiChatPanel-2OWWIKF5.mjs → AiChatPanel-TIJ3MRTR.mjs} +4 -4
  6. package/dist/AiChatPanel-TIJ3MRTR.mjs.br +0 -0
  7. package/dist/AiChatPanel-TIJ3MRTR.mjs.gz +0 -0
  8. package/dist/{Model3DScene-TXD4IOMU.js → Model3DScene-LQBTZGVN.js} +2 -2
  9. package/dist/Model3DScene-LQBTZGVN.js.br +0 -0
  10. package/dist/Model3DScene-LQBTZGVN.js.gz +0 -0
  11. package/dist/{Model3DScene-SKCDIM2U.mjs → Model3DScene-SJGIK2TB.mjs} +1 -1
  12. package/dist/Model3DScene-SJGIK2TB.mjs.br +0 -0
  13. package/dist/Model3DScene-SJGIK2TB.mjs.gz +0 -0
  14. package/dist/{chunk-LKL6DQ55.js → chunk-6HMJTCFO.js} +1 -0
  15. package/dist/chunk-6HMJTCFO.js.br +0 -0
  16. package/dist/chunk-6HMJTCFO.js.gz +0 -0
  17. package/dist/{chunk-C7SS65W2.mjs → chunk-DKMPRUXL.mjs} +1 -1
  18. package/dist/chunk-DKMPRUXL.mjs.br +0 -0
  19. package/dist/chunk-DKMPRUXL.mjs.gz +0 -0
  20. package/dist/{chunk-M6FVQI5G.mjs → chunk-K564H64A.mjs} +4 -4
  21. package/dist/chunk-K564H64A.mjs.br +0 -0
  22. package/dist/chunk-K564H64A.mjs.gz +0 -0
  23. package/dist/{chunk-5FEQK3MW.mjs → chunk-LCWNHXHZ.mjs} +205 -31
  24. package/dist/chunk-LCWNHXHZ.mjs.br +0 -0
  25. package/dist/chunk-LCWNHXHZ.mjs.gz +0 -0
  26. package/dist/{chunk-QTASICXP.js → chunk-NWZKMLGC.js} +5 -5
  27. package/dist/chunk-NWZKMLGC.js.br +0 -0
  28. package/dist/chunk-NWZKMLGC.js.gz +0 -0
  29. package/dist/{chunk-XDWL6LNV.js → chunk-PW3YOZFA.js} +834 -834
  30. package/dist/chunk-PW3YOZFA.js.br +0 -0
  31. package/dist/chunk-PW3YOZFA.js.gz +0 -0
  32. package/dist/{chunk-BP7NMPQE.mjs → chunk-QJNZZBVF.mjs} +7 -7
  33. package/dist/chunk-QJNZZBVF.mjs.br +0 -0
  34. package/dist/chunk-QJNZZBVF.mjs.gz +0 -0
  35. package/dist/{chunk-MRJZIBPQ.js → chunk-UHW3R465.js} +205 -31
  36. package/dist/chunk-UHW3R465.js.br +0 -0
  37. package/dist/chunk-UHW3R465.js.gz +0 -0
  38. package/dist/{chunk-DC67MV5I.mjs → chunk-USJXG5TE.mjs} +2 -2
  39. package/dist/chunk-USJXG5TE.mjs.br +0 -0
  40. package/dist/chunk-USJXG5TE.mjs.gz +0 -0
  41. package/dist/{chunk-7E6EF4GQ.js → chunk-VEVEP7VF.js} +197 -197
  42. package/dist/chunk-VEVEP7VF.js.br +0 -0
  43. package/dist/chunk-VEVEP7VF.js.gz +0 -0
  44. package/dist/{chunk-Q4HRYUEP.mjs → chunk-XLPQM7OJ.mjs} +1 -0
  45. package/dist/chunk-XLPQM7OJ.mjs.br +0 -0
  46. package/dist/chunk-XLPQM7OJ.mjs.gz +0 -0
  47. package/dist/{chunk-MT33XQSF.js → chunk-ZW2WNQN7.js} +1117 -1117
  48. package/dist/chunk-ZW2WNQN7.js.br +0 -0
  49. package/dist/chunk-ZW2WNQN7.js.gz +0 -0
  50. package/dist/i18n/de.cjs +1 -0
  51. package/dist/i18n/de.cjs.br +0 -0
  52. package/dist/i18n/de.cjs.gz +0 -0
  53. package/dist/i18n/de.mjs +1 -0
  54. package/dist/i18n/de.mjs.br +0 -0
  55. package/dist/i18n/de.mjs.gz +0 -0
  56. package/dist/i18n/es.cjs +1 -0
  57. package/dist/i18n/es.cjs.br +0 -0
  58. package/dist/i18n/es.cjs.gz +0 -0
  59. package/dist/i18n/es.mjs +1 -0
  60. package/dist/i18n/es.mjs.br +0 -0
  61. package/dist/i18n/es.mjs.gz +0 -0
  62. package/dist/i18n/fr.cjs +1 -0
  63. package/dist/i18n/fr.cjs.br +0 -0
  64. package/dist/i18n/fr.cjs.gz +0 -0
  65. package/dist/i18n/fr.mjs +1 -0
  66. package/dist/i18n/fr.mjs.br +0 -0
  67. package/dist/i18n/fr.mjs.gz +0 -0
  68. package/dist/i18n/zh-CN.cjs +1 -0
  69. package/dist/i18n/zh-CN.cjs.br +0 -0
  70. package/dist/i18n/zh-CN.cjs.gz +0 -0
  71. package/dist/i18n/zh-CN.mjs +1 -0
  72. package/dist/i18n/zh-CN.mjs.br +0 -0
  73. package/dist/i18n/zh-CN.mjs.gz +0 -0
  74. package/dist/i18n.js +4 -4
  75. package/dist/i18n.js.br +0 -0
  76. package/dist/i18n.js.gz +0 -0
  77. package/dist/i18n.mjs +1 -1
  78. package/dist/i18n.mjs.br +0 -0
  79. package/dist/i18n.mjs.gz +0 -0
  80. package/dist/index.js +63 -63
  81. package/dist/index.js.br +0 -0
  82. package/dist/index.js.gz +0 -0
  83. package/dist/index.mjs +6 -6
  84. package/dist/index.mjs.br +0 -0
  85. package/dist/index.mjs.gz +0 -0
  86. package/dist/internals.js +105 -105
  87. package/dist/internals.js.br +0 -0
  88. package/dist/internals.js.gz +0 -0
  89. package/dist/internals.mjs +4 -4
  90. package/dist/internals.mjs.br +0 -0
  91. package/dist/internals.mjs.gz +0 -0
  92. package/dist/smartart-layouts-5T2QZGLG.js +2494 -0
  93. package/dist/smartart-layouts-5T2QZGLG.js.br +0 -0
  94. package/dist/smartart-layouts-5T2QZGLG.js.gz +0 -0
  95. package/dist/smartart-layouts-UCAFYVFW.mjs +2487 -0
  96. package/dist/smartart-layouts-UCAFYVFW.mjs.br +0 -0
  97. package/dist/smartart-layouts-UCAFYVFW.mjs.gz +0 -0
  98. package/dist/viewer/index.js +27 -27
  99. package/dist/viewer/index.js.br +0 -0
  100. package/dist/viewer/index.js.gz +0 -0
  101. package/dist/viewer/index.mjs +6 -6
  102. package/dist/viewer/index.mjs.br +0 -0
  103. package/dist/viewer/index.mjs.gz +0 -0
  104. package/package.json +3 -3
  105. package/dist/AiChatPanel-2OWWIKF5.mjs.br +0 -0
  106. package/dist/AiChatPanel-2OWWIKF5.mjs.gz +0 -0
  107. package/dist/AiChatPanel-3NUGL5VN.js.br +0 -0
  108. package/dist/AiChatPanel-3NUGL5VN.js.gz +0 -0
  109. package/dist/Model3DScene-SKCDIM2U.mjs.br +0 -0
  110. package/dist/Model3DScene-SKCDIM2U.mjs.gz +0 -0
  111. package/dist/Model3DScene-TXD4IOMU.js.br +0 -0
  112. package/dist/Model3DScene-TXD4IOMU.js.gz +0 -0
  113. package/dist/chunk-5FEQK3MW.mjs.br +0 -0
  114. package/dist/chunk-5FEQK3MW.mjs.gz +0 -0
  115. package/dist/chunk-7E6EF4GQ.js.br +0 -0
  116. package/dist/chunk-7E6EF4GQ.js.gz +0 -0
  117. package/dist/chunk-BP7NMPQE.mjs.br +0 -0
  118. package/dist/chunk-BP7NMPQE.mjs.gz +0 -0
  119. package/dist/chunk-C7SS65W2.mjs.br +0 -0
  120. package/dist/chunk-C7SS65W2.mjs.gz +0 -0
  121. package/dist/chunk-DC67MV5I.mjs.br +0 -0
  122. package/dist/chunk-DC67MV5I.mjs.gz +0 -0
  123. package/dist/chunk-LKL6DQ55.js.br +0 -0
  124. package/dist/chunk-LKL6DQ55.js.gz +0 -0
  125. package/dist/chunk-M6FVQI5G.mjs.br +0 -0
  126. package/dist/chunk-M6FVQI5G.mjs.gz +0 -0
  127. package/dist/chunk-MRJZIBPQ.js.br +0 -0
  128. package/dist/chunk-MRJZIBPQ.js.gz +0 -0
  129. package/dist/chunk-MT33XQSF.js.br +0 -0
  130. package/dist/chunk-MT33XQSF.js.gz +0 -0
  131. package/dist/chunk-Q4HRYUEP.mjs.br +0 -0
  132. package/dist/chunk-Q4HRYUEP.mjs.gz +0 -0
  133. package/dist/chunk-QTASICXP.js.br +0 -0
  134. package/dist/chunk-QTASICXP.js.gz +0 -0
  135. package/dist/chunk-XDWL6LNV.js.br +0 -0
  136. package/dist/chunk-XDWL6LNV.js.gz +0 -0
@@ -74125,11 +74125,11 @@ async function loadNestedDeck(pptxBytes) {
74125
74125
  }
74126
74126
  }
74127
74127
  async function readOleNestedDeckDetail(pptxBytes) {
74128
- const loaded = await loadNestedDeck(pptxBytes);
74129
- if (!loaded) {
74128
+ const loaded2 = await loadNestedDeck(pptxBytes);
74129
+ if (!loaded2) {
74130
74130
  return void 0;
74131
74131
  }
74132
- return loaded.slides.map((slide, index) => ({
74132
+ return loaded2.slides.map((slide, index) => ({
74133
74133
  index,
74134
74134
  elements: collectTextBearingElements(slide.elements).map((el) => ({
74135
74135
  elementId: el.id,
@@ -74138,8 +74138,8 @@ async function readOleNestedDeckDetail(pptxBytes) {
74138
74138
  }));
74139
74139
  }
74140
74140
  async function readOleNestedDeckFirstSlideTextLines(pptxBytes) {
74141
- const loaded = await loadNestedDeck(pptxBytes);
74142
- const firstSlide = loaded?.slides[0];
74141
+ const loaded2 = await loadNestedDeck(pptxBytes);
74142
+ const firstSlide = loaded2?.slides[0];
74143
74143
  if (!firstSlide) {
74144
74144
  return ["Embedded presentation"];
74145
74145
  }
@@ -74148,16 +74148,16 @@ async function readOleNestedDeckFirstSlideTextLines(pptxBytes) {
74148
74148
  }
74149
74149
  async function writeOleNestedDeckElementText(pptxBytes, slideIndex, elementId, text23) {
74150
74150
  try {
74151
- const loaded = await loadNestedDeck(pptxBytes);
74152
- const slide = loaded?.slides[slideIndex];
74151
+ const loaded2 = await loadNestedDeck(pptxBytes);
74152
+ const slide = loaded2?.slides[slideIndex];
74153
74153
  const target = slide ? findTextBearingElementById(slide.elements, elementId) : void 0;
74154
- if (!loaded || !slide || !target) {
74154
+ if (!loaded2 || !slide || !target) {
74155
74155
  return pptxBytes;
74156
74156
  }
74157
74157
  target.text = text23;
74158
74158
  target.textSegments = void 0;
74159
74159
  slide.isDirty = true;
74160
- return await loaded.handler.save(loaded.slides);
74160
+ return await loaded2.handler.save(loaded2.slides);
74161
74161
  } catch {
74162
74162
  return pptxBytes;
74163
74163
  }
@@ -100535,6 +100535,7 @@ function switchSmartArtLayout(currentData, newLayoutType) {
100535
100535
  // the nodes with the previous layout's algorithm (or a mismatch of the
100536
100536
  // two), which is what broke a diagram after a layout change.
100537
100537
  layoutDefinition: void 0,
100538
+ builtinLayoutId: void 0,
100538
100539
  presLayoutVars: void 0,
100539
100540
  layoutDirty: true,
100540
100541
  drawingDirty: true,
@@ -149657,8 +149658,8 @@ function masterPartBackgroundEdited(runtime, part) {
149657
149658
  if (part.backgroundColor === void 0) {
149658
149659
  return false;
149659
149660
  }
149660
- const loaded = masterPartLoadedBackground(runtime, part.path);
149661
- return loaded === void 0 || loaded !== backgroundKey(part.backgroundColor);
149661
+ const loaded2 = masterPartLoadedBackground(runtime, part.path);
149662
+ return loaded2 === void 0 || loaded2 !== backgroundKey(part.backgroundColor);
149662
149663
  }
149663
149664
  var backgroundsByRuntime;
149664
149665
  var init_master_part_background_cache = __esm({
@@ -149701,11 +149702,11 @@ function masterPartElementsChanged(runtime, partPath, elements2) {
149701
149702
  if (elements2 === void 0) {
149702
149703
  return false;
149703
149704
  }
149704
- const loaded = signaturesByRuntime.get(runtime)?.get(partPath);
149705
- if (loaded === void 0) {
149705
+ const loaded2 = signaturesByRuntime.get(runtime)?.get(partPath);
149706
+ if (loaded2 === void 0) {
149706
149707
  return true;
149707
149708
  }
149708
- return loaded !== masterPartElementSignature(elements2);
149709
+ return loaded2 !== masterPartElementSignature(elements2);
149709
149710
  }
149710
149711
  var signaturesByRuntime;
149711
149712
  var SIGNATURE_SKIP_KEYS;
@@ -167656,7 +167657,7 @@ function projectRubySubRunStyle(style, ownAuthored) {
167656
167657
  if (!inherited) {
167657
167658
  return style;
167658
167659
  }
167659
- const loaded = style.authoredRunStyle;
167660
+ const loaded2 = style.authoredRunStyle;
167660
167661
  const own = ownAuthored ?? {};
167661
167662
  const projected = { ...inherited, ...own };
167662
167663
  for (const [key2, value] of Object.entries(style)) {
@@ -167664,7 +167665,7 @@ function projectRubySubRunStyle(style, ownAuthored) {
167664
167665
  continue;
167665
167666
  }
167666
167667
  const styleKey = key2;
167667
- const loadedValue = loaded?.[styleKey] ?? inherited[styleKey];
167668
+ const loadedValue = loaded2?.[styleKey] ?? inherited[styleKey];
167668
167669
  if (value !== loadedValue) {
167669
167670
  projected[key2] = value;
167670
167671
  }
@@ -167740,8 +167741,8 @@ function toParsedSegmentUnderlay(runScopedTextStyle) {
167740
167741
  const underlay = {};
167741
167742
  for (const [key2, value] of Object.entries(runScopedTextStyle)) {
167742
167743
  const styleKey = key2;
167743
- const loaded = authored?.[styleKey] ?? baseline[styleKey];
167744
- if (loaded !== void 0 && loaded === value) {
167744
+ const loaded2 = authored?.[styleKey] ?? baseline[styleKey];
167745
+ if (loaded2 !== void 0 && loaded2 === value) {
167745
167746
  continue;
167746
167747
  }
167747
167748
  underlay[key2] = value;
@@ -174099,6 +174100,14 @@ var init_smartart_fabrication_layouts = __esm({
174099
174100
  }
174100
174101
  });
174101
174102
  function resolveSmartArtSaveLayout(data) {
174103
+ const raw = data.layoutDefinition?.rawXmlText;
174104
+ if (data.builtinLayoutId && raw) {
174105
+ return {
174106
+ category: data.layoutDefinition?.categories?.[0]?.type ?? "list",
174107
+ uniqueId: data.builtinLayoutId,
174108
+ xml: raw
174109
+ };
174110
+ }
174102
174111
  const family2 = resolveFabricatedLayoutFamily(data);
174103
174112
  const identity8 = data.layout ?? data.resolvedLayoutType;
174104
174113
  return {
@@ -233670,15 +233679,72 @@ var init_smartart_3d_translucency = __esm2({
233670
233679
  CLEAR_EDGE_EXPONENT = 1;
233671
233680
  }
233672
233681
  });
233682
+ function buildConnectorLines(three, connectors2, disposables) {
233683
+ return connectors2.flatMap((connector) => {
233684
+ if (connector.points.length < 2) {
233685
+ return [];
233686
+ }
233687
+ const geometry = new three.BufferGeometry().setFromPoints(
233688
+ connector.points.map((p) => new three.Vector3(p.x, p.y, p.z + CONNECTOR_Z_LIFT))
233689
+ );
233690
+ const material = new three.LineBasicMaterial({ color: connector.color });
233691
+ disposables.push(geometry, material);
233692
+ return [new three.Line(geometry, material)];
233693
+ });
233694
+ }
233695
+ var CONNECTOR_Z_LIFT;
233696
+ var init_connector_object = __esm2({
233697
+ "src/smartart-3d/connector-object.ts"() {
233698
+ CONNECTOR_Z_LIFT = 0.02;
233699
+ }
233700
+ });
233701
+ function textureScale(devicePixelRatio) {
233702
+ const wanted = Math.ceil((Number.isFinite(devicePixelRatio) ? devicePixelRatio : 1) * 2);
233703
+ return Math.min(MAX_SCALE, Math.max(MIN_SCALE, wanted));
233704
+ }
233705
+ function layoutTextBlock(block, measure22, devicePixelRatio) {
233706
+ const fontSize = Math.max(6, block.fontSize);
233707
+ let halfWidth = Math.max(1, block.maxWidth) / 2;
233708
+ let halfHeight = Math.max(1, block.maxHeight) / 2;
233709
+ for (const line5 of block.lines) {
233710
+ if (!line5.text) continue;
233711
+ halfWidth = Math.max(halfWidth, measure22(line5.text) / 2 + fontSize * PAD_EM);
233712
+ halfHeight = Math.max(halfHeight, Math.abs(line5.dy) + fontSize * (LINE_HALF_EM + PAD_EM));
233713
+ }
233714
+ const worldWidth = halfWidth * 2;
233715
+ const worldHeight = halfHeight * 2;
233716
+ const scale2 = Math.min(
233717
+ textureScale(devicePixelRatio),
233718
+ MAX_TEXTURE_SIDE / worldWidth,
233719
+ MAX_TEXTURE_SIDE / worldHeight
233720
+ );
233721
+ return {
233722
+ worldWidth,
233723
+ worldHeight,
233724
+ scale: scale2,
233725
+ pixelWidth: Math.max(8, Math.round(worldWidth * scale2)),
233726
+ pixelHeight: Math.max(8, Math.round(worldHeight * scale2))
233727
+ };
233728
+ }
233729
+ var MAX_TEXTURE_SIDE;
233730
+ var MIN_SCALE;
233731
+ var MAX_SCALE;
233732
+ var LINE_HALF_EM;
233733
+ var PAD_EM;
233734
+ var init_text_block_layout = __esm2({
233735
+ "src/smartart-3d/text-block-layout.ts"() {
233736
+ MAX_TEXTURE_SIDE = 4096;
233737
+ MIN_SCALE = 3;
233738
+ MAX_SCALE = 6;
233739
+ LINE_HALF_EM = 0.75;
233740
+ PAD_EM = 0.25;
233741
+ }
233742
+ });
233673
233743
  function buildTextBlockTexture(three, block) {
233674
233744
  if (typeof document === "undefined" || block.lines.every((l) => l.text.length === 0)) {
233675
233745
  return null;
233676
233746
  }
233677
- const worldWidth = Math.max(1, block.maxWidth);
233678
- const worldHeight = Math.max(1, block.maxHeight);
233679
233747
  const canvas = document.createElement("canvas");
233680
- canvas.width = Math.max(8, Math.round(worldWidth * SUPERSAMPLE2));
233681
- canvas.height = Math.max(8, Math.round(worldHeight * SUPERSAMPLE2));
233682
233748
  const ctx2d = canvas.getContext("2d");
233683
233749
  if (!ctx2d) {
233684
233750
  return null;
@@ -233686,24 +233752,37 @@ function buildTextBlockTexture(three, block) {
233686
233752
  const weight = block.fontWeight ?? 400;
233687
233753
  const italic = block.fontStyle === "italic" ? "italic " : "";
233688
233754
  const family2 = block.fontFamily ? `${block.fontFamily}, system-ui, sans-serif` : "system-ui, -apple-system, Segoe UI, Roboto, sans-serif";
233689
- const px32 = Math.max(6, block.fontSize) * SUPERSAMPLE2;
233755
+ const fontSize = Math.max(6, block.fontSize);
233756
+ const fontAt = (scale3) => `${italic}${weight} ${fontSize * scale3}px ${family2}`;
233757
+ const MEASURE = 4;
233758
+ ctx2d.font = fontAt(MEASURE);
233759
+ const layout = layoutTextBlock(
233760
+ block,
233761
+ (text3) => ctx2d.measureText(text3).width / MEASURE,
233762
+ typeof window === "undefined" ? 1 : window.devicePixelRatio
233763
+ );
233764
+ const { worldWidth, worldHeight, scale: scale2 } = layout;
233765
+ canvas.width = layout.pixelWidth;
233766
+ canvas.height = layout.pixelHeight;
233690
233767
  ctx2d.clearRect(0, 0, canvas.width, canvas.height);
233691
233768
  ctx2d.fillStyle = block.color;
233692
233769
  ctx2d.textAlign = "center";
233693
233770
  ctx2d.textBaseline = "middle";
233694
- ctx2d.font = `${italic}${weight} ${px32}px ${family2}`;
233771
+ ctx2d.font = fontAt(scale2);
233695
233772
  const centerX = canvas.width / 2;
233696
233773
  const centerY = canvas.height / 2;
233697
233774
  for (const line5 of block.lines) {
233698
233775
  if (!line5.text) {
233699
233776
  continue;
233700
233777
  }
233701
- ctx2d.fillText(line5.text, centerX, centerY - line5.dy * SUPERSAMPLE2);
233778
+ ctx2d.fillText(line5.text, centerX, centerY - line5.dy * scale2);
233702
233779
  }
233703
233780
  const texture = new three.CanvasTexture(canvas);
233704
233781
  texture.colorSpace = three.SRGBColorSpace;
233705
- texture.minFilter = three.LinearFilter;
233782
+ texture.generateMipmaps = true;
233783
+ texture.minFilter = three.LinearMipmapLinearFilter;
233706
233784
  texture.magFilter = three.LinearFilter;
233785
+ texture.anisotropy = ANISOTROPY;
233707
233786
  texture.flipY = false;
233708
233787
  texture.premultiplyAlpha = false;
233709
233788
  texture.wrapT = three.RepeatWrapping;
@@ -233712,10 +233791,11 @@ function buildTextBlockTexture(three, block) {
233712
233791
  texture.needsUpdate = true;
233713
233792
  return { texture, worldWidth, worldHeight };
233714
233793
  }
233715
- var SUPERSAMPLE2;
233794
+ var ANISOTROPY;
233716
233795
  var init_text_block_texture = __esm2({
233717
233796
  "src/smartart-3d/text-block-texture.ts"() {
233718
- SUPERSAMPLE2 = 3;
233797
+ init_text_block_layout();
233798
+ ANISOTROPY = 8;
233719
233799
  }
233720
233800
  });
233721
233801
  function buildShape(three, mesh) {
@@ -234556,6 +234636,9 @@ async function mountSmartArt3DView(model, ctx) {
234556
234636
  root.add(built.group);
234557
234637
  disposables.push(...built.disposables);
234558
234638
  });
234639
+ for (const line5 of buildConnectorLines(three, model.connectors, disposables)) {
234640
+ root.add(line5);
234641
+ }
234559
234642
  const camera = buildSmartArtViewCamera(three, model.bounds, model.camera, ctx.size);
234560
234643
  let overflow = frameSmartArtOverflow(three, root, camera, ctx.size, Boolean(model.camera));
234561
234644
  return {
@@ -234581,6 +234664,7 @@ var init_view_scene = __esm2({
234581
234664
  init_smartart_3d_lighting();
234582
234665
  init_smartart_3d_scene_camera();
234583
234666
  init_smartart_3d_translucency();
234667
+ init_connector_object();
234584
234668
  init_flat_mesh_object();
234585
234669
  init_lit_mesh_object();
234586
234670
  init_view_camera();
@@ -255734,6 +255818,7 @@ var galleryTranslationsEn = {
255734
255818
  "pptx.gallery.smartArtStyles.title": "SmartArt Styles",
255735
255819
  "pptx.gallery.smartArtColors.title": "Change Colors",
255736
255820
  "pptx.gallery.smartArtLayouts.title": "Layouts",
255821
+ "pptx.gallery.smartArtLayouts.named": "{{name}}",
255737
255822
  "pptx.gallery.smartArtCommand.addShape": "Add Shape",
255738
255823
  "pptx.gallery.smartArtCommand.addBullet": "Add Bullet",
255739
255824
  "pptx.gallery.smartArtCommand.textPane": "Text Pane",
@@ -293777,6 +293862,39 @@ function smartArtColorPatch(data, fillColors) {
293777
293862
  })
293778
293863
  };
293779
293864
  }
293865
+ var loaded;
293866
+ var loading;
293867
+ function preloadSmartArtBuiltinLayouts() {
293868
+ loading ??= import('./smartart-layouts-UCAFYVFW.mjs').then(
293869
+ (module) => loaded = module,
293870
+ () => void 0
293871
+ );
293872
+ return loading;
293873
+ }
293874
+ function smartArtBuiltinLayouts() {
293875
+ if (!loaded) {
293876
+ void preloadSmartArtBuiltinLayouts();
293877
+ }
293878
+ return loaded;
293879
+ }
293880
+ function builtinLayoutPatch(data, layoutId) {
293881
+ const library = smartArtBuiltinLayouts();
293882
+ if (!library?.findBuiltinSmartArtLayout(layoutId)) {
293883
+ return void 0;
293884
+ }
293885
+ const next = library.applyBuiltinSmartArtLayout(data, layoutId);
293886
+ return {
293887
+ layoutType: next.layoutType,
293888
+ resolvedLayoutType: next.resolvedLayoutType,
293889
+ layout: next.layout,
293890
+ layoutDefinition: next.layoutDefinition,
293891
+ builtinLayoutId: next.builtinLayoutId,
293892
+ presLayoutVars: next.presLayoutVars,
293893
+ layoutDirty: next.layoutDirty,
293894
+ drawingDirty: next.drawingDirty,
293895
+ drawingShapes: next.drawingShapes
293896
+ };
293897
+ }
293780
293898
  function applySmartArtDataPatch(data, patch, box, elementId = "inspector") {
293781
293899
  const next = { ...data, ...patch };
293782
293900
  if (patch.style !== void 0) {
@@ -293797,11 +293915,17 @@ function applySmartArtDataPatch(data, patch, box, elementId = "inspector") {
293797
293915
  }
293798
293916
  function smartArtLayoutSwitchPatch(data, layout) {
293799
293917
  const updated = switchSmartArtLayout(data, layout);
293918
+ const defaultId = smartArtBuiltinLayouts()?.defaultBuiltinSmartArtLayoutId(layout);
293919
+ const builtin = defaultId ? builtinLayoutPatch(data, defaultId) : void 0;
293920
+ if (builtin) {
293921
+ return { ...builtin, resolvedLayoutType: layout, layoutType: layout };
293922
+ }
293800
293923
  return {
293801
293924
  layoutType: updated.layoutType,
293802
293925
  resolvedLayoutType: updated.resolvedLayoutType,
293803
293926
  layout: updated.layout,
293804
293927
  layoutDefinition: updated.layoutDefinition,
293928
+ builtinLayoutId: updated.builtinLayoutId,
293805
293929
  presLayoutVars: updated.presLayoutVars,
293806
293930
  layoutDirty: updated.layoutDirty,
293807
293931
  drawingDirty: updated.drawingDirty,
@@ -293866,6 +293990,9 @@ var SMARTART_STYLE_ENTRIES = [
293866
293990
  },
293867
293991
  { id: "intense", name: "Intense Effect", labelKey: "pptx.gallery.smartArtStyles.intenseEffect" }
293868
293992
  ];
293993
+ function smartArtBuiltinLayoutPatch(data, layoutId) {
293994
+ return builtinLayoutPatch(data, layoutId);
293995
+ }
293869
293996
  function num5(value) {
293870
293997
  return String(Math.round(value * 100) / 100);
293871
293998
  }
@@ -294244,6 +294371,47 @@ function smartArtLayoutTileSvg(type, fill, size) {
294244
294371
  return svgTile(size.width, size.height, "", bg + draw(color2, size.width, size.height));
294245
294372
  }
294246
294373
  var TILE7 = { width: 56, height: 36 };
294374
+ var NAMED_CATEGORIES = [
294375
+ ["list", "List"],
294376
+ ["process", "Process"],
294377
+ ["cycle", "Cycle"],
294378
+ ["hierarchy", "Hierarchy"],
294379
+ ["relationship", "Relationship"],
294380
+ ["matrix", "Matrix"],
294381
+ ["pyramid", "Pyramid"],
294382
+ ["picture", "Picture"],
294383
+ ["timeline", "Timeline"],
294384
+ ["textcard", "Text Card"],
294385
+ ["meettheteam", "Meet the Team"]
294386
+ ];
294387
+ function namedLayoutSections(accent1, currentId) {
294388
+ const library = smartArtBuiltinLayouts();
294389
+ if (!library) {
294390
+ return [];
294391
+ }
294392
+ const entries2 = library.listBuiltinSmartArtLayouts();
294393
+ return NAMED_CATEGORIES.flatMap(([category, heading]) => {
294394
+ const items = entries2.filter((entry5) => entry5.category === category).map((entry5) => ({
294395
+ id: entry5.id,
294396
+ labelKey: "pptx.gallery.smartArtLayouts.named",
294397
+ labelParams: { name: entry5.title },
294398
+ label: entry5.title,
294399
+ previewSvg: smartArtLayoutTileSvg(category, accent1, TILE7),
294400
+ applied: currentId === entry5.id
294401
+ }));
294402
+ return items.length === 0 ? [] : [
294403
+ {
294404
+ id: `named-${category}`,
294405
+ titleKey: SMARTART_LAYOUT_LABEL_KEYS[category],
294406
+ title: heading,
294407
+ columns: 5,
294408
+ tileWidth: TILE7.width,
294409
+ tileHeight: TILE7.height,
294410
+ items
294411
+ }
294412
+ ];
294413
+ });
294414
+ }
294247
294415
  var humanize = (id) => id.replace(/^./u, (c) => c.toUpperCase());
294248
294416
  var SMARTART_LAYOUTS_GALLERY = {
294249
294417
  build(ctx) {
@@ -294269,16 +294437,22 @@ var SMARTART_LAYOUTS_GALLERY = {
294269
294437
  previewSvg: smartArtLayoutTileSvg(type, accent1, TILE7),
294270
294438
  applied: current === type
294271
294439
  }))
294272
- }
294440
+ },
294441
+ ...namedLayoutSections(accent1, data?.layoutDefinition?.uniqueId)
294273
294442
  ]
294274
294443
  };
294275
294444
  },
294276
294445
  apply(itemId, ctx) {
294277
294446
  const element = ctx.element;
294278
- const type = SWITCHABLE_LAYOUT_TYPES.find((candidate) => candidate === itemId);
294279
- if (!type || element?.type !== "smartArt" || !element.smartArtData) {
294447
+ if (element?.type !== "smartArt" || !element.smartArtData) {
294280
294448
  return null;
294281
294449
  }
294450
+ const type = SWITCHABLE_LAYOUT_TYPES.find((candidate) => candidate === itemId);
294451
+ if (!type) {
294452
+ const named = smartArtBuiltinLayoutPatch(element.smartArtData, itemId);
294453
+ const patch2 = named ? smartArtElementPatch(element, named) : null;
294454
+ return patch2 ? { kind: "element", ...patch2 } : null;
294455
+ }
294282
294456
  if ((element.smartArtData.resolvedLayoutType ?? "list") === type) {
294283
294457
  return null;
294284
294458
  }
Binary file
Binary file
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkMRJZIBPQ_js = require('./chunk-MRJZIBPQ.js');
3
+ var chunkUHW3R465_js = require('./chunk-UHW3R465.js');
4
4
  var chunk4VNS5WPM_js = require('./chunk-4VNS5WPM.js');
5
5
  var mcp = require('pptx-viewer-mcp');
6
6
  var mcpSchemas = require('pptx-viewer-mcp/schemas');
@@ -20032,7 +20032,7 @@ async function buildSlideMarkdown(slides, slideIndex2, meta3, options = {}) {
20032
20032
  };
20033
20033
  let markdown;
20034
20034
  try {
20035
- const converter = new chunkMRJZIBPQ_js.PptxMarkdownConverter(
20035
+ const converter = new chunkUHW3R465_js.PptxMarkdownConverter(
20036
20036
  "",
20037
20037
  {
20038
20038
  sourceName: meta3.title ?? "deck.pptx",
@@ -20624,7 +20624,7 @@ var getTheme = (ctx) => {
20624
20624
  name: theme?.name,
20625
20625
  colorScheme: theme?.colorScheme,
20626
20626
  fontScheme: theme?.fontScheme,
20627
- availablePresets: Object.keys(chunkMRJZIBPQ_js.ThemePresets)
20627
+ availablePresets: Object.keys(chunkUHW3R465_js.ThemePresets)
20628
20628
  };
20629
20629
  };
20630
20630
  var readExecutors = {
@@ -21754,7 +21754,7 @@ function applyElementUpdate(el, u) {
21754
21754
  applyShapeStyleUpdate(el, u);
21755
21755
  }
21756
21756
  function applyTextUpdate(el, u) {
21757
- if (!chunkMRJZIBPQ_js.hasTextProperties(el)) {
21757
+ if (!chunkUHW3R465_js.hasTextProperties(el)) {
21758
21758
  return;
21759
21759
  }
21760
21760
  const textEl = el;
@@ -21800,7 +21800,7 @@ function applyShapeStyleUpdate(el, u) {
21800
21800
  if (u.fillColor === void 0 && u.strokeColor === void 0 && u.strokeWidth === void 0) {
21801
21801
  return;
21802
21802
  }
21803
- if (!chunkMRJZIBPQ_js.hasShapeProperties(el)) {
21803
+ if (!chunkUHW3R465_js.hasShapeProperties(el)) {
21804
21804
  return;
21805
21805
  }
21806
21806
  const holder = el;
Binary file
Binary file