pptx-react-viewer 2.16.1 → 2.16.3

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 (170) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/{AiChatPanel-OHB6CVLY.js → AiChatPanel-2WWE5U3X.js} +23 -23
  3. package/dist/AiChatPanel-2WWE5U3X.js.br +0 -0
  4. package/dist/AiChatPanel-2WWE5U3X.js.gz +0 -0
  5. package/dist/{AiChatPanel-UPNVIENY.mjs → AiChatPanel-RGIINA3S.mjs} +4 -4
  6. package/dist/AiChatPanel-RGIINA3S.mjs.br +0 -0
  7. package/dist/AiChatPanel-RGIINA3S.mjs.gz +0 -0
  8. package/dist/{Model3DScene-KEUY3M7X.mjs → Model3DScene-2ZP3V2P2.mjs} +1 -1
  9. package/dist/Model3DScene-2ZP3V2P2.mjs.br +0 -0
  10. package/dist/Model3DScene-2ZP3V2P2.mjs.gz +0 -0
  11. package/dist/{Model3DScene-7FKWPESH.js → Model3DScene-D2ZJ5XGR.js} +2 -2
  12. package/dist/Model3DScene-D2ZJ5XGR.js.br +0 -0
  13. package/dist/Model3DScene-D2ZJ5XGR.js.gz +0 -0
  14. package/dist/{SurfaceChart3DScene-NPJQXIGW.js → SurfaceChart3DScene-DWQ3IP5C.js} +2 -2
  15. package/dist/SurfaceChart3DScene-DWQ3IP5C.js.br +0 -0
  16. package/dist/SurfaceChart3DScene-DWQ3IP5C.js.gz +0 -0
  17. package/dist/{SurfaceChart3DScene-2MLBPJ63.mjs → SurfaceChart3DScene-L7YPNZ7X.mjs} +1 -1
  18. package/dist/SurfaceChart3DScene-L7YPNZ7X.mjs.br +0 -0
  19. package/dist/SurfaceChart3DScene-L7YPNZ7X.mjs.gz +0 -0
  20. package/dist/{audience-content-store-DaABTAcQ.d.ts → audience-content-store-BvqKy7Hf.d.ts} +2 -2
  21. package/dist/{audience-content-store-DaABTAcQ.d.ts.map → audience-content-store-BvqKy7Hf.d.ts.map} +1 -1
  22. package/dist/{chunk-3NDRTC7T.js → chunk-2UVKMKRP.js} +277 -95
  23. package/dist/chunk-2UVKMKRP.js.br +0 -0
  24. package/dist/chunk-2UVKMKRP.js.gz +0 -0
  25. package/dist/{chunk-5YV26HMJ.mjs → chunk-5IUEPQTK.mjs} +1 -0
  26. package/dist/chunk-5IUEPQTK.mjs.br +0 -0
  27. package/dist/chunk-5IUEPQTK.mjs.gz +0 -0
  28. package/dist/{chunk-3ISYPBSX.js → chunk-DVZF4ARG.js} +1 -0
  29. package/dist/chunk-DVZF4ARG.js.br +0 -0
  30. package/dist/chunk-DVZF4ARG.js.gz +0 -0
  31. package/dist/{chunk-OYF6ISXZ.mjs → chunk-DWIIYEOG.mjs} +4 -4
  32. package/dist/chunk-DWIIYEOG.mjs.br +0 -0
  33. package/dist/{chunk-OYF6ISXZ.mjs.gz → chunk-DWIIYEOG.mjs.gz} +0 -0
  34. package/dist/{chunk-ZOOGEDYG.mjs → chunk-EBLFH3R2.mjs} +49 -28
  35. package/dist/chunk-EBLFH3R2.mjs.br +0 -0
  36. package/dist/chunk-EBLFH3R2.mjs.gz +0 -0
  37. package/dist/{chunk-6ROCCY4M.mjs → chunk-FVWVEWUG.mjs} +52 -30
  38. package/dist/chunk-FVWVEWUG.mjs.br +0 -0
  39. package/dist/chunk-FVWVEWUG.mjs.gz +0 -0
  40. package/dist/{chunk-3OYWYONZ.mjs → chunk-FXGO5KLU.mjs} +3 -3
  41. package/dist/chunk-FXGO5KLU.mjs.br +0 -0
  42. package/dist/chunk-FXGO5KLU.mjs.gz +0 -0
  43. package/dist/{chunk-LJZFG6YP.mjs → chunk-JHDAOYRQ.mjs} +1 -1
  44. package/dist/chunk-JHDAOYRQ.mjs.br +0 -0
  45. package/dist/chunk-JHDAOYRQ.mjs.gz +0 -0
  46. package/dist/{chunk-ENOHLGJ2.mjs → chunk-KMT3SLZC.mjs} +276 -96
  47. package/dist/chunk-KMT3SLZC.mjs.br +0 -0
  48. package/dist/chunk-KMT3SLZC.mjs.gz +0 -0
  49. package/dist/{chunk-IN7D2T4R.js → chunk-KTWK3D6O.js} +308 -287
  50. package/dist/chunk-KTWK3D6O.js.br +0 -0
  51. package/dist/chunk-KTWK3D6O.js.gz +0 -0
  52. package/dist/{chunk-7UBDMCI7.js → chunk-LBP6BUD4.js} +3 -3
  53. package/dist/chunk-LBP6BUD4.js.br +0 -0
  54. package/dist/chunk-LBP6BUD4.js.gz +0 -0
  55. package/dist/{chunk-PYV6FIYK.js → chunk-NB7M4XBG.js} +38 -38
  56. package/dist/chunk-NB7M4XBG.js.br +0 -0
  57. package/dist/chunk-NB7M4XBG.js.gz +0 -0
  58. package/dist/{chunk-RUK5XZGO.mjs → chunk-OZ3HGL6E.mjs} +18 -8
  59. package/dist/chunk-OZ3HGL6E.mjs.br +0 -0
  60. package/dist/chunk-OZ3HGL6E.mjs.gz +0 -0
  61. package/dist/{chunk-DQTTI6D4.js → chunk-U7SASWG4.js} +361 -351
  62. package/dist/chunk-U7SASWG4.js.br +0 -0
  63. package/dist/chunk-U7SASWG4.js.gz +0 -0
  64. package/dist/{chunk-N6IE34HX.js → chunk-ZYBVQXLR.js} +1104 -1082
  65. package/dist/chunk-ZYBVQXLR.js.br +0 -0
  66. package/dist/chunk-ZYBVQXLR.js.gz +0 -0
  67. package/dist/{chunk-MMFM7JRT.js → chunk-ZYQT7I5C.js} +4 -4
  68. package/dist/chunk-ZYQT7I5C.js.br +0 -0
  69. package/dist/chunk-ZYQT7I5C.js.gz +0 -0
  70. package/dist/i18n.js +4 -4
  71. package/dist/i18n.js.br +0 -0
  72. package/dist/i18n.js.gz +0 -0
  73. package/dist/i18n.mjs +1 -1
  74. package/dist/i18n.mjs.br +0 -0
  75. package/dist/i18n.mjs.gz +0 -0
  76. package/dist/index.js +41 -41
  77. package/dist/index.js.br +0 -0
  78. package/dist/index.js.gz +0 -0
  79. package/dist/index.mjs +6 -6
  80. package/dist/index.mjs.br +0 -0
  81. package/dist/index.mjs.gz +0 -0
  82. package/dist/internals.d.ts +57 -1
  83. package/dist/internals.d.ts.map +1 -1
  84. package/dist/internals.js +79 -79
  85. package/dist/internals.js.br +0 -0
  86. package/dist/internals.js.gz +0 -0
  87. package/dist/internals.mjs +4 -4
  88. package/dist/internals.mjs.br +0 -0
  89. package/dist/internals.mjs.gz +0 -0
  90. package/dist/viewer/index.d.ts +1 -1
  91. package/dist/viewer/index.js +27 -27
  92. package/dist/viewer/index.js.br +0 -0
  93. package/dist/viewer/index.js.gz +0 -0
  94. package/dist/viewer/index.mjs +6 -6
  95. package/dist/viewer/index.mjs.br +0 -0
  96. package/dist/viewer/index.mjs.gz +0 -0
  97. package/dist/{y-webrtc-DGVURJIF.mjs → y-webrtc-7DLWG3LJ.mjs} +5 -5
  98. package/dist/y-webrtc-7DLWG3LJ.mjs.br +0 -0
  99. package/dist/y-webrtc-7DLWG3LJ.mjs.gz +0 -0
  100. package/dist/{y-webrtc-YN53KW3J.js → y-webrtc-TAJBJIKH.js} +107 -107
  101. package/dist/y-webrtc-TAJBJIKH.js.br +0 -0
  102. package/dist/y-webrtc-TAJBJIKH.js.gz +0 -0
  103. package/dist/{y-websocket-P5LTAJ5T.mjs → y-websocket-DCTJ76B7.mjs} +4 -4
  104. package/dist/y-websocket-DCTJ76B7.mjs.br +0 -0
  105. package/dist/y-websocket-DCTJ76B7.mjs.gz +0 -0
  106. package/dist/{y-websocket-HZCIQLM6.js → y-websocket-DQLOWGV6.js} +81 -81
  107. package/dist/y-websocket-DQLOWGV6.js.br +0 -0
  108. package/dist/y-websocket-DQLOWGV6.js.gz +0 -0
  109. package/dist/{yjs-FKGX4QHS.mjs → yjs-4ED7E5CZ.mjs} +1 -1
  110. package/dist/yjs-4ED7E5CZ.mjs.br +0 -0
  111. package/dist/yjs-4ED7E5CZ.mjs.gz +0 -0
  112. package/dist/{yjs-HBLSEMHP.js → yjs-OWUA3UHD.js} +104 -104
  113. package/dist/yjs-OWUA3UHD.js.br +0 -0
  114. package/dist/yjs-OWUA3UHD.js.gz +0 -0
  115. package/package.json +6 -6
  116. package/dist/AiChatPanel-OHB6CVLY.js.br +0 -0
  117. package/dist/AiChatPanel-OHB6CVLY.js.gz +0 -0
  118. package/dist/AiChatPanel-UPNVIENY.mjs.br +0 -0
  119. package/dist/AiChatPanel-UPNVIENY.mjs.gz +0 -0
  120. package/dist/Model3DScene-7FKWPESH.js.br +0 -0
  121. package/dist/Model3DScene-7FKWPESH.js.gz +0 -0
  122. package/dist/Model3DScene-KEUY3M7X.mjs.br +0 -0
  123. package/dist/Model3DScene-KEUY3M7X.mjs.gz +0 -0
  124. package/dist/SurfaceChart3DScene-2MLBPJ63.mjs.br +0 -0
  125. package/dist/SurfaceChart3DScene-2MLBPJ63.mjs.gz +0 -0
  126. package/dist/SurfaceChart3DScene-NPJQXIGW.js.br +0 -0
  127. package/dist/SurfaceChart3DScene-NPJQXIGW.js.gz +0 -0
  128. package/dist/chunk-3ISYPBSX.js.br +0 -0
  129. package/dist/chunk-3ISYPBSX.js.gz +0 -0
  130. package/dist/chunk-3NDRTC7T.js.br +0 -0
  131. package/dist/chunk-3NDRTC7T.js.gz +0 -0
  132. package/dist/chunk-3OYWYONZ.mjs.br +0 -0
  133. package/dist/chunk-3OYWYONZ.mjs.gz +0 -0
  134. package/dist/chunk-5YV26HMJ.mjs.br +0 -0
  135. package/dist/chunk-5YV26HMJ.mjs.gz +0 -0
  136. package/dist/chunk-6ROCCY4M.mjs.br +0 -0
  137. package/dist/chunk-6ROCCY4M.mjs.gz +0 -0
  138. package/dist/chunk-7UBDMCI7.js.br +0 -0
  139. package/dist/chunk-7UBDMCI7.js.gz +0 -0
  140. package/dist/chunk-DQTTI6D4.js.br +0 -0
  141. package/dist/chunk-DQTTI6D4.js.gz +0 -0
  142. package/dist/chunk-ENOHLGJ2.mjs.br +0 -0
  143. package/dist/chunk-ENOHLGJ2.mjs.gz +0 -0
  144. package/dist/chunk-IN7D2T4R.js.br +0 -0
  145. package/dist/chunk-IN7D2T4R.js.gz +0 -0
  146. package/dist/chunk-LJZFG6YP.mjs.br +0 -0
  147. package/dist/chunk-LJZFG6YP.mjs.gz +0 -0
  148. package/dist/chunk-MMFM7JRT.js.br +0 -0
  149. package/dist/chunk-MMFM7JRT.js.gz +0 -0
  150. package/dist/chunk-N6IE34HX.js.br +0 -0
  151. package/dist/chunk-N6IE34HX.js.gz +0 -0
  152. package/dist/chunk-OYF6ISXZ.mjs.br +0 -0
  153. package/dist/chunk-PYV6FIYK.js.br +0 -0
  154. package/dist/chunk-PYV6FIYK.js.gz +0 -0
  155. package/dist/chunk-RUK5XZGO.mjs.br +0 -0
  156. package/dist/chunk-RUK5XZGO.mjs.gz +0 -0
  157. package/dist/chunk-ZOOGEDYG.mjs.br +0 -0
  158. package/dist/chunk-ZOOGEDYG.mjs.gz +0 -0
  159. package/dist/y-webrtc-DGVURJIF.mjs.br +0 -0
  160. package/dist/y-webrtc-DGVURJIF.mjs.gz +0 -0
  161. package/dist/y-webrtc-YN53KW3J.js.br +0 -0
  162. package/dist/y-webrtc-YN53KW3J.js.gz +0 -0
  163. package/dist/y-websocket-HZCIQLM6.js.br +0 -0
  164. package/dist/y-websocket-HZCIQLM6.js.gz +0 -0
  165. package/dist/y-websocket-P5LTAJ5T.mjs.br +0 -0
  166. package/dist/y-websocket-P5LTAJ5T.mjs.gz +0 -0
  167. package/dist/yjs-FKGX4QHS.mjs.br +0 -0
  168. package/dist/yjs-FKGX4QHS.mjs.gz +0 -0
  169. package/dist/yjs-HBLSEMHP.js.br +0 -0
  170. package/dist/yjs-HBLSEMHP.js.gz +0 -0
