pptx-react-viewer 2.6.7 → 2.7.1

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 (99) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/{AiChatPanel-I22AHEBC.js → AiChatPanel-SRKOMEW6.js} +22 -22
  3. package/dist/AiChatPanel-SRKOMEW6.js.br +0 -0
  4. package/dist/AiChatPanel-SRKOMEW6.js.gz +0 -0
  5. package/dist/{AiChatPanel-E5PVW4MN.mjs → AiChatPanel-YAYQ5KUT.mjs} +3 -3
  6. package/dist/AiChatPanel-YAYQ5KUT.mjs.br +0 -0
  7. package/dist/AiChatPanel-YAYQ5KUT.mjs.gz +0 -0
  8. package/dist/{Model3DScene-UYOY6QJN.mjs → Model3DScene-HYMOPMAM.mjs} +1 -1
  9. package/dist/Model3DScene-HYMOPMAM.mjs.br +0 -0
  10. package/dist/Model3DScene-HYMOPMAM.mjs.gz +0 -0
  11. package/dist/{Model3DScene-VC3HMMBO.js → Model3DScene-ONKC5Z6A.js} +2 -2
  12. package/dist/Model3DScene-ONKC5Z6A.js.br +0 -0
  13. package/dist/Model3DScene-ONKC5Z6A.js.gz +0 -0
  14. package/dist/{SurfaceChart3DScene-PDULQ4DY.mjs → SurfaceChart3DScene-B3FK4Q2U.mjs} +1 -1
  15. package/dist/SurfaceChart3DScene-B3FK4Q2U.mjs.br +0 -0
  16. package/dist/SurfaceChart3DScene-B3FK4Q2U.mjs.gz +0 -0
  17. package/dist/{SurfaceChart3DScene-YMRRZC5V.js → SurfaceChart3DScene-YJFWGG5L.js} +2 -2
  18. package/dist/SurfaceChart3DScene-YJFWGG5L.js.br +0 -0
  19. package/dist/SurfaceChart3DScene-YJFWGG5L.js.gz +0 -0
  20. package/dist/{chunk-CKERNV36.mjs → chunk-2UCJYJUS.mjs} +15 -9
  21. package/dist/chunk-2UCJYJUS.mjs.br +0 -0
  22. package/dist/chunk-2UCJYJUS.mjs.gz +0 -0
  23. package/dist/{chunk-5XXNNTE2.js → chunk-BVK7K74O.js} +851 -845
  24. package/dist/chunk-BVK7K74O.js.br +0 -0
  25. package/dist/chunk-BVK7K74O.js.gz +0 -0
  26. package/dist/{chunk-AB4WM3RK.js → chunk-GRW7HM6X.js} +236 -236
  27. package/dist/chunk-GRW7HM6X.js.br +0 -0
  28. package/dist/chunk-GRW7HM6X.js.gz +0 -0
  29. package/dist/{chunk-LR546YFN.mjs → chunk-HEAJOHLJ.mjs} +178 -46
  30. package/dist/chunk-HEAJOHLJ.mjs.br +0 -0
  31. package/dist/chunk-HEAJOHLJ.mjs.gz +0 -0
  32. package/dist/{chunk-Y6WE6JJO.mjs → chunk-HQGLKAIY.mjs} +2 -2
  33. package/dist/chunk-HQGLKAIY.mjs.br +0 -0
  34. package/dist/chunk-HQGLKAIY.mjs.gz +0 -0
  35. package/dist/{chunk-B7DXNZPM.mjs → chunk-IDK6XECR.mjs} +2 -2
  36. package/dist/chunk-IDK6XECR.mjs.br +0 -0
  37. package/dist/{chunk-B7DXNZPM.mjs.gz → chunk-IDK6XECR.mjs.gz} +0 -0
  38. package/dist/{chunk-C4JFU2XG.js → chunk-JEIMWRKF.js} +315 -315
  39. package/dist/chunk-JEIMWRKF.js.br +0 -0
  40. package/dist/chunk-JEIMWRKF.js.gz +0 -0
  41. package/dist/{chunk-TJFZ7ZP6.js → chunk-JVE7BZ25.js} +3 -3
  42. package/dist/chunk-JVE7BZ25.js.br +0 -0
  43. package/dist/chunk-JVE7BZ25.js.gz +0 -0
  44. package/dist/{chunk-QOWFOMZP.js → chunk-LYS44KMG.js} +178 -46
  45. package/dist/chunk-LYS44KMG.js.br +0 -0
  46. package/dist/chunk-LYS44KMG.js.gz +0 -0
  47. package/dist/{chunk-5QS6ANI7.mjs → chunk-N7EZIKF4.mjs} +1 -1
  48. package/dist/chunk-N7EZIKF4.mjs.br +0 -0
  49. package/dist/chunk-N7EZIKF4.mjs.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-E5PVW4MN.mjs.br +0 -0
  70. package/dist/AiChatPanel-E5PVW4MN.mjs.gz +0 -0
  71. package/dist/AiChatPanel-I22AHEBC.js.br +0 -0
  72. package/dist/AiChatPanel-I22AHEBC.js.gz +0 -0
  73. package/dist/Model3DScene-UYOY6QJN.mjs.br +0 -0
  74. package/dist/Model3DScene-UYOY6QJN.mjs.gz +0 -0
  75. package/dist/Model3DScene-VC3HMMBO.js.br +0 -0
  76. package/dist/Model3DScene-VC3HMMBO.js.gz +0 -0
  77. package/dist/SurfaceChart3DScene-PDULQ4DY.mjs.br +0 -0
  78. package/dist/SurfaceChart3DScene-PDULQ4DY.mjs.gz +0 -0
  79. package/dist/SurfaceChart3DScene-YMRRZC5V.js.br +0 -0
  80. package/dist/SurfaceChart3DScene-YMRRZC5V.js.gz +0 -0
  81. package/dist/chunk-5QS6ANI7.mjs.br +0 -0
  82. package/dist/chunk-5QS6ANI7.mjs.gz +0 -0
  83. package/dist/chunk-5XXNNTE2.js.br +0 -0
  84. package/dist/chunk-5XXNNTE2.js.gz +0 -0
  85. package/dist/chunk-AB4WM3RK.js.br +0 -0
  86. package/dist/chunk-AB4WM3RK.js.gz +0 -0
  87. package/dist/chunk-B7DXNZPM.mjs.br +0 -0
  88. package/dist/chunk-C4JFU2XG.js.br +0 -0
  89. package/dist/chunk-C4JFU2XG.js.gz +0 -0
  90. package/dist/chunk-CKERNV36.mjs.br +0 -0
  91. package/dist/chunk-CKERNV36.mjs.gz +0 -0
  92. package/dist/chunk-LR546YFN.mjs.br +0 -0
  93. package/dist/chunk-LR546YFN.mjs.gz +0 -0
  94. package/dist/chunk-QOWFOMZP.js.br +0 -0
  95. package/dist/chunk-QOWFOMZP.js.gz +0 -0
  96. package/dist/chunk-TJFZ7ZP6.js.br +0 -0
  97. package/dist/chunk-TJFZ7ZP6.js.gz +0 -0
  98. package/dist/chunk-Y6WE6JJO.mjs.br +0 -0
  99. package/dist/chunk-Y6WE6JJO.mjs.gz +0 -0
