custom-electron-titlebar 4.2.7 → 4.4.0

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.
Files changed (77) hide show
  1. package/README.md +43 -19
  2. package/index.d.mts +684 -0
  3. package/index.d.ts +684 -3
  4. package/index.js +5225 -175
  5. package/index.js.map +1 -0
  6. package/index.mjs +5227 -0
  7. package/index.mjs.map +1 -0
  8. package/main/index.d.mts +21 -0
  9. package/main/index.d.ts +21 -3
  10. package/main/index.js +793 -175
  11. package/main/index.js.map +1 -0
  12. package/main/index.mjs +785 -0
  13. package/main/index.mjs.map +1 -0
  14. package/package.json +56 -33
  15. package/theme/base.css +425 -0
  16. package/theme/mac.css +0 -0
  17. package/theme/win.css +0 -0
  18. package/base/browser/browser.d.ts +0 -26
  19. package/base/browser/browser.js +0 -317
  20. package/base/browser/event.d.ts +0 -12
  21. package/base/browser/event.js +0 -215
  22. package/base/browser/keyboardEvent.d.ts +0 -38
  23. package/base/browser/keyboardEvent.js +0 -464
  24. package/base/browser/mouseEvent.d.ts +0 -61
  25. package/base/browser/mouseEvent.js +0 -327
  26. package/base/browser/touch.d.ts +0 -39
  27. package/base/browser/touch.js +0 -454
  28. package/base/common/arrays.d.ts +0 -10
  29. package/base/common/arrays.js +0 -210
  30. package/base/common/async.d.ts +0 -35
  31. package/base/common/async.js +0 -280
  32. package/base/common/charCode.d.ts +0 -405
  33. package/base/common/charCode.js +0 -9
  34. package/base/common/color.d.ts +0 -159
  35. package/base/common/color.js +0 -708
  36. package/base/common/decorators.d.ts +0 -6
  37. package/base/common/decorators.js +0 -300
  38. package/base/common/dom.d.ts +0 -221
  39. package/base/common/dom.js +0 -1478
  40. package/base/common/event.d.ts +0 -213
  41. package/base/common/event.js +0 -804
  42. package/base/common/iterator.d.ts +0 -69
  43. package/base/common/iterator.js +0 -381
  44. package/base/common/keyCodes.d.ts +0 -478
  45. package/base/common/keyCodes.js +0 -479
  46. package/base/common/lifecycle.d.ts +0 -17
  47. package/base/common/lifecycle.js +0 -258
  48. package/base/common/linkedList.d.ts +0 -17
  49. package/base/common/linkedList.js +0 -319
  50. package/base/common/platform.d.ts +0 -36
  51. package/base/common/platform.js +0 -314
  52. package/base/common/strings.d.ts +0 -23
  53. package/base/common/strings.js +0 -273
  54. package/consts.d.ts +0 -58
  55. package/consts.js +0 -317
  56. package/main/attach-titlebar-to-window.d.ts +0 -3
  57. package/main/attach-titlebar-to-window.js +0 -210
  58. package/main/setup-titlebar.d.ts +0 -2
  59. package/main/setup-titlebar.js +0 -255
  60. package/menubar/index.d.ts +0 -86
  61. package/menubar/index.js +0 -1121
  62. package/menubar/menu/index.d.ts +0 -46
  63. package/menubar/menu/index.js +0 -566
  64. package/menubar/menu/item.d.ts +0 -67
  65. package/menubar/menu/item.js +0 -575
  66. package/menubar/menu/separator.d.ts +0 -11
  67. package/menubar/menu/separator.js +0 -213
  68. package/menubar/menu/submenu.d.ts +0 -32
  69. package/menubar/menu/submenu.js +0 -372
  70. package/menubar/menubar-options.d.ts +0 -47
  71. package/menubar/menubar-options.js +0 -9
  72. package/titlebar/index.d.ts +0 -104
  73. package/titlebar/index.js +0 -696
  74. package/titlebar/options.d.ts +0 -84
  75. package/titlebar/options.js +0 -9
  76. package/titlebar/themebar.d.ts +0 -20
  77. package/titlebar/themebar.js +0 -267