@@ -8520,20 +8520,18 @@ function createTableElement(input, options) {
8520
8520
  }
8521
8521
  const rows = input.rows.map((rowInput) => ({
8522
8522
  height: rowInput.height ?? rowHeight,
8523
- cells: rowInput.cells.map(
8524
- (cellInput) => ({
8525
- text: cellInput.text,
8526
- gridSpan: cellInput.gridSpan,
8527
- rowSpan: cellInput.rowSpan,
8528
- style: cellInput.style ? {
8529
- fontSize: cellInput.style.fontSize,
8530
- bold: cellInput.style.bold,
8531
- italic: cellInput.style.italic,
8532
- color: cellInput.style.color,
8533
- align: cellInput.style.alignment
8534
- } : void 0
8535
- })
8536
- )
8523
+ cells: rowInput.cells.map((cellInput) => ({
8524
+ text: cellInput.text,
8525
+ gridSpan: cellInput.gridSpan,
8526
+ rowSpan: cellInput.rowSpan,
8527
+ style: cellInput.style ? {
8528
+ fontSize: cellInput.style.fontSize,
8529
+ bold: cellInput.style.bold,
8530
+ italic: cellInput.style.italic,
8531
+ color: cellInput.style.color,
8532
+ align: cellInput.style.alignment
8533
+ } : void 0
8534
+ }))
8537
8535
  }));
