@netless/telebox-insider 1.0.0-alpha.4 → 1.0.0-alpha.7
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 +34 -32
- package/src/TeleBoxCollector/style.scss +1 -1
- package/src/TeleBoxManager/index.ts +3 -2
- package/src/TeleStage/index.ts +2 -6
- package/src/TeleStage/style.scss +1 -1
- package/src/scss/variables.scss +2 -0
package/package.json
CHANGED
package/src/TeleBox/index.ts
CHANGED
|
@@ -719,40 +719,42 @@ export class TeleBox {
|
|
|
719
719
|
pxIntrinsicCoord,
|
|
720
720
|
collectorRect,
|
|
721
721
|
]) => {
|
|
722
|
+
const styles = maximized
|
|
723
|
+
? {
|
|
724
|
+
x: 0,
|
|
725
|
+
y: 0,
|
|
726
|
+
width: "100%",
|
|
727
|
+
height: "100%",
|
|
728
|
+
scaleX: 1,
|
|
729
|
+
scaleY: 1,
|
|
730
|
+
}
|
|
731
|
+
: {
|
|
732
|
+
x: pxIntrinsicCoord.x,
|
|
733
|
+
y: pxIntrinsicCoord.y,
|
|
734
|
+
width: pxIntrinsicSize.width + "px",
|
|
735
|
+
height: pxIntrinsicSize.height + "px",
|
|
736
|
+
scaleX: 1,
|
|
737
|
+
scaleY: 1,
|
|
738
|
+
};
|
|
722
739
|
if (minimized && collectorRect) {
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
return {
|
|
740
|
-
x: 0,
|
|
741
|
-
y: 0,
|
|
742
|
-
width: "100%",
|
|
743
|
-
height: "100%",
|
|
744
|
-
scaleX: 1,
|
|
745
|
-
scaleY: 1,
|
|
746
|
-
};
|
|
740
|
+
const boxWidth = maximized
|
|
741
|
+
? this.rootRect.width
|
|
742
|
+
: pxIntrinsicSize.width;
|
|
743
|
+
const boxHeight = maximized
|
|
744
|
+
? this.rootRect.height
|
|
745
|
+
: pxIntrinsicSize.height;
|
|
746
|
+
styles.x =
|
|
747
|
+
collectorRect.x -
|
|
748
|
+
boxWidth / 2 +
|
|
749
|
+
collectorRect.width / 2;
|
|
750
|
+
styles.y =
|
|
751
|
+
collectorRect.y -
|
|
752
|
+
boxHeight / 2 +
|
|
753
|
+
collectorRect.height / 2;
|
|
754
|
+
styles.scaleX = collectorRect.width / boxWidth;
|
|
755
|
+
styles.scaleY = collectorRect.height / boxHeight;
|
|
747
756
|
}
|
|
748
|
-
return
|
|
749
|
-
x: pxIntrinsicCoord.x,
|
|
750
|
-
y: pxIntrinsicCoord.y,
|
|
751
|
-
width: pxIntrinsicSize.width + "px",
|
|
752
|
-
height: pxIntrinsicSize.height + "px",
|
|
753
|
-
scaleX: 1,
|
|
754
|
-
scaleY: 1,
|
|
755
|
-
};
|
|
757
|
+
return styles;
|
|
756
758
|
},
|
|
757
759
|
{ compare: shallowequal }
|
|
758
760
|
);
|
|
@@ -206,8 +206,9 @@ export class TeleBoxManager {
|
|
|
206
206
|
ratio$: stageRatio$,
|
|
207
207
|
root$,
|
|
208
208
|
highlightStage$: combine(
|
|
209
|
-
[highlightStage$, maximized$],
|
|
210
|
-
([highlightStage, maximized]) =>
|
|
209
|
+
[highlightStage$, maximized$, minimized$],
|
|
210
|
+
([highlightStage, maximized, minimized]) =>
|
|
211
|
+
highlightStage && (minimized || !maximized)
|
|
211
212
|
),
|
|
212
213
|
});
|
|
213
214
|
this._sideEffect.addDisposer(() => teleStage.destroy());
|
package/src/TeleStage/index.ts
CHANGED
|
@@ -34,12 +34,8 @@ export class TeleStage {
|
|
|
34
34
|
this.highlightStage$ = highlightStage$;
|
|
35
35
|
|
|
36
36
|
this.stageRect$ = combine(
|
|
37
|
-
[rootRect$,
|
|
38
|
-
([rootRect,
|
|
39
|
-
if (!highlightStage) {
|
|
40
|
-
return rootRect;
|
|
41
|
-
}
|
|
42
|
-
|
|
37
|
+
[rootRect$, ratio$],
|
|
38
|
+
([rootRect, ratio]) => {
|
|
43
39
|
if (ratio <= 0 || rootRect.width <= 0 || rootRect.height <= 0) {
|
|
44
40
|
return rootRect;
|
|
45
41
|
}
|
package/src/TeleStage/style.scss
CHANGED
package/src/scss/variables.scss
CHANGED