pptx-react-viewer 2.0.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +1 -1
  3. package/dist/{AiChatPanel-BRGQCYZM.mjs → AiChatPanel-JFCJCR3O.mjs} +3 -3
  4. package/dist/AiChatPanel-JFCJCR3O.mjs.br +0 -0
  5. package/dist/AiChatPanel-JFCJCR3O.mjs.gz +0 -0
  6. package/dist/{AiChatPanel-PW5OT25Z.js → AiChatPanel-S3FWARWG.js} +11 -11
  7. package/dist/AiChatPanel-S3FWARWG.js.br +0 -0
  8. package/dist/AiChatPanel-S3FWARWG.js.gz +0 -0
  9. package/dist/{Model3DScene-JCGYRKXM.js → Model3DScene-BZK4UHL4.js} +2 -2
  10. package/dist/Model3DScene-BZK4UHL4.js.br +0 -0
  11. package/dist/Model3DScene-BZK4UHL4.js.gz +0 -0
  12. package/dist/{Model3DScene-TEF362W2.mjs → Model3DScene-RCZCBW52.mjs} +1 -1
  13. package/dist/{Model3DScene-TEF362W2.mjs.br → Model3DScene-RCZCBW52.mjs.br} +0 -0
  14. package/dist/Model3DScene-RCZCBW52.mjs.gz +0 -0
  15. package/dist/PowerPointViewer-gmU5rc7K.d.ts.map +1 -1
  16. package/dist/{SurfaceChart3DScene-2SHCYZVC.js → SurfaceChart3DScene-EGPAMPX4.js} +2 -2
  17. package/dist/SurfaceChart3DScene-EGPAMPX4.js.br +0 -0
  18. package/dist/SurfaceChart3DScene-EGPAMPX4.js.gz +0 -0
  19. package/dist/{SurfaceChart3DScene-UPDCIMJM.mjs → SurfaceChart3DScene-IRLH4ADG.mjs} +1 -1
  20. package/dist/{SurfaceChart3DScene-UPDCIMJM.mjs.br → SurfaceChart3DScene-IRLH4ADG.mjs.br} +0 -0
  21. package/dist/SurfaceChart3DScene-IRLH4ADG.mjs.gz +0 -0
  22. package/dist/{chunk-LFXG7SGG.js → chunk-3KD6S6VM.js} +1111 -830
  23. package/dist/chunk-3KD6S6VM.js.br +0 -0
  24. package/dist/chunk-3KD6S6VM.js.gz +0 -0
  25. package/dist/{chunk-L63RAVM7.mjs → chunk-6BUR4MJO.mjs} +358 -77
  26. package/dist/chunk-6BUR4MJO.mjs.br +0 -0
  27. package/dist/chunk-6BUR4MJO.mjs.gz +0 -0
  28. package/dist/{chunk-ZB4NZRCI.js → chunk-JPJBOVU7.js} +423 -332
  29. package/dist/chunk-JPJBOVU7.js.br +0 -0
  30. package/dist/chunk-JPJBOVU7.js.gz +0 -0
  31. package/dist/{chunk-5XLLRPMV.mjs → chunk-L4ETDT4F.mjs} +174 -84
  32. package/dist/chunk-L4ETDT4F.mjs.br +0 -0
  33. package/dist/chunk-L4ETDT4F.mjs.gz +0 -0
  34. package/dist/{chunk-2X72MOPZ.mjs → chunk-PZTPX3HK.mjs} +10 -1
  35. package/dist/chunk-PZTPX3HK.mjs.br +0 -0
  36. package/dist/chunk-PZTPX3HK.mjs.gz +0 -0
  37. package/dist/{chunk-R2N2UYT7.mjs → chunk-RLK72AOU.mjs} +403 -3
  38. package/dist/chunk-RLK72AOU.mjs.br +0 -0
  39. package/dist/{chunk-R2N2UYT7.mjs.gz → chunk-RLK72AOU.mjs.gz} +0 -0
  40. package/dist/{chunk-ZKDE3HJI.js → chunk-RNZJKGA7.js} +219 -219
  41. package/dist/chunk-RNZJKGA7.js.br +0 -0
  42. package/dist/chunk-RNZJKGA7.js.gz +0 -0
  43. package/dist/{chunk-B6NRDUHJ.mjs → chunk-SOHIKHL4.mjs} +3 -3
  44. package/dist/chunk-SOHIKHL4.mjs.br +0 -0
  45. package/dist/chunk-SOHIKHL4.mjs.gz +0 -0
  46. package/dist/{chunk-OKOJVSKJ.js → chunk-UTTXH3GH.js} +410 -2
  47. package/dist/chunk-UTTXH3GH.js.br +0 -0
  48. package/dist/{chunk-OKOJVSKJ.js.gz → chunk-UTTXH3GH.js.gz} +0 -0
  49. package/dist/{chunk-CUUYYYC5.js → chunk-YIFO3WQO.js} +10 -1
  50. package/dist/chunk-YIFO3WQO.js.br +0 -0
  51. package/dist/chunk-YIFO3WQO.js.gz +0 -0
  52. package/dist/i18n.js +4 -4
  53. package/dist/i18n.js.br +0 -0
  54. package/dist/i18n.js.gz +0 -0
  55. package/dist/i18n.mjs +1 -1
  56. package/dist/i18n.mjs.br +0 -0
  57. package/dist/i18n.mjs.gz +0 -0
  58. package/dist/{index-a8wcFjRJ.d.ts → index-CDCSXtK3.d.ts} +32 -16
  59. package/dist/index-CDCSXtK3.d.ts.map +1 -0
  60. package/dist/index.js +35 -35
  61. package/dist/index.js.br +0 -0
  62. package/dist/index.js.gz +0 -0
  63. package/dist/index.mjs +5 -5
  64. package/dist/index.mjs.br +0 -0
  65. package/dist/index.mjs.gz +0 -0
  66. package/dist/internals.d.ts +142 -14
  67. package/dist/internals.d.ts.map +1 -1
  68. package/dist/internals.js +79 -79
  69. package/dist/internals.js.br +0 -0
  70. package/dist/internals.js.gz +0 -0
  71. package/dist/internals.mjs +4 -4
  72. package/dist/internals.mjs.br +0 -0
  73. package/dist/internals.mjs.gz +0 -0
  74. package/dist/pptx-viewer.css +1 -1
  75. package/dist/pptx-viewer.css.br +0 -0
  76. package/dist/pptx-viewer.css.gz +0 -0
  77. package/dist/viewer/index.js +21 -21
  78. package/dist/viewer/index.js.br +0 -0
  79. package/dist/viewer/index.js.gz +0 -0
  80. package/dist/viewer/index.mjs +5 -5
  81. package/dist/viewer/index.mjs.br +0 -0
  82. package/dist/viewer/index.mjs.gz +0 -0
  83. package/package.json +5 -3
  84. package/dist/AiChatPanel-BRGQCYZM.mjs.br +0 -0
  85. package/dist/AiChatPanel-BRGQCYZM.mjs.gz +0 -0
  86. package/dist/AiChatPanel-PW5OT25Z.js.br +0 -0
  87. package/dist/AiChatPanel-PW5OT25Z.js.gz +0 -0
  88. package/dist/Model3DScene-JCGYRKXM.js.br +0 -0
  89. package/dist/Model3DScene-JCGYRKXM.js.gz +0 -0
  90. package/dist/Model3DScene-TEF362W2.mjs.gz +0 -0
  91. package/dist/SurfaceChart3DScene-2SHCYZVC.js.br +0 -0
  92. package/dist/SurfaceChart3DScene-2SHCYZVC.js.gz +0 -0
  93. package/dist/SurfaceChart3DScene-UPDCIMJM.mjs.gz +0 -0
  94. package/dist/chunk-2X72MOPZ.mjs.br +0 -0
  95. package/dist/chunk-2X72MOPZ.mjs.gz +0 -0
  96. package/dist/chunk-5XLLRPMV.mjs.br +0 -0
  97. package/dist/chunk-5XLLRPMV.mjs.gz +0 -0
  98. package/dist/chunk-B6NRDUHJ.mjs.br +0 -0
  99. package/dist/chunk-B6NRDUHJ.mjs.gz +0 -0
  100. package/dist/chunk-CUUYYYC5.js.br +0 -0
  101. package/dist/chunk-CUUYYYC5.js.gz +0 -0
  102. package/dist/chunk-L63RAVM7.mjs.br +0 -0
  103. package/dist/chunk-L63RAVM7.mjs.gz +0 -0
  104. package/dist/chunk-LFXG7SGG.js.br +0 -0
  105. package/dist/chunk-LFXG7SGG.js.gz +0 -0
  106. package/dist/chunk-OKOJVSKJ.js.br +0 -0
  107. package/dist/chunk-R2N2UYT7.mjs.br +0 -0
  108. package/dist/chunk-ZB4NZRCI.js.br +0 -0
  109. package/dist/chunk-ZB4NZRCI.js.gz +0 -0
  110. package/dist/chunk-ZKDE3HJI.js.br +0 -0
  111. package/dist/chunk-ZKDE3HJI.js.gz +0 -0
  112. package/dist/index-a8wcFjRJ.d.ts.map +0 -1