package/theme/base.css ADDED
@@ -0,0 +1,425 @@
1
+ body {
2
+ margin: 0 !important;
3
+ overflow: hidden !important;
4
+ }
5
+
6
+ /* Titlebar */
7
+ .cet-titlebar {
8
+ display: flex;
9
+ align-items: center;
10
+ justify-content: center;
11
+ flex-shrink: 0;
12
+ flex-wrap: wrap;
13
+ position: absolute;
14
+ top: 0;
15
+ left: 0;
16
+ right: 0;
17
+ font-size: var(--cet-font-size, 13px);
18
+ font-family: var(--cet-font-family, Arial, Helvetica, sans-serif);
19
+ box-sizing: border-box;
20
+ padding: 0 16px;
21
+ overflow: hidden;
22
+ -webkit-user-select: none;
23
+ -ms-user-select: none;
24
+ user-select: none;
25
+ zoom: 1;
26
+ width: 100%;
27
+ height: 31px;
28
+ line-height: 31px;
29
+ z-index: 99999;
30
+ }
31
+
32
+ .cet-titlebar *,
33
+ .cet-titlebar *:before,
34
+ .cet-titlebar *:after {
35
+ box-sizing: border-box;
36
+ }
37
+
38
+ .cet-titlebar.cet-windows,
39
+ .cet-titlebar.cet-linux,
40
+ .cet-titlebar.cet-freebsd {
41
+ padding: 0;
42
+ height: 30px;
43
+ line-height: 30px;
44
+ justify-content: left;
45
+ overflow: visible;
46
+ }
47
+
48
+ /* Inverted */
49
+ .cet-titlebar.cet-inverted {
50
+ flex-direction: row-reverse;
51
+ }
52
+
53
+ .cet-titlebar.cet-inverted .cet-menubar,
54
+ .cet-titlebar.cet-inverted .cet-window-controls {
55
+ flex-direction: row-reverse;
56
+ margin-left: 20px;
57
+ margin-right: 0;
58
+ }
59
+
60
+ /* First buttons */
61
+ .cet-titlebar.cet-first-buttons .cet-window-controls {
62
+ order: -1;
63
+ margin: 0 5px 0 0;
64
+ }
65
+
66
+ .cet-titlebar.cet-inverted .cet-window-controls {
67
+ margin: 0 5px 0 0;
68
+ }
69
+
70
+ /* Shadow */
71
+ .cet-titlebar.cet-shadow {
72
+ box-shadow: 0 2px 1px -1px rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 1px 3px 0 rgba(0, 0, 0, 0.12);
73
+ }
74
+
75
+ /* Drag region */
76
+ .cet-drag-region {
77
+ top: 0;
78
+ left: 0;
79
+ display: block;
80
+ position: absolute;
81
+ width: 100%;
82
+ height: 100%;
83
+ z-index: -1;
84
+ -webkit-app-region: drag;
85
+ }
86
+
87
+ /* Icon */
88
+ .cet-icon {
89
+ display: flex;
90
+ align-items: center;
91
+ justify-content: center;
92
+ width: 34px;
93
+ height: 30px;
94
+ z-index: 99;
95
+ overflow: hidden;
96
+ }
97
+
98
+ /* Title */
99
+ .cet-title {
100
+ flex: 0 1 auto;
101
+ font-size: var(--cet-title-font-size, 12px);
102
+ overflow: hidden;
103
+ white-space: nowrap;
104
+ text-overflow: ellipsis;
105
+ zoom: 1;
106
+ }
107
+
108
+ /* Title alignment */
109
+ .cet-title.cet-title-left {
110
+ margin-left: 8px;
111
+ margin-right: auto;
112
+ }
113
+
114
+ .cet-title.cet-title-right {
115
+ margin-left: auto;
116
+ margin-right: 8px;
117
+ }
118
+
119
+ .cet-title.cet-title-center {
120
+ position: absolute;
121
+ left: 50%;
122
+ transform: translateX(-50%);
123
+ }
124
+
125
+ .cet-title.cet-bigsur {
126
+ font-size: 13px;
127
+ font-weight: 600;
128
+ }
129
+
130
+ /* Window controls */
131
+ .cet-window-controls {
132
+ display: flex;
133
+ flex-grow: 0;
134
+ flex-shrink: 0;
135
+ text-align: center;
136
+ position: relative;
137
+ z-index: 99;
138
+ -webkit-app-region: no-drag;
139
+ height: 30px;
140
+ font-family: initial !important;
141
+ margin-left: auto;
142
+ }
143
+
144
+ .cet-control-icon {
145
+ width: 2.85rem;
146
+ }
147
+
148
+ .cet-control-icon:not(.inactive):hover {
149
+ background-color: rgb(255 255 255 / 12%);
150
+ }
151
+
152
+ .light .cet-control-icon:not(.inactive):hover {
153
+ background-color: rgb(0 0 0 / 12%);
154
+ }
155
+
156
+ .cet-control-icon.inactive svg {
157
+ opacity: 0.4;
158
+ }
159
+
160
+ .cet-control-icon svg {
161
+ width: 10px;
162
+ height: -webkit-fill-available;
163
+ fill: #fff;
164
+ display: initial !important;
165
+ vertical-align: unset !important;
166
+ }
167
+
168
+ .cet-titlebar.light .cet-control-icon svg {
169
+ fill: #222222 !important;
170
+ }
171
+
172
+ .cet-control-close:not(.inactive):hover {
173
+ background-color: rgb(232 17 35 / 90%) !important;
174
+ }
175
+
176
+ .cet-control-close:not(.inactive):hover svg {
177
+ fill: #fff !important;
178
+ }
179
+
180
+ /* Resizer */
181
+ .cet-resizer {
182
+ -webkit-app-region: no-drag;
183
+ position: absolute;
184
+ }
185
+
186
+ .cet-resizer.left {
187
+ top: 0;
188
+ left: 0;
189
+ width: 6px;
190
+ height: 100%;
191
+ }
192
+
193
+ .cet-resizer.top {
194
+ top: 0;
195
+ width: 100%;
196
+ height: 6px;
197
+ }
198
+
199
+ /* Container */
200
+ .cet-container {
201
+ position: absolute;
202
+ left: 0;
203
+ right: 0;
204
+ bottom: 0;
205
+ overflow: auto;
206
+ z-index: 1;
207
+ }
208
+
209
+ /* MenuBar */
210
+ .cet-menubar {
211
+ min-width: 0;
212
+ display: flex;
213
+ flex-shrink: 1;
214
+ flex-grow: 0;
215
+ box-sizing: border-box;
216
+ overflow: hidden;
217
+ flex-wrap: nowrap;
218
+ margin-right: 20px;
219
+ }
220
+
221
+ .cet-menubar.bottom {
222
+ order: 1;
223
+ width: 100%;
224
+ padding: 0 5px 5px;
225
+ margin-right: 0;
226
+ }
227
+
228
+ .cet-menubar.bottom .cet-menubar-menu-button {
229
+ border-radius: 4px;
230
+ }
231
+
232
+ .cet-menubar.bottom .cet-menubar-menu-button .cet-menubar-menu-title {
233
+ line-height: 26px;
234
+ }
235
+
236
+ .cet-menubar .cet-menubar-menu-button {
237
+ box-sizing: border-box;
238
+ padding: 0px 8px;
239
+ height: 100%;
240
+ cursor: default;
241
+ zoom: 1;
242
+ white-space: nowrap;
243
+ -webkit-app-region: no-drag;
244
+ outline: 0;
245
+ }
246
+
247
+ .cet-menubar .cet-menubar-menu-button .cet-menubar-menu-title {
248
+ font-size: var(--cet-menu-font-size, 12px);
249
+ }
250
+
251
+ .cet-menubar .cet-menubar-menu-title.cet-toggle-more {
252
+ font-weight: 700;
253
+ letter-spacing: 1px;
254
+ }
255
+
256
+ .cet-menubar .cet-menubar-menu-button.disabled {
257
+ opacity: 0.4;
258
+ }
259
+
260
+ .cet-menubar .cet-menubar-menu-button:not(.disabled):hover,
261
+ .cet-menubar .cet-menubar-menu-button:not(.disabled).open {
262
+ background-color: rgb(255 255 255 / 12%);
263
+ }
264
+
265
+ .cet-titlebar.light .cet-menubar .cet-menubar-menu-button:not(.disabled):hover,
266
+ .cet-titlebar.light .cet-menubar .cet-menubar-menu-button:not(.disabled).open {
267
+ background-color: rgb(0 0 0 / 12%);
268
+ }
269
+
270
+ .cet-menubar-menu-container {
271
+ position: absolute;
272
+ display: block;
273
+ left: 0px;
274
+ opacity: 1;
275
+ outline: 0;
276
+ border: none;
277
+ text-align: left;
278
+ margin: 0 auto;
279
+ margin-left: 0;
280
+ font-size: inherit;
281
+ overflow-x: visible;
282
+ overflow-y: visible;
283
+ -webkit-overflow-scrolling: touch;
284
+ justify-content: flex-end;
285
+ white-space: nowrap;
286
+ border-radius: 7px;
287
+ backdrop-filter: blur(10px);
288
+ box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);
289
+ z-index: 99999;
290
+ }
291
+
292
+ .cet-menubar-menu-container::-webkit-scrollbar {
293
+ width: 8px;
294
+ height: 4px;
295
+ cursor: pointer;
296
+ background-color: rgba(0, 0, 0, 0);
297
+ }
298
+
299
+ .cet-menubar-menu-container::-webkit-scrollbar-track {
300
+ border: none;
301
+ background-color: rgba(0, 0, 0, 0);
302
+ }
303
+
304
+ .cet-menubar-menu-container::-webkit-scrollbar-thumb {
305
+ border-radius: 10px;
306
+ background-color: rgba(110, 110, 110, 0.2);
307
+ }
308
+
309
+ .cet-menubar-menu-container:focus {
310
+ outline: 0;
311
+ }
312
+
313
+ .cet-menubar-menu-container .cet-action-item {
314
+ padding: 0;
315
+ margin: 0;
316
+ transform: none;
317
+ display: -ms-flexbox;
318
+ display: flex;
319
+ outline: none;
320
+ }
321
+
322
+ .cet-menubar-menu-container .cet-action-item.active {
323
+ transform: none;
324
+ }
325
+
326
+ .cet-menubar-menu-container .cet-action-item.disabled .cet-action-menu-item {
327
+ opacity: 0.4;
328
+ }
329
+
330
+ .cet-menubar-menu-container .cet-action-item .cet-submenu {
331
+ position: absolute;
332
+ }
333
+
334
+ .cet-menubar-menu-container .cet-action-menu-item {
335
+ -ms-flex: 1 1 auto;
336
+ flex: 1 1 auto;
337
+ display: -ms-flexbox;
338
+ display: flex;
339
+ height: 2.231em;
340
+ margin: 4px 3px;
341
+ align-items: center;
342
+ position: relative;
343
+ border-radius: 4px;
344
+ text-decoration: none;
345
+ }
346
+
347
+ .cet-menubar-menu-container .cet-action-label {
348
+ -ms-flex: 1 1 auto;
349
+ flex: 1 1 auto;
350
+ text-decoration: none;
351
+ padding: 0 1em;
352
+ background: none;
353
+ font-size: 12px;
354
+ line-height: 1;
355
+ }
356
+
357
+ .cet-menubar-menu-container .cet-action-label:not(.separator) {
358
+ display: inline-block;
359
+ -webkit-box-sizing: border-box;
360
+ -o-box-sizing: border-box;
361
+ -moz-box-sizing: border-box;
362
+ -ms-box-sizing: border-box;
363
+ box-sizing: border-box;
364
+ margin: 0;
365
+ padding: 0 2em 0 0.8em;
366
+ }
367
+
368
+ .cet-menubar-menu-container .cet-action-label.separator {
369
+ opacity: 0.1;
370
+ font-size: inherit;
371
+ width: 100%;
372
+ border-bottom: 1px solid transparent;
373
+ }
374
+
375
+ .cet-menubar-menu-container .cet-action-label.separator.text {
376
+ padding: 0.7em 1em 0.1em 1em;
377
+ font-weight: bold;
378
+ opacity: 1;
379
+ }
380
+
381
+ .cet-menubar-menu-container .cet-action-label:hover {
382
+ color: inherit;
383
+ }
384
+
385
+ .cet-menubar-menu-container .keybinding,
386
+ .cet-menubar-menu-container .cet-submenu-indicator {
387
+ display: inline-block;
388
+ -ms-flex: 2 1 auto;
389
+ flex: 2 1 auto;
390
+ padding: 0 2em 0 1em;
391
+ text-align: right;
392
+ font-size: 11px;
393
+ line-height: 1;
394
+ }
395
+
396
+ .cet-menubar-menu-container .cet-submenu-indicator {
397
+ position: absolute;
398
+ right: 4px;
399
+ height: 12px;
400
+ width: 12px;
401
+ padding: 0;
402
+ }
403
+
404
+ .cet-menubar-menu-container .cet-submenu-indicator img,
405
+ .cet-menubar-menu-container .cet-menu-item-icon .icon,
406
+ .cet-menubar-menu-container .cet-submenu-indicator svg,
407
+ .cet-menubar-menu-container .cet-menu-item-icon svg {
408
+ display: inherit;
409
+ width: 100%;
410
+ height: 100%;
411
+ }
412
+
413
+ .cet-menubar-menu-container .cet-action-menu-item.checked>.cet-menu-item-icon.checkbox {
414
+ visibility: visible;
415
+ }
416
+
417
+ .cet-menubar-menu-container .cet-menu-item-icon {
418
+ width: 14px;
419
+ height: 14px;
420
+ margin: 0 0 0 12px;
421
+ }
422
+
423
+ .cet-menubar-menu-container .cet-menu-item-icon.checkbox {
424
+ visibility: hidden;
425
+ }
package/theme/mac.css ADDED
File without changes
package/theme/win.css ADDED
File without changes
@@ -1,26 +0,0 @@
1
- import { Event } from '../common/event';
2
- import { IDisposable } from '../common/lifecycle';
3
- /** A zoom index, e.g. 1, 2, 3 */
4
- export declare function setZoomLevel(zoomLevel: number, isTrusted: boolean): void;
5
- export declare function getZoomLevel(): number;
6
- /** Returns the time (in ms) since the zoom level was changed */
7
- export declare function getTimeSinceLastZoomLevelChanged(): number;
8
- export declare function onDidChangeZoomLevel(callback: (zoomLevel: number) => void): IDisposable;
9
- /** The zoom scale for an index, e.g. 1, 1.2, 1.4 */
10
- export declare function getZoomFactor(): number;
11
- export declare function setZoomFactor(zoomFactor: number): void;
12
- export declare function getPixelRatio(): number;
13
- export declare function setFullscreen(fullscreen: boolean): void;
14
- export declare function isFullscreen(): boolean;
15
- export declare const onDidChangeFullscreen: Event<void>;
16
- export declare const isIE: boolean;
17
- export declare const isEdge: boolean;
18
- export declare const isEdgeOrIE: boolean;
19
- export declare const isOpera: boolean;
20
- export declare const isFirefox: boolean;
21
- export declare const isWebKit: boolean;
22
- export declare const isChrome: boolean;
23
- export declare const isSafari: boolean;
24
- export declare const isWebkitWebView: boolean;
25
- export declare const isIPad: boolean;
26
- export declare const isEdgeWebView: boolean;