@netless/app-slide 0.2.90 → 0.2.91

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
@@ -10711,7 +10711,7 @@ var Slide = function(t) {
10711
10711
  }, function(t, e) {
10712
10712
  t.exports = "vec4 blendSrcOver(vec4 src, vec4 dist) {\n vec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n src.r *= src.a;\n src.g *= src.a;\n src.b *= src.a;\n result.a = src.a + (dist.a * (1.0 - src.a));\n result.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n result.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n result.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n return result;\n}\nprecision mediump float;\nvarying vec2 vTextureCoord;\nvarying vec2 filterCoord;\nuniform vec4 uShapeFilterArea;\nuniform sampler2D uSampler;\nuniform sampler2D uSdfSampler;\nuniform float uSdfIsReady;\nuniform float uSdfMaxDis;\nuniform float uRad;\nuniform vec4 uGlowColor;\nuniform vec2 uSdfPosition;\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\nvoid main() {\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n vec4 glowColor = vec4(uGlowColor.rgb * uGlowColor.a, uGlowColor.a);\n float a = 1.0;\n if (uSdfIsReady > 0.0) {\n vec2 cod = vec2(filterCoord.x / uShapeFilterArea.z, filterCoord.y / uShapeFilterArea.w);\n vec4 sdfColor = texture2D(uSdfSampler, cod + uSdfPosition);\n float dis = sdfColor.a * uSdfMaxDis;\n if ((sdfColor.r <= 0.0) && (dis >= (uRad * 0.5))) {\n a = 1.0 - smoothstep(uRad * 0.5, uRad, dis);\n }\n }\n vec4 resultColor = blendSrcOver(texColor, glowColor);\n resultColor.rgb *= resultColor.a;\n resultColor.rgb *= a;\n resultColor.a *= a;\n gl_FragColor = uSdfIsReady > 0.0 ? resultColor : texColor;\n}\n";
10713
10713
  }, function(t, e) {
10714
- t.exports = "precision mediump float;\nvarying vec2 vTextureCoord;\nvarying vec2 filterCoord;\nuniform vec4 uShapeFilterArea;\nuniform sampler2D uSampler;\nuniform sampler2D uSdfSampler;\nuniform float uSdfIsReady;\nuniform float uSdfMaxDis;\nuniform float uRad;\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\nvoid main() {\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n float alpha = texColor.a;\n texColor /= texColor.a;\n if (uSdfIsReady > 0.0) {\n float dx = uShapeFilterArea.x < 0.0 ? -uShapeFilterArea.x : 0.0;\n float dy = uShapeFilterArea.y < 0.0 ? -uShapeFilterArea.y : 0.0;\n vec2 cod = vec2((filterCoord.x + dx) / uShapeFilterArea.z, (filterCoord.y + dy) / uShapeFilterArea.w);\n vec4 sdfColor = texture2D(uSdfSampler, cod);\n float dis = sdfColor.a * uSdfMaxDis;\n if (texColor.a > 0.0392156862745098) {\n if (dis <= (uRad / 2.0)) {\n float a = smoothstep(0.0, uRad / 2.0, dis) * 0.1;\n texColor.rgb *= a;\n texColor.a = a;\n }\n else if ((dis > (uRad / 2.0)) && (dis < (uRad * 1.2))) {\n float a = (smoothstep(uRad / 2.0, uRad * 1.2, dis) * 0.9) + 0.1;\n texColor.rgb *= a;\n texColor.a = a;\n }\n }\n else {\n texColor.rgba *= 0.0;\n }\n }\n texColor *= alpha;\n gl_FragColor = texColor;\n}\n";
10714
+ t.exports = "precision mediump float;\nvarying vec2 vTextureCoord;\nvarying vec2 filterCoord;\nuniform vec4 uShapeFilterArea;\nuniform sampler2D uSampler;\nuniform sampler2D uSdfSampler;\nuniform float uSdfIsReady;\nuniform float uSdfMaxDis;\nuniform float uRad;\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\nvoid main() {\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n float alpha = max(texColor.a, 0.00001);\n texColor /= alpha;\n if (uSdfIsReady > 0.5) {\n float dx = uShapeFilterArea.x < 0.0 ? -uShapeFilterArea.x : 0.0;\n float dy = uShapeFilterArea.y < 0.0 ? -uShapeFilterArea.y : 0.0;\n vec2 cod = vec2((filterCoord.x + dx) / uShapeFilterArea.z, (filterCoord.y + dy) / uShapeFilterArea.w);\n vec4 sdfColor = texture2D(uSdfSampler, cod);\n float dis = sdfColor.a * uSdfMaxDis;\n if (texColor.a > 0.0392156862745098) {\n if (dis <= (uRad / 2.0)) {\n float a = smoothstep(0.0, uRad / 2.0, dis) * 0.1;\n texColor.rgb *= a;\n texColor.a = a;\n }\n else if ((dis > (uRad / 2.0)) && (dis < (uRad * 1.2))) {\n float a = (smoothstep(uRad / 2.0, uRad * 1.2, dis) * 0.9) + 0.1;\n texColor.rgb *= a;\n texColor.a = a;\n }\n }\n else {\n texColor.rgba *= 0.0;\n }\n }\n texColor *= alpha;\n gl_FragColor = texColor;\n}\n";
10715
10715
  }, function(t, e) {
10716
10716
  t.exports = "varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nvoid main() {\n vec4 sourceColor = texture2D(uSampler, vTextureCoord);\n if (sourceColor.a == 0.0) {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n else {\n gl_FragColor = uColor * sourceColor.a;\n }\n}\n";
10717
10717
  }, function(t, e) {
@@ -30083,7 +30083,7 @@ void main(void){
30083
30083
  var mv = i(19), gv = i.n(mv), vv = i(115), _v = i.n(vv);
30084
30084
  class yv extends hv {
30085
30085
  constructor(t2) {
30086
- super(gv.a, _v.a, { uShapeFilterArea: new Float32Array([0, 0, 0, 0]), uRad: t2.rad, uSdfSampler: Vh.t.WHITE, uSdfReady: 0, uSdfMaxDis: 1 }), this.priority = 2, this.json = t2;
30086
+ super(gv.a, _v.a, { uShapeFilterArea: new Float32Array([0, 0, 0, 0]), uRad: t2.rad, uSdfSampler: Vh.t.WHITE, uSdfIsReady: 0, uSdfMaxDis: 0 }), this.priority = 2, this.json = t2;
30087
30087
  }
30088
30088
  filterAreaJustify(t2) {
30089
30089
  return t2;
@@ -31336,7 +31336,7 @@ void main(void){
31336
31336
  t3.stopPropagation(), this.hide();
31337
31337
  }, this.mediaTimeUpdate = () => a_(this, void 0, void 0, function* () {
31338
31338
  const t3 = this.media.currentTime - this.start;
31339
- if (console.log(t3, this.duration), this.duration < 0.5 ? this.duration > 0 && t3 >= this.duration && (yield this.pauseMedia(), this.medianIsEnd = true, this.jumpToTime(), this.ctx.eventHub.emit(Xy.mediaStop, { id: this.targetId }), this.onClickCancelFullScreenButtonHandle()) : this.duration > 0 && (Math.abs(t3 - this.duration) < 0.3 || t3 > this.duration) && (yield this.pauseMedia(), this.medianIsEnd = true, this.jumpToTime(), this.ctx.eventHub.emit(Xy.mediaStop, { id: this.targetId }), this.onClickCancelFullScreenButtonHandle()), this.currentTime.innerText = u_.formatTime(t3), this.currentProgress.style.flex = (t3 / this.duration).toString(), this.bookmarkList && this.bookmarkList.length > 0) {
31339
+ if (this.duration < 0.5 ? this.duration > 0 && t3 >= this.duration && (yield this.pauseMedia(), this.medianIsEnd = true, this.jumpToTime(), this.ctx.eventHub.emit(Xy.mediaStop, { id: this.targetId }), this.onClickCancelFullScreenButtonHandle()) : this.duration > 0 && (Math.abs(t3 - this.duration) < 0.3 || t3 > this.duration) && (yield this.pauseMedia(), this.medianIsEnd = true, this.jumpToTime(), this.ctx.eventHub.emit(Xy.mediaStop, { id: this.targetId }), this.onClickCancelFullScreenButtonHandle()), this.currentTime.innerText = u_.formatTime(t3), this.currentProgress.style.flex = (t3 / this.duration).toString(), this.bookmarkList && this.bookmarkList.length > 0) {
31340
31340
  const t4 = this.bookmarkList[this.pickBookmarkIndex];
31341
31341
  t4 && t4.time.toFixed(0) === this.media.currentTime.toFixed(0) && (this.ctx.timingEventHub.emit(`shape ${this.shapeId} onMediaBookmark ${t4.name}`), this.pickBookmarkIndex += 1);
31342
31342
  }
@@ -33616,7 +33616,7 @@ void main(void){
33616
33616
  const e3 = this.renderer.plugins.extract.image(t2, "image/png");
33617
33617
  e3.addEventListener("load", () => {
33618
33618
  this.createSdfByWorker(o2, s2, t2.width, t2.height, n2, r2, e3, i2);
33619
- }), e3.addEventListener("error", () => null), yield Pm(() => !!this.outputData.has(i2), 2e3), this.loadingSdfKeys.delete(i2);
33619
+ }), e3.addEventListener("error", () => null), yield Pm(() => !!this.outputData.has(i2), 5e3), this.loadingSdfKeys.delete(i2);
33620
33620
  const h2 = this.outputData.get(i2);
33621
33621
  if (h2) {
33622
33622
  this.outputData.delete(i2);
@@ -36501,7 +36501,7 @@ void main(void){
36501
36501
  }
36502
36502
  var _T = { 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" }, yT = { taskId: "", url: "", currentSlideIndex: -1, mainSeqStep: -1, mainSeqState: null, mediaState: /* @__PURE__ */ Object.create(null), interactiveSeqState: /* @__PURE__ */ Object.create(null) }, xT = "";
36503
36503
  try {
36504
- xT = "1.4.44";
36504
+ xT = "1.4.45";
36505
36505
  } catch (t2) {
36506
36506
  xT = "-dev-";
36507
36507
  }
@@ -40226,7 +40226,7 @@ class SlidePreviewer {
40226
40226
  }
40227
40227
  }
40228
40228
  const usePlugin = /* @__PURE__ */ Slide.Slide.usePlugin.bind(Slide.Slide);
40229
- const version = "0.2.90";
40229
+ const version = "0.2.91";
40230
40230
  const SlideApp = {
40231
40231
  kind: "Slide",
40232
40232
  setup(context) {