@netless/telebox-insider 1.0.0-alpha.7 → 1.0.0-alpha.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/style.css +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/TeleBox/index.ts +11 -16
- package/src/TeleBoxManager/MaxTitleBar/index.ts +0 -5
- package/src/TeleBoxManager/MaxTitleBar/style.scss +5 -2
- package/src/TeleBoxManager/index.ts +8 -10
- package/src/scss/variables.scss +3 -2
package/package.json
CHANGED
package/src/TeleBox/index.ts
CHANGED
|
@@ -737,12 +737,9 @@ export class TeleBox {
|
|
|
737
737
|
scaleY: 1,
|
|
738
738
|
};
|
|
739
739
|
if (minimized && collectorRect) {
|
|
740
|
-
const boxWidth = maximized
|
|
741
|
-
? this.rootRect
|
|
742
|
-
: pxIntrinsicSize
|
|
743
|
-
const boxHeight = maximized
|
|
744
|
-
? this.rootRect.height
|
|
745
|
-
: pxIntrinsicSize.height;
|
|
740
|
+
const { width: boxWidth, height: boxHeight } = maximized
|
|
741
|
+
? this.rootRect
|
|
742
|
+
: pxIntrinsicSize;
|
|
746
743
|
styles.x =
|
|
747
744
|
collectorRect.x -
|
|
748
745
|
boxWidth / 2 +
|
|
@@ -792,16 +789,14 @@ export class TeleBox {
|
|
|
792
789
|
this.$content = $content;
|
|
793
790
|
|
|
794
791
|
this._sideEffect.add(() => {
|
|
795
|
-
const observer = new ResizeObserver((
|
|
796
|
-
const rect =
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
});
|
|
804
|
-
}
|
|
792
|
+
const observer = new ResizeObserver(() => {
|
|
793
|
+
const rect = $content.getBoundingClientRect();
|
|
794
|
+
this._contentRect$.setValue({
|
|
795
|
+
x: rect.x,
|
|
796
|
+
y: rect.y,
|
|
797
|
+
width: rect.width,
|
|
798
|
+
height: rect.height,
|
|
799
|
+
});
|
|
805
800
|
});
|
|
806
801
|
observer.observe($content);
|
|
807
802
|
return () => observer.disconnect();
|
|
@@ -75,11 +75,6 @@ export class MaxTitleBar extends DefaultTitleBar {
|
|
|
75
75
|
|
|
76
76
|
this.sideEffect.addDisposer(
|
|
77
77
|
[
|
|
78
|
-
this.rootRect$.subscribe((rootRect) => {
|
|
79
|
-
const { x, y, width } = rootRect;
|
|
80
|
-
$titleBar.style.transform = `translate(${x}px, ${y}px)`;
|
|
81
|
-
$titleBar.style.width = width + "px";
|
|
82
|
-
}),
|
|
83
78
|
this.state$.subscribe((state) => {
|
|
84
79
|
$titleBar.classList.toggle(
|
|
85
80
|
this.wrapClassName("max-titlebar-maximized"),
|
|
@@ -16,7 +16,10 @@ $scrollbar-color-active: rgba(238, 238, 247, 1);
|
|
|
16
16
|
position: absolute;
|
|
17
17
|
top: 0;
|
|
18
18
|
left: 0;
|
|
19
|
-
|
|
19
|
+
width: 100%;
|
|
20
|
+
z-index: $max-titlebar-z-index;
|
|
21
|
+
border-top-left-radius: 6px;
|
|
22
|
+
border-top-right-radius: 6px;
|
|
20
23
|
|
|
21
24
|
.#{$namespace}-title {
|
|
22
25
|
display: none;
|
|
@@ -95,7 +98,7 @@ $scrollbar-color-active: rgba(238, 238, 247, 1);
|
|
|
95
98
|
height: 100%;
|
|
96
99
|
overflow: hidden;
|
|
97
100
|
max-width: 182px;
|
|
98
|
-
min-width:
|
|
101
|
+
min-width: 150px;
|
|
99
102
|
padding: 0 26px 0 16px;
|
|
100
103
|
outline: none;
|
|
101
104
|
font-size: 13px;
|
|
@@ -111,16 +111,14 @@ export class TeleBoxManager {
|
|
|
111
111
|
if (!root) {
|
|
112
112
|
return () => void 0;
|
|
113
113
|
}
|
|
114
|
-
const observer = new ResizeObserver((
|
|
115
|
-
const rect =
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
});
|
|
123
|
-
}
|
|
114
|
+
const observer = new ResizeObserver(() => {
|
|
115
|
+
const rect = root.getBoundingClientRect();
|
|
116
|
+
rootRect$.setValue({
|
|
117
|
+
x: rect.x,
|
|
118
|
+
y: rect.y,
|
|
119
|
+
width: rect.width,
|
|
120
|
+
height: rect.height,
|
|
121
|
+
});
|
|
124
122
|
});
|
|
125
123
|
observer.observe(root);
|
|
126
124
|
return () => observer.disconnect();
|
package/src/scss/variables.scss
CHANGED