custom-electron-titlebar 4.2.0 → 4.2.1

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 (65) hide show
  1. package/dist/base/browser/browser.d.ts +26 -0
  2. package/dist/base/browser/browser.js +317 -0
  3. package/dist/base/browser/event.d.ts +12 -0
  4. package/dist/base/browser/event.js +215 -0
  5. package/dist/base/browser/keyboardEvent.d.ts +38 -0
  6. package/dist/base/browser/keyboardEvent.js +466 -0
  7. package/dist/base/browser/mouseEvent.d.ts +61 -0
  8. package/dist/base/browser/mouseEvent.js +327 -0
  9. package/dist/base/browser/touch.d.ts +39 -0
  10. package/dist/base/browser/touch.js +454 -0
  11. package/dist/base/common/arrays.d.ts +10 -0
  12. package/dist/base/common/arrays.js +210 -0
  13. package/dist/base/common/async.d.ts +35 -0
  14. package/dist/base/common/async.js +280 -0
  15. package/dist/base/common/charCode.d.ts +405 -0
  16. package/dist/base/common/charCode.js +9 -0
  17. package/dist/base/common/color.d.ts +159 -0
  18. package/dist/base/common/color.js +709 -0
  19. package/dist/base/common/decorators.d.ts +6 -0
  20. package/dist/base/common/decorators.js +300 -0
  21. package/dist/base/common/dom.d.ts +221 -0
  22. package/dist/base/common/dom.js +1478 -0
  23. package/dist/base/common/event.d.ts +213 -0
  24. package/dist/base/common/event.js +804 -0
  25. package/dist/base/common/iterator.d.ts +69 -0
  26. package/dist/base/common/iterator.js +381 -0
  27. package/dist/base/common/keyCodes.d.ts +478 -0
  28. package/dist/base/common/keyCodes.js +479 -0
  29. package/dist/base/common/lifecycle.d.ts +17 -0
  30. package/dist/base/common/lifecycle.js +258 -0
  31. package/dist/base/common/linkedList.d.ts +17 -0
  32. package/dist/base/common/linkedList.js +319 -0
  33. package/dist/base/common/platform.d.ts +33 -0
  34. package/dist/base/common/platform.js +302 -0
  35. package/dist/base/common/strings.d.ts +23 -0
  36. package/dist/base/common/strings.js +273 -0
  37. package/dist/consts.d.ts +49 -0
  38. package/dist/consts.js +303 -0
  39. package/dist/index.d.ts +3 -0
  40. package/dist/index.js +211 -0
  41. package/dist/main/attach-titlebar-to-window.d.ts +3 -0
  42. package/dist/main/attach-titlebar-to-window.js +207 -0
  43. package/dist/main/index.d.ts +3 -0
  44. package/dist/main/index.js +202 -0
  45. package/dist/main/setup-titlebar.d.ts +2 -0
  46. package/dist/main/setup-titlebar.js +242 -0
  47. package/dist/menubar/index.d.ts +86 -0
  48. package/dist/menubar/index.js +1118 -0
  49. package/dist/menubar/menu/index.d.ts +46 -0
  50. package/dist/menubar/menu/index.js +556 -0
  51. package/dist/menubar/menu/item.d.ts +67 -0
  52. package/dist/menubar/menu/item.js +575 -0
  53. package/dist/menubar/menu/separator.d.ts +11 -0
  54. package/dist/menubar/menu/separator.js +213 -0
  55. package/dist/menubar/menu/submenu.d.ts +32 -0
  56. package/dist/menubar/menu/submenu.js +372 -0
  57. package/dist/menubar/menubar-options.d.ts +55 -0
  58. package/dist/menubar/menubar-options.js +9 -0
  59. package/dist/titlebar/index.d.ts +99 -0
  60. package/dist/titlebar/index.js +663 -0
  61. package/dist/titlebar/options.d.ts +84 -0
  62. package/dist/titlebar/options.js +9 -0
  63. package/dist/titlebar/themebar.d.ts +20 -0
  64. package/dist/titlebar/themebar.js +267 -0
  65. package/package.json +1 -1
