ooxml-ui 1.27.1 → 1.28.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 (24) hide show
  1. package/dist/chart/format-pane-3d.d.ts +0 -1
  2. package/dist/chart/format-pane-types.d.ts +1 -0
  3. package/dist/chart/format-pane-view.d.ts +1 -0
  4. package/dist/pptx/{chunk-TMCN2OVN.cjs → chunk-3AFB46RL.cjs} +41 -41
  5. package/dist/pptx/{chunk-OD6REJDV.mjs → chunk-7OD74VJC.mjs} +1 -1
  6. package/dist/pptx/{chunk-XZX7EHX4.mjs → chunk-CT7UD6VL.mjs} +102 -9
  7. package/dist/pptx/{chunk-VMDMICQC.cjs → chunk-WBFAVFD4.cjs} +106 -8
  8. package/dist/pptx/dom/index.cjs +381 -381
  9. package/dist/pptx/dom/index.mjs +4 -4
  10. package/dist/pptx/index.cjs +3022 -3002
  11. package/dist/pptx/index.mjs +1 -1
  12. package/dist/pptx/render/customization/customization-controller.d.ts +8 -0
  13. package/dist/pptx/render/customization/customization-controller.d.ts.map +1 -1
  14. package/dist/pptx/render/options/external-content-policy.d.ts +31 -0
  15. package/dist/pptx/render/options/external-content-policy.d.ts.map +1 -0
  16. package/dist/pptx/render/options/index.d.ts +1 -0
  17. package/dist/pptx/render/options/index.d.ts.map +1 -1
  18. package/dist/pptx/render/options/viewer-options-constraints.d.ts +15 -1
  19. package/dist/pptx/render/options/viewer-options-constraints.d.ts.map +1 -1
  20. package/dist/pptx/render/options/viewer-options-store.d.ts.map +1 -1
  21. package/dist/pptx/render/viewer-props-manifest.d.ts.map +1 -1
  22. package/dist/pptx/{smartart-insert-preview-MCDHVWHZ.cjs → smartart-insert-preview-3BY6HNZL.cjs} +3 -3
  23. package/dist/pptx/{smartart-insert-preview-QQH5ZBSF.mjs → smartart-insert-preview-7CRBDPYF.mjs} +2 -2
  24. package/package.json +2 -2
@@ -56777,6 +56777,18 @@ function applyAutoCorrect(text4, proofing) {
56777
56777
  }
56778
56778
  return result;
56779
56779
  }
56780
+
56781
+ // src/pptx/render/options/external-content-policy.ts
56782
+ var EXTERNAL_CONTENT_SETTING_ID = "trust.allowExternalContent";
56783
+ function resolveAllowExternalContent(host2, options) {
56784
+ return typeof host2 === "boolean" ? host2 : options.trust.allowExternalContent;
56785
+ }
56786
+ function lockExternalContentSetting(locked, host2) {
56787
+ if (typeof host2 !== "boolean") {
56788
+ return locked;
56789
+ }
56790
+ return { ...locked, [EXTERNAL_CONTENT_SETTING_ID]: host2 };
56791
+ }
56780
56792
  var HOST_REGION_ATTRIBUTE = "data-office-region";
56781
56793
  var HostRegionHost = class {
56782
56794
  #container;
@@ -59178,6 +59190,42 @@ function rebaseOptions(options, previousBaseline, nextBaseline, userSaved) {
59178
59190
  }
59179
59191
  return next;
59180
59192
  }
59193
+ function storedValueOf(stored, group, key) {
59194
+ const record = stored?.[group];
59195
+ if (!record || typeof record !== "object" || !Object.hasOwn(record, key)) {
59196
+ return void 0;
59197
+ }
59198
+ const value = record[key];
59199
+ const fallback = DEFAULT_VIEWER_OPTIONS[group][key];
59200
+ return typeof value === typeof fallback ? value : void 0;
59201
+ }
59202
+ function keepStoredLockedValues(diff, stored, locked) {
59203
+ for (const [id] of entriesOf(locked)) {
59204
+ const parsed = parseOptionsSettingId(id);
59205
+ const value = parsed ? storedValueOf(stored, parsed.group, parsed.key) : void 0;
59206
+ if (parsed && value !== void 0) {
59207
+ (diff[parsed.group] ??= {})[parsed.key] = value;
59208
+ }
59209
+ }
59210
+ return diff;
59211
+ }
59212
+ function restoreUnlockedOptions(options, previousLocked, nextLocked, ownValues, stored, previousBaseline) {
59213
+ const lifted = entriesOf(previousLocked).filter(([id]) => !Object.hasOwn(nextLocked ?? {}, id));
59214
+ if (lifted.length === 0) {
59215
+ return options;
59216
+ }
59217
+ const next = cloneOptions(options);
59218
+ for (const [id] of lifted) {
59219
+ const parsed = parseOptionsSettingId(id);
59220
+ if (!parsed) {
59221
+ continue;
59222
+ }
59223
+ const target = next[parsed.group];
59224
+ const base2 = previousBaseline[parsed.group];
59225
+ target[parsed.key] = storedValueOf(stored, parsed.group, parsed.key) ?? ownValues.get(id) ?? base2[parsed.key];
59226
+ }
59227
+ return next;
59228
+ }
59181
59229
 
