custom-electron-titlebar 4.2.0 → 4.2.2

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