@netless/forge-slide 0.1.1-alpha.3 → 0.1.1-alpha.5
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/SlideApplication.d.ts +1 -0
- package/dist/SlideApplication.d.ts.map +1 -1
- package/dist/classes.d.ts +3 -0
- package/dist/classes.d.ts.map +1 -0
- package/dist/index.esm.js +11 -5
- package/dist/index.esm.js.map +2 -2
- package/dist/index.js +11 -5
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
- package/src/SlideApplication.ts +12 -4
package/dist/index.js
CHANGED
|
@@ -67171,6 +67171,12 @@ var SlideApplication = class extends import_forge_room4.AbstractApplication {
|
|
|
67171
67171
|
}
|
|
67172
67172
|
});
|
|
67173
67173
|
}
|
|
67174
|
+
getPreviewImageUrl(pageIndex) {
|
|
67175
|
+
if (pageIndex < 1 || pageIndex > this.slideCount) {
|
|
67176
|
+
throw new Error("pageIndex out of range");
|
|
67177
|
+
}
|
|
67178
|
+
return `${this.prefix}/${this.taskId}/preview/${pageIndex}.png`;
|
|
67179
|
+
}
|
|
67174
67180
|
async getPreviewImage(imageUrl) {
|
|
67175
67181
|
const image = fetch(imageUrl);
|
|
67176
67182
|
return await image.then((res) => res.blob()).then((blob) => {
|
|
@@ -67194,10 +67200,10 @@ var SlideApplication = class extends import_forge_room4.AbstractApplication {
|
|
|
67194
67200
|
});
|
|
67195
67201
|
}
|
|
67196
67202
|
async getImageUrl(pageIndex) {
|
|
67197
|
-
return
|
|
67203
|
+
return this.getPreviewImageUrl(pageIndex);
|
|
67198
67204
|
}
|
|
67199
67205
|
async getImageSize(pageIndex) {
|
|
67200
|
-
const imageUrl =
|
|
67206
|
+
const imageUrl = this.getPreviewImageUrl(pageIndex);
|
|
67201
67207
|
let preview = null;
|
|
67202
67208
|
try {
|
|
67203
67209
|
const result = await import_forge_room5.kvStore.getItem(imageUrl);
|
|
@@ -67213,7 +67219,7 @@ var SlideApplication = class extends import_forge_room4.AbstractApplication {
|
|
|
67213
67219
|
return { width: preview.width, height: preview.height };
|
|
67214
67220
|
}
|
|
67215
67221
|
async getImageContent(pageIndex) {
|
|
67216
|
-
const imageUrl =
|
|
67222
|
+
const imageUrl = this.getPreviewImageUrl(pageIndex);
|
|
67217
67223
|
let preview = null;
|
|
67218
67224
|
try {
|
|
67219
67225
|
const result = await import_forge_room5.kvStore.getItem(imageUrl);
|
|
@@ -67261,7 +67267,6 @@ var SlideApplication = class extends import_forge_room4.AbstractApplication {
|
|
|
67261
67267
|
whiteboardApp.userManager = this.userManager;
|
|
67262
67268
|
whiteboardApp.applicationManager = this.applicationManager;
|
|
67263
67269
|
const json = await fetch(`${option.prefix}/${option.taskId}/jsonOutput/slide-1.json`).then((res) => res.json());
|
|
67264
|
-
console.log(json.slideCount);
|
|
67265
67270
|
this.slideCount = json.slideCount;
|
|
67266
67271
|
await whiteboardApp.initialize({
|
|
67267
67272
|
width: json.width,
|
|
@@ -67277,11 +67282,13 @@ var SlideApplication = class extends import_forge_room4.AbstractApplication {
|
|
|
67277
67282
|
this.whiteboard.view.style.top = "0";
|
|
67278
67283
|
this.whiteboard.view.style.left = "0";
|
|
67279
67284
|
this.whiteboard.view.style.zIndex = "4";
|
|
67285
|
+
this.whiteboard.view.classList.add("slide-whiteboard");
|
|
67280
67286
|
this.whiteboard.permissions.addPermission(WhiteboardPermissionFlag.all);
|
|
67281
67287
|
this.whiteboard.setCanvasBackgroundColor("#f0f0f000");
|
|
67282
67288
|
this.whiteboardContainer.style.position = "relative";
|
|
67283
67289
|
this.whiteboardContainer.style.flex = "0 0 auto";
|
|
67284
67290
|
this.whiteboardContainer.style.height = "calc(100% - 24px)";
|
|
67291
|
+
this.whiteboardContainer.classList.add("forge-slide-whiteboard-container");
|
|
67285
67292
|
this.whiteboardContainer.appendChild(this.whiteboard.view);
|
|
67286
67293
|
this.whiteboardContainer.appendChild(this.slideContainer);
|
|
67287
67294
|
this.contentContainer.appendChild(this.whiteboardContainer);
|
|
@@ -67341,7 +67348,6 @@ var SlideApplication = class extends import_forge_room4.AbstractApplication {
|
|
|
67341
67348
|
} else {
|
|
67342
67349
|
this.slide.renderSlide(1);
|
|
67343
67350
|
}
|
|
67344
|
-
console.log("pageCount", this.emitter.pageCount);
|
|
67345
67351
|
this.permissions = new ForgeSlidePermissions(this.userManager, (userId) => {
|
|
67346
67352
|
return this.userMap(userId);
|
|
67347
67353
|
});
|