@netless/app-slide 0.2.105-beta.2 → 0.2.105-beta.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/dist/index.d.ts +1 -0
- package/dist/main.cjs.js +85 -85
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +18 -8
- package/dist/main.es.js.map +1 -1
- package/dist/main.iife.js +85 -85
- package/dist/main.iife.js.map +1 -1
- package/package.json +1 -1
- package/src/DocsViewer/ResizableContainer.ts +5 -5
- package/src/SlideDocsViewer/index.ts +7 -0
- package/src/index.ts +4 -0
package/dist/main.es.js
CHANGED
|
@@ -41502,8 +41502,6 @@ class ResizableContainer {
|
|
|
41502
41502
|
this.whiteboardContainer.style.clipPath = `inset(${padding}px 0px ${padding}px 0px)`;
|
|
41503
41503
|
}
|
|
41504
41504
|
}
|
|
41505
|
-
this.translateX = 0.5;
|
|
41506
|
-
this.translateY = 0.5;
|
|
41507
41505
|
this.renderScrollBar(
|
|
41508
41506
|
parentBounds.width,
|
|
41509
41507
|
parentBounds.width * this.scale,
|
|
@@ -41512,14 +41510,15 @@ class ResizableContainer {
|
|
|
41512
41510
|
);
|
|
41513
41511
|
this.handleNormalizeTranslate(this.translateX, this.translateY, {
|
|
41514
41512
|
triggerScrollBar: true,
|
|
41515
|
-
triggerSync:
|
|
41513
|
+
triggerSync: false,
|
|
41514
|
+
force: true
|
|
41516
41515
|
});
|
|
41517
41516
|
(_a = this.slide) == null ? void 0 : _a.notifyFrameResize();
|
|
41518
41517
|
(_b = this.onLayoutUpdated) == null ? void 0 : _b.call(this);
|
|
41519
41518
|
}
|
|
41520
41519
|
handleNormalizeTranslate(x, y, options) {
|
|
41521
41520
|
var _a;
|
|
41522
|
-
if (Math.abs(x - this.translateX) < 1e-3 && Math.abs(y - this.translateY) < 1e-3 && !options.triggerSync) {
|
|
41521
|
+
if (Math.abs(x - this.translateX) < 1e-3 && Math.abs(y - this.translateY) < 1e-3 && !options.triggerSync && !options.force) {
|
|
41523
41522
|
return;
|
|
41524
41523
|
}
|
|
41525
41524
|
const parentBounds = this.scrollContainer.getBoundingClientRect();
|
|
@@ -42365,6 +42364,7 @@ class SlideDocsViewer {
|
|
|
42365
42364
|
this.render();
|
|
42366
42365
|
this._registerBoxSizeChange();
|
|
42367
42366
|
this.sideEffect.add(() => {
|
|
42367
|
+
var _a, _b;
|
|
42368
42368
|
const applyScale = (scale) => {
|
|
42369
42369
|
if (this.resizableContainer) {
|
|
42370
42370
|
this.resizableContainer.scaleContainer(scale);
|
|
@@ -42381,16 +42381,22 @@ class SlideDocsViewer {
|
|
|
42381
42381
|
} else {
|
|
42382
42382
|
console.log("[SlideDocsViewer] No initial slideScale found");
|
|
42383
42383
|
}
|
|
42384
|
+
const initialTranslateX = (_a = this.context.storage.state.translateX) != null ? _a : 0.5;
|
|
42385
|
+
const initialTranslateY = (_b = this.context.storage.state.translateY) != null ? _b : 0.5;
|
|
42386
|
+
this.resizableContainer.handleNormalizeTranslate(initialTranslateX, initialTranslateY, {
|
|
42387
|
+
triggerScrollBar: true,
|
|
42388
|
+
triggerSync: false
|
|
42389
|
+
});
|
|
42384
42390
|
const handler = (diff) => {
|
|
42385
|
-
var
|
|
42391
|
+
var _a2, _b2;
|
|
42386
42392
|
if (diff.slideScale !== void 0) {
|
|
42387
42393
|
const newScale = diff.slideScale.newValue;
|
|
42388
42394
|
applyScale(newScale != null ? newScale : 1);
|
|
42389
42395
|
}
|
|
42390
42396
|
if (diff.translateX !== void 0 || diff.translateY !== void 0) {
|
|
42391
42397
|
const currentTranslate = this.resizableContainer.getTranslate();
|
|
42392
|
-
const translateX = diff.translateX ? (
|
|
42393
|
-
const translateY = diff.translateY ? (
|
|
42398
|
+
const translateX = diff.translateX ? (_a2 = diff.translateX.newValue) != null ? _a2 : 0.5 : currentTranslate.x;
|
|
42399
|
+
const translateY = diff.translateY ? (_b2 = diff.translateY.newValue) != null ? _b2 : 0.5 : currentTranslate.y;
|
|
42394
42400
|
if (this.resizableContainer) {
|
|
42395
42401
|
this.resizableContainer.handleNormalizeTranslate(translateX, translateY, {
|
|
42396
42402
|
triggerScrollBar: true,
|
|
@@ -42853,7 +42859,7 @@ class SlidePreviewer {
|
|
|
42853
42859
|
}
|
|
42854
42860
|
}
|
|
42855
42861
|
const usePlugin = /* @__PURE__ */ Slide.Slide.usePlugin.bind(Slide.Slide);
|
|
42856
|
-
const version = "0.2.105-beta.
|
|
42862
|
+
const version = "0.2.105-beta.3";
|
|
42857
42863
|
const DEFAULT_SLIDE_SETUP_READY_TIMEOUT = 5e3;
|
|
42858
42864
|
const SlideApp = {
|
|
42859
42865
|
kind: "Slide",
|
|
@@ -43076,6 +43082,10 @@ const SlideApp = {
|
|
|
43076
43082
|
translateX: 0.5,
|
|
43077
43083
|
translateY: 0.5
|
|
43078
43084
|
});
|
|
43085
|
+
container.handleNormalizeTranslate(0.5, 0.5, {
|
|
43086
|
+
triggerScrollBar: true,
|
|
43087
|
+
triggerSync: false
|
|
43088
|
+
});
|
|
43079
43089
|
container.scaleContainer(applyScale);
|
|
43080
43090
|
},
|
|
43081
43091
|
getViewScale: () => {
|