@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.
@@ -28,6 +28,7 @@ export declare class SlideApplication extends AbstractApplication<SlideApplicati
28
28
  private currentSlideIndex;
29
29
  private taskId;
30
30
  private prefix;
31
+ private slideCount;
31
32
  constructor();
32
33
  private getPreviewImage;
33
34
  private getImageUrl;
@@ -1 +1 @@
1
- {"version":3,"file":"SlideApplication.d.ts","sourceRoot":"","sources":["../src/SlideApplication.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAsB,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AAQnC,MAAM,WAAW,sBAAsB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAChC;AASD,eAAO,MAAM,cAAc,gBAAgB,CAAC;AAE5C,qBAAa,gBAAiB,SAAQ,mBAAmB,CAAC,sBAAsB,EAAE,UAAU,CAAC;IAEzF,MAAM,CAAC,eAAe,SAAkB;IAExC,SAAgB,IAAI,EAAE,MAAM,CAAkB;IAC9C,SAAgB,OAAO,EAAE,UAAU,CAAoB;IAEvD,OAAO,CAAC,aAAa,CAAyB;IAC9C,OAAO,CAAC,UAAU,CAAc;IAChC,OAAO,CAAC,QAAQ,CAAiD;IACjE,OAAO,CAAC,gBAAgB,CAAiD;IACzE,OAAO,CAAC,mBAAmB,CAAiD;IAC5E,OAAO,CAAC,cAAc,CAAiD;IACvE,OAAO,CAAC,WAAW,CAAyB;IAC5C,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC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OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,iBAAiB,CAAa;IACtC,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,UAAU,CAAa;;YAkLjB,eAAe;YAuBf,WAAW;YAIX,YAAY;YAiBZ,eAAe;IAiB7B,OAAO,CAAC,eAAe,CAYtB;IAED,OAAO,CAAC,mBAAmB,CAS1B;IAEY,UAAU,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAmItE,OAAO,CAAC,OAAO;IAIF,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CASxC"}
package/dist/index.esm.js CHANGED
@@ -66996,6 +66996,7 @@ var SlideApplication = class extends AbstractApplication2 {
66996
66996
  currentSlideIndex = 0;
66997
66997
  taskId = "";
66998
66998
  prefix = "";
66999
+ slideCount = 0;
66999
67000
  constructor() {
67000
67001
  super();
67001
67002
  window.emitter = this.emitter;
@@ -67011,7 +67012,7 @@ var SlideApplication = class extends AbstractApplication2 {
67011
67012
  this.footer = new FooterView();
67012
67013
  this.sideBar = new SideBarView();
67013
67014
  this.sideBar.on("pageChange", (index) => {
67014
- if (index > 0 && index <= this.slide.slideCount) {
67015
+ if (index > 0 && index <= this.slideCount) {
67015
67016
  this.slide.renderSlide(index);
67016
67017
  }
67017
67018
  });
@@ -67053,7 +67054,7 @@ var SlideApplication = class extends AbstractApplication2 {
67053
67054
  if (!this.permissions.hasPermission(2 /* changePage */)) {
67054
67055
  return;
67055
67056
  }
67056
- if (this.currentSlideIndex < this.slide.slideCount) {
67057
+ if (this.currentSlideIndex < this.slideCount) {
67057
67058
  this.slide.renderSlide(this.currentSlideIndex + 1);
67058
67059
  }
67059
67060
  });
@@ -67068,9 +67069,6 @@ var SlideApplication = class extends AbstractApplication2 {
67068
67069
  }
67069
67070
  });
67070
67071
  this.rootView.appendChild(this.contentContainer);
67071
- this.permissions.on("change", (userId, flags, value) => {
67072
- this.emitter.emit("permissionChange", userId, flags, value);
67073
- });
67074
67072
  this.emitter.on("renderStart", (pageIndex) => {
67075
67073
  this.footer.prevPageState(pageIndex !== 0);
67076
67074
  });
@@ -67254,6 +67252,7 @@ var SlideApplication = class extends AbstractApplication2 {
67254
67252
  whiteboardApp.userManager = this.userManager;
67255
67253
  whiteboardApp.applicationManager = this.applicationManager;
67256
67254
  const json = await fetch(`${option.prefix}/${option.taskId}/jsonOutput/slide-1.json`).then((res) => res.json());
67255
+ this.slideCount = json.slideCount;
67257
67256
  await whiteboardApp.initialize({
67258
67257
  width: json.width,
67259
67258
  height: json.height
@@ -67328,7 +67327,7 @@ var SlideApplication = class extends AbstractApplication2 {
67328
67327
  window.forgeSlide = this;
67329
67328
  const syncSlide = this.getMap(this.name).get("slideState");
67330
67329
  if (syncSlide && syncSlide.taskId === option.taskId) {
67331
- await this.slide.setSlideState(syncSlide);
67330
+ this.slide.setSlideState(syncSlide);
67332
67331
  } else {
67333
67332
  this.slide.renderSlide(1);
67334
67333
  }
@@ -67336,6 +67335,7 @@ var SlideApplication = class extends AbstractApplication2 {
67336
67335
  return this.userMap(userId);
67337
67336
  });
67338
67337
  this.permissions.on("change", (userId, flags, value) => {
67338
+ this.emitter.emit("permissionChange", userId, flags, value);
67339
67339
  if (this.userId === userId) {
67340
67340
  if (flags.includes(4 /* clickAnim */)) {
67341
67341
  this.slideContainer.style.pointerEvents = "auto";