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

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/Slide.d.ts CHANGED
@@ -19,15 +19,71 @@ export interface SlideEvents {
19
19
  * @param {number} pageIndex 页面索引
20
20
  */
21
21
  renderEnd: (pageIndex: number) => void;
22
+ /**
23
+ * 主序列动画完成时触发
24
+ * @param {number} animateIndex 主动画索引
25
+ */
26
+ mainSeqStepEnd: (animateIndex: number) => void;
27
+ /**
28
+ * 主序列动画开始时触发
29
+ * @param {number} animateIndex 主动画索引
30
+ */
31
+ mainSeqStepStart: (animateIndex: number) => void;
22
32
  }
23
33
  export declare class SlideForge extends EventEmitter<SlideEvents> implements ApplicationInstanceType {
24
34
  readonly view: HTMLDivElement;
25
35
  readonly permissions: ForgeSlidePermissions;
36
+ readonly footView: HTMLDivElement;
37
+ /**
38
+ * 当前页面索引, 从 0 开始
39
+ */
26
40
  readonly pageIndex: number;
41
+ /**
42
+ * 总页数
43
+ */
44
+ readonly pageCount: number;
27
45
  /**
28
46
  * 切换到参数指定页面, index 从 0 开始
29
47
  * @param {number} index 页面索引
30
48
  */
31
- goto: (index: number) => Promise<void>;
49
+ goto: (index: number) => void;
50
+ /**
51
+ * 下一步, 如果已经是本页的最后一步, 则切换到下一页
52
+ */
53
+ nextStep: () => void;
54
+ /**
55
+ * 上一步, 如果已经是本页的第一步, 则切换到上一页
56
+ */
57
+ prevStep: () => void;
58
+ /**
59
+ * 下一页, 如果是最后一页, 则不执行任何操作
60
+ */
61
+ nextPage: () => void;
62
+ /**
63
+ * 上一页, 如果是第一页, 则不执行任何操作
64
+ */
65
+ prevPage: () => void;
66
+ /**
67
+ * 切换侧栏显示状态
68
+ */
69
+ sideBarToggle: () => void;
70
+ /**
71
+ * 获取预览图图片内容, base64 编码
72
+ * @param {number} index 页面索引
73
+ */
74
+ imgContent: (index: number) => Promise<string>;
75
+ /**
76
+ * 获取预览图图片链接
77
+ * @param {number} index 页面索引
78
+ */
79
+ imgUrl: (index: number) => Promise<string>;
80
+ /**
81
+ * 获取预览图图片尺寸
82
+ * @param {number} index 页面索引
83
+ */
84
+ imgSize: (index: number) => Promise<{
85
+ width: number;
86
+ height: number;
87
+ }>;
32
88
  }
33
89
  //# sourceMappingURL=Slide.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Slide.d.ts","sourceRoot":"","sources":["../src/Slide.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEzF,MAAM,WAAW,WAAW;IACxB;;;;;OAKG;IACH,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,wBAAwB,EAAE,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAE7F;;;OAGG;IACH,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAEzC;;;OAGG;IACH,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C;AAGD,qBAAa,UAAW,SAAQ,YAAY,CAAC,WAAW,CAAE,YAAW,uBAAuB;IAExF,SAAgB,IAAI,EAAG,cAAc,CAAC;IACtC,SAAgB,WAAW,EAAG,qBAAqB,CAAC;IACpD,SAAgB,SAAS,EAAG,MAAM,CAAC;IAEnC;;;OAGG;IACI,IAAI,EAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACjD"}
