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,215 +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.stop = exports.domEvent = void 0;
11
- const event_1 = require("../common/event");
12
- const domEvent = (element, type, useCapture) => {
13
- const fn = e => emitter.fire(e);
14
- const emitter = new (_get__("event_1").Emitter)({
15
- onFirstListenerAdd: () => {
16
- element.addEventListener(type, fn, useCapture);
17
- },
18
- onLastListenerRemove: () => {
19
- element.removeEventListener(type, fn, useCapture);
20
- }
21
- });
22
- return emitter.event;
23
- };
24
- exports.domEvent = _get__("domEvent");
25
- function stop(event) {
26
- return _get__("event_1").Event.map(event, e => {
27
- e.preventDefault();
28
- e.stopPropagation();
29
- return e;
30
- });
31
- }
32
- exports.stop = _get__("stop");
33
- function _getGlobalObject() {
34
- try {
35
- if (!!global) {
36
- return global;
37
- }
38
- } catch (e) {
39
- try {
40
- if (!!window) {
41
- return window;
42
- }
43
- } catch (e) {
44
- return this;
45
- }
46
- }
47
- }
48
- ;
49
- var _RewireModuleId__ = null;
50
- function _getRewireModuleId__() {
51
- if (_RewireModuleId__ === null) {
52
- let globalVariable = _getGlobalObject();
53
- if (!globalVariable.__$$GLOBAL_REWIRE_NEXT_MODULE_ID__) {
54
- globalVariable.__$$GLOBAL_REWIRE_NEXT_MODULE_ID__ = 0;
55
- }
56
- _RewireModuleId__ = __$$GLOBAL_REWIRE_NEXT_MODULE_ID__++;
57
- }
58
- return _RewireModuleId__;
59
- }
60
- function _getRewireRegistry__() {
61
- let theGlobalVariable = _getGlobalObject();
62
- if (!theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__) {
63
- theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__ = Object.create(null);
64
- }
65
- return theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__;
66
- }
67
- function _getRewiredData__() {
68
- let moduleId = _getRewireModuleId__();
69
- let registry = _getRewireRegistry__();
70
- let rewireData = registry[moduleId];
71
- if (!rewireData) {
72
- registry[moduleId] = Object.create(null);
73
- rewireData = registry[moduleId];
74
- }
75
- return rewireData;
76
- }
77
- (function registerResetAll() {
78
- let theGlobalVariable = _getGlobalObject();
79
- if (!theGlobalVariable['__rewire_reset_all__']) {
80
- theGlobalVariable['__rewire_reset_all__'] = function () {
81
- theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__ = Object.create(null);
82
- };
83
- }
84
- })();
85
- var INTENTIONAL_UNDEFINED = '__INTENTIONAL_UNDEFINED__';
86
- let _RewireAPI__ = {};
87
- (function () {
88
- function addPropertyToAPIObject(name, value) {
89
- Object.defineProperty(_RewireAPI__, name, {
90
- value: value,
91
- enumerable: false,
92
- configurable: true
93
- });
94
- }
95
- addPropertyToAPIObject('__get__', _get__);
96
- addPropertyToAPIObject('__GetDependency__', _get__);
97
- addPropertyToAPIObject('__Rewire__', _set__);
98
- addPropertyToAPIObject('__set__', _set__);
99
- addPropertyToAPIObject('__reset__', _reset__);
100
- addPropertyToAPIObject('__ResetDependency__', _reset__);
101
- addPropertyToAPIObject('__with__', _with__);
102
- })();
103
- function _get__(variableName) {
104
- let rewireData = _getRewiredData__();
105
- if (rewireData[variableName] === undefined) {
106
- return _get_original__(variableName);
107
- } else {
108
- var value = rewireData[variableName];
109
- if (value === INTENTIONAL_UNDEFINED) {
110
- return undefined;
111
- } else {
112
- return value;
113
- }
114
- }
115
- }
116
- function _get_original__(variableName) {
117
- switch (variableName) {
118
- case "event_1":
119
- return event_1;
120
- case "domEvent":
121
- return domEvent;
122
- case "stop":
123
- return stop;
124
- }
125
- return undefined;
126
- }
127
- function _assign__(variableName, value) {
128
- let rewireData = _getRewiredData__();
129
- if (rewireData[variableName] === undefined) {
130
- return _set_original__(variableName, value);
131
- } else {
132
- return rewireData[variableName] = value;
133
- }
134
- }
135
- function _set_original__(variableName, _value) {
136
- switch (variableName) {}
137
- return undefined;
138
- }
139
- function _update_operation__(operation, variableName, prefix) {
140
- var oldValue = _get__(variableName);
141
- var newValue = operation === '++' ? oldValue + 1 : oldValue - 1;
142
- _assign__(variableName, newValue);
143
- return prefix ? newValue : oldValue;
144
- }
145
- function _set__(variableName, value) {
146
- let rewireData = _getRewiredData__();
147
- if (typeof variableName === 'object') {
148
- Object.keys(variableName).forEach(function (name) {
149
- rewireData[name] = variableName[name];
150
- });
151
- return function () {
152
- Object.keys(variableName).forEach(function (name) {
153
- _reset__(variableName);
154
- });
155
- };
156
- } else {
157
- if (value === undefined) {
158
- rewireData[variableName] = INTENTIONAL_UNDEFINED;
159
- } else {
160
- rewireData[variableName] = value;
161
- }
162
- return function () {
163
- _reset__(variableName);
164
- };
165
- }
166
- }
167
- function _reset__(variableName) {
168
- let rewireData = _getRewiredData__();
169
- delete rewireData[variableName];
170
- if (Object.keys(rewireData).length == 0) {
171
- delete _getRewireRegistry__()[_getRewireModuleId__];
172
- }
173
- ;
174
- }
175
- function _with__(object) {
176
- let rewireData = _getRewiredData__();
177
- var rewiredVariableNames = Object.keys(object);
178
- var previousValues = {};
179
- function reset() {
180
- rewiredVariableNames.forEach(function (variableName) {
181
- rewireData[variableName] = previousValues[variableName];
182
- });
183
- }
184
- return function (callback) {
185
- rewiredVariableNames.forEach(function (variableName) {
186
- previousValues[variableName] = rewireData[variableName];
187
- rewireData[variableName] = object[variableName];
188
- });
189
- let result = callback();
190
- if (!!result && typeof result.then == 'function') {
191
- result.then(reset).catch(reset);
192
- } else {
193
- reset();
194
- }
195
- return result;
196
- };
197
- }
198
- let _typeOfOriginalExport = typeof module.exports;
199
- function addNonEnumerableProperty(name, value) {
200
- Object.defineProperty(module.exports, name, {
201
- value: value,
202
- enumerable: false,
203
- configurable: true
204
- });
205
- }
206
- if ((_typeOfOriginalExport === 'object' || _typeOfOriginalExport === 'function') && Object.isExtensible(module.exports)) {
207
- addNonEnumerableProperty('__get__', _get__);
208
- addNonEnumerableProperty('__GetDependency__', _get__);
209
- addNonEnumerableProperty('__Rewire__', _set__);
210
- addNonEnumerableProperty('__set__', _set__);
211
- addNonEnumerableProperty('__reset__', _reset__);
212
- addNonEnumerableProperty('__ResetDependency__', _reset__);
213
- addNonEnumerableProperty('__with__', _with__);
214
- addNonEnumerableProperty('__RewireAPI__', _RewireAPI__);
215
- }
@@ -1,38 +0,0 @@
1
- import { KeyCode, SimpleKeybinding } from '../common/keyCodes';
2
- export declare function getCodeForKeyCode(keyCode: KeyCode): number;
3
- export interface IKeyboardEvent {
4
- readonly browserEvent: KeyboardEvent;
5
- readonly target: HTMLElement;
6
- readonly ctrlKey: boolean;
7
- readonly shiftKey: boolean;
8
- readonly altKey: boolean;
9
- readonly metaKey: boolean;
10
- readonly keyCode: KeyCode;
11
- readonly code: string;
12
- /**
13
- * @internal
14
- */
15
- toKeybinding(): SimpleKeybinding;
16
- equals(keybinding: number): boolean;
17
- preventDefault(): void;
18
- stopPropagation(): void;
19
- }
20
- export declare class StandardKeyboardEvent implements IKeyboardEvent {
21
- readonly browserEvent: KeyboardEvent;
22
- readonly target: HTMLElement;
23
- readonly ctrlKey: boolean;
24
- readonly shiftKey: boolean;
25
- readonly altKey: boolean;
26
- readonly metaKey: boolean;
27
- readonly keyCode: KeyCode;
28
- readonly code: string;
29
- private _asKeybinding;
30
- private _asRuntimeKeybinding;
31
- constructor(source: KeyboardEvent);
32
- preventDefault(): void;
33
- stopPropagation(): void;
34
- toKeybinding(): SimpleKeybinding;
35
- equals(other: number): boolean;
36
- private _computeKeybinding;
37
- private _computeRuntimeKeybinding;
38
- }