pptx-react-viewer 2.16.1 → 2.16.2

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 (97) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/dist/{AiChatPanel-OHB6CVLY.js → AiChatPanel-MCGNCS7Q.js} +22 -22
  3. package/dist/AiChatPanel-MCGNCS7Q.js.br +0 -0
  4. package/dist/AiChatPanel-MCGNCS7Q.js.gz +0 -0
  5. package/dist/{AiChatPanel-UPNVIENY.mjs → AiChatPanel-WJXPCHQK.mjs} +3 -3
  6. package/dist/AiChatPanel-WJXPCHQK.mjs.br +0 -0
  7. package/dist/AiChatPanel-WJXPCHQK.mjs.gz +0 -0
  8. package/dist/{Model3DScene-KEUY3M7X.mjs → Model3DScene-IXW2AKAU.mjs} +1 -1
  9. package/dist/{Model3DScene-KEUY3M7X.mjs.br → Model3DScene-IXW2AKAU.mjs.br} +0 -0
  10. package/dist/Model3DScene-IXW2AKAU.mjs.gz +0 -0
  11. package/dist/{Model3DScene-7FKWPESH.js → Model3DScene-Q2DTGVQ7.js} +2 -2
  12. package/dist/Model3DScene-Q2DTGVQ7.js.br +0 -0
  13. package/dist/Model3DScene-Q2DTGVQ7.js.gz +0 -0
  14. package/dist/{SurfaceChart3DScene-NPJQXIGW.js → SurfaceChart3DScene-AD43LAOO.js} +2 -2
  15. package/dist/SurfaceChart3DScene-AD43LAOO.js.br +0 -0
  16. package/dist/SurfaceChart3DScene-AD43LAOO.js.gz +0 -0
  17. package/dist/{SurfaceChart3DScene-2MLBPJ63.mjs → SurfaceChart3DScene-MODEHQ6G.mjs} +1 -1
  18. package/dist/{SurfaceChart3DScene-2MLBPJ63.mjs.br → SurfaceChart3DScene-MODEHQ6G.mjs.br} +0 -0
  19. package/dist/SurfaceChart3DScene-MODEHQ6G.mjs.gz +0 -0
  20. package/dist/{chunk-3NDRTC7T.js → chunk-4GX347MG.js} +235 -46
  21. package/dist/chunk-4GX347MG.js.br +0 -0
  22. package/dist/{chunk-3NDRTC7T.js.gz → chunk-4GX347MG.js.gz} +0 -0
  23. package/dist/{chunk-7UBDMCI7.js → chunk-CIK6XUOH.js} +3 -3
  24. package/dist/chunk-CIK6XUOH.js.br +0 -0
  25. package/dist/chunk-CIK6XUOH.js.gz +0 -0
  26. package/dist/{chunk-N6IE34HX.js → chunk-JV6DI7AK.js} +1096 -1074
  27. package/dist/chunk-JV6DI7AK.js.br +0 -0
  28. package/dist/chunk-JV6DI7AK.js.gz +0 -0
  29. package/dist/{chunk-6ROCCY4M.mjs → chunk-LDD2UVCV.mjs} +49 -27
  30. package/dist/chunk-LDD2UVCV.mjs.br +0 -0
  31. package/dist/chunk-LDD2UVCV.mjs.gz +0 -0
  32. package/dist/{chunk-ENOHLGJ2.mjs → chunk-MDFCBYEM.mjs} +234 -47
  33. package/dist/chunk-MDFCBYEM.mjs.br +0 -0
  34. package/dist/{chunk-ENOHLGJ2.mjs.gz → chunk-MDFCBYEM.mjs.gz} +0 -0
  35. package/dist/{chunk-DQTTI6D4.js → chunk-NKE64XVV.js} +340 -340
  36. package/dist/chunk-NKE64XVV.js.br +0 -0
  37. package/dist/chunk-NKE64XVV.js.gz +0 -0
  38. package/dist/{chunk-IN7D2T4R.js → chunk-P6KM7RO5.js} +297 -276
  39. package/dist/chunk-P6KM7RO5.js.br +0 -0
  40. package/dist/chunk-P6KM7RO5.js.gz +0 -0
  41. package/dist/{chunk-LJZFG6YP.mjs → chunk-QI2JCXTH.mjs} +1 -1
  42. package/dist/chunk-QI2JCXTH.mjs.br +0 -0
  43. package/dist/chunk-QI2JCXTH.mjs.gz +0 -0
  44. package/dist/{chunk-RUK5XZGO.mjs → chunk-UWYHBCLM.mjs} +2 -2
  45. package/dist/chunk-UWYHBCLM.mjs.br +0 -0
  46. package/dist/chunk-UWYHBCLM.mjs.gz +0 -0
  47. package/dist/{chunk-ZOOGEDYG.mjs → chunk-Z4CS2ZYN.mjs} +48 -27
  48. package/dist/chunk-Z4CS2ZYN.mjs.br +0 -0
  49. package/dist/chunk-Z4CS2ZYN.mjs.gz +0 -0
  50. package/dist/index.js +39 -39
  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.d.ts +27 -0
  57. package/dist/internals.js +78 -78
  58. package/dist/internals.js.br +0 -0
  59. package/dist/internals.js.gz +0 -0
  60. package/dist/internals.mjs +3 -3
  61. package/dist/internals.mjs.br +0 -0
  62. package/dist/internals.mjs.gz +0 -0
  63. package/dist/viewer/index.js +26 -26
  64. package/dist/viewer/index.js.br +0 -0
  65. package/dist/viewer/index.js.gz +0 -0
  66. package/dist/viewer/index.mjs +5 -5
  67. package/dist/viewer/index.mjs.br +0 -0
  68. package/dist/viewer/index.mjs.gz +0 -0
  69. package/package.json +1 -1
  70. package/dist/AiChatPanel-OHB6CVLY.js.br +0 -0
  71. package/dist/AiChatPanel-OHB6CVLY.js.gz +0 -0
  72. package/dist/AiChatPanel-UPNVIENY.mjs.br +0 -0
  73. package/dist/AiChatPanel-UPNVIENY.mjs.gz +0 -0
  74. package/dist/Model3DScene-7FKWPESH.js.br +0 -0
  75. package/dist/Model3DScene-7FKWPESH.js.gz +0 -0
  76. package/dist/Model3DScene-KEUY3M7X.mjs.gz +0 -0
  77. package/dist/SurfaceChart3DScene-2MLBPJ63.mjs.gz +0 -0
  78. package/dist/SurfaceChart3DScene-NPJQXIGW.js.br +0 -0
  79. package/dist/SurfaceChart3DScene-NPJQXIGW.js.gz +0 -0
  80. package/dist/chunk-3NDRTC7T.js.br +0 -0
  81. package/dist/chunk-6ROCCY4M.mjs.br +0 -0
  82. package/dist/chunk-6ROCCY4M.mjs.gz +0 -0
  83. package/dist/chunk-7UBDMCI7.js.br +0 -0
  84. package/dist/chunk-7UBDMCI7.js.gz +0 -0
  85. package/dist/chunk-DQTTI6D4.js.br +0 -0
  86. package/dist/chunk-DQTTI6D4.js.gz +0 -0
  87. package/dist/chunk-ENOHLGJ2.mjs.br +0 -0
  88. package/dist/chunk-IN7D2T4R.js.br +0 -0
  89. package/dist/chunk-IN7D2T4R.js.gz +0 -0
  90. package/dist/chunk-LJZFG6YP.mjs.br +0 -0
  91. package/dist/chunk-LJZFG6YP.mjs.gz +0 -0
  92. package/dist/chunk-N6IE34HX.js.br +0 -0
  93. package/dist/chunk-N6IE34HX.js.gz +0 -0
  94. package/dist/chunk-RUK5XZGO.mjs.br +0 -0
  95. package/dist/chunk-RUK5XZGO.mjs.gz +0 -0
  96. package/dist/chunk-ZOOGEDYG.mjs.br +0 -0
  97. package/dist/chunk-ZOOGEDYG.mjs.gz +0 -0
