@netless/app-slide 0.2.88 → 0.2.89

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
@@ -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.43";
36504
+ xT = "1.4.44";
36505
36505
  } catch (t2) {
36506
36506
  xT = "-dev-";
36507
36507
  }
@@ -36928,7 +36928,7 @@ void main(void){
36928
36928
  case 0:
36929
36929
  return this.renderingIndex = t3, this.player && t3 === this.player.currentIndex ? [2] : ((Yy.platform.isIOS() || Yy.platform.isAndroid()) && this.iosResetCache.indexOf(t3) < 0 && this.iosResetCache.push(t3), this.flushDebounce(), [4, null === (e3 = this.player) || void 0 === e3 ? void 0 : e3.renderSlide(t3)]);
36930
36930
  case 1:
36931
- return n3.sent(), this.__slideState.currentSlideIndex = t3, this.resizeView(), this.__slideState.interactiveSeqState = {}, this.__slideState.mediaState = {}, this.emitStateChange(), setTimeout(function() {
36931
+ return n3.sent(), this.__slideState.currentSlideIndex = t3, this._resizeView(), this.__slideState.interactiveSeqState = {}, this.__slideState.mediaState = {}, this.emitStateChange(), setTimeout(function() {
36932
36932
  var t4, e4;
36933
36933
  "hidden" === (null === (e4 = null === (t4 = i3.player) || void 0 === t4 ? void 0 : t4.view) || void 0 === e4 ? void 0 : e4.style.visibility) && (i3.player.view.style.visibility = "visible"), "hidden" === i3.frame.style.visibility && (i3.frame.style.visibility = "visible"), i3.cacheImage.style.display = "none";
36934
36934
  }, 100), [2];
@@ -39454,6 +39454,7 @@ class ResizableContainer {
39454
39454
  this.resizeObserver = null;
39455
39455
  this.slideWidth = 1;
39456
39456
  this.slideHeight = 1;
39457
+ this.scrollBar = null;
39457
39458
  this.translateX = 0.5;
39458
39459
  this.translateY = 0.5;
39459
39460
  this.lastTriggerTime = 0;
@@ -39470,7 +39471,7 @@ class ResizableContainer {
39470
39471
  }
39471
39472
  }
39472
39473
  };
39473
- this.enableResize = enableResize || true;
39474
+ this.enableResize = enableResize;
39474
39475
  this.parent = parent;
39475
39476
  this.context = context;
39476
39477
  this.root = document.createElement("div");
@@ -39489,7 +39490,9 @@ class ResizableContainer {
39489
39490
  this.container.setAttribute("data-resizable-container", "true");
39490
39491
  this.scrollContainer.appendChild(this.container);
39491
39492
  this.root.appendChild(this.scrollContainer);
39492
- this.scrollBar = new ScrollBar(this.root, this);
39493
+ if (this.enableResize) {
39494
+ this.scrollBar = new ScrollBar(this.root, this);
39495
+ }
39493
39496
  this.resizeObserver = new ResizeObserver(() => {
39494
39497
  this.updateResizableContainer();
39495
39498
  });
@@ -39518,7 +39521,7 @@ class ResizableContainer {
39518
39521
  const parentBounds = this.scrollContainer.getBoundingClientRect();
39519
39522
  this.container.style.width = `${parentBounds.width * this.scale}px`;
39520
39523
  this.container.style.height = `${parentBounds.height * this.scale}px`;
39521
- if (this.whiteboardContainer) {
39524
+ if (this.whiteboardContainer && this.enableResize) {
39522
39525
  const whiteboardBounds = this.whiteboardContainer.getBoundingClientRect();
39523
39526
  if (whiteboardBounds.width / whiteboardBounds.height > this.slideWidth / this.slideHeight) {
39524
39527
  const renderWidth = whiteboardBounds.height * this.slideWidth / this.slideHeight;
@@ -39539,6 +39542,7 @@ class ResizableContainer {
39539
39542
  });
39540
39543
  }
39541
39544
  handleNormalizeTranslate(x, y, options) {
39545
+ var _a;
39542
39546
  if (Math.abs(x - this.translateX) < 1e-3 && Math.abs(y - this.translateY) < 1e-3 && !options.triggerSync) {
39543
39547
  return;
39544
39548
  }
@@ -39550,14 +39554,14 @@ class ResizableContainer {
39550
39554
  this.translateY = y;
39551
39555
  this.container.style.transform = `translate(${translateX}px, ${translateY}px)`;
39552
39556
  if (options.triggerScrollBar) {
39553
- this.scrollBar.handleNormalizeTranslate(x, y);
39557
+ (_a = this.scrollBar) == null ? void 0 : _a.handleNormalizeTranslate(x, y);
39554
39558
  }
39555
39559
  if (options.triggerSync) {
39556
39560
  this.context.storage.setState({ translateX: this.translateX, translateY: this.translateY });
39557
39561
  }
39558
39562
  }
39559
39563
  scaleContainer(applyScale) {
39560
- if (Math.abs(this.scale - applyScale) < 1e-3) {
39564
+ if (Math.abs(this.scale - applyScale) < 1e-3 || !this.enableResize) {
39561
39565
  return;
39562
39566
  }
39563
39567
  if (applyScale > 1) {
@@ -40227,7 +40231,7 @@ class SlidePreviewer {
40227
40231
  }
40228
40232
  }
40229
40233
  const usePlugin = /* @__PURE__ */ Slide.Slide.usePlugin.bind(Slide.Slide);
40230
- const version = "0.2.88";
40234
+ const version = "0.2.89";
40231
40235
  const SlideApp = {
40232
40236
  kind: "Slide",
40233
40237
  setup(context) {