pptx-vue-viewer 4.45.0 → 4.47.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 (65) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +2 -2
  3. package/dist/{AiChatPanel-Xiq2AsYX.cjs → AiChatPanel-DijLC9jc.cjs} +1 -1
  4. package/dist/AiChatPanel-DijLC9jc.cjs.br +0 -0
  5. package/dist/AiChatPanel-DijLC9jc.cjs.gz +0 -0
  6. package/dist/{AiChatPanel-BVnemARt.js → AiChatPanel-Jcgn-oeY.js} +2 -2
  7. package/dist/AiChatPanel-Jcgn-oeY.js.br +0 -0
  8. package/dist/AiChatPanel-Jcgn-oeY.js.gz +0 -0
  9. package/dist/index.cjs +1 -1
  10. package/dist/index.cjs.br +0 -0
  11. package/dist/index.cjs.gz +0 -0
  12. package/dist/index.d.ts +57 -0
  13. package/dist/index.js +2 -2
  14. package/dist/index.js.br +0 -0
  15. package/dist/index.js.gz +0 -0
  16. package/dist/internals.cjs +1 -1
  17. package/dist/internals.cjs.br +0 -0
  18. package/dist/internals.cjs.gz +0 -0
  19. package/dist/internals.d.ts +23 -1
  20. package/dist/internals.js +1 -1
  21. package/dist/internals.js.br +0 -0
  22. package/dist/internals.js.gz +0 -0
  23. package/dist/pptx-vue-viewer.css +5 -5
  24. package/dist/pptx-vue-viewer.css.br +0 -0
  25. package/dist/pptx-vue-viewer.css.gz +0 -0
  26. package/dist/{useViewerSettingsDialog-DPG5VDMB.js → useViewerSettingsDialog-CXbWkqSq.js} +2485 -2459
  27. package/dist/useViewerSettingsDialog-CXbWkqSq.js.br +0 -0
  28. package/dist/useViewerSettingsDialog-CXbWkqSq.js.gz +0 -0
  29. package/dist/{useViewerSettingsDialog-D6InSTG6.cjs → useViewerSettingsDialog-jAbWHh3J.cjs} +116 -90
  30. package/dist/useViewerSettingsDialog-jAbWHh3J.cjs.br +0 -0
  31. package/dist/{useViewerSettingsDialog-D6InSTG6.cjs.gz → useViewerSettingsDialog-jAbWHh3J.cjs.gz} +0 -0
  32. package/dist/viewer/index.cjs +1 -1
  33. package/dist/viewer/index.cjs.br +0 -0
  34. package/dist/viewer/index.cjs.gz +0 -0
  35. package/dist/viewer/index.d.ts +61 -0
  36. package/dist/viewer/index.js +2 -2
  37. package/dist/viewer/index.js.br +0 -0
  38. package/dist/viewer/index.js.gz +0 -0
  39. package/dist/{viewer-v6sw9LNJ.cjs → viewer-7Z6aaf6w.cjs} +3462 -3407
  40. package/dist/viewer-7Z6aaf6w.cjs.br +0 -0
  41. package/dist/viewer-7Z6aaf6w.cjs.gz +0 -0
  42. package/dist/{viewer-CWgTBLKM.js → viewer-DIlCsUp0.js} +6792 -6737
  43. package/dist/viewer-DIlCsUp0.js.br +0 -0
  44. package/dist/viewer-DIlCsUp0.js.gz +0 -0
  45. package/dist/{y-webrtc-Cb8v01f2.cjs → y-webrtc-B7OSkf8u.cjs} +1 -1
  46. package/dist/y-webrtc-B7OSkf8u.cjs.br +0 -0
  47. package/dist/y-webrtc-B7OSkf8u.cjs.gz +0 -0
  48. package/dist/{y-webrtc-DDtmS1y0.js → y-webrtc-BHTCM7ok.js} +1 -1
  49. package/dist/y-webrtc-BHTCM7ok.js.br +0 -0
  50. package/dist/{y-webrtc-DDtmS1y0.js.gz → y-webrtc-BHTCM7ok.js.gz} +0 -0
  51. package/package.json +3 -3
  52. package/dist/AiChatPanel-BVnemARt.js.br +0 -0
  53. package/dist/AiChatPanel-BVnemARt.js.gz +0 -0
  54. package/dist/AiChatPanel-Xiq2AsYX.cjs.br +0 -0
  55. package/dist/AiChatPanel-Xiq2AsYX.cjs.gz +0 -0
  56. package/dist/useViewerSettingsDialog-D6InSTG6.cjs.br +0 -0
  57. package/dist/useViewerSettingsDialog-DPG5VDMB.js.br +0 -0
  58. package/dist/useViewerSettingsDialog-DPG5VDMB.js.gz +0 -0
  59. package/dist/viewer-CWgTBLKM.js.br +0 -0
  60. package/dist/viewer-CWgTBLKM.js.gz +0 -0
  61. package/dist/viewer-v6sw9LNJ.cjs.br +0 -0
  62. package/dist/viewer-v6sw9LNJ.cjs.gz +0 -0
  63. package/dist/y-webrtc-Cb8v01f2.cjs.br +0 -0
  64. package/dist/y-webrtc-Cb8v01f2.cjs.gz +0 -0
  65. package/dist/y-webrtc-DDtmS1y0.js.br +0 -0
