pptx-react-viewer 4.5.0 → 4.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/README.md +34 -33
  3. package/dist/{AiChatPanel-P2N6X2KB.js → AiChatPanel-3YILWCBX.js} +28 -28
  4. package/dist/AiChatPanel-3YILWCBX.js.br +0 -0
  5. package/dist/AiChatPanel-3YILWCBX.js.gz +0 -0
  6. package/dist/{AiChatPanel-HXGCZPUX.mjs → AiChatPanel-X2MVL5UP.mjs} +4 -4
  7. package/dist/AiChatPanel-X2MVL5UP.mjs.br +0 -0
  8. package/dist/AiChatPanel-X2MVL5UP.mjs.gz +0 -0
  9. package/dist/{Model3DScene-PIFMH2TU.js → Model3DScene-G7P6ZAIO.js} +2 -2
  10. package/dist/Model3DScene-G7P6ZAIO.js.br +0 -0
  11. package/dist/Model3DScene-G7P6ZAIO.js.gz +0 -0
  12. package/dist/{Model3DScene-QXMMJRV3.mjs → Model3DScene-QFWI5CEE.mjs} +1 -1
  13. package/dist/Model3DScene-QFWI5CEE.mjs.br +0 -0
  14. package/dist/Model3DScene-QFWI5CEE.mjs.gz +0 -0
  15. package/dist/{chunk-T35BGKZG.js → chunk-2BM4GBFZ.js} +5 -5
  16. package/dist/chunk-2BM4GBFZ.js.br +0 -0
  17. package/dist/chunk-2BM4GBFZ.js.gz +0 -0
  18. package/dist/{chunk-ZF5S3HHW.mjs → chunk-5J6NW3YS.mjs} +55 -28
  19. package/dist/chunk-5J6NW3YS.mjs.br +0 -0
  20. package/dist/chunk-5J6NW3YS.mjs.gz +0 -0
  21. package/dist/{chunk-LYZQLV7R.js → chunk-AQIXKTAT.js} +13881 -8722
  22. package/dist/chunk-AQIXKTAT.js.br +0 -0
  23. package/dist/chunk-AQIXKTAT.js.gz +0 -0
  24. package/dist/{chunk-DX2JCSQ4.mjs → chunk-E5OIDWHO.mjs} +1 -1
  25. package/dist/chunk-E5OIDWHO.mjs.br +0 -0
  26. package/dist/chunk-E5OIDWHO.mjs.gz +0 -0
  27. package/dist/{chunk-6FVYG27J.js → chunk-FYAOOACZ.js} +241 -214
  28. package/dist/chunk-FYAOOACZ.js.br +0 -0
  29. package/dist/chunk-FYAOOACZ.js.gz +0 -0
  30. package/dist/{chunk-PRXJ3J5W.mjs → chunk-OECUSL2B.mjs} +129 -311
  31. package/dist/chunk-OECUSL2B.mjs.br +0 -0
  32. package/dist/chunk-OECUSL2B.mjs.gz +0 -0
  33. package/dist/{chunk-VZNIVS3X.mjs → chunk-QLDHUKH2.mjs} +13808 -8718
  34. package/dist/chunk-QLDHUKH2.mjs.br +0 -0
  35. package/dist/chunk-QLDHUKH2.mjs.gz +0 -0
  36. package/dist/{chunk-Y4VRYQQS.js → chunk-SR7ETIBF.js} +931 -1112
  37. package/dist/chunk-SR7ETIBF.js.br +0 -0
  38. package/dist/chunk-SR7ETIBF.js.gz +0 -0
  39. package/dist/{chunk-IDV2ITXM.mjs → chunk-UBYFLXAU.mjs} +1383 -208
  40. package/dist/chunk-UBYFLXAU.mjs.br +0 -0
  41. package/dist/chunk-UBYFLXAU.mjs.gz +0 -0
  42. package/dist/{chunk-UMQV2432.js → chunk-UIAU3NR2.js} +45 -0
  43. package/dist/chunk-UIAU3NR2.js.br +0 -0
  44. package/dist/chunk-UIAU3NR2.js.gz +0 -0
  45. package/dist/{chunk-UZFCFYK6.js → chunk-VF4RA27Q.js} +3245 -2070
  46. package/dist/chunk-VF4RA27Q.js.br +0 -0
  47. package/dist/chunk-VF4RA27Q.js.gz +0 -0
  48. package/dist/{chunk-APAVAD2A.mjs → chunk-WIEBQGQI.mjs} +45 -0
  49. package/dist/chunk-WIEBQGQI.mjs.br +0 -0
  50. package/dist/chunk-WIEBQGQI.mjs.gz +0 -0
  51. package/dist/i18n/de.cjs +71 -21
  52. package/dist/i18n/de.cjs.br +0 -0
  53. package/dist/i18n/de.cjs.gz +0 -0
  54. package/dist/i18n/de.mjs +71 -21
  55. package/dist/i18n/de.mjs.br +0 -0
  56. package/dist/i18n/de.mjs.gz +0 -0
  57. package/dist/i18n/es.cjs +71 -21
  58. package/dist/i18n/es.cjs.br +0 -0
  59. package/dist/i18n/es.cjs.gz +0 -0
  60. package/dist/i18n/es.mjs +71 -21
  61. package/dist/i18n/es.mjs.br +0 -0
  62. package/dist/i18n/es.mjs.gz +0 -0
  63. package/dist/i18n/fr.cjs +71 -21
  64. package/dist/i18n/fr.cjs.br +0 -0
  65. package/dist/i18n/fr.cjs.gz +0 -0
  66. package/dist/i18n/fr.mjs +71 -21
  67. package/dist/i18n/fr.mjs.br +0 -0
  68. package/dist/i18n/fr.mjs.gz +0 -0
  69. package/dist/i18n/zh-CN.cjs +49 -4
  70. package/dist/i18n/zh-CN.cjs.br +0 -0
  71. package/dist/i18n/zh-CN.cjs.gz +0 -0
  72. package/dist/i18n/zh-CN.mjs +49 -4
  73. package/dist/i18n/zh-CN.mjs.br +0 -0
  74. package/dist/i18n/zh-CN.mjs.gz +0 -0
  75. package/dist/i18n.js +4 -4
  76. package/dist/i18n.js.br +0 -0
  77. package/dist/i18n.js.gz +0 -0
  78. package/dist/i18n.mjs +1 -1
  79. package/dist/i18n.mjs.br +0 -0
  80. package/dist/i18n.mjs.gz +0 -0
  81. package/dist/index.d.ts +438 -13
  82. package/dist/index.js +105 -49
  83. package/dist/index.js.br +0 -0
  84. package/dist/index.js.gz +0 -0
  85. package/dist/index.mjs +6 -6
  86. package/dist/index.mjs.br +0 -0
  87. package/dist/index.mjs.gz +0 -0
  88. package/dist/internals.d.ts +501 -15
  89. package/dist/internals.js +105 -105
  90. package/dist/internals.js.br +0 -0
  91. package/dist/internals.js.gz +0 -0
  92. package/dist/internals.mjs +4 -4
  93. package/dist/internals.mjs.br +0 -0
  94. package/dist/internals.mjs.gz +0 -0
  95. package/dist/pptx-viewer.css +1 -1
  96. package/dist/pptx-viewer.css.br +0 -0
  97. package/dist/pptx-viewer.css.gz +0 -0
  98. package/dist/viewer/index.d.ts +515 -12
  99. package/dist/viewer/index.js +27 -27
  100. package/dist/viewer/index.js.br +0 -0
  101. package/dist/viewer/index.js.gz +0 -0
  102. package/dist/viewer/index.mjs +6 -6
  103. package/dist/viewer/index.mjs.br +3 -4
  104. package/dist/viewer/index.mjs.gz +0 -0
  105. package/package.json +1 -1
  106. package/dist/AiChatPanel-HXGCZPUX.mjs.br +0 -0
  107. package/dist/AiChatPanel-HXGCZPUX.mjs.gz +0 -0
  108. package/dist/AiChatPanel-P2N6X2KB.js.br +0 -0
  109. package/dist/AiChatPanel-P2N6X2KB.js.gz +0 -0
  110. package/dist/Model3DScene-PIFMH2TU.js.br +0 -0
  111. package/dist/Model3DScene-PIFMH2TU.js.gz +0 -0
  112. package/dist/Model3DScene-QXMMJRV3.mjs.br +0 -0
  113. package/dist/Model3DScene-QXMMJRV3.mjs.gz +0 -0
  114. package/dist/chunk-6FVYG27J.js.br +0 -0
  115. package/dist/chunk-6FVYG27J.js.gz +0 -0
  116. package/dist/chunk-APAVAD2A.mjs.br +0 -0
  117. package/dist/chunk-APAVAD2A.mjs.gz +0 -0
  118. package/dist/chunk-DX2JCSQ4.mjs.br +0 -0
  119. package/dist/chunk-DX2JCSQ4.mjs.gz +0 -0
  120. package/dist/chunk-IDV2ITXM.mjs.br +0 -0
  121. package/dist/chunk-IDV2ITXM.mjs.gz +0 -0
  122. package/dist/chunk-LYZQLV7R.js.br +0 -0
  123. package/dist/chunk-LYZQLV7R.js.gz +0 -0
  124. package/dist/chunk-PRXJ3J5W.mjs.br +0 -0
  125. package/dist/chunk-PRXJ3J5W.mjs.gz +0 -0
  126. package/dist/chunk-T35BGKZG.js.br +0 -0
  127. package/dist/chunk-T35BGKZG.js.gz +0 -0
  128. package/dist/chunk-UMQV2432.js.br +0 -0
  129. package/dist/chunk-UMQV2432.js.gz +0 -0
  130. package/dist/chunk-UZFCFYK6.js.br +0 -0
  131. package/dist/chunk-UZFCFYK6.js.gz +0 -0
  132. package/dist/chunk-VZNIVS3X.mjs.br +0 -0
  133. package/dist/chunk-VZNIVS3X.mjs.gz +0 -0
  134. package/dist/chunk-Y4VRYQQS.js.br +0 -0
  135. package/dist/chunk-Y4VRYQQS.js.gz +0 -0
  136. package/dist/chunk-ZF5S3HHW.mjs.br +0 -0
  137. package/dist/chunk-ZF5S3HHW.mjs.gz +0 -0
