@netless/telebox-insider 1.0.0-alpha.13 → 1.0.0-alpha.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netless/telebox-insider",
3
- "version": "1.0.0-alpha.13",
3
+ "version": "1.0.0-alpha.16",
4
4
  "private": false,
5
5
  "description": "Window widget for Whiteboard",
6
6
  "license": "MIT",
@@ -744,7 +744,14 @@ export class TeleBox {
744
744
  pxIntrinsicCoord,
745
745
  collectorRect,
746
746
  ]) => {
747
- const styles = maximized
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,
@@ -817,8 +824,8 @@ export class TeleBox {
817
824
  const observer = new ResizeObserver(() => {
818
825
  const rect = $content.getBoundingClientRect();
819
826
  this._contentRect$.setValue({
820
- x: rect.x,
821
- y: rect.y,
827
+ x: 0,
828
+ y: 0,
822
829
  width: rect.width,
823
830
  height: rect.height,
824
831
  });
@@ -1184,4 +1191,5 @@ export type ReadonlyTeleBox = Pick<
1184
1191
  | "setRatio"
1185
1192
  | "setVisible"
1186
1193
  | "handleTrackStart"
1194
+ | "onValChanged"
1187
1195
  >;
@@ -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$, rootRect$, root$]).subscribe(
148
- ([minimized, rootRect, root]) => {
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,
@@ -114,8 +114,8 @@ export class TeleBoxManager {
114
114
  const observer = new ResizeObserver(() => {
115
115
  const rect = root.getBoundingClientRect();
116
116
  rootRect$.setValue({
117
- x: rect.x,
118
- y: rect.y,
117
+ x: 0,
118
+ y: 0,
119
119
  width: rect.width,
120
120
  height: rect.height,
121
121
  });
@@ -195,7 +195,6 @@ export class TeleBoxManager {
195
195
  darkMode$: darkMode$,
196
196
  namespace,
197
197
  root$,
198
- rootRect$,
199
198
  });
200
199
 
201
200
  const teleStage = new TeleStage({