@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netless/forge-slide",
|
|
3
|
-
"version": "0.1.1-alpha.
|
|
3
|
+
"version": "0.1.1-alpha.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@netless/slide": "^1.4.15",
|
|
10
10
|
"uuid": "^11.0.5",
|
|
11
|
-
"@netless/forge-
|
|
12
|
-
"@netless/forge-
|
|
11
|
+
"@netless/forge-whiteboard": "0.1.14",
|
|
12
|
+
"@netless/forge-room": "0.1.8"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
15
|
"eventemitter3": "^5.0.1",
|
package/src/SlideApplication.ts
CHANGED
|
@@ -48,6 +48,7 @@ export class SlideApplication extends AbstractApplication<SlideApplicationOption
|
|
|
48
48
|
private currentSlideIndex: number = 0;
|
|
49
49
|
private taskId: string = "";
|
|
50
50
|
private prefix: string = "";
|
|
51
|
+
private slideCount: number = 0;
|
|
51
52
|
|
|
52
53
|
constructor() {
|
|
53
54
|
super();
|
|
@@ -68,7 +69,7 @@ export class SlideApplication extends AbstractApplication<SlideApplicationOption
|
|
|
68
69
|
this.footer = new FooterView();
|
|
69
70
|
this.sideBar = new SideBarView();
|
|
70
71
|
this.sideBar.on("pageChange", index => {
|
|
71
|
-
if (index > 0 && index <= this.
|
|
72
|
+
if (index > 0 && index <= this.slideCount) {
|
|
72
73
|
this.slide.renderSlide(index);
|
|
73
74
|
}
|
|
74
75
|
});
|
|
@@ -110,7 +111,7 @@ export class SlideApplication extends AbstractApplication<SlideApplicationOption
|
|
|
110
111
|
if (!this.permissions.hasPermission(ForgeSlidePermissionFlag.changePage)) {
|
|
111
112
|
return;
|
|
112
113
|
}
|
|
113
|
-
if (this.currentSlideIndex < this.
|
|
114
|
+
if (this.currentSlideIndex < this.slideCount) {
|
|
114
115
|
this.slide.renderSlide(this.currentSlideIndex + 1);
|
|
115
116
|
}
|
|
116
117
|
});
|
|
@@ -155,7 +156,7 @@ export class SlideApplication extends AbstractApplication<SlideApplicationOption
|
|
|
155
156
|
});
|
|
156
157
|
Object.defineProperty(this.emitter, "pageCount", {
|
|
157
158
|
get(): any {
|
|
158
|
-
return that.
|
|
159
|
+
return that.slideCount;
|
|
159
160
|
}
|
|
160
161
|
});
|
|
161
162
|
Object.defineProperty(this.emitter, "goto", {
|
|
@@ -327,7 +328,7 @@ export class SlideApplication extends AbstractApplication<SlideApplicationOption
|
|
|
327
328
|
whiteboardApp.applicationManager = this.applicationManager;
|
|
328
329
|
|
|
329
330
|
const json = await fetch(`${option.prefix}/${option.taskId}/jsonOutput/slide-1.json`).then(res => res.json())
|
|
330
|
-
|
|
331
|
+
this.slideCount = json.slideCount;
|
|
331
332
|
await whiteboardApp.initialize({
|
|
332
333
|
width: json.width,
|
|
333
334
|
height: json.height,
|
|
@@ -416,11 +417,10 @@ export class SlideApplication extends AbstractApplication<SlideApplicationOption
|
|
|
416
417
|
|
|
417
418
|
const syncSlide = this.getMap(this.name).get("slideState");
|
|
418
419
|
if (syncSlide && syncSlide.taskId === option.taskId) {
|
|
419
|
-
|
|
420
|
+
this.slide.setSlideState(syncSlide)
|
|
420
421
|
} else {
|
|
421
422
|
this.slide.renderSlide(1);
|
|
422
423
|
}
|
|
423
|
-
|
|
424
424
|
this.permissions = new ForgeSlidePermissions(this.userManager, (userId: string) => {
|
|
425
425
|
return this.userMap(userId);
|
|
426
426
|
});
|