@netless/telebox-insider 1.0.0-alpha.25 → 1.0.0-alpha.28
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 +1 -0
- package/dist/TeleBoxCollector/index.d.ts +5 -7
- package/dist/TeleBoxManager/index.d.ts +8 -4
- package/dist/TeleBoxManager/typings.d.ts +38 -0
- package/dist/index.d.ts +0 -1
- package/dist/style.css +113 -112
- package/dist/telebox-insider.cjs.js +59 -41
- package/dist/telebox-insider.cjs.js.map +1 -1
- package/dist/telebox-insider.es.js +59 -41
- package/dist/telebox-insider.es.js.map +1 -1
- package/package.json +1 -1
- package/src/TeleBox/index.ts +2 -0
- package/src/TeleBox/style.scss +7 -5
- package/src/TeleBox/style.shadow.scss +17 -28
- package/src/TeleBoxCollector/index.ts +27 -39
- package/src/TeleBoxCollector/style.scss +4 -8
- package/src/TeleBoxManager/MaxTitleBar/style.scss +8 -28
- package/src/TeleBoxManager/index.ts +77 -20
- package/src/TeleBoxManager/style.scss +24 -25
- package/src/TeleBoxManager/typings.ts +45 -0
- package/src/TeleTitleBar/DefaultTitleBar/index.ts +2 -2
- package/src/TeleTitleBar/DefaultTitleBar/style.scss +21 -58
- package/src/index.ts +0 -2
- package/src/scss/mixins.scss +0 -5
- package/src/scss/variables.scss +62 -36
|
@@ -7,6 +7,8 @@ import type { TELE_BOX_MANAGER_EVENT } from "./constants";
|
|
|
7
7
|
export interface TeleBoxManagerConfig extends Pick<TeleBoxConfig, "namespace"> {
|
|
8
8
|
/** Element to mount boxes. */
|
|
9
9
|
readonly root?: HTMLElement | null;
|
|
10
|
+
/** Fullscreen mode. Default false. */
|
|
11
|
+
readonly fullscreen?: TeleBoxFullscreen;
|
|
10
12
|
/** Stage area height/with ratio. No ratio if <= 0. Default -1. */
|
|
11
13
|
readonly stageRatio?: number;
|
|
12
14
|
/** Where the minimized boxes go. */
|
|
@@ -29,6 +31,8 @@ export interface TeleBoxManagerConfig extends Pick<TeleBoxConfig, "namespace"> {
|
|
|
29
31
|
readonly defaultBoxBodyStyle?: string | null;
|
|
30
32
|
/** Custom `style` attribute value for stage area of all boxes. Can be overwritten by box. */
|
|
31
33
|
readonly defaultBoxStageStyle?: string | null;
|
|
34
|
+
/** Theme variable */
|
|
35
|
+
readonly theme?: TeleBoxManagerThemeConfig;
|
|
32
36
|
}
|
|
33
37
|
|
|
34
38
|
type TeleBoxManagerBoxConfigBaseProps =
|
|
@@ -101,3 +105,44 @@ export type TeleBoxManagerEventConfig = CheckTeleBoxManagerConfig<{
|
|
|
101
105
|
}>;
|
|
102
106
|
|
|
103
107
|
export type TeleBoxManagerEvent = keyof TeleBoxManagerEventConfig;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Fullscreen mode.
|
|
111
|
+
* - `true`: fullscreen mode. hide titlebar for single tab.
|
|
112
|
+
* - `false`: normal mode.
|
|
113
|
+
* - `"no-titlebar"`: always hide titlebar
|
|
114
|
+
* - `"always-titlebar"`: always show titlebar
|
|
115
|
+
*/
|
|
116
|
+
export type TeleBoxFullscreen = boolean | "no-titlebar" | "always-titlebar";
|
|
117
|
+
|
|
118
|
+
export type TeleBoxManagerThemeConfig = {
|
|
119
|
+
managerContainerBackground?: string | null;
|
|
120
|
+
managerStageBackground?: string | null;
|
|
121
|
+
managerStageShadow?: string | null;
|
|
122
|
+
|
|
123
|
+
boxContainerBackground?: string | null;
|
|
124
|
+
boxStageBackground?: string | null;
|
|
125
|
+
boxStageShadow?: string | null;
|
|
126
|
+
|
|
127
|
+
boxColor?: string | null;
|
|
128
|
+
boxBorder?: string | null;
|
|
129
|
+
boxShadow?: string | null;
|
|
130
|
+
boxFooterColor?: string | null;
|
|
131
|
+
boxFooterBackground?: string | null;
|
|
132
|
+
|
|
133
|
+
titlebarColor?: string | null;
|
|
134
|
+
titlebarBackground?: string | null;
|
|
135
|
+
titlebarBorderBottom?: string | null;
|
|
136
|
+
titlebarTabColor?: string | null;
|
|
137
|
+
titlebarTabFocusColor?: string | null;
|
|
138
|
+
titlebarTabBackground?: string | null;
|
|
139
|
+
titlebarTabDividerColor?: string | null;
|
|
140
|
+
|
|
141
|
+
collectorBackground?: string | null;
|
|
142
|
+
collectorShadow?: string | null;
|
|
143
|
+
|
|
144
|
+
titlebarIconMinimize?: string | null;
|
|
145
|
+
titlebarIconMaximize?: string | null;
|
|
146
|
+
titlebarIconMaximizeActive?: string | null;
|
|
147
|
+
titlebarIconClose?: string | null;
|
|
148
|
+
};
|
|
@@ -122,9 +122,9 @@ export class DefaultTitleBar implements TeleTitleBar {
|
|
|
122
122
|
|
|
123
123
|
this.sideEffect.addEventListener(
|
|
124
124
|
$buttonsContainer,
|
|
125
|
-
"
|
|
125
|
+
"click",
|
|
126
126
|
(ev) => {
|
|
127
|
-
if (
|
|
127
|
+
if (this.readonly$.value) {
|
|
128
128
|
return;
|
|
129
129
|
}
|
|
130
130
|
const target = ev.target as HTMLElement;
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
user-select: none;
|
|
12
12
|
touch-action: manipulation;
|
|
13
13
|
|
|
14
|
-
@include
|
|
15
|
-
@include
|
|
16
|
-
@include
|
|
14
|
+
@include clr(color, titlebarColor);
|
|
15
|
+
@include clr(background-color, titlebarBackground);
|
|
16
|
+
@include clr(border-bottom, titlebarBorderBottom);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.#{$namespace}-title-area {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
.#{$namespace}-title {
|
|
30
30
|
@include no-user-select;
|
|
31
|
-
@include
|
|
31
|
+
@include clr(color, titlebarColor);
|
|
32
32
|
|
|
33
33
|
overflow: hidden;
|
|
34
34
|
margin: 0;
|
|
@@ -49,6 +49,8 @@
|
|
|
49
49
|
bottom: 0;
|
|
50
50
|
margin: auto;
|
|
51
51
|
z-index: 10;
|
|
52
|
+
// enable pointermove event on touch devices
|
|
53
|
+
touch-action: none;
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
.#{$namespace}-titlebar-btns {
|
|
@@ -88,25 +90,25 @@
|
|
|
88
90
|
|
|
89
91
|
.#{$namespace}-titlebar-icon-minimize {
|
|
90
92
|
background: center / cover no-repeat;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
background-image: url("./icons/minimize.svg");
|
|
94
|
+
background-image: var(
|
|
95
|
+
--tele-titlebarIconMinimize,
|
|
94
96
|
url("./icons/minimize.svg")
|
|
95
97
|
);
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
.#{$namespace}-titlebar-icon-maximize {
|
|
99
101
|
background: center / cover no-repeat;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
background-image: url("./icons/maximize.svg");
|
|
103
|
+
background-image: var(
|
|
104
|
+
--tele-titlebarIconMaximize,
|
|
103
105
|
url("./icons/maximize.svg")
|
|
104
106
|
);
|
|
105
107
|
|
|
106
108
|
&.is-active {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
background-image: url("./icons/maximize-active.svg");
|
|
110
|
+
background-image: var(
|
|
111
|
+
--tele-titlebarIconMaximizeActive,
|
|
110
112
|
url("./icons/maximize-active.svg")
|
|
111
113
|
);
|
|
112
114
|
}
|
|
@@ -114,59 +116,20 @@
|
|
|
114
116
|
|
|
115
117
|
.#{$namespace}-titlebar-icon-close {
|
|
116
118
|
background: center / cover no-repeat;
|
|
117
|
-
|
|
119
|
+
background-image: url("./icons/close.svg");
|
|
120
|
+
background-image: var(--tele-titlebarIconClose, url("./icons/close.svg"));
|
|
118
121
|
}
|
|
119
122
|
|
|
120
123
|
.#{$namespace}-color-scheme-dark {
|
|
121
124
|
color-scheme: dark;
|
|
122
125
|
|
|
123
126
|
.#{$namespace}-title {
|
|
124
|
-
@include
|
|
127
|
+
@include clr-dark(color, titlebarColor);
|
|
125
128
|
}
|
|
126
129
|
|
|
127
130
|
.#{$namespace}-titlebar {
|
|
128
|
-
@include
|
|
129
|
-
@include
|
|
130
|
-
|
|
131
|
-
titlebar-background-dark,
|
|
132
|
-
$titlebar-background-dark
|
|
133
|
-
);
|
|
134
|
-
@include v(
|
|
135
|
-
border-bottom,
|
|
136
|
-
titlebar-border-bottom-dark,
|
|
137
|
-
$titlebar-border-bottom-dark
|
|
138
|
-
);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.#{$namespace}-titlebar-icon-minimize {
|
|
142
|
-
@include v(
|
|
143
|
-
background-image,
|
|
144
|
-
titlebar-icon-minimize-dark,
|
|
145
|
-
url("./icons/minimize.svg")
|
|
146
|
-
);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.#{$namespace}-titlebar-icon-maximize {
|
|
150
|
-
@include v(
|
|
151
|
-
background-image,
|
|
152
|
-
titlebar-icon-maximize-dark,
|
|
153
|
-
url("./icons/maximize.svg")
|
|
154
|
-
);
|
|
155
|
-
|
|
156
|
-
&.is-active {
|
|
157
|
-
@include v(
|
|
158
|
-
background-image,
|
|
159
|
-
titlebar-icon-maximize-active-dark,
|
|
160
|
-
url("./icons/maximize-active.svg")
|
|
161
|
-
);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
.#{$namespace}-titlebar-icon-close {
|
|
166
|
-
@include v(
|
|
167
|
-
background-image,
|
|
168
|
-
titlebar-icon-close-dark,
|
|
169
|
-
url("./icons/close.svg")
|
|
170
|
-
);
|
|
131
|
+
@include clr-dark(color, titlebarColor);
|
|
132
|
+
@include clr-dark(background-color, titlebarBackground);
|
|
133
|
+
@include clr-dark(border-bottom, titlebarBorderBottom);
|
|
171
134
|
}
|
|
172
135
|
}
|
package/src/index.ts
CHANGED
package/src/scss/mixins.scss
CHANGED
package/src/scss/variables.scss
CHANGED
|
@@ -5,44 +5,70 @@ $max-titlebar-z-index: $base-z-index + 5000;
|
|
|
5
5
|
$stage-z-index: $max-titlebar-z-index + 10;
|
|
6
6
|
$collector-z-index: $stage-z-index + 10;
|
|
7
7
|
|
|
8
|
-
$
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
$tele-colors: (
|
|
9
|
+
managerContainerBackground: #f9f9f9,
|
|
10
|
+
managerStageBackground: #fff,
|
|
11
|
+
managerStageShadow: 0px 0px 16px rgba(0, 0, 0, 0.08),
|
|
12
|
+
boxContainerBackground: #f9f9f9,
|
|
13
|
+
boxStageBackground: #fff,
|
|
14
|
+
boxStageShadow: 0px 0px 16px rgba(0, 0, 0, 0.08),
|
|
15
|
+
boxColor: #191919,
|
|
16
|
+
boxBorder: 1px solid #e3e3ec,
|
|
17
|
+
boxShadow: 0px 4px 10px 0px rgba(47, 65, 146, 0.15),
|
|
18
|
+
boxFooterColor: #191919,
|
|
19
|
+
boxFooterBackground: #fff,
|
|
20
|
+
titlebarColor: #191919,
|
|
21
|
+
titlebarBackground: #fff,
|
|
22
|
+
titlebarBorderBottom: 1px solid #eeeef7,
|
|
23
|
+
titlebarTabColor: #7b88a0,
|
|
24
|
+
titlebarTabFocusColor: #357bf6,
|
|
25
|
+
titlebarTabBackground: transparent,
|
|
26
|
+
titlebarTabDividerColor: #e5e5f0,
|
|
27
|
+
collectorBackground: #fff,
|
|
28
|
+
collectorShadow: 0px 2px 6px 0px rgba(47, 65, 146, 0.15),
|
|
29
|
+
);
|
|
14
30
|
|
|
15
|
-
$
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
31
|
+
$tele-colors-dark: (
|
|
32
|
+
managerContainerBackground: #25282e,
|
|
33
|
+
managerStageBackground: #272a30,
|
|
34
|
+
managerStageShadow: 0px 0px 16px rgba(0, 0, 0, 0.24),
|
|
35
|
+
boxContainerBackground: #25282e,
|
|
36
|
+
boxStageBackground: #272a30,
|
|
37
|
+
boxStageShadow: 0px 0px 16px rgba(0, 0, 0, 0.24),
|
|
38
|
+
boxColor: #e9e9e9,
|
|
39
|
+
boxBorder: 1px solid #383b42,
|
|
40
|
+
boxShadow: 0px 4px 10px 0px rgba(56, 59, 66, 0.15),
|
|
41
|
+
boxFooterColor: #e9e9e9,
|
|
42
|
+
boxFooterBackground: #383b42,
|
|
43
|
+
titlebarColor: #e9e9e9,
|
|
44
|
+
titlebarBackground: #383b42,
|
|
45
|
+
titlebarBorderBottom: none,
|
|
46
|
+
titlebarTabColor: #e9e9e9,
|
|
47
|
+
titlebarTabFocusColor: #357bf6,
|
|
48
|
+
titlebarTabBackground: transparent,
|
|
49
|
+
titlebarTabDividerColor: #7b88a0,
|
|
50
|
+
collectorBackground: #383b42,
|
|
51
|
+
collectorShadow: 0px 2px 6px 0px rgba(47, 65, 146, 0.15),
|
|
52
|
+
);
|
|
21
53
|
|
|
22
|
-
$
|
|
23
|
-
$
|
|
24
|
-
$
|
|
25
|
-
|
|
26
|
-
$box-shadow: 0px 4px 10px 0px rgba(47, 65, 146, 0.15);
|
|
27
|
-
$box-shadow-dark: 0px 4px 10px 0px rgba(56, 59, 66, 0.15);
|
|
54
|
+
@mixin clr($property, $key) {
|
|
55
|
+
#{$property}: map-get($tele-colors, $key);
|
|
56
|
+
#{$property}: var(--tele-#{$key}, map-get($tele-colors, $key));
|
|
57
|
+
}
|
|
28
58
|
|
|
29
|
-
$
|
|
30
|
-
$
|
|
31
|
-
$
|
|
32
|
-
|
|
33
|
-
$titlebar-border-bottom: 1px solid #eeeef7;
|
|
34
|
-
$titlebar-border-bottom-dark: none;
|
|
59
|
+
@mixin clr-dark($property, $key) {
|
|
60
|
+
#{$property}: map-get($tele-colors-dark, $key);
|
|
61
|
+
#{$property}: var(--tele-#{$key}, map-get($tele-colors-dark, $key));
|
|
62
|
+
}
|
|
35
63
|
|
|
36
|
-
|
|
37
|
-
$
|
|
38
|
-
$
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
$titlebar-tab-background-dark: transparent;
|
|
42
|
-
$titlebar-tab-divider-color: #e5e5f0;
|
|
43
|
-
$titlebar-tab-divider-color-dark: #7b88a0;
|
|
64
|
+
@mixin clr-root() {
|
|
65
|
+
@each $key, $value in $tele-colors {
|
|
66
|
+
--tele-#{$key}: #{$value};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
44
69
|
|
|
45
|
-
|
|
46
|
-
$
|
|
47
|
-
$
|
|
48
|
-
|
|
70
|
+
@mixin clr-root-dark() {
|
|
71
|
+
@each $key, $value in $tele-colors-dark {
|
|
72
|
+
--tele-#{$key}: #{$value};
|
|
73
|
+
}
|
|
74
|
+
}
|