@netless/window-manager 1.0.0-canary.8 → 1.0.0-canary.9

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 CHANGED
@@ -80,8 +80,8 @@ export declare type MountParams = {
80
80
  container?: HTMLElement;
81
81
  /** 白板高宽比例, 默认为 9 / 16 */
82
82
  containerSizeRatio?: number;
83
- /** 显示 PS 透明背景,默认 true */
84
- chessboard?: boolean;
83
+ /** 是否高亮显示同步区域, 默认为 true */
84
+ highlightStage?: boolean;
85
85
  collectorContainer?: HTMLElement;
86
86
  collectorStyles?: Partial<CSSStyleDeclaration>;
87
87
  overwriteStyles?: string;
@@ -144,6 +144,7 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
144
144
  setMainViewSceneIndex(index: number): Promise<void>;
145
145
  nextPage(): Promise<boolean>;
146
146
  prevPage(): Promise<boolean>;
147
+ jumpPage(index: number): Promise<boolean>;
147
148
  addPage(params?: AddPageParams): Promise<void>;
148
149
  /**
149
150
  * 删除一页
package/dist/index.es.js CHANGED
@@ -1041,6 +1041,7 @@ class AppContext {
1041
1041
  this._viewWrapper = void 0;
1042
1042
  };
1043
1043
  view.divElement = viewWrapper;
1044
+ this.appProxy.fireMemberStateChange();
1044
1045
  if (this.isAddApp) {
1045
1046
  this.ensurePageSize(size2);
1046
1047
  }
@@ -1114,7 +1115,7 @@ class AppContext {
1114
1115
  return this.appProxy.view;
1115
1116
  }
1116
1117
  get isWritable() {
1117
- return this.manager.canOperate;
1118
+ return this.manager.canOperate && !this.destroyed;
1118
1119
  }
1119
1120
  get box() {
1120
1121
  const box = this.boxManager.getBox(this.appId);
@@ -1225,21 +1226,6 @@ class CameraSynchronizer {
1225
1226
  delay(moveCamera, 50);
1226
1227
  }
1227
1228
  }, 50);
1228
- this.onLocalSizeUpdate = (size2) => {
1229
- if (this.rect && this.view) {
1230
- let scale2;
1231
- if (size2.width < size2.height) {
1232
- scale2 = this.rect.width / size2.width;
1233
- } else {
1234
- scale2 = this.rect.height / size2.height;
1235
- }
1236
- const nextScale = this.view.camera.scale / scale2;
1237
- this.view.moveCamera({
1238
- scale: nextScale,
1239
- animationMode: AnimationMode.Immediately
1240
- });
1241
- }
1242
- };
1243
1229
  }
1244
1230
  setRect(rect) {
1245
1231
  this.rect = rect;
@@ -1515,10 +1501,30 @@ class AppProxy {
1515
1501
  this.uid = this.manager.uid;
1516
1502
  this.status = "normal";
1517
1503
  this.sideEffectManager = new SideEffectManager();
1518
- this.camera$ = new Val(void 0);
1519
- this.size$ = new Val(void 0);
1520
- this.box$ = new Val(void 0);
1521
- this.view$ = new Val(void 0);
1504
+ this.valManager = new ValManager();
1505
+ this.fullPath$ = this.valManager.attach(new Val(void 0));
1506
+ this.camera$ = this.valManager.attach(new Val(void 0));
1507
+ this.size$ = this.valManager.attach(new Val(void 0));
1508
+ this.box$ = this.valManager.attach(new Val(void 0));
1509
+ this.view$ = this.valManager.attach(new Val(void 0));
1510
+ this.fireMemberStateChange = () => {
1511
+ if (this.manager.room) {
1512
+ this.onMemberStateChange(this.manager.room.state.memberState);
1513
+ }
1514
+ };
1515
+ this.onMemberStateChange = (memberState) => {
1516
+ var _a2, _b;
1517
+ const needPointerEventsNone = memberState.currentApplianceName === "clicker";
1518
+ if (needPointerEventsNone) {
1519
+ if ((_a2 = this.appContext) == null ? void 0 : _a2._viewWrapper) {
1520
+ this.appContext._viewWrapper.style.pointerEvents = "none";
1521
+ }
1522
+ } else {
1523
+ if ((_b = this.appContext) == null ? void 0 : _b._viewWrapper) {
1524
+ this.appContext._viewWrapper.style.pointerEvents = "auto";
1525
+ }
1526
+ }
1527
+ };
1522
1528
  this.getAppInitState = (id2) => {
1523
1529
  var _a2, _b;
1524
1530
  const attrs = this.store.getAppState(id2);
@@ -1547,8 +1553,7 @@ class AppProxy {
1547
1553
  return payload;
1548
1554
  };
1549
1555
  this.appAttributesUpdateListener = (appId2) => {
1550
- var _a2, _b, _c;
1551
- (_a2 = this.manager.refresher) == null ? void 0 : _a2.add(appId2, () => {
1556
+ this.manager.refresher.add(appId2, () => {
1552
1557
  return autorun(() => {
1553
1558
  const attrs = this.manager.attributes[appId2];
1554
1559
  if (attrs) {
@@ -1556,23 +1561,23 @@ class AppProxy {
1556
1561
  }
1557
1562
  });
1558
1563
  });
1559
- (_b = this.manager.refresher) == null ? void 0 : _b.add(this.stateKey, () => {
1564
+ this.manager.refresher.add(this.stateKey, () => {
1560
1565
  return autorun(() => {
1561
- var _a3, _b2, _c2;
1562
- const appState = (_a3 = this.appAttributes) == null ? void 0 : _a3.state;
1563
- if ((appState == null ? void 0 : appState.zIndex) > 0 && appState.zIndex !== ((_b2 = this.box) == null ? void 0 : _b2.zIndex)) {
1564
- (_c2 = this.boxManager) == null ? void 0 : _c2.setZIndex(appId2, appState.zIndex);
1566
+ var _a2, _b, _c;
1567
+ const appState = (_a2 = this.appAttributes) == null ? void 0 : _a2.state;
1568
+ if ((appState == null ? void 0 : appState.zIndex) > 0 && appState.zIndex !== ((_b = this.box) == null ? void 0 : _b.zIndex)) {
1569
+ (_c = this.boxManager) == null ? void 0 : _c.setZIndex(appId2, appState.zIndex);
1565
1570
  }
1566
1571
  });
1567
1572
  });
1568
- (_c = this.manager.refresher) == null ? void 0 : _c.add(`${appId2}-fullPath`, () => {
1573
+ this.manager.refresher.add(`${appId2}-fullPath`, () => {
1569
1574
  return autorun(() => {
1570
- var _a3;
1571
- const fullPath = (_a3 = this.appAttributes) == null ? void 0 : _a3.fullPath;
1575
+ var _a2;
1576
+ const fullPath = (_a2 = this.appAttributes) == null ? void 0 : _a2.fullPath;
1572
1577
  this.setFocusScenePathHandler(fullPath);
1573
- if (this._prevFullPath !== fullPath) {
1578
+ if (this.fullPath$.value !== fullPath) {
1574
1579
  this.notifyPageStateChange();
1575
- this._prevFullPath = fullPath;
1580
+ this.fullPath$.setValue(fullPath);
1576
1581
  }
1577
1582
  });
1578
1583
  });
@@ -1601,6 +1606,26 @@ class AppProxy {
1601
1606
  const nextCamera = __spreadValues(__spreadValues({}, this.camera$.value), camera);
1602
1607
  this.storeCamera(nextCamera);
1603
1608
  };
1609
+ this.addCameraReaction = () => {
1610
+ this.sideEffectManager.add(() => this.manager.refresher.add(`${this.id}-camera`, () => reaction(() => {
1611
+ var _a2;
1612
+ return (_a2 = this.appAttributes) == null ? void 0 : _a2.camera;
1613
+ }, (camera) => {
1614
+ if (camera && camera.id !== this.uid) {
1615
+ this.camera$.setValue(toJS(camera));
1616
+ }
1617
+ })), "camera");
1618
+ };
1619
+ this.addSizeReaction = () => {
1620
+ this.sideEffectManager.add(() => this.manager.refresher.add(`${this.id}-size`, () => reaction(() => {
1621
+ var _a2;
1622
+ return (_a2 = this.appAttributes) == null ? void 0 : _a2.size;
1623
+ }, (size2) => {
1624
+ if (size2 && size2.id !== this.uid) {
1625
+ this.size$.setValue(toJS(size2));
1626
+ }
1627
+ })), "size");
1628
+ };
1604
1629
  this.kind = params.kind;
1605
1630
  this.id = appId;
1606
1631
  this.appScenePath = `/${this.id}-app-dir`;
@@ -1628,31 +1653,9 @@ class AppProxy {
1628
1653
  }));
1629
1654
  this.camera$.setValue(toJS(this.appAttributes.camera));
1630
1655
  this.size$.setValue(toJS(this.appAttributes.size));
1631
- this.sideEffectManager.add(() => {
1632
- return this.manager.refresher.add(`${this.id}-camera`, () => {
1633
- return reaction(() => {
1634
- var _a2;
1635
- return (_a2 = this.appAttributes) == null ? void 0 : _a2.camera;
1636
- }, (camera) => {
1637
- if (camera && camera.id !== this.uid) {
1638
- this.camera$.setValue(toJS(camera));
1639
- }
1640
- });
1641
- });
1642
- });
1643
- this.sideEffectManager.add(() => {
1644
- return this.manager.refresher.add(`${this.id}-size`, () => {
1645
- return reaction(() => {
1646
- var _a2;
1647
- return (_a2 = this.appAttributes) == null ? void 0 : _a2.size;
1648
- }, (size2) => {
1649
- if (size2 && size2.id !== this.uid) {
1650
- this.size$.setValue(toJS(size2));
1651
- }
1652
- });
1653
- });
1654
- });
1655
- combine([this.box$, this.view$]).subscribe(([box, view]) => {
1656
+ this.addCameraReaction();
1657
+ this.addSizeReaction();
1658
+ this.sideEffectManager.add(() => combine([this.box$, this.view$]).subscribe(([box, view]) => {
1656
1659
  var _a2, _b;
1657
1660
  if (box && view) {
1658
1661
  if (!this.camera$.value) {
@@ -1678,20 +1681,8 @@ class AppProxy {
1678
1681
  return (_a3 = this.appViewSync) == null ? void 0 : _a3.destroy();
1679
1682
  });
1680
1683
  }
1681
- });
1682
- this.sideEffectManager.add(() => emitter.on("memberStateChange", (memberState) => {
1683
- var _a2, _b;
1684
- const needPointerEventsNone = memberState.currentApplianceName === "clicker";
1685
- if (needPointerEventsNone) {
1686
- if ((_a2 = this.appContext) == null ? void 0 : _a2._viewWrapper) {
1687
- this.appContext._viewWrapper.style.pointerEvents = "none";
1688
- }
1689
- } else {
1690
- if ((_b = this.appContext) == null ? void 0 : _b._viewWrapper) {
1691
- this.appContext._viewWrapper.style.pointerEvents = "auto";
1692
- }
1693
- }
1694
1684
  }));
1685
+ this.sideEffectManager.add(() => emitter.on("memberStateChange", this.onMemberStateChange));
1695
1686
  }
1696
1687
  createAppDir() {
1697
1688
  const scenePath = this.scenePath || this.appScenePath;
@@ -1719,7 +1710,7 @@ class AppProxy {
1719
1710
  }
1720
1711
  }
1721
1712
  get view() {
1722
- return this.manager.viewManager.getView(this.id);
1713
+ return this.view$.value;
1723
1714
  }
1724
1715
  get viewIndex() {
1725
1716
  var _a;
@@ -1975,7 +1966,7 @@ class AppProxy {
1975
1966
  }
1976
1967
  }
1977
1968
  async destroy(needCloseBox, cleanAttrs, skipUpdate, error) {
1978
- var _a, _b, _c, _d;
1969
+ var _a;
1979
1970
  if (this.status === "destroyed")
1980
1971
  return;
1981
1972
  this.status = "destroyed";
@@ -2000,13 +1991,10 @@ class AppProxy {
2000
1991
  this.appProxies.delete(this.id);
2001
1992
  this.viewManager.destroyView(this.id);
2002
1993
  this.manager.appStatus.delete(this.id);
2003
- (_b = this.manager.refresher) == null ? void 0 : _b.remove(this.id);
2004
- (_c = this.manager.refresher) == null ? void 0 : _c.remove(this.stateKey);
2005
- (_d = this.manager.refresher) == null ? void 0 : _d.remove(`${this.id}-fullPath`);
2006
- this._prevFullPath = void 0;
2007
- this.camera$.destroy();
2008
- this.size$.destroy();
2009
- this.box$.destroy();
1994
+ this.manager.refresher.remove(this.id);
1995
+ this.manager.refresher.remove(this.stateKey);
1996
+ this.manager.refresher.remove(`${this.id}-fullPath`);
1997
+ this.valManager.destroy();
2010
1998
  }
2011
1999
  close() {
2012
2000
  return this.destroy(true, true, false);
@@ -2071,17 +2059,14 @@ class MainViewProxy {
2071
2059
  this.store = this.manager.store;
2072
2060
  this.sideEffectManager = new SideEffectManager();
2073
2061
  this.startListenWritableChange = () => {
2074
- this.sideEffectManager.add(() => {
2075
- return emitter.on("writableChange", (isWritable) => {
2076
- if (isWritable) {
2077
- this.ensureCameraAndSize();
2078
- }
2079
- });
2080
- });
2062
+ this.sideEffectManager.add(() => emitter.on("writableChange", (isWritable) => {
2063
+ if (isWritable) {
2064
+ this.ensureCameraAndSize();
2065
+ }
2066
+ }));
2081
2067
  };
2082
2068
  this.addCameraReaction = () => {
2083
- var _a2;
2084
- (_a2 = this.manager.refresher) == null ? void 0 : _a2.add(Fields.MainViewCamera, this.cameraReaction);
2069
+ this.manager.refresher.add(Fields.MainViewCamera, this.cameraReaction);
2085
2070
  };
2086
2071
  this.cameraReaction = () => {
2087
2072
  return reaction(() => this.mainViewCamera, (camera) => {
@@ -2090,11 +2075,8 @@ class MainViewProxy {
2090
2075
  }
2091
2076
  }, { fireImmediately: true });
2092
2077
  };
2093
- this.sizeChangeHandler = debounce((size2) => {
2094
- }, 30);
2095
2078
  this.onUpdateContainerSizeRatio = () => {
2096
2079
  const size2 = this.store.getMainViewSize();
2097
- this.sizeChangeHandler(size2);
2098
2080
  if (size2.id === this.manager.uid) {
2099
2081
  this.setCameraAndSize();
2100
2082
  }
@@ -2124,23 +2106,19 @@ class MainViewProxy {
2124
2106
  this.ensureCameraAndSize();
2125
2107
  this.startListenWritableChange();
2126
2108
  });
2127
- this.sideEffectManager.add(() => {
2128
- return emitter.on("containerSizeRatioUpdate", this.onUpdateContainerSizeRatio);
2129
- });
2130
- this.sideEffectManager.add(() => {
2131
- return emitter.on("startReconnect", () => {
2109
+ this.sideEffectManager.add(() => [
2110
+ emitter.on("containerSizeRatioUpdate", this.onUpdateContainerSizeRatio),
2111
+ emitter.on("startReconnect", () => {
2132
2112
  releaseView(this.mainView);
2133
- });
2134
- });
2113
+ }),
2114
+ emitter.on("playgroundSizeChange", (rect2) => {
2115
+ this.synchronizer.setRect(rect2);
2116
+ })
2117
+ ]);
2135
2118
  const rect = (_a = this.manager.boxManager) == null ? void 0 : _a.stageRect;
2136
2119
  if (rect) {
2137
2120
  this.synchronizer.setRect(rect);
2138
2121
  }
2139
- this.sideEffectManager.add(() => {
2140
- return emitter.on("playgroundSizeChange", (rect2) => {
2141
- this.synchronizer.setRect(rect2);
2142
- });
2143
- });
2144
2122
  }
2145
2123
  ensureCameraAndSize() {
2146
2124
  if (!this.mainViewCamera || !this.mainViewSize) {
@@ -2163,7 +2141,6 @@ class MainViewProxy {
2163
2141
  start() {
2164
2142
  if (this.started)
2165
2143
  return;
2166
- this.sizeChangeHandler(this.mainViewSize);
2167
2144
  this.addCameraListener();
2168
2145
  this.addCameraReaction();
2169
2146
  this.started = true;
@@ -2257,10 +2234,9 @@ class MainViewProxy {
2257
2234
  this.view.callbacks.off("onSizeUpdated", this.onCameraOrSizeUpdated);
2258
2235
  }
2259
2236
  stop() {
2260
- var _a, _b;
2261
2237
  this.removeCameraListener();
2262
- (_a = this.manager.refresher) == null ? void 0 : _a.remove(Fields.MainViewCamera);
2263
- (_b = this.manager.refresher) == null ? void 0 : _b.remove(Fields.MainViewSize);
2238
+ this.manager.refresher.remove(Fields.MainViewCamera);
2239
+ this.manager.refresher.remove(Fields.MainViewSize);
2264
2240
  this.started = false;
2265
2241
  }
2266
2242
  destroy() {
@@ -2338,6 +2314,8 @@ class AppManager {
2338
2314
  this.mainViewScenesLength = 0;
2339
2315
  this.callbacksNode = null;
2340
2316
  this.appCreateQueue = new AppCreateQueue();
2317
+ this.sceneIndex$ = new Val(void 0);
2318
+ this.focused$ = new Val(void 0);
2341
2319
  this.sideEffectManager = new SideEffectManager();
2342
2320
  this.sceneState = null;
2343
2321
  this.rootDirRemoving = false;
@@ -2505,21 +2483,21 @@ class AppManager {
2505
2483
  });
2506
2484
  };
2507
2485
  this.onMainViewIndexChange = (index2) => {
2508
- if (index2 !== void 0 && this._prevSceneIndex !== index2) {
2486
+ if (index2 !== void 0 && this.sceneIndex$.value !== index2) {
2509
2487
  callbacks$1.emit("mainViewSceneIndexChange", index2);
2510
2488
  emitter.emit("changePageState");
2511
2489
  if (this.callbacksNode) {
2512
2490
  this.updateSceneState(this.callbacksNode);
2513
2491
  }
2514
- this._prevSceneIndex = index2;
2492
+ this.sceneIndex$.setValue(index2);
2515
2493
  }
2516
2494
  };
2517
2495
  this.onFocusChange = (focused) => {
2518
2496
  var _a;
2519
- if (this._prevFocused !== focused) {
2497
+ if (this.focused$.value !== focused) {
2520
2498
  callbacks$1.emit("focusedChange", focused);
2521
- emitter.emit("focusedChange", { focused, prev: this._prevFocused });
2522
- this._prevFocused = focused;
2499
+ emitter.emit("focusedChange", { focused, prev: this.focused$.value });
2500
+ this.focused$.setValue(focused);
2523
2501
  if (focused !== void 0) {
2524
2502
  (_a = this.boxManager) == null ? void 0 : _a.focusBox({ appId: focused });
2525
2503
  setTimeout(() => {
@@ -2605,12 +2583,9 @@ class AppManager {
2605
2583
  appProxy.emitAppIsWritableChange();
2606
2584
  });
2607
2585
  if (isWritable === true) {
2608
- this.mainView.disableCameraTransform = false;
2609
2586
  if (this.room && this.room.disableSerialization === true) {
2610
2587
  this.room.disableSerialization = false;
2611
2588
  }
2612
- } else {
2613
- this.mainView.disableCameraTransform = true;
2614
2589
  }
2615
2590
  emitter.emit("writableChange", isWritable);
2616
2591
  };
@@ -2715,7 +2690,7 @@ class AppManager {
2715
2690
  }
2716
2691
  }
2717
2692
  async onCreated() {
2718
- var _a, _b, _c, _d, _e, _f;
2693
+ var _a;
2719
2694
  await this.attributesUpdateCallback(this.attributes.apps);
2720
2695
  emitter.emit("updateManagerRect");
2721
2696
  boxEmitter.on("move", this.onBoxMove);
@@ -2725,32 +2700,32 @@ class AppManager {
2725
2700
  boxEmitter.on("boxStateChange", this.onBoxStateChange);
2726
2701
  this.addAppsChangeListener();
2727
2702
  this.addAppCloseListener();
2728
- (_a = this.refresher) == null ? void 0 : _a.add("maximized", () => {
2703
+ this.refresher.add("maximized", () => {
2729
2704
  return autorun(() => {
2730
2705
  var _a2;
2731
2706
  const maximized = this.attributes.maximized;
2732
2707
  (_a2 = this.boxManager) == null ? void 0 : _a2.setMaximized(Boolean(maximized));
2733
2708
  });
2734
2709
  });
2735
- (_b = this.refresher) == null ? void 0 : _b.add("minimized", () => {
2710
+ this.refresher.add("minimized", () => {
2736
2711
  return autorun(() => {
2737
2712
  const minimized = this.attributes.minimized;
2738
2713
  this.onMinimized(minimized);
2739
2714
  });
2740
2715
  });
2741
- (_c = this.refresher) == null ? void 0 : _c.add("mainViewIndex", () => {
2716
+ this.refresher.add("mainViewIndex", () => {
2742
2717
  return autorun(() => {
2743
2718
  const mainSceneIndex = get(this.attributes, "_mainSceneIndex");
2744
2719
  this.onMainViewIndexChange(mainSceneIndex);
2745
2720
  });
2746
2721
  });
2747
- (_d = this.refresher) == null ? void 0 : _d.add("focusedChange", () => {
2722
+ this.refresher.add("focusedChange", () => {
2748
2723
  return autorun(() => {
2749
2724
  const focused = get(this.attributes, "focus");
2750
2725
  this.onFocusChange(focused);
2751
2726
  });
2752
2727
  });
2753
- (_e = this.refresher) == null ? void 0 : _e.add("registeredChange", () => {
2728
+ this.refresher.add("registeredChange", () => {
2754
2729
  return autorun(() => {
2755
2730
  const registered = get(this.attributes, Fields.Registered);
2756
2731
  this.onRegisteredChange(registered);
@@ -2762,9 +2737,9 @@ class AppManager {
2762
2737
  return;
2763
2738
  this.resetScenePath(mainScenePath);
2764
2739
  }
2765
- this.displayerWritableListener(!((_f = this.room) == null ? void 0 : _f.isWritable));
2740
+ this.displayerWritableListener(!((_a = this.room) == null ? void 0 : _a.isWritable));
2766
2741
  this.displayer.callbacks.on("onEnableWriteNowChanged", this.displayerWritableListener);
2767
- this._prevFocused = this.attributes.focus;
2742
+ this.focused$.setValue(this.attributes.focus);
2768
2743
  this.sideEffectManager.add(() => {
2769
2744
  const redoUndo = new RedoUndo({
2770
2745
  mainView: () => this.mainViewProxy.view,
@@ -3013,8 +2988,8 @@ class AppManager {
3013
2988
  }
3014
2989
  callbacks$1.clearListeners();
3015
2990
  this.sideEffectManager.flushAll();
3016
- this._prevFocused = void 0;
3017
- this._prevSceneIndex = void 0;
2991
+ this.sceneIndex$.destroy();
2992
+ this.focused$.destroy();
3018
2993
  }
3019
2994
  }
3020
2995
  /*! *****************************************************************************
@@ -4596,7 +4571,6 @@ class F$3 {
4596
4571
  const createBoxManager = (manager, callbacks2, emitter2, boxEmitter2, options) => {
4597
4572
  return new BoxManager({
4598
4573
  safeSetAttributes: (attributes) => manager.safeSetAttributes(attributes),
4599
- getMainView: () => manager.mainView,
4600
4574
  updateAppState: (...args) => {
4601
4575
  var _a;
4602
4576
  return (_a = manager.appManager) == null ? void 0 : _a.store.updateAppState(...args);
@@ -4697,9 +4671,6 @@ class BoxManager {
4697
4671
  })
4698
4672
  ]);
4699
4673
  }
4700
- get mainView() {
4701
- return this.context.getMainView();
4702
- }
4703
4674
  get canOperate() {
4704
4675
  return this.context.canOperate();
4705
4676
  }
@@ -4756,7 +4727,8 @@ class BoxManager {
4756
4727
  stageRatio: createTeleBoxManagerConfig == null ? void 0 : createTeleBoxManagerConfig.stageRatio,
4757
4728
  root,
4758
4729
  fence: false,
4759
- prefersColorScheme: createTeleBoxManagerConfig == null ? void 0 : createTeleBoxManagerConfig.prefersColorScheme
4730
+ prefersColorScheme: createTeleBoxManagerConfig == null ? void 0 : createTeleBoxManagerConfig.prefersColorScheme,
4731
+ highlightStage: createTeleBoxManagerConfig == null ? void 0 : createTeleBoxManagerConfig.highlightStage
4760
4732
  };
4761
4733
  const manager = new F$3(initManagerState);
4762
4734
  if (this.teleBoxManager) {
@@ -15497,7 +15469,7 @@ const reconnectRefresher = new ReconnectRefresher({ emitter });
15497
15469
  const _WindowManager = class extends InvisiblePlugin {
15498
15470
  constructor(context) {
15499
15471
  super(context);
15500
- this.version = "1.0.0-canary.8";
15472
+ this.version = "1.0.0-canary.9";
15501
15473
  this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "1.0.0-alpha.14", "emittery": "^0.9.2", "lodash": "^4.17.21", "p-retry": "^4.6.1", "side-effect-manager": "^1.1.0", "uuid": "^7.0.3", "value-enhancer": "^1.2.1", "video.js": ">=7" }, "peerDependencies": { "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "^0.2.9", "@netless/app-media-player": "0.1.0-beta.5", "@rollup/plugin-commonjs": "^20.0.0", "@rollup/plugin-node-resolve": "^13.0.4", "@rollup/plugin-url": "^6.1.0", "@sveltejs/vite-plugin-svelte": "^1.0.0-next.22", "@tsconfig/svelte": "^2.0.1", "@types/debug": "^4.1.7", "@types/lodash": "^4.14.182", "@types/lodash-es": "^4.17.4", "@types/uuid": "^8.3.1", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.30.0", "@vitest/ui": "^0.14.1", "cypress": "^8.7.0", "dotenv": "^10.0.0", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-svelte3": "^3.2.0", "jsdom": "^19.0.0", "less": "^4.1.1", "prettier": "^2.3.2", "prettier-plugin-svelte": "^2.4.0", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-styles": "^3.14.1", "svelte": "^3.42.4", "typescript": "^4.5.5", "vite": "^2.5.3", "vitest": "^0.14.1", "white-web-sdk": "2.16.10" } };
15502
15474
  this.emitter = callbacks$1;
15503
15475
  this.viewMode = ViewMode.Broadcaster;
@@ -15561,7 +15533,8 @@ const _WindowManager = class extends InvisiblePlugin {
15561
15533
  collectorContainer: params.collectorContainer,
15562
15534
  collectorStyles: params.collectorStyles,
15563
15535
  prefersColorScheme: params.prefersColorScheme,
15564
- stageRatio: params.containerSizeRatio
15536
+ stageRatio: params.containerSizeRatio,
15537
+ highlightStage: params.highlightStage
15565
15538
  });
15566
15539
  (_a = manager.appManager) == null ? void 0 : _a.setBoxManager(manager.boxManager);
15567
15540
  if (params.container) {
@@ -15781,6 +15754,17 @@ const _WindowManager = class extends InvisiblePlugin {
15781
15754
  return false;
15782
15755
  }
15783
15756
  }
15757
+ async jumpPage(index2) {
15758
+ if (!this.appManager) {
15759
+ return false;
15760
+ }
15761
+ if (index2 < 0 || index2 >= this.pageState.length) {
15762
+ console.warn(`[WindowManager]: index ${index2} out of range`);
15763
+ return false;
15764
+ }
15765
+ await this.appManager.setMainViewSceneIndex(index2);
15766
+ return true;
15767
+ }
15784
15768
  async addPage(params) {
15785
15769
  if (this.appManager) {
15786
15770
  const after = params == null ? void 0 : params.after;