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
@@ -1,314 +0,0 @@
1
- "use strict";
2
-
3
- /* eslint-disable indent */
4
- /* ---------------------------------------------------------------------------------------------
5
- * Copyright (c) Microsoft Corporation. All rights reserved.
6
- * Licensed under the MIT License. See License.txt in the project root for license information.
7
- *-------------------------------------------------------------------------------------------- */
8
- Object.defineProperty(exports, "__esModule", {
9
- value: true
10
- });
11
- exports.OS = exports.setImmediate = exports.globals = exports.isRootUser = exports.platform = exports.isWeb = exports.isNative = exports.isFreeBSD = exports.isLinux = exports.isMacintosh = exports.isWindows = exports.PlatformToString = void 0;
12
- let _isWindows = false;
13
- let _isMacintosh = false;
14
- let _isLinux = false;
15
- let _isFreeBSD = false;
16
- let _isNative = false;
17
- let _isWeb = false;
18
- const isElectronRenderer = typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'renderer';
19
- // OS detection
20
- if (typeof navigator === 'object' && !_get__("isElectronRenderer")) {
21
- const userAgent = navigator.userAgent;
22
- _assign__("_isWindows", userAgent.indexOf('Windows') >= 0);
23
- _assign__("_isMacintosh", userAgent.indexOf('Macintosh') >= 0);
24
- _assign__("_isLinux", userAgent.indexOf('Linux') >= 0);
25
- _assign__("_isFreeBSD", userAgent.indexOf('FreeBSD') >= 0);
26
- _assign__("_isWeb", true);
27
- } else if (typeof process === 'object') {
28
- _assign__("_isWindows", process.platform === 'win32');
29
- _assign__("_isMacintosh", process.platform === 'darwin');
30
- _assign__("_isLinux", process.platform === 'linux');
31
- _assign__("_isFreeBSD", process.platform === 'freebsd');
32
- _assign__("_isNative", true);
33
- }
34
- function PlatformToString(platform) {
35
- switch (platform) {
36
- case 0 /* Platform.Web */:
37
- return 'Web';
38
- case 1 /* Platform.Mac */:
39
- return 'Mac';
40
- case 2 /* Platform.Linux */:
41
- return 'Linux';
42
- case 3 /* Platform.FreeBSD */:
43
- return 'FreeBSD';
44
- case 4 /* Platform.Windows */:
45
- return 'Windows';
46
- }
47
- }
48
- exports.PlatformToString = _get__("PlatformToString");
49
- let _platform = 0 /* Platform.Web */;
50
- if (_get__("_isNative")) {
51
- if (_get__("_isMacintosh")) {
52
- _assign__("_platform", 1) /* Platform.Mac */;
53
- } else if (_get__("_isWindows")) {
54
- _assign__("_platform", 4) /* Platform.Windows */;
55
- } else if (_get__("_isLinux")) {
56
- _assign__("_platform", 2) /* Platform.Linux */;
57
- } else if (_get__("_isFreeBSD")) {
58
- _assign__("_platform", 3) /* Platform.FreeBSD */;
59
- }
60
- }
61
- exports.isWindows = _get__("_isWindows");
62
- exports.isMacintosh = _get__("_isMacintosh");
63
- exports.isLinux = _get__("_isLinux");
64
- exports.isFreeBSD = _get__("_isFreeBSD");
65
- exports.isNative = _get__("_isNative");
66
- exports.isWeb = _get__("_isWeb");
67
- exports.platform = _get__("_platform");
68
- function isRootUser() {
69
- return _get__("_isNative") && !_get__("_isWindows") && process.getuid() === 0;
70
- }
71
- exports.isRootUser = _get__("isRootUser");
72
- const g = typeof global === 'object' ? global : {};
73
- const _globals = typeof self === 'object' ? self : _get__("g");
74
- exports.globals = _get__("_globals");
75
- let _setImmediate = null;
76
- function setImmediate(callback) {
77
- if (_get__("_setImmediate") === null) {
78
- if (exports.globals.setImmediate) {
79
- _assign__("_setImmediate", exports.globals.setImmediate.bind(exports.globals));
80
- } else if (typeof process !== 'undefined' && typeof process.nextTick === 'function') {
81
- _assign__("_setImmediate", process.nextTick.bind(process));
82
- } else {
83
- _assign__("_setImmediate", exports.globals.setTimeout.bind(exports.globals));
84
- }
85
- }
86
- return _get__("_setImmediate")(callback);
87
- }
88
- exports.setImmediate = _get__("setImmediate");
89
- const _wl = _get__("_isWindows") ? 1 /* OperatingSystem.Windows */ : 3 /* OperatingSystem.Linux */ | 4 /* OperatingSystem.FreeBSD */;
90
- exports.OS = _get__("_isMacintosh") ? 2 /* OperatingSystem.Macintosh */ : _get__("_wl");
91
- function _getGlobalObject() {
92
- try {
93
- if (!!global) {
94
- return global;
95
- }
96
- } catch (e) {
97
- try {
98
- if (!!window) {
99
- return window;
100
- }
101
- } catch (e) {
102
- return this;
103
- }
104
- }
105
- }
106
- ;
107
- var _RewireModuleId__ = null;
108
- function _getRewireModuleId__() {
109
- if (_RewireModuleId__ === null) {
110
- let globalVariable = _getGlobalObject();
111
- if (!globalVariable.__$$GLOBAL_REWIRE_NEXT_MODULE_ID__) {
112
- globalVariable.__$$GLOBAL_REWIRE_NEXT_MODULE_ID__ = 0;
113
- }
114
- _RewireModuleId__ = __$$GLOBAL_REWIRE_NEXT_MODULE_ID__++;
115
- }
116
- return _RewireModuleId__;
117
- }
118
- function _getRewireRegistry__() {
119
- let theGlobalVariable = _getGlobalObject();
120
- if (!theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__) {
121
- theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__ = Object.create(null);
122
- }
123
- return theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__;
124
- }
125
- function _getRewiredData__() {
126
- let moduleId = _getRewireModuleId__();
127
- let registry = _getRewireRegistry__();
128
- let rewireData = registry[moduleId];
129
- if (!rewireData) {
130
- registry[moduleId] = Object.create(null);
131
- rewireData = registry[moduleId];
132
- }
133
- return rewireData;
134
- }
135
- (function registerResetAll() {
136
- let theGlobalVariable = _getGlobalObject();
137
- if (!theGlobalVariable['__rewire_reset_all__']) {
138
- theGlobalVariable['__rewire_reset_all__'] = function () {
139
- theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__ = Object.create(null);
140
- };
141
- }
142
- })();
143
- var INTENTIONAL_UNDEFINED = '__INTENTIONAL_UNDEFINED__';
144
- let _RewireAPI__ = {};
145
- (function () {
146
- function addPropertyToAPIObject(name, value) {
147
- Object.defineProperty(_RewireAPI__, name, {
148
- value: value,
149
- enumerable: false,
150
- configurable: true
151
- });
152
- }
153
- addPropertyToAPIObject('__get__', _get__);
154
- addPropertyToAPIObject('__GetDependency__', _get__);
155
- addPropertyToAPIObject('__Rewire__', _set__);
156
- addPropertyToAPIObject('__set__', _set__);
157
- addPropertyToAPIObject('__reset__', _reset__);
158
- addPropertyToAPIObject('__ResetDependency__', _reset__);
159
- addPropertyToAPIObject('__with__', _with__);
160
- })();
161
- function _get__(variableName) {
162
- let rewireData = _getRewiredData__();
163
- if (rewireData[variableName] === undefined) {
164
- return _get_original__(variableName);
165
- } else {
166
- var value = rewireData[variableName];
167
- if (value === INTENTIONAL_UNDEFINED) {
168
- return undefined;
169
- } else {
170
- return value;
171
- }
172
- }
173
- }
174
- function _get_original__(variableName) {
175
- switch (variableName) {
176
- case "isElectronRenderer":
177
- return isElectronRenderer;
178
- case "_isWindows":
179
- return _isWindows;
180
- case "_isMacintosh":
181
- return _isMacintosh;
182
- case "_isLinux":
183
- return _isLinux;
184
- case "_isFreeBSD":
185
- return _isFreeBSD;
186
- case "_isWeb":
187
- return _isWeb;
188
- case "_isNative":
189
- return _isNative;
190
- case "PlatformToString":
191
- return PlatformToString;
192
- case "_platform":
193
- return _platform;
194
- case "isRootUser":
195
- return isRootUser;
196
- case "g":
197
- return g;
198
- case "_globals":
199
- return _globals;
200
- case "_setImmediate":
201
- return _setImmediate;
202
- case "setImmediate":
203
- return setImmediate;
204
- case "_wl":
205
- return _wl;
206
- }
207
- return undefined;
208
- }
209
- function _assign__(variableName, value) {
210
- let rewireData = _getRewiredData__();
211
- if (rewireData[variableName] === undefined) {
212
- return _set_original__(variableName, value);
213
- } else {
214
- return rewireData[variableName] = value;
215
- }
216
- }
217
- function _set_original__(variableName, _value) {
218
- switch (variableName) {
219
- case "_isWindows":
220
- return _isWindows = _value;
221
- case "_isMacintosh":
222
- return _isMacintosh = _value;
223
- case "_isLinux":
224
- return _isLinux = _value;
225
- case "_isFreeBSD":
226
- return _isFreeBSD = _value;
227
- case "_isWeb":
228
- return _isWeb = _value;
229
- case "_isNative":
230
- return _isNative = _value;
231
- case "_platform":
232
- return _platform = _value;
233
- case "_setImmediate":
234
- return _setImmediate = _value;
235
- }
236
- return undefined;
237
- }
238
- function _update_operation__(operation, variableName, prefix) {
239
- var oldValue = _get__(variableName);
240
- var newValue = operation === '++' ? oldValue + 1 : oldValue - 1;
241
- _assign__(variableName, newValue);
242
- return prefix ? newValue : oldValue;
243
- }
244
- function _set__(variableName, value) {
245
- let rewireData = _getRewiredData__();
246
- if (typeof variableName === 'object') {
247
- Object.keys(variableName).forEach(function (name) {
248
- rewireData[name] = variableName[name];
249
- });
250
- return function () {
251
- Object.keys(variableName).forEach(function (name) {
252
- _reset__(variableName);
253
- });
254
- };
255
- } else {
256
- if (value === undefined) {
257
- rewireData[variableName] = INTENTIONAL_UNDEFINED;
258
- } else {
259
- rewireData[variableName] = value;
260
- }
261
- return function () {
262
- _reset__(variableName);
263
- };
264
- }
265
- }
266
- function _reset__(variableName) {
267
- let rewireData = _getRewiredData__();
268
- delete rewireData[variableName];
269
- if (Object.keys(rewireData).length == 0) {
270
- delete _getRewireRegistry__()[_getRewireModuleId__];
271
- }
272
- ;
273
- }
274
- function _with__(object) {
275
- let rewireData = _getRewiredData__();
276
- var rewiredVariableNames = Object.keys(object);
277
- var previousValues = {};
278
- function reset() {
279
- rewiredVariableNames.forEach(function (variableName) {
280
- rewireData[variableName] = previousValues[variableName];
281
- });
282
- }
283
- return function (callback) {
284
- rewiredVariableNames.forEach(function (variableName) {
285
- previousValues[variableName] = rewireData[variableName];
286
- rewireData[variableName] = object[variableName];
287
- });
288
- let result = callback();
289
- if (!!result && typeof result.then == 'function') {
290
- result.then(reset).catch(reset);
291
- } else {
292
- reset();
293
- }
294
- return result;
295
- };
296
- }
297
- let _typeOfOriginalExport = typeof module.exports;
298
- function addNonEnumerableProperty(name, value) {
299
- Object.defineProperty(module.exports, name, {
300
- value: value,
301
- enumerable: false,
302
- configurable: true
303
- });
304
- }
305
- if ((_typeOfOriginalExport === 'object' || _typeOfOriginalExport === 'function') && Object.isExtensible(module.exports)) {
306
- addNonEnumerableProperty('__get__', _get__);
307
- addNonEnumerableProperty('__GetDependency__', _get__);
308
- addNonEnumerableProperty('__Rewire__', _set__);
309
- addNonEnumerableProperty('__set__', _set__);
310
- addNonEnumerableProperty('__reset__', _reset__);
311
- addNonEnumerableProperty('__ResetDependency__', _reset__);
312
- addNonEnumerableProperty('__with__', _with__);
313
- addNonEnumerableProperty('__RewireAPI__', _RewireAPI__);
314
- }
@@ -1,23 +0,0 @@
1
- /**
2
- * Converts HTML characters inside the string to use entities instead. Makes the string safe from
3
- * being used e.g. in HTMLElement.innerHTML.
4
- */
5
- export declare function escape(html: string): string;
6
- /**
7
- * Removes all occurrences of needle from the beginning and end of haystack.
8
- * @param haystack string to trim
9
- * @param needle the thing to trim (default is a blank)
10
- */
11
- export declare function trim(haystack: string, needle?: string): string;
12
- /**
13
- * Removes all occurrences of needle from the beginning of haystack.
14
- * @param haystack string to trim
15
- * @param needle the thing to trim
16
- */
17
- export declare function ltrim(haystack: string, needle: string): string;
18
- /**
19
- * Removes all occurrences of needle from the end of haystack.
20
- * @param haystack string to trim
21
- * @param needle the thing to trim
22
- */
23
- export declare function rtrim(haystack: string, needle: string): string;
@@ -1,273 +0,0 @@
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.rtrim = exports.ltrim = exports.trim = exports.escape = void 0;
11
- /**
12
- * Converts HTML characters inside the string to use entities instead. Makes the string safe from
13
- * being used e.g. in HTMLElement.innerHTML.
14
- */
15
- function escape(html) {
16
- return html.replace(/[<>&]/g, function (match) {
17
- switch (match) {
18
- case '<':
19
- return '&lt;';
20
- case '>':
21
- return '&gt;';
22
- case '&':
23
- return '&amp;';
24
- default:
25
- return match;
26
- }
27
- });
28
- }
29
- exports.escape = _get__("escape");
30
- /**
31
- * Removes all occurrences of needle from the beginning and end of haystack.
32
- * @param haystack string to trim
33
- * @param needle the thing to trim (default is a blank)
34
- */
35
- function trim(haystack, needle = ' ') {
36
- const trimmed = _get__("ltrim")(haystack, needle);
37
- return _get__("rtrim")(trimmed, needle);
38
- }
39
- exports.trim = _get__("trim");
40
- /**
41
- * Removes all occurrences of needle from the beginning of haystack.
42
- * @param haystack string to trim
43
- * @param needle the thing to trim
44
- */
45
- function ltrim(haystack, needle) {
46
- if (!haystack || !needle) {
47
- return haystack;
48
- }
49
- const needleLen = needle.length;
50
- if (needleLen === 0 || haystack.length === 0) {
51
- return haystack;
52
- }
53
- let offset = 0;
54
- while (haystack.indexOf(needle, offset) === offset) {
55
- offset = offset + needleLen;
56
- }
57
- return haystack.substring(offset);
58
- }
59
- exports.ltrim = _get__("ltrim");
60
- /**
61
- * Removes all occurrences of needle from the end of haystack.
62
- * @param haystack string to trim
63
- * @param needle the thing to trim
64
- */
65
- function rtrim(haystack, needle) {
66
- if (!haystack || !needle) {
67
- return haystack;
68
- }
69
- const needleLen = needle.length,
70
- haystackLen = haystack.length;
71
- if (needleLen === 0 || haystackLen === 0) {
72
- return haystack;
73
- }
74
- let offset = haystackLen,
75
- idx = -1;
76
- while (true) {
77
- idx = haystack.lastIndexOf(needle, offset - 1);
78
- if (idx === -1 || idx + needleLen !== offset) {
79
- break;
80
- }
81
- if (idx === 0) {
82
- return '';
83
- }
84
- offset = idx;
85
- }
86
- return haystack.substring(0, offset);
87
- }
88
- exports.rtrim = _get__("rtrim");
89
- function _getGlobalObject() {
90
- try {
91
- if (!!global) {
92
- return global;
93
- }
94
- } catch (e) {
95
- try {
96
- if (!!window) {
97
- return window;
98
- }
99
- } catch (e) {
100
- return this;
101
- }
102
- }
103
- }
104
- ;
105
- var _RewireModuleId__ = null;
106
- function _getRewireModuleId__() {
107
- if (_RewireModuleId__ === null) {
108
- let globalVariable = _getGlobalObject();
109
- if (!globalVariable.__$$GLOBAL_REWIRE_NEXT_MODULE_ID__) {
110
- globalVariable.__$$GLOBAL_REWIRE_NEXT_MODULE_ID__ = 0;
111
- }
112
- _RewireModuleId__ = __$$GLOBAL_REWIRE_NEXT_MODULE_ID__++;
113
- }
114
- return _RewireModuleId__;
115
- }
116
- function _getRewireRegistry__() {
117
- let theGlobalVariable = _getGlobalObject();
118
- if (!theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__) {
119
- theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__ = Object.create(null);
120
- }
121
- return theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__;
122
- }
123
- function _getRewiredData__() {
124
- let moduleId = _getRewireModuleId__();
125
- let registry = _getRewireRegistry__();
126
- let rewireData = registry[moduleId];
127
- if (!rewireData) {
128
- registry[moduleId] = Object.create(null);
129
- rewireData = registry[moduleId];
130
- }
131
- return rewireData;
132
- }
133
- (function registerResetAll() {
134
- let theGlobalVariable = _getGlobalObject();
135
- if (!theGlobalVariable['__rewire_reset_all__']) {
136
- theGlobalVariable['__rewire_reset_all__'] = function () {
137
- theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__ = Object.create(null);
138
- };
139
- }
140
- })();
141
- var INTENTIONAL_UNDEFINED = '__INTENTIONAL_UNDEFINED__';
142
- let _RewireAPI__ = {};
143
- (function () {
144
- function addPropertyToAPIObject(name, value) {
145
- Object.defineProperty(_RewireAPI__, name, {
146
- value: value,
147
- enumerable: false,
148
- configurable: true
149
- });
150
- }
151
- addPropertyToAPIObject('__get__', _get__);
152
- addPropertyToAPIObject('__GetDependency__', _get__);
153
- addPropertyToAPIObject('__Rewire__', _set__);
154
- addPropertyToAPIObject('__set__', _set__);
155
- addPropertyToAPIObject('__reset__', _reset__);
156
- addPropertyToAPIObject('__ResetDependency__', _reset__);
157
- addPropertyToAPIObject('__with__', _with__);
158
- })();
159
- function _get__(variableName) {
160
- let rewireData = _getRewiredData__();
161
- if (rewireData[variableName] === undefined) {
162
- return _get_original__(variableName);
163
- } else {
164
- var value = rewireData[variableName];
165
- if (value === INTENTIONAL_UNDEFINED) {
166
- return undefined;
167
- } else {
168
- return value;
169
- }
170
- }
171
- }
172
- function _get_original__(variableName) {
173
- switch (variableName) {
174
- case "escape":
175
- return escape;
176
- case "ltrim":
177
- return ltrim;
178
- case "rtrim":
179
- return rtrim;
180
- case "trim":
181
- return trim;
182
- }
183
- return undefined;
184
- }
185
- function _assign__(variableName, value) {
186
- let rewireData = _getRewiredData__();
187
- if (rewireData[variableName] === undefined) {
188
- return _set_original__(variableName, value);
189
- } else {
190
- return rewireData[variableName] = value;
191
- }
192
- }
193
- function _set_original__(variableName, _value) {
194
- switch (variableName) {}
195
- return undefined;
196
- }
197
- function _update_operation__(operation, variableName, prefix) {
198
- var oldValue = _get__(variableName);
199
- var newValue = operation === '++' ? oldValue + 1 : oldValue - 1;
200
- _assign__(variableName, newValue);
201
- return prefix ? newValue : oldValue;
202
- }
203
- function _set__(variableName, value) {
204
- let rewireData = _getRewiredData__();
205
- if (typeof variableName === 'object') {
206
- Object.keys(variableName).forEach(function (name) {
207
- rewireData[name] = variableName[name];
208
- });
209
- return function () {
210
- Object.keys(variableName).forEach(function (name) {
211
- _reset__(variableName);
212
- });
213
- };
214
- } else {
215
- if (value === undefined) {
216
- rewireData[variableName] = INTENTIONAL_UNDEFINED;
217
- } else {
218
- rewireData[variableName] = value;
219
- }
220
- return function () {
221
- _reset__(variableName);
222
- };
223
- }
224
- }
225
- function _reset__(variableName) {
226
- let rewireData = _getRewiredData__();
227
- delete rewireData[variableName];
228
- if (Object.keys(rewireData).length == 0) {
229
- delete _getRewireRegistry__()[_getRewireModuleId__];
230
- }
231
- ;
232
- }
233
- function _with__(object) {
234
- let rewireData = _getRewiredData__();
235
- var rewiredVariableNames = Object.keys(object);
236
- var previousValues = {};
237
- function reset() {
238
- rewiredVariableNames.forEach(function (variableName) {
239
- rewireData[variableName] = previousValues[variableName];
240
- });
241
- }
242
- return function (callback) {
243
- rewiredVariableNames.forEach(function (variableName) {
244
- previousValues[variableName] = rewireData[variableName];
245
- rewireData[variableName] = object[variableName];
246
- });
247
- let result = callback();
248
- if (!!result && typeof result.then == 'function') {
249
- result.then(reset).catch(reset);
250
- } else {
251
- reset();
252
- }
253
- return result;
254
- };
255
- }
256
- let _typeOfOriginalExport = typeof module.exports;
257
- function addNonEnumerableProperty(name, value) {
258
- Object.defineProperty(module.exports, name, {
259
- value: value,
260
- enumerable: false,
261
- configurable: true
262
- });
263
- }
264
- if ((_typeOfOriginalExport === 'object' || _typeOfOriginalExport === 'function') && Object.isExtensible(module.exports)) {
265
- addNonEnumerableProperty('__get__', _get__);
266
- addNonEnumerableProperty('__GetDependency__', _get__);
267
- addNonEnumerableProperty('__Rewire__', _set__);
268
- addNonEnumerableProperty('__set__', _set__);
269
- addNonEnumerableProperty('__reset__', _reset__);
270
- addNonEnumerableProperty('__ResetDependency__', _reset__);
271
- addNonEnumerableProperty('__with__', _with__);
272
- addNonEnumerableProperty('__RewireAPI__', _RewireAPI__);
273
- }
package/consts.d.ts DELETED
@@ -1,58 +0,0 @@
1
- import { Color } from './base/common/color';
2
- import { IMenuIcons } from './menubar';
3
- export declare const INACTIVE_FOREGROUND_DARK: Color;
4
- export declare const ACTIVE_FOREGROUND_DARK: Color;
5
- export declare const INACTIVE_FOREGROUND: Color;
6
- export declare const ACTIVE_FOREGROUND: Color;
7
- export declare const DEFAULT_ITEM_SELECTOR: Color;
8
- export declare const IS_MAC_BIGSUR_OR_LATER: boolean;
9
- export declare const BOTTOM_TITLEBAR_HEIGHT = 60;
10
- export declare const TOP_TITLEBAR_HEIGHT_MAC: number;
11
- export declare const TOP_TITLEBAR_HEIGHT_WIN = 30;
12
- export declare const WINDOW_MIN_WIDTH = 400;
13
- export declare const WINDOW_MIN_HEIGHT = 270;
14
- export declare const MENU_MNEMONIC_REGEX: RegExp;
15
- export declare const MENU_ESCAPED_MNEMONIC_REGEX: RegExp;
16
- interface ITitlebarIcons extends IMenuIcons {
17
- linux: {
18
- minimize: string;
19
- maximize: string;
20
- restore: string;
21
- close: string;
22
- };
23
- freebsd: {
24
- minimize: string;
25
- maximize: string;
26
- restore: string;
27
- close: string;
28
- };
29
- windows: {
30
- minimize: string;
31
- maximize: string;
32
- restore: string;
33
- close: string;
34
- };
35
- }
36
- export declare const menuIcons: ITitlebarIcons;
37
- export declare function getPx(value: number): string;
38
- /**
39
- * Handles mnemonics for menu items. Depending on OS:
40
- * - Windows: Supported via & character (replace && with &)
41
- * - Linux: Supported via & character (replace && with &)
42
- * - FreeBSD: Supported via & character (replace && with &)
43
- * - macOS: Unsupported (replace && with empty string)
44
- */
45
- export declare function mnemonicMenuLabel(label: string, forceDisableMnemonics?: boolean): string;
46
- /**
47
- * Handles mnemonics for buttons. Depending on OS:
48
- * - Windows: Supported via & character (replace && with & and & with && for escaping)
49
- * - Linux: Supported via _ character (replace && with _)
50
- * - FreeBSD: Supported via _ character (replace && with _)
51
- * - macOS: Unsupported (replace && with empty string)
52
- */
53
- export declare function mnemonicButtonLabel(label: string, forceDisableMnemonics?: boolean): string;
54
- export declare function cleanMnemonic(label: string): string;
55
- export declare function parseAccelerator(accelerator: Electron.Accelerator | string): string;
56
- export declare function applyFill(element: HTMLElement | undefined | null, svgColor: Color | undefined, fgColor: Color | undefined, color?: boolean): void;
57
- export declare function loadWindowIcons(icons: string | undefined): any;
58
- export {};