Binary file
Binary file
@@ -1,5 +1,5 @@
1
- import { SHAPE_PRESET_DEFS, computeValueRangeForChart, getAnimationInitialStyle, cloneHistorySnapshot, isTemplateElement, clampCropValue, parseMediaCommand, normalizeHexColor, toCssWritingMode, toCssTextOrientation, toCssVerticalDirection, computeAutoFitTextStyle, resolveLineHeight, getKinsokuLineBreakStyles, buildTextBody3DSceneStyle, resolveParagraphRtl, resolveParagraphAlign, resolveCssTextAlign, colorWithOpacity, build3DExtrusionData, getResolvedShapeClipPath, normalizeStrokeDashType, buildCssGradientFromShapeStyle, buildShadowCssFromShapeStyle, buildInnerShadowCssFromShapeStyle, buildMultiLayerShadowCss, buildGlowBoxShadow, getCompoundLineBoxShadow, getSoftEdgeFilterId, getEffectDagFilter, buildPatternFillCss, buildReflectionCss, getCssBorderDashStyle, getCompoundLineBorderWidth, getSvgStrokeDasharray, svgLineCap, getCompoundLineOffsets, getCompoundLineWidths, computeSelectionRect, rectToCells, isCellInRect, buildChartViewModel, buildNotesPdfBytes, buildSlidesPdfBytes, buildPreviewAnimation, getRoundRectRadiusPx, substituteFieldText, resolveUnderlineDecorationStyle, hasDistinctScriptFonts, buildTextReflectionCss, getTextAlphaOpacity, buildTextRunFilterChain, buildTextShadowCss, TEXT_BUILD_ID_SEP, apply3dEffects, clampUnitInterval, computeColumnBoundaries, parseDrawingColor, parseDrawingColorOpacity, getCellDiagonalBorders, getPatternSvg, ooxmlDashToCssBorderStyle, cell3DBevelCss, getChartStylePalette, computeLayout, valueToY, formatAxisValue, computeLayoutOptions, splitSeriesByAxis, computeValueRange, getSecondaryValueAxis, seriesColor, paletteColor, resolveRegionCode, normalizeValue, sequentialColorScale, convertOmmlToMathMl, sanitizeMathMl, buildTextFillCss, resolvePictureBullet, computeResizedColumnWidths, computeResizedRowHeight, DEFAULT_ROW_HEIGHT, resolveFontRefIdx, tintColor2, shadeColor2, segmentByScript, resolveFontForScript, generateLogTicks, formatAxisValueWithUnits, getDisplayUnitLabel, hexToRgbChannels, chartPartToAttrs } from './chunk-R2N2UYT7.mjs';
2
- import { translationsEn } from './chunk-2X72MOPZ.mjs';
1
+ import { SHAPE_PRESET_DEFS, computeValueRangeForChart, getAnimationInitialStyle, cloneHistorySnapshot, isTemplateElement, clampCropValue, parseMediaCommand, normalizeHexColor, toCssWritingMode, toCssTextOrientation, toCssVerticalDirection, computeAutoFitTextStyle, resolveLineHeight, getKinsokuLineBreakStyles, buildTextBody3DSceneStyle, resolveParagraphRtl, resolveParagraphAlign, resolveCssTextAlign, colorWithOpacity, build3DExtrusionData, getResolvedShapeClipPath, normalizeStrokeDashType, buildCssGradientFromShapeStyle, buildShadowCssFromShapeStyle, buildInnerShadowCssFromShapeStyle, buildMultiLayerShadowCss, buildGlowBoxShadow, getCompoundLineBoxShadow, getSoftEdgeFilterId, getEffectDagFilter, buildPatternFillCss, buildReflectionCss, getCssBorderDashStyle, getCompoundLineBorderWidth, getSvgStrokeDasharray, svgLineCap, getCompoundLineOffsets, getCompoundLineWidths, computeSelectionRect, rectToCells, isCellInRect, buildChartViewModel, buildNotesPdfBytes, buildSlidesPdfBytes, buildPreviewAnimation, getRoundRectRadiusPx, substituteFieldText, resolveUnderlineDecorationStyle, hasDistinctScriptFonts, buildTextReflectionCss, getTextAlphaOpacity, buildTextRunFilterChain, buildTextShadowCss, TEXT_BUILD_ID_SEP, apply3dEffects, clampUnitInterval, computeColumnBoundaries, parseDrawingColor, parseDrawingColorOpacity, getCellDiagonalBorders, getPatternSvg, ooxmlDashToCssBorderStyle, cell3DBevelCss, getChartStylePalette, computeLayout, valueToY, formatAxisValue, computeLayoutOptions, splitSeriesByAxis, computeValueRange, getSecondaryValueAxis, seriesColor, paletteColor, resolveRegionCode, normalizeValue, sequentialColorScale, convertOmmlToMathMl, sanitizeMathMl, buildTextFillCss, resolvePictureBullet, computeResizedColumnWidths, computeResizedRowHeight, DEFAULT_ROW_HEIGHT, resolveFontRefIdx, tintColor2, shadeColor2, segmentByScript, resolveFontForScript, generateLogTicks, formatAxisValueWithUnits, getDisplayUnitLabel, hexToRgbChannels, chartPartToAttrs } from './chunk-RLK72AOU.mjs';
2
+ import { translationsEn } from './chunk-PZTPX3HK.mjs';
3
3
  import { hasShapeProperties, isImageLikeElement, hasTextProperties, isCalloutShape, getCalloutLeaderLineGeometry, buildCalloutLeaderLineSvgPath, getCalloutViewBoxBounds, getSubstituteFontFamily, evaluatePresetShape, customGeometryPathsToSvgSubpaths } from './chunk-6YXLGMTN.mjs';
