pptx-react-viewer 4.42.0 → 4.43.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 (63) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/{AiChatPanel-IDP326YW.mjs → AiChatPanel-R5UTSMXU.mjs} +1 -1
  3. package/dist/AiChatPanel-R5UTSMXU.mjs.br +0 -0
  4. package/dist/AiChatPanel-R5UTSMXU.mjs.gz +0 -0
  5. package/dist/{AiChatPanel-KEVVVR7C.js → AiChatPanel-VI2IQ7XU.js} +9 -9
  6. package/dist/AiChatPanel-VI2IQ7XU.js.br +0 -0
  7. package/dist/AiChatPanel-VI2IQ7XU.js.gz +0 -0
  8. package/dist/{chunk-MNT2CXDI.mjs → chunk-3LIHPZKS.mjs} +22 -22
  9. package/dist/chunk-3LIHPZKS.mjs.br +0 -0
  10. package/dist/chunk-3LIHPZKS.mjs.gz +0 -0
  11. package/dist/{chunk-36H3P2PB.js → chunk-CHPELGQD.js} +384 -383
  12. package/dist/chunk-CHPELGQD.js.br +0 -0
  13. package/dist/chunk-CHPELGQD.js.gz +0 -0
  14. package/dist/{chunk-3PKYNJJG.js → chunk-FKY33ZKL.js} +21 -21
  15. package/dist/chunk-FKY33ZKL.js.br +0 -0
  16. package/dist/chunk-FKY33ZKL.js.gz +0 -0
  17. package/dist/{chunk-QJ4X7Y7S.js → chunk-GLWV52C6.js} +248 -245
  18. package/dist/chunk-GLWV52C6.js.br +0 -0
  19. package/dist/chunk-GLWV52C6.js.gz +0 -0
  20. package/dist/{chunk-MPKUCUHD.mjs → chunk-ITV63NJ5.mjs} +5 -4
  21. package/dist/chunk-ITV63NJ5.mjs.br +0 -0
  22. package/dist/chunk-ITV63NJ5.mjs.gz +0 -0
  23. package/dist/{chunk-EQTNWM5Y.mjs → chunk-UACDKMXF.mjs} +4 -1
  24. package/dist/chunk-UACDKMXF.mjs.br +0 -0
  25. package/dist/chunk-UACDKMXF.mjs.gz +0 -0
  26. package/dist/index.js +24 -24
  27. package/dist/index.js.br +0 -0
  28. package/dist/index.js.gz +0 -0
  29. package/dist/index.mjs +3 -3
  30. package/dist/index.mjs.br +0 -0
  31. package/dist/index.mjs.gz +0 -0
  32. package/dist/internals.js +81 -81
  33. package/dist/internals.js.br +0 -0
  34. package/dist/internals.js.gz +0 -0
  35. package/dist/internals.mjs +2 -2
  36. package/dist/internals.mjs.br +0 -0
  37. package/dist/internals.mjs.gz +0 -0
  38. package/dist/pptx-viewer.css +1 -1
  39. package/dist/pptx-viewer.css.br +0 -0
  40. package/dist/pptx-viewer.css.gz +0 -0
  41. package/dist/viewer/index.js +19 -19
  42. package/dist/viewer/index.js.br +0 -0
  43. package/dist/viewer/index.js.gz +0 -0
  44. package/dist/viewer/index.mjs +3 -3
  45. package/dist/viewer/index.mjs.br +0 -0
  46. package/dist/viewer/index.mjs.gz +0 -0
  47. package/package.json +8 -8
  48. package/dist/AiChatPanel-IDP326YW.mjs.br +0 -0
  49. package/dist/AiChatPanel-IDP326YW.mjs.gz +0 -0
  50. package/dist/AiChatPanel-KEVVVR7C.js.br +0 -0
  51. package/dist/AiChatPanel-KEVVVR7C.js.gz +0 -0
  52. package/dist/chunk-36H3P2PB.js.br +0 -0
  53. package/dist/chunk-36H3P2PB.js.gz +0 -0
  54. package/dist/chunk-3PKYNJJG.js.br +0 -0
  55. package/dist/chunk-3PKYNJJG.js.gz +0 -0
  56. package/dist/chunk-EQTNWM5Y.mjs.br +0 -0
  57. package/dist/chunk-EQTNWM5Y.mjs.gz +0 -0
  58. package/dist/chunk-MNT2CXDI.mjs.br +0 -0
  59. package/dist/chunk-MNT2CXDI.mjs.gz +0 -0
  60. package/dist/chunk-MPKUCUHD.mjs.br +0 -0
  61. package/dist/chunk-MPKUCUHD.mjs.gz +0 -0
  62. package/dist/chunk-QJ4X7Y7S.js.br +0 -0
  63. package/dist/chunk-QJ4X7Y7S.js.gz +0 -0
Binary file
Binary file
@@ -1437,10 +1437,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
1437
1437
  spanStyle.fontFamily = baseFontFamily;
1438
1438
  spanStyle.verticalAlign = baselineShift;
1439
1439
  spanStyle.fontKerning = fontKerning;
