@netless/forge-slide 0.1.1-alpha.1 → 0.1.1-alpha.3

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/index.js CHANGED
@@ -67005,6 +67005,7 @@ var SlideApplication = class extends import_forge_room4.AbstractApplication {
67005
67005
  currentSlideIndex = 0;
67006
67006
  taskId = "";
67007
67007
  prefix = "";
67008
+ slideCount = 0;
67008
67009
  constructor() {
67009
67010
  super();
67010
67011
  window.emitter = this.emitter;
@@ -67020,7 +67021,7 @@ var SlideApplication = class extends import_forge_room4.AbstractApplication {
67020
67021
  this.footer = new FooterView();
67021
67022
  this.sideBar = new SideBarView();
67022
67023
  this.sideBar.on("pageChange", (index) => {
67023
- if (index > 0 && index <= this.slide.slideCount) {
67024
+ if (index > 0 && index <= this.slideCount) {
67024
67025
  this.slide.renderSlide(index);
67025
67026
  }
67026
67027
  });
@@ -67062,7 +67063,7 @@ var SlideApplication = class extends import_forge_room4.AbstractApplication {
67062
67063
  if (!this.permissions.hasPermission(2 /* changePage */)) {
67063
67064
  return;
67064
67065
  }
67065
- if (this.currentSlideIndex < this.slide.slideCount) {
67066
+ if (this.currentSlideIndex < this.slideCount) {
67066
67067
  this.slide.renderSlide(this.currentSlideIndex + 1);
67067
67068
  }
67068
67069
  });
@@ -67103,7 +67104,7 @@ var SlideApplication = class extends import_forge_room4.AbstractApplication {
67103
67104
  });
67104
67105
  Object.defineProperty(this.emitter, "pageCount", {
67105
67106
  get() {
67106
- return that.slide.slideCount;
67107
+ return that.slideCount;
67107
67108
  }
67108
67109
  });
67109
67110
  Object.defineProperty(this.emitter, "goto", {
@@ -67260,6 +67261,8 @@ var SlideApplication = class extends import_forge_room4.AbstractApplication {
67260
67261
  whiteboardApp.userManager = this.userManager;
67261
67262
  whiteboardApp.applicationManager = this.applicationManager;
67262
67263
  const json = await fetch(`${option.prefix}/${option.taskId}/jsonOutput/slide-1.json`).then((res) => res.json());
67264
+ console.log(json.slideCount);
67265
+ this.slideCount = json.slideCount;
67263
67266
  await whiteboardApp.initialize({
67264
67267
  width: json.width,
67265
67268
  height: json.height
@@ -67334,10 +67337,11 @@ var SlideApplication = class extends import_forge_room4.AbstractApplication {
67334
67337
  window.forgeSlide = this;
67335
67338
  const syncSlide = this.getMap(this.name).get("slideState");
67336
67339
  if (syncSlide && syncSlide.taskId === option.taskId) {
67337
- await this.slide.setSlideState(syncSlide);
67340
+ this.slide.setSlideState(syncSlide);
67338
67341
  } else {
67339
67342
  this.slide.renderSlide(1);
67340
67343
  }
67344
+ console.log("pageCount", this.emitter.pageCount);
67341
67345
  this.permissions = new ForgeSlidePermissions(this.userManager, (userId) => {
67342
67346
  return this.userMap(userId);
67343
67347
  });