@netless/app-slide 0.2.71 → 0.2.72-alpha.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.
package/dist/main.es.js CHANGED
@@ -23051,7 +23051,7 @@ var Slide = function(t) {
23051
23051
  var th = i(96), eh = i.n(th), ih = i(97), nh = i.n(ih);
23052
23052
  class rh extends Nl {
23053
23053
  constructor() {
23054
- super(...arguments), this.duration = 1250, this.options = [], this.fragmentShader = nh.a, this.vertexShader = eh.a, this.verticalSegments = 100;
23054
+ super(...arguments), this.duration = 1250, this.options = [], this.fragmentShader = nh.a, this.vertexShader = eh.a, this.verticalSegments = 10;
23055
23055
  }
23056
23056
  addObjects(t2) {
23057
23057
  t2.add(this.mesh), t2.background = this.nextTexture;
@@ -29446,6 +29446,9 @@ void main() {
29446
29446
  Tg.matrix = [1, 0, 0, 0, 0.1, 0, 1, 0, 0, 0.1, 0, 0, 1, 0, 0.1, 0, 0, 0, 1, 0];
29447
29447
  const Eg = { darken: yg, darkenLess: xg, lightenLess: Tg, lighten: bg };
29448
29448
  class Sg extends lg {
29449
+ constructor(t2, e2, i2) {
29450
+ super({ position: { x: t2.x, y: t2.y }, width: t2.width, height: t2.height }, e2, i2), this.fillColorFilter = new vg(), this.fill = new ig(this), this.json = t2, this.ctx = e2, this.parentGlobalPos = i2.parentGlobalPos, this.global = { x: i2.parentGlobalPos.x + t2.x, y: i2.parentGlobalPos.y + t2.y }, this.updateTransform({ position: { x: t2.x, y: t2.y }, width: t2.width, height: t2.height });
29451
+ }
29449
29452
  get fillActive() {
29450
29453
  var t2, e2;
29451
29454
  return (null !== (e2 = null === (t2 = this.container.filters) || void 0 === t2 ? void 0 : t2.length) && void 0 !== e2 ? e2 : -1) > 0;
@@ -29454,9 +29457,6 @@ void main() {
29454
29457
  var e2, i2;
29455
29458
  t2 ? (null !== (i2 = null === (e2 = this.container.filters) || void 0 === e2 ? void 0 : e2.indexOf(this.fillColorFilter)) && void 0 !== i2 ? i2 : -1) < 0 && (this.container.filters = [this.fillColorFilter]) : this.container.filters = [];
29456
29459
  }
29457
- constructor(t2, e2, i2) {
29458
- super({ position: { x: t2.x, y: t2.y }, width: t2.width, height: t2.height }, e2, i2), this.fillColorFilter = new vg(), this.fill = new ig(this), this.json = t2, this.ctx = e2, this.parentGlobalPos = i2.parentGlobalPos, this.global = { x: i2.parentGlobalPos.x + t2.x, y: i2.parentGlobalPos.y + t2.y }, this.updateTransform({ position: { x: t2.x, y: t2.y }, width: t2.width, height: t2.height });
29459
- }
29460
29460
  get renderContainer() {
29461
29461
  return this.container;
29462
29462
  }
@@ -29993,6 +29993,9 @@ void main(void){
29993
29993
  }), i2;
29994
29994
  }
29995
29995
  class lv {
29996
+ constructor(t2, e2, i2, n2, r2) {
29997
+ this.ctx = t2, this.fillStyle = e2, this.width = i2, this.height = n2, this.config = r2, this.clonedObjects = [], this._displayObject = null, this.gradientHash = jm()(`${JSON.stringify(e2)}${Math.ceil(i2)}${Math.ceil(n2)}`);
29998
+ }
29996
29999
  get displayObject() {
29997
30000
  return this._displayObject || (this._displayObject = this.createDisplayObject()), this._displayObject;
29998
30001
  }
@@ -30002,9 +30005,6 @@ void main(void){
30002
30005
  get hasFill() {
30003
30006
  return !!this.fillStyle && "noFill" !== this.fillStyle.fillType;
30004
30007
  }
30005
- constructor(t2, e2, i2, n2, r2) {
30006
- this.ctx = t2, this.fillStyle = e2, this.width = i2, this.height = n2, this.config = r2, this.clonedObjects = [], this._displayObject = null, this.gradientHash = jm()(`${JSON.stringify(e2)}${Math.ceil(i2)}${Math.ceil(n2)}`);
30007
- }
30008
30008
  createDisplayObject() {
30009
30009
  var t2, e2;
30010
30010
  if (!this.fillStyle)
@@ -30210,9 +30210,6 @@ void main(void){
30210
30210
  });
30211
30211
  };
30212
30212
  class Nv extends Za.a {
30213
- get container() {
30214
- return this._targetContainer;
30215
- }
30216
30213
  constructor(t2, e2, i2, n2, r2, o2) {
30217
30214
  super(), this.effects = [], this.attachs = [], this.frames = /* @__PURE__ */ new Map(), this._targetContainer = new Oh.b(), this.frameCount = 1, this.ctx = n2, this.originWidth = t2.width, this.originHeight = t2.height, this.cacheKey = i2, this.sourceSprite = new ep();
30218
30215
  for (const i3 of e2)
@@ -30239,6 +30236,9 @@ void main(void){
30239
30236
  const s2 = new Lh.j(0, 0, this.originWidth, this.originHeight), a2 = this.effects.map((t3) => t3.filterAreaJustify(s2)), l2 = a2.map((t3) => t3.x), h2 = a2.map((t3) => t3.y), u2 = a2.map((t3) => t3.width), c2 = a2.map((t3) => t3.height);
30240
30237
  this.filterArea = new Lh.j(Math.min(...l2, 0), Math.min(...h2, 0), Math.max(...u2, this.originWidth), Math.max(...c2, this.originHeight)), this.sourceSprite.filters = this.effects, this.sourceSprite.filterArea = new Lh.j(0, 0, this.filterArea.width, this.filterArea.height), this._targetSprite = new ep(), this._targetSprite.name = "effect-sprite", this._targetContainer.sortableChildren = true, this._targetSprite.zIndex = 999, this._targetContainer.addChild(this._targetSprite);
30241
30238
  }
30239
+ get container() {
30240
+ return this._targetContainer;
30241
+ }
30242
30242
  getSdfTexture(t2, e2) {
30243
30243
  return Ov(this, void 0, void 0, function* () {
30244
30244
  const i2 = `${this.cacheKey}_${t2}`, n2 = this.effects.map((t3) => ({ sdfRect: t3.sdfBox(e2.width, e2.height) })).reduce((t3, e3) => e3.sdfRect ? (t3.width < e3.sdfRect.width && (t3.width = e3.sdfRect.width), t3.height < e3.sdfRect.height && (t3.height = e3.sdfRect.height), t3) : t3, new Lh.j(0, 0));
@@ -30669,6 +30669,12 @@ void main(void){
30669
30669
  });
30670
30670
  };
30671
30671
  class Yv {
30672
+ constructor(t2, e2, i2, n2, r2) {
30673
+ var o2;
30674
+ this.iterateElements = [], this.paragraphs = [], this.effectList = [], this.container = new Oh.b(), this.textContainer = new Oh.b(), this.textColorFilter = new vg(), this.json = t2, this.ctx = e2, this.shapeRotation = r2, this.parentGlobalPos = n2, this.iterateType = i2, this.container.name = "textBody", this.global = { x: this.parentGlobalPos.x + t2.position.x, y: this.parentGlobalPos.y + t2.position.y }, this.container.position.x = t2.position.x, this.container.position.y = t2.position.y, this.container.scale.x = t2.scale.x, this.container.scale.y = t2.scale.y;
30675
+ const s2 = new Jd();
30676
+ s2.drawRect(0, 0, t2.width, t2.height), this.container.addChild(s2), this.container.addChild(this.textContainer), this.textColorFilter.currentColor = "#000000FF", this.textColorFilter.designColor = "#000000FF", this.effectList = null !== (o2 = t2.effectList) && void 0 !== o2 ? o2 : [];
30677
+ }
30672
30678
  get width() {
30673
30679
  return this.json.width;
30674
30680
  }
@@ -30696,12 +30702,6 @@ void main(void){
30696
30702
  var e2;
30697
30703
  "true" === t2 ? (null !== (e2 = this.container.filters) && void 0 !== e2 ? e2 : []).indexOf(this.textColorFilter) < 0 && (this.container.filters = [this.textColorFilter]) : this.container.filters = [];
30698
30704
  }
30699
- constructor(t2, e2, i2, n2, r2) {
30700
- var o2;
30701
- this.iterateElements = [], this.paragraphs = [], this.effectList = [], this.container = new Oh.b(), this.textContainer = new Oh.b(), this.textColorFilter = new vg(), this.json = t2, this.ctx = e2, this.shapeRotation = r2, this.parentGlobalPos = n2, this.iterateType = i2, this.container.name = "textBody", this.global = { x: this.parentGlobalPos.x + t2.position.x, y: this.parentGlobalPos.y + t2.position.y }, this.container.position.x = t2.position.x, this.container.position.y = t2.position.y, this.container.scale.x = t2.scale.x, this.container.scale.y = t2.scale.y;
30702
- const s2 = new Jd();
30703
- s2.drawRect(0, 0, t2.width, t2.height), this.container.addChild(s2), this.container.addChild(this.textContainer), this.textColorFilter.currentColor = "#000000FF", this.textColorFilter.designColor = "#000000FF", this.effectList = null !== (o2 = t2.effectList) && void 0 !== o2 ? o2 : [];
30704
- }
30705
30705
  getTextElement(t2, e2) {
30706
30706
  return "paragraph" === t2 ? this.paragraphs[e2[0]] : null;
30707
30707
  }
@@ -30851,12 +30851,12 @@ void main(void){
30851
30851
  }
30852
30852
  }
30853
30853
  class Zv {
30854
- get displayObject() {
30855
- return this._displayObject;
30856
- }
30857
30854
  constructor(t2, e2, i2, n2, r2, o2, s2, a2, l2, h2, u2) {
30858
30855
  this.id = t2, this.ctx = e2, this.paths = i2, this.hash = n2, this.nept = r2, this.width = o2, this.height = s2, this.lineStyle = a2, this.shouldFill = l2, this.bgColor = h2, this.lnColor = u2, this.clonedObjects = [], this._displayObject = null, this.isRectangle = false, this.isPureRect = false, this.isColoredPureRect = false, this.isRectangle = this.rectangleDetect(i2), this.isRectangle && l2 ? this.bgColor ? this.isColoredPureRect = true : this.isPureRect = true : this.ctx.graphicsTexture.addGraphics(this.id, this.paths, this.hash, this.nept, this.width, this.height, this.lineStyle, this.ctx.objectPoolGroup, this.shouldFill, this.bgColor, this.lnColor);
30859
30856
  }
30857
+ get displayObject() {
30858
+ return this._displayObject;
30859
+ }
30860
30860
  pointDis(t2, e2) {
30861
30861
  return Math.pow(t2.x - e2.x, 2) + Math.pow(t2.y - e2.y, 2);
30862
30862
  }
@@ -31290,9 +31290,6 @@ void main(void){
31290
31290
  }
31291
31291
  const h_ = { medianContainerClass: "median-container", hoverHiddeDelay: 1500, portalWidth: 300, portalHeight: 50, hiddenOpacity: "0", hoverOpacity: "1", opacityAnimationTime: 0.4 };
31292
31292
  class u_ {
31293
- get clippedDuration() {
31294
- return this.duration;
31295
- }
31296
31293
  constructor(t2) {
31297
31294
  var e2, i2;
31298
31295
  this.progress = document.createElement("div"), this.totalTime = document.createElement("span"), this.playButton = document.createElement("div"), this.pauseButton = document.createElement("div"), this.currentTime = document.createElement("span"), this.mediaController = document.createElement("div"), this.currentProgress = document.createElement("div"), this.fullScreenButton = document.createElement("div"), this.exitFullScreenButton = document.createElement("div"), this.medianIsEnd = false, this.pickBookmarkIndex = 0, this.playCallBackList = [], this.duration = 0, this.isVideo = false, this.start = 0, this.end = 0, this.fullscreenStatus = false, this.fadeState = { in: false, out: false }, this.changeMediaProgress = (t3) => {
@@ -31355,6 +31352,9 @@ void main(void){
31355
31352
  t3 === this.targetId && (this.media.isPlaying ? this.pauseMediaFromCtrl(false) : this.playMediaFromCtrl(false));
31356
31353
  });
31357
31354
  }
31355
+ get clippedDuration() {
31356
+ return this.duration;
31357
+ }
31358
31358
  getMedianContainer() {
31359
31359
  var t2;
31360
31360
  const { medianContainerClass: e2 } = h_;
@@ -31505,8 +31505,10 @@ void main(void){
31505
31505
  this.emit("resumeAllAudioInterruptByAudioSessionChanged");
31506
31506
  })) : window.__pcmProxy ? (this.domAudio = document.createElement("audio"), this.domAudio.src = t2, this.domAudio.crossOrigin = "anonymous", this.domAudio.addEventListener("pause", () => {
31507
31507
  this.emit("pause");
31508
- }), this.pcmSource = window.__pcmProxy.connect(this.domAudio), this.domAudio.addEventListener("playing", () => {
31509
- this.emit("load"), this.startTimeChangeEmit(), this.emit("play");
31508
+ }), this.pcmSource = window.__pcmProxy.connect(this.domAudio), this.domAudio.addEventListener("loadedmetadata", () => {
31509
+ this.emit("load");
31510
+ }), this.domAudio.addEventListener("playing", () => {
31511
+ this.startTimeChangeEmit(), this.emit("play");
31510
31512
  })) : (this.howl = new c_.Howl({ src: [t2], html5: null == n2 ? void 0 : n2.enableWebAudio }), [this.staticEventId] = this.howl._getSoundIds(), this.howl.load(), this.howl.on("load", () => {
31511
31513
  this.isHowlLoadEmit = true, this.emit("load");
31512
31514
  }), this.howl.on("pause", () => this.emit("pause")), this.howl.on("play", () => {
@@ -31587,27 +31589,6 @@ void main(void){
31587
31589
  });
31588
31590
  };
31589
31591
  class f_ extends Za.a {
31590
- get videoElement() {
31591
- return this.videoResource.source;
31592
- }
31593
- get currentTime() {
31594
- var t2, e2;
31595
- return null !== (e2 = null === (t2 = this.videoElement) || void 0 === t2 ? void 0 : t2.currentTime) && void 0 !== e2 ? e2 : 0;
31596
- }
31597
- set currentTime(t2) {
31598
- this.videoElement && (this.videoElement.currentTime = t2), this.rtcAudio && (this.rtcAudio.currentTime = t2);
31599
- }
31600
- get paused() {
31601
- var t2, e2;
31602
- return null === (e2 = null === (t2 = this.videoElement) || void 0 === t2 ? void 0 : t2.paused) || void 0 === e2 || e2;
31603
- }
31604
- get duration() {
31605
- var t2, e2;
31606
- return null !== (e2 = null === (t2 = this.videoElement) || void 0 === t2 ? void 0 : t2.duration) && void 0 !== e2 ? e2 : 0;
31607
- }
31608
- get clippedDuration() {
31609
- return this.controller.clippedDuration;
31610
- }
31611
31592
  constructor(t2) {
31612
31593
  var e2, i2, n2, r2, o2, s2, a2;
31613
31594
  super(), this.type = "video", this.sprite = new ep(), this.rtcAudio = null, this.isPlaying = false, this.isGlobalPause = false, this.fullscreen = false, this.url = "", this.isLoaded = false, this.onVideoResourceLoaded = () => {
@@ -31654,6 +31635,27 @@ void main(void){
31654
31635
  });
31655
31636
  }), this.ctx.activeMedia.add(this), this.ctx.volumeAdjuster.on("update", this.updateVolume), this.ctx.globalEventHub.on("syncFullscreenVideoState", this.syncFullscreenVideoState);
31656
31637
  }
31638
+ get videoElement() {
31639
+ return this.videoResource.source;
31640
+ }
31641
+ get currentTime() {
31642
+ var t2, e2;
31643
+ return null !== (e2 = null === (t2 = this.videoElement) || void 0 === t2 ? void 0 : t2.currentTime) && void 0 !== e2 ? e2 : 0;
31644
+ }
31645
+ set currentTime(t2) {
31646
+ this.videoElement && (this.videoElement.currentTime = t2), this.rtcAudio && (this.rtcAudio.currentTime = t2);
31647
+ }
31648
+ get paused() {
31649
+ var t2, e2;
31650
+ return null === (e2 = null === (t2 = this.videoElement) || void 0 === t2 ? void 0 : t2.paused) || void 0 === e2 || e2;
31651
+ }
31652
+ get duration() {
31653
+ var t2, e2;
31654
+ return null !== (e2 = null === (t2 = this.videoElement) || void 0 === t2 ? void 0 : t2.duration) && void 0 !== e2 ? e2 : 0;
31655
+ }
31656
+ get clippedDuration() {
31657
+ return this.controller.clippedDuration;
31658
+ }
31657
31659
  showController() {
31658
31660
  this.controller.show();
31659
31661
  }
@@ -32753,10 +32755,11 @@ void main(void){
32753
32755
  }
32754
32756
  function Ty(t2) {
32755
32757
  return function(t3) {
32756
- return !!(null == t3 ? void 0 : t3.cBhvr);
32757
- }(t2) ? t2.cBhvr.ctn : function(t3) {
32758
32758
  var e2;
32759
- return !!(null === (e2 = null == t3 ? void 0 : t3.cMediaNode) || void 0 === e2 ? void 0 : e2.ctn);
32759
+ return !!(null === (e2 = t3) || void 0 === e2 ? void 0 : e2.cBhvr);
32760
+ }(t2) ? t2.cBhvr.ctn : function(t3) {
32761
+ var e2, i2;
32762
+ return !!(null === (i2 = null === (e2 = t3) || void 0 === e2 ? void 0 : e2.cMediaNode) || void 0 === i2 ? void 0 : i2.ctn);
32760
32763
  }(t2) ? t2.cMediaNode.ctn : t2.ctn;
32761
32764
  }
32762
32765
  var Ey = function(t2, e2, i2, n2) {
@@ -33927,17 +33930,6 @@ void main(void){
33927
33930
  Ph.skipHello();
33928
33931
  const Wy = { randomBar: "RandomLines", circle: "Shape", ripple: "Ripples", wipe: "Erase", dissolve: "Dissolve", morph: "Smooth", fade: "FadeInOut", push: "Push", split: "Separation", reveal: "Display", pull: "Uncover", cover: "Cover", flash: "Flash", checker: "Checkerboard", blinds: "WindowShades", curtains: "Curtain", fallOver: "Fall", drape: "Suspension", wheel: "Clock", comb: "Combing", warp: "Scale", peelOff: "PeelOff", flip: "Flip", gallery: "Gallery", switch: "Switch", prism: "Prism", doors: "Doors" }, Xy = { mainSeqStepChange: "mainSeqStepChange", mainSeqStateChange: "mainSeqStateChange", interactiveSeqStateChange: "interactiveSeqStateChange", interactiveSeqAction: "interactiveSeqAction", mainSeqStepStart: "mainSeqStepStart", mainSeqStepEnd: "mainSeqStepEnd", slideChange: "slideChange", renderStart: "renderStart", renderEnd: "renderEnd", hyperlinkTrigger: "hyperlinkTrigger", animateStart: "animateStart", animateEnd: "animateEnd", mediaSeek: "mediaSeek", mediaPlay: "mediaPlay", mediaPause: "mediaPause", mediaStop: "mediaStop", requestNextStep: "requestNextStep", requestNextSlide: "requestNextSlide", requestPrevSlide: "requestPrevSlide", requestGotoSlide: "requestGotoSlide", requestOpenUrl: "requestOpenUrl", userInput: "userInput", fullscreenChange: "fullscreenChange", changeLocalFullscreenState: "changeLocalFullscreenState" };
33929
33932
  class Yy extends Za.a {
33930
- get view() {
33931
- return this.app.renderer ? this.app.view : null;
33932
- }
33933
- get nextSlideIndex() {
33934
- var t2;
33935
- return (null === (t2 = this.currentStage) || void 0 === t2 ? void 0 : t2.json.nextIndex) ? this.currentStage.json.nextIndex : this.currentIndex + 1;
33936
- }
33937
- get prevSlideIndex() {
33938
- var t2;
33939
- return (null === (t2 = this.currentStage) || void 0 === t2 ? void 0 : t2.json.prevIndex) ? this.currentStage.json.prevIndex : this.currentIndex - 1;
33940
- }
33941
33933
  constructor(t2, e2 = {}) {
33942
33934
  super(), this.errorChannel = new Za.a(), this.transactionPlayer = null, this.isForward = true, this.drawCall = 0, this.scale = 1, this._isPaused = false, this.maxResolution = new Lh.g(0, 0), this.transitionResolution = new Lh.g(0, 0), this.isNVIDIA = false, this.fps = new bm(), this.designWidth = 0, this.designHeight = 0, this.currentIndex = 0, this.slideCount = 0, this.runtime = { drawCall: 0, fps: 0 }, this.globalEventHub = new Za.a(), this.globalVideoBackground = new Jd(), this.globalVideoSprite = new ep(), this.onMousemoveTimeout = null, this.cacheFunctionMap = /* @__PURE__ */ new Map(), this.enableAutoForward = false, this.isPlayerPaused = () => this._isPaused, this.onWebGLLost = () => {
33943
33935
  this.errorChannel.emit("error", new Tm(gm.CanvasCrash, "webgl context lost."));
@@ -34030,6 +34022,17 @@ void main(void){
34030
34022
  this.startAutoForwardTimer(this.currentStage);
34031
34023
  });
34032
34024
  }
34025
+ get view() {
34026
+ return this.app.renderer ? this.app.view : null;
34027
+ }
34028
+ get nextSlideIndex() {
34029
+ var t2;
34030
+ return (null === (t2 = this.currentStage) || void 0 === t2 ? void 0 : t2.json.nextIndex) ? this.currentStage.json.nextIndex : this.currentIndex + 1;
34031
+ }
34032
+ get prevSlideIndex() {
34033
+ var t2;
34034
+ return (null === (t2 = this.currentStage) || void 0 === t2 ? void 0 : t2.json.prevIndex) ? this.currentStage.json.prevIndex : this.currentIndex - 1;
34035
+ }
34033
34036
  getMaxResolution(t2) {
34034
34037
  return !$a()(t2) && Number.isInteger(t2) ? (t2 < 1 && (t2 = 1), t2 > 4 && (t2 = 4), t2) : Yy.platform.isAndroid() || Yy.platform.isIOS() ? 2 : 4;
34035
34038
  }
@@ -36212,9 +36215,9 @@ void main(void){
36212
36215
  }
36213
36216
  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" }, _T = { taskId: "", url: "", currentSlideIndex: -1, mainSeqStep: -1, mainSeqState: null, mediaState: /* @__PURE__ */ Object.create(null), interactiveSeqState: /* @__PURE__ */ Object.create(null) }, yT = "";
36214
36217
  try {
36215
- yT = "1.4.31-alpha.3";
36218
+ yT = "1.4.31";
36216
36219
  } catch (t2) {
36217
- yT = "-dev";
36220
+ yT = "-dev-";
36218
36221
  }
36219
36222
  var xT = null;
36220
36223
  try {
@@ -39501,7 +39504,7 @@ class SlidePreviewer {
39501
39504
  }
39502
39505
  }
39503
39506
  const usePlugin = /* @__PURE__ */ Slide.Slide.usePlugin.bind(Slide.Slide);
39504
- const version = "0.2.71";
39507
+ const version = "0.2.72-alpha.0";
39505
39508
  const SlideApp = {
39506
39509
  kind: "Slide",
39507
39510
  setup(context) {