@netless/telebox-insider 1.0.0-alpha.14 → 1.0.0-alpha.17
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/TeleBox/index.d.ts +2 -2
- package/dist/TeleBoxCollector/index.d.ts +1 -2
- 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 +14 -8
- package/src/TeleBoxCollector/index.ts +4 -4
- package/src/TeleBoxManager/index.ts +0 -1
package/package.json
CHANGED
package/src/TeleBox/index.ts
CHANGED
|
@@ -91,7 +91,7 @@ type MyReadonlyValConfig = {
|
|
|
91
91
|
highlightStage: ReadonlyVal<boolean, boolean>;
|
|
92
92
|
boxHighlightStage: Val<boolean | null, boolean>;
|
|
93
93
|
contentRect: Val<TeleBoxRect>;
|
|
94
|
-
contentStageRect: ReadonlyVal<TeleBoxRect
|
|
94
|
+
contentStageRect: ReadonlyVal<TeleBoxRect>;
|
|
95
95
|
};
|
|
96
96
|
|
|
97
97
|
type CombinedValEnhancedResult = ReadonlyValEnhancedResult<
|
|
@@ -744,7 +744,14 @@ export class TeleBox {
|
|
|
744
744
|
pxIntrinsicCoord,
|
|
745
745
|
collectorRect,
|
|
746
746
|
]) => {
|
|
747
|
-
const styles
|
|
747
|
+
const styles: {
|
|
748
|
+
x: number;
|
|
749
|
+
y: number;
|
|
750
|
+
width: string;
|
|
751
|
+
height: string;
|
|
752
|
+
scaleX: number;
|
|
753
|
+
scaleY: number;
|
|
754
|
+
} = maximized
|
|
748
755
|
? {
|
|
749
756
|
x: 0,
|
|
750
757
|
y: 0,
|
|
@@ -867,12 +874,10 @@ export class TeleBox {
|
|
|
867
874
|
$stage.className = this.wrapClassName("content-stage");
|
|
868
875
|
this._sideEffect.addDisposer(
|
|
869
876
|
this._contentStageRect$.subscribe((rect) => {
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
$stage.style.height = rect.height + "px";
|
|
875
|
-
}
|
|
877
|
+
$stage.style.top = rect.y + "px";
|
|
878
|
+
$stage.style.left = rect.x + "px";
|
|
879
|
+
$stage.style.width = rect.width + "px";
|
|
880
|
+
$stage.style.height = rect.height + "px";
|
|
876
881
|
}),
|
|
877
882
|
"content-stage-rect"
|
|
878
883
|
);
|
|
@@ -1184,4 +1189,5 @@ export type ReadonlyTeleBox = Pick<
|
|
|
1184
1189
|
| "setRatio"
|
|
1185
1190
|
| "setVisible"
|
|
1186
1191
|
| "handleTrackStart"
|
|
1192
|
+
| "onValChanged"
|
|
1187
1193
|
>;
|
|
@@ -24,7 +24,6 @@ export interface TeleBoxCollectorConfig {
|
|
|
24
24
|
minimized$: Val<boolean>;
|
|
25
25
|
readonly$: ReadonlyVal<boolean>;
|
|
26
26
|
darkMode$: ReadonlyVal<boolean>;
|
|
27
|
-
rootRect$: ReadonlyVal<TeleBoxRect>;
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
type ValConfig = {
|
|
@@ -51,7 +50,6 @@ export class TeleBoxCollector {
|
|
|
51
50
|
minimized$,
|
|
52
51
|
readonly$,
|
|
53
52
|
darkMode$,
|
|
54
|
-
rootRect$,
|
|
55
53
|
namespace = "telebox",
|
|
56
54
|
styles = {},
|
|
57
55
|
root$,
|
|
@@ -144,11 +142,13 @@ export class TeleBoxCollector {
|
|
|
144
142
|
}
|
|
145
143
|
}),
|
|
146
144
|
// Place after $collector appended to the DOM so that rect calc works
|
|
147
|
-
combine([minimized$,
|
|
148
|
-
([minimized,
|
|
145
|
+
combine([minimized$, root$]).subscribe(
|
|
146
|
+
([minimized, root]) => {
|
|
149
147
|
if (minimized && root) {
|
|
150
148
|
const { x, y, width, height } =
|
|
151
149
|
$collector.getBoundingClientRect();
|
|
150
|
+
const rootRect =
|
|
151
|
+
root.getBoundingClientRect();
|
|
152
152
|
rect$.setValue({
|
|
153
153
|
x: x - rootRect.x,
|
|
154
154
|
y: y - rootRect.y,
|