@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
|
@@ -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,CAAy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M,CAAc;IAC5B,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,UAAU,CAAa;;IAiL/B,OAAO,CAAC,kBAAkB;YAOZ,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;IAqItE,OAAO,CAAC,OAAO;IAIF,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CASxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classes.d.ts","sourceRoot":"","sources":["../src/classes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,6BAA6B,QAIxC,CAAA;AAEF,eAAO,MAAM,oBAAoB,QAO/B,CAAA"}
|
package/dist/index.esm.js
CHANGED
|
@@ -67162,6 +67162,12 @@ var SlideApplication = class extends AbstractApplication2 {
|
|
|
67162
67162
|
}
|
|
67163
67163
|
});
|
|
67164
67164
|
}
|
|
67165
|
+
getPreviewImageUrl(pageIndex) {
|
|
67166
|
+
if (pageIndex < 1 || pageIndex > this.slideCount) {
|
|
67167
|
+
throw new Error("pageIndex out of range");
|
|
67168
|
+
}
|
|
67169
|
+
return `${this.prefix}/${this.taskId}/preview/${pageIndex}.png`;
|
|
67170
|
+
}
|
|
67165
67171
|
async getPreviewImage(imageUrl) {
|
|
67166
67172
|
const image = fetch(imageUrl);
|
|
67167
67173
|
return await image.then((res) => res.blob()).then((blob) => {
|
|
@@ -67185,10 +67191,10 @@ var SlideApplication = class extends AbstractApplication2 {
|
|
|
67185
67191
|
});
|
|
67186
67192
|
}
|
|
67187
67193
|
async getImageUrl(pageIndex) {
|
|
67188
|
-
return
|
|
67194
|
+
return this.getPreviewImageUrl(pageIndex);
|
|
67189
67195
|
}
|
|
67190
67196
|
async getImageSize(pageIndex) {
|
|
67191
|
-
const imageUrl =
|
|
67197
|
+
const imageUrl = this.getPreviewImageUrl(pageIndex);
|
|
67192
67198
|
let preview = null;
|
|
67193
67199
|
try {
|
|
67194
67200
|
const result = await kvStore.getItem(imageUrl);
|
|
@@ -67204,7 +67210,7 @@ var SlideApplication = class extends AbstractApplication2 {
|
|
|
67204
67210
|
return { width: preview.width, height: preview.height };
|
|
67205
67211
|
}
|
|
67206
67212
|
async getImageContent(pageIndex) {
|
|
67207
|
-
const imageUrl =
|
|
67213
|
+
const imageUrl = this.getPreviewImageUrl(pageIndex);
|
|
67208
67214
|
let preview = null;
|
|
67209
67215
|
try {
|
|
67210
67216
|
const result = await kvStore.getItem(imageUrl);
|
|
@@ -67252,7 +67258,6 @@ var SlideApplication = class extends AbstractApplication2 {
|
|
|
67252
67258
|
whiteboardApp.userManager = this.userManager;
|
|
67253
67259
|
whiteboardApp.applicationManager = this.applicationManager;
|
|
67254
67260
|
const json = await fetch(`${option.prefix}/${option.taskId}/jsonOutput/slide-1.json`).then((res) => res.json());
|
|
67255
|
-
console.log(json.slideCount);
|
|
67256
67261
|
this.slideCount = json.slideCount;
|
|
67257
67262
|
await whiteboardApp.initialize({
|
|
67258
67263
|
width: json.width,
|
|
@@ -67268,11 +67273,13 @@ var SlideApplication = class extends AbstractApplication2 {
|
|
|
67268
67273
|
this.whiteboard.view.style.top = "0";
|
|
67269
67274
|
this.whiteboard.view.style.left = "0";
|
|
67270
67275
|
this.whiteboard.view.style.zIndex = "4";
|
|
67276
|
+
this.whiteboard.view.classList.add("slide-whiteboard");
|
|
67271
67277
|
this.whiteboard.permissions.addPermission(WhiteboardPermissionFlag.all);
|
|
67272
67278
|
this.whiteboard.setCanvasBackgroundColor("#f0f0f000");
|
|
67273
67279
|
this.whiteboardContainer.style.position = "relative";
|
|
67274
67280
|
this.whiteboardContainer.style.flex = "0 0 auto";
|
|
67275
67281
|
this.whiteboardContainer.style.height = "calc(100% - 24px)";
|
|
67282
|
+
this.whiteboardContainer.classList.add("forge-slide-whiteboard-container");
|
|
67276
67283
|
this.whiteboardContainer.appendChild(this.whiteboard.view);
|
|
67277
67284
|
this.whiteboardContainer.appendChild(this.slideContainer);
|
|
67278
67285
|
this.contentContainer.appendChild(this.whiteboardContainer);
|
|
@@ -67332,7 +67339,6 @@ var SlideApplication = class extends AbstractApplication2 {
|
|
|
67332
67339
|
} else {
|
|
67333
67340
|
this.slide.renderSlide(1);
|
|
67334
67341
|
}
|
|
67335
|
-
console.log("pageCount", this.emitter.pageCount);
|
|
67336
67342
|
this.permissions = new ForgeSlidePermissions(this.userManager, (userId) => {
|
|
67337
67343
|
return this.userMap(userId);
|
|
67338
67344
|
});
|