custom-electron-titlebar 4.2.8 → 4.4.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 (74) hide show
  1. package/README.md +32 -12
  2. package/index.d.mts +684 -0
  3. package/index.d.ts +684 -3
  4. package/index.js +5207 -175
  5. package/index.js.map +1 -0
  6. package/index.mjs +5219 -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 +40 -32
  15. package/base/browser/browser.d.ts +0 -26
  16. package/base/browser/browser.js +0 -317
  17. package/base/browser/event.d.ts +0 -12
  18. package/base/browser/event.js +0 -215
  19. package/base/browser/keyboardEvent.d.ts +0 -38
  20. package/base/browser/keyboardEvent.js +0 -462
  21. package/base/browser/mouseEvent.d.ts +0 -61
  22. package/base/browser/mouseEvent.js +0 -327
  23. package/base/browser/touch.d.ts +0 -39
  24. package/base/browser/touch.js +0 -454
  25. package/base/common/arrays.d.ts +0 -10
  26. package/base/common/arrays.js +0 -210
  27. package/base/common/async.d.ts +0 -35
  28. package/base/common/async.js +0 -280
  29. package/base/common/charCode.d.ts +0 -405
  30. package/base/common/charCode.js +0 -9
  31. package/base/common/color.d.ts +0 -159
  32. package/base/common/color.js +0 -708
  33. package/base/common/decorators.d.ts +0 -6
  34. package/base/common/decorators.js +0 -300
  35. package/base/common/dom.d.ts +0 -221
  36. package/base/common/dom.js +0 -1476
  37. package/base/common/event.d.ts +0 -213
  38. package/base/common/event.js +0 -804
  39. package/base/common/iterator.d.ts +0 -69
  40. package/base/common/iterator.js +0 -380
  41. package/base/common/keyCodes.d.ts +0 -478
  42. package/base/common/keyCodes.js +0 -477
  43. package/base/common/lifecycle.d.ts +0 -17
  44. package/base/common/lifecycle.js +0 -258
  45. package/base/common/linkedList.d.ts +0 -17
  46. package/base/common/linkedList.js +0 -319
  47. package/base/common/platform.d.ts +0 -36
  48. package/base/common/platform.js +0 -314
  49. package/base/common/strings.d.ts +0 -23
  50. package/base/common/strings.js +0 -273
  51. package/consts.d.ts +0 -58
  52. package/consts.js +0 -317
  53. package/main/attach-titlebar-to-window.d.ts +0 -3
  54. package/main/attach-titlebar-to-window.js +0 -210
  55. package/main/setup-titlebar.d.ts +0 -2
  56. package/main/setup-titlebar.js +0 -255
  57. package/menubar/index.d.ts +0 -86
  58. package/menubar/index.js +0 -1119
  59. package/menubar/menu/index.d.ts +0 -46
  60. package/menubar/menu/index.js +0 -565
  61. package/menubar/menu/item.d.ts +0 -67
  62. package/menubar/menu/item.js +0 -575
  63. package/menubar/menu/separator.d.ts +0 -11
  64. package/menubar/menu/separator.js +0 -213
  65. package/menubar/menu/submenu.d.ts +0 -32
  66. package/menubar/menu/submenu.js +0 -372
  67. package/menubar/menubar-options.d.ts +0 -47
  68. package/menubar/menubar-options.js +0 -9
  69. package/titlebar/index.d.ts +0 -105
  70. package/titlebar/index.js +0 -703
  71. package/titlebar/options.d.ts +0 -89
  72. package/titlebar/options.js +0 -9
  73. package/titlebar/themebar.d.ts +0 -20
  74. package/titlebar/themebar.js +0 -267
