@netless/telebox-insider 1.0.0-alpha.1 → 1.0.0-alpha.4
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 +5 -11
- package/dist/TeleBox/typings.d.ts +2 -0
- package/dist/TeleBoxCollector/index.d.ts +8 -6
- package/dist/TeleBoxManager/MaxTitleBar/index.d.ts +1 -0
- package/dist/TeleBoxManager/index.d.ts +9 -1
- package/dist/TeleBoxManager/typings.d.ts +1 -1
- package/dist/TeleStage/index.d.ts +2 -6
- package/dist/TeleTitleBar/DefaultTitleBar/index.d.ts +3 -5
- package/dist/TeleTitleBar/typings.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/telebox-insider.cjs.js +1 -15
- package/dist/telebox-insider.cjs.js.map +1 -1
- package/dist/telebox-insider.es.js +1 -15
- package/dist/telebox-insider.es.js.map +1 -1
- package/package.json +3 -2
- package/src/TeleBox/index.ts +48 -34
- package/src/TeleBox/typings.ts +2 -0
- package/src/TeleBoxCollector/index.ts +30 -16
- package/src/TeleBoxManager/MaxTitleBar/index.ts +16 -3
- package/src/TeleBoxManager/index.ts +47 -26
- package/src/TeleBoxManager/typings.ts +1 -1
- package/src/TeleStage/index.ts +3 -14
- package/src/TeleStage/style.scss +1 -1
- package/src/TeleTitleBar/DefaultTitleBar/index.ts +4 -12
- package/src/TeleTitleBar/typings.ts +1 -1
|
@@ -14,7 +14,7 @@ import type {
|
|
|
14
14
|
TeleTitleBarEvent,
|
|
15
15
|
} from "../typings";
|
|
16
16
|
import { preventEvent } from "../../utils";
|
|
17
|
-
import {
|
|
17
|
+
import type { ReadonlyVal } from "value-enhancer";
|
|
18
18
|
|
|
19
19
|
export type DefaultTitleBarButton = TeleTitleBarEvent & {
|
|
20
20
|
readonly iconClassName: string;
|
|
@@ -29,7 +29,7 @@ export class DefaultTitleBar implements TeleTitleBar {
|
|
|
29
29
|
public constructor({
|
|
30
30
|
readonly$,
|
|
31
31
|
state$,
|
|
32
|
-
title
|
|
32
|
+
title$,
|
|
33
33
|
buttons,
|
|
34
34
|
onEvent,
|
|
35
35
|
onDragStart,
|
|
@@ -37,7 +37,7 @@ export class DefaultTitleBar implements TeleTitleBar {
|
|
|
37
37
|
}: DefaultTitleBarConfig) {
|
|
38
38
|
this.readonly$ = readonly$;
|
|
39
39
|
this.state$ = state$;
|
|
40
|
-
this.title$ =
|
|
40
|
+
this.title$ = title$;
|
|
41
41
|
this.onEvent = onEvent;
|
|
42
42
|
this.onDragStart = onDragStart;
|
|
43
43
|
this.namespace = namespace;
|
|
@@ -67,14 +67,6 @@ export class DefaultTitleBar implements TeleTitleBar {
|
|
|
67
67
|
|
|
68
68
|
public $dragArea: HTMLElement;
|
|
69
69
|
|
|
70
|
-
public get title(): string {
|
|
71
|
-
return this.title$.value;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
public setTitle(title: string): void {
|
|
75
|
-
this.title$.setValue(title);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
70
|
public render(): HTMLElement {
|
|
79
71
|
if (!this.$titleBar) {
|
|
80
72
|
this.$titleBar = document.createElement("div");
|
|
@@ -205,7 +197,7 @@ export class DefaultTitleBar implements TeleTitleBar {
|
|
|
205
197
|
|
|
206
198
|
protected readonly$: TeleTitleBarConfig["readonly$"];
|
|
207
199
|
|
|
208
|
-
protected title$:
|
|
200
|
+
protected title$: ReadonlyVal<string>;
|
|
209
201
|
|
|
210
202
|
protected buttons: ReadonlyArray<DefaultTitleBarButton>;
|
|
211
203
|
|
|
@@ -10,7 +10,7 @@ export type TeleTitleBarEvent<U = keyof TeleBoxDelegateEventConfig> =
|
|
|
10
10
|
|
|
11
11
|
export interface TeleTitleBarConfig {
|
|
12
12
|
readonly$: ReadonlyVal<boolean, boolean>;
|
|
13
|
-
title
|
|
13
|
+
title$: ReadonlyVal<string, boolean>;
|
|
14
14
|
state$: ReadonlyVal<TeleBoxState, boolean>;
|
|
15
15
|
namespace?: string;
|
|
16
16
|
onEvent?: (event: TeleTitleBarEvent) => void;
|