@netless/forge-slide 0.1.1-alpha.3 → 0.1.1-alpha.4
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/index.esm.js +9 -5
- package/dist/index.esm.js.map +2 -2
- package/dist/index.js +9 -5
- package/dist/index.js.map +2 -2
- package/package.json +3 -3
- package/src/SlideApplication.ts +10 -3
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,
|
|
@@ -67341,7 +67346,6 @@ var SlideApplication = class extends import_forge_room4.AbstractApplication {
|
|
|
67341
67346
|
} else {
|
|
67342
67347
|
this.slide.renderSlide(1);
|
|
67343
67348
|
}
|
|
67344
|
-
console.log("pageCount", this.emitter.pageCount);
|
|
67345
67349
|
this.permissions = new ForgeSlidePermissions(this.userManager, (userId) => {
|
|
67346
67350
|
return this.userMap(userId);
|
|
67347
67351
|
});
|