@@ -6887,6 +6887,7 @@ var zc = [
6887
6887
  ref_key: "stageRef",
6888
6888
  ref: o,
6889
6889
  class: "pptx-vue-stage",
6890
+ "data-pptx-scope": "",
6890
6891
  style: (0, d.normalizeStyle)(c.value),
6891
6892
  role: e.presenting ? "region" : void 0,
6892
6893
  "aria-roledescription": e.presenting ? "slide" : void 0,
@@ -8258,99 +8259,103 @@ function ed(e) {
8258
8259
  };
8259
8260
  }
8260
8261
  function td(e, t) {
8261
- const n = (0, d.ref)(!1), o = (0, d.ref)(!1), l = (0, u.createCollaborationLivePatcher)();
8262
- let a = null, r = null, i = null, s = !1, c = "", p = null, m = null;
8263
- const v = (0, u.createWriteBackScheduler)({
8264
- getYDoc: () => a,
8262
+ const n = (0, d.ref)(!1), o = (0, d.ref)(!1), l = (0, d.ref)(void 0), a = (0, u.createCollaborationLivePatcher)();
8263
+ let r = null, i = null, s = null, c = !1, p = "", m = null, v = null;
8264
+ const f = (0, u.createWriteBackScheduler)({
8265
+ getYDoc: () => r,
8265
8266
  serialize: e.serialize,
8266
8267
  getSourceBytes: e.getSourceBytes,
8267
8268
  getTemplateElements: e.getTemplateElements,
8268
8269
  mergeTemplateElements: u.buildSaveSlides,
8269
- getSaveOptions: e.getSaveOptions
8270
- }), f = (0, u.createSyncGate)(() => {
8271
- o.value = !0, h();
8272
- }), g = {
8273
- ...f,
8270
+ getSaveOptions: e.getSaveOptions,
8271
+ onWriteBackStatus: () => {
8272
+ l.value = f.getState();
8273
+ }
8274
+ }), g = (0, u.createSyncGate)(() => {
8275
+ o.value = !0, y();
8276
+ }), h = {
8277
+ ...g,
8274
8278
  reset: () => {
8275
- f.reset(), o.value = !1;
8279
+ g.reset(), o.value = !1;
8276
8280
  }
8277
8281
  };
8278
- function h() {
8279
- if (!a || !r || !i || s || !g.isOpen()) return;
8282
+ function y() {
8283
+ if (!r || !i || !s || c || !h.isOpen()) return;
8280
8284
  if (e.slidesPaused?.()) return;
8281
- if ("viewer" === i.role || i.externalSession && !i.externalSession.getSnapshot().synced) return;
8285
+ if ("viewer" === s.role || s.externalSession && !s.externalSession.getSnapshot().synced) return;
8282
8286
  const t = JSON.stringify(e.slides.value);
8283
- t !== c && (c = t, (0, u.reconcileSlidesInYDoc)(e.slides.value, a, r), v.schedule(i));
8287
+ t !== p && (p = t, (0, u.reconcileSlidesInYDoc)(e.slides.value, r, i), f.schedule(s));
8284
8288
  }
8285
- function y(t) {
8286
- c = JSON.stringify(t), s = !0;
8289
+ function k(t) {
8290
+ p = JSON.stringify(t), c = !0;
8287
8291
  try {
8288
8292
  e.onRemoteSlides(t);
8289
8293
  } finally {
8290
- s = !1;
8294
+ c = !1;
8291
8295
  }
8292
8296
  }
8293
- const k = (0, d.watch)(e.slides, h, { deep: !1 }), x = e.loadVersion ? (b = {
8297
+ const x = (0, d.watch)(e.slides, y, { deep: !1 }), b = e.loadVersion ? (S = {
8294
8298
  loadVersion: e.loadVersion,
8295
- getYDoc: () => a,
8296
- isConnected: () => !i?.externalSession && "connected" === t.value,
8299
+ getYDoc: () => r,
8300
+ isConnected: () => !s?.externalSession && "connected" === t.value,
8297
8301
  getLoadOrigin: e.getLoadOrigin,
8298
- adoptDocSlides: y
8299
- }, (0, d.watch)(b.loadVersion, () => {
8300
- const e = b.getYDoc();
8301
- if (!e || !b.isConnected()) return;
8302
+ adoptDocSlides: k
8303
+ }, (0, d.watch)(S.loadVersion, () => {
8304
+ const e = S.getYDoc();
8305
+ if (!e || !S.isConnected()) return;
8302
8306
  const t = (0, u.readSlidesFromYDoc)(e);
8303
- (0, u.shouldRoomSlidesReplaceLoad)(b.getLoadOrigin?.(), t.length) && b.adoptDocSlides(t);
8307
+ (0, u.shouldRoomSlidesReplaceLoad)(S.getLoadOrigin?.(), t.length) && S.adoptDocSlides(t);
8304
8308
  }, { flush: "sync" })) : null;
8305
- var b;
8306
- const S = e.loadVersion ? (0, d.watch)(e.loadVersion, () => {
8307
- p?.handleLoad(e.getLoadOrigin?.() ?? "user");
8309
+ var S;
8310
+ const w = e.loadVersion ? (0, d.watch)(e.loadVersion, () => {
8311
+ m?.handleLoad(e.getLoadOrigin?.() ?? "user");
8308
8312
  }, { flush: "sync" }) : null;
8309
- function w() {
8310
- p?.(), p = null, m?.(), m = null, g.reset(), v.cancel(), l.configure(null, null), a = null, r = null, i = null, s = !1, c = "", n.value = !1;
8313
+ function E() {
8314
+ m?.(), m = null, v?.(), v = null, h.reset(), f.cancel(), l.value = void 0, a.configure(null, null), r = null, i = null, s = null, c = !1, p = "", n.value = !1;
8311
8315
  }
8312
8316
  return {
8313
8317
  readOnly: n,
8314
8318
  synced: o,
8315
- livePatcher: l,
8316
- gate: g,
8319
+ writeBackState: l,
8320
+ livePatcher: a,
8321
+ gate: h,
8317
8322
  begin: function(e) {
8318
- i = e, n.value = "viewer" === e.role || Boolean(e.externalSession);
8323
+ s = e, n.value = "viewer" === e.role || Boolean(e.externalSession);
8319
8324
  },
8320
8325
  attach: function(e, o) {
8321
- if (a = e, r = o, !i) return;
8322
- const d = i;
8323
- if (d.externalSession) return void (p = (0, u.observeExternalCollaborationReadiness)(d.externalSession, {
8324
- gate: g,
8325
- livePatcher: l,
8326
- factories: r,
8327
- role: d.role,
8328
- sessionIntent: d.sessionIntent,
8326
+ if (r = e, i = o, !s) return;
8327
+ const l = s;
8328
+ if (l.externalSession) return void (m = (0, u.observeExternalCollaborationReadiness)(l.externalSession, {
8329
+ gate: h,
8330
+ livePatcher: a,
8331
+ factories: i,
8332
+ role: l.role,
8333
+ sessionIntent: l.sessionIntent,
8329
8334
  onStatus: (e) => {
8330
8335
  t.value = e;
8331
8336
  },
8332
8337
  adoptSlides: (e) => {
8333
- y(e), v.schedule(d);
8338
+ k(e), f.schedule(l);
8334
8339
  },
8335
8340
  onReady: ({ seedEmptyRoom: e }) => {
8336
- e && (c = ""), h();
8341
+ e && (p = ""), y();
8337
8342
  },
8338
- onSuspend: () => v.cancel(),
8343
+ onSuspend: () => f.cancel(),
8339
8344
  onReadOnlyChange: (e) => {
8340
8345
  n.value = e;
8341
8346
  }
8342
8347
  }));
8343
- l.configure("viewer" === d.role ? null : a, r), m = (0, u.observeYDocSlides)(a, (e, t) => {
8344
- if (t?.origin === u.LOCAL_SYNC_ORIGIN || s || !a) return;
8345
- const n = (0, u.readSlidesFromYDoc)(a);
8346
- n.length && (y(n), v.schedule(d));
8348
+ a.configure("viewer" === l.role ? null : r, i), v = (0, u.observeYDocSlides)(r, (e, t) => {
8349
+ if (t?.origin === u.LOCAL_SYNC_ORIGIN || c || !r) return;
8350
+ const n = (0, u.readSlidesFromYDoc)(r);
8351
+ n.length && (k(n), f.schedule(l));
8347
8352
  });
8348
- const f = (0, u.readSlidesFromYDoc)(a);
8349
- f.length && y(f);
8353
+ const d = (0, u.readSlidesFromYDoc)(r);
8354
+ d.length && k(d);
8350
8355
  },
8351
- stop: w,
8356
+ stop: E,
8352
8357
  dispose: () => {
8353
- w(), k(), x?.(), S?.();
8358
+ E(), x(), b?.(), w?.();
8354
8359
  }
8355
8360
  };
8356
8361
  }
@@ -8450,7 +8455,8 @@ function ad(e) {
8450
8455
  clientId: i.localClientId.value,
8451
8456
  userName: a.value?.userName,
8452
8457
  userColor: e.userColor ?? a.value?.userColor,
8453
- remoteUsers: i.remoteUsers.value
8458
+ remoteUsers: i.remoteUsers.value,
8459
+ writeBack: (0, u.writeBackReport)(a.value, s.writeBackState.value)
8454
8460
  })), m = (0, d.computed)(() => i.remotePresences.value.length + (l.value ? 1 : 0));
8455
8461
  let v = null, f = null, g = null, h = null, y = null, k = null, x = 0;
8456
8462
  async function b(e) {
@@ -8491,7 +8497,7 @@ function ad(e) {
8491
8497
  }
8492
8498
  const y = await async function(e, t, n) {
8493
8499
  if ("webrtc" === e) {
8494
- const { WebrtcProvider: e } = await Promise.resolve().then(() => require("./y-webrtc-Cb8v01f2.cjs")), o = new e(t.roomId, n, {
8500
+ const { WebrtcProvider: e } = await Promise.resolve().then(() => require("./y-webrtc-B7OSkf8u.cjs")), o = new e(t.roomId, n, {
8495
8501
  signaling: t.signaling?.length ? t.signaling : void 0,
8496
8502
  password: t.authToken || void 0
8497
8503
  }), l = (0, u.createDepartureChannel)(t.roomId, o.awareness);
@@ -9090,14 +9096,14 @@ function vd(e) {
9090
9096
  const { coreProperties: t, customProperties: n, appProperties: o } = e, l = (0, d.ref)(!1);
9091
9097
  return {
9092
9098
  propertiesOpen: l,
9093
- onPropertiesSave: function(e) {
9099
+ onPropertiesSave: function(a) {
9094
9100
  t.value = {
9095
9101
  ...t.value,
9096
- ...e.core
9097
- }, n.value = e.custom, e.app && (o.value = {
9102
+ ...a.core
9103
+ }, n.value = a.custom, a.app && (o.value = {
9098
9104
  ...o.value,
9099
- ...e.app
9100
- }), l.value = !1;
9105
+ ...a.app
9106
+ }), l.value = !1, e.onCorePropertiesChanged?.(a.core);
9101
9107
  }
9102
9108
  };
9103
9109
  }
@@ -9118,22 +9124,28 @@ function fd(e, t, n) {
9118
9124
  const e = Math.max(o.slides.length - 1, 0);
9119
9125
  l.value > e && (l.value = e);
9120
9126
  }
9127
+ }, c = (0, d.computed)(() => (l.value, o.canUndo)), p = (0, d.computed)(() => (l.value, o.canRedo)), m = (0, d.computed)(() => (l.value, o.undoLabel || void 0)), v = (0, d.computed)(() => (l.value, o.redoLabel || void 0));
9128
+ let f = !1;
9129
+ const g = () => {
9130
+ n?.onChange && !f && (f = !0, (0, d.nextTick)(() => {
9131
+ f = !1, n.onChange?.();
9132
+ }));
9121
9133
  };
9122
9134
  return {
9123
- canUndo: (0, d.computed)(() => (l.value, o.canUndo)),
9124
- canRedo: (0, d.computed)(() => (l.value, o.canRedo)),
9125
- undoLabel: (0, d.computed)(() => (l.value, o.undoLabel || void 0)),
9126
- redoLabel: (0, d.computed)(() => (l.value, o.redoLabel || void 0)),
9135
+ canUndo: c,
9136
+ canRedo: p,
9137
+ undoLabel: m,
9138
+ redoLabel: v,
9127
9139
  pushHistory: (e = "") => {
9128
- o.record(i(), e), a();
9140
+ o.record(i(), e), a(), g();
9129
9141
  },
9130
9142
  undo: () => {
9131
9143
  const e = o.undo(i());
9132
- e && (s(e.snapshot), a());
9144
+ e && (s(e.snapshot), a(), g());
9133
9145
  },
9134
9146
  redo: () => {
9135
9147
  const e = o.redo(i());
9136
- e && (s(e.snapshot), a());
9148
+ e && (s(e.snapshot), a(), g());
9137
9149
  },
9138
9150
  clearHistory: () => {
9139
9151
  o.clear(), a();
@@ -10099,7 +10111,28 @@ function $d(e) {
10099
10111
  }), y = Dd({
10100
10112
  exporter: g,
10101
10113
  mediaExport: h
10102
- });
10114
+ }), k = (0, d.computed)(() => g.exporting.value || h.exporting.value);
10115
+ async function x(t, n = "saveAs") {
10116
+ const o = e.storage?.();
10117
+ try {
10118
+ const l = await r(t);
10119
+ await (0, u.deliverSavedPresentation)({
10120
+ storage: o,
10121
+ bytes: l,
10122
+ format: t,
10123
+ fileName: (0, u.savedPresentationFileName)(e.fileName?.(), t),
10124
+ reason: n
10125
+ });
10126
+ const a = e.getOptions?.();
10127
+ if (a) {
10128
+ (0, u.playFeedbackSound)(a);
10129
+ const n = e.filePath?.();
10130
+ "pptx" === t && n && (0, u.shouldDiscardAutosaveOnSuccessfulSave)(a) && (0, u.deleteAutosaveSnapshot)(n, o).catch(() => {});
10131
+ }
10132
+ } catch (n) {
10133
+ console.error(`[PowerPointViewer] Save as .${t} failed:`, n), e.onSaveError?.(n);
10134
+ }
10135
+ }
10103
10136
  return {
10104
10137
  exportStageRef: s,
10105
10138
  exportSlide: p,
@@ -10109,7 +10142,7 @@ function $d(e) {
10109
10142
  exporter: g,
10110
10143
  mediaExport: h,
10111
10144
  exportProgressCtl: y,
10112
- isExporting: (0, d.computed)(() => g.exporting.value || h.exporting.value),
10145
+ isExporting: k,
10113
10146
  onExportPng: function() {
10114
10147
  g.exportSlidePng(a.value);
10115
10148
  },
@@ -10129,19 +10162,9 @@ function $d(e) {
10129
10162
  console.error("[PowerPointViewer] Export as JSON failed:", e);
10130
10163
  }
10131
10164
  },
10132
- downloadAs: async function(t) {
10133
- try {
10134
- const n = await r(t), o = new Blob([n], { type: "ppt" === t ? "application/vnd.ms-powerpoint" : "application/vnd.openxmlformats-officedocument.presentationml.presentation" });
10135
- (0, u.downloadBlob)(o, `presentation.${t}`);
10136
- const l = e.getOptions?.();
10137
- if (l) {
10138
- (0, u.playFeedbackSound)(l);
10139
- const n = e.filePath?.();
10140
- "pptx" === t && n && (0, u.shouldDiscardAutosaveOnSuccessfulSave)(l) && (0, u.deleteAutosaveSnapshot)(n).catch(() => {});
10141
- }
10142
- } catch (e) {
10143
- console.error(`[PowerPointViewer] Save as .${t} failed:`, e);
10144
- }
10165
+ downloadAs: x,
10166
+ save: function() {
10167
+ return x("pptx", "save");
10145
10168
  },
10146
10169
  onCopySlideAsImage: async function() {
10147
10170
  try {
@@ -11019,16 +11042,16 @@ function xp(e) {
11019
11042
  }, t.value = r;
11020
11043
  }
11021
11044
  return {
11022
- onNotesUpdate: function(e, o) {
11023
- const a = n.value, r = t.value[a];
11024
- if (!r) return;
11045
+ onNotesUpdate: function(o, a) {
11046
+ const r = n.value, i = t.value[r];
11047
+ if (!i) return;
11025
11048
  l();
11026
- const i = t.value.slice();
11027
- i[a] = {
11028
- ...r,
11029
- notes: e,
11030
- ...void 0 === o ? {} : { notesSegments: o.length > 0 ? o : void 0 }
11031
- }, t.value = i;
11049
+ const s = t.value.slice();
11050
+ s[r] = {
11051
+ ...i,
11052
+ notes: o,
11053
+ ...void 0 === a ? {} : { notesSegments: a.length > 0 ? a : void 0 }
11054
+ }, t.value = s, e.onNotesChanged?.(o);
11032
11055
  },
11033
11056
  toggleSlideHidden: function(e) {
11034
11057
  const n = t.value[e];
@@ -11425,6 +11448,9 @@ function Dp(e) {
11425
11448
  onOpenShareDialog: () => {
11426
11449
  e.shareOpen.value = !0;
11427
11450
  },
11451
+ onSave: () => {
11452
+ e.save();
11453
+ },
11428
11454
  onSaveAsPptx: () => {
11429
11455
  e.downloadAs("pptx");
11430
11456
  },
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const e = require("../useViewerSettingsDialog-D6InSTG6.cjs"), t = require("../viewer-v6sw9LNJ.cjs");
2
+ const e = require("../useViewerSettingsDialog-jAbWHh3J.cjs"), t = require("../viewer-7Z6aaf6w.cjs");
3
3
  let r = require("ooxml-ui/pptx");
4
4
  Object.defineProperty(exports, "AUDIENCE_HASH", {
5
5
  enumerable: !0,
Binary file
Binary file
@@ -1,6 +1,7 @@
1
1
  import { AccountAuthConfig } from 'ooxml-ui/pptx';
2
2
  import { AnimationApplyGroup } from 'ooxml-ui/pptx';
3
3
  import { AUDIENCE_HASH } from 'ooxml-ui/pptx';
4
+ import { AutosaveRecord } from 'ooxml-ui/pptx';
4
5
  import { buildInitialGuides } from 'ooxml-ui/pptx';
5
6
  import { CanvasSize } from 'ooxml-ui/pptx';
6
7
  import { ChangeCaseMode } from 'ooxml-ui/pptx';
@@ -21,6 +22,7 @@ import { ConnectionStatus } from 'ooxml-ui/pptx';
21
22
  import { CSSProperties } from 'vue';
22
23
  import { DeckSaveIntent } from 'ooxml-ui/pptx';
23
24
  import { DefineComponent } from 'vue';
25
+ import { DocumentStorage } from 'ooxml-ui/pptx';
24
26
  import { ElementAnimationState } from 'ooxml-ui/pptx';
25
27
  import { ExternalCollaborationAwareness } from 'ooxml-ui/pptx';
26
28
  import { ExternalCollaborationSession } from 'ooxml-ui/pptx';
@@ -98,6 +100,7 @@ import { TemplateElementMap } from 'ooxml-ui/pptx';
98
100
  import { TextStyle } from 'ooxml-core/pptx';
99
101
  import { ThemeCatalogEntry } from 'ooxml-ui/pptx';
100
102
  import { ToolbarActionId } from 'ooxml-ui/pptx';
103
+ import { ViewerAutosaveStatus } from 'ooxml-ui/pptx';
101
104
  import { ViewerCustomization } from 'ooxml-ui/pptx';
102
105
  import { ViewerCustomizationApi } from 'ooxml-ui/pptx';
103
106
  import { ViewerFontSource } from 'ooxml-ui/pptx';
@@ -122,8 +125,10 @@ declare const __VLS_base_2: DefineComponent<__VLS_Props_2, {}, {}, {}, {}, Compo
122
125
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
123
126
 
124
127
  declare const __VLS_export: DefineComponent<PowerPointViewerProps, PowerPointViewerExpose, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
128
+ change: () => any;
125
129
  error: (message: string) => any;
126
130
  load: (detail: ViewerLoadDetail) => any;
131
+ "collaboration-status": (status: ConnectionStatus) => any;
127
132
  "dirty-change": (isDirty: boolean) => any;
128
133
  "content-change": (content: Uint8Array<ArrayBufferLike>) => any;
129
134
  autosave: (content: Uint8Array<ArrayBufferLike>) => any;
@@ -135,9 +140,17 @@ declare const __VLS_export: DefineComponent<PowerPointViewerProps, PowerPointVie
135
140
  "start-collaboration": (config: CollaborationConfig) => any;
136
141
  "stop-collaboration": () => any;
137
142
  "collaboration-change": (state: CollaborationState) => any;
143
+ "autosave-toggle": (enabled: boolean) => any;
144
+ "autosave-status": (status: ViewerAutosaveStatus) => any;
145
+ "autosave-recovery": (record: AutosaveRecord) => any;
146
+ "properties-change": (updates: Partial< PptxCoreProperties>) => any;
147
+ "notes-update": (notes: string) => any;
148
+ "presentation-change": (presenting: boolean) => any;
138
149
  }, string, PublicProps, Readonly<PowerPointViewerProps> & Readonly<{
150
+ onChange?: (() => any) | undefined;
139
151
  onError?: ((message: string) => any) | undefined;
140
152
  onLoad?: ((detail: ViewerLoadDetail) => any) | undefined;
153
+ "onCollaboration-status"?: ((status: ConnectionStatus) => any) | undefined;
141
154
  "onDirty-change"?: ((isDirty: boolean) => any) | undefined;
142
155
  "onContent-change"?: ((content: Uint8Array<ArrayBufferLike>) => any) | undefined;
143
156
  onAutosave?: ((content: Uint8Array<ArrayBufferLike>) => any) | undefined;
@@ -149,8 +162,16 @@ declare const __VLS_export: DefineComponent<PowerPointViewerProps, PowerPointVie
149
162
  "onStart-collaboration"?: ((config: CollaborationConfig) => any) | undefined;
150
163
  "onStop-collaboration"?: (() => any) | undefined;
151
164
  "onCollaboration-change"?: ((state: CollaborationState) => any) | undefined;
165
+ "onAutosave-toggle"?: ((enabled: boolean) => any) | undefined;
166
+ "onAutosave-status"?: ((status: ViewerAutosaveStatus) => any) | undefined;
167
+ "onAutosave-recovery"?: ((record: AutosaveRecord) => any) | undefined;
168
+ "onProperties-change"?: ((updates: Partial< PptxCoreProperties>) => any) | undefined;
169
+ "onNotes-update"?: ((notes: string) => any) | undefined;
170
+ "onPresentation-change"?: ((presenting: boolean) => any) | undefined;
152
171
  }>, {
153
172
  canEdit: boolean;
173
+ readOnly: boolean;
174
+ autosave: boolean;
154
175
  barChart3D: boolean;
155
176
  lineChart3D: boolean;
156
177
  areaChart3D: boolean;
@@ -1185,6 +1206,25 @@ export declare interface PowerPointViewerEmits {
1185
1206
  (e: 'load', detail: ViewerLoadDetail): void;
1186
1207
  /** Fired once per distinct load failure, with a human-readable message. */
1187
1208
  (e: 'error', message: string): void;
1209
+ /** Fired when the user enables or disables autosave (title bar or File > Options). */
1210
+ (e: 'autosave-toggle', enabled: boolean): void;
1211
+ /** Fired on every autosave lifecycle transition (`idle`, `saving`, `saved`, `error`). */
1212
+ (e: 'autosave-status', status: ViewerAutosaveStatus): void;
1213
+ /**
1214
+ * Fired when a recovery snapshot left by a previous session is found for this deck. The
1215
+ * built-in recovery prompt is shown as well.
1216
+ */
1217
+ (e: 'autosave-recovery', record: AutosaveRecord): void;
1218
+ /** Fired after any committed document edit (move, resize, text, undo, redo, ...). */
1219
+ (e: 'change'): void;
1220
+ /** Fired with the changed fields when the user edits the document properties. */
1221
+ (e: 'properties-change', updates: Partial<PptxCoreProperties>): void;
1222
+ /** Fired with the new speaker-notes text when the user edits the notes of a slide. */
1223
+ (e: 'notes-update', notes: string): void;
1224
+ /** Fired when presentation (slide show) mode is entered (`true`) or left (`false`). */
1225
+ (e: 'presentation-change', presenting: boolean): void;
1226
+ /** Fired on every collaboration connection-status transition. */
1227
+ (e: 'collaboration-status', status: ConnectionStatus): void;
1188
1228
  }
1189
1229
 
1190
1230
  /**
@@ -1224,6 +1264,12 @@ export declare interface PowerPointViewerProps {
1224
1264
  fileName?: string;
1225
1265
  /** Whether editing actions are enabled. */
1226
1266
  canEdit?: boolean;
1267
+ /**
1268
+ * Makes the deck read-only (default `false`). It is the inverse of the edit switch: true wins
1269
+ * over it, false only lifts this restriction, so editing still needs the edit switch and
1270
+ * is never granted over a collaboration `viewer` role or `capabilities.edit`.
1271
+ */
1272
+ readOnly?: boolean;
1227
1273
  /** Fired before following a link; return false to cancel its default action. */
1228
1274
  onHyperlinkClick?: HyperlinkClickHandler;
1229
1275
  /**
@@ -1251,6 +1297,14 @@ export declare interface PowerPointViewerProps {
1251
1297
  * were brought onto one rule.
1252
1298
  */
1253
1299
  autosaveIntervalMs?: number;
1300
+ /**
1301
+ * Host-owned storage (`DocumentStorage` from `ooxml-core/embedding`). When set,
1302
+ * Save and Save As hand the bytes to `storage.save()` instead of downloading
1303
+ * them, and recovery autosave snapshots go to the storage's recovery methods
1304
+ * (`readRecovery` / `writeRecovery` / `clearRecovery`) instead of IndexedDB
1305
+ * when it provides them.
1306
+ */
1307
+ storage?: DocumentStorage;
1254
1308
  /** Optional class name applied to the root element. */
1255
1309
  class?: string;
1256
1310
  /**
@@ -1693,6 +1747,8 @@ export declare interface RibbonProps {
1693
1747
  /** Serialise the deck to pptx-viewer-json and download it (Export page card). */
1694
1748
  onExportJson: () => void;
1695
1749
  onOpenShareDialog?: () => void;
1750
+ /** File > Save (backstage Save item): reported to host storage as `save`, not Save As. */
1751
+ onSave?: () => void;
1696
1752
  onSaveAsPptx: () => void;
1697
1753
  onSaveAsPpsx: () => void;
1698
1754
  onSaveAsPptm: () => void;
@@ -1993,6 +2049,11 @@ declare interface UseEditorHistoryOptions {
1993
2049
  * Without it the stage pointed past the end of the deck and drew nothing.
1994
2050
  */
1995
2051
  activeSlideIndex?: Ref<number>;
2052
+ /**
2053
+ * Called once per tick after an edit is recorded, undone or redone: the host's `change`
2054
+ * event. Deferred a tick so a listener reads the committed deck, not the one before it.
2055
+ */
2056
+ onChange?: () => void;
1996
2057
  }
1997
2058
 
1998
2059
  export declare function useEditorOperations(input: UseEditorOperationsInput): EditorOperations;
@@ -1,3 +1,3 @@
1
- import { $ as a, Ar as s, Bn as r, C as e, Fr as o, Hn as n, Ir as t, Kn as l, L as i, Lr as d, M as R, Mr as S, N as m, Nr as b, P as C, Pr as w, S as u, Vn as c, X as p, Yn as v, Z as f, br as g, fr as j, j as x, jr as y, kr as I, lr as M, lt as P, pr as T, rr as A, ur as E, w as O, x as V, yr as h } from "../useViewerSettingsDialog-DPG5VDMB.js";
2
- import { C as k, S as B, _ as D, a as F, b as L, c as N, d as Z, f as q, g as H, h as K, i as W, m as X, n as Y, o as $, p as _, r as z, s as G, t as J, u as Q, v as U, w as aa, y as sa } from "../viewer-CWgTBLKM.js";
1
+ import { $ as a, Ar as s, Bn as r, C as e, Fr as o, Hn as n, Ir as t, Kn as l, L as i, Lr as d, M as R, Mr as S, N as m, Nr as b, P as C, Pr as w, S as u, Vn as c, X as p, Yn as v, Z as f, br as g, fr as j, j as x, jr as y, kr as I, lr as M, lt as P, pr as T, rr as A, ur as E, w as O, x as V, yr as h } from "../useViewerSettingsDialog-CXbWkqSq.js";
2
+ import { C as k, S as B, _ as D, a as F, b as L, c as N, d as Z, f as q, g as H, h as K, i as W, m as X, n as Y, o as $, p as _, r as z, s as G, t as J, u as Q, v as U, w as aa, y as sa } from "../viewer-DIlCsUp0.js";
3
3
  export { Z as AUDIENCE_HASH, g as ChartRenderer, U as CollaborationCursors, aa as CollaborationStatusIndicator, h as ConnectorRenderer, b as DEFAULT_CANVAS_HEIGHT, w as DEFAULT_CANVAS_WIDTH, o as DEFAULT_FILL_COLOR, t as DEFAULT_STROKE_COLOR, d as DEFAULT_TEXT_COLOR, c as ElementRenderer, T as EquationRenderer, Q as FollowModeBar, j as InkRenderer, k as InlineTextEditor, E as Model3DRenderer, M as OleRenderer, N as PowerPointViewer, D as RemoteSelectionOverlay, L as RibbonToolbar, B as SelectionOverlay, sa as SlideCanvas, r as SlideStage, A as SmartArtRenderer, v as TableRenderer, l as WordArtText, n as ZoomRenderer, R as buildInitialGuides, q as clearAudienceContent, m as collectImagePaths, C as collectMediaElements, V as exportAllSlidesToSvg, u as exportAllSlidesToSvgBlobs, e as exportSlideToSvg, O as exportSlideToSvgBlob, I as getContainerStyle, s as getImageSrc, Y as getResolvedShapeClipPath, z as getResolvedShapeClipPathFor, y as getShapeFillStrokeStyle, S as getTextBlockStyle, _ as isAudienceTab, X as loadAudienceContent, J as overlayInlineTextSnapshot, K as parseAudienceNonce, H as storeAudienceContent, P as useCollaboration, W as useCollaborativeHistory, F as useCollaborativeState, a as useEditorHistory, f as useEditorOperations, p as useElementDrag, i as useInlineEditing, x as useLoadContent, $ as usePresenceTracking, G as useYjsProvider };
Binary file
Binary file