@netless/telebox-insider 1.0.0-alpha.20 → 1.0.0-alpha.23

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.
@@ -47,10 +47,12 @@ declare type CombinedValEnhancedResult = ReadonlyValEnhancedResult<PropsValConfi
47
47
  export interface TeleBox extends CombinedValEnhancedResult {
48
48
  }
49
49
  export declare class TeleBox {
50
- constructor({ id, title, namespace, visible, width, height, minWidth, minHeight, x, y, resizable, draggable, boxRatio, focus, zIndex, stageRatio, titleBar, content, stage, footer, styles, userStyles, bodyStyle, stageStyle, darkMode$, fence$, minimized$, maximized$, readonly$, root, rootRect$, managerStageRect$, managerStageRatio$, defaultBoxBodyStyle$, defaultBoxStageStyle$, collectorRect$, }: TeleBoxConfig);
50
+ constructor({ id, title, namespace, visible, width, height, minWidth, minHeight, x, y, resizable, draggable, boxRatio, focus, zIndex, stageRatio, enableShadowDOM, titleBar, content, stage, footer, styles, userStyles, bodyStyle, stageStyle, darkMode$, fence$, minimized$, maximized$, readonly$, root, rootRect$, managerStageRect$, managerStageRatio$, defaultBoxBodyStyle$, defaultBoxStageStyle$, collectorRect$, }: TeleBoxConfig);
51
51
  readonly id: string;
52
52
  /** ClassName Prefix. For CSS styling. Default "telebox" */
53
53
  readonly namespace: string;
54
+ /** Enable shadow DOM for box content. Default true. */
55
+ readonly enableShadowDOM: boolean;
54
56
  readonly events: Emittery<{
55
57
  dark_mode: boolean;
56
58
  prefers_color_scheme: "light" | "dark" | "auto";
@@ -176,6 +178,8 @@ export declare class TeleBox {
176
178
  unmountUserStyles(): void;
177
179
  /** DOM of the box */
178
180
  $box: HTMLElement;
181
+ /** DOM of main area of the box. Including $body and $footer. */
182
+ $main: HTMLElement;
179
183
  /** DOM of the box body */
180
184
  $body: HTMLElement;
181
185
  /** DOM of the box content container inside box body */
@@ -193,7 +197,7 @@ export declare class TeleBox {
193
197
  private _render;
194
198
  private _renderStage;
195
199
  private _handleTrackStart?;
196
- handleTrackStart: (ev: MouseEvent | TouchEvent) => void;
200
+ handleTrackStart: (ev: PointerEvent) => void;
197
201
  private _renderResizeHandlers;
198
202
  destroy(): Promise<void>;
199
203
  /**
@@ -53,6 +53,8 @@ export interface TeleBoxConfig {
53
53
  readonly stageRatio?: number | null;
54
54
  /** Classname Prefix. For CSS styling. Default "telebox". */
55
55
  readonly namespace?: string;
56
+ /** Enable shadow DOM for box content. Default true. */
57
+ readonly enableShadowDOM?: boolean;
56
58
  /** TeleTitleBar Instance. */
57
59
  readonly titleBar?: TeleTitleBar;
58
60
  /** Box content element. */
@@ -9,7 +9,7 @@ export interface MaxTitleBarConfig extends DefaultTitleBarConfig {
9
9
  darkMode$: ReadonlyVal<boolean>;
10
10
  boxes$: ReadonlyVal<TeleBox[]>;
11
11
  rootRect$: ReadonlyVal<TeleBoxRect>;
12
- root$: ReadonlyVal<HTMLElement | null>;
12
+ root: HTMLElement;
13
13
  }
14
14
  export declare class MaxTitleBar extends DefaultTitleBar {
15
15
  constructor(config: MaxTitleBarConfig);
@@ -30,7 +30,7 @@ export interface TeleBoxManagerConfig extends Pick<TeleBoxConfig, "namespace"> {
30
30
  readonly defaultBoxStageStyle?: string | null;
31
31
  }
32
32
  declare type TeleBoxManagerBoxConfigBaseProps = "title" | "visible" | "width" | "height" | "minWidth" | "minHeight" | "x" | "y" | "resizable" | "draggable" | "boxRatio" | "zIndex" | "stageRatio";
33
- export declare type TeleBoxManagerCreateConfig = Pick<TeleBoxConfig, TeleBoxManagerBoxConfigBaseProps | "content" | "stage" | "footer" | "id" | "focus">;
33
+ export declare type TeleBoxManagerCreateConfig = Pick<TeleBoxConfig, TeleBoxManagerBoxConfigBaseProps | "content" | "stage" | "footer" | "styles" | "bodyStyle" | "stageStyle" | "id" | "focus" | "enableShadowDOM">;
34
34
  export declare type TeleBoxManagerQueryConfig = Pick<TeleBoxConfig, "title" | "visible" | "resizable" | "draggable" | "boxRatio" | "stageRatio" | "zIndex" | "id" | "focus">;
35
35
  export declare type TeleBoxManagerUpdateConfig = Pick<TeleBoxConfig, TeleBoxManagerBoxConfigBaseProps | "content" | "stage" | "footer">;
36
36
  declare type CheckTeleBoxManagerConfig<T extends Record<`${TELE_BOX_MANAGER_EVENT}`, any>> = T;
@@ -32,11 +32,5 @@ export declare class DefaultTitleBar implements TeleTitleBar {
32
32
  clientX: number;
33
33
  clientY: number;
34
34
  };
35
- protected handleTitleBarClick: (ev: MouseEvent) => void;
36
- protected lastTitleBarTouch: {
37
- timestamp: number;
38
- clientX: number;
39
- clientY: number;
40
- };
41
- protected handleTitleBarTouch: (ev: TouchEvent) => void;
35
+ protected handleTitleBarClick: (ev: PointerEvent) => void;
42
36
  }
@@ -13,7 +13,7 @@ export interface TeleTitleBarConfig {
13
13
  state$: ReadonlyVal<TeleBoxState, boolean>;
14
14
  namespace?: string;
15
15
  onEvent?: (event: TeleTitleBarEvent) => void;
16
- onDragStart?: (event: MouseEvent | TouchEvent) => void;
16
+ onDragStart?: (event: PointerEvent) => void;
17
17
  }
18
18
  export interface TeleTitleBar {
19
19
  render(): HTMLElement;