@netless/telebox-insider 1.0.0-alpha.27 → 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.
@@ -122,9 +122,9 @@ export class DefaultTitleBar implements TeleTitleBar {
122
122
 
123
123
  this.sideEffect.addEventListener(
124
124
  $buttonsContainer,
125
- "pointerup",
125
+ "click",
126
126
  (ev) => {
127
- if (!ev.isPrimary || this.readonly$.value) {
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 v(color, titlebar-color, $titlebar-color);
15
- @include v(background-color, titlebar-background, $titlebar-background);
16
- @include v(border-bottom, titlebar-border-bottom, $titlebar-border-bottom);
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 v(color, titlebar-color, $titlebar-color);
31
+ @include clr(color, titlebarColor);
32
32
 
33
33
  overflow: hidden;
34
34
  margin: 0;
@@ -90,25 +90,25 @@
90
90
 
91
91
  .#{$namespace}-titlebar-icon-minimize {
92
92
  background: center / cover no-repeat;
93
- @include v(
94
- background-image,
95
- titlebar-icon-minimize,
93
+ background-image: url("./icons/minimize.svg");
94
+ background-image: var(
95
+ --tele-titlebarIconMinimize,
96
96
  url("./icons/minimize.svg")
97
97
  );
98
98
  }
99
99
 
100
100
  .#{$namespace}-titlebar-icon-maximize {
101
101
  background: center / cover no-repeat;
102
- @include v(
103
- background-image,
104
- titlebar-icon-maximize,
102
+ background-image: url("./icons/maximize.svg");
103
+ background-image: var(
104
+ --tele-titlebarIconMaximize,
105
105
  url("./icons/maximize.svg")
106
106
  );
107
107
 
108
108
  &.is-active {
109
- @include v(
110
- background-image,
111
- titlebar-icon-maximize-active,
109
+ background-image: url("./icons/maximize-active.svg");
110
+ background-image: var(
111
+ --tele-titlebarIconMaximizeActive,
112
112
  url("./icons/maximize-active.svg")
113
113
  );
114
114
  }
@@ -116,59 +116,20 @@
116
116
 
117
117
  .#{$namespace}-titlebar-icon-close {
118
118
  background: center / cover no-repeat;
119
- @include v(background-image, titlebar-icon-close, url("./icons/close.svg"));
119
+ background-image: url("./icons/close.svg");
120
+ background-image: var(--tele-titlebarIconClose, url("./icons/close.svg"));
120
121
  }
121
122
 
122
123
  .#{$namespace}-color-scheme-dark {
123
124
  color-scheme: dark;
124
125
 
125
126
  .#{$namespace}-title {
126
- @include v(color, titlebar-color-dark, $titlebar-color-dark);
127
+ @include clr-dark(color, titlebarColor);
127
128
  }
128
129
 
129
130
  .#{$namespace}-titlebar {
130
- @include v(color, titlebar-color-dark, $titlebar-color-dark);
131
- @include v(
132
- background-color,
133
- titlebar-background-dark,
134
- $titlebar-background-dark
135
- );
136
- @include v(
137
- border-bottom,
138
- titlebar-border-bottom-dark,
139
- $titlebar-border-bottom-dark
140
- );
141
- }
142
-
143
- .#{$namespace}-titlebar-icon-minimize {
144
- @include v(
145
- background-image,
146
- titlebar-icon-minimize-dark,
147
- url("./icons/minimize.svg")
148
- );
149
- }
150
-
151
- .#{$namespace}-titlebar-icon-maximize {
152
- @include v(
153
- background-image,
154
- titlebar-icon-maximize-dark,
155
- url("./icons/maximize.svg")
156
- );
157
-
158
- &.is-active {
159
- @include v(
160
- background-image,
161
- titlebar-icon-maximize-active-dark,
162
- url("./icons/maximize-active.svg")
163
- );
164
- }
165
- }
166
-
167
- .#{$namespace}-titlebar-icon-close {
168
- @include v(
169
- background-image,
170
- titlebar-icon-close-dark,
171
- url("./icons/close.svg")
172
- );
131
+ @include clr-dark(color, titlebarColor);
132
+ @include clr-dark(background-color, titlebarBackground);
133
+ @include clr-dark(border-bottom, titlebarBorderBottom);
173
134
  }
174
135
  }
@@ -5,8 +5,3 @@
5
5
  // iOS Safari
6
6
  -webkit-user-select: none;
7
7
  }
8
-
9
- @mixin v($property, $varName, $val) {
10
- #{$property}: $val;
11
- #{$property}: var(--tele-#{$varName}, $val);
12
- }
@@ -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
- $manager-container-background: #f9f9f9;
9
- $manager-container-background-dark: #25282e;
10
- $manager-stage-background: #fff;
11
- $manager-stage-background-dark: #272a30;
12
- $manager-stage-shadow: 0px 0px 16px rgba(0, 0, 0, 0.08);
13
- $manager-stage-shadow-dark: 0px 0px 16px rgba(0, 0, 0, 0.24);
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
- $box-container-background: $manager-container-background;
16
- $box-container-background-dark: $manager-container-background-dark;
17
- $box-stage-background: $manager-stage-background;
18
- $box-stage-background-dark: $manager-stage-background-dark;
19
- $box-stage-shadow: $manager-stage-shadow;
20
- $box-stage-shadow-dark: $manager-stage-shadow-dark;
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
- $box-color: #191919;
23
- $box-color-dark: #e9e9e9;
24
- $box-border: 1px solid #e3e3ec;
25
- $box-border-dark: 1px solid #383b42;
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
- $titlebar-color: #191919;
30
- $titlebar-color-dark: #e9e9e9;
31
- $titlebar-background: #fff;
32
- $titlebar-background-dark: #383b42;
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
- $titlebar-tab-color: #7b88a0;
37
- $titlebar-tab-color-dark: #e9e9e9;
38
- $titlebar-tab-focus-color: #357bf6;
39
- $titlebar-tab-focus-color-dark: #357bf6;
40
- $titlebar-tab-background: transparent;
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
- $collector-background: #fff;
46
- $collector-background-dark: #383b42;
47
- $collector-shadow: 0px 2px 6px 0px rgba(47, 65, 146, 0.15);
48
- $collector-shadow-dark: $collector-shadow;
70
+ @mixin clr-root-dark() {
71
+ @each $key, $value in $tele-colors-dark {
72
+ --tele-#{$key}: #{$value};
73
+ }
74
+ }