@netless/app-slide 0.2.38 → 0.2.39-alpha.1
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/README-zh.md +53 -53
- package/README.md +68 -68
- package/dist/index.d.ts +294 -294
- package/dist/main.cjs.js +2 -2
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +8 -11
- package/dist/main.es.js.map +1 -1
- package/dist/main.iife.js +2 -2
- package/dist/main.iife.js.map +1 -1
- package/package.json +8 -8
- package/src/DocsViewer/icons/arrow-left.svg +4 -4
- package/src/DocsViewer/icons/arrow-left.ts +18 -18
- package/src/DocsViewer/icons/arrow-right.svg +4 -4
- package/src/DocsViewer/icons/arrow-right.ts +18 -18
- package/src/DocsViewer/icons/pause.svg +4 -4
- package/src/DocsViewer/icons/pause.ts +18 -18
- package/src/DocsViewer/icons/play.svg +4 -4
- package/src/DocsViewer/icons/play.ts +18 -18
- package/src/DocsViewer/icons/sidebar.svg +4 -4
- package/src/DocsViewer/icons/sidebar.ts +18 -18
- package/src/DocsViewer/index.ts +381 -381
- package/src/DocsViewer/style.scss +228 -228
- package/src/DocsViewer/variables.scss +1 -1
- package/src/SlideController/helpers.ts +48 -48
- package/src/SlideController/index.ts +351 -351
- package/src/SlideDocsViewer/index.ts +11 -11
- package/src/SlideDocsViewer/style.scss +28 -28
- package/src/SlidePreviewer/index.ts +225 -225
- package/src/index.ts +283 -283
- package/src/style.scss +14 -14
- package/src/typings.ts +21 -21
- package/src/utils/bgcolor.ts +45 -45
- package/src/utils/freezer.ts +116 -116
- package/src/utils/helpers.ts +32 -32
- package/src/utils/logger.ts +106 -106
- package/LICENSE +0 -21
package/dist/main.es.js
CHANGED
|
@@ -38638,8 +38638,8 @@ class SlideDocsViewer {
|
|
|
38638
38638
|
resizeCanvas.width = pdfWidth;
|
|
38639
38639
|
resizeCanvas.height = pdfHeight;
|
|
38640
38640
|
const whiteSnapshotCanvas = document.createElement("canvas");
|
|
38641
|
-
whiteSnapshotCanvas.width =
|
|
38642
|
-
whiteSnapshotCanvas.height =
|
|
38641
|
+
whiteSnapshotCanvas.width = pdfWidth;
|
|
38642
|
+
whiteSnapshotCanvas.height = pdfHeight;
|
|
38643
38643
|
const whiteCtx = whiteSnapshotCanvas.getContext("2d");
|
|
38644
38644
|
if (!whiteCtx || !this.getWhiteSnapshot || !resizeCtx) {
|
|
38645
38645
|
this.reportProgress(100, null);
|
|
@@ -38664,8 +38664,8 @@ class SlideDocsViewer {
|
|
|
38664
38664
|
await new Promise((resolve) => img.onload = resolve);
|
|
38665
38665
|
resizeCtx.drawImage(img, 0, 0, pdfWidth, pdfHeight);
|
|
38666
38666
|
}
|
|
38667
|
-
whiteCtx.clearRect(0, 0,
|
|
38668
|
-
this.getWhiteSnapshot(i, whiteSnapshotCanvas, whiteCtx);
|
|
38667
|
+
whiteCtx.clearRect(0, 0, pdfWidth, pdfHeight);
|
|
38668
|
+
this.getWhiteSnapshot(i, whiteSnapshotCanvas, whiteCtx, width, height);
|
|
38669
38669
|
try {
|
|
38670
38670
|
const whiteSnapshot = whiteSnapshotCanvas.toDataURL("image/png");
|
|
38671
38671
|
const whiteImg = document.createElement("img");
|
|
@@ -38809,14 +38809,11 @@ class SlideDocsViewer {
|
|
|
38809
38809
|
wrapClassName(className) {
|
|
38810
38810
|
return `${this.namespace}-${className}`;
|
|
38811
38811
|
}
|
|
38812
|
-
getWhiteSnapshot(pageIndex, canvas, ctx) {
|
|
38813
|
-
|
|
38814
|
-
canvas.width = width;
|
|
38815
|
-
canvas.height = height;
|
|
38816
|
-
this.whiteboardView.screenshotToCanvas(ctx, `${this.baseScenePath}/${pageIndex}`, width, height, {
|
|
38812
|
+
getWhiteSnapshot(pageIndex, canvas, ctx, slideWidth, slideHeight) {
|
|
38813
|
+
this.whiteboardView.screenshotToCanvas(ctx, `${this.baseScenePath}/${pageIndex}`, canvas.width, canvas.height, {
|
|
38817
38814
|
centerX: 0,
|
|
38818
38815
|
centerY: 0,
|
|
38819
|
-
scale:
|
|
38816
|
+
scale: Math.min(canvas.width / slideWidth, canvas.height / slideHeight)
|
|
38820
38817
|
});
|
|
38821
38818
|
}
|
|
38822
38819
|
reportProgress(progress, result) {
|
|
@@ -39067,7 +39064,7 @@ class SlidePreviewer {
|
|
|
39067
39064
|
}
|
|
39068
39065
|
}
|
|
39069
39066
|
const usePlugin = /* @__PURE__ */ Slide.Slide.usePlugin.bind(Slide.Slide);
|
|
39070
|
-
const version = "0.2.
|
|
39067
|
+
const version = "0.2.39-alpha.1";
|
|
39071
39068
|
const SlideApp = {
|
|
39072
39069
|
kind: "Slide",
|
|
39073
39070
|
setup(context) {
|