4
4
  import { clsx } from 'clsx';
5
5
  import { twMerge } from 'tailwind-merge';
@@ -6250,7 +6250,7 @@ function FailedToLoad() {
6250
6250
  var LazySurfaceChart3DScene = React6.lazy(
6251
6251
  async () => {
6252
6252
  try {
6253
- return await import('./SurfaceChart3DScene-UPDCIMJM.mjs');
6253
+ return await import('./SurfaceChart3DScene-IRLH4ADG.mjs');
6254
6254
  } catch {
6255
6255
  return { default: FailedToLoad };
6256
6256
  }
Binary file
Binary file
@@ -17591,7 +17591,7 @@ function reconcileComplexFields(ymap, rec, fields) {
17591
17591
  }
17592
17592
  }
17593
17593
  }
17594
- function reconcileTextBody(ymap, rec, factories) {
17594
+ function reconcileElementTextBody(ymap, rec, factories) {
17595
17595
  const segments = rec.textSegments;
17596
17596
  const current = ymap.get("textBody");
17597
17597
  if (!Array.isArray(segments)) {
@@ -17617,7 +17617,7 @@ function reconcileElementYMap(ymap, element, factories, assets) {
17617
17617
  const rec = element;
17618
17618
  reconcileScalars(ymap, rec, SCALAR_ELEMENT_KEYS);
17619
17619
  reconcileComplexFields(ymap, rec, COMPLEX_ELEMENT_FIELDS);
17620
- reconcileTextBody(ymap, rec, factories);
17620
+ reconcileElementTextBody(ymap, rec, factories);
17621
17621
  reconcileAssetFields(rec.id, rec, ymap, assets);
17622
17622
  }
17623
17623
  function mapIdAt(arr, index) {
@@ -17715,6 +17715,175 @@ function reconcileSlidesInYDoc(slides, ydoc, factories, origin = LOCAL_SYNC_ORIG
17715
17715
  });
17716
17716
  }, origin);
17717
17717
  }
17718
+ var GEOMETRY_KEYS = ["x", "y", "width", "height", "rotation"];
17719
+ var MAX_LIVE_TEXT_LENGTH = 1e5;
17720
+ var asMap = (value) => typeof value === "object" && value !== null && typeof value.get === "function" ? value : void 0;
17721
+ var asArray = (value) => typeof value === "object" && value !== null && typeof value.get === "function" ? value : void 0;
17722
+ function findElementYMap(doc, slideId, elementId) {
17723
+ const slidesArr = doc.getArray(YDOC_SLIDES_KEY);
17724
+ for (let i = 0; i < slidesArr.length; i++) {
17725
+ const slideMap = asMap(slidesArr.get(i));
17726
+ if (!slideMap || slideId !== void 0 && slideMap.get("id") !== slideId) {
17727
+ continue;
17728
+ }
17729
+ const elements = asArray(slideMap.get("elements"));
17730
+ if (!elements) {
17731
+ continue;
17732
+ }
17733
+ for (let j = 0; j < elements.length; j++) {
17734
+ const elementMap = asMap(elements.get(j));
17735
+ if (elementMap && elementMap.get("id") === elementId) {
17736
+ return elementMap;
17737
+ }
17738
+ }
17739
+ }
17740
+ return void 0;
17741
+ }
17742
+ function applyLivePatch(doc, factories, patch, textPatchLimit) {
17743
+ const ymap = findElementYMap(doc, patch.slideId, patch.elementId);
17744
+ if (!ymap) {
17745
+ return;
17746
+ }
17747
+ if (patch.geometry) {
17748
+ for (const key of GEOMETRY_KEYS) {
17749
+ const next = patch.geometry[key];
17750
+ if (typeof next === "number" && ymap.get(key) !== next) {
17751
+ ymap.set(key, next);
17752
+ }
17753
+ }
17754
+ }
17755
+ if (patch.text) {
17756
+ const { value, source } = patch.text;
17757
+ if (value.length > textPatchLimit) {
17758
+ return;
17759
+ }
17760
+ if (ymap.get("text") !== value) {
17761
+ ymap.set("text", value);
17762
+ }
17763
+ const segments = remapTextToSegments(value, source.textSegments, source.textStyle);
17764
+ reconcileElementTextBody(ymap, { textSegments: segments }, factories);
17765
+ }
17766
+ }
17767
+ var LIVE_PATCH_THROTTLE_MS = 50;
17768
+ function createCollaborationLivePatcher(options = {}) {
17769
+ const throttleMs = options.throttleMs ?? LIVE_PATCH_THROTTLE_MS;
17770
+ const pending = /* @__PURE__ */ new Map();
17771
+ let doc = null;
17772
+ let factories = null;
17773
+ let timer = null;
17774
+ let lastWriteAt = Number.NEGATIVE_INFINITY;
17775
+ const cancelTimer = () => {
17776
+ if (timer !== null) {
17777
+ clearTimeout(timer);
17778
+ timer = null;
17779
+ }
17780
+ };
17781
+ const writePending = () => {
17782
+ const activeDoc = doc;
17783
+ const activeFactories = factories;
17784
+ if (!activeDoc || !activeFactories || pending.size === 0) {
17785
+ pending.clear();
17786
+ return;
17787
+ }
17788
+ const patches = [...pending.values()];
17789
+ pending.clear();
17790
+ lastWriteAt = Date.now();
17791
+ try {
17792
+ activeDoc.transact(() => {
17793
+ for (const patch of patches) {
17794
+ applyLivePatch(activeDoc, activeFactories, patch, MAX_LIVE_TEXT_LENGTH);
17795
+ }
17796
+ }, LOCAL_SYNC_ORIGIN);
17797
+ } catch {
17798
+ }
17799
+ };
17800
+ const schedule = () => {
17801
+ if (timer !== null) {
17802
+ return;
17803
+ }
17804
+ const elapsed = Date.now() - lastWriteAt;
17805
+ if (elapsed >= throttleMs) {
17806
+ writePending();
17807
+ return;
17808
+ }
17809
+ timer = setTimeout(() => {
17810
+ timer = null;
17811
+ writePending();
17812
+ }, throttleMs - elapsed);
17813
+ };
17814
+ const enqueue = (slideId, elementId) => {
17815
+ if (!doc || !factories || !elementId) {
17816
+ return null;
17817
+ }
17818
+ const key = `${slideId ?? ""}\0${elementId}`;
17819
+ let entry = pending.get(key);
17820
+ if (!entry) {
17821
+ entry = { slideId, elementId };
17822
+ pending.set(key, entry);
17823
+ }
17824
+ return entry;
17825
+ };
17826
+ return {
17827
+ configure(nextDoc, nextFactories) {
17828
+ if (nextDoc === doc && nextFactories === factories) {
17829
+ return;
17830
+ }
17831
+ cancelTimer();
17832
+ pending.clear();
17833
+ doc = nextDoc;
17834
+ factories = nextFactories;
17835
+ lastWriteAt = Number.NEGATIVE_INFINITY;
17836
+ },
17837
+ isActive() {
17838
+ return doc !== null && factories !== null;
17839
+ },
17840
+ patchGeometry(slideId, elementId, geometry) {
17841
+ const entry = enqueue(slideId, elementId);
17842
+ if (!entry) {
17843
+ return;
17844
+ }
17845
+ entry.geometry = { ...entry.geometry, ...geometry };
17846
+ schedule();
17847
+ },
17848
+ patchText(slideId, elementId, text, source) {
17849
+ const entry = enqueue(slideId, elementId);
17850
+ if (!entry) {
17851
+ return;
17852
+ }
17853
+ entry.text = { value: text, source: source ?? entry.text?.source ?? {} };
17854
+ schedule();
17855
+ },
17856
+ flush() {
17857
+ cancelTimer();
17858
+ writePending();
17859
+ },
17860
+ dispose() {
17861
+ cancelTimer();
17862
+ pending.clear();
17863
+ doc = null;
17864
+ factories = null;
17865
+ }
17866
+ };
17867
+ }
17868
+ function publishLiveInlineText(patcher, slide, elementId, text) {
17869
+ if (!patcher || !slide || !elementId || !patcher.isActive()) {
17870
+ return;
17871
+ }
17872
+ const element = slide.elements.find((el) => el.id === elementId);
17873
+ if (!element || !chunkCLNGAVNH_js.hasTextProperties(element)) {
17874
+ return;
17875
+ }
17876
+ patcher.patchText(slide.id, elementId, text, {
17877
+ textSegments: element.textSegments,
17878
+ textStyle: element.textStyle
17879
+ });
17880
+ }
17881
+ function publishLiveGeometry(patcher, slideId, elementId, geometry) {
17882
+ if (!patcher || !elementId || !patcher.isActive()) {
17883
+ return;
17884
+ }
17885
+ patcher.patchGeometry(slideId, elementId, geometry);
17886
+ }
17718
17887
  function createSyncGate(onOpen, graceMs = INITIAL_SYNC_GRACE_MS) {
17719
17888
  let opened = false;
17720
17889
  let timer = null;
@@ -17747,6 +17916,144 @@ function createSyncGate(onOpen, graceMs = INITIAL_SYNC_GRACE_MS) {
17747
17916
  }
17748
17917
  };
17749
17918
  }
