@netless/app-slide 0.2.78 → 0.2.80

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
@@ -36242,7 +36242,7 @@ void main(void){
36242
36242
  }
36243
36243
  var vT = { 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", useraddLink: "useraddLink" }, _T = { taskId: "", url: "", currentSlideIndex: -1, mainSeqStep: -1, mainSeqState: null, mediaState: /* @__PURE__ */ Object.create(null), interactiveSeqState: /* @__PURE__ */ Object.create(null) }, yT = "";
36244
36244
  try {
36245
- yT = "1.4.35";
36245
+ yT = "1.4.36";
36246
36246
  } catch (t2) {
36247
36247
  yT = "-dev-";
36248
36248
  }
@@ -36293,6 +36293,9 @@ void main(void){
36293
36293
  n3.isTouchStart && (n3.isTouchStart = false, n3.handleViewClick());
36294
36294
  }, n3.handleSlideRef = function() {
36295
36295
  console.log(n3), window.__slide = n3;
36296
+ }, n3.updateStageCountLimit = function(t3) {
36297
+ var i4 = Number(t3.detail.value);
36298
+ i4 > 0 && Number.isInteger(i4) && (e2.__stageCountLimit = i4);
36296
36299
  }, n3.receiveSyncHandler = function(t3) {
36297
36300
  return dT(n3, void 0, void 0, function() {
36298
36301
  var e3, i4, n4, r2, o2, s2 = this;
@@ -36363,7 +36366,7 @@ void main(void){
36363
36366
  }), n3.renderingTaskManager.eventHub.on("task-error", function(t3) {
36364
36367
  var e3 = t3.error, i4 = t3.task, r2 = Tm.transform(e3);
36365
36368
  r2.errorType === gm.RuntimeWarn ? n3.logger.warn(r2.message, n3.taskId) : n3.logger.error(r2.message, n3.taskId), n3.isLoading = false, n3.reportError(r2, i4.slideIndex);
36366
- }), window.addEventListener("__slide_ref__", n3.handleSlideRef), n3.resizeView = $y()(n3.resizeView.bind(n3), 50), n3.player = n3.initPlayer(n3.config), n3.config.controller && n3.createController(), n3.player.view && n3.canvasContainer.appendChild(n3.player.view), n3.handleViewClick = $y()(n3.handleViewClick, 300), n3.player.errorChannel.on("error", function(t3, e3) {
36369
+ }), window.addEventListener("__slide_ref__", n3.handleSlideRef), window.addEventListener("__slide_updateStageCountLimit", n3.updateStageCountLimit), n3.resizeView = $y()(n3.resizeView.bind(n3), 50), n3.player = n3.initPlayer(n3.config), n3.config.controller && n3.createController(), n3.player.view && n3.canvasContainer.appendChild(n3.player.view), n3.handleViewClick = $y()(n3.handleViewClick, 300), n3.player.errorChannel.on("error", function(t3, e3) {
36367
36370
  var i4 = Tm.transform(t3);
36368
36371
  i4.errorType === gm.RuntimeWarn ? n3.logger.warn(i4.message, n3.taskId) : n3.logger.error(i4.message, n3.taskId), n3.isLoading = false, n3.reportError(t3, e3), n3.tracker({ name: "slideError", reason: i4.errorMsg, result: "", payload: { code: i4.errorType } });
36369
36372
  }), window.addEventListener("message", n3.recoverHandler), e2.volumeAdjuster.on("update", n3._updateVolumeByStaticAdjuster), n3.volumeAdjuster.volume = e2.volumeAdjuster.volume, n3;
@@ -36437,6 +36440,10 @@ void main(void){
36437
36440
  }, e2.appendLogString = function(t3) {
36438
36441
  e2._tempLog += t3, e2.remoteLogAddress && fetch(e2.remoteLogAddress + "/logs", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ log: t3 }) }).catch(function() {
36439
36442
  });
36443
+ }, e2.setStageCountLimit = function(t3) {
36444
+ if (!Vm()(t3) || !Number.isInteger(t3))
36445
+ throw new Error("Invalid stage count limit");
36446
+ e2.__stageCountLimit = t3;
36440
36447
  }, Object.defineProperty(e2.prototype, "dispatchIncrId", { get: function() {
36441
36448
  return this._dispatchIncrId++;
36442
36449
  }, enumerable: false, configurable: true }), e2.prototype.reportError = function(t3, i3) {
@@ -36675,7 +36682,8 @@ void main(void){
36675
36682
  (i3 !== this.player.currentIndex || this.renderingTaskManager.hasStartTask()) && (i3 > this.slideCount && this.slideCount > 0 || this.poseRenderSlide(i3, e3));
36676
36683
  }
36677
36684
  }, e2.prototype.needCreateNewPlayer = function() {
36678
- var t3 = Yy.platform.isLowGpuMemory() ? 15 : 30;
36685
+ var t3 = e2.__stageCountLimit;
36686
+ t3 <= 0 && (t3 = Yy.platform.isLowGpuMemory() ? 15 : 30);
36679
36687
  return (Yy.platform.isIOS() || Yy.platform.isAndroid()) && this.iosResetCache.length > t3;
36680
36688
  }, e2.prototype.poseRenderSlide = function(t3, e3) {
36681
36689
  "interactive" === this.mode ? this.emitSyncDispatch({ slideIndex: this.__slideState.currentSlideIndex, type: "renderSlide", index: t3, isForward: e3 }) : "sync" === this.mode ? (this.doRenderSlide(t3, e3), this.emitSyncDispatch({ slideIndex: this.__slideState.currentSlideIndex, type: "renderSlide", index: t3, isForward: e3 })) : this.doRenderSlide(t3, e3);
@@ -36799,7 +36807,7 @@ void main(void){
36799
36807
  return {};
36800
36808
  }, error: function() {
36801
36809
  return {};
36802
- } }, this.syncQueue.destroy(), this.renderingTaskManager.destroy(), this.frozenTaskManager.destroy(), window.removeEventListener("__slide_ref__", this.handleSlideRef), window.removeEventListener("message", this.recoverHandler), this.removeAllListeners(), null === (r2 = this.player) || void 0 === r2 ? void 0 : r2.view)
36810
+ } }, this.syncQueue.destroy(), this.renderingTaskManager.destroy(), this.frozenTaskManager.destroy(), window.removeEventListener("__slide_ref__", this.handleSlideRef), window.removeEventListener("__slide_updateStageCountLimit", this.updateStageCountLimit), window.removeEventListener("message", this.recoverHandler), this.removeAllListeners(), null === (r2 = this.player) || void 0 === r2 ? void 0 : r2.view)
36803
36811
  try {
36804
36812
  this.anchor.removeChild(this.player.view);
36805
36813
  } catch (t4) {
@@ -36879,7 +36887,7 @@ void main(void){
36879
36887
  var e3 = qy.get(t4.hookPoint) || [];
36880
36888
  e3.push(t4), qy.set(t4.hookPoint, e3);
36881
36889
  }(t3);
36882
- }, e2.volumeAdjuster = new zy(), e2.trackLogger = new oT(), e2.handleFrozenAllSlide = function() {
36890
+ }, e2.volumeAdjuster = new zy(), e2.__stageCountLimit = -1, e2.trackLogger = new oT(), e2.handleFrozenAllSlide = function() {
36883
36891
  e2.instances.forEach(function(t3) {
36884
36892
  t3.player && (e2._tempFrozenIds.push(t3.randomId), t3.frozen());
36885
36893
  });
@@ -37729,7 +37737,7 @@ class SlideController {
37729
37737
  if (this.ready) {
37730
37738
  let isNeedSyncState = false;
37731
37739
  log("[Slide] unfreeze", this.context.appId);
37732
- if (this.invisibleBehavior === "frozen" && !this.slide.view) {
37740
+ if (this.invisibleBehavior === "frozen") {
37733
37741
  this.slide.release();
37734
37742
  isNeedSyncState = true;
37735
37743
  } else {
@@ -37864,7 +37872,7 @@ class SlideController {
37864
37872
  return this.slide.slideState.currentSlideIndex;
37865
37873
  }
37866
37874
  createSlide(anchor, defaults = {}) {
37867
- var _a, _b, _c;
37875
+ var _a, _b, _c, _d;
37868
37876
  const options = this.context.getAppOptions() || {};
37869
37877
  const attribute = this.context.storage.state;
37870
37878
  const slide = new Slide.Slide({
@@ -37894,8 +37902,8 @@ class SlideController {
37894
37902
  logger: options.logger,
37895
37903
  whiteTracker: defaults.whiteTracker,
37896
37904
  timestamp: this.timestamp,
37897
- skipActionWhenFrozen: true,
37898
- customLinks: attribute.customLinks
37905
+ customLinks: attribute.customLinks,
37906
+ skipActionWhenFrozen: (_d = options.skipActionWhenFrozen) != null ? _d : true
37899
37907
  });
37900
37908
  return slide;
37901
37909
  }
@@ -39534,7 +39542,7 @@ class SlidePreviewer {
39534
39542
  }
39535
39543
  }
39536
39544
  const usePlugin = /* @__PURE__ */ Slide.Slide.usePlugin.bind(Slide.Slide);
39537
- const version = "0.2.78";
39545
+ const version = "0.2.80";
39538
39546
  const SlideApp = {
39539
39547
  kind: "Slide",
39540
39548
  setup(context) {