pptx-react-viewer 2.6.2 → 2.6.4

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 (96) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/{AiChatPanel-5IAXQYGH.mjs → AiChatPanel-5JEL2M7L.mjs} +3 -3
  3. package/dist/AiChatPanel-5JEL2M7L.mjs.br +0 -0
  4. package/dist/AiChatPanel-5JEL2M7L.mjs.gz +0 -0
  5. package/dist/{AiChatPanel-IC2Q3H3N.js → AiChatPanel-GMP3TU7S.js} +22 -22
  6. package/dist/AiChatPanel-GMP3TU7S.js.br +0 -0
  7. package/dist/AiChatPanel-GMP3TU7S.js.gz +0 -0
  8. package/dist/{Model3DScene-GOFY2PQS.js → Model3DScene-E4WWASL7.js} +2 -2
  9. package/dist/Model3DScene-E4WWASL7.js.br +0 -0
  10. package/dist/Model3DScene-E4WWASL7.js.gz +0 -0
  11. package/dist/{Model3DScene-UEU7L4QY.mjs → Model3DScene-LPA4HGFY.mjs} +1 -1
  12. package/dist/Model3DScene-LPA4HGFY.mjs.br +0 -0
  13. package/dist/Model3DScene-LPA4HGFY.mjs.gz +0 -0
  14. package/dist/{SurfaceChart3DScene-5TILKZMY.js → SurfaceChart3DScene-EOJ6FO7H.js} +2 -2
  15. package/dist/SurfaceChart3DScene-EOJ6FO7H.js.br +0 -0
  16. package/dist/SurfaceChart3DScene-EOJ6FO7H.js.gz +0 -0
  17. package/dist/{SurfaceChart3DScene-KCJUDJUK.mjs → SurfaceChart3DScene-JT64KYVP.mjs} +1 -1
  18. package/dist/{SurfaceChart3DScene-KCJUDJUK.mjs.br → SurfaceChart3DScene-JT64KYVP.mjs.br} +0 -0
  19. package/dist/SurfaceChart3DScene-JT64KYVP.mjs.gz +0 -0
  20. package/dist/{chunk-UV5R7IQY.mjs → chunk-A3WQ6JDW.mjs} +2 -2
  21. package/dist/chunk-A3WQ6JDW.mjs.br +0 -0
  22. package/dist/chunk-A3WQ6JDW.mjs.gz +0 -0
  23. package/dist/{chunk-W27U3GQS.js → chunk-CZPAFVPN.js} +323 -317
  24. package/dist/chunk-CZPAFVPN.js.br +0 -0
  25. package/dist/chunk-CZPAFVPN.js.gz +0 -0
  26. package/dist/{chunk-IGYK3NK5.js → chunk-D754TQ4S.js} +3 -3
  27. package/dist/chunk-D754TQ4S.js.br +0 -0
  28. package/dist/{chunk-IGYK3NK5.js.gz → chunk-D754TQ4S.js.gz} +0 -0
  29. package/dist/{chunk-Y6H2RSLB.mjs → chunk-GMW7VRFD.mjs} +38 -19
  30. package/dist/chunk-GMW7VRFD.mjs.br +0 -0
  31. package/dist/{chunk-Y6H2RSLB.mjs.gz → chunk-GMW7VRFD.mjs.gz} +0 -0
  32. package/dist/{chunk-Y4TIW2MM.mjs → chunk-HHUBO5OD.mjs} +1 -1
  33. package/dist/chunk-HHUBO5OD.mjs.br +0 -0
  34. package/dist/chunk-HHUBO5OD.mjs.gz +0 -0
  35. package/dist/{chunk-TMU7Z3CU.js → chunk-K26WJWSH.js} +850 -851
  36. package/dist/chunk-K26WJWSH.js.br +0 -0
  37. package/dist/chunk-K26WJWSH.js.gz +0 -0
  38. package/dist/{chunk-MQYNBEOY.mjs → chunk-MVXW7BHH.mjs} +10 -4
  39. package/dist/chunk-MVXW7BHH.mjs.br +0 -0
  40. package/dist/chunk-MVXW7BHH.mjs.gz +0 -0
  41. package/dist/{chunk-XROVGBFQ.js → chunk-NZYSI3BL.js} +236 -236
  42. package/dist/chunk-NZYSI3BL.js.br +0 -0
  43. package/dist/chunk-NZYSI3BL.js.gz +0 -0
  44. package/dist/{chunk-LJPRMPNA.mjs → chunk-PQDHPMQG.mjs} +14 -15
  45. package/dist/chunk-PQDHPMQG.mjs.br +0 -0
  46. package/dist/chunk-PQDHPMQG.mjs.gz +0 -0
  47. package/dist/{chunk-G7PJSVUS.js → chunk-Z2ZC5QTJ.js} +38 -19
  48. package/dist/chunk-Z2ZC5QTJ.js.br +0 -0
  49. package/dist/{chunk-G7PJSVUS.js.gz → chunk-Z2ZC5QTJ.js.gz} +0 -0
  50. package/dist/index.js +34 -34
  51. package/dist/index.js.br +0 -0
  52. package/dist/index.js.gz +0 -0
  53. package/dist/index.mjs +5 -5
  54. package/dist/index.mjs.br +0 -0
  55. package/dist/index.mjs.gz +0 -0
  56. package/dist/internals.js +78 -78
  57. package/dist/internals.js.br +0 -0
  58. package/dist/internals.js.gz +0 -0
  59. package/dist/internals.mjs +3 -3
  60. package/dist/internals.mjs.br +0 -0
  61. package/dist/internals.mjs.gz +0 -0
  62. package/dist/viewer/index.js +21 -21
  63. package/dist/viewer/index.js.br +0 -0
  64. package/dist/viewer/index.js.gz +0 -0
  65. package/dist/viewer/index.mjs +5 -5
  66. package/dist/viewer/index.mjs.br +0 -0
  67. package/dist/viewer/index.mjs.gz +0 -0
  68. package/package.json +1 -1
  69. package/dist/AiChatPanel-5IAXQYGH.mjs.br +0 -0
  70. package/dist/AiChatPanel-5IAXQYGH.mjs.gz +0 -0
  71. package/dist/AiChatPanel-IC2Q3H3N.js.br +0 -0
  72. package/dist/AiChatPanel-IC2Q3H3N.js.gz +0 -0
  73. package/dist/Model3DScene-GOFY2PQS.js.br +0 -0
  74. package/dist/Model3DScene-GOFY2PQS.js.gz +0 -0
  75. package/dist/Model3DScene-UEU7L4QY.mjs.br +0 -0
  76. package/dist/Model3DScene-UEU7L4QY.mjs.gz +0 -0
  77. package/dist/SurfaceChart3DScene-5TILKZMY.js.br +0 -0
  78. package/dist/SurfaceChart3DScene-5TILKZMY.js.gz +0 -0
  79. package/dist/SurfaceChart3DScene-KCJUDJUK.mjs.gz +0 -0
  80. package/dist/chunk-G7PJSVUS.js.br +0 -0
  81. package/dist/chunk-IGYK3NK5.js.br +0 -0
  82. package/dist/chunk-LJPRMPNA.mjs.br +0 -0
  83. package/dist/chunk-LJPRMPNA.mjs.gz +0 -0
  84. package/dist/chunk-MQYNBEOY.mjs.br +0 -0
  85. package/dist/chunk-MQYNBEOY.mjs.gz +0 -0
  86. package/dist/chunk-TMU7Z3CU.js.br +0 -0
  87. package/dist/chunk-TMU7Z3CU.js.gz +0 -0
  88. package/dist/chunk-UV5R7IQY.mjs.br +0 -0
  89. package/dist/chunk-UV5R7IQY.mjs.gz +0 -0
  90. package/dist/chunk-W27U3GQS.js.br +0 -0
  91. package/dist/chunk-W27U3GQS.js.gz +0 -0
  92. package/dist/chunk-XROVGBFQ.js.br +0 -0
  93. package/dist/chunk-XROVGBFQ.js.gz +0 -0
  94. package/dist/chunk-Y4TIW2MM.mjs.br +0 -0
  95. package/dist/chunk-Y4TIW2MM.mjs.gz +0 -0
  96. package/dist/chunk-Y6H2RSLB.mjs.br +0 -0