17919
+ var COLLAB_LEAVE_MESSAGE = "pptx-viewer:collab-leave";
17920
+ function resolveTarget(target) {
17921
+ if (target) {
17922
+ return target;
17923
+ }
17924
+ const scope = globalThis;
17925
+ return scope.window ?? null;
17926
+ }
17927
+ function isLeaveMessage(data) {
17928
+ if (typeof data === "string") {
17929
+ return data === COLLAB_LEAVE_MESSAGE;
17930
+ }
17931
+ if (typeof data !== "object" || data === null) {
17932
+ return false;
17933
+ }
17934
+ return data.type === COLLAB_LEAVE_MESSAGE;
17935
+ }
17936
+ function registerCollaborationTeardown(options) {
17937
+ const target = resolveTarget(options.target);
17938
+ if (!target) {
17939
+ return () => {
17940
+ };
17941
+ }
17942
+ const { leave, rejoin } = options;
17943
+ let left = false;
17944
+ const doLeave = () => {
17945
+ if (left) {
17946
+ return;
17947
+ }
17948
+ left = true;
17949
+ leave();
17950
+ };
17951
+ const onPageHide = (event) => {
17952
+ if (event.persisted === true && !rejoin) {
17953
+ return;
17954
+ }
17955
+ doLeave();
17956
+ };
17957
+ const onBeforeUnload = () => {
17958
+ doLeave();
17959
+ };
17960
+ const onPageShow = (event) => {
17961
+ if (event.persisted !== true || !left || !rejoin) {
17962
+ return;
17963
+ }
17964
+ left = false;
17965
+ rejoin();
17966
+ };
17967
+ const onMessage = (event) => {
17968
+ if (isLeaveMessage(event.data)) {
17969
+ doLeave();
17970
+ }
17971
+ };
17972
+ target.addEventListener("pagehide", onPageHide);
17973
+ target.addEventListener("beforeunload", onBeforeUnload);
17974
+ target.addEventListener("pageshow", onPageShow);
17975
+ target.addEventListener("message", onMessage);
17976
+ return () => {
17977
+ target.removeEventListener("pagehide", onPageHide);
17978
+ target.removeEventListener("beforeunload", onBeforeUnload);
17979
+ target.removeEventListener("pageshow", onPageShow);
17980
+ target.removeEventListener("message", onMessage);
17981
+ };
17982
+ }
17983
+ function clearLocalAwareness(awareness) {
17984
+ awareness?.setLocalState?.(null);
17985
+ }
17986
+ var DEPARTURE_CHANNEL = "pptx-viewer:collab-departures";
17987
+ function removeAwarenessStatesLocally(awareness, clients) {
17988
+ const states = awareness?.states;
17989
+ if (!awareness || !states) {
17990
+ return [];
17991
+ }
17992
+ const removed = [];
17993
+ for (const clientId of clients) {
17994
+ if (states.delete(clientId)) {
17995
+ removed.push(clientId);
17996
+ }
17997
+ }
17998
+ if (removed.length > 0) {
17999
+ const change = { added: [], updated: [], removed };
18000
+ awareness.emit?.("change", [change, "peer-departed"]);
18001
+ awareness.emit?.("update", [change, "peer-departed"]);
18002
+ }
18003
+ return removed;
18004
+ }
18005
+ function readNotice(data, roomId, selfId) {
18006
+ if (typeof data !== "object" || data === null) {
18007
+ return null;
18008
+ }
18009
+ const notice = data;
18010
+ if (notice.channel !== DEPARTURE_CHANNEL || notice.roomId !== roomId) {
18011
+ return null;
18012
+ }
18013
+ if (typeof notice.clientId !== "number" || notice.clientId === selfId) {
18014
+ return null;
18015
+ }
18016
+ return notice.clientId;
18017
+ }
18018
+ function defaultFactory(name) {
18019
+ const scope = globalThis;
18020
+ if (!scope.BroadcastChannel) {
18021
+ return null;
18022
+ }
18023
+ return new scope.BroadcastChannel(name);
18024
+ }
18025
+ function createDepartureChannel(roomId, awareness, factory) {
18026
+ const channel = factory ? factory(DEPARTURE_CHANNEL) : defaultFactory(DEPARTURE_CHANNEL);
18027
+ if (!channel) {
18028
+ return { announce: () => {
18029
+ }, dispose: () => {
18030
+ } };
18031
+ }
18032
+ const selfId = awareness.clientID;
18033
+ channel.onmessage = (event) => {
18034
+ const departed = readNotice(event.data, roomId, selfId);
18035
+ if (departed !== null) {
18036
+ removeAwarenessStatesLocally(awareness, [departed]);
18037
+ }
18038
+ };
18039
+ let closed = false;
18040
+ return {
18041
+ announce: () => {
18042
+ if (closed || typeof selfId !== "number") {
18043
+ return;
18044
+ }
18045
+ channel.postMessage({ channel: DEPARTURE_CHANNEL, roomId, clientId: selfId });
18046
+ },
18047
+ dispose: () => {
18048
+ if (closed) {
18049
+ return;
18050
+ }
18051
+ closed = true;
18052
+ channel.onmessage = null;
18053
+ channel.close();
18054
+ }
18055
+ };
18056
+ }
17750
18057
  var POSITION_THRESHOLD = 2;
