@netless/telebox-insider 0.2.11 → 0.2.12
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/TeleBoxManager/index.d.ts +1 -2
- package/dist/TeleBoxManager/typings.d.ts +1 -1
- package/dist/telebox-insider.cjs.js +1 -1
- package/dist/telebox-insider.cjs.js.map +1 -1
- package/dist/telebox-insider.es.js +1 -1
- package/dist/telebox-insider.es.js.map +1 -1
- package/package.json +1 -1
- package/src/TeleBoxManager/index.ts +8 -14
- package/src/TeleBoxManager/typings.ts +0 -1
package/package.json
CHANGED
|
@@ -59,7 +59,6 @@ export class TeleBoxManager {
|
|
|
59
59
|
},
|
|
60
60
|
collector,
|
|
61
61
|
namespace = "telebox",
|
|
62
|
-
zIndex = 100,
|
|
63
62
|
readonly = false,
|
|
64
63
|
}: TeleBoxManagerConfig = {}) {
|
|
65
64
|
this._sideEffect = new SideEffectManager();
|
|
@@ -67,7 +66,6 @@ export class TeleBoxManager {
|
|
|
67
66
|
|
|
68
67
|
this.root = root;
|
|
69
68
|
this.namespace = namespace;
|
|
70
|
-
this.zIndex = zIndex;
|
|
71
69
|
|
|
72
70
|
this.boxes$ = createVal<TeleBox[]>([]);
|
|
73
71
|
this.topBox$ = this.boxes$.derive((boxes) => {
|
|
@@ -346,8 +344,6 @@ export class TeleBoxManager {
|
|
|
346
344
|
|
|
347
345
|
public readonly namespace: string;
|
|
348
346
|
|
|
349
|
-
public zIndex: number;
|
|
350
|
-
|
|
351
347
|
public _darkMode$: Val<boolean, boolean>;
|
|
352
348
|
|
|
353
349
|
public get darkMode(): boolean {
|
|
@@ -387,7 +383,7 @@ export class TeleBoxManager {
|
|
|
387
383
|
smartPosition = true
|
|
388
384
|
): ReadonlyTeleBox {
|
|
389
385
|
const box = new TeleBox({
|
|
390
|
-
zIndex: this.zIndex,
|
|
386
|
+
zIndex: this.topBox ? this.topBox.zIndex + 1 : 100,
|
|
391
387
|
...(smartPosition ? this.smartPosition(config) : config),
|
|
392
388
|
darkMode: this.darkMode,
|
|
393
389
|
prefersColorScheme: this.prefersColorScheme,
|
|
@@ -696,15 +692,13 @@ export class TeleBoxManager {
|
|
|
696
692
|
}
|
|
697
693
|
|
|
698
694
|
protected makeBoxTop(box: TeleBox, skipUpdate = false): void {
|
|
699
|
-
if (
|
|
700
|
-
|
|
701
|
-
(
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
if (!skipUpdate) {
|
|
707
|
-
this.events.emit(TELE_BOX_MANAGER_EVENT.ZIndex, box);
|
|
695
|
+
if (this.topBox) {
|
|
696
|
+
if (box !== this.topBox) {
|
|
697
|
+
box.setZIndex(this.topBox.zIndex + 1, skipUpdate);
|
|
698
|
+
this.topBox$.setValue(box);
|
|
699
|
+
if (!skipUpdate) {
|
|
700
|
+
this.events.emit(TELE_BOX_MANAGER_EVENT.ZIndex, box);
|
|
701
|
+
}
|
|
708
702
|
}
|
|
709
703
|
}
|
|
710
704
|
}
|