@netless/app-presentation 0.1.9-beta.4 → 0.1.9-beta.5

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.
@@ -6922,9 +6922,8 @@ var NetlessAppPresentation = (function (exports) {
6922
6922
  }
6923
6923
  setReadonly(bol) {
6924
6924
  this.readonly = bol;
6925
- if (this.readonly) {
6926
- this.destroy();
6927
- } else {
6925
+ this.destroy();
6926
+ if (!this.readonly) {
6928
6927
  this.init();
6929
6928
  }
6930
6929
  }
@@ -6989,16 +6988,27 @@ var NetlessAppPresentation = (function (exports) {
6989
6988
  this.onCameraUpdated();
6990
6989
  }
6991
6990
  destroy() {
6992
- var _a, _b, _c, _d;
6993
6991
  this.view.callbacks.off("onCameraUpdated", this.onCameraUpdated);
6994
- (_a = this.scrollbarX) == null ? void 0 : _a.remove();
6995
- (_b = this.scrollbarY) == null ? void 0 : _b.remove();
6996
- this.scrollbarX = void 0;
6997
- this.scrollbarY = void 0;
6998
- (_c = this.draggableX) == null ? void 0 : _c.destroy();
6999
- (_d = this.draggableY) == null ? void 0 : _d.destroy();
7000
- this.draggableX = void 0;
7001
- this.draggableY = void 0;
6992
+ if (this.scrollbarX && this.scrollbarContainerX) {
6993
+ this.scrollbarContainerX.removeChild(this.scrollbarX);
6994
+ this.scrollbarX.remove();
6995
+ this.scrollbarContainerX.remove();
6996
+ this.scrollbarX = void 0;
6997
+ }
6998
+ if (this.scrollbarY && this.scrollbarContainerY) {
6999
+ this.scrollbarContainerY.removeChild(this.scrollbarY);
7000
+ this.scrollbarY.remove();
7001
+ this.scrollbarContainerY.remove();
7002
+ this.scrollbarY = void 0;
7003
+ }
7004
+ if (this.draggableX) {
7005
+ this.draggableX.destroy();
7006
+ this.draggableX = void 0;
7007
+ }
7008
+ if (this.draggableY) {
7009
+ this.draggableY.destroy();
7010
+ this.draggableY = void 0;
7011
+ }
7002
7012
  }
7003
7013
  };
7004
7014
 
@@ -7235,7 +7245,7 @@ var NetlessAppPresentation = (function (exports) {
7235
7245
  dispose2.add(view$$.addStateChangedListener(() => syncViewFromRemote(false, true)));
7236
7246
  const box = context.getBox();
7237
7247
  const app = dispose2.add(createPresentation(box, pages, jumpPage, pageIndex$, options.thumbnail));
7238
- app.contentDOM.dataset.appPresentationVersion = "0.1.9-beta.4";
7248
+ app.contentDOM.dataset.appPresentationVersion = "0.1.9-beta.5";
7239
7249
  app.scaleDocsToFit = scaleDocsToFit;
7240
7250
  app.log = log;
7241
7251
  if (options.justDocsViewReadonly) {
@@ -7483,7 +7493,7 @@ var NetlessAppPresentation = (function (exports) {
7483
7493
  };
7484
7494
 
7485
7495
  // src/index.ts
7486
- var version = "0.1.9-beta.4";
7496
+ var version = "0.1.9-beta.5";
7487
7497
  /*! Bundled license information:
7488
7498
 
7489
7499
  lodash/lodash.js:
package/dist/index.js CHANGED
@@ -6923,9 +6923,8 @@ var Scrollbar = class {
6923
6923
  }
6924
6924
  setReadonly(bol) {
6925
6925
  this.readonly = bol;
6926
- if (this.readonly) {
6927
- this.destroy();
6928
- } else {
6926
+ this.destroy();
6927
+ if (!this.readonly) {
6929
6928
  this.init();
6930
6929
  }
6931
6930
  }
@@ -6990,16 +6989,27 @@ var Scrollbar = class {
6990
6989
  this.onCameraUpdated();
6991
6990
  }
6992
6991
  destroy() {
6993
- var _a, _b, _c, _d;
6994
6992
  this.view.callbacks.off("onCameraUpdated", this.onCameraUpdated);
6995
- (_a = this.scrollbarX) == null ? void 0 : _a.remove();
6996
- (_b = this.scrollbarY) == null ? void 0 : _b.remove();
6997
- this.scrollbarX = void 0;
6998
- this.scrollbarY = void 0;
6999
- (_c = this.draggableX) == null ? void 0 : _c.destroy();
7000
- (_d = this.draggableY) == null ? void 0 : _d.destroy();
7001
- this.draggableX = void 0;
7002
- this.draggableY = void 0;
6993
+ if (this.scrollbarX && this.scrollbarContainerX) {
6994
+ this.scrollbarContainerX.removeChild(this.scrollbarX);
6995
+ this.scrollbarX.remove();
6996
+ this.scrollbarContainerX.remove();
6997
+ this.scrollbarX = void 0;
6998
+ }
6999
+ if (this.scrollbarY && this.scrollbarContainerY) {
7000
+ this.scrollbarContainerY.removeChild(this.scrollbarY);
7001
+ this.scrollbarY.remove();
7002
+ this.scrollbarContainerY.remove();
7003
+ this.scrollbarY = void 0;
7004
+ }
7005
+ if (this.draggableX) {
7006
+ this.draggableX.destroy();
7007
+ this.draggableX = void 0;
7008
+ }
7009
+ if (this.draggableY) {
7010
+ this.draggableY.destroy();
7011
+ this.draggableY = void 0;
7012
+ }
7003
7013
  }
7004
7014
  };
7005
7015
 
@@ -7236,7 +7246,7 @@ var NetlessAppPresentation = {
7236
7246
  dispose2.add(view$$.addStateChangedListener(() => syncViewFromRemote(false, true)));
7237
7247
  const box = context.getBox();
7238
7248
  const app = dispose2.add(createPresentation(box, pages, jumpPage, pageIndex$, options.thumbnail));
7239
- app.contentDOM.dataset.appPresentationVersion = "0.1.9-beta.4";
7249
+ app.contentDOM.dataset.appPresentationVersion = "0.1.9-beta.5";
7240
7250
  app.scaleDocsToFit = scaleDocsToFit;
7241
7251
  app.log = log;
7242
7252
  if (options.justDocsViewReadonly) {
@@ -7484,7 +7494,7 @@ var install = (register, options = {}) => {
7484
7494
  };
7485
7495
 
7486
7496
  // src/index.ts
7487
- var version = "0.1.9-beta.4";
7497
+ var version = "0.1.9-beta.5";
7488
7498
  /*! Bundled license information:
7489
7499
 
7490
7500
  lodash/lodash.js: