pptx-react-viewer 4.52.0 → 4.53.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 (43) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/{chunk-3KXEJCMG.mjs → chunk-3WAEUEID.mjs} +133 -128
  3. package/dist/chunk-3WAEUEID.mjs.br +0 -0
  4. package/dist/chunk-3WAEUEID.mjs.gz +0 -0
  5. package/dist/{chunk-I63IFSNX.js → chunk-7M7MQGRK.js} +1252 -1134
  6. package/dist/chunk-7M7MQGRK.js.br +0 -0
  7. package/dist/chunk-7M7MQGRK.js.gz +0 -0
  8. package/dist/{chunk-E6A6ZBAM.mjs → chunk-BFVUPYIH.mjs} +188 -70
  9. package/dist/chunk-BFVUPYIH.mjs.br +0 -0
  10. package/dist/chunk-BFVUPYIH.mjs.gz +0 -0
  11. package/dist/{chunk-6GAWXARM.js → chunk-L3I2DEBI.js} +132 -126
  12. package/dist/chunk-L3I2DEBI.js.br +0 -0
  13. package/dist/chunk-L3I2DEBI.js.gz +0 -0
  14. package/dist/index.d.ts +17 -1
  15. package/dist/index.js +23 -23
  16. package/dist/index.js.br +0 -0
  17. package/dist/index.js.gz +0 -0
  18. package/dist/index.mjs +2 -2
  19. package/dist/index.mjs.br +0 -0
  20. package/dist/index.mjs.gz +0 -0
  21. package/dist/internals.d.ts +36 -6
  22. package/dist/internals.js +80 -80
  23. package/dist/internals.js.br +0 -0
  24. package/dist/internals.js.gz +0 -0
  25. package/dist/internals.mjs +1 -1
  26. package/dist/internals.mjs.br +0 -0
  27. package/dist/internals.mjs.gz +0 -0
  28. package/dist/viewer/index.d.ts +10 -0
  29. package/dist/viewer/index.js +18 -18
  30. package/dist/viewer/index.js.br +0 -0
  31. package/dist/viewer/index.js.gz +0 -0
  32. package/dist/viewer/index.mjs +2 -2
  33. package/dist/viewer/index.mjs.br +0 -0
  34. package/dist/viewer/index.mjs.gz +0 -0
  35. package/package.json +3 -3
  36. package/dist/chunk-3KXEJCMG.mjs.br +0 -0
  37. package/dist/chunk-3KXEJCMG.mjs.gz +0 -0
  38. package/dist/chunk-6GAWXARM.js.br +0 -0
  39. package/dist/chunk-6GAWXARM.js.gz +0 -0
  40. package/dist/chunk-E6A6ZBAM.mjs.br +0 -0
  41. package/dist/chunk-E6A6ZBAM.mjs.gz +0 -0
  42. package/dist/chunk-I63IFSNX.js.br +0 -0
  43. package/dist/chunk-I63IFSNX.js.gz +0 -0
Binary file
Binary file
@@ -731,7 +731,11 @@ function useEditorHistory(input) {
731
731
  React17.useEffect(() => {
732
732
  onDirtyRef.current = onDirty;
733
733
  }, [onDirty]);
734
+ const untrackedDepthRef = React17.useRef(0);
734
735
  const markDirty = React17.useCallback(() => {
736
+ if (untrackedDepthRef.current > 0) {
737
+ return;
738
+ }
735
739
  setEditCommitNonce((previous) => previous + 1);
736
740
  onDirtyRef.current?.();
737
741
  }, []);
@@ -748,6 +752,14 @@ function useEditorHistory(input) {
748
752
  },
749
753
  []
750
754
  );