@@ -1,5 +1,5 @@
1
- import { SHAPE_PRESET_DEFS, VIEWER_SHORTCUT_REFERENCE, STROKE_DASH_OPTIONS, getAnimationInitialStyle, cloneHistorySnapshot, hasShapeProperties, getImageFitStyle, getImageFillCounterTransform, getComputedFillStyle, isImageLikeElement, getCropShapeClipPath, getImageTilingStyle, mediaPlaybackAttributes, getOnlineVideoEmbed, ONLINE_VIDEO_IFRAME_SANDBOX, ONLINE_VIDEO_IFRAME_ALLOW, buildTextBlockStyle, hasTextProperties, toCssWritingMode, toCssTextOrientation, toCssVerticalDirection, buildTextBodyLayoutStyle, buildTextBody3DSceneStyle, buildParagraphs, colorWithOpacity, normalizeHexColor, hexToRgbUnit, build3DExtrusionData, getComputedEffectStyle, getComputedStrokeStyle, getAnimationColorBaseStyle, isStrokeOnlyPresetElement, resolveShapeGeometry, getConnectorPathGeometry, normalizeStrokeDashType, getSvgStrokeDasharray, buildSvgGradientDef, buildStrokeOutline, getPresetShapeVectorGeometry, isWedgeCalloutPresetShape, svgGradientFillRef, isCalloutShape, getCalloutLeaderLineGeometry, buildCalloutLeaderLineSvgPath, getCalloutViewBoxBounds, svgLineCap, getCompoundLineOffsets, getCompoundLineWidths, canDrillDown, computeSelectionRect, DEFAULT_FONT_FAMILY, cellStyleToCss, rectToCells, isCellInRect, tableContainerCss, buildChartViewModel, resolveChartKind, chartPreserveAspectRatio, buildNotesPdfBytes, buildTiledSlidesPdfBytes, buildPreviewAnimation, buildMotionPathPreview, mediaFallbackVisual, scheduleMediaTrimAndFade, registerCrossSlideAudio, shouldShowMediaFullscreenStopButton, withInlineListDecorationDefaults, segmentStyleToCss, resolveAutoFitFontScale, applyUnderlineVariant, nestedTextDecorationStyle, scaleFontSizeForAutoFit, resolveFontKerning, getSubstituteFontFamily, parsePanoseString, resolveScriptFontSet, hasDistinctScriptFonts, pieceLetterSpacing, resolveMetricTrackingPx, hollowTextFillStyle, stripUnderlineDecoration, buildTabContext, TEXT_BUILD_ID_SEP, buildTextBuildSpec, textBuildSpanStyle, apply3dEffects, customGeometryPathsToSvgSubpaths, buildSubpathPaints, computeColumnBoundaries, getTableCellBandStyle, parseDrawingColor, parseDrawingColorOpacity, getCellDiagonalBorders, xmlText, cellRunStyle, getChartStylePalette, computeChartLegendLayout, mediaFallbackIcon, mediaFallbackLabelKey, MEDIA_CHROME_ATTRIBUTE, convertOmmlToMathMl, sanitizeMathMl, tableCellCss, computeResizedColumnWidths, computeResizedRowHeight, DEFAULT_ROW_HEIGHT, ooxmlGradientAngleToCssDegrees, buildRectPathGradient, buildRunTabLines, chartPartToAttrs, splitWordsForUnderline, splitRunForMetrics, splitRunByScriptFont } from './chunk-VZNIVS3X.mjs';
2
- import { translationsEn } from './chunk-APAVAD2A.mjs';
1
+ import { SHAPE_PRESET_DEFS, VIEWER_SHORTCUT_REFERENCE, STROKE_DASH_OPTIONS, getAnimationInitialStyle, cloneHistorySnapshot, hasShapeProperties, getImageFitStyle, getImageFillCounterTransform, getComputedFillStyle, isImageLikeElement, getCropShapeClipPath, getImageTilingStyle, mediaPlaybackAttributes, getOnlineVideoEmbed, ONLINE_VIDEO_IFRAME_SANDBOX, ONLINE_VIDEO_IFRAME_ALLOW, buildTextBlockStyle, hasTextProperties, toCssWritingMode, toCssTextOrientation, toCssVerticalDirection, buildTextBodyLayoutStyle, buildTextBody3DSceneStyle, buildParagraphs, colorWithOpacity, normalizeHexColor, hexToRgbUnit, build3DExtrusionData, getComputedEffectStyle, getComputedStrokeStyle, getAnimationColorBaseStyle, isStrokeOnlyPresetElement, resolveShapeGeometry, getConnectorPathGeometry, normalizeStrokeDashType, getSvgStrokeDasharray, buildSvgGradientDef, buildStrokeOutline, getPresetShapeVectorGeometry, isWedgeCalloutPresetShape, svgGradientFillRef, isCalloutShape, getCalloutLeaderLineGeometry, buildCalloutLeaderLineSvgPath, getCalloutViewBoxBounds, svgLineCap, getCompoundLineOffsets, getCompoundLineWidths, canDrillDown, computeSelectionRect, DEFAULT_FONT_FAMILY, cellStyleToCss, rectToCells, isCellInRect, tableContainerCss, buildChartViewModel, resolveChartKind, chartPreserveAspectRatio, buildNotesPdfBytes, buildTiledSlidesPdfBytes, buildPreviewAnimation, buildMotionPathPreview, mediaFallbackVisual, scheduleMediaTrimAndFade, registerCrossSlideAudio, shouldShowMediaFullscreenStopButton, withInlineListDecorationDefaults, segmentStyleToCss, resolveAutoFitFontScale, applyUnderlineVariant, nestedTextDecorationStyle, scaleFontSizeForAutoFit, resolveFontKerning, getSubstituteFontFamily, parsePanoseString, resolveScriptFontSet, hasDistinctScriptFonts, pieceLetterSpacing, resolveMetricTrackingPx, hollowTextFillStyle, splitsUnderlineIntoWords, stripUnderlineDecoration, buildTabContext, TEXT_BUILD_ID_SEP, buildTextBuildSpec, textBuildSpanStyle, apply3dEffects, customGeometryPathsToSvgSubpaths, buildSubpathPaints, computeColumnBoundaries, getTableCellBandStyle, parseDrawingColor, parseDrawingColorOpacity, getCellDiagonalBorders, xmlText, cellRunStyle, getChartStylePalette, computeChartLegendLayout, mediaFallbackIcon, mediaFallbackLabelKey, MEDIA_CHROME_ATTRIBUTE, convertOmmlToMathMl, sanitizeMathMl, tableCellCss, computeResizedColumnWidths, computeResizedRowHeight, DEFAULT_ROW_HEIGHT, ooxmlGradientAngleToCssDegrees, buildRectPathGradient, buildRunTabLines, chartPartToAttrs, splitWordsForUnderline, splitRunForMetrics, splitRunByScriptFont } from './chunk-QLDHUKH2.mjs';
2
+ import { translationsEn } from './chunk-WIEBQGQI.mjs';
3
3
  import { clsx } from 'clsx';
