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,213 @@
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.CETSeparator = void 0;
11
+ const item_1 = require("./item");
12
+ const dom_1 = require("../../base/common/dom");
13
+ class CETSeparator extends _get__("item_1").CETMenuItem {
14
+ constructor(item, submenuIcons, submenuParentOptions, submenuOptions) {
15
+ super(item, submenuIcons, submenuParentOptions, submenuOptions);
16
+ }
17
+ render(container) {
18
+ if (container) {
19
+ this.separatorElement = (0, _get__("dom_1").append)(container, (0, _get__("dom_1").$)('a.cet-action-label.separator', {
20
+ role: 'presentation'
21
+ }));
22
+ }
23
+ }
24
+ updateStyle(style) {
25
+ if (this.separatorElement && style.separatorColor) {
26
+ this.separatorElement.style.borderBottomColor = style.separatorColor.toString();
27
+ }
28
+ }
29
+ }
30
+ exports.CETSeparator = _get__("CETSeparator");
31
+ function _getGlobalObject() {
32
+ try {
33
+ if (!!global) {
34
+ return global;
35
+ }
36
+ } catch (e) {
37
+ try {
38
+ if (!!window) {
39
+ return window;
40
+ }
41
+ } catch (e) {
42
+ return this;
43
+ }
44
+ }
45
+ }
46
+ ;
47
+ var _RewireModuleId__ = null;
48
+ function _getRewireModuleId__() {
49
+ if (_RewireModuleId__ === null) {
50
+ let globalVariable = _getGlobalObject();
51
+ if (!globalVariable.__$$GLOBAL_REWIRE_NEXT_MODULE_ID__) {
52
+ globalVariable.__$$GLOBAL_REWIRE_NEXT_MODULE_ID__ = 0;
53
+ }
54
+ _RewireModuleId__ = __$$GLOBAL_REWIRE_NEXT_MODULE_ID__++;
55
+ }
56
+ return _RewireModuleId__;
57
+ }
58
+ function _getRewireRegistry__() {
59
+ let theGlobalVariable = _getGlobalObject();
60
+ if (!theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__) {
61
+ theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__ = Object.create(null);
62
+ }
63
+ return theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__;
64
+ }
65
+ function _getRewiredData__() {
66
+ let moduleId = _getRewireModuleId__();
67
+ let registry = _getRewireRegistry__();
68
+ let rewireData = registry[moduleId];
69
+ if (!rewireData) {
70
+ registry[moduleId] = Object.create(null);
71
+ rewireData = registry[moduleId];
72
+ }
73
+ return rewireData;
74
+ }
75
+ (function registerResetAll() {
76
+ let theGlobalVariable = _getGlobalObject();
77
+ if (!theGlobalVariable['__rewire_reset_all__']) {
78
+ theGlobalVariable['__rewire_reset_all__'] = function () {
79
+ theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__ = Object.create(null);
80
+ };
81
+ }
82
+ })();
83
+ var INTENTIONAL_UNDEFINED = '__INTENTIONAL_UNDEFINED__';
84
+ let _RewireAPI__ = {};
85
+ (function () {
86
+ function addPropertyToAPIObject(name, value) {
87
+ Object.defineProperty(_RewireAPI__, name, {
88
+ value: value,
89
+ enumerable: false,
90
+ configurable: true
91
+ });
92
+ }
93
+ addPropertyToAPIObject('__get__', _get__);
94
+ addPropertyToAPIObject('__GetDependency__', _get__);
95
+ addPropertyToAPIObject('__Rewire__', _set__);
96
+ addPropertyToAPIObject('__set__', _set__);
97
+ addPropertyToAPIObject('__reset__', _reset__);
98
+ addPropertyToAPIObject('__ResetDependency__', _reset__);
99
+ addPropertyToAPIObject('__with__', _with__);
100
+ })();
101
+ function _get__(variableName) {
102
+ let rewireData = _getRewiredData__();
103
+ if (rewireData[variableName] === undefined) {
104
+ return _get_original__(variableName);
105
+ } else {
106
+ var value = rewireData[variableName];
107
+ if (value === INTENTIONAL_UNDEFINED) {
108
+ return undefined;
109
+ } else {
110
+ return value;
111
+ }
112
+ }
113
+ }
114
+ function _get_original__(variableName) {
115
+ switch (variableName) {
116
+ case "dom_1":
117
+ return dom_1;
118
+ case "item_1":
119
+ return item_1;
120
+ case "CETSeparator":
121
+ return CETSeparator;
122
+ }
123
+ return undefined;
124
+ }
125
+ function _assign__(variableName, value) {
126
+ let rewireData = _getRewiredData__();
127
+ if (rewireData[variableName] === undefined) {
128
+ return _set_original__(variableName, value);
129
+ } else {
130
+ return rewireData[variableName] = value;
131
+ }
132
+ }
133
+ function _set_original__(variableName, _value) {
134
+ switch (variableName) {}
135
+ return undefined;
136
+ }
137
+ function _update_operation__(operation, variableName, prefix) {
138
+ var oldValue = _get__(variableName);
139
+ var newValue = operation === '++' ? oldValue + 1 : oldValue - 1;
140
+ _assign__(variableName, newValue);
141
+ return prefix ? newValue : oldValue;
142
+ }
143
+ function _set__(variableName, value) {
144
+ let rewireData = _getRewiredData__();
145
+ if (typeof variableName === 'object') {
146
+ Object.keys(variableName).forEach(function (name) {
147
+ rewireData[name] = variableName[name];
148
+ });
149
+ return function () {
150
+ Object.keys(variableName).forEach(function (name) {
151
+ _reset__(variableName);
152
+ });
153
+ };
154
+ } else {
155
+ if (value === undefined) {
156
+ rewireData[variableName] = INTENTIONAL_UNDEFINED;
157
+ } else {
158
+ rewireData[variableName] = value;
159
+ }
160
+ return function () {
161
+ _reset__(variableName);
162
+ };
163
+ }
164
+ }
165
+ function _reset__(variableName) {
166
+ let rewireData = _getRewiredData__();
167
+ delete rewireData[variableName];
168
+ if (Object.keys(rewireData).length == 0) {
169
+ delete _getRewireRegistry__()[_getRewireModuleId__];
170
+ }
171
+ ;
172
+ }
173
+ function _with__(object) {
174
+ let rewireData = _getRewiredData__();
175
+ var rewiredVariableNames = Object.keys(object);
176
+ var previousValues = {};
177
+ function reset() {
178
+ rewiredVariableNames.forEach(function (variableName) {
179
+ rewireData[variableName] = previousValues[variableName];
180
+ });
181
+ }
182
+ return function (callback) {
183
+ rewiredVariableNames.forEach(function (variableName) {
184
+ previousValues[variableName] = rewireData[variableName];
185
+ rewireData[variableName] = object[variableName];
186
+ });
187
+ let result = callback();
188
+ if (!!result && typeof result.then == 'function') {
189
+ result.then(reset).catch(reset);
190
+ } else {
191
+ reset();
192
+ }
193
+ return result;
194
+ };
195
+ }
196
+ let _typeOfOriginalExport = typeof module.exports;
197
+ function addNonEnumerableProperty(name, value) {
198
+ Object.defineProperty(module.exports, name, {
199
+ value: value,
200
+ enumerable: false,
201
+ configurable: true
202
+ });
203
+ }
204
+ if ((_typeOfOriginalExport === 'object' || _typeOfOriginalExport === 'function') && Object.isExtensible(module.exports)) {
205
+ addNonEnumerableProperty('__get__', _get__);
206
+ addNonEnumerableProperty('__GetDependency__', _get__);
207
+ addNonEnumerableProperty('__Rewire__', _set__);
208
+ addNonEnumerableProperty('__set__', _set__);
209
+ addNonEnumerableProperty('__reset__', _reset__);
210
+ addNonEnumerableProperty('__ResetDependency__', _reset__);
211
+ addNonEnumerableProperty('__with__', _with__);
212
+ addNonEnumerableProperty('__RewireAPI__', _RewireAPI__);
213
+ }
@@ -0,0 +1,32 @@
1
+ import { MenuItem } from 'electron';
2
+ import { CETMenuItem } from './item';
3
+ import { EventLike } from '../../base/common/dom';
4
+ import { CETMenu, IMenuOptions } from './index';
5
+ import { MenuBarOptions } from '../../menubar/menubar-options';
6
+ import { IMenuIcons } from '../../menubar';
7
+ export interface ISubMenuData {
8
+ parent: CETMenu;
9
+ submenu?: CETMenu;
10
+ }
11
+ export declare class CETSubMenu extends CETMenuItem {
12
+ private submenuIcons;
13
+ private submenuItems;
14
+ private parentData;
15
+ private submenuParentOptions;
16
+ private submenuOptions;
17
+ private mySubmenu?;
18
+ private submenuContainer?;
19
+ private submenuIndicator?;
20
+ private submenuDisposables;
21
+ private mouseOver;
22
+ private showScheduler;
23
+ private hideScheduler;
24
+ private _closeSubMenu;
25
+ constructor(item: MenuItem, submenuIcons: IMenuIcons, submenuItems: MenuItem[], parentData: ISubMenuData, submenuParentOptions: MenuBarOptions, submenuOptions: IMenuOptions, closeSubMenu?: () => void);
26
+ render(el: HTMLElement): void;
27
+ private cleanupExistingSubmenu;
28
+ private createSubmenu;
29
+ protected applyStyle(): void;
30
+ onClick(e: EventLike): void;
31
+ dispose(): void;
32
+ }
@@ -0,0 +1,372 @@
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.CETSubMenu = void 0;
11
+ const consts_1 = require("../../consts");
12
+ const item_1 = require("./item");
13
+ const lifecycle_1 = require("../../base/common/lifecycle");
14
+ const dom_1 = require("../../base/common/dom");
15
+ const keyboardEvent_1 = require("../../base/browser/keyboardEvent");
16
+ const index_1 = require("./index");
17
+ const async_1 = require("../../base/common/async");
18
+ class CETSubMenu extends _get__("item_1").CETMenuItem {
19
+ constructor(item, submenuIcons, submenuItems, parentData, submenuParentOptions, submenuOptions, closeSubMenu = () => {}) {
20
+ super(item, submenuIcons, submenuParentOptions, submenuOptions);
21
+ this.submenuIcons = submenuIcons;
22
+ this.submenuItems = submenuItems;
23
+ this.parentData = parentData;
24
+ this.submenuParentOptions = submenuParentOptions;
25
+ this.submenuOptions = submenuOptions;
26
+ this.submenuDisposables = [];
27
+ this.mouseOver = false;
28
+ this._closeSubMenu = () => {};
29
+ this._closeSubMenu = closeSubMenu;
30
+ this.showScheduler = new (_get__("async_1").RunOnceScheduler)(() => {
31
+ if (this.mouseOver) {
32
+ this.cleanupExistingSubmenu(false);
33
+ this.createSubmenu(false);
34
+ }
35
+ }, 250);
36
+ this.hideScheduler = new (_get__("async_1").RunOnceScheduler)(() => {
37
+ if (this.element && !(0, _get__("dom_1").isAncestor)(document.activeElement, this.element) && this.parentData.submenu === this.mySubmenu) {
38
+ this.parentData.parent.focus(false);
39
+ this.cleanupExistingSubmenu(true);
40
+ }
41
+ }, 750);
42
+ }
43
+ render(el) {
44
+ super.render(el);
45
+ if (!this.itemElement) {
46
+ return;
47
+ }
48
+ (0, _get__("dom_1").addClass)(this.itemElement, 'cet-submenu-item');
49
+ this.itemElement.setAttribute('aria-haspopup', 'true');
50
+ this.submenuIndicator = (0, _get__("dom_1").append)(this.itemElement, (0, _get__("dom_1").$)('span.cet-submenu-indicator'));
51
+ this.submenuIndicator.innerHTML = this.submenuIcons.submenuIndicator;
52
+ this.submenuIndicator.setAttribute('aria-hidden', 'true');
53
+ (0, _get__("consts_1").applyFill)(this.submenuIndicator, this.menuStyle?.svgColor, this.menuStyle?.foregroundColor);
54
+ if (this.element) {
55
+ (0, _get__("dom_1").addDisposableListener)(this.element, _get__("dom_1").EventType.KEY_UP, e => {
56
+ const event = new (_get__("keyboardEvent_1").StandardKeyboardEvent)(e);
57
+ if (event.equals(17 /* KeyCode.RightArrow */) || event.equals(3 /* KeyCode.Enter */)) {
58
+ _get__("dom_1").EventHelper.stop(e, true);
59
+ this.createSubmenu(true);
60
+ }
61
+ });
62
+ (0, _get__("dom_1").addDisposableListener)(this.element, _get__("dom_1").EventType.KEY_DOWN, e => {
63
+ const event = new (_get__("keyboardEvent_1").StandardKeyboardEvent)(e);
64
+ if (event.equals(17 /* KeyCode.RightArrow */) || event.equals(3 /* KeyCode.Enter */)) {
65
+ _get__("dom_1").EventHelper.stop(e, true);
66
+ }
67
+ });
68
+ (0, _get__("dom_1").addDisposableListener)(this.element, _get__("dom_1").EventType.MOUSE_OVER, e => {
69
+ if (!this.mouseOver) {
70
+ this.mouseOver = true;
71
+ this.showScheduler.schedule();
72
+ }
73
+ });
74
+ (0, _get__("dom_1").addDisposableListener)(this.element, _get__("dom_1").EventType.MOUSE_LEAVE, e => {
75
+ this.mouseOver = false;
76
+ });
77
+ (0, _get__("dom_1").addDisposableListener)(this.element, _get__("dom_1").EventType.FOCUS_OUT, e => {
78
+ if (this.element && !(0, _get__("dom_1").isAncestor)(document.activeElement, this.element)) {
79
+ this.hideScheduler.schedule();
80
+ }
81
+ });
82
+ }
83
+ }
84
+ cleanupExistingSubmenu(force) {
85
+ if (this.parentData.submenu && (force || this.parentData.submenu !== this.mySubmenu)) {
86
+ this.parentData.submenu.dispose();
87
+ this.parentData.submenu = undefined;
88
+ if (this.submenuContainer) {
89
+ this.submenuContainer = undefined;
90
+ }
91
+ }
92
+ }
93
+ createSubmenu(selectFirstItem = true) {
94
+ if (!this.itemElement) {
95
+ return;
96
+ }
97
+ if (this.element) {
98
+ if (!this.parentData.submenu) {
99
+ this.submenuContainer = (0, _get__("dom_1").append)(this.element, (0, _get__("dom_1").$)('.cet-submenu'));
100
+ (0, _get__("dom_1").addClasses)(this.submenuContainer, 'cet-menubar-menu-container');
101
+ this.parentData.submenu = new (_get__("index_1").CETMenu)(this.submenuContainer, this.submenuIcons, this.submenuParentOptions, this.submenuOptions, this._closeSubMenu);
102
+ this.parentData.submenu.createMenu(this.submenuItems);
103
+ if (this.menuStyle) {
104
+ this.parentData.submenu.applyStyle(this.menuStyle);
105
+ }
106
+ const boundingRect = this.element.getBoundingClientRect();
107
+ const childBoundingRect = this.submenuContainer.getBoundingClientRect();
108
+ const computedStyles = getComputedStyle(this.parentData.parent.container);
109
+ const paddingTop = parseFloat(computedStyles.paddingTop || '0') || 0;
110
+ if (window.innerWidth <= boundingRect.right + childBoundingRect.width) {
111
+ this.submenuContainer.style.left = '10px';
112
+ this.submenuContainer.style.top = `${this.element.offsetTop + boundingRect.height}px`;
113
+ } else {
114
+ this.submenuContainer.style.left = `${this.element.offsetWidth}px`;
115
+ this.submenuContainer.style.top = `${this.element.offsetTop - paddingTop}px`;
116
+ }
117
+ this.submenuDisposables.push((0, _get__("dom_1").addDisposableListener)(this.submenuContainer, _get__("dom_1").EventType.KEY_UP, e => {
118
+ const event = new (_get__("keyboardEvent_1").StandardKeyboardEvent)(e);
119
+ if (event.equals(15 /* KeyCode.LeftArrow */)) {
120
+ _get__("dom_1").EventHelper.stop(e, true);
121
+ this.parentData.parent.focus();
122
+ if (this.parentData.submenu) {
123
+ this.parentData.submenu.dispose();
124
+ this.parentData.submenu = undefined;
125
+ }
126
+ this.submenuDisposables = (0, _get__("lifecycle_1").dispose)(this.submenuDisposables);
127
+ this.submenuContainer = undefined;
128
+ }
129
+ }));
130
+ this.submenuDisposables.push((0, _get__("dom_1").addDisposableListener)(this.submenuContainer, _get__("dom_1").EventType.KEY_DOWN, e => {
131
+ const event = new (_get__("keyboardEvent_1").StandardKeyboardEvent)(e);
132
+ if (event.equals(15 /* KeyCode.LeftArrow */)) {
133
+ _get__("dom_1").EventHelper.stop(e, true);
134
+ }
135
+ }));
136
+ this.submenuDisposables.push(this.parentData.submenu.onDidCancel(() => {
137
+ this.parentData.parent.focus();
138
+ if (this.parentData.submenu) {
139
+ this.parentData.submenu.dispose();
140
+ this.parentData.submenu = undefined;
141
+ }
142
+ this.submenuDisposables = (0, _get__("lifecycle_1").dispose)(this.submenuDisposables);
143
+ this.submenuContainer = undefined;
144
+ }));
145
+ this.parentData.submenu.focus(selectFirstItem);
146
+ this.mySubmenu = this.parentData.submenu;
147
+ } else {
148
+ this.parentData.submenu.focus(false);
149
+ }
150
+ }
151
+ }
152
+ applyStyle() {
153
+ super.applyStyle();
154
+ if (!this.menuStyle) return;
155
+ const isSelected = this.element && (0, _get__("dom_1").hasClass)(this.element, 'focused');
156
+ const fgColor = isSelected && this.menuStyle.selectionForegroundColor ? this.menuStyle.selectionForegroundColor : this.menuStyle.foregroundColor;
157
+ (0, _get__("consts_1").applyFill)(this.submenuIndicator, this.submenuParentOptions.svgColor, fgColor);
158
+ if (this.parentData.submenu) this.parentData.submenu.applyStyle(this.menuStyle);
159
+ }
160
+ onClick(e) {
161
+ // stop clicking from trying to run an action
162
+ _get__("dom_1").EventHelper.stop(e, true);
163
+ this.cleanupExistingSubmenu(false);
164
+ this.createSubmenu(false);
165
+ }
166
+ dispose() {
167
+ super.dispose();
168
+ this.hideScheduler.dispose();
169
+ if (this.mySubmenu) {
170
+ this.mySubmenu.dispose();
171
+ this.mySubmenu = null;
172
+ }
173
+ if (this.submenuContainer) {
174
+ this.submenuDisposables = (0, _get__("lifecycle_1").dispose)(this.submenuDisposables);
175
+ this.submenuContainer = undefined;
176
+ }
177
+ }
178
+ }
179
+ exports.CETSubMenu = _get__("CETSubMenu");
180
+ function _getGlobalObject() {
181
+ try {
182
+ if (!!global) {
183
+ return global;
184
+ }
185
+ } catch (e) {
186
+ try {
187
+ if (!!window) {
188
+ return window;
189
+ }
190
+ } catch (e) {
191
+ return this;
192
+ }
193
+ }
194
+ }
195
+ ;
196
+ var _RewireModuleId__ = null;
197
+ function _getRewireModuleId__() {
198
+ if (_RewireModuleId__ === null) {
199
+ let globalVariable = _getGlobalObject();
200
+ if (!globalVariable.__$$GLOBAL_REWIRE_NEXT_MODULE_ID__) {
201
+ globalVariable.__$$GLOBAL_REWIRE_NEXT_MODULE_ID__ = 0;
202
+ }
203
+ _RewireModuleId__ = __$$GLOBAL_REWIRE_NEXT_MODULE_ID__++;
204
+ }
205
+ return _RewireModuleId__;
206
+ }
207
+ function _getRewireRegistry__() {
208
+ let theGlobalVariable = _getGlobalObject();
209
+ if (!theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__) {
210
+ theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__ = Object.create(null);
211
+ }
212
+ return theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__;
213
+ }
214
+ function _getRewiredData__() {
215
+ let moduleId = _getRewireModuleId__();
216
+ let registry = _getRewireRegistry__();
217
+ let rewireData = registry[moduleId];
218
+ if (!rewireData) {
219
+ registry[moduleId] = Object.create(null);
220
+ rewireData = registry[moduleId];
221
+ }
222
+ return rewireData;
223
+ }
224
+ (function registerResetAll() {
225
+ let theGlobalVariable = _getGlobalObject();
226
+ if (!theGlobalVariable['__rewire_reset_all__']) {
227
+ theGlobalVariable['__rewire_reset_all__'] = function () {
228
+ theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__ = Object.create(null);
229
+ };
230
+ }
231
+ })();
232
+ var INTENTIONAL_UNDEFINED = '__INTENTIONAL_UNDEFINED__';
233
+ let _RewireAPI__ = {};
234
+ (function () {
235
+ function addPropertyToAPIObject(name, value) {
236
+ Object.defineProperty(_RewireAPI__, name, {
237
+ value: value,
238
+ enumerable: false,
239
+ configurable: true
240
+ });
241
+ }
242
+ addPropertyToAPIObject('__get__', _get__);
243
+ addPropertyToAPIObject('__GetDependency__', _get__);
244
+ addPropertyToAPIObject('__Rewire__', _set__);
245
+ addPropertyToAPIObject('__set__', _set__);
246
+ addPropertyToAPIObject('__reset__', _reset__);
247
+ addPropertyToAPIObject('__ResetDependency__', _reset__);
248
+ addPropertyToAPIObject('__with__', _with__);
249
+ })();
250
+ function _get__(variableName) {
251
+ let rewireData = _getRewiredData__();
252
+ if (rewireData[variableName] === undefined) {
253
+ return _get_original__(variableName);
254
+ } else {
255
+ var value = rewireData[variableName];
256
+ if (value === INTENTIONAL_UNDEFINED) {
257
+ return undefined;
258
+ } else {
259
+ return value;
260
+ }
261
+ }
262
+ }
263
+ function _get_original__(variableName) {
264
+ switch (variableName) {
265
+ case "async_1":
266
+ return async_1;
267
+ case "dom_1":
268
+ return dom_1;
269
+ case "consts_1":
270
+ return consts_1;
271
+ case "keyboardEvent_1":
272
+ return keyboardEvent_1;
273
+ case "index_1":
274
+ return index_1;
275
+ case "lifecycle_1":
276
+ return lifecycle_1;
277
+ case "item_1":
278
+ return item_1;
279
+ case "CETSubMenu":
280
+ return CETSubMenu;
281
+ }
282
+ return undefined;
283
+ }
284
+ function _assign__(variableName, value) {
285
+ let rewireData = _getRewiredData__();
286
+ if (rewireData[variableName] === undefined) {
287
+ return _set_original__(variableName, value);
288
+ } else {
289
+ return rewireData[variableName] = value;
290
+ }
291
+ }
292
+ function _set_original__(variableName, _value) {
293
+ switch (variableName) {}
294
+ return undefined;
295
+ }
296
+ function _update_operation__(operation, variableName, prefix) {
297
+ var oldValue = _get__(variableName);
298
+ var newValue = operation === '++' ? oldValue + 1 : oldValue - 1;
299
+ _assign__(variableName, newValue);
300
+ return prefix ? newValue : oldValue;
301
+ }
302
+ function _set__(variableName, value) {
303
+ let rewireData = _getRewiredData__();
304
+ if (typeof variableName === 'object') {
305
+ Object.keys(variableName).forEach(function (name) {
306
+ rewireData[name] = variableName[name];
307
+ });
308
+ return function () {
309
+ Object.keys(variableName).forEach(function (name) {
310
+ _reset__(variableName);
311
+ });
312
+ };
313
+ } else {
314
+ if (value === undefined) {
315
+ rewireData[variableName] = INTENTIONAL_UNDEFINED;
316
+ } else {
317
+ rewireData[variableName] = value;
318
+ }
319
+ return function () {
320
+ _reset__(variableName);
321
+ };
322
+ }
323
+ }
324
+ function _reset__(variableName) {
325
+ let rewireData = _getRewiredData__();
326
+ delete rewireData[variableName];
327
+ if (Object.keys(rewireData).length == 0) {
328
+ delete _getRewireRegistry__()[_getRewireModuleId__];
329
+ }
330
+ ;
331
+ }
332
+ function _with__(object) {
333
+ let rewireData = _getRewiredData__();
334
+ var rewiredVariableNames = Object.keys(object);
335
+ var previousValues = {};
336
+ function reset() {
337
+ rewiredVariableNames.forEach(function (variableName) {
338
+ rewireData[variableName] = previousValues[variableName];
339
+ });
340
+ }
341
+ return function (callback) {
342
+ rewiredVariableNames.forEach(function (variableName) {
343
+ previousValues[variableName] = rewireData[variableName];
344
+ rewireData[variableName] = object[variableName];
345
+ });
346
+ let result = callback();
347
+ if (!!result && typeof result.then == 'function') {
348
+ result.then(reset).catch(reset);
349
+ } else {
350
+ reset();
351
+ }
352
+ return result;
353
+ };
354
+ }
355
+ let _typeOfOriginalExport = typeof module.exports;
356
+ function addNonEnumerableProperty(name, value) {
357
+ Object.defineProperty(module.exports, name, {
358
+ value: value,
359
+ enumerable: false,
360
+ configurable: true
361
+ });
362
+ }
363
+ if ((_typeOfOriginalExport === 'object' || _typeOfOriginalExport === 'function') && Object.isExtensible(module.exports)) {
364
+ addNonEnumerableProperty('__get__', _get__);
365
+ addNonEnumerableProperty('__GetDependency__', _get__);
366
+ addNonEnumerableProperty('__Rewire__', _set__);
367
+ addNonEnumerableProperty('__set__', _set__);
368
+ addNonEnumerableProperty('__reset__', _reset__);
369
+ addNonEnumerableProperty('__ResetDependency__', _reset__);
370
+ addNonEnumerableProperty('__with__', _with__);
371
+ addNonEnumerableProperty('__RewireAPI__', _RewireAPI__);
372
+ }
@@ -0,0 +1,55 @@
1
+ import { Menu } from 'electron';
2
+ import { Color } from '../base/common/color';
3
+ export interface MenuBarOptions {
4
+ /**
5
+ * Enable the mnemonics on menubar and menu items
6
+ * **The default is true**
7
+ */
8
+ enableMnemonics?: boolean;
9
+ /**
10
+ * The path of the icons of menubar.
11
+ */
12
+ icons?: string;
13
+ /**
14
+ * The background color when the mouse is over the item.
15
+ * **The default is undefined**
16
+ */
17
+ itemBackgroundColor?: Color;
18
+ /**
19
+ * @deprecated Use `setupTitlebar` method instead.
20
+ * The menu to show in the title bar.
21
+ * You can use `Menu` or not add this option and the menu created in the main process will be taken.
22
+ * **The default menu is undefined**
23
+ */
24
+ menu?: Menu;
25
+ /**
26
+ * The background color of the menu.
27
+ * **The default is automatic**
28
+ */
29
+ menuBarBackgroundColor?: Color;
30
+ /**
31
+ * The position of menubar on titlebar.
32
+ * **The default is left**
33
+ */
34
+ menuPosition?: 'left' | 'bottom';
35
+ /**
36
+ * The color of the menu separator.
37
+ * **The default is automatic**
38
+ */
39
+ menuSeparatorColor?: Color;
40
+ /**
41
+ * The menu container transparency
42
+ * **The default is 0 (not apply transparency)*
43
+ */
44
+ menuTransparency?: number;
45
+ /**
46
+ * Define if is only rendering the menubar without the titlebar.
47
+ * **The default is false**
48
+ */
49
+ onlyShowMenuBar?: boolean;
50
+ /**
51
+ * The color of the svg icons in the menu
52
+ * **The default is automatic**
53
+ */
54
+ svgColor?: Color;
55
+ }
@@ -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
+ });