59182
59230
  // src/pptx/render/options/viewer-options-store.ts
59183
59231
  function createViewerOptionsStore(init) {
@@ -59189,11 +59237,16 @@ function createViewerOptionsStore(init) {
59189
59237
  const options = () => store.getState();
59190
59238
  let constraints = {};
59191
59239
  let baseline = buildOptionsBaseline(void 0);
59240
+ const ownValues = /* @__PURE__ */ new Map();
59192
59241
  function commit(raw) {
59193
59242
  const next = applyLockedOptions(raw, constraints.locked);
59194
59243
  if (persist) {
59195
59244
  writeStoredViewerPrefs({
59196
- options: diffOptionsAgainstBaseline(next, baseline, constraints.locked)
59245
+ options: keepStoredLockedValues(
59246
+ diffOptionsAgainstBaseline(next, baseline, constraints.locked),
59247
+ readStoredViewerPrefs().options,
59248
+ constraints.locked
59249
+ )
59197
59250
  });
59198
59251
  }
59199
59252
  store.setState(next);
@@ -59248,9 +59301,32 @@ function createViewerOptionsStore(init) {
59248
59301
  batch: (write) => store.batch(write),
59249
59302
  setConstraints: (next) => {
59250
59303
  const previousBaseline = baseline;
59304
+ const previousLocked = constraints.locked;
59305
+ for (const id of Object.keys(next.locked ?? {})) {
59306
+ const parsed = parseOptionsSettingId(id);
59307
+ if (parsed && !isOptionLocked(previousLocked, parsed.group, parsed.key)) {
59308
+ const value = options()[parsed.group][parsed.key];
59309
+ if (typeof value === "boolean" || typeof value === "number" || typeof value === "string") {
59310
+ ownValues.set(id, value);
59311
+ }
59312
+ }
59313
+ }
59251
59314
  constraints = { locked: { ...next.locked }, defaults: { ...next.defaults } };
59252
59315
  baseline = buildOptionsBaseline(constraints.defaults);
59253
- commit(rebaseOptions(options(), previousBaseline, baseline, userSaved));
59316
+ const restored = restoreUnlockedOptions(
59317
+ options(),
59318
+ previousLocked,
59319
+ constraints.locked,
59320
+ ownValues,
59321
+ persist ? readStoredViewerPrefs().options : void 0,
59322
+ previousBaseline
59323
+ );
59324
+ for (const id of Object.keys(previousLocked ?? {})) {
59325
+ if (!Object.hasOwn(constraints.locked ?? {}, id)) {
59326
+ ownValues.delete(id);
59327
+ }
59328
+ }
59329
+ commit(rebaseOptions(restored, previousBaseline, baseline, userSaved));
59254
59330
  },
59255
59331
  isLocked: (group, key) => isOptionLocked(constraints.locked, group, key)
59256
59332
  };
@@ -59313,13 +59389,24 @@ function withRecordEntry(record, key, value) {
59313
59389
  }
59314
59390
 
59315
59391
  // src/pptx/render/customization/customization-controller.ts
59316
- function stateOf(customization) {
59317
- return { customization, resolved: resolveCustomization(customization) };
59392
+ function stateOf(customization, allowExternalContent) {
59393
+ const resolved2 = resolveCustomization(customization);
59394
+ return {
59395
+ customization,
59396
+ allowExternalContent,
59397
+ resolved: allowExternalContent === void 0 ? resolved2 : {
59398
+ ...resolved2,
59399
+ lockedSettings: lockExternalContentSetting(
59400
+ resolved2.lockedSettings,
59401
+ allowExternalContent
59402
+ )
59403
+ }
59404
+ };
59318
59405
  }
59319
59406
  function createCustomizationController(initial) {
59320
- const store = createViewerStore(stateOf({ ...initial }));
59407
+ const store = createViewerStore(stateOf({ ...initial }, void 0));
59321
59408
  const current = () => store.getState().customization;
59322
- const set = (next) => store.setState(stateOf(next));
59409
+ const set = (next) => store.setState(stateOf(next, store.getState().allowExternalContent));
59323
59410
  const update = (patch) => set(mergeCustomization(current(), patch));
59324
59411
  const ribbon = (edit) => {
59325
59412
  const next = { ...current().ribbon };
@@ -59404,7 +59491,13 @@ function createCustomizationController(initial) {
59404
59491
  return {
59405
59492
  api,
59406
59493
  getResolved: () => store.getState().resolved,
59407
- subscribe: (listener) => store.subscribe(listener)
59494
+ subscribe: (listener) => store.subscribe(listener),
59495
+ setAllowExternalContent: (allow) => {
59496
+ const next = typeof allow === "boolean" ? allow : void 0;
59497
+ if (next !== store.getState().allowExternalContent) {
59498
+ store.setState(stateOf(current(), next));
59499
+ }
59500
+ }
59408
59501
  };
59409
59502
  }
59410
59503
 
@@ -82461,7 +82554,7 @@ function definePptxInsertSmartArtDialog(registry2) {
82461
82554
  if (this.#live || this.#draw) {
82462
82555
  return;
82463
82556
  }
82464
- this.#live = import('./smartart-insert-preview-MCDHVWHZ.cjs').then((module) => {
82557
+ this.#live = import('./smartart-insert-preview-3BY6HNZL.cjs').then((module) => {
82465
82558
  if (this.#draw || !this.#picker) {
82466
82559
  return;
82467
82560
  }
@@ -91439,6 +91532,7 @@ exports.EXPANDED_MAX_HEIGHT = EXPANDED_MAX_HEIGHT;
91439
91532
  exports.EXPLOSION_SUPPORTED_TYPES = EXPLOSION_SUPPORTED_TYPES;
91440
91533
  exports.EXPORT_ASSEMBLING_PERCENT = EXPORT_ASSEMBLING_PERCENT;
91441
91534
  exports.EXPORT_DONE_PERCENT = EXPORT_DONE_PERCENT;
91535
+ exports.EXTERNAL_CONTENT_SETTING_ID = EXTERNAL_CONTENT_SETTING_ID;
91442
91536
  exports.EditGeometryPen = EditGeometryPen;
91443
91537
  exports.EditPointsSession = EditPointsSession;
91444
91538
  exports.FEATURE_ENTRY_POINTS = FEATURE_ENTRY_POINTS;
@@ -93014,6 +93108,7 @@ exports.isVerticalTextDirection = isVerticalTextDirection;
93014
93108
  exports.isWedgeCalloutPresetShape = isWedgeCalloutPresetShape;
93015
93109
  exports.issueTrackKey = issueTrackKey;
93016
93110
  exports.issueTypeLabel = issueTypeLabel;
93111
+ exports.keepStoredLockedValues = keepStoredLockedValues;
93017
93112
  exports.lastShowSlideIndex = lastShowSlideIndex;
93018
93113
  exports.latexToMathMl = latexToMathMl;
93019
93114
  exports.layoutEnvelopeBlock = layoutEnvelopeBlock;
@@ -93032,6 +93127,7 @@ exports.loadAudienceContent = loadAudienceContent;
93032
93127
  exports.loadPresentationDeck = loadPresentationDeck;
93033
93128
  exports.loadSessionDeck = loadSessionDeck;
93034
93129
  exports.loadedThemeName = loadedThemeName;
93130
+ exports.lockExternalContentSetting = lockExternalContentSetting;
93035
93131
  exports.lockResizeAspect = lockResizeAspect;
93036
93132
  exports.makeCloneId = makeCloneId;
93037
93133
  exports.mapAwarenessCursors = mapAwarenessCursors;
@@ -93399,6 +93495,7 @@ exports.resolveAccentHex = resolveAccentHex;
93399
93495
  exports.resolveActionType = resolveActionType;
93400
93496
  exports.resolveActiveRibbonAddIn = resolveActiveRibbonAddIn;
93401
93497
  exports.resolveActiveRibbonTab = resolveActiveRibbonTab;
93498
+ exports.resolveAllowExternalContent = resolveAllowExternalContent;
93402
93499
  exports.resolveAnimationCss = resolveAnimationCss;
93403
93500
  exports.resolveAnimationEnd = resolveAnimationEnd;
93404
93501
  exports.resolveAnimationStart = resolveAnimationStart;
@@ -93568,6 +93665,7 @@ exports.restoreInlineListBodySelection = restoreInlineListBodySelection;
93568
93665
  exports.restoreParagraphMetadata = restoreParagraphMetadata;
93569
93666
  exports.restoreSegmentSelection = restoreSegmentSelection;
93570
93667
  exports.restoreSessionDeck = restoreSessionDeck;
93668
+ exports.restoreUnlockedOptions = restoreUnlockedOptions;
93571
93669
  exports.resumeAllPersistentAudio = resumeAllPersistentAudio;
93572
93670
  exports.revealComment = revealComment;
93573
93671
  exports.revealedElementStyles = revealedElementStyles;