@@ -107797,9 +107797,9 @@ function buildTextRunFilterChain(style) {
107797
107797
  return parts.length > 0 ? parts.join(" ") : void 0;
107798
107798
  }
107799
107799
  var ADVANCE_STEPS_PER_PX = 6;
107800
+ var MAX_TRACKING_PX_PER_CHAR = 1 / (2 * ADVANCE_STEPS_PER_PX);
107800
107801
  var MAX_CACHE_ENTRIES = 2e4;
107801
107802
  var measureContext;
107802
- var advanceCache = /* @__PURE__ */ new Map();
107803
107803
  var trackingCache = /* @__PURE__ */ new Map();
107804
107804
  var fontsHookInstalled = false;
107805
107805
  function installFontLoadHook() {
@@ -107808,7 +107808,6 @@ function installFontLoadHook() {
107808
107808
  }
107809
107809
  fontsHookInstalled = true;
107810
107810
  document.fonts?.addEventListener?.("loadingdone", () => {
107811
- advanceCache = /* @__PURE__ */ new Map();
107812
107811
  trackingCache = /* @__PURE__ */ new Map();
107813
107812
  });
107814
107813
  }
@@ -107829,19 +107828,19 @@ function toCanvasFont(font) {
107829
107828
  const family = font.fontFamily || DEFAULT_FONT_FAMILY;
107830
107829
  return `${font.italic ? "italic " : ""}${font.bold ? "bold " : ""}${size}px ${family}`;
107831
107830
  }