755
+ const withoutUndoStep = React17.useCallback((apply) => {
756
+ untrackedDepthRef.current += 1;
757
+ try {
758
+ apply();
759
+ } finally {
760
+ untrackedDepthRef.current -= 1;
761
+ }
762
+ }, []);
751
763
  const handleUndo = React17.useCallback(() => {
752
764
  if (!history.getSnapshot().canUndo) {
753
765
  return;
@@ -906,6 +918,7 @@ function useEditorHistory(input) {
906
918
  resetHistory,
907
919
  forgetHistory: history.forget,
908
920
  markDirty,
921
+ withoutUndoStep,
909
922
  buildHistorySnapshot
910
923
  };
911
924
  }
@@ -3204,109 +3217,62 @@ function usePresentationAnnotations(input) {
3204
3217
  function useFindReplace({
3205
3218
  slides,
3206
3219
  mode,
3207
- onSetActiveSlideIndex,
3208
- onSetSelectedElementId,
3220
+ onShowMatch,
3209
3221
  onUpdateSlides,
3210
3222
  onMarkDirty,
3211
3223
  keyboard
3212
3224
  }) {
3213
3225
  const [findReplaceOpen, setFindReplaceOpen] = React17.useState(false);
3214
- const [findQuery, setFindQuery] = React17.useState("");
3215
- const [replaceQuery, setReplaceQuery] = React17.useState("");
3216
- const [findMatchCase, setFindMatchCase] = React17.useState(false);
3217
- const [findIncludeNotes, setFindIncludeNotes] = React17.useState(false);
3218
- const [findIncludeChartTitles, setFindIncludeChartTitles] = React17.useState(true);
3219
- const [findIncludeChartData, setFindIncludeChartData] = React17.useState(false);
3220
- const [findResults, setFindResults] = React17.useState([]);
3221
- const [findResultIndex, setFindResultIndex] = React17.useState(-1);
3222
- const pendingRefindRef = React17.useRef(false);
3223
- React17.useEffect(() => {
3224
- if (findReplaceOpen) {
3225
- return;
3226
- }
3227
- setFindResults([]);
3228
- setFindResultIndex(-1);
3229
- pendingRefindRef.current = false;
3230
- }, [findReplaceOpen]);
3231
- const performFind = React17.useCallback(() => {
3232
- const results = pptx.findInSlides(slides, findQuery, {
3233
- matchCase: findMatchCase,
3234
- includeNotes: findIncludeNotes,
3235
- includeChartTitles: findIncludeChartTitles,
3236
- includeChartData: findIncludeChartData
3237
- });
3238
- if (!findQuery) {
3239
- setFindResults([]);
3240
- setFindResultIndex(-1);
3241
- return;
3242
- }
3243
- setFindResults(results);
3244
- setFindResultIndex(results.length > 0 ? 0 : -1);
3245
- if (results.length > 0) {
3246
- onSetActiveSlideIndex(results[0].slideIndex);
3247
- onSetSelectedElementId(results[0].elementId);
3248
- }
3249
- }, [
3250
- slides,
3251
- findQuery,
3252
- findMatchCase,
3253
- findIncludeNotes,
3254
- findIncludeChartTitles,
3255
- findIncludeChartData,
3256
- onSetActiveSlideIndex,
3257
- onSetSelectedElementId
3258
- ]);
3259
- const navigateFindResult = React17.useCallback(
3260
- (direction) => {
3261
- if (findResults.length === 0) {
3262
- return;
3263
- }
3264
- const nextIdx = (findResultIndex + direction + findResults.length) % findResults.length;
3265
- setFindResultIndex(nextIdx);
3266
- const match = findResults[nextIdx];
3267
- if (match) {
3268
- onSetActiveSlideIndex(match.slideIndex);
3269
- onSetSelectedElementId(match.elementId);
3270
- }
3271
- },
3272
- [findResults, findResultIndex, onSetActiveSlideIndex, onSetSelectedElementId]
3273
- );
3274
- const applyReplacements = React17.useCallback(
3275
- (toReplace) => {
3276
- if (toReplace.length === 0) {
3277
- return;
3278
- }
3279
- if (toReplace.some((match) => match.readOnly)) {
3280
- return;
3226
+ const [session, setSession] = React17.useState(pptx.INITIAL_FIND_REPLACE_SESSION);
3227
+ const latest = React17.useRef({ slides, onShowMatch, onUpdateSlides, onMarkDirty });
3228
+ latest.current = { slides, onShowMatch, onUpdateSlides, onMarkDirty };
3229
+ const latestSession = React17.useRef(session);
3230
+ const [actions] = React17.useState(
3231
+ () => pptx.findReplaceSessionActions(
3232
+ {
3233
+ get: () => latestSession.current,
3234
+ set: (next) => {
3235
+ latestSession.current = next;
3236
+ setSession(next);
3237
+ }
3238
+ },
3239
+ {
3240
+ slides: () => latest.current.slides,
3241
+ commit: (next) => {
3242
+ latest.current.onUpdateSlides(() => next);
3243
+ latest.current.onMarkDirty();
3244
+ },
3245
+ navigate: ({ slideIndex, elementId }) => latest.current.onShowMatch(slideIndex, elementId)
3281
3246
  }
3282
- onUpdateSlides(
3283
- (prevSlides) => pptx.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
3284
- );
3285
- onMarkDirty();
3286
- },
3287
- [replaceQuery, onUpdateSlides, onMarkDirty]
3247
+ )
3288
3248
  );
3289
- const handleReplace = React17.useCallback(() => {
3290
- if (findResults.length === 0 || findResultIndex < 0) {
3291
- return;
3292
- }
3293
- applyReplacements([findResults[findResultIndex]]);
3294
- pendingRefindRef.current = true;
3295
- }, [findResults, findResultIndex, applyReplacements]);
3296
- const handleReplaceAll = React17.useCallback(() => {
3297
- if (findResults.length === 0) {
3298
- return;
3299
- }
3300
- applyReplacements(findResults);
3301
- pendingRefindRef.current = true;
3302
- }, [findResults, applyReplacements]);
3303
3249
  React17.useEffect(() => {
3304
- if (!pendingRefindRef.current) {
3305
- return;
3250
+ if (!findReplaceOpen) {
3251
+ actions.close();
3306
3252
  }
3307
- pendingRefindRef.current = false;
3308
- performFind();
3309
- }, [performFind]);
3253
+ }, [findReplaceOpen, actions]);
3254
+ React17.useEffect(() => {
3255
+ actions.slidesChanged();
3256
+ }, [slides, actions]);
3257
+ const handlers = React17.useMemo(
3258
+ () => ({
3259
+ setFindQuery: (query) => actions.search({ query }),
3260
+ setReplaceQuery: actions.setReplacement,
3261
+ setFindMatchCase: (matchCase) => actions.search({ options: { matchCase } }),
3262
+ setFindIncludeNotes: (includeNotes) => actions.search({ options: { includeNotes } }),
3263
+ setFindIncludeChartTitles: (includeChartTitles) => actions.search({ options: { includeChartTitles } }),
3264
+ setFindIncludeChartData: (includeChartData) => actions.search({ options: { includeChartData } }),
3265
+ performFind: () => actions.search(),
3266
+ navigateFindResult: (direction) => direction > 0 ? actions.next() : actions.previous(),
3267
+ handleReplace: () => {
3268
+ actions.replaceCurrent();
3269
+ },
3270
+ handleReplaceAll: () => {
3271
+ actions.replaceAll();
3272
+ }
3273
+ }),
3274
+ [actions]
3275
+ );
3310
3276
  React17.useEffect(() => {
3311
3277
  const handler = (event) => {
3312
3278
  const { action } = pptx.mapCustomizedEditorKey(
@@ -3329,24 +3295,15 @@ function useFindReplace({
3329
3295
  return {
3330
3296
  findReplaceOpen,
3331
3297
  setFindReplaceOpen,
3332
- findQuery,
3333
- setFindQuery,
3334
- replaceQuery,
3335
- setReplaceQuery,
3336
- findMatchCase,
3337
- setFindMatchCase,
3338
- findIncludeNotes,
3339
- setFindIncludeNotes,
3340
- findIncludeChartTitles,
3341
- findIncludeChartData,
3342
- setFindIncludeChartTitles,
3343
- setFindIncludeChartData,
3344
- findResults,
3345
- findResultIndex,
3346
- performFind,
3347
- navigateFindResult,
3348
- handleReplace,
3349
- handleReplaceAll
3298
+ findQuery: session.query,
3299
+ replaceQuery: session.replacement,
3300
+ findMatchCase: session.options.matchCase,
3301
+ findIncludeNotes: session.options.includeNotes,
3302
+ findIncludeChartTitles: session.options.includeChartTitles,
3303
+ findIncludeChartData: session.options.includeChartData,
3304
+ findResults: session.matches,
3305
+ findResultIndex: session.current,
3306
+ ...handlers
3350
3307
  };
3351
3308
  }
3352
3309
  function useModalDismissDrag(onClose, threshold = 120) {
@@ -4006,6 +3963,35 @@ function useInlineEditingState(onTextChange) {
4006
3963
  registerInlineEditReader
4007
3964
  };
4008
3965
  }
3966
+ function useSlideChangeSelection({
3967
+ setActiveSlideIndex,
3968
+ setSelectedElementId,
3969
+ setSelectedElementIds
3970
+ }) {
3971
+ const slideSelectionRef = React17.useRef(null);
3972
+ const showSlideSelection = React17.useCallback(
3973
+ (slideIndex, elementId) => {
3974
+ slideSelectionRef.current = slideIndex;
3975
+ setActiveSlideIndex(slideIndex);
3976
+ setSelectedElementId(elementId);
3977
+ setSelectedElementIds([]);
3978
+ },
3979
+ [setActiveSlideIndex, setSelectedElementId, setSelectedElementIds]
3980
+ );
3981
+ return { slideSelectionRef, showSlideSelection };
3982
+ }
3983
+ function useClearSelectionOnSlideChange(state, activeSlideIndex) {
3984
+ React17.useEffect(() => {
3985
+ const kept = state.slideSelectionRef.current === activeSlideIndex;
3986
+ state.slideSelectionRef.current = null;
3987
+ state.setInlineEditingElementId(null);
3988
+ if (kept) {
3989
+ return;
3990
+ }
3991
+ state.setSelectedElementId(null);
3992
+ state.setSelectedElementIds([]);
3993
+ }, [activeSlideIndex]);
3994
+ }
4009
3995
  function useSlideState() {
4010
3996
  const [renderedSlides, setRenderedSlides] = React17.useState([]);
4011
3997
  const slidesRef = React17.useRef(renderedSlides);
@@ -4045,6 +4031,11 @@ function useViewerCoreState(_input) {
4045
4031
  const [activeSlideIndex, setActiveSlideIndex] = React17.useState(0);
4046
4032
  const [selectedElementId, setSelectedElementId] = React17.useState(null);
4047
4033
  const [selectedElementIds, setSelectedElementIds] = React17.useState([]);
4034
+ const slideChangeSelection = useSlideChangeSelection({
4035
+ setActiveSlideIndex,
4036
+ setSelectedElementId,
4037
+ setSelectedElementIds
4038
+ });
4048
4039
  const [isDirty, setIsDirty] = React17.useState(false);
4049
4040
  const autosaveDraftSinkRef = React17.useRef(null);
4050
4041
  const publishInlineText = React17.useCallback(
@@ -4148,6 +4139,7 @@ function useViewerCoreState(_input) {
4148
4139
  setSelectedElementId,
4149
4140
  selectedElementIds,
4150
4141
  setSelectedElementIds,
4142
+ ...slideChangeSelection,
4151
4143
  isDirty,
4152
4144
  setIsDirty,
4153
4145
  editTemplateMode,
@@ -8491,6 +8483,7 @@ function useThemeSwitching(input) {
8491
8483
  // src/viewer/hooks/usePropertyHandlers.ts
8492
8484
  function usePropertyHandlers(input) {
8493
8485
  const {
8486
+ allowExternalImages,
8494
8487
  slides,
8495
8488
  activeSlideIndex,
8496
8489
  canvasSize,
@@ -8563,7 +8556,7 @@ function usePropertyHandlers(input) {
8563
8556
  try {
8564
8557
  const ab = await file.arrayBuffer();
8565
8558
  const h = new pptx$1.PptxHandler();
8566
- const other = await h.load(ab);
8559
+ const other = await h.load(ab, { allowExternalImages: allowExternalImages === true });
8567
8560
  if (!other) {
8568
8561
  return;
8569
8562
  }
@@ -8579,7 +8572,7 @@ function usePropertyHandlers(input) {
8579
8572
  }
8580
8573
  };
8581
8574
  fileInput.click();
8582
- }, [slides, canvasSize.width, canvasSize.height]);
8575
+ }, [slides, canvasSize.width, canvasSize.height, allowExternalImages]);
8583
8576
  const handleAcceptSlide = React17.useCallback(
8584
8577
  (di) => {
8585
8578
  if (!compareResult) {
@@ -9801,8 +9794,7 @@ function useEditorOperations(input) {
9801
9794
  const findReplace = useFindReplace({
9802
9795
  slides,
9803
9796
  mode,
9804
- onSetActiveSlideIndex: state.setActiveSlideIndex,
9805
- onSetSelectedElementId: state.setSelectedElementId,
9797
+ onShowMatch: state.showSlideSelection,
9806
9798
  onUpdateSlides: ops.updateSlides,
9807
9799
  onMarkDirty: history.markDirty,
9808
9800
  keyboard
@@ -10010,6 +10002,7 @@ function useIOHandlers(input) {
10010
10002
  setContent,
10011
10003
  onPropertiesChange,
10012
10004
  onNotesUpdate,
10005
+ allowExternalImages,
10013
10006
  imageExportScale,
10014
10007
  imageResolutionScale
10015
10008
  } = input;
@@ -10077,7 +10070,8 @@ function useIOHandlers(input) {
10077
10070
  ops,
10078
10071
  history,
10079
10072
  onPropertiesChange,
10080
- onNotesUpdate
10073
+ onNotesUpdate,
10074
+ allowExternalImages
10081
10075
  });
10082
10076
  return { exportHandlers, printHandlers, themeHandlers, propertyHandlers };
10083
10077
  }
@@ -10785,6 +10779,7 @@ function useViewerIntegration(input) {
10785
10779
  setContent,
10786
10780
  onPropertiesChange,
10787
10781
  onNotesUpdate,
10782
+ allowExternalImages,
10788
10783
  imageExportScale,
10789
10784
  imageResolutionScale
10790
10785
  });
@@ -12597,7 +12592,7 @@ function useViewerBuildingBlocksCore(input) {
12597
12592
  fitPadding: input.fitPadding,
12598
12593
  maxFitScale: input.maxFitScale
12599
12594
  });
12600
- const { options: viewerOptions } = useViewerOptions();
12595
+ const { options: viewerOptions, optionsStore } = useViewerOptions();
12601
12596
  const { setIsDirty } = state;
12602
12597
  const markDocumentDirty = React17.useCallback(() => {
12603
12598
  setIsDirty(true);
@@ -12687,7 +12682,8 @@ function useViewerBuildingBlocksCore(input) {
12687
12682
  // comment in `PowerPointViewer.tsx`.
12688
12683
  imageExportScale: 2 * pptx.resolveImageResolutionScale(viewerOptions),
12689
12684
  imageResolutionScale: pptx.resolveImageResolutionScale(viewerOptions),
12690
- viewerOptions
12685
+ viewerOptions,
12686
+ optionsStore
12691
12687
  };
12692
12688
  }
12693
12689
  function useCompatibilityToastsState() {
@@ -12818,7 +12814,18 @@ function useViewPreferencesSync(input) {
12818
12814
  // src/viewer/hooks/useViewerBuildingBlocksState.ts
12819
12815
  function useViewerBuildingBlocksState(input) {
12820
12816
  const { core, content, canEdit, filePath, autosaveEnabled, userName, handle, setContent } = input;
12821
- const { initialSlide, googleFonts } = input;
12817
+ const { initialSlide, googleFonts, allowExternalContent } = input;
12818
+ const externalContentLockedRef = React17.useRef(false);
12819
+ const { optionsStore } = core;
12820
+ React17.useLayoutEffect(() => {
12821
+ if (allowExternalContent === void 0 && !externalContentLockedRef.current) {
12822
+ return;
12823
+ }
12824
+ externalContentLockedRef.current = allowExternalContent !== void 0;
12825
+ optionsStore.setConstraints({
12826
+ locked: pptx.lockExternalContentSetting({}, allowExternalContent)
12827
+ });
12828
+ }, [optionsStore, allowExternalContent]);
12822
12829
  const {
12823
12830
  onContentChange,
12824
12831
  onDirtyChange,
@@ -12876,11 +12883,7 @@ function useViewerBuildingBlocksState(input) {
12876
12883
  });
12877
12884
  const readOnlyRec = useReadOnlyRecommendationState(content);
12878
12885
  const compatToastsState = useCompatibilityToastsState();
12879
- React17.useEffect(() => {
12880
- state.setSelectedElementId(null);
12881
- state.setSelectedElementIds([]);
12882
- state.setInlineEditingElementId(null);
12883
- }, [activeSlideIndex]);
12886
+ useClearSelectionOnSlideChange(state, activeSlideIndex);
12884
12887
  const editorOps = useEditorOperations({
12885
12888
  state,
12886
12889
  history,
@@ -12926,7 +12929,7 @@ function useViewerBuildingBlocksState(input) {
12926
12929
  // Trust Center > "Allow external content": same gate `PowerPointViewer`
12927
12930
  // applies, so the headless building-blocks API loads http(s) images
12928
12931
  // under the same default-off, core-side SSRF/privacy guard.
12929
- allowExternalImages: viewerOptions.trust.allowExternalContent,
12932
+ allowExternalImages: pptx.resolveAllowExternalContent(allowExternalContent, viewerOptions),
12930
12933
  setReadOnlyRecommendation: readOnlyRec.setRecommendation,
12931
12934
  setModifyVerifier: readOnlyRec.setModifyVerifier,
12932
12935
  canInsertElement: !readOnlyRec.locked && !viewerOptions.trust.openInProtectedView,
@@ -12988,6 +12991,7 @@ function useViewerBuildingBlocks(input) {
12988
12991
  fileName,
12989
12992
  initialSlide,
12990
12993
  googleFonts,
12994
+ allowExternalContent,
12991
12995
  autosaveEnabled = true,
12992
12996
  userName,
12993
12997
  hiddenActions,
@@ -13077,6 +13081,7 @@ function useViewerBuildingBlocks(input) {
13077
13081
  filePath,
13078
13082
  initialSlide,
13079
13083
  googleFonts,
13084
+ allowExternalContent,
13080
13085
  autosaveEnabled,
13081
13086
  userName,
13082
13087
  handle,
@@ -18763,6 +18768,7 @@ exports.useBroadcastFollower = useBroadcastFollower;
18763
18768
  exports.useCanvasInteractions = useCanvasInteractions;
18764
18769
  exports.useChartFormatContext = useChartFormatContext;
18765
18770
  exports.useChartPartSelection = useChartPartSelection;
18771
+ exports.useClearSelectionOnSlideChange = useClearSelectionOnSlideChange;
18766
18772
  exports.useClipboardHandlers = useClipboardHandlers;
18767
18773
  exports.useCollaboration = useCollaboration;
18768
18774
  exports.useCollaborationDocumentSync = useCollaborationDocumentSync;
Binary file
Binary file
package/dist/index.d.ts CHANGED
@@ -537,6 +537,16 @@ interface PowerPointViewerProps extends ViewportFitOptions {
537
537
  /** Initial inspector visibility; omitted preserves the desktop/mobile default. */
538
538
  inspectorInitiallyOpen?: boolean;
539
539
  customization?: ViewerCustomization;
540
+ /**
541
+ * Host switch for content a deck links from another server (http(s)
542
+ * relationship targets): pictures, picture fills and bullets, video, audio
543
+ * and poster frames. `false`: none of it is fetched. `true`: it is allowed.
544
+ * Either value locks File > Options > Trust Center > "Allow external
545
+ * content" to match; unset keeps the user's choice there. Google Fonts
546
+ * requests are separate (see `googleFonts`).
547
+ * A change applies from the next load.
548
+ */
549
+ allowExternalContent?: boolean;
540
550
  }
541
551
  interface PowerPointViewerHandle extends FileViewerHandle, PowerPointViewerAPI, ViewerCustomizationApi {
542
552
  getContent: () => Promise<Uint8Array>;
@@ -983,7 +993,7 @@ interface SlideCanvasProps {
983
993
  /** Called when a table row is resized. */
984
994
  onResizeTableRow?: (elementId: string, rowIndex: number, newHeight: number) => void;
985
995
  /** Find & Replace results (all matches across all slides). */
986
- findResults?: Array<{
996
+ findResults?: ReadonlyArray<{
987
997
  slideIndex: number;
988
998
  elementId: string;
989
999
  segmentIndex: number;
@@ -1076,6 +1086,12 @@ interface UseViewerBuildingBlocksInput extends ViewportFitOptions {
1076
1086
  initialSlide?: number;
1077
1087
  /** As `PowerPointViewer`'s `googleFonts`: the Google Fonts fallback policy (off, or a self-hosted mirror). */
1078
1088
  googleFonts?: GoogleFontsOption;
1089
+ /**
1090
+ * As `PowerPointViewer`'s `allowExternalContent`: `false` fetches no linked
1091
+ * http(s) content, `true` allows it, either value locks the Trust Center
1092
+ * setting; unset keeps the user's choice. A change applies from the next load.
1093
+ */
1094
+ allowExternalContent?: boolean;
1079
1095
  /** Whether the built-in autosave-to-localStorage recovery timer is active. Defaults to true. */
1080
1096
  autosaveEnabled?: boolean;
1081
1097
  /** Display name used as the author for comments. */
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkI63IFSNX_js = require('./chunk-I63IFSNX.js');
4
- var chunk6GAWXARM_js = require('./chunk-6GAWXARM.js');
3
+ var chunk7M7MQGRK_js = require('./chunk-7M7MQGRK.js');
4
+ var chunkL3I2DEBI_js = require('./chunk-L3I2DEBI.js');
5
5
  var chunk3TN5SUQR_js = require('./chunk-3TN5SUQR.js');
6
6
  require('./chunk-PIRHQTI4.js');
7
7
  var pptx = require('ooxml-ui/pptx');
@@ -11,87 +11,87 @@ var i18n = require('ooxml-ui/pptx/i18n');
11
11
 
12
12
  Object.defineProperty(exports, "PowerPointViewer", {
13
13
  enumerable: true,
14
- get: function () { return chunkI63IFSNX_js.PowerPointViewer; }
14
+ get: function () { return chunk7M7MQGRK_js.PowerPointViewer; }
15
15
  });
16
16
  Object.defineProperty(exports, "PptxI18nProvider", {
17
17
  enumerable: true,
18
- get: function () { return chunkI63IFSNX_js.PptxI18nProvider; }
18
+ get: function () { return chunk7M7MQGRK_js.PptxI18nProvider; }
19
19
  });
20
20
  Object.defineProperty(exports, "SlideCanvas", {
21
21
  enumerable: true,
22
- get: function () { return chunkI63IFSNX_js.SlideCanvas; }
22
+ get: function () { return chunk7M7MQGRK_js.SlideCanvas; }
23
23
  });
24
24
  Object.defineProperty(exports, "SlideTemplateGalleryDialog", {
25
25
  enumerable: true,
26
- get: function () { return chunkI63IFSNX_js.SlideTemplateGalleryDialog; }
26
+ get: function () { return chunk7M7MQGRK_js.SlideTemplateGalleryDialog; }
27
27
  });
28
28
  Object.defineProperty(exports, "SlideTemplatePreview", {
29
29
  enumerable: true,
30
- get: function () { return chunkI63IFSNX_js.SlideTemplatePreview; }
30
+ get: function () { return chunk7M7MQGRK_js.SlideTemplatePreview; }
31
31
  });
32
32
  Object.defineProperty(exports, "THEME_CATALOG", {
33
33
  enumerable: true,
34
- get: function () { return chunkI63IFSNX_js.THEME_CATALOG; }
34
+ get: function () { return chunk7M7MQGRK_js.THEME_CATALOG; }
35
35
  });
36
36
  Object.defineProperty(exports, "Toolbar", {
37
37
  enumerable: true,
38
- get: function () { return chunkI63IFSNX_js.Toolbar; }
38
+ get: function () { return chunk7M7MQGRK_js.Toolbar; }
39
39
  });
40
40
  Object.defineProperty(exports, "ViewerThemeProvider", {
41
41
  enumerable: true,
42
- get: function () { return chunkI63IFSNX_js.ViewerThemeProvider; }
42
+ get: function () { return chunk7M7MQGRK_js.ViewerThemeProvider; }
43
43
  });
44
44
  Object.defineProperty(exports, "defaultCssVars", {
45
45
  enumerable: true,
46
- get: function () { return chunkI63IFSNX_js.defaultCssVars; }
46
+ get: function () { return chunk7M7MQGRK_js.defaultCssVars; }
47
47
  });
48
48
  Object.defineProperty(exports, "defaultRadius", {
49
49
  enumerable: true,
50
- get: function () { return chunkI63IFSNX_js.defaultRadius; }
50
+ get: function () { return chunk7M7MQGRK_js.defaultRadius; }
51
51
  });
52
52
  Object.defineProperty(exports, "defaultThemeColors", {
53
53
  enumerable: true,
54
- get: function () { return chunkI63IFSNX_js.defaultThemeColors; }
54
+ get: function () { return chunk7M7MQGRK_js.defaultThemeColors; }
55
55
  });
56
56
  Object.defineProperty(exports, "resolveThemeCatalogEntry", {
57
57
  enumerable: true,
58
- get: function () { return chunkI63IFSNX_js.resolveThemeCatalogEntry; }
58
+ get: function () { return chunk7M7MQGRK_js.resolveThemeCatalogEntry; }
59
59
  });
60
60
  Object.defineProperty(exports, "themeToCssVars", {
61
61
  enumerable: true,
62
- get: function () { return chunkI63IFSNX_js.themeToCssVars; }
62
+ get: function () { return chunk7M7MQGRK_js.themeToCssVars; }
63
63
  });
64
64
  Object.defineProperty(exports, "useViewerTheme", {
65
65
  enumerable: true,
66
- get: function () { return chunkI63IFSNX_js.useViewerTheme; }
66
+ get: function () { return chunk7M7MQGRK_js.useViewerTheme; }
67
67
  });
68
68
  Object.defineProperty(exports, "vermilionDarkColors", {
69
69
  enumerable: true,
70
- get: function () { return chunkI63IFSNX_js.vermilionDarkColors; }
70
+ get: function () { return chunk7M7MQGRK_js.vermilionDarkColors; }
71
71
  });
72
72
  Object.defineProperty(exports, "vermilionDarkTheme", {
73
73
  enumerable: true,
74
- get: function () { return chunkI63IFSNX_js.vermilionDarkTheme; }
74
+ get: function () { return chunk7M7MQGRK_js.vermilionDarkTheme; }
75
75
  });
76
76
  Object.defineProperty(exports, "vermilionLightColors", {
77
77
  enumerable: true,
78
- get: function () { return chunkI63IFSNX_js.vermilionLightColors; }
78
+ get: function () { return chunk7M7MQGRK_js.vermilionLightColors; }
79
79
  });
80
80
  Object.defineProperty(exports, "vermilionLightTheme", {
81
81
  enumerable: true,
82
- get: function () { return chunkI63IFSNX_js.vermilionLightTheme; }
82
+ get: function () { return chunk7M7MQGRK_js.vermilionLightTheme; }
83
83
  });
84
84
  Object.defineProperty(exports, "vermilionRadius", {
85
85
  enumerable: true,
86
- get: function () { return chunkI63IFSNX_js.vermilionRadius; }
86
+ get: function () { return chunk7M7MQGRK_js.vermilionRadius; }
87
87
  });
88
88
  Object.defineProperty(exports, "renderToCanvas", {
89
89
  enumerable: true,
90
- get: function () { return chunk6GAWXARM_js.renderToCanvas; }
90
+ get: function () { return chunkL3I2DEBI_js.renderToCanvas; }
91
91
  });
92
92
  Object.defineProperty(exports, "useViewerBuildingBlocks", {
93
93
  enumerable: true,
94
- get: function () { return chunk6GAWXARM_js.useViewerBuildingBlocks; }
94
+ get: function () { return chunkL3I2DEBI_js.useViewerBuildingBlocks; }
95
95
  });
96
96
  Object.defineProperty(exports, "getAnimationInitialStyle", {
97
97
  enumerable: true,
package/dist/index.js.br CHANGED
Binary file
package/dist/index.js.gz CHANGED
Binary file
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- export { PowerPointViewer, PptxI18nProvider, SlideCanvas, SlideTemplateGalleryDialog, SlideTemplatePreview, THEME_CATALOG, Toolbar, ViewerThemeProvider, defaultCssVars, defaultRadius, defaultThemeColors, resolveThemeCatalogEntry, themeToCssVars, useViewerTheme, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius } from './chunk-E6A6ZBAM.mjs';
2
- export { renderToCanvas, useViewerBuildingBlocks } from './chunk-3KXEJCMG.mjs';
1
+ export { PowerPointViewer, PptxI18nProvider, SlideCanvas, SlideTemplateGalleryDialog, SlideTemplatePreview, THEME_CATALOG, Toolbar, ViewerThemeProvider, defaultCssVars, defaultRadius, defaultThemeColors, resolveThemeCatalogEntry, themeToCssVars, useViewerTheme, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius } from './chunk-BFVUPYIH.mjs';
2
+ export { renderToCanvas, useViewerBuildingBlocks } from './chunk-3WAEUEID.mjs';
3
3
  export { getAnimationInitialStyle } from './chunk-ID37Y3HG.mjs';
4
4
  import './chunk-UV2HVMKZ.mjs';
5
5
  export { AVATAR_COLOR_SWATCHES, BACKSTAGE_CARD_IDS, BACKSTAGE_PAGE_IDS, CANVAS_CONTEXT_MENU_COMMAND_IDS, DEFAULT_VIEWER_PROFILE, EDITOR_SHORTCUT_ACTION_IDS, ELEMENT_CONTEXT_MENU_COMMAND_IDS, OPTIONS_PAGE_IDS, OPTIONS_SECTION_IDS, OPTIONS_SETTING_IDS, PPTX_OPEN_ACCEPT, PRESENTATION_OPEN_EXTENSIONS, RIBBON_TAB_IDS, SLIDE_TEMPLATES, TOOLBAR_BUTTON_IDS, VIEWER_DIALOG_IDS, VIEWER_EXPORT_FORMAT_IDS, VIEWER_FEATURE_IDS, VIEWER_PANEL_IDS, VIEWER_PREFS_STORAGE_KEY, buildSlideTemplateContent, buildSlideTemplateSlide, clearAllLocalViewerData, clearStoredViewerPrefs, createImageElementFromFile, describeCollaborationShellState, getLocalStorageUsageSummary, isLegacyBinaryPresentation, isSupportedPresentationFile, presentationBaseName, readStoredViewerPrefs, resolveProfileInitial, saveViewerProfile, savedPresentationFileName, writeStoredViewerPrefs } from 'ooxml-ui/pptx';
package/dist/index.mjs.br CHANGED
Binary file
package/dist/index.mjs.gz CHANGED
Binary file