@@ -0,0 +1,84 @@
1
+ import { NativeImage } from 'electron';
2
+ import { Color } from '../base/common/color';
3
+ import { MenuBarOptions } from '../menubar/menubar-options';
4
+ export interface TitleBarOptions extends MenuBarOptions {
5
+ /**
6
+ * The background color of titlebar.
7
+ * **The default is `#ffffff`**
8
+ */
9
+ backgroundColor?: Color;
10
+ /**
11
+ * Sets the value for the overflow of the container after title bar.
12
+ * **The default value is auto**
13
+ */
14
+ containerOverflow?: 'auto' | 'hidden' | 'visible';
15
+ /**
16
+ * Define if the close button is enabled.
17
+ * **The default is true**
18
+ */
19
+ closeable?: boolean;
20
+ /**
21
+ * When the close button is clicked, the window is hidden instead of closed.
22
+ * **The default is false**
23
+ */
24
+ /**
25
+ * The icon shown on the left side of titlebar.
26
+ * **The default is the favicon of the index.html**
27
+ */
28
+ icon?: NativeImage | string;
29
+ /**
30
+ * The icon size of titlebar. Value between 16 and 24.
31
+ * **The default is 16**
32
+ */
33
+ iconSize?: number;
34
+ /**
35
+ * Define if the maximize and restore buttons are enabled.
36
+ * **The default is true**
37
+ */
38
+ maximizable?: boolean;
39
+ /**
40
+ * Define if the minimize button is enabled.
41
+ * **The default is true**
42
+ */
43
+ minimizable?: boolean;
44
+ /**
45
+ * Set the order of the elements on the title bar. You can use `inverted`, `first-buttons` or don't add for.
46
+ * **The default is undefined**
47
+ */
48
+ order?: 'inverted' | 'first-buttons';
49
+ /**
50
+ * Show shadow of titlebar.
51
+ * **The default is false*
52
+ */
53
+ shadow?: boolean;
54
+ /**
55
+ * Set horizontal alignment of the window title.
56
+ * **The default value is center**
57
+ */
58
+ titleHorizontalAlignment?: 'left' | 'center' | 'right';
59
+ /**
60
+ * Set the titles of controls of the window.
61
+ */
62
+ tooltips?: {
63
+ /**
64
+ * The tooltip of minimize button.
65
+ * **The default is "Minimize"**
66
+ */
67
+ minimize?: string;
68
+ /**
69
+ * The tooltip of maximize button.
70
+ * **The default is "Maximize"**
71
+ */
72
+ maximize?: string;
73
+ /**
74
+ * The tooltip of restore button.
75
+ * **The default is "Restore Down"**
76
+ */
77
+ restoreDown?: string;
78
+ /**
79
+ * The tooltip of close button.
80
+ * **The default is "Close"**
81
+ */
82
+ close?: string;
83
+ };
84
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ /* ---------------------------------------------------------------------------------------------
4
+ * Copyright (c) AlexTorresDev. All rights reserved.
5
+ * Licensed under the MIT License. See License.txt in the project root for license information.
6
+ *-------------------------------------------------------------------------------------------- */
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
@@ -0,0 +1,20 @@
1
+ import { IDisposable, Disposable } from '../base/common/lifecycle';
2
+ export interface CssStyle {
3
+ addRule(rule: string): void;
4
+ }
5
+ export interface Theme {
6
+ (collector: CssStyle): void;
7
+ }
8
+ declare class ThemingRegistry extends Disposable {
9
+ private readonly theming;
10
+ constructor();
11
+ protected onThemeChange(theme: Theme): IDisposable;
12
+ protected getTheming(): Theme[];
13
+ }
14
+ export declare class ThemeBar extends ThemingRegistry {
15
+ constructor();
16
+ protected registerTheme(theme: Theme): void;
17
+ static get win(): Theme;
18
+ static get mac(): Theme;
19
+ }
20
+ export {};
@@ -0,0 +1,267 @@
1
+ "use strict";
2
+
3
+ /* ---------------------------------------------------------------------------------------------
4
+ * Copyright (c) Microsoft Corporation. All rights reserved.
5
+ * Licensed under the MIT License. See License.txt in the project root for license information.
6
+ *-------------------------------------------------------------------------------------------- */
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports.ThemeBar = void 0;
11
+ const lifecycle_1 = require("../base/common/lifecycle");
12
+ const baseTheme = "body {\n margin: 0 !important;\n overflow: hidden !important;\n}\n\n/* Titlebar */\n.cet-titlebar {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n flex-wrap: wrap;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n font-size: 13px;\n font-family: Arial, Helvetica, sans-serif;\n box-sizing: border-box;\n padding: 0 16px;\n overflow: hidden;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n zoom: 1;\n width: 100%;\n height: 31px;\n line-height: 31px;\n z-index: 99999;\n}\n\n.cet-titlebar *,\n.cet-titlebar *:before,\n.cet-titlebar *:after {\n box-sizing: border-box;\n}\n\n.cet-titlebar.cet-windows,\n.cet-titlebar.cet-linux {\n padding: 0;\n height: 30px;\n line-height: 30px;\n justify-content: left;\n overflow: visible;\n}\n\n/* Inverted */\n.cet-titlebar.cet-inverted {\n flex-direction: row-reverse;\n}\n\n.cet-titlebar.cet-inverted .cet-menubar,\n.cet-titlebar.cet-inverted .cet-window-controls {\n flex-direction: row-reverse;\n margin-left: 20px;\n margin-right: 0;\n}\n\n/* First buttons */\n.cet-titlebar.cet-first-buttons .cet-window-controls {\n order: -1;\n margin: 0 5px 0 0;\n}\n\n.cet-titlebar.cet-inverted .cet-window-controls {\n margin: 0 5px 0 0;\n}\n\n/* Shadow */\n.cet-titlebar.cet-shadow {\n 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);\n}\n\n/* Drag region */\n.cet-drag-region {\n top: 0;\n left: 0;\n display: block;\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: -1;\n -webkit-app-region: drag;\n}\n\n/* Icon */\n.cet-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 34px;\n height: 30px;\n z-index: 99;\n overflow: hidden;\n}\n\n/* Title */\n.cet-title {\n flex: 0 1 auto;\n font-size: 12px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n zoom: 1;\n}\n\n/* Title alignment */\n.cet-title.cet-title-left {\n margin-left: 8px;\n margin-right: auto;\n}\n\n.cet-title.cet-title-right {\n margin-left: auto;\n margin-right: 8px;\n}\n\n.cet-title.cet-title-center {\n position: absolute;\n left: 50%;\n transform: translateX(-50%);\n}\n\n.cet-title.cet-bigsur {\n font-size: 13px;\n font-weight: 600;\n}\n\n/* Window controls */\n.cet-window-controls {\n display: flex;\n flex-grow: 0;\n flex-shrink: 0;\n text-align: center;\n position: relative;\n z-index: 99;\n -webkit-app-region: no-drag;\n height: 30px;\n font-family: initial !important;\n margin-left: auto;\n}\n\n.cet-control-icon {\n width: 46px;\n}\n\n.cet-control-icon:not(.inactive):hover {\n background-color: rgb(255 255 255 / 12%);\n}\n\n.light .cet-control-icon:not(.inactive):hover {\n background-color: rgb(0 0 0 / 12%);\n}\n\n.cet-control-icon.inactive svg {\n opacity: 0.4;\n}\n\n.cet-control-icon svg {\n width: 10px;\n height: -webkit-fill-available;\n fill: #fff;\n display: initial !important;\n vertical-align: unset !important;\n}\n\n.cet-titlebar.light .cet-control-icon svg {\n fill: #222222 !important;\n}\n\n.cet-control-close:not(.inactive):hover {\n background-color: rgb(232 17 35 / 90%) !important;\n}\n\n.cet-control-close:not(.inactive):hover svg {\n fill: #fff !important;\n}\n\n/* Resizer */\n.cet-resizer {\n -webkit-app-region: no-drag;\n position: absolute;\n}\n\n.cet-resizer.left {\n top: 0;\n left: 0;\n width: 6px;\n height: 100%;\n}\n\n.cet-resizer.top {\n top: 0;\n width: 100%;\n height: 6px;\n}\n\n/* Container */\n.cet-container {\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: auto;\n z-index: 1;\n}\n\n/* MenuBar */\n.cet-menubar {\n display: flex;\n flex-shrink: 1;\n box-sizing: border-box;\n overflow: hidden;\n flex-wrap: wrap;\n margin-right: 20px;\n}\n\n.cet-menubar.bottom {\n order: 1;\n width: 100%;\n padding: 0 5px 5px;\n margin-right: 0;\n}\n\n.cet-menubar.bottom .cet-menubar-menu-button {\n border-radius: 4px;\n}\n\n.cet-menubar.bottom .cet-menubar-menu-button .cet-menubar-menu-title {\n line-height: 26px;\n}\n\n.cet-menubar .cet-menubar-menu-button {\n box-sizing: border-box;\n padding: 0px 8px;\n height: 100%;\n cursor: default;\n zoom: 1;\n white-space: nowrap;\n -webkit-app-region: no-drag;\n outline: 0;\n}\n\n.cet-menubar .cet-menubar-menu-button .cet-menubar-menu-title {\n font-size: 12px;\n}\n\n.cet-menubar .cet-menubar-menu-button.disabled {\n opacity: 0.4;\n}\n\n.cet-menubar .cet-menubar-menu-button:not(.disabled):focus,\n.cet-menubar .cet-menubar-menu-button:not(.disabled):hover,\n.cet-menubar .cet-menubar-menu-button:not(.disabled).open {\n background-color: rgb(255 255 255 / 12%);\n}\n\n.cet-titlebar.light .cet-menubar .cet-menubar-menu-button:not(.disabled):focus,\n.cet-titlebar.light .cet-menubar .cet-menubar-menu-button:not(.disabled):hover,\n.cet-titlebar.light .cet-menubar .cet-menubar-menu-button:not(.disabled).open {\n background-color: rgb(0 0 0 / 12%);\n}\n\n.cet-menubar-menu-container {\n position: absolute;\n display: block;\n left: 0px;\n opacity: 1;\n outline: 0;\n border: none;\n text-align: left;\n margin: 0 auto;\n margin-left: 0;\n font-size: inherit;\n overflow-x: visible;\n overflow-y: visible;\n -webkit-overflow-scrolling: touch;\n justify-content: flex-end;\n white-space: nowrap;\n border-radius: 7px;\n backdrop-filter: blur(5px);\n 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);\n z-index: 99999;\n}\n\n.cet-menubar-menu-container::-webkit-scrollbar {\n width: 8px;\n height: 4px;\n cursor: pointer;\n background-color: rgba(0, 0, 0, 0);\n}\n\n.cet-menubar-menu-container::-webkit-scrollbar-track {\n border: none;\n background-color: rgba(0, 0, 0, 0);\n}\n\n.cet-menubar-menu-container::-webkit-scrollbar-thumb {\n border-radius: 10px;\n background-color: rgba(110, 110, 110, 0.2);\n}\n\n.cet-menubar-menu-container:focus {\n outline: 0;\n}\n\n.cet-menubar-menu-container .cet-action-item {\n padding: 0;\n margin: 0;\n transform: none;\n display: -ms-flexbox;\n display: flex;\n outline: none;\n}\n\n.cet-menubar-menu-container .cet-action-item.active {\n transform: none;\n}\n\n.cet-menubar-menu-container .cet-action-item.disabled .cet-action-menu-item {\n opacity: 0.4;\n}\n\n.cet-menubar-menu-container .cet-action-item .cet-submenu {\n position: absolute;\n}\n\n.cet-menubar-menu-container .cet-action-menu-item {\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n display: -ms-flexbox;\n display: flex;\n height: 2.231em;\n margin: 4px 3px;\n align-items: center;\n position: relative;\n border-radius: 4px;\n text-decoration: none;\n}\n\n.cet-menubar-menu-container .cet-action-label {\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n text-decoration: none;\n padding: 0 1em;\n background: none;\n font-size: 12px;\n line-height: 1;\n}\n\n.cet-menubar-menu-container .cet-action-label:not(.separator) {\n display: inline-block;\n -webkit-box-sizing: border-box;\n -o-box-sizing: border-box;\n -moz-box-sizing: border-box;\n -ms-box-sizing: border-box;\n box-sizing: border-box;\n margin: 0;\n padding: 0 2em 0 0.8em;\n}\n\n.cet-menubar-menu-container .cet-action-label.separator {\n opacity: 0.1;\n font-size: inherit;\n width: 100%;\n border-bottom: 1px solid transparent;\n}\n\n.cet-menubar-menu-container .cet-action-label.separator.text {\n padding: 0.7em 1em 0.1em 1em;\n font-weight: bold;\n opacity: 1;\n}\n\n.cet-menubar-menu-container .cet-action-label:hover {\n color: inherit;\n}\n\n.cet-menubar-menu-container .keybinding,\n.cet-menubar-menu-container .cet-submenu-indicator {\n display: inline-block;\n -ms-flex: 2 1 auto;\n flex: 2 1 auto;\n padding: 0 2em 0 1em;\n text-align: right;\n font-size: 11px;\n line-height: 1;\n}\n\n.cet-menubar-menu-container .cet-submenu-indicator {\n position: absolute;\n right: 4px;\n height: 12px;\n width: 12px;\n padding: 0;\n}\n\n.cet-menubar-menu-container .cet-submenu-indicator img,\n.cet-menubar-menu-container .cet-menu-item-icon .icon,\n.cet-menubar-menu-container .cet-submenu-indicator svg,\n.cet-menubar-menu-container .cet-menu-item-icon svg {\n display: inherit;\n width: 100%;\n height: 100%;\n}\n\n.cet-menubar-menu-container .cet-action-menu-item.checked>.cet-menu-item-icon.checkbox {\n visibility: visible;\n}\n\n.cet-menubar-menu-container .cet-menu-item-icon {\n width: 14px;\n height: 14px;\n margin: 0 0 0 12px;\n}\n\n.cet-menubar-menu-container .cet-menu-item-icon.checkbox {\n visibility: hidden;\n}";
13
+ const macTheme = "";
14
+ const winTheme = "";
15
+ class ThemingRegistry extends _get__("lifecycle_1").Disposable {
16
+ constructor() {
17
+ super();
18
+ this.theming = [];
19
+ this.theming = [];
20
+ }
21
+ onThemeChange(theme) {
22
+ this.theming.push(theme);
23
+ return (0, _get__("lifecycle_1").toDisposable)(() => {
24
+ const idx = this.theming.indexOf(theme);
25
+ this.theming.splice(idx, 1);
26
+ });
27
+ }
28
+ getTheming() {
29
+ return this.theming;
30
+ }
31
+ }
32
+ class ThemeBar extends _get__("ThemingRegistry") {
33
+ constructor() {
34
+ super();
35
+ this.registerTheme(collector => {
36
+ collector.addRule(_get__("baseTheme"));
37
+ });
38
+ }
39
+ registerTheme(theme) {
40
+ this.onThemeChange(theme);
41
+ const cssRules = [];
42
+ const hasRule = {};
43
+ const ruleCollector = {
44
+ addRule: rule => {
45
+ if (!hasRule[rule]) {
46
+ cssRules.push(rule);
47
+ hasRule[rule] = true;
48
+ }
49
+ }
50
+ };
51
+ this.getTheming().forEach(p => p(ruleCollector));
52
+ _get__("_applyRules")(cssRules.join('\n'), 'titlebar-style');
53
+ }
54
+ static get win() {
55
+ return collector => {
56
+ collector.addRule(_get__("winTheme"));
57
+ };
58
+ }
59
+ static get mac() {
60
+ return collector => {
61
+ collector.addRule(_get__("macTheme"));
62
+ };
63
+ }
64
+ }
65
+ exports.ThemeBar = _get__("ThemeBar");
66
+ function _applyRules(styleSheetContent, rulesClassName) {
67
+ const themeStyles = document.head.getElementsByClassName(rulesClassName);
68
+ if (themeStyles.length === 0) {
69
+ const styleElement = document.createElement('style');
70
+ styleElement.className = rulesClassName;
71
+ styleElement.innerHTML = styleSheetContent;
72
+ document.head.appendChild(styleElement);
73
+ } else {
74
+ themeStyles[0].innerHTML = styleSheetContent;
75
+ }
76
+ }
77
+ function _getGlobalObject() {
78
+ try {
79
+ if (!!global) {
80
+ return global;
81
+ }
82
+ } catch (e) {
83
+ try {
84
+ if (!!window) {
85
+ return window;
86
+ }
87
+ } catch (e) {
88
+ return this;
89
+ }
90
+ }
91
+ }
92
+ ;
93
+ var _RewireModuleId__ = null;
94
+ function _getRewireModuleId__() {
95
+ if (_RewireModuleId__ === null) {
96
+ let globalVariable = _getGlobalObject();
97
+ if (!globalVariable.__$$GLOBAL_REWIRE_NEXT_MODULE_ID__) {
98
+ globalVariable.__$$GLOBAL_REWIRE_NEXT_MODULE_ID__ = 0;
99
+ }
100
+ _RewireModuleId__ = __$$GLOBAL_REWIRE_NEXT_MODULE_ID__++;
101
+ }
102
+ return _RewireModuleId__;
103
+ }
104
+ function _getRewireRegistry__() {
105
+ let theGlobalVariable = _getGlobalObject();
106
+ if (!theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__) {
107
+ theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__ = Object.create(null);
108
+ }
109
+ return theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__;
110
+ }
111
+ function _getRewiredData__() {
112
+ let moduleId = _getRewireModuleId__();
113
+ let registry = _getRewireRegistry__();
114
+ let rewireData = registry[moduleId];
115
+ if (!rewireData) {
116
+ registry[moduleId] = Object.create(null);
117
+ rewireData = registry[moduleId];
118
+ }
119
+ return rewireData;
120
+ }
121
+ (function registerResetAll() {
122
+ let theGlobalVariable = _getGlobalObject();
123
+ if (!theGlobalVariable['__rewire_reset_all__']) {
124
+ theGlobalVariable['__rewire_reset_all__'] = function () {
125
+ theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__ = Object.create(null);
126
+ };
127
+ }
128
+ })();
129
+ var INTENTIONAL_UNDEFINED = '__INTENTIONAL_UNDEFINED__';
130
+ let _RewireAPI__ = {};
131
+ (function () {
132
+ function addPropertyToAPIObject(name, value) {
133
+ Object.defineProperty(_RewireAPI__, name, {
134
+ value: value,
135
+ enumerable: false,
136
+ configurable: true
137
+ });
138
+ }
139
+ addPropertyToAPIObject('__get__', _get__);
140
+ addPropertyToAPIObject('__GetDependency__', _get__);
141
+ addPropertyToAPIObject('__Rewire__', _set__);
142
+ addPropertyToAPIObject('__set__', _set__);
143
+ addPropertyToAPIObject('__reset__', _reset__);
144
+ addPropertyToAPIObject('__ResetDependency__', _reset__);
145
+ addPropertyToAPIObject('__with__', _with__);
146
+ })();
147
+ function _get__(variableName) {
148
+ let rewireData = _getRewiredData__();
149
+ if (rewireData[variableName] === undefined) {
150
+ return _get_original__(variableName);
151
+ } else {
152
+ var value = rewireData[variableName];
153
+ if (value === INTENTIONAL_UNDEFINED) {
154
+ return undefined;
155
+ } else {
156
+ return value;
157
+ }
158
+ }
159
+ }
160
+ function _get_original__(variableName) {
161
+ switch (variableName) {
162
+ case "lifecycle_1":
163
+ return lifecycle_1;
164
+ case "baseTheme":
165
+ return baseTheme;
166
+ case "_applyRules":
167
+ return _applyRules;
168
+ case "winTheme":
169
+ return winTheme;
170
+ case "macTheme":
171
+ return macTheme;
172
+ case "ThemingRegistry":
173
+ return ThemingRegistry;
174
+ case "ThemeBar":
175
+ return ThemeBar;
176
+ }
177
+ return undefined;
178
+ }
179
+ function _assign__(variableName, value) {
180
+ let rewireData = _getRewiredData__();
181
+ if (rewireData[variableName] === undefined) {
182
+ return _set_original__(variableName, value);
183
+ } else {
184
+ return rewireData[variableName] = value;
185
+ }
186
+ }
187
+ function _set_original__(variableName, _value) {
188
+ switch (variableName) {}
189
+ return undefined;
190
+ }
191
+ function _update_operation__(operation, variableName, prefix) {
192
+ var oldValue = _get__(variableName);
193
+ var newValue = operation === '++' ? oldValue + 1 : oldValue - 1;
194
+ _assign__(variableName, newValue);
195
+ return prefix ? newValue : oldValue;
196
+ }
197
+ function _set__(variableName, value) {
198
+ let rewireData = _getRewiredData__();
199
+ if (typeof variableName === 'object') {
200
+ Object.keys(variableName).forEach(function (name) {
201
+ rewireData[name] = variableName[name];
202
+ });
203
+ return function () {
204
+ Object.keys(variableName).forEach(function (name) {
205
+ _reset__(variableName);
206
+ });
207
+ };
208
+ } else {
209
+ if (value === undefined) {
210
+ rewireData[variableName] = INTENTIONAL_UNDEFINED;
211
+ } else {
212
+ rewireData[variableName] = value;
213
+ }
214
+ return function () {
215
+ _reset__(variableName);
216
+ };
217
+ }
218
+ }
219
+ function _reset__(variableName) {
220
+ let rewireData = _getRewiredData__();
221
+ delete rewireData[variableName];
222
+ if (Object.keys(rewireData).length == 0) {
223
+ delete _getRewireRegistry__()[_getRewireModuleId__];
224
+ }
225
+ ;
226
+ }
227
+ function _with__(object) {
228
+ let rewireData = _getRewiredData__();
229
+ var rewiredVariableNames = Object.keys(object);
230
+ var previousValues = {};
231
+ function reset() {
232
+ rewiredVariableNames.forEach(function (variableName) {
233
+ rewireData[variableName] = previousValues[variableName];
234
+ });
235
+ }
236
+ return function (callback) {
237
+ rewiredVariableNames.forEach(function (variableName) {
238
+ previousValues[variableName] = rewireData[variableName];
239
+ rewireData[variableName] = object[variableName];
240
+ });
241
+ let result = callback();
242
+ if (!!result && typeof result.then == 'function') {
243
+ result.then(reset).catch(reset);
244
+ } else {
245
+ reset();
246
+ }
247
+ return result;
248
+ };
249
+ }
250
+ let _typeOfOriginalExport = typeof module.exports;
251
+ function addNonEnumerableProperty(name, value) {
252
+ Object.defineProperty(module.exports, name, {
253
+ value: value,
254
+ enumerable: false,
255
+ configurable: true
256
+ });
257
+ }
258
+ if ((_typeOfOriginalExport === 'object' || _typeOfOriginalExport === 'function') && Object.isExtensible(module.exports)) {
259
+ addNonEnumerableProperty('__get__', _get__);
260
+ addNonEnumerableProperty('__GetDependency__', _get__);
261
+ addNonEnumerableProperty('__Rewire__', _set__);
262
+ addNonEnumerableProperty('__set__', _set__);
263
+ addNonEnumerableProperty('__reset__', _reset__);
264
+ addNonEnumerableProperty('__ResetDependency__', _reset__);
265
+ addNonEnumerableProperty('__with__', _with__);
266
+ addNonEnumerableProperty('__RewireAPI__', _RewireAPI__);
267
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "custom-electron-titlebar",
3
- "version": "4.2.0",
3
+ "version": "4.2.1",
4
4
  "description": "Library for electron that allows you to configure a fully customizable title bar.",
5
5
  "types": "./dist/index.d.ts",
6
6
  "typesVersions": {