@netless/app-slide 0.2.65 → 0.2.67

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
@@ -6079,7 +6079,7 @@ var Slide = function(t) {
6079
6079
  }
6080
6080
  return void 0 === d && (d = setTimeout(b, e2)), c;
6081
6081
  }
6082
- return e2 = o(e2) || 0, n(i2) && (m = !!i2.leading, u = (g = "maxWait" in i2) ? s(o(i2.maxWait) || 0, e2) : u, v = "trailing" in i2 ? !!i2.trailing : v), E.cancel = function() {
6082
+ return e2 = o(e2) || 0, n(i2) && (m = !!i2.leading, u = (g = "maxWait" in i2) ? s(o(i2.maxWait) || 0, e2) : u, v = "trailing" in i2 ? !!i2.trailing : v), console.log("max wait", u), E.cancel = function() {
6083
6083
  void 0 !== d && clearTimeout(d), f = 0, l = p = h = d = void 0;
6084
6084
  }, E.flush = function() {
6085
6085
  return void 0 === d ? c : T(r());
@@ -31320,7 +31320,9 @@ void main(void){
31320
31320
  }
31321
31321
  this.delayHide();
31322
31322
  }
31323
- }, this.targetId = t2.targetId, this.ctx = t2.ctx, this.height = t2.height, this.width = t2.width, this.target = t2.target, this.media = t2.media, this.info = t2.info, this.shapeId = t2.shapeId, this.canvasElement = t2.canvasElement, "video" === this.media.type && (this.isVideo = true), this.getMedianContainer(), this.createMediaController(), this.info.cut && (this.start = null !== (e2 = this.info.cut.start) && void 0 !== e2 ? e2 : 0, this.end = null !== (i2 = this.info.cut.end) && void 0 !== i2 ? i2 : 0), this.info.bookmarkList && (this.bookmarkList = this.info.bookmarkList.sort((t3, e3) => t3.time - e3.time));
31323
+ }, this.targetId = t2.targetId, this.ctx = t2.ctx, this.height = t2.height, this.width = t2.width, this.target = t2.target, this.media = t2.media, this.info = t2.info, this.shapeId = t2.shapeId, this.canvasElement = t2.canvasElement, "video" === this.media.type && (this.isVideo = true), this.getMedianContainer(), this.createMediaController(), this.info.cut && (this.start = null !== (e2 = this.info.cut.start) && void 0 !== e2 ? e2 : 0, this.end = null !== (i2 = this.info.cut.end) && void 0 !== i2 ? i2 : 0), this.info.bookmarkList && (this.bookmarkList = this.info.bookmarkList.sort((t3, e3) => t3.time - e3.time)), this.ctx.globalEventHub.on("togglePlayStatus", (t3) => {
31324
+ t3 === this.targetId && (this.media.isPlaying ? this.pauseMediaFromCtrl(false) : this.playMediaFromCtrl(false));
31325
+ });
31324
31326
  }