Binary file
Binary file
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkG7PJSVUS_js = require('./chunk-G7PJSVUS.js');
3
+ var chunkZ2ZC5QTJ_js = require('./chunk-Z2ZC5QTJ.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');
@@ -14879,7 +14879,7 @@ async function buildSlideMarkdown(slides, slideIndex2, meta3, options = {}) {
14879
14879
  };
14880
14880
  let markdown;
14881
14881
  try {
14882
- const converter = new chunkG7PJSVUS_js.PptxMarkdownConverter(
14882
+ const converter = new chunkZ2ZC5QTJ_js.PptxMarkdownConverter(
14883
14883
  "",
14884
14884
  {
14885
14885
  sourceName: meta3.title ?? "deck.pptx",
@@ -15470,7 +15470,7 @@ var getTheme = (ctx) => {
15470
15470
  name: theme?.name,
15471
15471
  colorScheme: theme?.colorScheme,
15472
15472
  fontScheme: theme?.fontScheme,
15473
- availablePresets: Object.keys(chunkG7PJSVUS_js.ThemePresets)
15473
+ availablePresets: Object.keys(chunkZ2ZC5QTJ_js.ThemePresets)
15474
15474
  };
15475
15475
  };
15476
15476
  var readExecutors = {
Binary file
@@ -98258,6 +98258,7 @@ function interpolateOutline(from, to, t) {
98258
98258
  }
98259
98259
  var MORPH_EASING = "cubic-bezier(0.4, 0, 0.2, 1)";
98260
98260
  var PROXIMITY_THRESHOLD = 300;
98261
+ var PROXIMITY_SIZE_RATIO_LIMIT = 2;
98261
98262
  var GEOMETRY_MORPH_STEPS = 8;
98262
98263
  function shouldGeometryMorph(pair) {
98263
98264
  const fromType = pair.fromElement.shapeType;
@@ -98383,6 +98384,11 @@ function matchMorphElementsFull(fromSlide, toSlide) {
98383
98384
  if (fromEl.type !== toEl.type) {
98384
98385
  continue;
98385
98386
  }
98387
+ const widthRatio = Math.max(fromEl.width, toEl.width, 1) / Math.max(Math.min(fromEl.width, toEl.width), 1);
98388
+ const heightRatio = Math.max(fromEl.height, toEl.height, 1) / Math.max(Math.min(fromEl.height, toEl.height), 1);
98389
+ if (widthRatio > PROXIMITY_SIZE_RATIO_LIMIT || heightRatio > PROXIMITY_SIZE_RATIO_LIMIT) {
98390
+ continue;
98391
+ }
98386
98392
  const dx = fromEl.x - toEl.x;
98387
98393
  const dy = fromEl.y - toEl.y;
98388
98394
  const dist2 = Math.sqrt(dx * dx + dy * dy);
@@ -98639,20 +98645,22 @@ function generateMorphAnimations(pairs2, durationMs, _mode = "object") {
98639
98645
  for (let index = 0; index < pairs2.length; index++) {
98640
98646
  const { fromElement, toElement } = pairs2[index];
98641
98647
  const safeName = `pptx-morph-${index}-${toElement.id.replace(/[^a-zA-Z0-9]/gu, "")}`;
98642
- const dx = fromElement.x - toElement.x;
98643
- const dy = fromElement.y - toElement.y;
98648
+ const dx = fromElement.x + fromElement.width / 2 - (toElement.x + toElement.width / 2);
98649
+ const dy = fromElement.y + fromElement.height / 2 - (toElement.y + toElement.height / 2);
98644
98650
  const sx = Math.max(fromElement.width, 1) / Math.max(toElement.width, 1);
98645
98651
  const sy = Math.max(fromElement.height, 1) / Math.max(toElement.height, 1);
98646
- const dr = (fromElement.rotation ?? 0) - (toElement.rotation ?? 0);
98647
98652
  const fromOpacity = fromElement.opacity ?? 1;
98648
98653
  const toOpacity = toElement.opacity ?? 1;
98654
+ const fromRot = fromElement.rotation ?? 0;
98655
+ const toRot = toElement.rotation ?? 0;
98656
+ const flips = `${toElement.flipHorizontal ? " scaleX(-1)" : ""}${toElement.flipVertical ? " scaleY(-1)" : ""}`;
98649
98657
  const crossfades = morphPairNeedsCrossfade(fromElement, toElement);
98650
98658
  const fromProps = [
98651
- ` transform: translate(${dx}px, ${dy}px) scale(${sx}, ${sy}) rotate(${dr}deg);`,
98659
+ ` transform: translate(${dx}px, ${dy}px) scale(${sx}, ${sy}) rotate(${fromRot}deg)${flips};`,
98652
98660
  ` opacity: ${crossfades ? 0 : fromOpacity};`
98653
98661
  ];
98654
98662
  const toProps = [
98655
- " transform: translate(0, 0) scale(1, 1) rotate(0deg);",
98663
+ ` transform: translate(0, 0) scale(1, 1) rotate(${toRot}deg)${flips};`,
98656
98664
  ` opacity: ${toOpacity};`
98657
98665
  ];
98658
98666
  const colorInterp = buildColorInterpolationProps(fromElement, toElement);
@@ -98688,23 +98696,23 @@ function generateMorphGhostAnimations(pairs2, durationMs, startIndex) {
98688
98696
  const { fromElement, toElement } = pairs2[index];
98689
98697
  const fadesOut = morphPairNeedsCrossfade(fromElement, toElement);
98690
98698
  const safeName = `pptx-morph-ghost-${startIndex + index}-${fromElement.id.replace(/[^a-zA-Z0-9]/gu, "")}`;
98691
- const dx = toElement.x - fromElement.x;
98692
- const dy = toElement.y - fromElement.y;
98699
+ const dx = toElement.x + toElement.width / 2 - (fromElement.x + fromElement.width / 2);
98700
+ const dy = toElement.y + toElement.height / 2 - (fromElement.y + fromElement.height / 2);
98693
98701
  const sx = Math.max(toElement.width, 1) / Math.max(fromElement.width, 1);
98694
98702
  const sy = Math.max(toElement.height, 1) / Math.max(fromElement.height, 1);
98695
- const dr = (toElement.rotation ?? 0) - (fromElement.rotation ?? 0);
98696
- const originX = fromElement.x + fromElement.width / 2;
98697
- const originY = fromElement.y + fromElement.height / 2;
98703
+ const fromRot = fromElement.rotation ?? 0;
98704
+ const toRot = toElement.rotation ?? 0;
98705
+ const flips = `${fromElement.flipHorizontal ? " scaleX(-1)" : ""}${fromElement.flipVertical ? " scaleY(-1)" : ""}`;
98698
98706
  const keyframes = `
98699
98707
  @keyframes ${safeName} {
98700
98708
  from {
98701
- transform-origin: ${originX}px ${originY}px;
98702
- transform: translate(0, 0) scale(1, 1) rotate(0deg);
98709
+ transform-origin: center;
98710
+ transform: translate(0, 0) scale(1, 1) rotate(${fromRot}deg)${flips};
98703
98711
  opacity: ${fromElement.opacity ?? 1};
98704
98712
  }
98705
98713
  to {
98706
- transform-origin: ${originX}px ${originY}px;
98707
- transform: translate(${dx}px, ${dy}px) scale(${sx}, ${sy}) rotate(${dr}deg);
98714
+ transform-origin: center;
98715
+ transform: translate(${dx}px, ${dy}px) scale(${sx}, ${sy}) rotate(${toRot}deg)${flips};
98708
98716
  opacity: ${fadesOut ? 0 : fromElement.opacity ?? 1};
98709
98717
  }
98710
98718
  }`;
@@ -98716,6 +98724,10 @@ function generateMorphGhostAnimations(pairs2, durationMs, startIndex) {
98716
98724
  }
98717
98725
  return animations;
98718
98726
  }
98727
+ function staticTransformSuffix(el) {
98728
+ const rot = el.rotation ?? 0;
98729
+ return ` rotate(${rot}deg)${el.flipHorizontal ? " scaleX(-1)" : ""}${el.flipVertical ? " scaleY(-1)" : ""}`;
98730
+ }
98719
98731
  function generateUnmatchedFadeOutAnimations(elements, durationMs, startIndex) {
98720
98732
  return elements.map((el, i) => {
98721
98733
  const safeName = `pptx-morph-fadeout-${startIndex + i}-${el.id.replace(/[^a-zA-Z0-9]/gu, "")}`;
@@ -98723,11 +98735,11 @@ function generateUnmatchedFadeOutAnimations(elements, durationMs, startIndex) {
98723
98735
  @keyframes ${safeName} {
98724
98736
  from {
98725
98737
  opacity: ${el.opacity ?? 1};
98726
- transform: scale(1);
98738
+ transform: scale(1)${staticTransformSuffix(el)};
98727
98739
  }
98728
98740
  to {
98729
98741
  opacity: 0;
98730
- transform: scale(0.95);
98742
+ transform: scale(0.95)${staticTransformSuffix(el)};
98731
98743
  }
98732
98744
  }`;
98733
98745
  return {
@@ -98744,11 +98756,11 @@ function generateUnmatchedFadeInAnimations(elements, durationMs, startIndex) {
98744
98756
  @keyframes ${safeName} {
98745
98757
  from {
98746
98758
  opacity: 0;
98747
- transform: scale(0.95);
98759
+ transform: scale(0.95)${staticTransformSuffix(el)};
98748
98760
  }
98749
98761
  to {
98750
98762
  opacity: ${el.opacity ?? 1};
98751
- transform: scale(1);
98763
+ transform: scale(1)${staticTransformSuffix(el)};
98752
98764
  }
98753
98765
  }`;
98754
98766
  return {
@@ -101204,6 +101216,7 @@ var INSTANT = {
101204
101216
  outgoingOnTop: true
101205
101217
  };
101206
101218
  var DEFAULT_TRANSITION_DURATION_MS = 1e3;
101219
+ var DEFAULT_MORPH_DURATION_MS = 2e3;
101207
101220
  var EASE = "ease-in-out";
101208
101221
  var P14_TRANSITION_KEYFRAMES = `
101209
101222
  /* \u2500\u2500 Conveyor (translate X with staggered timing) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
@@ -102411,7 +102424,13 @@ function resolveTransitionDurationMs(transition) {
102411
102424
  if (!transition || transition.type === "none" || transition.type === "cut") {
102412
102425
  return 0;
102413
102426
  }
102414
- return typeof transition.durationMs === "number" && transition.durationMs > 0 ? transition.durationMs : DEFAULT_TRANSITION_DURATION_MS;
102427
+ if (typeof transition.durationMs === "number" && transition.durationMs > 0) {
102428
+ return transition.durationMs;
102429
+ }
102430
+ if (transition.type === "morph") {
102431
+ return DEFAULT_MORPH_DURATION_MS;
102432
+ }
102433
+ return DEFAULT_TRANSITION_DURATION_MS;
102415
102434
  }
102416
102435
  function colour(index, palette) {
102417
102436
  return palette[index % palette.length];
Binary file
@@ -1,4 +1,4 @@
1
- import { ThemePresets, PptxMarkdownConverter } from './chunk-Y6H2RSLB.mjs';
1
+ import { ThemePresets, PptxMarkdownConverter } from './chunk-GMW7VRFD.mjs';
2
2
  import { __export } from './chunk-XGB3TDIC.mjs';
3
3
  import * as mcp from 'pptx-viewer-mcp';
4
4
  import * as mcpSchemas from 'pptx-viewer-mcp/schemas';
Binary file
Binary file