8538
8536
  const tableData = {
8539
8537
  rows,
@@ -42502,17 +42500,13 @@ function remapCellStyleColors(style, remap) {
42502
42500
  function remapTableColors(tableData, remap) {
42503
42501
  return {
42504
42502
  ...tableData,
42505
- rows: tableData.rows.map(
42506
- (row) => ({
42507
- ...row,
42508
- cells: row.cells.map(
42509
- (cell) => ({
42510
- ...cell,
42511
- style: remapCellStyleColors(cell.style, remap)
42512
- })
42513
- )
42514
- })
42515
- )
42503
+ rows: tableData.rows.map((row) => ({
42504
+ ...row,
42505
+ cells: row.cells.map((cell) => ({
42506
+ ...cell,
42507
+ style: remapCellStyleColors(cell.style, remap)
42508
+ }))
42509
+ }))
42516
42510
  };
42517
42511
  }
42518
42512
  function remapSlideColors(slide, remap) {
@@ -42979,9 +42973,10 @@ function parseWhen(node) {
42979
42973
  } : void 0;
42980
42974
  }
42981
42975
  function parseSmartArtControlFlow(node, localName22) {
42982
- const forEach = children5(node, "forEach", localName22).map(
42983
- (entry2) => ({ ...parseIterator(entry2), rawXml: entry2 })
42984
- );
42976
+ const forEach = children5(node, "forEach", localName22).map((entry2) => ({
42977
+ ...parseIterator(entry2),
42978
+ rawXml: entry2
42979
+ }));
42985
42980
  const choose = children5(node, "choose", localName22).map((entry2) => {
42986
42981
  const otherwiseNode = children5(entry2, "else", localName22)[0];
42987
42982
  return {
@@ -102266,27 +102261,24 @@ function newTableElement(rows = 3, cols = 3, x = DEFAULT_X, y = TABLE_DEFAULT_Y)
102266
102261
  const columnWidths = Array.from({ length: cols }).fill(colWidth);
102267
102262
  const tableRows = Array.from({ length: rows }, (_, rowIdx) => {
102268
102263
  const isHeader = rowIdx === 0;
102269
- const cells = Array.from(
102270
- { length: cols },
102271
- (__, colIdx) => ({
102272
- text: isHeader ? `Header ${colIdx + 1}` : "",
102273
- style: {
102274
- borderTopWidth: 1,
102275
- borderBottomWidth: 1,
102276
- borderLeftWidth: 1,
102277
- borderRightWidth: 1,
102278
- borderTopColor: "#cccccc",
102279
- borderBottomColor: "#cccccc",
102280
- borderLeftColor: "#cccccc",
102281
- borderRightColor: "#cccccc",
102282
- ...isHeader ? {
102283
- bold: true,
102284
- backgroundColor: "#2563eb",
102285
- color: "#ffffff"
102286
- } : {}
102287
- }
102288
- })
102289
- );
102264
+ const cells = Array.from({ length: cols }, (__, colIdx) => ({
102265
+ text: isHeader ? `Header ${colIdx + 1}` : "",
102266
+ style: {
102267
+ borderTopWidth: 1,
102268
+ borderBottomWidth: 1,
102269
+ borderLeftWidth: 1,
102270
+ borderRightWidth: 1,
102271
+ borderTopColor: "#cccccc",
102272
+ borderBottomColor: "#cccccc",
102273
+ borderLeftColor: "#cccccc",
102274
+ borderRightColor: "#cccccc",
102275
+ ...isHeader ? {
102276
+ bold: true,
102277
+ backgroundColor: "#2563eb",
102278
+ color: "#ffffff"
102279
+ } : {}
102280
+ }
102281
+ }));
102290
102282
  return { cells, height: isHeader ? 40 : 36 };
102291
102283
  });
102292
102284
  return {
@@ -103825,6 +103817,7 @@ var translationsEn = {
103825
103817
  "pptx.inspector.lock": "Lock",
103826
103818
  "pptx.inspector.unlock": "Unlock",
103827
103819
  // Slide master / handout master / notes master
103820
+ "pptx.master.backgroundColorLabel": "Master background color",
103828
103821
  "pptx.master.collapseMasterPane": "Collapse pane",
103829
103822
  "pptx.master.handoutBackground": "Background",
103830
103823
  "pptx.master.handoutMasterTitle": "Handout Master",
@@ -107797,9 +107790,9 @@ function buildTextRunFilterChain(style) {
107797
107790
  return parts.length > 0 ? parts.join(" ") : void 0;
107798
107791
  }
107799
107792
  var ADVANCE_STEPS_PER_PX = 6;
107793
+ var MAX_TRACKING_PX_PER_CHAR = 1 / (2 * ADVANCE_STEPS_PER_PX);
107800
107794
  var MAX_CACHE_ENTRIES = 2e4;
107801
107795
  var measureContext;
107802
- var advanceCache = /* @__PURE__ */ new Map();
107803
107796
  var trackingCache = /* @__PURE__ */ new Map();
107804
107797
  var fontsHookInstalled = false;
107805
107798
  function installFontLoadHook() {
@@ -107808,7 +107801,6 @@ function installFontLoadHook() {
107808
107801
  }
107809
107802
  fontsHookInstalled = true;
107810
107803
  document.fonts?.addEventListener?.("loadingdone", () => {
107811
- advanceCache = /* @__PURE__ */ new Map();
107812
107804
  trackingCache = /* @__PURE__ */ new Map();
107813
107805
  });
107814
107806
  }
@@ -107829,19 +107821,19 @@ function toCanvasFont(font) {
107829
107821
  const family = font.fontFamily || DEFAULT_FONT_FAMILY;
107830
107822
  return `${font.italic ? "italic " : ""}${font.bold ? "bold " : ""}${size}px ${family}`;
107831
107823
  }
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
- }
107824
+ function advancesOf(ctx, canvasFont, chars) {
107838
107825
  ctx.font = canvasFont;
107839
- const width = ctx.measureText(char).width;
107840
- if (advanceCache.size >= MAX_CACHE_ENTRIES) {
107841
- advanceCache = /* @__PURE__ */ new Map();
107826
+ ctx.fontKerning = "none";
107827
+ const advances = [];
107828
+ let previous = 0;
107829
+ let prefix = "";
107830
+ for (const char of chars) {
107831
+ prefix += char;
107832
+ const width = ctx.measureText(prefix).width;
107833
+ advances.push(width - previous);
107834
+ previous = width;
107842
107835
  }
107843
- advanceCache.set(key, width);
107844
- return width;
107836
+ return advances;
107845
107837
  }
107846
107838
  function resolveMetricTrackingPx(text2, font) {
107847
107839
  if (!text2) {
@@ -107858,23 +107850,57 @@ function resolveMetricTrackingPx(text2, font) {
107858
107850
  return 0;
107859
107851
  }
107860
107852
  const chars = [...text2];
107861
- ctx.font = canvasFont;
107853
+ let powerPoint = 0;
107854
+ for (const advance of advancesOf(ctx, canvasFont, chars)) {
107855
+ powerPoint += Math.round(advance * ADVANCE_STEPS_PER_PX);
107856
+ }
107857
+ ctx.fontKerning = "auto";
107862
107858
  const natural = ctx.measureText(text2).width;
107863
107859
  if (!(natural > 0)) {
107864
107860
  return 0;
107865
107861
  }
107866
- let powerPoint = 0;
107867
- for (const char of chars) {
107868
- powerPoint += Math.round(advanceOf(ctx, canvasFont, char) * ADVANCE_STEPS_PER_PX);
107869
- }
107870
107862
  powerPoint /= ADVANCE_STEPS_PER_PX;
107871
- const tracking = (powerPoint - natural) / chars.length;
107863
+ const limit = MAX_TRACKING_PX_PER_CHAR;
107864
+ const raw = (powerPoint - natural) / chars.length;
107865
+ const tracking = Math.min(limit, Math.max(-limit, raw));
107872
107866
  if (trackingCache.size >= MAX_CACHE_ENTRIES) {
107873
107867
  trackingCache = /* @__PURE__ */ new Map();
107874
107868
  }
107875
107869
  trackingCache.set(key, tracking);
107876
107870
  return tracking;
107877
107871
  }
107872
+ function isBreakBoundary(previous, next) {
107873
+ const previousSpace = /\s/u.test(previous);
107874
+ const nextSpace = /\s/u.test(next);
107875
+ if (previousSpace !== nextSpace) {
107876
+ return true;
107877
+ }
107878
+ return previous === "-" && next !== "-" && !nextSpace;
107879
+ }
107880
+ function splitRunForMetrics(text2, font) {
107881
+ const chars = [...text2];
107882
+ if (chars.length < 2 || !getMeasureContext()) {
107883
+ return [{ text: text2, tracking: resolveMetricTrackingPx(text2, font) }];
107884
+ }
107885
+ const pieces = [];
107886
+ let current = chars[0];
107887
+ for (let i = 1; i < chars.length; i++) {
107888
+ if (isBreakBoundary(chars[i - 1], chars[i])) {
107889
+ pieces.push(current);
107890
+ current = "";
107891
+ }
107892
+ current += chars[i];
107893
+ }
107894
+ pieces.push(current);
107895
+ if (pieces.length === 1) {
107896
+ return [{ text: text2, tracking: resolveMetricTrackingPx(text2, font) }];
107897
+ }
107898
+ return pieces.map((piece) => ({ text: piece, tracking: resolveMetricTrackingPx(piece, font) }));
107899
+ }
107900
+ function pieceLetterSpacing(authoredPx, tracking) {
107901
+ const spacing = authoredPx + tracking;
107902
+ return spacing === 0 ? void 0 : `${spacing}px`;
107903
+ }
107878
107904
  function resolveParagraphStrutFontSize(segments, bodyFontSize) {
107879
107905
  let largest;
107880
107906
  for (const segment of segments) {
@@ -107985,6 +108011,43 @@ function correspondingGroup(group2, candidates) {
107985
108011
  return sameBox(group2, candidate);
107986
108012
  });
107987
108013
  }
108014
+ var CHILD_OVERLAP_RATIO = 0.5;
108015
+ function boxOverlapRatio(a, b) {
108016
+ const left = Math.max(a.x, b.x);
108017
+ const top = Math.max(a.y, b.y);
108018
+ const right = Math.min(a.x + a.width, b.x + b.width);
108019
+ const bottom = Math.min(a.y + a.height, b.y + b.height);
108020
+ if (right <= left || bottom <= top) {
108021
+ return 0;
108022
+ }
108023
+ const intersection = (right - left) * (bottom - top);
108024
+ const union = a.width * a.height + b.width * b.height - intersection;
108025
+ return union > 0 ? intersection / union : 0;
108026
+ }
108027
+ function childrenPair(a, b) {
108028
+ const morphName = getElementMorphName(a);
108029
+ if (morphName !== void 0 && getElementMorphName(b) === morphName) {
108030
+ return true;
108031
+ }
108032
+ if (a.name && a.name === b.name) {
108033
+ return true;
108034
+ }
108035
+ return boxOverlapRatio(a, b) >= CHILD_OVERLAP_RATIO;
108036
+ }
108037
+ function childrenCorrespond(a, b) {
108038
+ if (a.length !== b.length || a.length === 0) {
108039
+ return false;
108040
+ }
108041
+ const unclaimed = b.map((child22) => child22);
108042
+ for (const child22 of a) {
108043
+ const index = unclaimed.findIndex((candidate) => childrenPair(child22, candidate));
108044
+ if (index < 0) {
108045
+ return false;
108046
+ }
108047
+ unclaimed.splice(index, 1);
108048
+ }
108049
+ return true;
108050
+ }
107988
108051
  function flattenMorphElements(elements, counterpart, offsetX = 0, offsetY = 0) {
107989
108052
  const out = [];
107990
108053
  for (const element of elements) {
@@ -107992,7 +108055,7 @@ function flattenMorphElements(elements, counterpart, offsetX = 0, offsetY = 0) {
107992
108055
  if (children8 && containsMorphNamedDescendant(element)) {
107993
108056
  const twin = correspondingGroup(element, counterpart);
107994
108057
  const twinChildren = twin ? groupChildren(twin) ?? [] : void 0;
107995
- if (twinChildren) {
108058
+ if (twinChildren && childrenCorrespond(children8, twinChildren)) {
107996
108059
  out.push(
107997
108060
  ...flattenMorphElements(children8, twinChildren, offsetX + element.x, offsetY + element.y)
107998
108061
  );
@@ -108212,6 +108275,7 @@ function interpolateOutline(from, to, t) {
108212
108275
  return parts.join(" ");
108213
108276
  }
108214
108277
  var MORPH_EASING = "cubic-bezier(0.4, 0, 0.2, 1)";
108278
+ var MORPH_CROSSFADE_EASING = "cubic-bezier(0.2, 0, 0.4, 1)";
108215
108279
  var MORPH_FADE_OUT_HOLD_PERCENT = 4;
108216
108280
  var MORPH_FADE_OUT_END_PERCENT = 23;
108217
108281
  var MORPH_FADE_IN_START_PERCENT = 42;
@@ -108532,6 +108596,69 @@ function matchMorphElementsFull(fromSlide, toSlide) {
108532
108596
  const unmatchedTo = toElements.filter((el) => !usedTo.has(el.id));
108533
108597
  return { pairs: pairs2, unmatchedFrom, unmatchedTo };
108534
108598
  }
108599
+ function travelledBox(from, to) {
108600
+ const boxes = to ? [from, to] : [from];
108601
+ return {
108602
+ left: Math.min(...boxes.map((element) => element.x)),
108603
+ top: Math.min(...boxes.map((element) => element.y)),
108604
+ right: Math.max(...boxes.map((element) => element.x + element.width)),
108605
+ bottom: Math.max(...boxes.map((element) => element.y + element.height))
108606
+ };
108607
+ }
108608
+ function boxesOverlap(a, b) {
108609
+ return a.left < b.right && b.left < a.right && a.top < b.bottom && b.top < a.bottom;
108610
+ }
108611
+ function buildMorphMergedOrder(outgoing, incoming, pairs2) {
108612
+ const partnerOf = new Map(pairs2.map((pair) => [pair.toElement.id, pair.fromElement.id]));
108613
+ const outgoingIndex = new Map(outgoing.map((element, index) => [element.id, index]));
108614
+ const rank = /* @__PURE__ */ new Map();
108615
+ let next = 0;
108616
+ let cursor = 0;
108617
+ const flushOutgoingBelow = (limit) => {
108618
+ while (cursor < limit) {
108619
+ const element = outgoing[cursor];
108620
+ cursor += 1;
108621
+ if (!rank.has(element.id)) {
108622
+ rank.set(element.id, next);
108623
+ next += 1;
108624
+ }
108625
+ }
108626
+ };
108627
+ for (const element of incoming) {
108628
+ const partner = partnerOf.get(element.id);
108629
+ const partnerIndex = partner === void 0 ? void 0 : outgoingIndex.get(partner);
108630
+ if (partner === void 0 || partnerIndex === void 0) {
108631
+ rank.set(element.id, next);
108632
+ next += 1;
108633
+ continue;
108634
+ }
108635
+ flushOutgoingBelow(partnerIndex + 1);
108636
+ rank.set(element.id, rank.get(partner) ?? next);
108637
+ }
108638
+ flushOutgoingBelow(outgoing.length);
108639
+ return rank;
108640
+ }
108641
+ function resolveMorphOverlayArrivals(outgoing, incoming, pairs2, holdingGhostIds) {
108642
+ const rank = buildMorphMergedOrder(outgoing, incoming, pairs2);
108643
+ const matched = new Set(pairs2.map((pair) => pair.toElement.id));
108644
+ const counterpart = new Map(pairs2.map((pair) => [pair.fromElement.id, pair.toElement]));
108645
+ const ghosts = outgoing.filter((element) => holdingGhostIds.has(element.id)).map((element) => ({
108646
+ rank: rank.get(element.id) ?? 0,
108647
+ box: travelledBox(element, counterpart.get(element.id))
108648
+ }));
108649
+ const lifted = /* @__PURE__ */ new Set();
108650
+ for (const element of incoming) {
108651
+ if (matched.has(element.id)) {
108652
+ continue;
108653
+ }
108654
+ const mine = rank.get(element.id) ?? 0;
108655
+ const box = travelledBox(element);
108656
+ if (ghosts.some((ghost) => ghost.rank < mine && boxesOverlap(ghost.box, box))) {
108657
+ lifted.add(element.id);
108658
+ }
108659
+ }
108660
+ return lifted;
108661
+ }
108535
108662
  function tokenizeText(element, mode) {
108536
108663
  if (!hasTextProperties(element) || !element.text) {
108537
108664
  return [];
@@ -108769,18 +108896,6 @@ var GEOMETRY_EPSILON = 0.5;
108769
108896
  function isInertMorphPair(fromElement, toElement) {
108770
108897
  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
108898
  }
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
108899
  function resolveMorphGhostIds(outgoingElements, pairs2) {
108785
108900
  const counterparts = new Map(pairs2.map((pair) => [pair.fromElement.id, pair.toElement]));
108786
108901
  const painted = /* @__PURE__ */ new Set();
@@ -108801,6 +108916,10 @@ function crossfadeIncomingMayFadeIn(element) {
108801
108916
  if (image.imagePath || image.svgPath) {
108802
108917
  return false;
108803
108918
  }
108919
+ const children8 = element.children;
108920
+ if (children8?.length) {
108921
+ return children8.every((child22) => crossfadeIncomingMayFadeIn(child22));
108922
+ }
108804
108923
  if (!hasShapeProperties(element)) {
108805
108924
  return true;
108806
108925
  }
@@ -108834,13 +108953,15 @@ function generateMorphAnimations(pairs2, durationMs, _mode = "object", ghostIds)
108834
108953
  const inert = ghosted && isInertMorphPair(fromElement, toElement);
108835
108954
  const crossfadesIn = !inert && morphPairNeedsCrossfade(fromElement, toElement) && crossfadeIncomingMayFadeIn(toElement);
108836
108955
  const fromProps = [
108837
- ` transform: translate(${dx}px, ${dy}px) scale(${sx}, ${sy}) rotate(${fromRot}deg)${flips};`,
108838
- ` opacity: ${inert ? 0 : crossfadesIn ? 0 : fromOpacity};`
108956
+ ` transform: translate(${dx}px, ${dy}px) scale(${sx}, ${sy}) rotate(${fromRot}deg)${flips};`
108839
108957
  ];
108840
108958
  const toProps = [
108841
- ` transform: translate(0, 0) scale(1, 1) rotate(${toRot}deg)${flips};`,
108842
- ` opacity: ${inert ? 0 : toOpacity};`
108959
+ ` transform: translate(0, 0) scale(1, 1) rotate(${toRot}deg)${flips};`
108843
108960
  ];
108961
+ if (!crossfadesIn) {
108962
+ fromProps.push(` opacity: ${inert ? 0 : fromOpacity};`);
108963
+ toProps.push(` opacity: ${inert ? 0 : toOpacity};`);
108964
+ }
108844
108965
  const colorInterp = buildColorInterpolationProps(fromElement, toElement);
108845
108966
  if (colorInterp) {
108846
108967
  fromProps.push(` background-color: ${colorInterp.fromBg};`);
@@ -108859,10 +108980,18 @@ ${fromProps.join("\n")}
108859
108980
  to {
108860
108981
  ${toProps.join("\n")}
108861
108982
  }
108862
- }`;
108983
+ }${crossfadesIn ? `
108984
+ @keyframes ${safeName}-fade {
108985
+ from {
108986
+ opacity: 0;
108987
+ }
108988
+ to {
108989
+ opacity: ${toOpacity};
108990
+ }
108991
+ }` : ""}`;
108863
108992
  animations.push({
108864
108993
  elementId: toElement.id,
108865
- animation: `${safeName} ${durationMs}ms ${MORPH_EASING} forwards`,
108994
+ animation: `${safeName} ${durationMs}ms ${MORPH_EASING} forwards${crossfadesIn ? `, ${safeName}-fade ${durationMs}ms ${MORPH_CROSSFADE_EASING} forwards` : ""}`,
108866
108995
  keyframes
108867
108996
  });
108868
108997
  }
@@ -108884,22 +109013,31 @@ function generateMorphGhostAnimations(pairs2, durationMs, startIndex, ghostIds)
108884
109013
  const fromRot = fromElement.rotation ?? 0;
108885
109014
  const toRot = shortestRotationTarget(fromRot, toElement.rotation ?? 0);
108886
109015
  const flips = `${fromElement.flipHorizontal ? " scaleX(-1)" : ""}${fromElement.flipVertical ? " scaleY(-1)" : ""}`;
109016
+ const opacity2 = fromElement.opacity ?? 1;
108887
109017
  const keyframes = `
108888
109018
  @keyframes ${safeName} {
108889
109019
  from {
108890
109020
  transform-origin: center;
108891
- transform: translate(0, 0) scale(1, 1) rotate(${fromRot}deg)${flips};
108892
- opacity: ${fromElement.opacity ?? 1};
109021
+ transform: translate(0, 0) scale(1, 1) rotate(${fromRot}deg)${flips};${fadesOut ? "" : `
109022
+ opacity: ${opacity2};`}
108893
109023
  }
108894
109024
  to {
108895
109025
  transform-origin: center;
108896
- transform: translate(${dx}px, ${dy}px) scale(${sx}, ${sy}) rotate(${toRot}deg)${flips};
108897
- opacity: ${fadesOut ? 0 : fromElement.opacity ?? 1};
109026
+ transform: translate(${dx}px, ${dy}px) scale(${sx}, ${sy}) rotate(${toRot}deg)${flips};${fadesOut ? "" : `
109027
+ opacity: ${opacity2};`}
108898
109028
  }
108899
- }`;
109029
+ }${fadesOut ? `
109030
+ @keyframes ${safeName}-fade {
109031
+ from {
109032
+ opacity: ${opacity2};
109033
+ }
109034
+ to {
109035
+ opacity: 0;
109036
+ }
109037
+ }` : ""}`;
108900
109038
  animations.push({
108901
109039
  elementId: fromElement.id,
108902
- animation: `${safeName} ${durationMs}ms ${MORPH_EASING} forwards`,
109040
+ animation: `${safeName} ${durationMs}ms ${MORPH_EASING} forwards${fadesOut ? `, ${safeName}-fade ${durationMs}ms ${MORPH_CROSSFADE_EASING} forwards` : ""}`,
108903
109041
  keyframes
108904
109042
  });
108905
109043
  }
@@ -109041,6 +109179,16 @@ function generateFullMorphTransition(fromSlide, toSlide, durationMs, mode = "obj
109041
109179
  allAnimations.push(...fadeIns);
109042
109180
  return allAnimations;
109043
109181
  }
109182
+ var LIFTED_HIDDEN_NAME = "pptx-morph-lifted-hidden";
109183
+ var LIFTED_HIDDEN_KEYFRAMES = `
109184
+ @keyframes ${LIFTED_HIDDEN_NAME} {
109185
+ from {
109186
+ opacity: 0;
109187
+ }
109188
+ to {
109189
+ opacity: 0;
109190
+ }
109191
+ }`;
109044
109192
  function morphOptionToMode(option) {
109045
109193
  if (option === "byWord") {
109046
109194
  return "word";
@@ -109075,13 +109223,42 @@ function buildMorphTransitionPlan(fromSlide, toSlide, durationMs, mode = "object
109075
109223
  const outgoingElements = flattenedOutgoing.filter(
109076
109224
  (element) => outgoingAnimations.has(element.id)
109077
109225
  );
109226
+ const flattenedIncoming = flattenMorphElements(toSlide.elements, fromSlide.elements);
109227
+ const holdingGhostIds = new Set(
109228
+ match.pairs.filter(
109229
+ (candidate) => outgoingAnimations.has(candidate.fromElement.id) && !morphPairNeedsCrossfade(candidate.fromElement, candidate.toElement)
109230
+ ).map((candidate) => candidate.fromElement.id)
109231
+ );
109232
+ const lifted = resolveMorphOverlayArrivals(
109233
+ flattenedOutgoing,
109234
+ flattenedIncoming,
109235
+ match.pairs,
109236
+ holdingGhostIds
109237
+ );
109238
+ const overlayIncomingAnimations = /* @__PURE__ */ new Map();
109239
+ for (const id of lifted) {
109240
+ const animation = incomingAnimations.get(id);
109241
+ if (animation === void 0) {
109242
+ continue;
109243
+ }
109244
+ overlayIncomingAnimations.set(id, animation);
109245
+ incomingAnimations.set(id, `${LIFTED_HIDDEN_NAME} ${durationMs}ms linear forwards`);
109246
+ }
109247
+ if (overlayIncomingAnimations.size > 0) {
109248
+ keyframes.push(LIFTED_HIDDEN_KEYFRAMES);
109249
+ }
109250
+ const overlayIncomingElements = flattenedIncoming.filter(
109251
+ (element) => overlayIncomingAnimations.has(element.id)
109252
+ );
109078
109253
  return {
109079
109254
  keyframesCss: keyframes.join("\n"),
109080
109255
  incomingAnimations,
109081
109256
  outgoingAnimations,
109082
109257
  incomingImageAnimations,
109083
109258
  outgoingImageAnimations,
109259
+ overlayIncomingAnimations,
109084
109260
  outgoingElements,
109261
+ overlayIncomingElements,
109085
109262
  durationMs
109086
109263
  };
109087
109264
  }
@@ -109099,9 +109276,12 @@ function buildMorphAnimationRules(plan, scopeAttribute, which = "incoming", only
109099
109276
  }
109100
109277
  };
109101
109278
  if (only !== "image") {
109102
- emit(which === "incoming" ? plan.incomingAnimations : plan.outgoingAnimations, "");
109279
+ emit(
109280
+ which === "outgoing" ? plan.outgoingAnimations : which === "lifted" ? plan.overlayIncomingAnimations : plan.incomingAnimations,
109281
+ ""
109282
+ );
109103
109283
  }
109104
- emit(which === "incoming" ? plan.incomingImageAnimations : plan.outgoingImageAnimations, " img");
109284
+ emit(which === "outgoing" ? plan.outgoingImageAnimations : plan.incomingImageAnimations, " img");
109105
109285
  return rules.join("\n");
109106
109286
  }
109107
109287
  function hexToRgb6(hex10) {
@@ -124063,6 +124243,7 @@ exports.parseDrawingColorOpacity = parseDrawingColorOpacity;
124063
124243
  exports.parsePanoseString = parsePanoseString;
124064
124244
  exports.parsePpactionUrl = parsePpactionUrl;
124065
124245
  exports.pickSupportedMimeType = pickSupportedMimeType;
124246
+ exports.pieceLetterSpacing = pieceLetterSpacing;
124066
124247
  exports.placeAudienceWindow = placeAudienceWindow;
124067
124248
  exports.placeCaretAtEnd = placeCaretAtEnd;
124068
124249
  exports.polygonsToSvgPath = polygonsToSvgPath;
@@ -124187,6 +124368,7 @@ exports.slideProgressPercent = slideProgressPercent;
124187
124368
  exports.slideStatusLabel = slideStatusLabel;
124188
124369
  exports.snapBoxToGrid = snapBoxToGrid;
124189
124370
  exports.splitCell = splitCell;
124371
+ exports.splitRunForMetrics = splitRunForMetrics;
124190
124372
  exports.splitSeriesByAxis = splitSeriesByAxis;
124191
124373
  exports.stepPresenterZoom = stepPresenterZoom;
124192
124374
  exports.stopAllPersistentAudio = stopAllPersistentAudio;
Binary file
Binary file
@@ -1334,6 +1334,7 @@ var translationsEn = {
1334
1334
  "pptx.inspector.lock": "Lock",
1335
1335
  "pptx.inspector.unlock": "Unlock",
1336
1336
  // Slide master / handout master / notes master
1337
+ "pptx.master.backgroundColorLabel": "Master background color",
1337
1338
  "pptx.master.collapseMasterPane": "Collapse pane",
1338
1339
  "pptx.master.handoutBackground": "Background",
1339
1340
  "pptx.master.handoutMasterTitle": "Handout Master",
Binary file
Binary file
@@ -1336,6 +1336,7 @@ var translationsEn = {
1336
1336
  "pptx.inspector.lock": "Lock",
1337
1337
  "pptx.inspector.unlock": "Unlock",
1338
1338
  // Slide master / handout master / notes master
1339
+ "pptx.master.backgroundColorLabel": "Master background color",
1339
1340
  "pptx.master.collapseMasterPane": "Collapse pane",
1340
1341
  "pptx.master.handoutBackground": "Background",
1341
1342
  "pptx.master.handoutMasterTitle": "Handout Master",
Binary file
Binary file
@@ -2054,7 +2054,7 @@ var iteratorMap = (iterator, fmap) => createIterator(() => {
2054
2054
  return { done, value: done ? void 0 : fmap(value) };
2055
2055
  });
2056
2056
 
2057
- // ../../node_modules/.bun/yjs@13.6.31/node_modules/yjs/dist/yjs.mjs
2057
+ // ../../node_modules/.bun/yjs@13.6.32/node_modules/yjs/dist/yjs.mjs
2058
2058
  var AbstractConnector = class extends ObservableV2 {
2059
2059
  /**
2060
2060
  * @param {Doc} ydoc
@@ -4364,10 +4364,9 @@ var UndoManager = class extends ObservableV2 {
4364
4364
  this.emit("stack-item-updated", changeEvent);
4365
4365
  }
4366
4366
  };
4367
+ this.destroy = this.destroy.bind(this);
4367
4368
  this.doc.on("afterTransaction", this.afterTransactionHandler);
4368
- this.doc.on("destroy", () => {
4369
- this.destroy();
4370
- });
4369
+ this.doc.on("destroy", this.destroy);
4371
4370
  }
4372
4371
  /**
4373
4372
  * Extend the scope.
@@ -4484,6 +4483,7 @@ var UndoManager = class extends ObservableV2 {
4484
4483
  destroy() {
4485
4484
  this.trackedOrigins.delete(this);
4486
4485
  this.doc.off("afterTransaction", this.afterTransactionHandler);
4486
+ this.doc.off("destroy", this.destroy);
4487
4487
  super.destroy();
4488
4488
  }
4489
4489
  };
Binary file