4
4
  import { twMerge } from 'tailwind-merge';
5
5
  import React7, { useRef, useState, useEffect, useCallback, useMemo, useLayoutEffect } from 'react';
@@ -1418,7 +1418,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
1418
1418
  spanStyle.direction = runRtl ? "rtl" : "ltr";
1419
1419
  spanStyle.unicodeBidi = runRtl !== ctx.paragraphRtl ? "bidi-override" : "embed";
1420
1420
  }
1421
- const isUnderlineWords = Boolean(segmentStyle.underline) && segmentStyle.underlineStyle === "words";
1421
+ const isUnderlineWords = splitsUnderlineIntoWords(segmentStyle);
1422
1422
  const wordDecoration = isUnderlineWords ? nestedStyle ?? run.underlineWordPieces?.find((piece) => piece.style)?.style : void 0;
1423
1423
  if (isUnderlineWords) {
1424
1424
  const stripped = stripUnderlineDecoration(spanStyle);
@@ -1443,7 +1443,8 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
1443
1443
  baseFontSize,
1444
1444
  baseFontFamily,
1445
1445
  Boolean(segmentStyle.bold),
1446
- Boolean(segmentStyle.italic)
1446
+ Boolean(segmentStyle.italic),
1447
+ { language: segmentStyle.language, rtl: ctx.paragraphRtl === true }
1447
1448
  ),