package/consts.js DELETED
@@ -1,317 +0,0 @@
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
- });
10
- exports.loadWindowIcons = exports.applyFill = exports.parseAccelerator = exports.cleanMnemonic = exports.mnemonicButtonLabel = exports.mnemonicMenuLabel = exports.getPx = exports.menuIcons = exports.MENU_ESCAPED_MNEMONIC_REGEX = exports.MENU_MNEMONIC_REGEX = exports.WINDOW_MIN_HEIGHT = exports.WINDOW_MIN_WIDTH = exports.TOP_TITLEBAR_HEIGHT_WIN = exports.TOP_TITLEBAR_HEIGHT_MAC = exports.BOTTOM_TITLEBAR_HEIGHT = exports.IS_MAC_BIGSUR_OR_LATER = exports.DEFAULT_ITEM_SELECTOR = exports.ACTIVE_FOREGROUND = exports.INACTIVE_FOREGROUND = exports.ACTIVE_FOREGROUND_DARK = exports.INACTIVE_FOREGROUND_DARK = void 0;
11
- const color_1 = require("./base/common/color");
12
- const platform_1 = require("./base/common/platform");
13
- exports.INACTIVE_FOREGROUND_DARK = _get__("color_1").Color.fromHex('#222222');
14
- exports.ACTIVE_FOREGROUND_DARK = _get__("color_1").Color.fromHex('#333333');
15
- exports.INACTIVE_FOREGROUND = _get__("color_1").Color.fromHex('#EEEEEE');
16
- exports.ACTIVE_FOREGROUND = _get__("color_1").Color.fromHex('#FFFFFF');
17
- exports.DEFAULT_ITEM_SELECTOR = _get__("color_1").Color.fromHex('#0000001F');
18
- exports.IS_MAC_BIGSUR_OR_LATER = _get__("platform_1").isMacintosh && parseInt(process.getSystemVersion().split('.')[0]) >= 11;
19
- exports.BOTTOM_TITLEBAR_HEIGHT = 60;
20
- exports.TOP_TITLEBAR_HEIGHT_MAC = exports.IS_MAC_BIGSUR_OR_LATER ? 28 : 22;
21
- exports.TOP_TITLEBAR_HEIGHT_WIN = 30;
22
- exports.WINDOW_MIN_WIDTH = 400;
23
- exports.WINDOW_MIN_HEIGHT = 270;
24
- exports.MENU_MNEMONIC_REGEX = /\(&([^\s&])\)|(^|[^&])&([^\s&])/;
25
- exports.MENU_ESCAPED_MNEMONIC_REGEX = /(&)?(&)([^\s&])/g;
26
- exports.menuIcons = {
27
- submenuIndicator: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none" /><polyline points="9 6 15 12 9 18" /></svg>',
28
- checkbox: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l5 5l10 -10" /></svg>',
29
- radioChecked: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill="currentColor" d="M10,5 C7.2,5 5,7.2 5,10 C5,12.8 7.2,15 10,15 C12.8,15 15,12.8 15,10 C15,7.2 12.8,5 10,5 L10,5 Z M10,0 C4.5,0 0,4.5 0,10 C0,15.5 4.5,20 10,20 C15.5,20 20,15.5 20,10 C20,4.5 15.5,0 10,0 L10,0 Z M10,18 C5.6,18 2,14.4 2,10 C2,5.6 5.6,2 10,2 C14.4,2 18,5.6 18,10 C18,14.4 14.4,18 10,18 L10,18 Z" /></svg>',
30
- radioUnchecked: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill="currentColor" d="M10,0 C4.5,0 0,4.5 0,10 C0,15.5 4.5,20 10,20 C15.5,20 20,15.5 20,10 C20,4.5 15.5,0 10,0 L10,0 Z M10,18 C5.6,18 2,14.4 2,10 C2,5.6 5.6,2 10,2 C14.4,2 18,5.6 18,10 C18,14.4 14.4,18 10,18 L10,18 Z" /></svg>',
31
- linux: {
32
- minimize: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 11"><path d="M11,4.9v1.1H0V4.399h11z"/></svg>',
33
- maximize: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 11"><path d="M0,1.7v7.6C0,10.2,0.8,11,1.7,11h7.6c0.9,0,1.7-0.8,1.7-1.7V1.7C11,0.8,10.2,0,9.3,0H1.7C0.8,0,0,0.8,0,1.7z M8.8,9.9H2.2c-0.6,0-1.1-0.5-1.1-1.1V2.2c0-0.6,0.5-1.1,1.1-1.1h6.7c0.6,0,1.1,0.5,1.1,1.1v6.7C9.9,9.4,9.4,9.9,8.8,9.9z"/></svg>',
34
- restore: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 11"><path d="M7.9,2.2h-7C0.4,2.2,0,2.6,0,3.1v7C0,10.6,0.4,11,0.9,11h7c0.5,0,0.9-0.4,0.9-0.9v-7C8.8,2.6,8.4,2.2,7.9,2.2z M7.7,9.6 c0,0.2-0.1,0.3-0.3,0.3h-6c-0.2,0-0.3-0.1-0.3-0.3v-6c0-0.2,0.1-0.3,0.3-0.3h6c0.2,0,0.3,0.1,0.3,0.3V9.6z M10,0.9 c0,0.5-0.4,0.9-0.9,0.9h-2.1 c-0.5,0-0.9-0.4-0.9-0.9V0.9c0-0.5,0.4-0.9,0.9-0.9h2.1C9.6,0,10,0.4,10,0.9z"/></svg>',
35
- close: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 11"><path d="M6.279 5.5L11 10.221l-.779.779L5.5 6.279.779 11 0 10.221 4.721 5.5 0 .779.779 0 5.5 4.721 10.221 0 11 .779 6.279 5.5z"/></svg>'
36
- },
37
- freebsd: {
38
- minimize: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 11"><path d="M11,4.9v1.1H0V4.399h11z"/></svg>',
39
- maximize: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 11"><path d="M0,1.7v7.6C0,10.2,0.8,11,1.7,11h7.6c0.9,0,1.7-0.8,1.7-1.7V1.7C11,0.8,10.2,0,9.3,0H1.7C0.8,0,0,0.8,0,1.7z M8.8,9.9H2.2c-0.6,0-1.1-0.5-1.1-1.1V2.2c0-0.6,0.5-1.1,1.1-1.1h6.7c0.6,0,1.1,0.5,1.1,1.1v6.7C9.9,9.4,9.4,9.9,8.8,9.9z"/></svg>',
40
- restore: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 11"><path d="M7.9,2.2h-7C0.4,2.2,0,2.6,0,3.1v7C0,10.6,0.4,11,0.9,11h7c0.5,0,0.9-0.4,0.9-0.9v-7C8.8,2.6,8.4,2.2,7.9,2.2z M7.7,9.6 c0,0.2-0.1,0.3-0.3,0.3h-6c-0.2,0-0.3-0.1-0.3-0.3v-6c0-0.2,0.1-0.3,0.3-0.3h6c0.2,0,0.3,0.1,0.3,0.3V9.6z M10,0.9 c0,0.5-0.4,0.9-0.9,0.9h-2.1 c-0.5,0-0.9-0.4-0.9-0.9V0.9c0-0.5,0.4-0.9,0.9-0.9h2.1C9.6,0,10,0.4,10,0.9z"/></svg>',
41
- close: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 11"><path d="M6.279 5.5L11 10.221l-.779.779L5.5 6.279.779 11 0 10.221 4.721 5.5 0 .779.779 0 5.5 4.721 10.221 0 11 .779 6.279 5.5z"/></svg>'
42
- },
43
- windows: {
44
- minimize: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 11"><path d="M11,4.9v1.1H0V4.399h11z"/></svg>',
45
- maximize: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 11"><path d="M0,1.7v7.6C0,10.2,0.8,11,1.7,11h7.6c0.9,0,1.7-0.8,1.7-1.7V1.7C11,0.8,10.2,0,9.3,0H1.7C0.8,0,0,0.8,0,1.7z M8.8,9.9H2.2c-0.6,0-1.1-0.5-1.1-1.1V2.2c0-0.6,0.5-1.1,1.1-1.1h6.7c0.6,0,1.1,0.5,1.1,1.1v6.7C9.9,9.4,9.4,9.9,8.8,9.9z"/></svg>',
46
- restore: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 11"><path d="M7.9,2.2h-7C0.4,2.2,0,2.6,0,3.1v7C0,10.6,0.4,11,0.9,11h7c0.5,0,0.9-0.4,0.9-0.9v-7C8.8,2.6,8.4,2.2,7.9,2.2z M7.7,9.6 c0,0.2-0.1,0.3-0.3,0.3h-6c-0.2,0-0.3-0.1-0.3-0.3v-6c0-0.2,0.1-0.3,0.3-0.3h6c0.2,0,0.3,0.1,0.3,0.3V9.6z"/><path d="M10,0H3.5v1.1h6.1c0.2,0,0.3,0.1,0.3,0.3v6.1H11V1C11,0.4,10.6,0,10,0z"/></svg>',
47
- close: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 11"><path d="M6.279 5.5L11 10.221l-.779.779L5.5 6.279.779 11 0 10.221 4.721 5.5 0 .779.779 0 5.5 4.721 10.221 0 11 .779 6.279 5.5z"/></svg>'
48
- }
49
- };
50
- function getPx(value) {
51
- return `${value}px`;
52
- }
53
- exports.getPx = _get__("getPx");
54
- /**
55
- * Handles mnemonics for menu items. Depending on OS:
56
- * - Windows: Supported via & character (replace && with &)
57
- * - Linux: Supported via & character (replace && with &)
58
- * - FreeBSD: Supported via & character (replace && with &)
59
- * - macOS: Unsupported (replace && with empty string)
60
- */
61
- function mnemonicMenuLabel(label, forceDisableMnemonics) {
62
- if (_get__("platform_1").isMacintosh || forceDisableMnemonics) {
63
- return label.replace(/\(&&\w\)|&&/g, '').replace(/&/g, _get__("platform_1").isMacintosh ? '&' : '&&');
64
- }
65
- return label.replace(/&&|&/g, m => m === '&' ? '&&' : '&');
66
- }
67
- exports.mnemonicMenuLabel = _get__("mnemonicMenuLabel");
68
- /**
69
- * Handles mnemonics for buttons. Depending on OS:
70
- * - Windows: Supported via & character (replace && with & and & with && for escaping)
71
- * - Linux: Supported via _ character (replace && with _)
72
- * - FreeBSD: Supported via _ character (replace && with _)
73
- * - macOS: Unsupported (replace && with empty string)
74
- */
75
- function mnemonicButtonLabel(label, forceDisableMnemonics) {
76
- if (_get__("platform_1").isMacintosh || forceDisableMnemonics) {
77
- return label.replace(/\(&&\w\)|&&/g, '');
78
- }
79
- if (_get__("platform_1").isWindows) {
80
- return label.replace(/&&|&/g, m => m === '&' ? '&&' : '&');
81
- }
82
- return label.replace(/&&/g, '_');
83
- }
84
- exports.mnemonicButtonLabel = _get__("mnemonicButtonLabel");
85
- function cleanMnemonic(label) {
86
- const regex = exports.MENU_MNEMONIC_REGEX;
87
- const matches = regex.exec(label);
88
- if (!matches) {
89
- return label;
90
- }
91
- const mnemonicInText = !matches[1];
92
- return label.replace(regex, mnemonicInText ? '$2$3' : '').trim();
93
- }
94
- exports.cleanMnemonic = _get__("cleanMnemonic");
95
- function parseAccelerator(accelerator) {
96
- let acc = accelerator.toString();
97
- if (!_get__("platform_1").isMacintosh) {
98
- acc = acc.replace(/(Cmd)|(Command)/gi, '');
99
- } else {
100
- acc = acc.replace(/(Ctrl)|(Control)/gi, '');
101
- }
102
- acc = acc.replace(/(Or)/gi, '');
103
- return acc;
104
- }
105
- exports.parseAccelerator = _get__("parseAccelerator");
106
- function applyFill(element, svgColor, fgColor, color = true) {
107
- let fillColor = '';
108
- if (svgColor) fillColor = svgColor.toString();else if (fgColor) fillColor = fgColor.toString();
109
- if (element && element !== null) {
110
- if (color) element.style.color = fillColor;else element.style.backgroundColor = fillColor;
111
- }
112
- }
113
- exports.applyFill = _get__("applyFill");
114
- function loadWindowIcons(icons) {
115
- if (!icons) return;
116
- const jWindowsIcons = require(icons);
117
- return {
118
- icons: jWindowsIcons,
119
- platformIcons: jWindowsIcons[(0, _get__("platform_1").PlatformToString)(_get__("platform_1").platform).toLocaleLowerCase()]
120
- };
121
- }
122
- exports.loadWindowIcons = _get__("loadWindowIcons");
123
- function _getGlobalObject() {
124
- try {
125
- if (!!global) {
126
- return global;
127
- }
128
- } catch (e) {
129
- try {
130
- if (!!window) {
131
- return window;
132
- }
133
- } catch (e) {
134
- return this;
135
- }
136
- }
137
- }
138
- ;
139
- var _RewireModuleId__ = null;
140
- function _getRewireModuleId__() {
141
- if (_RewireModuleId__ === null) {
142
- let globalVariable = _getGlobalObject();
143
- if (!globalVariable.__$$GLOBAL_REWIRE_NEXT_MODULE_ID__) {
144
- globalVariable.__$$GLOBAL_REWIRE_NEXT_MODULE_ID__ = 0;
145
- }
146
- _RewireModuleId__ = __$$GLOBAL_REWIRE_NEXT_MODULE_ID__++;
147
- }
148
- return _RewireModuleId__;
149
- }
150
- function _getRewireRegistry__() {
151
- let theGlobalVariable = _getGlobalObject();
152
- if (!theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__) {
153
- theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__ = Object.create(null);
154
- }
155
- return theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__;
156
- }
157
- function _getRewiredData__() {
158
- let moduleId = _getRewireModuleId__();
159
- let registry = _getRewireRegistry__();
160
- let rewireData = registry[moduleId];
161
- if (!rewireData) {
162
- registry[moduleId] = Object.create(null);
163
- rewireData = registry[moduleId];
164
- }
165
- return rewireData;
166
- }
167
- (function registerResetAll() {
168
- let theGlobalVariable = _getGlobalObject();
169
- if (!theGlobalVariable['__rewire_reset_all__']) {
170
- theGlobalVariable['__rewire_reset_all__'] = function () {
171
- theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__ = Object.create(null);
172
- };
173
- }
174
- })();
175
- var INTENTIONAL_UNDEFINED = '__INTENTIONAL_UNDEFINED__';
176
- let _RewireAPI__ = {};
177
- (function () {
178
- function addPropertyToAPIObject(name, value) {
179
- Object.defineProperty(_RewireAPI__, name, {
180
- value: value,
181
- enumerable: false,
182
- configurable: true
183
- });
184
- }
185
- addPropertyToAPIObject('__get__', _get__);
186
- addPropertyToAPIObject('__GetDependency__', _get__);
187
- addPropertyToAPIObject('__Rewire__', _set__);
188
- addPropertyToAPIObject('__set__', _set__);
189
- addPropertyToAPIObject('__reset__', _reset__);
190
- addPropertyToAPIObject('__ResetDependency__', _reset__);
191
- addPropertyToAPIObject('__with__', _with__);
192
- })();
193
- function _get__(variableName) {
194
- let rewireData = _getRewiredData__();
195
- if (rewireData[variableName] === undefined) {
196
- return _get_original__(variableName);
197
- } else {
198
- var value = rewireData[variableName];
199
- if (value === INTENTIONAL_UNDEFINED) {
200
- return undefined;
201
- } else {
202
- return value;
203
- }
204
- }
205
- }
206
- function _get_original__(variableName) {
207
- switch (variableName) {
208
- case "color_1":
209
- return color_1;
210
- case "platform_1":
211
- return platform_1;
212
- case "getPx":
213
- return getPx;
214
- case "mnemonicMenuLabel":
215
- return mnemonicMenuLabel;
216
- case "mnemonicButtonLabel":
217
- return mnemonicButtonLabel;
218
- case "cleanMnemonic":
219
- return cleanMnemonic;
220
- case "parseAccelerator":
221
- return parseAccelerator;
222
- case "applyFill":
223
- return applyFill;
224
- case "loadWindowIcons":
225
- return loadWindowIcons;
226
- }
227
- return undefined;
228
- }
229
- function _assign__(variableName, value) {
230
- let rewireData = _getRewiredData__();
231
- if (rewireData[variableName] === undefined) {
232
- return _set_original__(variableName, value);
233
- } else {
234
- return rewireData[variableName] = value;
235
- }
236
- }
237
- function _set_original__(variableName, _value) {
238
- switch (variableName) {}
239
- return undefined;
240
- }
241
- function _update_operation__(operation, variableName, prefix) {
242
- var oldValue = _get__(variableName);
243
- var newValue = operation === '++' ? oldValue + 1 : oldValue - 1;
244
- _assign__(variableName, newValue);
245
- return prefix ? newValue : oldValue;
246
- }
247
- function _set__(variableName, value) {
248
- let rewireData = _getRewiredData__();
249
- if (typeof variableName === 'object') {
250
- Object.keys(variableName).forEach(function (name) {
251
- rewireData[name] = variableName[name];
252
- });
253
- return function () {
254
- Object.keys(variableName).forEach(function (name) {
255
- _reset__(variableName);
256
- });
257
- };
258
- } else {
259
- if (value === undefined) {
260
- rewireData[variableName] = INTENTIONAL_UNDEFINED;
261
- } else {
262
- rewireData[variableName] = value;
263
- }
264
- return function () {
265
- _reset__(variableName);
266
- };
267
- }
268
- }
269
- function _reset__(variableName) {
270
- let rewireData = _getRewiredData__();
271
- delete rewireData[variableName];
272
- if (Object.keys(rewireData).length == 0) {
273
- delete _getRewireRegistry__()[_getRewireModuleId__];
274
- }
275
- ;
276
- }
277
- function _with__(object) {
278
- let rewireData = _getRewiredData__();
279
- var rewiredVariableNames = Object.keys(object);
280
- var previousValues = {};
281
- function reset() {
282
- rewiredVariableNames.forEach(function (variableName) {
283
- rewireData[variableName] = previousValues[variableName];
284
- });
285
- }
286
- return function (callback) {
287
- rewiredVariableNames.forEach(function (variableName) {
288
- previousValues[variableName] = rewireData[variableName];
289
- rewireData[variableName] = object[variableName];
290
- });
291
- let result = callback();
292
- if (!!result && typeof result.then == 'function') {
293
- result.then(reset).catch(reset);
294
- } else {
295
- reset();
296
- }
297
- return result;
298
- };
299
- }
300
- let _typeOfOriginalExport = typeof module.exports;
301
- function addNonEnumerableProperty(name, value) {
302
- Object.defineProperty(module.exports, name, {
303
- value: value,
304
- enumerable: false,
305
- configurable: true
306
- });
307
- }
308
- if ((_typeOfOriginalExport === 'object' || _typeOfOriginalExport === 'function') && Object.isExtensible(module.exports)) {
309
- addNonEnumerableProperty('__get__', _get__);
310
- addNonEnumerableProperty('__GetDependency__', _get__);
311
- addNonEnumerableProperty('__Rewire__', _set__);
312
- addNonEnumerableProperty('__set__', _set__);
313
- addNonEnumerableProperty('__reset__', _reset__);
314
- addNonEnumerableProperty('__ResetDependency__', _reset__);
315
- addNonEnumerableProperty('__with__', _with__);
316
- addNonEnumerableProperty('__RewireAPI__', _RewireAPI__);
317
- }
@@ -1,3 +0,0 @@
1
- import { BrowserWindow } from 'electron';
2
- declare const _default: (browserWindow: BrowserWindow) => void;
3
- export default _default;
@@ -1,210 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- /* ---------------------------------------------------------------------------------------------
7
- * Copyright (c) AlexTorresDev. All rights reserved.
8
- * Licensed under the MIT License. See License.txt in the project root for license information.
9
- *-------------------------------------------------------------------------------------------- */
10
- const consts_1 = require("../consts");
11
- exports.default = browserWindow => {
12
- browserWindow.setMinimumSize(_get__("consts_1").WINDOW_MIN_WIDTH, _get__("consts_1").WINDOW_MIN_HEIGHT);
13
- browserWindow.on('enter-full-screen', () => {
14
- browserWindow.webContents.send('window-fullscreen', true);
15
- });
16
- browserWindow.on('leave-full-screen', () => {
17
- browserWindow.webContents.send('window-fullscreen', false);
18
- });
19
- browserWindow.on('focus', () => {
20
- browserWindow.webContents.send('window-focus', true);
21
- });
22
- browserWindow.on('blur', () => {
23
- browserWindow.webContents.send('window-focus', false);
24
- });
25
- browserWindow.on('maximize', () => {
26
- browserWindow.webContents.send('window-maximize', true);
27
- });
28
- browserWindow.on('unmaximize', () => {
29
- browserWindow.webContents.send('window-maximize', false);
30
- });
31
- };
32
- function _getGlobalObject() {
33
- try {
34
- if (!!global) {
35
- return global;
36
- }
37
- } catch (e) {
38
- try {
39
- if (!!window) {
40
- return window;
41
- }
42
- } catch (e) {
43
- return this;
44
- }
45
- }
46
- }
47
- ;
48
- var _RewireModuleId__ = null;
49
- function _getRewireModuleId__() {
50
- if (_RewireModuleId__ === null) {
51
- let globalVariable = _getGlobalObject();
52
- if (!globalVariable.__$$GLOBAL_REWIRE_NEXT_MODULE_ID__) {
53
- globalVariable.__$$GLOBAL_REWIRE_NEXT_MODULE_ID__ = 0;
54
- }
55
- _RewireModuleId__ = __$$GLOBAL_REWIRE_NEXT_MODULE_ID__++;
56
- }
57
- return _RewireModuleId__;
58
- }
59
- function _getRewireRegistry__() {
60
- let theGlobalVariable = _getGlobalObject();
61
- if (!theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__) {
62
- theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__ = Object.create(null);
63
- }
64
- return theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__;
65
- }
66
- function _getRewiredData__() {
67
- let moduleId = _getRewireModuleId__();
68
- let registry = _getRewireRegistry__();
69
- let rewireData = registry[moduleId];
70
- if (!rewireData) {
71
- registry[moduleId] = Object.create(null);
72
- rewireData = registry[moduleId];
73
- }
74
- return rewireData;
75
- }
76
- (function registerResetAll() {
77
- let theGlobalVariable = _getGlobalObject();
78
- if (!theGlobalVariable['__rewire_reset_all__']) {
79
- theGlobalVariable['__rewire_reset_all__'] = function () {
80
- theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__ = Object.create(null);
81
- };
82
- }
83
- })();
84
- var INTENTIONAL_UNDEFINED = '__INTENTIONAL_UNDEFINED__';
85
- let _RewireAPI__ = {};
86
- (function () {
87
- function addPropertyToAPIObject(name, value) {
88
- Object.defineProperty(_RewireAPI__, name, {
89
- value: value,
90
- enumerable: false,
91
- configurable: true
92
- });
93
- }
94
- addPropertyToAPIObject('__get__', _get__);
95
- addPropertyToAPIObject('__GetDependency__', _get__);
96
- addPropertyToAPIObject('__Rewire__', _set__);
97
- addPropertyToAPIObject('__set__', _set__);
98
- addPropertyToAPIObject('__reset__', _reset__);
99
- addPropertyToAPIObject('__ResetDependency__', _reset__);
100
- addPropertyToAPIObject('__with__', _with__);
101
- })();
102
- function _get__(variableName) {
103
- let rewireData = _getRewiredData__();
104
- if (rewireData[variableName] === undefined) {
105
- return _get_original__(variableName);
106
- } else {
107
- var value = rewireData[variableName];
108
- if (value === INTENTIONAL_UNDEFINED) {
109
- return undefined;
110
- } else {
111
- return value;
112
- }
113
- }
114
- }
115
- function _get_original__(variableName) {
116
- switch (variableName) {
117
- case "consts_1":
118
- return consts_1;
119
- }
120
- return undefined;
121
- }
122
- function _assign__(variableName, value) {
123
- let rewireData = _getRewiredData__();
124
- if (rewireData[variableName] === undefined) {
125
- return _set_original__(variableName, value);
126
- } else {
127
- return rewireData[variableName] = value;
128
- }
129
- }
130
- function _set_original__(variableName, _value) {
131
- switch (variableName) {}
132
- return undefined;
133
- }
134
- function _update_operation__(operation, variableName, prefix) {
135
- var oldValue = _get__(variableName);
136
- var newValue = operation === '++' ? oldValue + 1 : oldValue - 1;
137
- _assign__(variableName, newValue);
138
- return prefix ? newValue : oldValue;
139
- }
140
- function _set__(variableName, value) {
141
- let rewireData = _getRewiredData__();
142
- if (typeof variableName === 'object') {
143
- Object.keys(variableName).forEach(function (name) {
144
- rewireData[name] = variableName[name];
145
- });
146
- return function () {
147
- Object.keys(variableName).forEach(function (name) {
148
- _reset__(variableName);
149
- });
150
- };
151
- } else {
152
- if (value === undefined) {
153
- rewireData[variableName] = INTENTIONAL_UNDEFINED;
154
- } else {
155
- rewireData[variableName] = value;
156
- }
157
- return function () {
158
- _reset__(variableName);
159
- };
160
- }
161
- }
162
- function _reset__(variableName) {
163
- let rewireData = _getRewiredData__();
164
- delete rewireData[variableName];
165
- if (Object.keys(rewireData).length == 0) {
166
- delete _getRewireRegistry__()[_getRewireModuleId__];
167
- }
168
- ;
169
- }
170
- function _with__(object) {
171
- let rewireData = _getRewiredData__();
172
- var rewiredVariableNames = Object.keys(object);
173
- var previousValues = {};
174
- function reset() {
175
- rewiredVariableNames.forEach(function (variableName) {
176
- rewireData[variableName] = previousValues[variableName];
177
- });
178
- }
179
- return function (callback) {
180
- rewiredVariableNames.forEach(function (variableName) {
181
- previousValues[variableName] = rewireData[variableName];
182
- rewireData[variableName] = object[variableName];
183
- });
184
- let result = callback();
185
- if (!!result && typeof result.then == 'function') {
186
- result.then(reset).catch(reset);
187
- } else {
188
- reset();
189
- }
190
- return result;
191
- };
192
- }
193
- let _typeOfOriginalExport = typeof module.exports;
194
- function addNonEnumerableProperty(name, value) {
195
- Object.defineProperty(module.exports, name, {
196
- value: value,
197
- enumerable: false,
198
- configurable: true
199
- });
200
- }
201
- if ((_typeOfOriginalExport === 'object' || _typeOfOriginalExport === 'function') && Object.isExtensible(module.exports)) {
202
- addNonEnumerableProperty('__get__', _get__);
203
- addNonEnumerableProperty('__GetDependency__', _get__);
204
- addNonEnumerableProperty('__Rewire__', _set__);
205
- addNonEnumerableProperty('__set__', _set__);
206
- addNonEnumerableProperty('__reset__', _reset__);
207
- addNonEnumerableProperty('__ResetDependency__', _reset__);
208
- addNonEnumerableProperty('__with__', _with__);
209
- addNonEnumerableProperty('__RewireAPI__', _RewireAPI__);
210
- }
@@ -1,2 +0,0 @@
1
- declare const _default: () => void;
2
- export default _default;