31325
31327
  getMedianContainer() {
31326
31328
  var t2;
@@ -31849,9 +31851,10 @@ void main(void){
31849
31851
  const a2 = null === (t2 = this.backgroundGraphics) || void 0 === t2 ? void 0 : t2.getPictureMask();
31850
31852
  if ((null === (e2 = this.backgroundGraphics) || void 0 === e2 ? void 0 : e2.isNeedMask(s2.width, s2.height)) && a2 && (s2.mask = a2, this.effectContainer.addChild(a2)), s2.width = this.designWidth, s2.height = this.designHeight, s2 instanceof im && this.ctx.slideScopeEventHub.on("slide-render", this.onSlideRenderPlayGif), this.effectContainer.addChild(s2), this.media) {
31851
31853
  let t3 = this.media.src;
31852
- if ("audio" === this.media.type && /mp4$/.test(t3) && (t3 = t3.replace(/mp4$/, "mp3")), this.ctx.urlInterrupter) {
31853
- const e3 = Date.now();
31854
- t3 = yield this.ctx.urlInterrupter(t3), this.ctx.logger.info("redirect media url by interrupter. time: " + (Date.now() - e3), this.ctx.taskId);
31854
+ const [e3, i3] = t3.split("dynamicConvert");
31855
+ if (i3 && (t3 = `${this.ctx.prefix}${i3}`), "audio" === this.media.type && /mp4$/.test(t3) && (t3 = t3.replace(/mp4$/, "mp3")), this.ctx.urlInterrupter) {
31856
+ const e4 = Date.now();
31857
+ t3 = yield this.ctx.urlInterrupter(t3), this.ctx.logger.info("redirect media url by interrupter. time: " + (Date.now() - e4), this.ctx.taskId);
31855
31858
  }
31856
31859
  this.ctx.loaderDelegate && (t3 = this.ctx.loaderDelegate.redirectMedia(t3), this.ctx.logger.info(`redirect media url to ${t3} by delegate.`, this.ctx.taskId)), this.media.src = t3;
31857
31860
  }
@@ -32319,12 +32322,18 @@ void main(void){
32319
32322
  if ("num" === e2 && this.timingTarget) {
32320
32323
  const e3 = new I_(t4, this.timingTarget);
32321
32324
  this.keyFrames.push([t4.time, e3]);
32325
+ } else if ("str" === e2 && this.timingTarget) {
32326
+ const e3 = new R_(t4, this.timingTarget);
32327
+ this.keyFrames.push([t4.time, e3]);
32322
32328
  }
32323
32329
  }
32324
32330
  const t3 = { time: 1, val: { type: "string", value: this.json.to }, fmla: "" };
32325
32331
  if ("num" === e2 && this.timingTarget) {
32326
32332
  const e3 = new I_(t3, this.timingTarget);
32327
32333
  this.keyFrames.push([t3.time, e3]);
32334
+ } else if ("str" === e2 && this.timingTarget) {
32335
+ const e3 = new R_(t3, this.timingTarget);
32336
+ this.keyFrames.push([t3.time, e3]);
32328
32337
  }
32329
32338
  } else if (this.json.by) {
32330
32339
  const i2 = { time: 0, val: { type: "string", value: this.json.cBhvr.attrList[0] }, fmla: "" };
@@ -32695,7 +32704,8 @@ void main(void){
32695
32704
  const { json: e2, isIterate: i2, isSub: n2, eventHub: r2, ctx: o2, parent: s2, iterateType: a2, iterateIndex: l2, iterateId: h2, isInInteractiveSeq: u2, fromSeqId: c2 } = t2;
32696
32705
  this.json = e2, this.id = e2.cMediaNode.ctn.id, this.commonTimeNode = new Ey({ json: e2.cMediaNode.ctn, isSub: n2, eventHubs: { global: r2, runtime: this.runtimeNodeEventHub }, ctx: o2, parent: s2, isIterate: i2, iterateType: a2, iterateIndex: l2, iterateId: h2, isInInteractiveSeq: u2, fromSeqId: c2 });
32697
32706
  let d2 = e2.cMediaNode.tgtEl;
32698
- o2.loaderDelegate && (d2 = o2.loaderDelegate.redirectMedia(d2), o2.logger.info(`redirect media url from ${e2.cMediaNode.tgtEl} to ${d2} by delegate.`, o2.taskId)), this.audio = new c_(d2, o2.runningAudio, void 0, { enableWebAudio: o2.enableWebAudio }), o2.activeMedia.add(this.audio), this.commonTimeNode.on("timelineStart", () => {
32707
+ const [p2, f2] = d2.split("dynamicConvert");
32708
+ f2 && (d2 = `${o2.prefix}${f2}`), o2.loaderDelegate && (d2 = o2.loaderDelegate.redirectMedia(d2), o2.logger.info(`redirect media url from ${e2.cMediaNode.tgtEl} to ${d2} by delegate.`, o2.taskId)), this.audio = new c_(d2, o2.runningAudio, void 0, { enableWebAudio: o2.enableWebAudio }), o2.activeMedia.add(this.audio), this.commonTimeNode.on("timelineStart", () => {
32699
32709
  this.audio.volume(o2.volumeAdjuster.volume), this.audio.play();
32700
32710
  }), this.commonTimeNode.on("seekToStart", this.stopAudio), this.commonTimeNode.on("seekToEnd", this.stopAudio), this.commonTimeNode.on("timeNodeDestroy", this.destroy), this.ctx = o2, this.ctx.volumeAdjuster.on("update", this.onVolumeUpdate);
32701
32711
  }
@@ -33594,7 +33604,7 @@ void main(void){
33594
33604
  createCtx(t2) {
33595
33605
  const { task: e2 } = this.stageStates[t2];
33596
33606
  e2.addMTask(() => Dy(this, void 0, void 0, function* () {
33597
- const e3 = new Gm(this.loader), i2 = new Za.a(), n2 = { taskId: this.taskId, mode: this.mode, renderer: this.renderer, graphicsTexture: new Km(this.maxResolution), stageWidth: 0, stageHeight: 0, ticker: this.ticker, timingTargets: new $m(i2), eventHub: i2, view: this.view, medias: /* @__PURE__ */ Object.create(null), lastViewedIndex: 0, conflictTimeNodeManager: new Qm(), clock: this.clock, spriteTexture: e3, slideIndex: t2, objectPoolGroup: this.objPoolGroup, hasBackgroundFillShape: false, slideScopeEventHub: new Za.a(), logger: this.logger, sdfManager: this.sdfManager, loaderDelegate: this.loaderDelegate, runningAudio: this.runningAudio, activeMedia: this.activeMedia, isPlayerPaused: this.isPlayerPaused, timingEventHub: new Za.a(), maxResolution: this.maxResolution, animatedIds: /* @__PURE__ */ new Set(), volumeAdjuster: this.volumeAdjuster, forceCanvas: this.forceCanvas, globalEventHub: this.globalEventHub, latestChangeFullscreenTargetId: "", isRendering: false, urlInterrupter: this.urlInterrupter, enableWebAudio: this.enableWebAudio };
33607
+ const e3 = new Gm(this.loader), i2 = new Za.a(), n2 = { taskId: this.taskId, prefix: this.url, mode: this.mode, renderer: this.renderer, graphicsTexture: new Km(this.maxResolution), stageWidth: 0, stageHeight: 0, ticker: this.ticker, timingTargets: new $m(i2), eventHub: i2, view: this.view, medias: /* @__PURE__ */ Object.create(null), lastViewedIndex: 0, conflictTimeNodeManager: new Qm(), clock: this.clock, spriteTexture: e3, slideIndex: t2, objectPoolGroup: this.objPoolGroup, hasBackgroundFillShape: false, slideScopeEventHub: new Za.a(), logger: this.logger, sdfManager: this.sdfManager, loaderDelegate: this.loaderDelegate, runningAudio: this.runningAudio, activeMedia: this.activeMedia, isPlayerPaused: this.isPlayerPaused, timingEventHub: new Za.a(), maxResolution: this.maxResolution, animatedIds: /* @__PURE__ */ new Set(), volumeAdjuster: this.volumeAdjuster, forceCanvas: this.forceCanvas, globalEventHub: this.globalEventHub, latestChangeFullscreenTargetId: "", isRendering: false, urlInterrupter: this.urlInterrupter, enableWebAudio: this.enableWebAudio };
33598
33608
  this.stageCtxs[t2] = n2;
33599
33609
  }), "@StagePool[createCtx]");
33600
33610
  }
@@ -33896,11 +33906,15 @@ void main(void){
33896
33906
  this.app.view.addEventListener("mouseover", e4, false);
33897
33907
  const r3 = { handleEvent: () => {
33898
33908
  this.fullscreenOnMousemove({ index: i3, targetId: n3 });
33909
+ } }, o3 = { handleEvent: () => {
33910
+ var t5;
33911
+ null === (t5 = this.currentStage) || void 0 === t5 || t5.ctx.globalEventHub.emit("togglePlayStatus", n3);
33899
33912
  } };
33900
- this.app.view.addEventListener("mousemove", r3, false), this.cacheFunctionMap.set("mouseover", e4), this.cacheFunctionMap.set("mousemove", r3), this.cacheFunctionMap.set("mouseout", t4);
33913
+ this.app.view.addEventListener("mousemove", r3, false), this.app.view.addEventListener("click", o3, false), this.cacheFunctionMap.set("click", o3), this.cacheFunctionMap.set("mouseover", e4), this.cacheFunctionMap.set("mousemove", r3), this.cacheFunctionMap.set("mouseout", t4);
33901
33914
  } else {
33902
33915
  const t4 = { handleEvent: () => {
33903
- this.fullscreenOnMousemove({ index: i3, targetId: n3 });
33916
+ var t5;
33917
+ this.fullscreenOnMousemove({ index: i3, targetId: n3 }), null === (t5 = this.currentStage) || void 0 === t5 || t5.ctx.globalEventHub.emit("togglePlayStatus", n3);
33904
33918
  } };
33905
33919
  this.app.view.addEventListener("touchstart", t4, false), this.cacheFunctionMap.set("touchstart", t4);
33906
33920
  }
@@ -34217,7 +34231,7 @@ void main(void){
34217
34231
  });
34218
34232
  }
34219
34233
  clearFullscreenEventListenersWithAppView() {
34220
- ["mousemove", "mouseout", "mouseover", "touchstart", "pointerdown"].forEach((t2) => {
34234
+ ["mousemove", "click", "mouseout", "mouseover", "touchstart", "pointerdown"].forEach((t2) => {
34221
34235
  this.cacheFunctionMap.has(t2) && (this.app.view.removeEventListener(t2, this.cacheFunctionMap.get(t2), false), this.cacheFunctionMap.delete(t2));
34222
34236
  });
34223
34237
  }
@@ -36073,7 +36087,7 @@ void main(void){
36073
36087
  }
36074
36088
  var mT = { 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" }, gT = { taskId: "", url: "", currentSlideIndex: -1, mainSeqStep: -1, mainSeqState: null, mediaState: /* @__PURE__ */ Object.create(null), interactiveSeqState: /* @__PURE__ */ Object.create(null) }, vT = "";
36075
36089
  try {
36076
- vT = "1.4.17";
36090
+ vT = "1.4.19";
36077
36091
  } catch (t2) {
36078
36092
  vT = "dev";
36079
36093
  }
@@ -36092,7 +36106,7 @@ void main(void){
36092
36106
  return n3.frameResizeHandler();
36093
36107
  }), n3.timestamp = function() {
36094
36108
  return Date.now();
36095
- }, n3.mode = "local", n3.enableGlobalClick = false, n3.lastEmitedState = null, n3.playerController = null, n3.isInitResized = false, n3.cacheImage = document.createElement("img"), n3.isTouchStart = false, n3.touchStartId = void 0, n3.taskId = "", n3.volumeAdjuster = new Hy(), n3.designWidth = 0, n3.designHeight = 0, n3._slideCount = 0, n3._dispatchIncrId = 0, n3._receiveIncrId = 0, n3.resizeView = Ky()(n3._resizeView.bind(n3), 50), n3.handleViewClick = Ky()(n3._handleViewClick.bind(n3), 300), n3.resourceList = [], n3._updateVolumeByStaticAdjuster = function(t3) {
36109
+ }, n3.mode = "local", n3.enableGlobalClick = false, n3.lastEmitedState = null, n3.playerController = null, n3.isInitResized = false, n3.cacheImage = document.createElement("img"), n3.isTouchStart = false, n3.touchStartId = void 0, n3.taskId = "", n3.volumeAdjuster = new Hy(), n3.designWidth = 0, n3.designHeight = 0, n3._slideCount = 0, n3._dispatchIncrId = 0, n3._receiveIncrId = 0, n3.resizeView = Ky()(n3._resizeView.bind(n3), 50), n3.handleViewClick = Ky()(n3._handleViewClick.bind(n3), 300, { leading: true }), n3.resourceList = [], n3._updateVolumeByStaticAdjuster = function(t3) {
36096
36110
  n3.volumeAdjuster.volume = t3;
36097
36111
  }, n3.recoverHandler = function(t3) {
36098
36112
  if ("@slide/_recover_" === t3.data.type && t3.data.slideId === n3.randomId) {
@@ -36275,11 +36289,11 @@ void main(void){
36275
36289
  }, e2.prototype.initSlideConfig = function(t3) {
36276
36290
  return t3.timestamp && (this.timestamp = t3.timestamp), t3.rtcAudio && (Wy.RtcAudioClazz = t3.rtcAudio), false !== t3.enableWebAudio && (t3.enableWebAudio = true), this.mode = t3.mode, this.anchor = t3.anchor, this.anchor.appendChild(this.frame), this.enableGlobalClick = !$a()(t3.enableGlobalClick) && t3.enableGlobalClick, this.resize = t3.resize || false, this.interactive = t3.interactive, this.frame.style.cssText = t3.fixedFrameSize ? "width:" + t3.fixedFrameSize.width + "px;height:" + t3.fixedFrameSize.height + "px;" : "width:100%;height:100%", this.frame.style.cssText += "display:flex;justify-content:center;align-items:center;visibility:hidden;position:relative;z-index:1;", t3.fixedFrameSize && (this.frameWidth = t3.fixedFrameSize.width, this.frameHeight = t3.fixedFrameSize.height), t3;
36277
36291
  }, e2.prototype.initPlayer = function(t3) {
36278
- var e3, i3, n3, r2 = this, o2 = new Wy({ mode: this.mode, useLocalCache: !!$a()(this.config.useLocalCache) || this.config.useLocalCache, logger: this.logger, resourceTimeout: $a()(this.config.resourceTimeout) ? 15e3 : this.config.resourceTimeout, loadDelegate: this.config.loaderDelegate, volumeAdjuster: this.volumeAdjuster, urlInterrupter: this.urlInterrupter, tracker: this.tracker }, t3.renderOptions);
36292
+ var e3, i3, n3, r2 = this, o2 = new Wy({ mode: this.mode, useLocalCache: !!$a()(this.config.useLocalCache) || this.config.useLocalCache, logger: this.logger, resourceTimeout: $a()(this.config.resourceTimeout) ? 15e3 : this.config.resourceTimeout, loadDelegate: this.config.loaderDelegate, volumeAdjuster: this.volumeAdjuster, urlInterrupter: this.urlInterrupter, tracker: this.tracker, enableWebAudio: this.config.enableWebAudio }, t3.renderOptions);
36279
36293
  return o2.setInteractive(this.interactive), o2.updateConfig(t3.renderOptions || {}), o2.on(Vy.renderStart, function(t4) {
36280
36294
  r2.isLoading = true, r2.emit(mT.renderStart, t4), window.postMessage({ type: "@slide/_render_start_", taskId: r2.taskId, index: t4 }, "*");
36281
36295
  }), o2.on(Vy.renderEnd, function(t4) {
36282
- r2.isLoading = false, r2.player && (r2.designHeight = r2.player.designHeight, r2.designWidth = r2.player.designWidth, r2.cacheImage.style.width = r2.player.designWidth + "px", r2.cacheImage.style.height = r2.player.designHeight + "px", r2._slideCount = r2.player.slideCount), r2.emit(mT.renderEnd, t4), window.postMessage({ type: "@slide/_render_end_", taskId: r2.taskId, index: t4 }, "*");
36296
+ r2.isLoading = false, r2.player && (r2.designHeight = r2.player.designHeight, r2.designWidth = r2.player.designWidth, r2.cacheImage.style.width = r2.player.designWidth + "px", r2.cacheImage.style.height = r2.player.designHeight + "px", r2.cacheImage.style.maxWidth = r2.player.designWidth + "px", r2.cacheImage.style.minWidth = r2.player.designHeight + "px", r2._slideCount = r2.player.slideCount), r2.emit(mT.renderEnd, t4), window.postMessage({ type: "@slide/_render_end_", taskId: r2.taskId, index: t4 }, "*");
36283
36297
  }), o2.on(Vy.slideChange, function(t4) {
36284
36298
  r2.__slideState.currentSlideIndex = t4, r2.emitStateChange(), r2.emit(mT.slideChange, t4);
36285
36299
  }), o2.on(Vy.mainSeqStateChange, function(t4) {
@@ -39352,7 +39366,7 @@ class SlidePreviewer {
39352
39366
  }
39353
39367
  }
39354
39368
  const usePlugin = /* @__PURE__ */ Slide.Slide.usePlugin.bind(Slide.Slide);
39355
- const version = "0.2.65";
39369
+ const version = "0.2.67";
39356
39370
  const SlideApp = {
39357
39371
  kind: "Slide",
39358
39372
  setup(context) {