17751
18058
  var SIZE_THRESHOLD = 2;
17752
18059
  function getElementText(element) {
@@ -22490,6 +22797,99 @@ async function clearAudienceContent(sessionId) {
22490
22797
  function formatSlideCounter(currentSlide, totalSlides) {
22491
22798
  return `${currentSlide + 1} / ${totalSlides}`;
22492
22799
  }
22800
+ function createPresentationKeyBuffer() {
22801
+ return { digits: "" };
22802
+ }
22803
+ var NEXT_KEYS = /* @__PURE__ */ new Set(["Enter", "PageDown", "ArrowRight", "ArrowDown", " ", "Spacebar"]);
22804
+ var PREVIOUS_KEYS = /* @__PURE__ */ new Set(["PageUp", "ArrowLeft", "ArrowUp", "Backspace"]);
22805
+ function isBare(input) {
22806
+ return !input.ctrlKey && !input.metaKey && !input.altKey;
22807
+ }
22808
+ function isControlChord(input) {
22809
+ return Boolean(input.ctrlKey || input.metaKey) && !input.altKey;
22810
+ }
22811
+ function mapPresentationKey(input, buffer = createPresentationKeyBuffer()) {
22812
+ const { key } = input;
22813
+ if (isControlChord(input)) {
22814
+ switch (key.toLowerCase()) {
22815
+ case "l":
22816
+ return { action: "pointerTool", tool: "laser" };
22817
+ case "p":
22818
+ return { action: "pointerTool", tool: "pen" };
22819
+ case "a":
22820
+ return { action: "pointerTool", tool: "arrow" };
22821
+ case "e":
22822
+ return { action: "pointerTool", tool: "eraser" };
22823
+ case "m":
22824
+ return { action: "toggleInkMarkup" };
22825
+ case "h":
22826
+ return { action: "toggleChrome" };
22827
+ case "s":
22828
+ return { action: "showAllSlides" };
22829
+ default:
22830
+ return { action: "none" };
22831
+ }
22832
+ }
22833
+ if (key === "F10" && input.shiftKey || key === "ContextMenu") {
22834
+ return { action: "contextMenu" };
22835
+ }
22836
+ if (isBare(input) && key.length === 1 && key >= "0" && key <= "9") {
22837
+ buffer.digits = (buffer.digits + key).slice(-4);
22838
+ return { action: "buffering", buffer: buffer.digits };
22839
+ }
22840
+ if (NEXT_KEYS.has(key)) {
22841
+ if (key === "Enter" && buffer.digits) {
22842
+ const slideNumber = Number.parseInt(buffer.digits, 10);
22843
+ buffer.digits = "";
22844
+ if (Number.isFinite(slideNumber) && slideNumber > 0) {
22845
+ return { action: "goto", slideNumber };
22846
+ }
22847
+ return { action: "none" };
22848
+ }
22849
+ buffer.digits = "";
22850
+ return { action: "next" };
22851
+ }
22852
+ if (PREVIOUS_KEYS.has(key)) {
22853
+ buffer.digits = "";
22854
+ return { action: "previous" };
22855
+ }
22856
+ if (key === "Home") {
22857
+ buffer.digits = "";
22858
+ return { action: "first" };
22859
+ }
22860
+ if (key === "End") {
22861
+ buffer.digits = "";
22862
+ return { action: "last" };
22863
+ }
22864
+ if (isBare(input)) {
22865
+ switch (key) {
22866
+ case "n":
22867
+ case "N":
22868
+ buffer.digits = "";
22869
+ return { action: "next" };
22870
+ case "p":
22871
+ case "P":
22872
+ buffer.digits = "";
22873
+ return { action: "previous" };
22874
+ case "b":
22875
+ case "B":
22876
+ case ".":
22877
+ return { action: "toggleBlackScreen" };
22878
+ case "w":
22879
+ case "W":
22880
+ case ",":
22881
+ return { action: "toggleWhiteScreen" };
22882
+ case "e":
22883
+ case "E":
22884
+ return { action: "eraseAnnotations" };
22885
+ case "Escape":
22886
+ case "-":
22887
+ buffer.digits = "";
22888
+ return { action: "end" };
22889
+ }
22890
+ }
22891
+ return { action: "none" };
22892
+ }
22493
22893
  var ACTION_BUTTON_PRESETS = [
22494
22894
  {
22495
22895
  shapeType: "actionButtonBackPrevious",
@@ -27338,6 +27738,7 @@ exports.clampPercent = clampPercent;
27338
27738
  exports.clampUnitInterval = clampUnitInterval;
27339
27739
  exports.clearAllLocalViewerData = clearAllLocalViewerData;
27340
27740
  exports.clearAudienceContent = clearAudienceContent;
27741
+ exports.clearLocalAwareness = clearLocalAwareness;
27341
27742
  exports.clearStoredViewerPrefs = clearStoredViewerPrefs;
27342
27743
  exports.cloneElementForPaste = cloneElementForPaste;
27343
27744
  exports.cloneHistorySnapshot = cloneHistorySnapshot;
@@ -27376,8 +27777,11 @@ exports.convertOmmlToMathMl = convertOmmlToMathMl;
27376
27777
  exports.copyFormatFromElement = copyFormatFromElement;
27377
27778
  exports.createBackstagePresentation = createBackstagePresentation;
27378
27779
  exports.createBlankSlide = createBlankSlide;
27780
+ exports.createCollaborationLivePatcher = createCollaborationLivePatcher;
27379
27781
  exports.createDefaultChartElement = createDefaultChartElement;
27782
+ exports.createDepartureChannel = createDepartureChannel;
27380
27783
  exports.createInitialPresentationSnapshot = createInitialPresentationSnapshot;
27784
+ exports.createPresentationKeyBuffer = createPresentationKeyBuffer;
27381
27785
  exports.createPresentationSessionId = createPresentationSessionId;
27382
27786
  exports.createPresenterTimer = createPresenterTimer;
27383
27787
  exports.createSyncGate = createSyncGate;
@@ -27503,6 +27907,7 @@ exports.listBackstageRecentFiles = listBackstageRecentFiles;
27503
27907
  exports.loadAudienceContent = loadAudienceContent;
27504
27908
  exports.makeCloneId = makeCloneId;
27505
27909
  exports.makeSlideId = makeSlideId;
27910
+ exports.mapPresentationKey = mapPresentationKey;
27506
27911
  exports.mergeAdditiveSelection = mergeAdditiveSelection;
27507
27912
  exports.mergeCells = mergeCells;
27508
27913
  exports.mergePresentationSnapshot = mergePresentationSnapshot;
@@ -27538,6 +27943,8 @@ exports.presenterElapsed = presenterElapsed;
27538
27943
  exports.pressuresToWidths = pressuresToWidths;
27539
27944
  exports.printPropertiesFrameSlides = printPropertiesFrameSlides;
27540
27945
  exports.printPropertiesSlidesPerPage = printPropertiesSlidesPerPage;
27946
+ exports.publishLiveGeometry = publishLiveGeometry;
27947
+ exports.publishLiveInlineText = publishLiveInlineText;
27541
27948
  exports.readBackstageRecentFile = readBackstageRecentFile;
27542
27949
  exports.readSlidesFromYDoc = readSlidesFromYDoc;
27543
27950
  exports.readStoredViewerPrefs = readStoredViewerPrefs;
@@ -27546,6 +27953,7 @@ exports.rebuildDrawingShapesIfCleared = rebuildDrawingShapesIfCleared;
27546
27953
  exports.reconcileSlidesInYDoc = reconcileSlidesInYDoc;
27547
27954
  exports.recordProgressPercent = recordProgressPercent;
27548
27955
  exports.rectToCells = rectToCells;
27956
+ exports.registerCollaborationTeardown = registerCollaborationTeardown;
27549
27957
  exports.remapTextToSegments = remapTextToSegments;
27550
27958
  exports.removeQuickAccessCommand = removeQuickAccessCommand;
27551
27959
  exports.renameSection = renameSection;
Binary file
@@ -377,6 +377,7 @@ var translationsEn = {
377
377
  "pptx.presentation.highlighter": "Highlighter",
378
378
  "pptx.presentation.eraser": "Eraser",
379
379
  "pptx.presentation.laserPointer": "Laser Pointer",
380
+ "pptx.presentation.pointerTools": "Pointer Options",
380
381
  // Selection pane
381
382
  "pptx.selectionPane.title": "Selection Pane",
382
383
  "pptx.selectionPane.empty": "No elements",
@@ -1103,9 +1104,17 @@ var translationsEn = {
1103
1104
  "pptx.presenter.nextSlide": "Next Slide",
1104
1105
  "pptx.presenter.noSlides": "No slides",
1105
1106
  "pptx.presenter.openAudienceWindow": "Open Audience Window",
1106
- "pptx.presenter.presenterView": "Presenter View (N)",
1107
+ "pptx.presenter.presenterView": "Presenter View",
1107
1108
  "pptx.presenter.prev": "Prev",
1108
1109
  "pptx.presenter.previousSlide": "Previous Slide",
1110
+ "pptx.presenter.seeAllSlides": "See All Slides",
1111
+ "pptx.presenter.screen": "Screen",
1112
+ "pptx.presenter.blackScreen": "Black Screen",
1113
+ "pptx.presenter.whiteScreen": "White Screen",
1114
+ "pptx.presenter.pointerArrow": "Arrow",
1115
+ "pptx.presenter.pointerPen": "Pen",
1116
+ "pptx.presenter.pointerHighlighter": "Highlighter",
1117
+ "pptx.presenter.eraseAllInk": "Erase All Ink on Slide",
1109
1118
  "pptx.presenter.slideLabel": "Slide {{current}} of {{total}}",
1110
1119
  "pptx.presenter.timerProgress": "Timer Progress",
1111
1120
  // Print dialog
Binary file
Binary file
package/dist/i18n.js CHANGED
@@ -1,19 +1,19 @@
1
1
  'use strict';
2
2
 
3
- var chunkCUUYYYC5_js = require('./chunk-CUUYYYC5.js');
3
+ var chunkYIFO3WQO_js = require('./chunk-YIFO3WQO.js');
4
4
  require('./chunk-4VNS5WPM.js');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "LOCALE_CATALOG", {
9
9
  enumerable: true,
10
- get: function () { return chunkCUUYYYC5_js.LOCALE_CATALOG; }
10
+ get: function () { return chunkYIFO3WQO_js.LOCALE_CATALOG; }
11
11
  });
12
12
  Object.defineProperty(exports, "keyToLabel", {
13
13
  enumerable: true,
14
- get: function () { return chunkCUUYYYC5_js.keyToLabel; }
14
+ get: function () { return chunkYIFO3WQO_js.keyToLabel; }
15
15
  });
16
16
  Object.defineProperty(exports, "translationsEn", {
17
17
  enumerable: true,
18
- get: function () { return chunkCUUYYYC5_js.translationsEn; }
18
+ get: function () { return chunkYIFO3WQO_js.translationsEn; }
19
19
  });
package/dist/i18n.js.br CHANGED
Binary file
package/dist/i18n.js.gz CHANGED
Binary file
package/dist/i18n.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export { LOCALE_CATALOG, keyToLabel, translationsEn } from './chunk-2X72MOPZ.mjs';
1
+ export { LOCALE_CATALOG, keyToLabel, translationsEn } from './chunk-PZTPX3HK.mjs';
2
2
  import './chunk-XGB3TDIC.mjs';
package/dist/i18n.mjs.br CHANGED
Binary file
package/dist/i18n.mjs.gz CHANGED
Binary file