1
+ {"version":3,"file":"Slide.d.ts","sourceRoot":"","sources":["../src/Slide.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,E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IACI,MAAM,EAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACnD;;;OAGG;IACI,OAAO,EAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;CAChF"}
@@ -14,6 +14,7 @@ export declare const Slide_APP_NAME = "forge_slide";
14
14
  export declare class SlideApplication extends AbstractApplication<SlideApplicationOption, SlideForge> {
15
15
  static applicationName: string;
16
16
  readonly name: string;
17
+ readonly emitter: SlideForge;
17
18
  private whiteboardApp;
18
19
  private whiteboard;
19
20
  private rootView;
@@ -25,8 +26,13 @@ export declare class SlideApplication extends AbstractApplication<SlideApplicati
25
26
  private sideBar;
26
27
  private slide;
27
28
  private currentSlideIndex;
29
+ private taskId;
30
+ private prefix;
28
31
  constructor();
29
- emitter: SlideForge;
32
+ private getPreviewImage;
33
+ private getImageUrl;
34
+ private getImageSize;
35
+ private getImageContent;
30
36
  private applySlideState;
31
37
  private onSlideEventHandler;
32
38
  initialize(option: SlideApplicationOption): Promise<void>;
@@ -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;AAOnC,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;AAED,eAAO,MAAM,cAAc,gBAAgB,CAAC;AAE5C,qBAAa,gBAAiB,SAAQ,mBAAmB,CAAC,sBAAsB,E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kB;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,KAAK,CAAS;IACtB,OAAO,CAAC,iBAAiB,CAAa;IACtC,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,MAAM,CAAc;;YAsLd,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
@@ -66585,12 +66585,55 @@ import EventEmitter14 from "eventemitter3";
66585
66585
  var SlideForge = class extends EventEmitter14 {
66586
66586
  view;
66587
66587
  permissions;
66588
+ footView;
66589
+ /**
66590
+ * 当前页面索引, 从 0 开始
66591
+ */
66588
66592
  pageIndex;
66593
+ /**
66594
+ * 总页数
66595
+ */
66596
+ pageCount;
66589
66597
  /**
66590
66598
  * 切换到参数指定页面, index 从 0 开始
66591
66599
  * @param {number} index 页面索引
66592
66600
  */
66593
66601
  goto;
66602
+ /**
66603
+ * 下一步, 如果已经是本页的最后一步, 则切换到下一页
66604
+ */
66605
+ nextStep;
66606
+ /**
66607
+ * 上一步, 如果已经是本页的第一步, 则切换到上一页
66608
+ */
66609
+ prevStep;
66610
+ /**
66611
+ * 下一页, 如果是最后一页, 则不执行任何操作
66612
+ */
66613
+ nextPage;
66614
+ /**
66615
+ * 上一页, 如果是第一页, 则不执行任何操作
66616
+ */
66617
+ prevPage;
66618
+ /**
66619
+ * 切换侧栏显示状态
66620
+ */
66621
+ sideBarToggle;
66622
+ /**
66623
+ * 获取预览图图片内容, base64 编码
66624
+ * @param {number} index 页面索引
66625
+ */
66626
+ imgContent;
66627
+ /**
66628
+ * 获取预览图图片链接
66629
+ * @param {number} index 页面索引
66630
+ */
66631
+ imgUrl;
66632
+ /**
66633
+ * 获取预览图图片尺寸
66634
+ * @param {number} index 页面索引
66635
+ */
66636
+ imgSize;
66594
66637
  };
66595
66638
 
66596
66639
  // src/ForgeSlidePermession.ts
@@ -66934,10 +66977,12 @@ async function delay2(time) {
66934
66977
  }
66935
66978
 
66936
66979
  // src/SlideApplication.ts
66980
+ import { kvStore } from "@netless/forge-room";
66937
66981
  var Slide_APP_NAME = "forge_slide";
66938
66982
  var SlideApplication = class extends AbstractApplication2 {
66939
66983
  static applicationName = Slide_APP_NAME;
66940
66984
  name = Slide_APP_NAME;
66985
+ emitter = new SlideForge();
66941
66986
  whiteboardApp;
66942
66987
  whiteboard;
66943
66988
  rootView = document.createElement("div");
@@ -66949,8 +66994,11 @@ var SlideApplication = class extends AbstractApplication2 {
66949
66994
  sideBar;
66950
66995
  slide;
66951
66996
  currentSlideIndex = 0;
66997
+ taskId = "";
66998
+ prefix = "";
66952
66999
  constructor() {
66953
67000
  super();
67001
+ window.emitter = this.emitter;
66954
67002
  this.rootView.setAttribute("data-forge-app", Slide_APP_NAME);
66955
67003
  this.rootView.style.background = "#f0f0f0f0";
66956
67004
  this.rootView.style.overflow = "hidden";
@@ -66963,7 +67011,9 @@ var SlideApplication = class extends AbstractApplication2 {
66963
67011
  this.footer = new FooterView();
66964
67012
  this.sideBar = new SideBarView();
66965
67013
  this.sideBar.on("pageChange", (index) => {
66966
- this.slide.renderSlide(index);
67014
+ if (index > 0 && index <= this.slide.slideCount) {
67015
+ this.slide.renderSlide(index);
67016
+ }
66967
67017
  });
66968
67018
  this.footer.on("prevStep", () => {
66969
67019
  if (!this.permissions.hasPermission(1 /* changeStep */)) {
@@ -67018,6 +67068,9 @@ var SlideApplication = class extends AbstractApplication2 {
67018
67068
  }
67019
67069
  });
67020
67070
  this.rootView.appendChild(this.contentContainer);
67071
+ this.permissions.on("change", (userId, flags, value) => {
67072
+ this.emitter.emit("permissionChange", userId, flags, value);
67073
+ });
67021
67074
  this.emitter.on("renderStart", (pageIndex) => {
67022
67075
  this.footer.prevPageState(pageIndex !== 0);
67023
67076
  });
@@ -67032,28 +67085,147 @@ var SlideApplication = class extends AbstractApplication2 {
67032
67085
  return that.permissions;
67033
67086
  }
67034
67087
  });
67088
+ Object.defineProperty(this.emitter, "footView", {
67089
+ get() {
67090
+ return that.footer.root;
67091
+ }
67092
+ });
67035
67093
  Object.defineProperty(this.emitter, "pageIndex", {
67036
67094
  get() {
67037
67095
  return that.currentSlideIndex;
67038
67096
  }
67039
67097
  });
67040
- Object.defineProperty(this.emitter, "goto", {
67098
+ Object.defineProperty(this.emitter, "pageCount", {
67041
67099
  get() {
67042
- return (index) => {
67043
- if (index > 0 && index < this.slide.slideCount) {
67044
- this.slide.renderSlide(index);
67045
- }
67046
- };
67100
+ return that.slide.slideCount;
67101
+ }
67102
+ });
67103
+ Object.defineProperty(this.emitter, "goto", {
67104
+ writable: false,
67105
+ enumerable: false,
67106
+ value: (pageIndex) => {
67107
+ this.sideBar.emit("pageChange", pageIndex);
67108
+ }
67109
+ });
67110
+ Object.defineProperty(this.emitter, "nextStep", {
67111
+ writable: false,
67112
+ enumerable: false,
67113
+ value: () => {
67114
+ this.footer.emit("nextStep");
67115
+ }
67116
+ });
67117
+ Object.defineProperty(this.emitter, "prevStep", {
67118
+ writable: false,
67119
+ enumerable: false,
67120
+ value: () => {
67121
+ this.footer.emit("prevStep");
67122
+ }
67123
+ });
67124
+ Object.defineProperty(this.emitter, "nextPage", {
67125
+ writable: false,
67126
+ enumerable: false,
67127
+ value: () => {
67128
+ this.footer.emit("nextPage");
67129
+ }
67130
+ });
67131
+ Object.defineProperty(this.emitter, "prevPage", {
67132
+ writable: false,
67133
+ enumerable: false,
67134
+ value: () => {
67135
+ this.footer.emit("prevPage");
67136
+ }
67137
+ });
67138
+ Object.defineProperty(this.emitter, "sideBarToggle", {
67139
+ writable: false,
67140
+ enumerable: false,
67141
+ value: () => {
67142
+ this.footer.emit("sideBarToggle");
67143
+ }
67144
+ });
67145
+ Object.defineProperty(this.emitter, "imgContent", {
67146
+ writable: false,
67147
+ enumerable: false,
67148
+ value: (pageIndex) => {
67149
+ return this.getImageContent(pageIndex);
67150
+ }
67151
+ });
67152
+ Object.defineProperty(this.emitter, "imgUrl", {
67153
+ writable: false,
67154
+ enumerable: false,
67155
+ value: (pageIndex) => {
67156
+ return this.getImageUrl(pageIndex);
67157
+ }
67158
+ });
67159
+ Object.defineProperty(this.emitter, "imgSize", {
67160
+ writable: false,
67161
+ enumerable: false,
67162
+ value: (pageIndex) => {
67163
+ return this.getImageSize(pageIndex);
67047
67164
  }
67048
67165
  });
67049
67166
  }
67050
- emitter = new SlideForge();
67167
+ async getPreviewImage(imageUrl) {
67168
+ const image = fetch(imageUrl);
67169
+ return await image.then((res) => res.blob()).then((blob) => {
67170
+ return new Promise((resolve) => {
67171
+ const reader = new FileReader();
67172
+ reader.onloadend = () => {
67173
+ const base64Data = reader.result;
67174
+ const img = document.createElement("img");
67175
+ img.src = base64Data;
67176
+ img.onload = () => {
67177
+ resolve({
67178
+ url: imageUrl,
67179
+ src: base64Data,
67180
+ width: img.width,
67181
+ height: img.height
67182
+ });
67183
+ };
67184
+ };
67185
+ reader.readAsDataURL(blob);
67186
+ });
67187
+ });
67188
+ }
67189
+ async getImageUrl(pageIndex) {
67190
+ return `${this.prefix}/${this.taskId}/preview/${pageIndex + 1}.png`;
67191
+ }
67192
+ async getImageSize(pageIndex) {
67193
+ const imageUrl = `${this.prefix}/${this.taskId}/preview/${pageIndex + 1}.png`;
67194
+ let preview = null;
67195
+ try {
67196
+ const result = await kvStore.getItem(imageUrl);
67197
+ preview = result ? JSON.parse(result) : null;
67198
+ } catch (e) {
67199
+ console.warn("kvStore getItem error", e);
67200
+ }
67201
+ if (preview) {
67202
+ return { width: preview.width, height: preview.height };
67203
+ }
67204
+ preview = await this.getPreviewImage(imageUrl);
67205
+ await kvStore.setItem(imageUrl, JSON.stringify(preview));
67206
+ return { width: preview.width, height: preview.height };
67207
+ }
67208
+ async getImageContent(pageIndex) {
67209
+ const imageUrl = `${this.prefix}/${this.taskId}/preview/${pageIndex + 1}.png`;
67210
+ let preview = null;
67211
+ try {
67212
+ const result = await kvStore.getItem(imageUrl);
67213
+ preview = result ? JSON.parse(result) : null;
67214
+ } catch (e) {
67215
+ console.warn("kvStore getItem error", e);
67216
+ }
67217
+ if (preview) {
67218
+ return preview.src;
67219
+ }
67220
+ preview = await this.getPreviewImage(imageUrl);
67221
+ await kvStore.setItem(imageUrl, JSON.stringify(preview));
67222
+ return preview.src;
67223
+ }
67051
67224
  applySlideState = async (slideState, lastDispatch) => {
67052
67225
  if (this.slide.slideState.currentSlideIndex < 0) {
67053
67226
  this.slide.emit(import_slide.SLIDE_EVENTS.syncReceive, lastDispatch);
67054
67227
  return;
67055
67228
  }
67056
- console.log("%cisEqual", "color: blue; font-size: 20px;", deepEqual(this.slide.slideState, slideState));
67057
67229
  if (this.slide.slideState.currentSlideIndex > 0 && deepEqual(this.slide.slideState, slideState)) {
67058
67230
  this.slide.emit(import_slide.SLIDE_EVENTS.syncReceive, lastDispatch);
67059
67231
  } else {
@@ -67073,6 +67245,8 @@ var SlideApplication = class extends AbstractApplication2 {
67073
67245
  }
67074
67246
  };
67075
67247
  async initialize(option) {
67248
+ this.prefix = option.prefix;
67249
+ this.taskId = option.taskId;
67076
67250
  const whiteboardApp = new WhiteboardApplication();
67077
67251
  whiteboardApp.roomDoc = this.roomDoc;
67078
67252
  whiteboardApp.appId = `${option.taskId}_wb`;
@@ -67106,7 +67280,6 @@ var SlideApplication = class extends AbstractApplication2 {
67106
67280
  this.contentContainer.appendChild(this.sideBar.root);
67107
67281
  if (option.inheritWhiteboardId) {
67108
67282
  whiteboardApp.linkToWhiteboard(option.inheritWhiteboardId);
67109
- console.log("inheritWhiteboardId", option.inheritWhiteboardId);
67110
67283
  }
67111
67284
  this.whiteboard.setViewModeToMain();
67112
67285
  this.slideContainer.setAttribute("builder", "slide-builder");
@@ -67129,14 +67302,22 @@ var SlideApplication = class extends AbstractApplication2 {
67129
67302
  dispatch: event
67130
67303
  });
67131
67304
  });
67305
+ this.slide.on("mainSeqStepStart", (animateIndex) => {
67306
+ this.emitter.emit("mainSeqStepStart", animateIndex);
67307
+ });
67308
+ this.slide.on("mainSeqStepEnd", (animateIndex) => {
67309
+ this.emitter.emit("mainSeqStepEnd", animateIndex);
67310
+ });
67132
67311
  this.slide.on("renderStart", (slideIndex) => {
67133
67312
  this.whiteboardApp.emitter.view.style.opacity = "0";
67134
67313
  this.whiteboardApp.emitter.addPage(`${slideIndex}`);
67135
67314
  this.whiteboardApp.emitter.gotoPage(`${slideIndex}`);
67315
+ this.emitter.emit("renderStart", slideIndex);
67136
67316
  });
67137
67317
  this.slide.on("renderEnd", (slideIndex) => {
67138
67318
  this.currentSlideIndex = slideIndex;
67139
67319
  this.whiteboardApp.emitter.view.style.opacity = "1";
67320
+ this.emitter.emit("renderEnd", slideIndex);
67140
67321
  });
67141
67322
  this.slide.on("stateChange", (state) => {
67142
67323
  this.getMap(this.name).set("slideState", state);
@@ -67144,6 +67325,7 @@ var SlideApplication = class extends AbstractApplication2 {
67144
67325
  this.getMap(this.name).observe(this.onSlideEventHandler);
67145
67326
  window.slide = this.slide;
67146
67327
  window.slideWhiteboard = this.whiteboardApp;
67328
+ window.forgeSlide = this;
67147
67329
  const syncSlide = this.getMap(this.name).get("slideState");
67148
67330
  if (syncSlide && syncSlide.taskId === option.taskId) {
67149
67331
  await this.slide.setSlideState(syncSlide);
@@ -67154,7 +67336,6 @@ var SlideApplication = class extends AbstractApplication2 {
67154
67336
  return this.userMap(userId);
67155
67337
  });
67156
67338
  this.permissions.on("change", (userId, flags, value) => {
67157
- console.log(userId, flags, value);
67158
67339
  if (this.userId === userId) {
67159
67340
  if (flags.includes(4 /* clickAnim */)) {
67160
67341
  this.slideContainer.style.pointerEvents = "auto";