@netless/app-slide 0.2.49 → 0.2.51

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.
package/dist/main.es.js CHANGED
@@ -32408,7 +32408,7 @@ void main(void){
32408
32408
  }
32409
32409
  n3 >= 1 && this.timingTarget && this.ctx.clock.setTimeout(() => {
32410
32410
  this.removeFilter();
32411
- });
32411
+ }, 34);
32412
32412
  }, this.onSeekToStart = () => {
32413
32413
  this.timingTarget && this.removeFilter();
32414
32414
  }, this.onSeekToEnd = () => {
@@ -36008,7 +36008,7 @@ void main(void){
36008
36008
  }
36009
36009
  var fT = { syncDispatch: "syncDispatch", syncReceive: "syncReceive", syncEventLag: "syncEventLag", renderStart: "renderStart", renderEnd: "renderEnd", renderError: "renderError", slideChange: "slideChange", mainSeqStepStart: "mainSeqStepStart", mainSeqStepEnd: "mainSeqStepEnd", animateStart: "animateStart", animateEnd: "animateEnd", stateChange: "stateChange", slideStepEnd: "slideEnd", slideStepStart: "slideStart" }, mT = { taskId: "", url: "", currentSlideIndex: -1, mainSeqStep: -1, mainSeqState: null, mediaState: /* @__PURE__ */ Object.create(null), interactiveSeqState: /* @__PURE__ */ Object.create(null) }, gT = "";
36010
36010
  try {
36011
- gT = "1.1.12";
36011
+ gT = "1.2.1";
36012
36012
  } catch (t2) {
36013
36013
  gT = "dev -";
36014
36014
  }
@@ -38325,7 +38325,7 @@ if (runningOnBrowser) {
38325
38325
  autoInitialize(LazyLoad, window.lazyLoadOptions);
38326
38326
  }
38327
38327
  class DocsViewer {
38328
- constructor({ readonly, onNewPageIndex, onPlay, urlInterrupter }) {
38328
+ constructor({ readonly, onNewPageIndex, onPlay, onPagesReady, urlInterrupter }) {
38329
38329
  this._pages = [];
38330
38330
  this.pageIndex = 0;
38331
38331
  this.setPaused = () => {
@@ -38341,6 +38341,7 @@ class DocsViewer {
38341
38341
  this.readonly = readonly;
38342
38342
  this.onNewPageIndex = onNewPageIndex;
38343
38343
  this.onPlay = onPlay;
38344
+ this.onPagesReady = onPagesReady;
38344
38345
  this.urlInterrupter = urlInterrupter || ((url) => url);
38345
38346
  this.render();
38346
38347
  }
@@ -38348,6 +38349,9 @@ class DocsViewer {
38348
38349
  this._pages = value;
38349
38350
  this.refreshPreview().then(this.refreshBtnSidebar.bind(this));
38350
38351
  this.refreshTotalPage();
38352
+ if (this.onPagesReady) {
38353
+ this.onPagesReady(value);
38354
+ }
38351
38355
  }
38352
38356
  get pages() {
38353
38357
  return this._pages;
@@ -38610,7 +38614,8 @@ class SlideDocsViewer {
38610
38614
  mountWhiteboard,
38611
38615
  baseScenePath,
38612
38616
  appId,
38613
- urlInterrupter
38617
+ urlInterrupter,
38618
+ onPagesReady
38614
38619
  }) {
38615
38620
  this.slideController = null;
38616
38621
  this.isViewMounted = false;
@@ -38772,7 +38777,8 @@ class SlideDocsViewer {
38772
38777
  readonly: box.readonly,
38773
38778
  onNewPageIndex: this.onNewPageIndex,
38774
38779
  onPlay: this.onPlay,
38775
- urlInterrupter
38780
+ urlInterrupter,
38781
+ onPagesReady
38776
38782
  });
38777
38783
  this.sideEffect.add(() => {
38778
38784
  const handler = (readonly) => {
@@ -39138,7 +39144,7 @@ class SlidePreviewer {
39138
39144
  }
39139
39145
  }
39140
39146
  const usePlugin = /* @__PURE__ */ Slide.Slide.usePlugin.bind(Slide.Slide);
39141
- const version = "0.2.49";
39147
+ const version = "0.2.51";
39142
39148
  const SlideApp = {
39143
39149
  kind: "Slide",
39144
39150
  setup(context) {
@@ -39175,6 +39181,10 @@ const SlideApp = {
39175
39181
  docsViewer.viewer.setPageIndex(page - 1);
39176
39182
  docsViewer.viewer.setPaused();
39177
39183
  docsViewer.onPageChanged();
39184
+ const length = docsViewer.viewer.pages.length;
39185
+ if (length > 0) {
39186
+ context.dispatchAppEvent("pageStateChange", { index: page - 1, length });
39187
+ }
39178
39188
  }
39179
39189
  };
39180
39190
  const mountSlideController = (options) => {
@@ -39209,7 +39219,11 @@ const SlideApp = {
39209
39219
  mountWhiteboard: context.mountView.bind(context),
39210
39220
  baseScenePath,
39211
39221
  appId: context.appId,
39212
- urlInterrupter: (_a = context.getAppOptions()) == null ? void 0 : _a.urlInterrupter
39222
+ urlInterrupter: (_a = context.getAppOptions()) == null ? void 0 : _a.urlInterrupter,
39223
+ onPagesReady: ({ length }) => {
39224
+ const index = (docsViewer == null ? void 0 : docsViewer.viewer.pageIndex) || 0;
39225
+ context.dispatchAppEvent("pageStateChange", { index, length });
39226
+ }
39213
39227
  });
39214
39228
  const room = context.getRoom();
39215
39229
  const sideEffect = new SideEffectManager();