@netless/app-slide 0.2.50 → 0.2.52
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 +11 -7
- package/dist/main.cjs.js +182 -182
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +35 -14
- package/dist/main.es.js.map +1 -1
- package/dist/main.iife.js +202 -202
- package/dist/main.iife.js.map +1 -1
- package/package.json +2 -2
- package/src/DocsViewer/index.ts +15 -9
- package/src/SlideController/index.ts +18 -4
- package/src/SlideDocsViewer/index.ts +14 -3
- package/src/index.ts +5 -1
- package/src/utils/tracker.ts +4 -4
package/dist/main.es.js
CHANGED
|
@@ -32408,7 +32408,7 @@ void main(void){
|
|
|
32408
32408
|
}
|
|
32409
32409
|
n3 >= 1 && this.timingTarget && this.ctx.clock.setTimeout(() => {
|
|
32410
32410
|
this.removeFilter();
|
|
32411
|
-
});
|
|
32411
|
+
}, 34);
|
|
32412
32412
|
}, this.onSeekToStart = () => {
|
|
32413
32413
|
this.timingTarget && this.removeFilter();
|
|
32414
32414
|
}, this.onSeekToEnd = () => {
|
|
@@ -36008,7 +36008,7 @@ void main(void){
|
|
|
36008
36008
|
}
|
|
36009
36009
|
var fT = { syncDispatch: "syncDispatch", syncReceive: "syncReceive", syncEventLag: "syncEventLag", renderStart: "renderStart", renderEnd: "renderEnd", renderError: "renderError", slideChange: "slideChange", mainSeqStepStart: "mainSeqStepStart", mainSeqStepEnd: "mainSeqStepEnd", animateStart: "animateStart", animateEnd: "animateEnd", stateChange: "stateChange", slideStepEnd: "slideEnd", slideStepStart: "slideStart" }, mT = { taskId: "", url: "", currentSlideIndex: -1, mainSeqStep: -1, mainSeqState: null, mediaState: /* @__PURE__ */ Object.create(null), interactiveSeqState: /* @__PURE__ */ Object.create(null) }, gT = "";
|
|
36010
36010
|
try {
|
|
36011
|
-
gT = "1.1
|
|
36011
|
+
gT = "1.2.1";
|
|
36012
36012
|
} catch (t2) {
|
|
36013
36013
|
gT = "dev -";
|
|
36014
36014
|
}
|
|
@@ -37353,6 +37353,8 @@ const EmptyAttributes = {
|
|
|
37353
37353
|
url: "",
|
|
37354
37354
|
state: null
|
|
37355
37355
|
};
|
|
37356
|
+
const noop$1 = function noop2() {
|
|
37357
|
+
};
|
|
37356
37358
|
class SlideController {
|
|
37357
37359
|
constructor({
|
|
37358
37360
|
context,
|
|
@@ -37361,6 +37363,7 @@ class SlideController {
|
|
|
37361
37363
|
onPageChanged,
|
|
37362
37364
|
onTransitionStart,
|
|
37363
37365
|
onTransitionEnd,
|
|
37366
|
+
onNavigate,
|
|
37364
37367
|
onError,
|
|
37365
37368
|
onRenderError,
|
|
37366
37369
|
showRenderError
|
|
@@ -37416,8 +37419,7 @@ class SlideController {
|
|
|
37416
37419
|
setTimeout(this.pollReadyState, 500);
|
|
37417
37420
|
} else {
|
|
37418
37421
|
this.pollCount = 0;
|
|
37419
|
-
log("[Slide]
|
|
37420
|
-
this.slide.renderSlide(1);
|
|
37422
|
+
log("[Slide] init timeout");
|
|
37421
37423
|
}
|
|
37422
37424
|
};
|
|
37423
37425
|
this._pageCount = 0;
|
|
@@ -37469,6 +37471,7 @@ class SlideController {
|
|
|
37469
37471
|
this.onPageChanged = onPageChanged;
|
|
37470
37472
|
this.onTransitionStart = onTransitionStart;
|
|
37471
37473
|
this.onTransitionEnd = onTransitionEnd;
|
|
37474
|
+
this.onNavigate = onNavigate || noop$1;
|
|
37472
37475
|
this.onError = onError;
|
|
37473
37476
|
this.onRenderError = onRenderError;
|
|
37474
37477
|
this.showRenderError = showRenderError != null ? showRenderError : true;
|
|
@@ -37484,9 +37487,10 @@ class SlideController {
|
|
|
37484
37487
|
this.savedIsFrozen = false;
|
|
37485
37488
|
this.initialize();
|
|
37486
37489
|
}
|
|
37487
|
-
jumpToPage(page) {
|
|
37490
|
+
jumpToPage(page, origin) {
|
|
37488
37491
|
if (this.ready) {
|
|
37489
37492
|
page = clamp$1(page, 1, this.pageCount);
|
|
37493
|
+
this.onNavigate(page, origin);
|
|
37490
37494
|
this.slide.renderSlide(page);
|
|
37491
37495
|
}
|
|
37492
37496
|
}
|
|
@@ -38325,7 +38329,13 @@ if (runningOnBrowser) {
|
|
|
38325
38329
|
autoInitialize(LazyLoad, window.lazyLoadOptions);
|
|
38326
38330
|
}
|
|
38327
38331
|
class DocsViewer {
|
|
38328
|
-
constructor({
|
|
38332
|
+
constructor({
|
|
38333
|
+
readonly,
|
|
38334
|
+
onNewPageIndex,
|
|
38335
|
+
onPlay,
|
|
38336
|
+
onPagesReady,
|
|
38337
|
+
urlInterrupter
|
|
38338
|
+
}) {
|
|
38329
38339
|
this._pages = [];
|
|
38330
38340
|
this.pageIndex = 0;
|
|
38331
38341
|
this.setPaused = () => {
|
|
@@ -38425,7 +38435,7 @@ class DocsViewer {
|
|
|
38425
38435
|
ev.preventDefault();
|
|
38426
38436
|
ev.stopPropagation();
|
|
38427
38437
|
ev.stopImmediatePropagation();
|
|
38428
|
-
this.onNewPageIndex(Number(pageIndex));
|
|
38438
|
+
this.onNewPageIndex(Number(pageIndex), "preview");
|
|
38429
38439
|
this.togglePreview(false);
|
|
38430
38440
|
}
|
|
38431
38441
|
});
|
|
@@ -38522,7 +38532,7 @@ class DocsViewer {
|
|
|
38522
38532
|
if (this.readonly) {
|
|
38523
38533
|
return;
|
|
38524
38534
|
}
|
|
38525
|
-
this.onNewPageIndex(this.pageIndex - 1);
|
|
38535
|
+
this.onNewPageIndex(this.pageIndex - 1, "navigation");
|
|
38526
38536
|
});
|
|
38527
38537
|
$pageJumps.appendChild($btnPageBack);
|
|
38528
38538
|
if (this.onPlay) {
|
|
@@ -38544,7 +38554,7 @@ class DocsViewer {
|
|
|
38544
38554
|
if (this.readonly) {
|
|
38545
38555
|
return;
|
|
38546
38556
|
}
|
|
38547
|
-
this.onNewPageIndex(this.pageIndex + 1);
|
|
38557
|
+
this.onNewPageIndex(this.pageIndex + 1, "navigation");
|
|
38548
38558
|
});
|
|
38549
38559
|
$pageJumps.appendChild($btnPageNext);
|
|
38550
38560
|
const $pageNumber = document.createElement("div");
|
|
@@ -38564,7 +38574,7 @@ class DocsViewer {
|
|
|
38564
38574
|
return;
|
|
38565
38575
|
}
|
|
38566
38576
|
if ($pageNumberInput.value) {
|
|
38567
|
-
this.onNewPageIndex(Number($pageNumberInput.value) - 1);
|
|
38577
|
+
this.onNewPageIndex(Number($pageNumberInput.value) - 1, "input");
|
|
38568
38578
|
}
|
|
38569
38579
|
});
|
|
38570
38580
|
const $totalPage = document.createElement("span");
|
|
@@ -38606,6 +38616,8 @@ class DocsViewer {
|
|
|
38606
38616
|
}
|
|
38607
38617
|
}
|
|
38608
38618
|
const ClickThroughAppliances = /* @__PURE__ */ new Set(["clicker"]);
|
|
38619
|
+
const noop = function noop22() {
|
|
38620
|
+
};
|
|
38609
38621
|
class SlideDocsViewer {
|
|
38610
38622
|
constructor({
|
|
38611
38623
|
box,
|
|
@@ -38615,7 +38627,8 @@ class SlideDocsViewer {
|
|
|
38615
38627
|
baseScenePath,
|
|
38616
38628
|
appId,
|
|
38617
38629
|
urlInterrupter,
|
|
38618
|
-
onPagesReady
|
|
38630
|
+
onPagesReady,
|
|
38631
|
+
onNavigate
|
|
38619
38632
|
}) {
|
|
38620
38633
|
this.slideController = null;
|
|
38621
38634
|
this.isViewMounted = false;
|
|
@@ -38686,9 +38699,9 @@ class SlideDocsViewer {
|
|
|
38686
38699
|
this.slideController.slide.nextStep();
|
|
38687
38700
|
}
|
|
38688
38701
|
};
|
|
38689
|
-
this.onNewPageIndex = (index) => {
|
|
38702
|
+
this.onNewPageIndex = (index, origin) => {
|
|
38690
38703
|
if (this.slideController) {
|
|
38691
|
-
this.slideController.jumpToPage(index + 1);
|
|
38704
|
+
this.slideController.jumpToPage(index + 1, origin);
|
|
38692
38705
|
}
|
|
38693
38706
|
};
|
|
38694
38707
|
this.sideEffect = new SideEffectManager();
|
|
@@ -38771,6 +38784,7 @@ class SlideDocsViewer {
|
|
|
38771
38784
|
this.whiteboardView = view;
|
|
38772
38785
|
this.mountSlideController = mountSlideController;
|
|
38773
38786
|
this.mountWhiteboard = mountWhiteboard;
|
|
38787
|
+
this.onNavigate = onNavigate || noop;
|
|
38774
38788
|
this.baseScenePath = baseScenePath;
|
|
38775
38789
|
this.appId = appId;
|
|
38776
38790
|
this.viewer = new DocsViewer({
|
|
@@ -38810,11 +38824,13 @@ class SlideDocsViewer {
|
|
|
38810
38824
|
case "ArrowUp":
|
|
38811
38825
|
case "ArrowLeft": {
|
|
38812
38826
|
this.slideController.slide.prevStep();
|
|
38827
|
+
this.onNavigate(this.slideController.page, "keydown");
|
|
38813
38828
|
break;
|
|
38814
38829
|
}
|
|
38815
38830
|
case "ArrowRight":
|
|
38816
38831
|
case "ArrowDown": {
|
|
38817
38832
|
this.slideController.slide.nextStep();
|
|
38833
|
+
this.onNavigate(this.slideController.page, "keydown");
|
|
38818
38834
|
break;
|
|
38819
38835
|
}
|
|
38820
38836
|
}
|
|
@@ -38855,6 +38871,7 @@ class SlideDocsViewer {
|
|
|
38855
38871
|
onTransitionStart: this.viewer.setPlaying,
|
|
38856
38872
|
onTransitionEnd: this.viewer.setPaused,
|
|
38857
38873
|
onReady: this.refreshPages,
|
|
38874
|
+
onNavigate: this.onNavigate,
|
|
38858
38875
|
onError: this.onError
|
|
38859
38876
|
});
|
|
38860
38877
|
this.scaleDocsToFit();
|
|
@@ -39144,7 +39161,7 @@ class SlidePreviewer {
|
|
|
39144
39161
|
}
|
|
39145
39162
|
}
|
|
39146
39163
|
const usePlugin = /* @__PURE__ */ Slide.Slide.usePlugin.bind(Slide.Slide);
|
|
39147
|
-
const version = "0.2.
|
|
39164
|
+
const version = "0.2.52";
|
|
39148
39165
|
const SlideApp = {
|
|
39149
39166
|
kind: "Slide",
|
|
39150
39167
|
setup(context) {
|
|
@@ -39193,6 +39210,7 @@ const SlideApp = {
|
|
|
39193
39210
|
context
|
|
39194
39211
|
}, options), {
|
|
39195
39212
|
onPageChanged,
|
|
39213
|
+
onNavigate: options.onNavigate,
|
|
39196
39214
|
onRenderError: appOptions.onRenderError,
|
|
39197
39215
|
showRenderError: appOptions.showRenderError
|
|
39198
39216
|
}));
|
|
@@ -39223,6 +39241,9 @@ const SlideApp = {
|
|
|
39223
39241
|
onPagesReady: ({ length }) => {
|
|
39224
39242
|
const index = (docsViewer == null ? void 0 : docsViewer.viewer.pageIndex) || 0;
|
|
39225
39243
|
context.dispatchAppEvent("pageStateChange", { index, length });
|
|
39244
|
+
},
|
|
39245
|
+
onNavigate: (page, origin) => {
|
|
39246
|
+
log("[Slide] user navigate to", page, origin ? `(${origin})` : "");
|
|
39226
39247
|
}
|
|
39227
39248
|
});
|
|
39228
39249
|
const room = context.getRoom();
|