@netless/forge-slide 0.1.1-alpha.0 → 0.1.1-alpha.2

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
  });
@@ -67077,9 +67078,6 @@ var SlideApplication = class extends import_forge_room4.AbstractApplication {
67077
67078
  }
67078
67079
  });
67079
67080
  this.rootView.appendChild(this.contentContainer);
67080
- this.permissions.on("change", (userId, flags, value) => {
67081
- this.emitter.emit("permissionChange", userId, flags, value);
67082
- });
67083
67081
  this.emitter.on("renderStart", (pageIndex) => {
67084
67082
  this.footer.prevPageState(pageIndex !== 0);
67085
67083
  });
@@ -67263,6 +67261,7 @@ var SlideApplication = class extends import_forge_room4.AbstractApplication {
67263
67261
  whiteboardApp.userManager = this.userManager;
67264
67262
  whiteboardApp.applicationManager = this.applicationManager;
67265
67263
  const json = await fetch(`${option.prefix}/${option.taskId}/jsonOutput/slide-1.json`).then((res) => res.json());
67264
+ this.slideCount = json.slideCount;
67266
67265
  await whiteboardApp.initialize({
67267
67266
  width: json.width,
67268
67267
  height: json.height
@@ -67337,7 +67336,7 @@ var SlideApplication = class extends import_forge_room4.AbstractApplication {
67337
67336
  window.forgeSlide = this;
67338
67337
  const syncSlide = this.getMap(this.name).get("slideState");
67339
67338
  if (syncSlide && syncSlide.taskId === option.taskId) {
67340
- await this.slide.setSlideState(syncSlide);
67339
+ this.slide.setSlideState(syncSlide);
67341
67340
  } else {
67342
67341
  this.slide.renderSlide(1);
67343
67342
  }
@@ -67345,6 +67344,7 @@ var SlideApplication = class extends import_forge_room4.AbstractApplication {
67345
67344
  return this.userMap(userId);
67346
67345
  });
67347
67346
  this.permissions.on("change", (userId, flags, value) => {
67347
+ this.emitter.emit("permissionChange", userId, flags, value);
67348
67348
  if (this.userId === userId) {
67349
67349
  if (flags.includes(4 /* clickAnim */)) {
67350
67350
  this.slideContainer.style.pointerEvents = "auto";