@netless/window-manager 1.0.7-beta.6 → 1.0.7-beta.8

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.mjs CHANGED
@@ -1174,6 +1174,7 @@ class AppContext {
1174
1174
  });
1175
1175
  }
1176
1176
  }
1177
+ AppContext.kind = "AppContext";
1177
1178
  class AppPageStateImpl {
1178
1179
  constructor(params) {
1179
1180
  this.params = params;
@@ -2394,6 +2395,8 @@ var TELE_BOX_EVENT = /* @__PURE__ */ ((TELE_BOX_EVENT2) => {
2394
2395
  TELE_BOX_EVENT2["Destroyed"] = "destroyed";
2395
2396
  TELE_BOX_EVENT2["BoxStatus"] = "box_status";
2396
2397
  TELE_BOX_EVENT2["LastNotMinimizedBoxStatus"] = "last_not_minimized_box_status";
2398
+ TELE_BOX_EVENT2["ForceTop"] = "force_top";
2399
+ TELE_BOX_EVENT2["ForceNormal"] = "force_normal";
2397
2400
  return TELE_BOX_EVENT2;
2398
2401
  })(TELE_BOX_EVENT || {});
2399
2402
  var TELE_BOX_DELEGATE_EVENT = /* @__PURE__ */ ((TELE_BOX_DELEGATE_EVENT2) => {
@@ -2448,7 +2451,9 @@ class DefaultTitleBar {
2448
2451
  onDragStart,
2449
2452
  namespace = "telebox",
2450
2453
  state = TELE_BOX_STATE.Normal,
2451
- boxStatus
2454
+ boxStatus,
2455
+ forceTop = false,
2456
+ forceNormal = false
2452
2457
  } = {}) {
2453
2458
  this.$btns = [];
2454
2459
  this.sideEffect = new o$1();
@@ -2522,7 +2527,14 @@ class DefaultTitleBar {
2522
2527
  this.title = title;
2523
2528
  this.state = state;
2524
2529
  this.boxStatus = boxStatus;
2525
- this.buttons = buttons || [
2530
+ this.forceTop = forceTop;
2531
+ this.forceNormal = forceNormal;
2532
+ this.buttons = buttons || (forceNormal ? [
2533
+ {
2534
+ type: TELE_BOX_DELEGATE_EVENT.Close,
2535
+ iconClassName: this.wrapClassName("titlebar-icon-close")
2536
+ }
2537
+ ] : [
2526
2538
  {
2527
2539
  type: TELE_BOX_DELEGATE_EVENT.Minimize,
2528
2540
  iconClassName: this.wrapClassName("titlebar-icon-minimize")
@@ -2536,7 +2548,7 @@ class DefaultTitleBar {
2536
2548
  type: TELE_BOX_DELEGATE_EVENT.Close,
2537
2549
  iconClassName: this.wrapClassName("titlebar-icon-close")
2538
2550
  }
2539
- ];
2551
+ ]);
2540
2552
  this.$dragArea = this.renderDragArea();
2541
2553
  }
2542
2554
  setTitle(title) {
@@ -2709,7 +2721,10 @@ class TeleBox {
2709
2721
  },
2710
2722
  collectorRect,
2711
2723
  boxStatus,
2712
- lastNotMinimizedBoxStatus
2724
+ lastNotMinimizedBoxStatus,
2725
+ forceTop = false,
2726
+ forceNormal = false,
2727
+ isDragContent = false
2713
2728
  } = {}) {
2714
2729
  this._renderSideEffect = new o$1();
2715
2730
  this.handleTrackStart = (ev) => {
@@ -2776,6 +2791,19 @@ class TeleBox {
2776
2791
  });
2777
2792
  const containerRect$ = createVal(containerRect, shallowequal);
2778
2793
  const collectorRect$ = createVal(collectorRect, shallowequal);
2794
+ const forceTop$ = createVal(forceTop);
2795
+ forceTop$.reaction((forceTop2, _2, skipUpdate) => {
2796
+ if (!skipUpdate) {
2797
+ this.events.emit(TELE_BOX_EVENT.ForceTop, forceTop2 || false);
2798
+ }
2799
+ });
2800
+ const forceNormal$ = createVal(forceNormal);
2801
+ forceNormal$.reaction((forceNormal2, _2, skipUpdate) => {
2802
+ if (!skipUpdate) {
2803
+ this.events.emit(TELE_BOX_EVENT.ForceNormal, forceNormal2 || false);
2804
+ }
2805
+ });
2806
+ const isDragContent$ = createVal(isDragContent);
2779
2807
  const title$ = createVal(title);
2780
2808
  title$.reaction((title2, _2, skipUpdate) => {
2781
2809
  if (!skipUpdate) {
@@ -2953,6 +2981,8 @@ class TeleBox {
2953
2981
  title: title$.value,
2954
2982
  namespace: this.namespace,
2955
2983
  boxStatus: boxStatus$.value,
2984
+ forceTop: forceTop$.value,
2985
+ forceNormal: forceNormal$.value,
2956
2986
  onDragStart: (event) => {
2957
2987
  var _a;
2958
2988
  return (_a = this._handleTrackStart) == null ? void 0 : _a.call(this, event);
@@ -3016,7 +3046,10 @@ class TeleBox {
3016
3046
  maximized: maximized$,
3017
3047
  $userContent: $userContent$,
3018
3048
  $userFooter: $userFooter$,
3019
- $userStyles: $userStyles$
3049
+ $userStyles: $userStyles$,
3050
+ forceTop: forceTop$,
3051
+ forceNormal: forceNormal$,
3052
+ isDragContent: isDragContent$
3020
3053
  };
3021
3054
  i$1(this, valConfig);
3022
3055
  this._state$ = state$;
@@ -3353,6 +3386,9 @@ class TeleBox {
3353
3386
  const $content = document.createElement("div");
3354
3387
  $content.className = this.wrapClassName("content") + " tele-fancy-scrollbar";
3355
3388
  this.$content = $content;
3389
+ if (this.isDragContent) {
3390
+ this.$content.appendChild(this.titleBar.$dragArea);
3391
+ }
3356
3392
  this._renderSideEffect.add(() => {
3357
3393
  let last$userStyles;
3358
3394
  return this._$userStyles$.subscribe(($userStyles) => {
@@ -3781,6 +3817,7 @@ class TeleBoxCollector {
3781
3817
  return `${this.namespace}-${className}`;
3782
3818
  }
3783
3819
  }
3820
+ TeleBoxCollector.kind = "TeleBoxCollector";
3784
3821
  var TELE_BOX_MANAGER_EVENT = /* @__PURE__ */ ((TELE_BOX_MANAGER_EVENT2) => {
3785
3822
  TELE_BOX_MANAGER_EVENT2["Focused"] = "focused";
3786
3823
  TELE_BOX_MANAGER_EVENT2["Blurred"] = "blurred";
@@ -3828,7 +3865,7 @@ class MaxTitleBar extends DefaultTitleBar {
3828
3865
  if (this.getBoxesStatus) {
3829
3866
  const boxesStatus = this.getBoxesStatus();
3830
3867
  if (boxesStatus) {
3831
- return this.boxes.filter((box) => boxesStatus && boxesStatus.get(box.id) === TELE_BOX_STATE.Maximized);
3868
+ return this.boxes.filter((box) => boxesStatus && boxesStatus.get(box.id) === TELE_BOX_STATE.Maximized && !box.forceTop);
3832
3869
  }
3833
3870
  }
3834
3871
  return [];
@@ -4169,6 +4206,9 @@ class TeleBoxManager {
4169
4206
  if (boxes.length > 0) {
4170
4207
  let currentTopBox = void 0;
4171
4208
  const topBox = boxes.reduce((topBox2, box) => {
4209
+ if (box.forceTop) {
4210
+ return topBox2;
4211
+ }
4172
4212
  if (box.boxStatus && box.boxStatus === TELE_BOX_STATE.Minimized) {
4173
4213
  return topBox2;
4174
4214
  }
@@ -4519,6 +4559,21 @@ class TeleBoxManager {
4519
4559
  get topBox() {
4520
4560
  return this.topBox$.value;
4521
4561
  }
4562
+ get forceTopBoxes() {
4563
+ return this.boxes.find((box) => box.forceTop);
4564
+ }
4565
+ get maxForceTopBox() {
4566
+ return this.boxes.reduce((maxTopBox, box) => {
4567
+ var _a;
4568
+ if (box.forceTop && box.zIndex > ((_a = maxTopBox == null ? void 0 : maxTopBox.zIndex) != null ? _a : 0)) {
4569
+ return box;
4570
+ }
4571
+ return maxTopBox;
4572
+ }, void 0);
4573
+ }
4574
+ get forceNormalBoxes() {
4575
+ return this.boxes.find((box) => box.forceNormal);
4576
+ }
4522
4577
  get darkMode() {
4523
4578
  return this._darkMode$.value;
4524
4579
  }
@@ -4605,7 +4660,7 @@ class TeleBoxManager {
4605
4660
  var _a;
4606
4661
  const boxStatus = this.boxesStatus$.get(box.id);
4607
4662
  if (boxStatus) {
4608
- if (boxStatus !== TELE_BOX_STATE.Minimized && box.zIndex > ((_a = newTopBox == null ? void 0 : newTopBox.zIndex) != null ? _a : 0)) {
4663
+ if (boxStatus !== TELE_BOX_STATE.Minimized && !this.isForceTop(box) && box.zIndex > ((_a = newTopBox == null ? void 0 : newTopBox.zIndex) != null ? _a : 0)) {
4609
4664
  newTopBox = box;
4610
4665
  }
4611
4666
  box.setBoxStatus(boxStatus, skipUpdate);
@@ -4789,7 +4844,7 @@ class TeleBoxManager {
4789
4844
  return this.getUnabledBoxesStatusZIndex();
4790
4845
  }
4791
4846
  return this.boxes.reduce((maxZIndex, box) => {
4792
- if (box.boxStatus && box.boxStatus === TELE_BOX_STATE.Maximized) {
4847
+ if (box.boxStatus && box.boxStatus === TELE_BOX_STATE.Maximized && !this.isForceTop(box)) {
4793
4848
  return Math.max(maxZIndex, box.zIndex);
4794
4849
  }
4795
4850
  return maxZIndex;
@@ -4800,15 +4855,32 @@ class TeleBoxManager {
4800
4855
  return this.getUnabledBoxesStatusZIndex();
4801
4856
  }
4802
4857
  return this.boxes.reduce((maxZIndex, box) => {
4803
- if (box.boxStatus && box.boxStatus === TELE_BOX_STATE.Normal) {
4858
+ if (box.boxStatus && box.boxStatus === TELE_BOX_STATE.Normal && !this.isForceTop(box)) {
4804
4859
  return Math.max(maxZIndex, box.zIndex);
4805
4860
  }
4806
4861
  return maxZIndex;
4807
4862
  }, 299);
4808
4863
  }
4864
+ getMaxForceTopBoxZIndex() {
4865
+ if (!this.useBoxesStatus) {
4866
+ return this.getUnabledBoxesStatusZIndex();
4867
+ }
4868
+ return this.boxes.reduce((maxZIndex, box) => {
4869
+ if (box.boxStatus && this.isForceTop(box)) {
4870
+ return Math.max(maxZIndex, box.zIndex);
4871
+ }
4872
+ return maxZIndex;
4873
+ }, 699);
4874
+ }
4875
+ isForceNormal(box) {
4876
+ return box._forceNormal$.value;
4877
+ }
4878
+ isForceTop(box) {
4879
+ return box._forceTop$.value;
4880
+ }
4809
4881
  create(config = {}, smartPosition = true) {
4810
4882
  const box = new TeleBox({
4811
- zIndex: this.getMaxNormalBoxZIndex() + 1,
4883
+ zIndex: config.forceTop ? this.getMaxForceTopBoxZIndex() + 1 : this.getMaxNormalBoxZIndex() + 1,
4812
4884
  ...smartPosition ? this.smartPosition(config) : config,
4813
4885
  darkMode: this.darkMode,
4814
4886
  prefersColorScheme: this.prefersColorScheme,
@@ -4836,13 +4908,16 @@ class TeleBoxManager {
4836
4908
  }
4837
4909
  box._delegateEvents.on(TELE_BOX_DELEGATE_EVENT.Maximize, () => {
4838
4910
  if (this.useBoxesStatus && box.boxStatus) {
4911
+ if (box._forceNormal$.value) {
4912
+ return;
4913
+ }
4839
4914
  if (box.boxStatus === TELE_BOX_STATE.Maximized) {
4840
4915
  this.setBox(box.id, {
4841
4916
  status: TELE_BOX_STATE.Normal,
4842
4917
  zIndex: this.getMaxNormalBoxZIndex() + 1
4843
4918
  }, false);
4844
4919
  } else {
4845
- [...this.boxes].filter((box2) => box2.boxStatus === TELE_BOX_STATE.Normal).sort((a2, b2) => a2.zIndex - b2.zIndex).forEach((box2) => {
4920
+ [...this.boxes].filter((box2) => box2.boxStatus === TELE_BOX_STATE.Normal && !this.isForceNormal(box2)).sort((a2, b2) => a2.zIndex - b2.zIndex).forEach((box2) => {
4846
4921
  if (box2.boxStatus === TELE_BOX_STATE.Normal) {
4847
4922
  this.setBox(box2.id, {
4848
4923
  status: TELE_BOX_STATE.Maximized,
@@ -4858,6 +4933,9 @@ class TeleBoxManager {
4858
4933
  });
4859
4934
  box._delegateEvents.on(TELE_BOX_DELEGATE_EVENT.Minimize, () => {
4860
4935
  if (box.boxStatus && this.useBoxesStatus) {
4936
+ if (box._forceNormal$.value) {
4937
+ return;
4938
+ }
4861
4939
  if (box.focus) {
4862
4940
  this.blurBox(box);
4863
4941
  }
@@ -4907,6 +4985,9 @@ class TeleBoxManager {
4907
4985
  if (this.boxes.length > 0) {
4908
4986
  let currentTopBox = void 0;
4909
4987
  const topBox = this.boxes.reduce((topBox2, box2) => {
4988
+ if (this.isForceTop(box2)) {
4989
+ return topBox2;
4990
+ }
4910
4991
  if (box2.boxStatus && box2.boxStatus === TELE_BOX_STATE.Minimized) {
4911
4992
  return topBox2;
4912
4993
  }
@@ -5136,13 +5217,27 @@ class TeleBoxManager {
5136
5217
  lastNotMinimizedBoxStatus: config.lastNotMinimizedBoxStatus
5137
5218
  }, skipUpdate);
5138
5219
  }
5220
+ if (config.forceTop != null) {
5221
+ box.setForceTop(config.forceTop, skipUpdate);
5222
+ }
5223
+ if (config.forceNormal != null) {
5224
+ box.setForceNormal(config.forceNormal, skipUpdate);
5225
+ }
5139
5226
  }
5140
5227
  smartPosition(config = {}) {
5141
5228
  let { x: x2, y: y2 } = config;
5142
5229
  const { width = 0.5, height = 0.5 } = config;
5143
5230
  if (x2 == null) {
5144
5231
  let vx = 20;
5145
- if (this.topBox) {
5232
+ if (config.forceTop) {
5233
+ const forceTopBox = this.maxForceTopBox || this.topBox;
5234
+ if (forceTopBox) {
5235
+ vx = forceTopBox.intrinsicX * this.containerRect.width + 20;
5236
+ if (vx > this.containerRect.width - width * this.containerRect.width) {
5237
+ vx = 20;
5238
+ }
5239
+ }
5240
+ } else if (this.topBox) {
5146
5241
  vx = this.topBox.intrinsicX * this.containerRect.width + 20;
5147
5242
  if (vx > this.containerRect.width - width * this.containerRect.width) {
5148
5243
  vx = 20;
@@ -5156,7 +5251,15 @@ class TeleBoxManager {
5156
5251
  }
5157
5252
  if (y2 == null) {
5158
5253
  let vy = 20;
5159
- if (this.topBox) {
5254
+ if (config.forceTop) {
5255
+ const forceTopBox = this.maxForceTopBox || this.topBox;
5256
+ if (forceTopBox) {
5257
+ vy = forceTopBox.intrinsicY * this.containerRect.height + 20;
5258
+ if (vy > this.containerRect.height - height * this.containerRect.height) {
5259
+ vy = 20;
5260
+ }
5261
+ }
5262
+ } else if (this.topBox) {
5160
5263
  vy = this.topBox.intrinsicY * this.containerRect.height + 20;
5161
5264
  if (vy > this.containerRect.height - height * this.containerRect.height) {
5162
5265
  vy = 20;
@@ -5221,6 +5324,7 @@ class TeleBoxManager {
5221
5324
  return;
5222
5325
  }
5223
5326
  }
5327
+ TeleBoxManager.kind = "TeleBoxManager";
5224
5328
  const createBoxManager = (manager, callbacks2, emitter, boxEmitter2, options) => {
5225
5329
  const BoxManagerClass = getExtendClass$1(BoxManager, WindowManager.extendClass);
5226
5330
  return new BoxManagerClass(
@@ -5408,7 +5512,10 @@ class BoxManager {
5408
5512
  width,
5409
5513
  height,
5410
5514
  id: params.appId,
5411
- boxStatus: params.boxStatus
5515
+ boxStatus: params.boxStatus,
5516
+ forceTop: params.forceTop,
5517
+ forceNormal: params.forceNormal,
5518
+ isDragContent: params.isDragContent
5412
5519
  };
5413
5520
  this.teleBoxManager.create(createBoxConfig, params.smartPosition);
5414
5521
  this.context.emitter.emit(`${params.appId}${Events.WindowCreated}`);
@@ -5505,7 +5612,10 @@ class BoxManager {
5505
5612
  height: state.height || 0.5,
5506
5613
  zIndex: state.zIndex,
5507
5614
  boxStatus: state.boxStatus,
5508
- lastNotMinimizedBoxStatus: state.lastNotMinimizedBoxStatus
5615
+ lastNotMinimizedBoxStatus: state.lastNotMinimizedBoxStatus,
5616
+ forceTop: state.forceTop,
5617
+ forceNormal: state.forceNormal,
5618
+ isDragContent: state.isDragContent
5509
5619
  },
5510
5620
  true
5511
5621
  );
@@ -5593,6 +5703,7 @@ class BoxManager {
5593
5703
  this.teleBoxManager.destroy();
5594
5704
  }
5595
5705
  }
5706
+ BoxManager.kind = "BoxManager";
5596
5707
  const log = (...args) => {
5597
5708
  if (WindowManager.debug) {
5598
5709
  console.log(`[WindowManager]:`, ...args);
@@ -6858,26 +6969,31 @@ class CursorManager {
6858
6969
  }
6859
6970
  }
6860
6971
  }
6972
+ CursorManager.kind = "CursorManager";
6861
6973
  function getExtendClass$1(baseClass, extendClass) {
6862
- switch (baseClass.name) {
6863
- case "AppManager":
6864
- return (extendClass == null ? void 0 : extendClass.AppManager) || AppManager;
6865
- case "BoxManager":
6866
- return (extendClass == null ? void 0 : extendClass.BoxManager) || BoxManager;
6867
- case "AttributesDelegate":
6868
- return (extendClass == null ? void 0 : extendClass.AttributesDelegate) || AttributesDelegate;
6869
- case "CursorManager":
6870
- return (extendClass == null ? void 0 : extendClass.CursorManager) || CursorManager;
6871
- case "AppProxy":
6872
- return (extendClass == null ? void 0 : extendClass.AppProxy) || AppProxy;
6873
- case "AppContext":
6874
- return (extendClass == null ? void 0 : extendClass.AppContext) || AppContext;
6875
- case "TeleBoxManager":
6876
- return (extendClass == null ? void 0 : extendClass.TeleBoxManager) || TeleBoxManager;
6877
- case "TeleBoxCollector":
6878
- return (extendClass == null ? void 0 : extendClass.TeleBoxCollector) || TeleBoxCollector;
6879
- default:
6880
- return baseClass;
6974
+ if (baseClass.kind && extendClass && Object.keys(extendClass).includes(baseClass.kind)) {
6975
+ switch (baseClass.kind) {
6976
+ case "AppManager":
6977
+ return (extendClass == null ? void 0 : extendClass.AppManager) || AppManager;
6978
+ case "BoxManager":
6979
+ return (extendClass == null ? void 0 : extendClass.BoxManager) || BoxManager;
6980
+ case "AttributesDelegate":
6981
+ return (extendClass == null ? void 0 : extendClass.AttributesDelegate) || AttributesDelegate;
6982
+ case "CursorManager":
6983
+ return (extendClass == null ? void 0 : extendClass.CursorManager) || CursorManager;
6984
+ case "AppProxy":
6985
+ return (extendClass == null ? void 0 : extendClass.AppProxy) || AppProxy;
6986
+ case "AppContext":
6987
+ return (extendClass == null ? void 0 : extendClass.AppContext) || AppContext;
6988
+ case "TeleBoxManager":
6989
+ return (extendClass == null ? void 0 : extendClass.TeleBoxManager) || TeleBoxManager;
6990
+ case "TeleBoxCollector":
6991
+ return (extendClass == null ? void 0 : extendClass.TeleBoxCollector) || TeleBoxCollector;
6992
+ default:
6993
+ return baseClass;
6994
+ }
6995
+ } else {
6996
+ return baseClass;
6881
6997
  }
6882
6998
  }
6883
6999
  var Fields = /* @__PURE__ */ ((Fields2) => {
@@ -6973,7 +7089,14 @@ class AttributesDelegate {
6973
7089
  attrNames.push("scenes");
6974
7090
  }
6975
7091
  const options = pick(params.options, attrNames);
6976
- const attrs = { kind: params.kind, options, isDynamicPPT };
7092
+ const attrs = {
7093
+ kind: params.kind,
7094
+ options,
7095
+ isDynamicPPT,
7096
+ forceTop: params.forceTop,
7097
+ forceNormal: params.forceNormal,
7098
+ isDragContent: params.isDragContent
7099
+ };
6977
7100
  if (typeof params.src === "string") {
6978
7101
  attrs.src = params.src;
6979
7102
  }
@@ -7088,6 +7211,7 @@ class AttributesDelegate {
7088
7211
  }
7089
7212
  }
7090
7213
  }
7214
+ AttributesDelegate.kind = "AttributesDelegate";
7091
7215
  const createAttributesDelegate = (extendClass, context = {
7092
7216
  getAttributes: () => {
7093
7217
  throw new Error("getAttributes not implemented");
@@ -7117,7 +7241,7 @@ const calculateNextIndex = (index2, pageState) => {
7117
7241
  return nextIndex;
7118
7242
  };
7119
7243
  const boxEmitter = new Emittery();
7120
- class AppProxy {
7244
+ const _AppProxy = class {
7121
7245
  constructor(params, manager, appId, isAddApp) {
7122
7246
  var _a;
7123
7247
  this.params = params;
@@ -7140,6 +7264,7 @@ class AppProxy {
7140
7264
  const minimized = (_b = this.attributes) == null ? void 0 : _b["minimized"];
7141
7265
  const boxStatus = (_c = this.store.getBoxStatus(id2)) != null ? _c : void 0;
7142
7266
  const lastNotMinimizedBoxStatus = (_d = this.store.getLastNotMinimizedBoxStatus(id2)) != null ? _d : void 0;
7267
+ const { forceTop, forceNormal, isDragContent } = this.store.getAppAttributes(id2);
7143
7268
  const zIndex = attrs == null ? void 0 : attrs.zIndex;
7144
7269
  let payload = { maximized, minimized, zIndex };
7145
7270
  if (position) {
@@ -7160,6 +7285,15 @@ class AppProxy {
7160
7285
  if (lastNotMinimizedBoxStatus) {
7161
7286
  payload = { ...payload, lastNotMinimizedBoxStatus };
7162
7287
  }
7288
+ if (forceTop) {
7289
+ payload = { ...payload, forceTop };
7290
+ }
7291
+ if (forceNormal) {
7292
+ payload = { ...payload, forceNormal };
7293
+ }
7294
+ if (isDragContent) {
7295
+ payload = { ...payload, isDragContent };
7296
+ }
7163
7297
  return payload;
7164
7298
  };
7165
7299
  this.appAttributesUpdateListener = (appId2) => {
@@ -7284,7 +7418,10 @@ class AppProxy {
7284
7418
  appImpl,
7285
7419
  params.options,
7286
7420
  appParams == null ? void 0 : appParams.appOptions,
7287
- this.manager.useBoxesStatus ? TELE_BOX_STATE.Normal : void 0
7421
+ this.manager.useBoxesStatus ? TELE_BOX_STATE.Normal : void 0,
7422
+ params.forceTop,
7423
+ params.forceNormal,
7424
+ params.isDragContent
7288
7425
  );
7289
7426
  } else {
7290
7427
  throw new Error(`[WindowManager]: app load failed ${params.kind} ${params.src}`);
@@ -7299,9 +7436,9 @@ class AppProxy {
7299
7436
  var _a;
7300
7437
  return (_a = this.boxManager) == null ? void 0 : _a.getBox(this.id);
7301
7438
  }
7302
- async setupApp(appId, skipUpdate, app, options, appOptions, boxStatus) {
7439
+ async setupApp(appId, skipUpdate, app, options, appOptions, boxStatus, forceTop, forceNormal, isDragContent) {
7303
7440
  var _a;
7304
- log("setupApp", appId, app, options, boxStatus);
7441
+ log("setupApp", appId, app, options, boxStatus, forceTop, forceNormal, isDragContent);
7305
7442
  if (!this.boxManager) {
7306
7443
  throw new BoxManagerNotFoundError();
7307
7444
  }
@@ -7342,7 +7479,10 @@ class AppProxy {
7342
7479
  options,
7343
7480
  canOperate: this.manager.canOperate,
7344
7481
  smartPosition: this.isAddApp,
7345
- boxStatus
7482
+ boxStatus,
7483
+ forceTop,
7484
+ forceNormal,
7485
+ isDragContent
7346
7486
  });
7347
7487
  if (this.isAddApp && this.box) {
7348
7488
  if (boxStatus) {
@@ -7399,7 +7539,7 @@ class AppProxy {
7399
7539
  const currentAppState = this.getAppInitState(this.id);
7400
7540
  await this.destroy(true, false, true);
7401
7541
  const params = this.params;
7402
- const AppProxyClass = getExtendClass$1(AppProxy, WindowManager.extendClass);
7542
+ const AppProxyClass = getExtendClass$1(_AppProxy, WindowManager.extendClass);
7403
7543
  const appProxy = new AppProxyClass(params, this.manager, this.id, this.isAddApp);
7404
7544
  await appProxy.baseInsertApp(true);
7405
7545
  (_a = this.boxManager) == null ? void 0 : _a.updateBoxState(currentAppState);
@@ -7560,7 +7700,9 @@ class AppProxy {
7560
7700
  close() {
7561
7701
  return this.destroy(true, true, false);
7562
7702
  }
7563
- }
7703
+ };
7704
+ let AppProxy = _AppProxy;
7705
+ AppProxy.kind = "AppProxy";
7564
7706
  class ViewManager {
7565
7707
  constructor(displayer) {
7566
7708
  this.displayer = displayer;
@@ -8480,7 +8622,10 @@ class AppManager {
8480
8622
  {
8481
8623
  kind: app.kind,
8482
8624
  options: app.options,
8483
- isDynamicPPT: app.isDynamicPPT
8625
+ isDynamicPPT: app.isDynamicPPT,
8626
+ forceNormal: app.forceNormal,
8627
+ forceTop: app.forceTop,
8628
+ isDragContent: app.isDragContent
8484
8629
  },
8485
8630
  id2,
8486
8631
  false
@@ -8713,6 +8858,7 @@ class AppManager {
8713
8858
  this._focusAppCreatedResolve = void 0;
8714
8859
  }
8715
8860
  }
8861
+ AppManager.kind = "AppManager";
8716
8862
  const ResizeObserver$2 = window.ResizeObserver || ResizeObserver$3;
8717
8863
  class ContainerResizeObserver {
8718
8864
  constructor(emitter) {
@@ -19469,40 +19615,44 @@ class ExtendPluginManager {
19469
19615
  }
19470
19616
  }
19471
19617
  function getExtendClass(baseClass, extendClass) {
19472
- switch (baseClass.name) {
19473
- case "AppManager":
19474
- return (extendClass == null ? void 0 : extendClass.AppManager) || AppManager;
19475
- case "BoxManager":
19476
- return (extendClass == null ? void 0 : extendClass.BoxManager) || BoxManager;
19477
- case "AttributesDelegate":
19478
- return (extendClass == null ? void 0 : extendClass.AttributesDelegate) || AttributesDelegate;
19479
- case "CursorManager":
19480
- return (extendClass == null ? void 0 : extendClass.CursorManager) || CursorManager;
19481
- case "AppProxy":
19482
- return (extendClass == null ? void 0 : extendClass.AppProxy) || AppProxy;
19483
- case "AppContext":
19484
- return (extendClass == null ? void 0 : extendClass.AppContext) || AppContext;
19485
- case "TeleBoxManager":
19486
- return (extendClass == null ? void 0 : extendClass.TeleBoxManager) || TeleBoxManager;
19487
- case "TeleBoxCollector":
19488
- return (extendClass == null ? void 0 : extendClass.TeleBoxCollector) || TeleBoxCollector;
19489
- default:
19490
- return baseClass;
19618
+ if (baseClass.kind && extendClass && Object.keys(extendClass).includes(baseClass.kind)) {
19619
+ switch (baseClass.kind) {
19620
+ case "AppManager":
19621
+ return (extendClass == null ? void 0 : extendClass.AppManager) || AppManager;
19622
+ case "BoxManager":
19623
+ return (extendClass == null ? void 0 : extendClass.BoxManager) || BoxManager;
19624
+ case "AttributesDelegate":
19625
+ return (extendClass == null ? void 0 : extendClass.AttributesDelegate) || AttributesDelegate;
19626
+ case "CursorManager":
19627
+ return (extendClass == null ? void 0 : extendClass.CursorManager) || CursorManager;
19628
+ case "AppProxy":
19629
+ return (extendClass == null ? void 0 : extendClass.AppProxy) || AppProxy;
19630
+ case "AppContext":
19631
+ return (extendClass == null ? void 0 : extendClass.AppContext) || AppContext;
19632
+ case "TeleBoxManager":
19633
+ return (extendClass == null ? void 0 : extendClass.TeleBoxManager) || TeleBoxManager;
19634
+ case "TeleBoxCollector":
19635
+ return (extendClass == null ? void 0 : extendClass.TeleBoxCollector) || TeleBoxCollector;
19636
+ default:
19637
+ return baseClass;
19638
+ }
19639
+ } else {
19640
+ return baseClass;
19491
19641
  }
19492
19642
  }
19493
19643
  const reconnectRefresher = new ReconnectRefresher({ emitter: internalEmitter });
19494
19644
  const _WindowManager = class extends InvisiblePlugin {
19495
19645
  constructor(context) {
19496
19646
  super(context);
19497
- this.version = "1.0.7-beta.6";
19498
- this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.3.0-beta.10", "emittery": "^0.9.2", "lodash": "^4.17.21", "p-retry": "^4.6.1", "uuid": "^7.0.3", "video.js": ">=7" }, "peerDependencies": { "jspdf": "2.5.1", "white-web-sdk": "^2.16.52" }, "devDependencies": { "@hyrious/dts": "^0.2.2", "@netless/app-docs-viewer": "^0.2.19", "@netless/app-media-player": "0.1.4", "@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.30", "@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", "jspdf": "^2.5.1", "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", "side-effect-manager": "0.1.5", "svelte": "^3.42.4", "typescript": "^4.5.5", "vite": "^2.9.9", "vitest": "^0.14.1", "white-web-sdk": "^2.16.52" } };
19647
+ this.version = "1.0.7-beta.8";
19648
+ this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.3.0-beta.14", "emittery": "^0.9.2", "lodash": "^4.17.21", "p-retry": "^4.6.1", "uuid": "^7.0.3", "video.js": ">=7" }, "peerDependencies": { "jspdf": "2.5.1", "white-web-sdk": "^2.16.52" }, "devDependencies": { "@hyrious/dts": "^0.2.2", "@netless/app-docs-viewer": "^0.2.19", "@netless/app-media-player": "0.1.4", "@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.30", "@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", "jspdf": "^2.5.1", "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", "side-effect-manager": "0.1.5", "svelte": "^3.42.4", "typescript": "^4.5.5", "vite": "^2.9.9", "vitest": "^0.14.1", "white-web-sdk": "^2.16.52" } };
19499
19649
  this.emitter = callbacks$1;
19500
19650
  this.viewMode = ViewMode.Broadcaster;
19501
19651
  this.isReplay = isPlayer(this.displayer);
19502
19652
  this._cursorUIDs = [];
19503
19653
  this.containerSizeRatio = _WindowManager.containerSizeRatio;
19504
19654
  _WindowManager.displayer = context.displayer;
19505
- window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.3.0-beta.10", "emittery": "^0.9.2", "lodash": "^4.17.21", "p-retry": "^4.6.1", "uuid": "^7.0.3", "video.js": ">=7" }, "peerDependencies": { "jspdf": "2.5.1", "white-web-sdk": "^2.16.52" }, "devDependencies": { "@hyrious/dts": "^0.2.2", "@netless/app-docs-viewer": "^0.2.19", "@netless/app-media-player": "0.1.4", "@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.30", "@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", "jspdf": "^2.5.1", "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", "side-effect-manager": "0.1.5", "svelte": "^3.42.4", "typescript": "^4.5.5", "vite": "^2.9.9", "vitest": "^0.14.1", "white-web-sdk": "^2.16.52" } };
19655
+ window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.3.0-beta.14", "emittery": "^0.9.2", "lodash": "^4.17.21", "p-retry": "^4.6.1", "uuid": "^7.0.3", "video.js": ">=7" }, "peerDependencies": { "jspdf": "2.5.1", "white-web-sdk": "^2.16.52" }, "devDependencies": { "@hyrious/dts": "^0.2.2", "@netless/app-docs-viewer": "^0.2.19", "@netless/app-media-player": "0.1.4", "@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.30", "@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", "jspdf": "^2.5.1", "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", "side-effect-manager": "0.1.5", "svelte": "^3.42.4", "typescript": "^4.5.5", "vite": "^2.9.9", "vitest": "^0.14.1", "white-web-sdk": "^2.16.52" } };
19506
19656
  }
19507
19657
  static onCreate(manager) {
19508
19658
  _WindowManager._resolve(manager);