1440
- spanStyle.letterSpacing = pptx.pieceLetterSpacing(
1441
- authoredLetterSpacing,
1442
- pptx.resolveMetricTrackingPx(textValue, metricFont)
1443
- );
1440
+ spanStyle.letterSpacing = ctx.textBuildPiece ? run.style.letterSpacing : pptx.pieceLetterSpacing(authoredLetterSpacing, pptx.resolveMetricTrackingPx(textValue, metricFont));
1444
1441
  const hollow = pptx.hollowTextFillStyle(segmentStyle, {
1445
1442
  color: resolvedSegmentColor,
1446
1443
  textStroke: typeof spanStyle.WebkitTextStroke === "string" ? spanStyle.WebkitTextStroke : void 0
@@ -1452,6 +1449,9 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
1452
1449
  if (runRtl !== void 0) {
1453
1450
  spanStyle.direction = runRtl ? "rtl" : "ltr";
1454
1451
  spanStyle.unicodeBidi = runRtl !== ctx.paragraphRtl ? "bidi-override" : "embed";
1452
+ if (ctx.textBuildPiece && runRtl === true === (ctx.paragraphRtl === true)) {
1453
+ spanStyle.unicodeBidi = "normal";
1454
+ }
1455
1455
  }
1456
1456
  const isUnderlineWords = pptx.splitsUnderlineIntoWords(segmentStyle);
1457
1457
  const wordDecoration = isUnderlineWords ? nestedStyle ?? run.underlineWordPieces?.find((piece) => piece.style)?.style : void 0;
@@ -1481,7 +1481,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
1481
1481
  Boolean(segmentStyle.italic),
1482
1482
  { language: segmentStyle.language, rtl: ctx.paragraphRtl === true }
1483
1483
  ),
1484
- metricContext,
1484
+ ctx.textBuildPiece ? void 0 : metricContext,
1485
1485
  isUnderlineWords,
1486
1486
  wordDecoration
1487
1487
  );
@@ -1619,7 +1619,7 @@ function renderParagraph(para, paraIndex, paraCount, segments, ctx, subElementAn
1619
1619
  element.id,
1620
1620
  paraIndex,
1621
1621
  renderedRuns,
1622
- runs,
1622
+ para.runs,
1623
1623
  subElementAnimStates,
1624
1624
  // A staged build splits the paragraph but must not flatten it: each piece
1625
1625
  // is re-rendered through the SAME run renderer, so it keeps its run's
@@ -1627,7 +1627,7 @@ function renderParagraph(para, paraIndex, paraCount, segments, ctx, subElementAn
1627
1627
  (run, text, pieceKey) => renderParagraphRun(
1628
1628
  { ...run, text },
1629
1629
  segments[run.segmentIndex ?? -1],
1630
- runCtx,
1630
+ { ...runCtx, textBuildPiece: true },
1631
1631
  `-build-${pieceKey}`
1632
1632
  )
1633
1633
  );
@@ -1920,31 +1920,31 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
1920
1920
  function getConnectorPathGeometry(element) {
1921
1921
  return (0, dist_exports.getConnectorPathGeometry)(element);
1922
1922
  }
1923
- var ARROW_SIZE_SCALE = {
1924
- sm: 0.6,
1925
- med: 1,
1926
- lg: 1.5
1927
- };
1928
1923
  function renderConnectorMarker(markerId, arrowType, color, arrowWidth, arrowLength) {
1929
1924
  if (!arrowType || arrowType === "none") {
1930
1925
  return null;
1931
1926
  }
1932
- const wScale = ARROW_SIZE_SCALE[arrowWidth || "med"] ?? 1;
1933
- const lScale = ARROW_SIZE_SCALE[arrowLength || "med"] ?? 1;
1934
- const mw = Math.round(8 * lScale);
1935
- const mh = Math.round(8 * wScale);
1927
+ const shape = pptx.markerPath(arrowType, arrowWidth, arrowLength);
1936
1928
  return /* @__PURE__ */ jsxRuntime.jsx(
1937
1929
  "marker",
1938
1930
  {
1939
1931
  id: markerId,
1940
- markerWidth: mw,
1941
- markerHeight: mh,
1942
- refX: 8,
1932
+ markerWidth: shape.markerWidth,
1933
+ markerHeight: shape.markerHeight,
1934
+ refX: shape.refX,
1943
1935
  refY: 5,
1944
1936
  orient: "auto-start-reverse",
1945
1937
  viewBox: "0 0 10 10",
1946
1938
  markerUnits: "strokeWidth",
1947
- children: arrowType === "triangle" ? /* @__PURE__ */ jsxRuntime.jsx("polygon", { points: "0,0 10,5 0,10", fill: color }) : arrowType === "stealth" ? /* @__PURE__ */ jsxRuntime.jsx("polygon", { points: "0,0 10,5 0,10 3.4,5", fill: color }) : arrowType === "diamond" ? /* @__PURE__ */ jsxRuntime.jsx("polygon", { points: "0,5 5,0 10,5 5,10", fill: color }) : arrowType === "oval" ? /* @__PURE__ */ jsxRuntime.jsx("ellipse", { cx: 5, cy: 5, rx: 4, ry: 3.3, fill: color }) : /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0 0 L10 5 L0 10", fill: "none", stroke: color, strokeWidth: 1.6 })
1939
+ preserveAspectRatio: "none",
1940
+ children: shape.shape === "circle" ? /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: 5, cy: 5, r: 4, fill: color }) : /* @__PURE__ */ jsxRuntime.jsx(
1941
+ "path",
1942
+ {
1943
+ d: shape.d,
1944
+ fill: shape.strokeOnly ? "none" : color,
1945
+ stroke: shape.strokeOnly ? color : void 0
1946
+ }
1947
+ )
1948
1948
  }
1949
1949
  );
1950
1950
  }
@@ -2163,7 +2163,7 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
2163
2163
  fillColor,
2164
2164
  element.shapeStyle?.fillOpacity,
2165
2165
  strokePaint,
2166
- strokeWidth,
2166
+ pptx.isArrowedCustomPath(element) ? 0 : strokeWidth,
2167
2167
  dashArray,
2168
2168
  Boolean(animatesFill),
2169
2169
  // A freeform's `a:gradFill` needs a real SVG paint server: the
Binary file
Binary file