1448
1449
  metricContext,
1449
1450
  isUnderlineWords,
@@ -2027,7 +2028,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
2027
2028
  "svg",
2028
2029
  {
2029
2030
  viewBox: `0 0 ${pathWidth} ${pathHeight}`,
2030
- className: "w-full h-full pointer-events-none",
2031
+ className: "absolute inset-0 w-full h-full pointer-events-none",
2031
2032
  preserveAspectRatio: "none",
2032
2033
  children: [
2033
2034
  animatesFill ? null : renderSvgGradientDefs(gradient),
@@ -3422,6 +3423,9 @@ function renderTableElement(element, textStyle, options) {
3422
3423
  }
3423
3424
  );
3424
3425
  }
3426
+ function renderGradientStops(stops) {
3427
+ return stops.map((stop, i) => /* @__PURE__ */ jsx("stop", { offset: stop.offset, stopColor: stop.color, stopOpacity: stop.opacity }, i));
3428
+ }
3425
3429
  function partAttrs(part) {
3426
3430
  return part ? chartPartToAttrs(part) : void 0;
3427
3431
  }
@@ -3599,29 +3603,52 @@ function renderChartViewModel(elementId, vm, preserveAspectRatio = "none") {
3599
3603
  viewBox: `0 0 ${vm.svgWidth} ${vm.svgHeight}`,
3600
3604
  preserveAspectRatio,
3601
3605
  children: [
3602
- vm.defs && vm.defs.length > 0 && /* @__PURE__ */ jsx("defs", { children: vm.defs.map((def, i) => /* @__PURE__ */ jsx(
3603
- "pattern",
3604
- {
3605
- id: def.id,
3606
- patternUnits: def.patternUnits,
3607
- x: def.x,
3608
- y: def.y,
3609
- width: def.width,
3610
- height: def.height,
3611
- children: /* @__PURE__ */ jsx(
3612
- "image",
3613
- {
3614
- href: def.href,
3615
- x: 0,
3616
- y: 0,
3617
- width: def.width,
3618
- height: def.height,
3619
- preserveAspectRatio: def.preserveAspectRatio
3620
- }
3621
- )
3622
- },
3623
- `${elementId}-def-${i}`
3624
- )) }),
3606
+ vm.defs && vm.defs.length > 0 && /* @__PURE__ */ jsx("defs", { children: vm.defs.map(
3607
+ (def, i) => def.kind === "linearGradient" ? /* @__PURE__ */ jsx(
3608
+ "linearGradient",
3609
+ {
3610
+ id: def.id,
3611
+ x1: def.x1,
3612
+ y1: def.y1,
3613
+ x2: def.x2,
3614
+ y2: def.y2,
3615
+ children: renderGradientStops(def.stops)
3616
+ },
3617
+ `${elementId}-def-${i}`
3618
+ ) : def.kind === "radialGradient" ? /* @__PURE__ */ jsx(
3619
+ "radialGradient",
3620
+ {
3621
+ id: def.id,
3622
+ cx: def.cx,
3623
+ cy: def.cy,
3624
+ r: def.r,
3625
+ children: renderGradientStops(def.stops)
3626
+ },
3627
+ `${elementId}-def-${i}`
3628
+ ) : /* @__PURE__ */ jsx(
3629
+ "pattern",
3630
+ {
3631
+ id: def.id,
3632
+ patternUnits: def.patternUnits,
3633
+ x: def.x,
3634
+ y: def.y,
3635
+ width: def.width,
3636
+ height: def.height,
3637
+ children: /* @__PURE__ */ jsx(
3638
+ "image",
3639
+ {
3640
+ href: def.href,
3641
+ x: 0,
3642
+ y: 0,
3643
+ width: def.width,
3644
+ height: def.height,
3645
+ preserveAspectRatio: def.preserveAspectRatio
3646
+ }
3647
+ )
3648
+ },
3649
+ `${elementId}-def-${i}`
3650
+ )
3651
+ ) }),
3625
3652
  vm.areaFill && /* @__PURE__ */ jsx(
3626
3653
  "rect",
3627
3654
  {
Binary file
Binary file