Binary file
Binary file
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkQOWFOMZP_js = require('./chunk-QOWFOMZP.js');
3
+ var chunkLYS44KMG_js = require('./chunk-LYS44KMG.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 chunkQOWFOMZP_js.PptxMarkdownConverter(
14882
+ const converter = new chunkLYS44KMG_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(chunkQOWFOMZP_js.ThemePresets)
15473
+ availablePresets: Object.keys(chunkLYS44KMG_js.ThemePresets)
15474
15474
  };
15475
15475
  };
15476
15476
  var readExecutors = {
Binary file
Binary file
@@ -19829,6 +19829,13 @@ function extractChildBehaviourDurationMs(cTn, toArray2) {
19829
19829
  }
19830
19830
  return longest;
19831
19831
  }
19832
+ function isInteractiveSequence(seq) {
19833
+ const cTn = seq["p:cTn"];
19834
+ if (!cTn || String(cTn["@_nodeType"] || "") === "mainSeq") {
19835
+ return false;
19836
+ }
19837
+ return extractTriggerShapeId(cTn) !== void 0;
19838
+ }
19832
19839
  var PptxNativeAnimationService = class {
19833
19840
  /**
19834
19841
  * Parse native OOXML animations from a slide's timing tree.
@@ -20029,6 +20036,9 @@ var PptxNativeAnimationService = class {
20029
20036
  );
20030
20037
  }
20031
20038
  for (const sequence of sequences) {
20039
+ if (isInteractiveSequence(sequence)) {
20040
+ continue;
20041
+ }
20032
20042
  this.walkTimingTree(sequence, animations, trigger, group);
20033
20043
  }
20034
20044
  for (const excl of exclusives) {
@@ -20054,6 +20064,9 @@ var PptxNativeAnimationService = class {
20054
20064
  );
20055
20065
  }
20056
20066
  for (const sequence of directSequences) {
20067
+ if (isInteractiveSequence(sequence)) {
20068
+ continue;
20069
+ }
20057
20070
  this.walkTimingTree(sequence, animations, currentTrigger, group);
20058
20071
  }
20059
20072
  }
@@ -20157,6 +20170,36 @@ var PptxNativeAnimationService = class {
20157
20170
  }
20158
20171
  return void 0;
20159
20172
  }
20173
+ /**
20174
+ * Collect every interactive `p:seq` reachable from `node`.
20175
+ *
20176
+ * Interactive sequences are normally siblings of the main sequence under the
20177
+ * root `p:par`, but a deck may nest one deeper. The generic walk skips every
20178
+ * sequence {@link isInteractiveSequence} matches, so this collector has to
20179
+ * reach exactly the same set or those effects would be dropped entirely.
20180
+ * Collection stops at an interactive sequence: its own subtree is walked by
20181
+ * {@link parseInteractiveSequences} under that sequence's trigger shape.
20182
+ */
20183
+ collectInteractiveSequences(node, found) {
20184
+ const containers = [];
20185
+ const cTn = node["p:cTn"];
20186
+ const childTnList = cTn?.["p:childTnLst"];
20187
+ if (childTnList) {
20188
+ containers.push(
20189
+ ...ensureArray5(childTnList["p:par"]),
20190
+ ...ensureArray5(childTnList["p:seq"]),
20191
+ ...ensureArray5(childTnList["p:excl"])
20192
+ );
20193
+ }
20194
+ containers.push(...ensureArray5(node["p:par"]), ...ensureArray5(node["p:seq"]));
20195
+ for (const container of containers) {
20196
+ if (isInteractiveSequence(container)) {
20197
+ found.push(container);
20198
+ continue;
20199
+ }
20200
+ this.collectInteractiveSequences(container, found);
20201
+ }
20202
+ }
20160
20203
  /**
20161
20204
  * Parse interactive sequences from the root `p:par` node.
20162
20205
  *
@@ -20167,25 +20210,11 @@ var PptxNativeAnimationService = class {
20167
20210
  * See ISO/IEC 29500-1 S19.5.60 (CT_TLTimeNodeSequence).
20168
20211
  */
20169
20212
  parseInteractiveSequences(rootPar, animations) {
20170
- const rootCTn = rootPar["p:cTn"];
20171
- if (!rootCTn) {
20172
- return;
20173
- }
20174
- const childTnList = rootCTn["p:childTnLst"];
20175
- if (!childTnList) {
20176
- return;
20177
- }
20178
- const sequences = ensureArray5(childTnList["p:seq"]);
20213
+ const sequences = [];
20214
+ this.collectInteractiveSequences(rootPar, sequences);
20179
20215
  for (const seq of sequences) {
20180
20216
  const seqCTn = seq["p:cTn"];
20181
- if (!seqCTn) {
20182
- continue;
20183
- }
20184
- const nodeType = String(seqCTn["@_nodeType"] || "");
20185
- if (nodeType === "mainSeq") {
20186
- continue;
20187
- }
20188
- const triggerShapeId = extractTriggerShapeId(seqCTn);
20217
+ const triggerShapeId = seqCTn ? extractTriggerShapeId(seqCTn) : void 0;
20189
20218
  if (!triggerShapeId) {
20190
20219
  continue;
20191
20220
  }
@@ -44638,7 +44667,7 @@ function applySeriesDataLabelsToXml(seriesNode, dataLabels, getLocalName2) {
44638
44667
  const dLblsKey = findKey13(seriesNode, "dLbls", getLocalName2);
44639
44668
  const labels = dataLabels ?? [];
44640
44669
  const existingByIdx = /* @__PURE__ */ new Map();
44641
- let groupChildren = [];
44670
+ let groupChildren2 = [];
44642
44671
  if (dLblsKey) {
44643
44672
  const dLbls = seriesNode[dLblsKey];
44644
44673
  const dLblKey = findKey13(dLbls, "dLbl", getLocalName2);
@@ -44653,9 +44682,9 @@ function applySeriesDataLabelsToXml(seriesNode, dataLabels, getLocalName2) {
44653
44682
  }
44654
44683
  }
44655
44684
  }
44656
- groupChildren = Object.keys(dLbls).filter((k) => getLocalName2(k) !== "dLbl").map((k) => [k, dLbls[k]]);
44685
+ groupChildren2 = Object.keys(dLbls).filter((k) => getLocalName2(k) !== "dLbl").map((k) => [k, dLbls[k]]);
44657
44686
  }
44658
- if (labels.length === 0 && groupChildren.length === 0) {
44687
+ if (labels.length === 0 && groupChildren2.length === 0) {
44659
44688
  if (dLblsKey) {
44660
44689
  delete seriesNode[dLblsKey];
44661
44690
  }
@@ -44666,7 +44695,7 @@ function applySeriesDataLabelsToXml(seriesNode, dataLabels, getLocalName2) {
44666
44695
  if (built.length > 0) {
44667
44696
  newDLbls["c:dLbl"] = built.length === 1 ? built[0] : built;
44668
44697
  }
44669
- const ordered32 = [...groupChildren].sort((a, b) => {
44698
+ const ordered32 = [...groupChildren2].sort((a, b) => {
44670
44699
  const ai = DLBLS_GROUP_ORDER.indexOf(getLocalName2(a[0]));
44671
44700
  const bi = DLBLS_GROUP_ORDER.indexOf(getLocalName2(b[0]));
44672
44701
  return (ai === -1 ? DLBLS_GROUP_ORDER.length : ai) - (bi === -1 ? DLBLS_GROUP_ORDER.length : bi);
@@ -98273,6 +98302,10 @@ function interpolateOutline(from, to, t) {
98273
98302
  return parts.join(" ");
98274
98303
  }
98275
98304
  var MORPH_EASING = "cubic-bezier(0.4, 0, 0.2, 1)";
98305
+ var MORPH_FADE_OUT_HOLD_PERCENT = 4;
98306
+ var MORPH_FADE_OUT_END_PERCENT = 23;
98307
+ var MORPH_FADE_IN_START_PERCENT = 42;
98308
+ var MORPH_FADE_IN_EASING = "cubic-bezier(0, 0, 0.35, 1)";
98276
98309
  var PROXIMITY_THRESHOLD = 300;
98277
98310
  var PROXIMITY_SIZE_RATIO_LIMIT = 2;
98278
98311
  var GEOMETRY_MORPH_STEPS = 8;
@@ -98349,6 +98382,67 @@ function getElementMorphName(element) {
98349
98382
  }
98350
98383
  return void 0;
98351
98384
  }
98385
+ function groupChildren(element) {
98386
+ if (element.type !== "group") {
98387
+ return void 0;
98388
+ }
98389
+ const children8 = element.children;
98390
+ return Array.isArray(children8) && children8.length > 0 ? children8 : void 0;
98391
+ }
98392
+ function containsMorphNamedDescendant(element) {
98393
+ const children8 = groupChildren(element);
98394
+ if (!children8) {
98395
+ return false;
98396
+ }
98397
+ for (const child22 of children8) {
98398
+ if (getElementMorphName(child22) !== void 0 || containsMorphNamedDescendant(child22)) {
98399
+ return true;
98400
+ }
98401
+ }
98402
+ return false;
98403
+ }
98404
+ function toAbsolute(child22, offsetX, offsetY) {
98405
+ if (offsetX === 0 && offsetY === 0) {
98406
+ return child22;
98407
+ }
98408
+ return { ...child22, x: child22.x + offsetX, y: child22.y + offsetY };
98409
+ }
98410
+ function sameBox(a, b) {
98411
+ return Math.abs(a.x - b.x) <= 0.5 && Math.abs(a.y - b.y) <= 0.5 && Math.abs(a.width - b.width) <= 0.5 && Math.abs(a.height - b.height) <= 0.5;
98412
+ }
98413
+ function correspondingGroup(group, candidates) {
98414
+ const morphName = getElementMorphName(group);
98415
+ return candidates.find((candidate) => {
98416
+ if (candidate.type !== "group") {
98417
+ return false;
98418
+ }
98419
+ if (morphName !== void 0 && getElementMorphName(candidate) === morphName) {
98420
+ return true;
98421
+ }
98422
+ if (group.name && candidate.name === group.name) {
98423
+ return true;
98424
+ }
98425
+ return sameBox(group, candidate);
98426
+ });
98427
+ }
98428
+ function flattenMorphElements(elements, counterpart, offsetX = 0, offsetY = 0) {
98429
+ const out = [];
98430
+ for (const element of elements) {
98431
+ const children8 = groupChildren(element);
98432
+ if (children8 && containsMorphNamedDescendant(element)) {
98433
+ const twin = correspondingGroup(element, counterpart);
98434
+ const twinChildren = twin ? groupChildren(twin) ?? [] : void 0;
98435
+ if (twinChildren) {
98436
+ out.push(
98437
+ ...flattenMorphElements(children8, twinChildren, offsetX + element.x, offsetY + element.y)
98438
+ );
98439
+ continue;
98440
+ }
98441
+ }
98442
+ out.push(toAbsolute(element, offsetX, offsetY));
98443
+ }
98444
+ return out;
98445
+ }
98352
98446
  var NV_PR_KEYS = [
98353
98447
  "p:nvSpPr",
98354
98448
  "p:nvPicPr",
@@ -98384,12 +98478,14 @@ function matchMorphElementsFull(fromSlide, toSlide) {
98384
98478
  const pairs2 = [];
98385
98479
  const usedFrom = /* @__PURE__ */ new Set();
98386
98480
  const usedTo = /* @__PURE__ */ new Set();
98387
- for (const fromEl of fromSlide.elements) {
98481
+ const fromElements = flattenMorphElements(fromSlide.elements, toSlide.elements);
98482
+ const toElements = flattenMorphElements(toSlide.elements, fromSlide.elements);
98483
+ for (const fromEl of fromElements) {
98388
98484
  const fromName = getElementMorphName(fromEl);
98389
98485
  if (!fromName) {
98390
98486
  continue;
98391
98487
  }
98392
- for (const toEl of toSlide.elements) {
98488
+ for (const toEl of toElements) {
98393
98489
  if (usedTo.has(toEl.id)) {
98394
98490
  continue;
98395
98491
  }
@@ -98409,7 +98505,7 @@ function matchMorphElementsFull(fromSlide, toSlide) {
98409
98505
  }
98410
98506
  return creationIds.get(el.id);
98411
98507
  };
98412
- for (const fromEl of fromSlide.elements) {
98508
+ for (const fromEl of fromElements) {
98413
98509
  if (usedFrom.has(fromEl.id)) {
98414
98510
  continue;
98415
98511
  }
@@ -98417,7 +98513,7 @@ function matchMorphElementsFull(fromSlide, toSlide) {
98417
98513
  if (!fromGuid) {
98418
98514
  continue;
98419
98515
  }
98420
- for (const toEl of toSlide.elements) {
98516
+ for (const toEl of toElements) {
98421
98517
  if (usedTo.has(toEl.id) || fromEl.type !== toEl.type) {
98422
98518
  continue;
98423
98519
  }
@@ -98429,11 +98525,11 @@ function matchMorphElementsFull(fromSlide, toSlide) {
98429
98525
  }
98430
98526
  }
98431
98527
  }
98432
- for (const fromEl of fromSlide.elements) {
98528
+ for (const fromEl of fromElements) {
98433
98529
  if (usedFrom.has(fromEl.id) || !fromEl.shapeId) {
98434
98530
  continue;
98435
98531
  }
98436
- for (const toEl of toSlide.elements) {
98532
+ for (const toEl of toElements) {
98437
98533
  if (usedTo.has(toEl.id)) {
98438
98534
  continue;
98439
98535
  }
@@ -98448,13 +98544,13 @@ function matchMorphElementsFull(fromSlide, toSlide) {
98448
98544
  }
98449
98545
  }
98450
98546
  }
98451
- for (const fromEl of fromSlide.elements) {
98547
+ for (const fromEl of fromElements) {
98452
98548
  if (usedFrom.has(fromEl.id)) {
98453
98549
  continue;
98454
98550
  }
98455
98551
  let bestMatch = null;
98456
98552
  let bestDist = Infinity;
98457
- for (const toEl of toSlide.elements) {
98553
+ for (const toEl of toElements) {
98458
98554
  if (usedTo.has(toEl.id)) {
98459
98555
  continue;
98460
98556
  }
@@ -98480,8 +98576,8 @@ function matchMorphElementsFull(fromSlide, toSlide) {
98480
98576
  usedTo.add(bestMatch.id);
98481
98577
  }
98482
98578
  }
98483
- const unmatchedFrom = fromSlide.elements.filter((el) => !usedFrom.has(el.id));
98484
- const unmatchedTo = toSlide.elements.filter((el) => !usedTo.has(el.id));
98579
+ const unmatchedFrom = fromElements.filter((el) => !usedFrom.has(el.id));
98580
+ const unmatchedTo = toElements.filter((el) => !usedTo.has(el.id));
98485
98581
  return { pairs: pairs2, unmatchedFrom, unmatchedTo };
98486
98582
  }
98487
98583
  function tokenizeText(element, mode) {
@@ -98728,13 +98824,12 @@ function generateMorphAnimations(pairs2, durationMs, _mode = "object") {
98728
98824
  const sy = Math.max(fromElement.height, 1) / Math.max(toElement.height, 1);
98729
98825
  const fromOpacity = fromElement.opacity ?? 1;
98730
98826
  const toOpacity = toElement.opacity ?? 1;
98731
- const fromRot = fromElement.rotation ?? 0;
98732
98827
  const toRot = toElement.rotation ?? 0;
98828
+ const fromRot = shortestRotationTarget(toRot, fromElement.rotation ?? 0);
98733
98829
  const flips = `${toElement.flipHorizontal ? " scaleX(-1)" : ""}${toElement.flipVertical ? " scaleY(-1)" : ""}`;
98734
- const crossfades = morphPairNeedsCrossfade(fromElement, toElement);
98735
98830
  const fromProps = [
98736
98831
  ` transform: translate(${dx}px, ${dy}px) scale(${sx}, ${sy}) rotate(${fromRot}deg)${flips};`,
98737
- ` opacity: ${crossfades ? 0 : fromOpacity};`
98832
+ ` opacity: ${fromOpacity};`
98738
98833
  ];
98739
98834
  const toProps = [
98740
98835
  ` transform: translate(0, 0) scale(1, 1) rotate(${toRot}deg)${flips};`,
@@ -98778,7 +98873,7 @@ function generateMorphGhostAnimations(pairs2, durationMs, startIndex) {
98778
98873
  const sx = Math.max(toElement.width, 1) / Math.max(fromElement.width, 1);
98779
98874
  const sy = Math.max(toElement.height, 1) / Math.max(fromElement.height, 1);
98780
98875
  const fromRot = fromElement.rotation ?? 0;
98781
- const toRot = toElement.rotation ?? 0;
98876
+ const toRot = shortestRotationTarget(fromRot, toElement.rotation ?? 0);
98782
98877
  const flips = `${fromElement.flipHorizontal ? " scaleX(-1)" : ""}${fromElement.flipVertical ? " scaleY(-1)" : ""}`;
98783
98878
  const keyframes = `
98784
98879
  @keyframes ${safeName} {
@@ -98801,6 +98896,19 @@ function generateMorphGhostAnimations(pairs2, durationMs, startIndex) {
98801
98896
  }
98802
98897
  return animations;
98803
98898
  }
98899
+ function shortestRotationTarget(fromDeg, toDeg) {
98900
+ let delta = (toDeg - fromDeg) % 360;
98901
+ if (delta > 180) {
98902
+ delta -= 360;
98903
+ } else if (delta < -180) {
98904
+ delta += 360;
98905
+ }
98906
+ if (Math.abs(Math.abs(delta) - 180) < 1e-9) {
98907
+ const start = (fromDeg % 360 + 360) % 360;
98908
+ delta = start >= 90 && start < 270 ? 180 : -180;
98909
+ }
98910
+ return fromDeg + delta;
98911
+ }
98804
98912
  function staticTransformSuffix(el) {
98805
98913
  const rot = el.rotation ?? 0;
98806
98914
  return ` rotate(${rot}deg)${el.flipHorizontal ? " scaleX(-1)" : ""}${el.flipVertical ? " scaleY(-1)" : ""}`;
@@ -98808,20 +98916,29 @@ function staticTransformSuffix(el) {
98808
98916
  function generateUnmatchedFadeOutAnimations(elements, durationMs, startIndex) {
98809
98917
  return elements.map((el, i) => {
98810
98918
  const safeName = `pptx-morph-fadeout-${startIndex + i}-${el.id.replace(/[^a-zA-Z0-9]/gu, "")}`;
98919
+ const transform = ` transform: scale(1)${staticTransformSuffix(el)};`;
98811
98920
  const keyframes = `
98812
98921
  @keyframes ${safeName} {
98813
- from {
98922
+ 0% {
98814
98923
  opacity: ${el.opacity ?? 1};
98815
- transform: scale(1)${staticTransformSuffix(el)};
98924
+ ${transform}
98816
98925
  }
98817
- to {
98926
+ ${MORPH_FADE_OUT_HOLD_PERCENT}% {
98927
+ opacity: ${el.opacity ?? 1};
98928
+ ${transform}
98929
+ }
98930
+ ${MORPH_FADE_OUT_END_PERCENT}% {
98818
98931
  opacity: 0;
98819
- transform: scale(0.95)${staticTransformSuffix(el)};
98932
+ ${transform}
98933
+ }
98934
+ 100% {
98935
+ opacity: 0;
98936
+ ${transform}
98820
98937
  }
98821
98938
  }`;
98822
98939
  return {
98823
98940
  elementId: el.id,
98824
- animation: `${safeName} ${durationMs}ms ${MORPH_EASING} forwards`,
98941
+ animation: `${safeName} ${durationMs}ms linear forwards`,
98825
98942
  keyframes
98826
98943
  };
98827
98944
  });
@@ -98829,20 +98946,26 @@ function generateUnmatchedFadeOutAnimations(elements, durationMs, startIndex) {
98829
98946
  function generateUnmatchedFadeInAnimations(elements, durationMs, startIndex) {
98830
98947
  return elements.map((el, i) => {
98831
98948
  const safeName = `pptx-morph-fadein-${startIndex + i}-${el.id.replace(/[^a-zA-Z0-9]/gu, "")}`;
98949
+ const transform = ` transform: scale(1)${staticTransformSuffix(el)};`;
98832
98950
  const keyframes = `
98833
98951
  @keyframes ${safeName} {
98834
- from {
98952
+ 0% {
98835
98953
  opacity: 0;
98836
- transform: scale(0.95)${staticTransformSuffix(el)};
98954
+ ${transform}
98837
98955
  }
98838
- to {
98956
+ ${MORPH_FADE_IN_START_PERCENT}% {
98957
+ opacity: 0;
98958
+ animation-timing-function: ${MORPH_FADE_IN_EASING};
98959
+ ${transform}
98960
+ }
98961
+ 100% {
98839
98962
  opacity: ${el.opacity ?? 1};
98840
- transform: scale(1)${staticTransformSuffix(el)};
98963
+ ${transform}
98841
98964
  }
98842
98965
  }`;
98843
98966
  return {
98844
98967
  elementId: el.id,
98845
- animation: `${safeName} ${durationMs}ms ${MORPH_EASING} forwards`,
98968
+ animation: `${safeName} ${durationMs}ms linear forwards`,
98846
98969
  keyframes
98847
98970
  };
98848
98971
  });
@@ -98916,7 +99039,7 @@ function buildMorphTransitionPlan(fromSlide, toSlide, durationMs, mode = "object
98916
99039
  return void 0;
98917
99040
  }
98918
99041
  const animations = generateFullMorphTransition(fromSlide, toSlide, durationMs, mode);
98919
- const outgoingElements = [...fromSlide.elements];
99042
+ const outgoingElements = flattenMorphElements(fromSlide.elements, toSlide.elements);
98920
99043
  const outgoingIds = new Set(outgoingElements.map((element) => element.id));
98921
99044
  const incomingAnimations = /* @__PURE__ */ new Map();
98922
99045
  const outgoingAnimations = /* @__PURE__ */ new Map();
@@ -101294,6 +101417,11 @@ var INSTANT = {
101294
101417
  };
101295
101418
  var DEFAULT_TRANSITION_DURATION_MS = 1e3;
101296
101419
  var DEFAULT_MORPH_DURATION_MS = 2e3;
101420
+ var TRANSITION_SPEED_DURATION_MS = {
101421
+ fast: 500,
101422
+ med: 750,
101423
+ slow: 1e3
101424
+ };
101297
101425
  var EASE = "ease-in-out";
101298
101426
  var P14_TRANSITION_KEYFRAMES = `
101299
101427
  /* \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 */
@@ -102504,6 +102632,10 @@ function resolveTransitionDurationMs(transition) {
102504
102632
  if (typeof transition.durationMs === "number" && transition.durationMs > 0) {
102505
102633
  return transition.durationMs;
102506
102634
  }
102635
+ const speedMs = transition.speed ? TRANSITION_SPEED_DURATION_MS[transition.speed] : void 0;
102636
+ if (typeof speedMs === "number") {
102637
+ return speedMs;
102638
+ }
102507
102639
  if (transition.type === "morph") {
102508
102640
  return DEFAULT_MORPH_DURATION_MS;
102509
102641
  }
Binary file
Binary file
@@ -1,4 +1,4 @@
1
- import { ThemePresets, PptxMarkdownConverter } from './chunk-LR546YFN.mjs';
1
+ import { ThemePresets, PptxMarkdownConverter } from './chunk-HEAJOHLJ.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
package/dist/index.js CHANGED
@@ -1,46 +1,46 @@
1
1
  'use strict';
2
2
 
3
- var chunk5XXNNTE2_js = require('./chunk-5XXNNTE2.js');
4
- require('./chunk-TJFZ7ZP6.js');
5
- var chunkC4JFU2XG_js = require('./chunk-C4JFU2XG.js');
6
- var chunkAB4WM3RK_js = require('./chunk-AB4WM3RK.js');
3
+ var chunkBVK7K74O_js = require('./chunk-BVK7K74O.js');
4
+ require('./chunk-JVE7BZ25.js');
5
+ var chunkJEIMWRKF_js = require('./chunk-JEIMWRKF.js');
6
+ var chunkGRW7HM6X_js = require('./chunk-GRW7HM6X.js');
7
7
  var chunk25VSL2BB_js = require('./chunk-25VSL2BB.js');
8
- var chunkQOWFOMZP_js = require('./chunk-QOWFOMZP.js');
8
+ var chunkLYS44KMG_js = require('./chunk-LYS44KMG.js');
9
9
  require('./chunk-4VNS5WPM.js');
10
10
 
11
11
 
12
12
 
13
13
  Object.defineProperty(exports, "PowerPointViewer", {
14
14
  enumerable: true,
15
- get: function () { return chunk5XXNNTE2_js.PowerPointViewer; }
15
+ get: function () { return chunkBVK7K74O_js.PowerPointViewer; }
16
16
  });
17
17
  Object.defineProperty(exports, "SlideCanvas", {
18
18
  enumerable: true,
19
- get: function () { return chunk5XXNNTE2_js.SlideCanvas; }
19
+ get: function () { return chunkBVK7K74O_js.SlideCanvas; }
20
20
  });
21
21
  Object.defineProperty(exports, "Toolbar", {
22
22
  enumerable: true,
23
- get: function () { return chunk5XXNNTE2_js.Toolbar; }
23
+ get: function () { return chunkBVK7K74O_js.Toolbar; }
24
24
  });
25
25
  Object.defineProperty(exports, "ViewerThemeProvider", {
26
26
  enumerable: true,
27
- get: function () { return chunk5XXNNTE2_js.ViewerThemeProvider; }
27
+ get: function () { return chunkBVK7K74O_js.ViewerThemeProvider; }
28
28
  });
29
29
  Object.defineProperty(exports, "useViewerTheme", {
30
30
  enumerable: true,
31
- get: function () { return chunk5XXNNTE2_js.useViewerTheme; }
31
+ get: function () { return chunkBVK7K74O_js.useViewerTheme; }
32
32
  });
33
33
  Object.defineProperty(exports, "renderToCanvas", {
34
34
  enumerable: true,
35
- get: function () { return chunkC4JFU2XG_js.renderToCanvas; }
35
+ get: function () { return chunkJEIMWRKF_js.renderToCanvas; }
36
36
  });
37
37
  Object.defineProperty(exports, "useViewerBuildingBlocks", {
38
38
  enumerable: true,
39
- get: function () { return chunkC4JFU2XG_js.useViewerBuildingBlocks; }
39
+ get: function () { return chunkJEIMWRKF_js.useViewerBuildingBlocks; }
40
40
  });
41
41
  Object.defineProperty(exports, "getAnimationInitialStyle", {
42
42
  enumerable: true,
43
- get: function () { return chunkAB4WM3RK_js.getAnimationInitialStyle; }
43
+ get: function () { return chunkGRW7HM6X_js.getAnimationInitialStyle; }
44
44
  });
45
45
  Object.defineProperty(exports, "LOCALE_CATALOG", {
46
46
  enumerable: true,
@@ -48,85 +48,85 @@ Object.defineProperty(exports, "LOCALE_CATALOG", {
48
48
  });
49
49
  Object.defineProperty(exports, "AVATAR_COLOR_SWATCHES", {
50
50
  enumerable: true,
51
- get: function () { return chunkQOWFOMZP_js.AVATAR_COLOR_SWATCHES; }
51
+ get: function () { return chunkLYS44KMG_js.AVATAR_COLOR_SWATCHES; }
52
52
  });
53
53
  Object.defineProperty(exports, "DEFAULT_VIEWER_PROFILE", {
54
54
  enumerable: true,
55
- get: function () { return chunkQOWFOMZP_js.DEFAULT_VIEWER_PROFILE; }
55
+ get: function () { return chunkLYS44KMG_js.DEFAULT_VIEWER_PROFILE; }
56
56
  });
57
57
  Object.defineProperty(exports, "THEME_CATALOG", {
58
58
  enumerable: true,
59
- get: function () { return chunkQOWFOMZP_js.THEME_CATALOG; }
59
+ get: function () { return chunkLYS44KMG_js.THEME_CATALOG; }
60
60
  });
61
61
  Object.defineProperty(exports, "VIEWER_PREFS_STORAGE_KEY", {
62
62
  enumerable: true,
63
- get: function () { return chunkQOWFOMZP_js.VIEWER_PREFS_STORAGE_KEY; }
63
+ get: function () { return chunkLYS44KMG_js.VIEWER_PREFS_STORAGE_KEY; }
64
64
  });
65
65
  Object.defineProperty(exports, "clearAllLocalViewerData", {
66
66
  enumerable: true,
67
- get: function () { return chunkQOWFOMZP_js.clearAllLocalViewerData; }
67
+ get: function () { return chunkLYS44KMG_js.clearAllLocalViewerData; }
68
68
  });
69
69
  Object.defineProperty(exports, "clearStoredViewerPrefs", {
70
70
  enumerable: true,
71
- get: function () { return chunkQOWFOMZP_js.clearStoredViewerPrefs; }
71
+ get: function () { return chunkLYS44KMG_js.clearStoredViewerPrefs; }
72
72
  });
73
73
  Object.defineProperty(exports, "defaultCssVars", {
74
74
  enumerable: true,
75
- get: function () { return chunkQOWFOMZP_js.defaultCssVars; }
75
+ get: function () { return chunkLYS44KMG_js.defaultCssVars; }
76
76
  });
77
77
  Object.defineProperty(exports, "defaultRadius", {
78
78
  enumerable: true,
79
- get: function () { return chunkQOWFOMZP_js.defaultRadius; }
79
+ get: function () { return chunkLYS44KMG_js.defaultRadius; }
80
80
  });
81
81
  Object.defineProperty(exports, "defaultThemeColors", {
82
82
  enumerable: true,
83
- get: function () { return chunkQOWFOMZP_js.defaultThemeColors; }
83
+ get: function () { return chunkLYS44KMG_js.defaultThemeColors; }
84
84
  });
85
85
  Object.defineProperty(exports, "getLocalStorageUsageSummary", {
86
86
  enumerable: true,
87
- get: function () { return chunkQOWFOMZP_js.getLocalStorageUsageSummary; }
87
+ get: function () { return chunkLYS44KMG_js.getLocalStorageUsageSummary; }
88
88
  });
89
89
  Object.defineProperty(exports, "readStoredViewerPrefs", {
90
90
  enumerable: true,
91
- get: function () { return chunkQOWFOMZP_js.readStoredViewerPrefs; }
91
+ get: function () { return chunkLYS44KMG_js.readStoredViewerPrefs; }
92
92
  });
93
93
  Object.defineProperty(exports, "resolveProfileInitial", {
94
94
  enumerable: true,
95
- get: function () { return chunkQOWFOMZP_js.resolveProfileInitial; }
95
+ get: function () { return chunkLYS44KMG_js.resolveProfileInitial; }
96
96
  });
97
97
  Object.defineProperty(exports, "resolveThemeCatalogEntry", {
98
98
  enumerable: true,
99
- get: function () { return chunkQOWFOMZP_js.resolveThemeCatalogEntry; }
99
+ get: function () { return chunkLYS44KMG_js.resolveThemeCatalogEntry; }
100
100
  });
101
101
  Object.defineProperty(exports, "saveViewerProfile", {
102
102
  enumerable: true,
103
- get: function () { return chunkQOWFOMZP_js.saveViewerProfile; }
103
+ get: function () { return chunkLYS44KMG_js.saveViewerProfile; }
104
104
  });
105
105
  Object.defineProperty(exports, "themeToCssVars", {
106
106
  enumerable: true,
107
- get: function () { return chunkQOWFOMZP_js.themeToCssVars; }
107
+ get: function () { return chunkLYS44KMG_js.themeToCssVars; }
108
108
  });
109
109
  Object.defineProperty(exports, "vermilionDarkColors", {
110
110
  enumerable: true,
111
- get: function () { return chunkQOWFOMZP_js.vermilionDarkColors; }
111
+ get: function () { return chunkLYS44KMG_js.vermilionDarkColors; }
112
112
  });
113
113
  Object.defineProperty(exports, "vermilionDarkTheme", {
114
114
  enumerable: true,
115
- get: function () { return chunkQOWFOMZP_js.vermilionDarkTheme; }
115
+ get: function () { return chunkLYS44KMG_js.vermilionDarkTheme; }
116
116
  });
117
117
  Object.defineProperty(exports, "vermilionLightColors", {
118
118
  enumerable: true,
119
- get: function () { return chunkQOWFOMZP_js.vermilionLightColors; }
119
+ get: function () { return chunkLYS44KMG_js.vermilionLightColors; }
120
120
  });
121
121
  Object.defineProperty(exports, "vermilionLightTheme", {
122
122
  enumerable: true,
123
- get: function () { return chunkQOWFOMZP_js.vermilionLightTheme; }
123
+ get: function () { return chunkLYS44KMG_js.vermilionLightTheme; }
124
124
  });
125
125
  Object.defineProperty(exports, "vermilionRadius", {
126
126
  enumerable: true,
127
- get: function () { return chunkQOWFOMZP_js.vermilionRadius; }
127
+ get: function () { return chunkLYS44KMG_js.vermilionRadius; }
128
128
  });
129
129
  Object.defineProperty(exports, "writeStoredViewerPrefs", {
130
130
  enumerable: true,
131
- get: function () { return chunkQOWFOMZP_js.writeStoredViewerPrefs; }
131
+ get: function () { return chunkLYS44KMG_js.writeStoredViewerPrefs; }
132
132
  });
package/dist/index.js.br CHANGED
Binary file
package/dist/index.js.gz CHANGED
Binary file
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
- export { PowerPointViewer, SlideCanvas, Toolbar, ViewerThemeProvider, useViewerTheme } from './chunk-CKERNV36.mjs';
2
- import './chunk-5QS6ANI7.mjs';
3
- export { renderToCanvas, useViewerBuildingBlocks } from './chunk-B7DXNZPM.mjs';
4
- export { getAnimationInitialStyle } from './chunk-Y6WE6JJO.mjs';
1
+ export { PowerPointViewer, SlideCanvas, Toolbar, ViewerThemeProvider, useViewerTheme } from './chunk-2UCJYJUS.mjs';
2
+ import './chunk-N7EZIKF4.mjs';
3
+ export { renderToCanvas, useViewerBuildingBlocks } from './chunk-IDK6XECR.mjs';
4
+ export { getAnimationInitialStyle } from './chunk-HQGLKAIY.mjs';
5
5
  export { LOCALE_CATALOG } from './chunk-Z6HIZWIQ.mjs';
6
- export { AVATAR_COLOR_SWATCHES, DEFAULT_VIEWER_PROFILE, THEME_CATALOG, VIEWER_PREFS_STORAGE_KEY, clearAllLocalViewerData, clearStoredViewerPrefs, defaultCssVars, defaultRadius, defaultThemeColors, getLocalStorageUsageSummary, readStoredViewerPrefs, resolveProfileInitial, resolveThemeCatalogEntry, saveViewerProfile, themeToCssVars, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius, writeStoredViewerPrefs } from './chunk-LR546YFN.mjs';
6
+ export { AVATAR_COLOR_SWATCHES, DEFAULT_VIEWER_PROFILE, THEME_CATALOG, VIEWER_PREFS_STORAGE_KEY, clearAllLocalViewerData, clearStoredViewerPrefs, defaultCssVars, defaultRadius, defaultThemeColors, getLocalStorageUsageSummary, readStoredViewerPrefs, resolveProfileInitial, resolveThemeCatalogEntry, saveViewerProfile, themeToCssVars, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius, writeStoredViewerPrefs } from './chunk-HEAJOHLJ.mjs';
7
7
  import './chunk-XGB3TDIC.mjs';
package/dist/index.mjs.br CHANGED
Binary file
package/dist/index.mjs.gz CHANGED
Binary file