107832
- function advanceOf(ctx, canvasFont, char) {
107833
- const key = `${canvasFont}\0${char}`;
107834
- const cached = advanceCache.get(key);
107835
- if (cached !== void 0) {
107836
- return cached;
107837
- }
107831
+ function advancesOf(ctx, canvasFont, chars) {
107838
107832
  ctx.font = canvasFont;
107839
- const width = ctx.measureText(char).width;
107840
- if (advanceCache.size >= MAX_CACHE_ENTRIES) {
107841
- advanceCache = /* @__PURE__ */ new Map();
107833
+ ctx.fontKerning = "none";
107834
+ const advances = [];
107835
+ let previous = 0;
107836
+ let prefix = "";
107837
+ for (const char of chars) {
107838
+ prefix += char;
107839
+ const width = ctx.measureText(prefix).width;
107840
+ advances.push(width - previous);
107841
+ previous = width;
107842
107842
  }
107843
- advanceCache.set(key, width);
107844
- return width;
107843
+ return advances;
107845
107844
  }
107846
107845
  function resolveMetricTrackingPx(text2, font) {
107847
107846
  if (!text2) {
@@ -107858,23 +107857,57 @@ function resolveMetricTrackingPx(text2, font) {
107858
107857
  return 0;
107859
107858
  }
107860
107859
  const chars = [...text2];
107861
- ctx.font = canvasFont;
107860
+ let powerPoint = 0;
107861
+ for (const advance of advancesOf(ctx, canvasFont, chars)) {
107862
+ powerPoint += Math.round(advance * ADVANCE_STEPS_PER_PX);
107863
+ }
107864
+ ctx.fontKerning = "auto";
107862
107865
  const natural = ctx.measureText(text2).width;
107863
107866
  if (!(natural > 0)) {
107864
107867
  return 0;
107865
107868
  }
107866
- let powerPoint = 0;
107867
- for (const char of chars) {
107868
- powerPoint += Math.round(advanceOf(ctx, canvasFont, char) * ADVANCE_STEPS_PER_PX);
107869
- }
107870
107869
  powerPoint /= ADVANCE_STEPS_PER_PX;
107871
- const tracking = (powerPoint - natural) / chars.length;
107870
+ const limit = MAX_TRACKING_PX_PER_CHAR;
107871
+ const raw = (powerPoint - natural) / chars.length;
107872
+ const tracking = Math.min(limit, Math.max(-limit, raw));
107872
107873
  if (trackingCache.size >= MAX_CACHE_ENTRIES) {
107873
107874
  trackingCache = /* @__PURE__ */ new Map();
107874
107875
  }
107875
107876
  trackingCache.set(key, tracking);
107876
107877
  return tracking;
107877
107878
  }
107879
+ function isBreakBoundary(previous, next) {
107880
+ const previousSpace = /\s/u.test(previous);
107881
+ const nextSpace = /\s/u.test(next);
107882
+ if (previousSpace !== nextSpace) {
107883
+ return true;
107884
+ }
107885
+ return previous === "-" && next !== "-" && !nextSpace;
107886
+ }
107887
+ function splitRunForMetrics(text2, font) {
107888
+ const chars = [...text2];
107889
+ if (chars.length < 2 || !getMeasureContext()) {
107890
+ return [{ text: text2, tracking: resolveMetricTrackingPx(text2, font) }];
107891
+ }
107892
+ const pieces = [];
107893
+ let current = chars[0];
107894
+ for (let i = 1; i < chars.length; i++) {
107895
+ if (isBreakBoundary(chars[i - 1], chars[i])) {
107896
+ pieces.push(current);
107897
+ current = "";
107898
+ }
107899
+ current += chars[i];
107900
+ }
107901
+ pieces.push(current);
107902
+ if (pieces.length === 1) {
107903
+ return [{ text: text2, tracking: resolveMetricTrackingPx(text2, font) }];
107904
+ }
107905
+ return pieces.map((piece) => ({ text: piece, tracking: resolveMetricTrackingPx(piece, font) }));
107906
+ }
107907
+ function pieceLetterSpacing(authoredPx, tracking) {
107908
+ const spacing = authoredPx + tracking;
107909
+ return spacing === 0 ? void 0 : `${spacing}px`;
107910
+ }
107878
107911
  function resolveParagraphStrutFontSize(segments, bodyFontSize) {
107879
107912
  let largest;
107880
107913
  for (const segment of segments) {
@@ -107985,6 +108018,43 @@ function correspondingGroup(group2, candidates) {
107985
108018
  return sameBox(group2, candidate);
107986
108019
  });
107987
108020
  }
108021
+ var CHILD_OVERLAP_RATIO = 0.5;
108022
+ function boxOverlapRatio(a, b) {
108023
+ const left = Math.max(a.x, b.x);
108024
+ const top = Math.max(a.y, b.y);
108025
+ const right = Math.min(a.x + a.width, b.x + b.width);
108026
+ const bottom = Math.min(a.y + a.height, b.y + b.height);
108027
+ if (right <= left || bottom <= top) {
108028
+ return 0;
108029
+ }
108030
+ const intersection = (right - left) * (bottom - top);
108031
+ const union = a.width * a.height + b.width * b.height - intersection;
108032
+ return union > 0 ? intersection / union : 0;
108033
+ }
108034
+ function childrenPair(a, b) {
108035
+ const morphName = getElementMorphName(a);
108036
+ if (morphName !== void 0 && getElementMorphName(b) === morphName) {
108037
+ return true;
108038
+ }
108039
+ if (a.name && a.name === b.name) {
108040
+ return true;
108041
+ }
108042
+ return boxOverlapRatio(a, b) >= CHILD_OVERLAP_RATIO;
108043
+ }
108044
+ function childrenCorrespond(a, b) {
108045
+ if (a.length !== b.length || a.length === 0) {
108046
+ return false;
108047
+ }
108048
+ const unclaimed = b.map((child22) => child22);
108049
+ for (const child22 of a) {
108050
+ const index = unclaimed.findIndex((candidate) => childrenPair(child22, candidate));
108051
+ if (index < 0) {
108052
+ return false;
108053
+ }
108054
+ unclaimed.splice(index, 1);
108055
+ }
108056
+ return true;
108057
+ }
107988
108058
  function flattenMorphElements(elements, counterpart, offsetX = 0, offsetY = 0) {
107989
108059
  const out = [];
107990
108060
  for (const element of elements) {
@@ -107992,7 +108062,7 @@ function flattenMorphElements(elements, counterpart, offsetX = 0, offsetY = 0) {
107992
108062
  if (children8 && containsMorphNamedDescendant(element)) {
107993
108063
  const twin = correspondingGroup(element, counterpart);
107994
108064
  const twinChildren = twin ? groupChildren(twin) ?? [] : void 0;
107995
- if (twinChildren) {
108065
+ if (twinChildren && childrenCorrespond(children8, twinChildren)) {
107996
108066
  out.push(
107997
108067
  ...flattenMorphElements(children8, twinChildren, offsetX + element.x, offsetY + element.y)
107998
108068
  );
@@ -108212,6 +108282,7 @@ function interpolateOutline(from, to, t) {
108212
108282
  return parts.join(" ");
108213
108283
  }
108214
108284
  var MORPH_EASING = "cubic-bezier(0.4, 0, 0.2, 1)";
108285
+ var MORPH_CROSSFADE_EASING = "cubic-bezier(0.2, 0, 0.4, 1)";
108215
108286
  var MORPH_FADE_OUT_HOLD_PERCENT = 4;
108216
108287
  var MORPH_FADE_OUT_END_PERCENT = 23;
108217
108288
  var MORPH_FADE_IN_START_PERCENT = 42;
@@ -108532,6 +108603,69 @@ function matchMorphElementsFull(fromSlide, toSlide) {
108532
108603
  const unmatchedTo = toElements.filter((el) => !usedTo.has(el.id));
108533
108604
  return { pairs: pairs2, unmatchedFrom, unmatchedTo };
108534
108605
  }
108606
+ function travelledBox(from, to) {
108607
+ const boxes = to ? [from, to] : [from];
108608
+ return {
108609
+ left: Math.min(...boxes.map((element) => element.x)),
108610
+ top: Math.min(...boxes.map((element) => element.y)),
108611
+ right: Math.max(...boxes.map((element) => element.x + element.width)),
108612
+ bottom: Math.max(...boxes.map((element) => element.y + element.height))
108613
+ };
108614
+ }
108615
+ function boxesOverlap(a, b) {
108616
+ return a.left < b.right && b.left < a.right && a.top < b.bottom && b.top < a.bottom;
108617
+ }
108618
+ function buildMorphMergedOrder(outgoing, incoming, pairs2) {
108619
+ const partnerOf = new Map(pairs2.map((pair) => [pair.toElement.id, pair.fromElement.id]));
108620
+ const outgoingIndex = new Map(outgoing.map((element, index) => [element.id, index]));
108621
+ const rank = /* @__PURE__ */ new Map();
108622
+ let next = 0;
108623
+ let cursor = 0;
108624
+ const flushOutgoingBelow = (limit) => {
108625
+ while (cursor < limit) {
108626
+ const element = outgoing[cursor];
108627
+ cursor += 1;
108628
+ if (!rank.has(element.id)) {
108629
+ rank.set(element.id, next);
108630
+ next += 1;
108631
+ }
108632
+ }
108633
+ };
108634
+ for (const element of incoming) {
108635
+ const partner = partnerOf.get(element.id);
108636
+ const partnerIndex = partner === void 0 ? void 0 : outgoingIndex.get(partner);
108637
+ if (partner === void 0 || partnerIndex === void 0) {
108638
+ rank.set(element.id, next);
108639
+ next += 1;
108640
+ continue;
108641
+ }
108642
+ flushOutgoingBelow(partnerIndex + 1);
108643
+ rank.set(element.id, rank.get(partner) ?? next);
108644
+ }
108645
+ flushOutgoingBelow(outgoing.length);
108646
+ return rank;
108647
+ }
108648
+ function resolveMorphOverlayArrivals(outgoing, incoming, pairs2, holdingGhostIds) {
108649
+ const rank = buildMorphMergedOrder(outgoing, incoming, pairs2);
108650
+ const matched = new Set(pairs2.map((pair) => pair.toElement.id));
108651
+ const counterpart = new Map(pairs2.map((pair) => [pair.fromElement.id, pair.toElement]));
108652
+ const ghosts = outgoing.filter((element) => holdingGhostIds.has(element.id)).map((element) => ({
108653
+ rank: rank.get(element.id) ?? 0,
108654
+ box: travelledBox(element, counterpart.get(element.id))
108655
+ }));
108656
+ const lifted = /* @__PURE__ */ new Set();
108657
+ for (const element of incoming) {
108658
+ if (matched.has(element.id)) {
108659
+ continue;
108660
+ }
108661
+ const mine = rank.get(element.id) ?? 0;
108662
+ const box = travelledBox(element);
108663
+ if (ghosts.some((ghost) => ghost.rank < mine && boxesOverlap(ghost.box, box))) {
108664
+ lifted.add(element.id);
108665
+ }
108666
+ }
108667
+ return lifted;
108668
+ }
108535
108669
  function tokenizeText(element, mode) {
108536
108670
  if (!hasTextProperties(element) || !element.text) {
108537
108671
  return [];
@@ -108769,18 +108903,6 @@ var GEOMETRY_EPSILON = 0.5;
108769
108903
  function isInertMorphPair(fromElement, toElement) {
108770
108904
  return !morphImageCropChanged(fromElement, toElement) && Math.abs(fromElement.x - toElement.x) <= GEOMETRY_EPSILON && Math.abs(fromElement.y - toElement.y) <= GEOMETRY_EPSILON && Math.abs(fromElement.width - toElement.width) <= GEOMETRY_EPSILON && Math.abs(fromElement.height - toElement.height) <= GEOMETRY_EPSILON && (fromElement.rotation ?? 0) === (toElement.rotation ?? 0) && Boolean(fromElement.flipHorizontal) === Boolean(toElement.flipHorizontal) && Boolean(fromElement.flipVertical) === Boolean(toElement.flipVertical) && (fromElement.opacity ?? 1) === (toElement.opacity ?? 1) && !morphPairNeedsCrossfade(fromElement, toElement);
108771
108905
  }
108772
- function travelledBox(from, to) {
108773
- const boxes = to ? [from, to] : [from];
108774
- return {
108775
- left: Math.min(...boxes.map((element) => element.x)),
108776
- top: Math.min(...boxes.map((element) => element.y)),
108777
- right: Math.max(...boxes.map((element) => element.x + element.width)),
108778
- bottom: Math.max(...boxes.map((element) => element.y + element.height))
108779
- };
108780
- }
108781
- function boxesOverlap(a, b) {
108782
- return a.left < b.right && b.left < a.right && a.top < b.bottom && b.top < a.bottom;
108783
- }
108784
108906
  function resolveMorphGhostIds(outgoingElements, pairs2) {
108785
108907
  const counterparts = new Map(pairs2.map((pair) => [pair.fromElement.id, pair.toElement]));
108786
108908
  const painted = /* @__PURE__ */ new Set();
@@ -108801,6 +108923,10 @@ function crossfadeIncomingMayFadeIn(element) {
108801
108923
  if (image.imagePath || image.svgPath) {
108802
108924
  return false;
108803
108925
  }
108926
+ const children8 = element.children;
108927
+ if (children8?.length) {
108928
+ return children8.every((child22) => crossfadeIncomingMayFadeIn(child22));
108929
+ }
108804
108930
  if (!hasShapeProperties(element)) {
108805
108931
  return true;
108806
108932
  }
@@ -108834,13 +108960,15 @@ function generateMorphAnimations(pairs2, durationMs, _mode = "object", ghostIds)
108834
108960
  const inert = ghosted && isInertMorphPair(fromElement, toElement);
108835
108961
  const crossfadesIn = !inert && morphPairNeedsCrossfade(fromElement, toElement) && crossfadeIncomingMayFadeIn(toElement);
108836
108962
  const fromProps = [
108837
- ` transform: translate(${dx}px, ${dy}px) scale(${sx}, ${sy}) rotate(${fromRot}deg)${flips};`,
108838
- ` opacity: ${inert ? 0 : crossfadesIn ? 0 : fromOpacity};`
108963
+ ` transform: translate(${dx}px, ${dy}px) scale(${sx}, ${sy}) rotate(${fromRot}deg)${flips};`
108839
108964
  ];
108840
108965
  const toProps = [
108841
- ` transform: translate(0, 0) scale(1, 1) rotate(${toRot}deg)${flips};`,
108842
- ` opacity: ${inert ? 0 : toOpacity};`
108966
+ ` transform: translate(0, 0) scale(1, 1) rotate(${toRot}deg)${flips};`
108843
108967
  ];
108968
+ if (!crossfadesIn) {
108969
+ fromProps.push(` opacity: ${inert ? 0 : fromOpacity};`);
108970
+ toProps.push(` opacity: ${inert ? 0 : toOpacity};`);
108971
+ }
108844
108972
  const colorInterp = buildColorInterpolationProps(fromElement, toElement);
108845
108973
  if (colorInterp) {
108846
108974
  fromProps.push(` background-color: ${colorInterp.fromBg};`);
@@ -108859,10 +108987,18 @@ ${fromProps.join("\n")}
108859
108987
  to {
108860
108988
  ${toProps.join("\n")}
108861
108989
  }
108862
- }`;
108990
+ }${crossfadesIn ? `
108991
+ @keyframes ${safeName}-fade {
108992
+ from {
108993
+ opacity: 0;
108994
+ }
108995
+ to {
108996
+ opacity: ${toOpacity};
108997
+ }
108998
+ }` : ""}`;
108863
108999
  animations.push({
108864
109000
  elementId: toElement.id,
108865
- animation: `${safeName} ${durationMs}ms ${MORPH_EASING} forwards`,
109001
+ animation: `${safeName} ${durationMs}ms ${MORPH_EASING} forwards${crossfadesIn ? `, ${safeName}-fade ${durationMs}ms ${MORPH_CROSSFADE_EASING} forwards` : ""}`,
108866
109002
  keyframes
108867
109003
  });
108868
109004
  }
@@ -108884,22 +109020,31 @@ function generateMorphGhostAnimations(pairs2, durationMs, startIndex, ghostIds)
108884
109020
  const fromRot = fromElement.rotation ?? 0;
108885
109021
  const toRot = shortestRotationTarget(fromRot, toElement.rotation ?? 0);
108886
109022
  const flips = `${fromElement.flipHorizontal ? " scaleX(-1)" : ""}${fromElement.flipVertical ? " scaleY(-1)" : ""}`;
109023
+ const opacity2 = fromElement.opacity ?? 1;
108887
109024
  const keyframes = `
108888
109025
  @keyframes ${safeName} {
108889
109026
  from {
108890
109027
  transform-origin: center;
108891
- transform: translate(0, 0) scale(1, 1) rotate(${fromRot}deg)${flips};
108892
- opacity: ${fromElement.opacity ?? 1};
109028
+ transform: translate(0, 0) scale(1, 1) rotate(${fromRot}deg)${flips};${fadesOut ? "" : `
109029
+ opacity: ${opacity2};`}
108893
109030
  }
108894
109031
  to {
108895
109032
  transform-origin: center;
108896
- transform: translate(${dx}px, ${dy}px) scale(${sx}, ${sy}) rotate(${toRot}deg)${flips};
108897
- opacity: ${fadesOut ? 0 : fromElement.opacity ?? 1};
109033
+ transform: translate(${dx}px, ${dy}px) scale(${sx}, ${sy}) rotate(${toRot}deg)${flips};${fadesOut ? "" : `
109034
+ opacity: ${opacity2};`}
108898
109035
  }
108899
- }`;
109036
+ }${fadesOut ? `
109037
+ @keyframes ${safeName}-fade {
109038
+ from {
109039
+ opacity: ${opacity2};
109040
+ }
109041
+ to {
109042
+ opacity: 0;
109043
+ }
109044
+ }` : ""}`;
108900
109045
  animations.push({
108901
109046
  elementId: fromElement.id,
108902
- animation: `${safeName} ${durationMs}ms ${MORPH_EASING} forwards`,
109047
+ animation: `${safeName} ${durationMs}ms ${MORPH_EASING} forwards${fadesOut ? `, ${safeName}-fade ${durationMs}ms ${MORPH_CROSSFADE_EASING} forwards` : ""}`,
108903
109048
  keyframes
108904
109049
  });
108905
109050
  }
@@ -109041,6 +109186,16 @@ function generateFullMorphTransition(fromSlide, toSlide, durationMs, mode = "obj
109041
109186
  allAnimations.push(...fadeIns);
109042
109187
  return allAnimations;
109043
109188
  }
109189
+ var LIFTED_HIDDEN_NAME = "pptx-morph-lifted-hidden";
109190
+ var LIFTED_HIDDEN_KEYFRAMES = `
109191
+ @keyframes ${LIFTED_HIDDEN_NAME} {
109192
+ from {
109193
+ opacity: 0;
109194
+ }
109195
+ to {
109196
+ opacity: 0;
109197
+ }
109198
+ }`;
109044
109199
  function morphOptionToMode(option) {
109045
109200
  if (option === "byWord") {
109046
109201
  return "word";
@@ -109075,13 +109230,42 @@ function buildMorphTransitionPlan(fromSlide, toSlide, durationMs, mode = "object
109075
109230
  const outgoingElements = flattenedOutgoing.filter(
109076
109231
  (element) => outgoingAnimations.has(element.id)
109077
109232
  );
109233
+ const flattenedIncoming = flattenMorphElements(toSlide.elements, fromSlide.elements);
109234
+ const holdingGhostIds = new Set(
109235
+ match.pairs.filter(
109236
+ (candidate) => outgoingAnimations.has(candidate.fromElement.id) && !morphPairNeedsCrossfade(candidate.fromElement, candidate.toElement)
109237
+ ).map((candidate) => candidate.fromElement.id)
109238
+ );
109239
+ const lifted = resolveMorphOverlayArrivals(
109240
+ flattenedOutgoing,
109241
+ flattenedIncoming,
109242
+ match.pairs,
109243
+ holdingGhostIds
109244
+ );
109245
+ const overlayIncomingAnimations = /* @__PURE__ */ new Map();
109246
+ for (const id of lifted) {
109247
+ const animation = incomingAnimations.get(id);
109248
+ if (animation === void 0) {
109249
+ continue;
109250
+ }
109251
+ overlayIncomingAnimations.set(id, animation);
109252
+ incomingAnimations.set(id, `${LIFTED_HIDDEN_NAME} ${durationMs}ms linear forwards`);
109253
+ }
109254
+ if (overlayIncomingAnimations.size > 0) {
109255
+ keyframes.push(LIFTED_HIDDEN_KEYFRAMES);
109256
+ }
109257
+ const overlayIncomingElements = flattenedIncoming.filter(
109258
+ (element) => overlayIncomingAnimations.has(element.id)
109259
+ );
109078
109260
  return {
109079
109261
  keyframesCss: keyframes.join("\n"),
109080
109262
  incomingAnimations,
109081
109263
  outgoingAnimations,
109082
109264
  incomingImageAnimations,
109083
109265
  outgoingImageAnimations,
109266
+ overlayIncomingAnimations,
109084
109267
  outgoingElements,
109268
+ overlayIncomingElements,
109085
109269
  durationMs
109086
109270
  };
109087
109271
  }
@@ -109099,9 +109283,12 @@ function buildMorphAnimationRules(plan, scopeAttribute, which = "incoming", only
109099
109283
  }
109100
109284
  };
109101
109285
  if (only !== "image") {
109102
- emit(which === "incoming" ? plan.incomingAnimations : plan.outgoingAnimations, "");
109286
+ emit(
109287
+ which === "outgoing" ? plan.outgoingAnimations : which === "lifted" ? plan.overlayIncomingAnimations : plan.incomingAnimations,
109288
+ ""
109289
+ );
109103
109290
  }
109104
- emit(which === "incoming" ? plan.incomingImageAnimations : plan.outgoingImageAnimations, " img");
109291
+ emit(which === "outgoing" ? plan.outgoingImageAnimations : plan.incomingImageAnimations, " img");
109105
109292
  return rules.join("\n");
109106
109293
  }
109107
109294
  function hexToRgb6(hex10) {
@@ -124063,6 +124250,7 @@ exports.parseDrawingColorOpacity = parseDrawingColorOpacity;
124063
124250
  exports.parsePanoseString = parsePanoseString;
124064
124251
  exports.parsePpactionUrl = parsePpactionUrl;
124065
124252
  exports.pickSupportedMimeType = pickSupportedMimeType;
124253
+ exports.pieceLetterSpacing = pieceLetterSpacing;
124066
124254
  exports.placeAudienceWindow = placeAudienceWindow;
124067
124255
  exports.placeCaretAtEnd = placeCaretAtEnd;
124068
124256
  exports.polygonsToSvgPath = polygonsToSvgPath;
@@ -124187,6 +124375,7 @@ exports.slideProgressPercent = slideProgressPercent;
124187
124375
  exports.slideStatusLabel = slideStatusLabel;
124188
124376
  exports.snapBoxToGrid = snapBoxToGrid;
124189
124377
  exports.splitCell = splitCell;
124378
+ exports.splitRunForMetrics = splitRunForMetrics;
124190
124379
  exports.splitSeriesByAxis = splitSeriesByAxis;
124191
124380
  exports.stepPresenterZoom = stepPresenterZoom;
124192
124381
  exports.stopAllPersistentAudio = stopAllPersistentAudio;
Binary file
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunk3NDRTC7T_js = require('./chunk-3NDRTC7T.js');
3
+ var chunk4GX347MG_js = require('./chunk-4GX347MG.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 chunk3NDRTC7T_js.PptxMarkdownConverter(
14882
+ const converter = new chunk4GX347MG_js.PptxMarkdownConverter(
14883
14883
  "",
14884
14884
  {
14885
14885
  sourceName: meta3.title ?? "deck.pptx",
@@ -15471,7 +15471,7 @@ var getTheme = (ctx) => {
15471
15471
  name: theme?.name,
15472
15472
  colorScheme: theme?.colorScheme,
15473
15473
  fontScheme: theme?.fontScheme,
15474
- availablePresets: Object.keys(chunk3NDRTC7T_js.ThemePresets)
15474
+ availablePresets: Object.keys(chunk4GX347MG_js.ThemePresets)
15475
15475
  };
15476
15476
  };
15477
15477
  var readExecutors = {
Binary file
Binary file