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,327 +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
- var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
8
- if (k2 === undefined) k2 = k;
9
- var desc = Object.getOwnPropertyDescriptor(m, k);
10
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11
- desc = {
12
- enumerable: true,
13
- get: function () {
14
- return m[k];
15
- }
16
- };
17
- }
18
- Object.defineProperty(o, k2, desc);
19
- } : function (o, m, k, k2) {
20
- if (k2 === undefined) k2 = k;
21
- o[k2] = m[k];
22
- });
23
- var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
24
- Object.defineProperty(o, "default", {
25
- enumerable: true,
26
- value: v
27
- });
28
- } : function (o, v) {
29
- o["default"] = v;
30
- });
31
- var __importStar = this && this.__importStar || function (mod) {
32
- if (mod && mod.__esModule) return mod;
33
- var result = {};
34
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) _get__("__createBinding")(result, mod, k);
35
- _get__("__setModuleDefault")(result, mod);
36
- return result;
37
- };
38
- Object.defineProperty(exports, "__esModule", {
39
- value: true
40
- });
41
- exports.StandardWheelEvent = exports.DragMouseEvent = exports.StandardMouseEvent = void 0;
42
- const browser = _get__("__importStar")(require("../browser/browser"));
43
- const platform = _get__("__importStar")(require("../common/platform"));
44
- class StandardMouseEvent {
45
- constructor(e) {
46
- this.timestamp = Date.now();
47
- this.browserEvent = e;
48
- this.leftButton = e.button === 0;
49
- this.middleButton = e.button === 1;
50
- this.rightButton = e.button === 2;
51
- this.target = e.target;
52
- this.detail = e.detail || 1;
53
- if (e.type === 'dblclick') {
54
- this.detail = 2;
55
- }
56
- this.ctrlKey = e.ctrlKey;
57
- this.shiftKey = e.shiftKey;
58
- this.altKey = e.altKey;
59
- this.metaKey = e.metaKey;
60
- if (typeof e.pageX === 'number') {
61
- this.posx = e.pageX;
62
- this.posy = e.pageY;
63
- } else {
64
- // Probably hit by MSGestureEvent
65
- this.posx = e.clientX + document.body.scrollLeft + document.documentElement?.scrollLeft;
66
- this.posy = e.clientY + document.body.scrollTop + document.documentElement?.scrollTop;
67
- }
68
- }
69
- preventDefault() {
70
- if (this.browserEvent.preventDefault) {
71
- this.browserEvent.preventDefault();
72
- }
73
- }
74
- stopPropagation() {
75
- if (this.browserEvent.stopPropagation) {
76
- this.browserEvent.stopPropagation();
77
- }
78
- }
79
- }
80
- exports.StandardMouseEvent = _get__("StandardMouseEvent");
81
- class DragMouseEvent extends _get__("StandardMouseEvent") {
82
- constructor(e) {
83
- super(e);
84
- this.dataTransfer = e.dataTransfer;
85
- }
86
- }
87
- exports.DragMouseEvent = _get__("DragMouseEvent");
88
- class StandardWheelEvent {
89
- constructor(e, deltaX = 0, deltaY = 0) {
90
- this.browserEvent = e || null;
91
- this.target = e ? e.target || e.targetNode || e.srcElement : null;
92
- this.deltaY = deltaY;
93
- this.deltaX = deltaX;
94
- if (e) {
95
- const e1 = e;
96
- const e2 = e;
97
- // vertical delta scroll
98
- if (typeof e1.wheelDeltaY !== 'undefined') {
99
- this.deltaY = e1.wheelDeltaY / 120;
100
- } else if (typeof e2.VERTICAL_AXIS !== 'undefined' && e2.axis === e2.VERTICAL_AXIS) {
101
- this.deltaY = -e2.detail / 3;
102
- }
103
- // horizontal delta scroll
104
- if (typeof e1.wheelDeltaX !== 'undefined') {
105
- if (_get__("browser").isSafari && _get__("platform").isWindows) {
106
- this.deltaX = -(e1.wheelDeltaX / 120);
107
- } else {
108
- this.deltaX = e1.wheelDeltaX / 120;
109
- }
110
- } else if (typeof e2.HORIZONTAL_AXIS !== 'undefined' && e2.axis === e2.HORIZONTAL_AXIS) {
111
- this.deltaX = -e.detail / 3;
112
- }
113
- // Assume a vertical scroll if nothing else worked
114
- if (this.deltaY === 0 && this.deltaX === 0 && e.wheelDelta) {
115
- this.deltaY = e.wheelDelta / 120;
116
- }
117
- }
118
- }
119
- preventDefault() {
120
- if (this.browserEvent) {
121
- if (this.browserEvent.preventDefault) {
122
- this.browserEvent.preventDefault();
123
- }
124
- }
125
- }
126
- stopPropagation() {
127
- if (this.browserEvent) {
128
- if (this.browserEvent.stopPropagation) {
129
- this.browserEvent.stopPropagation();
130
- }
131
- }
132
- }
133
- }
134
- exports.StandardWheelEvent = _get__("StandardWheelEvent");
135
- function _getGlobalObject() {
136
- try {
137
- if (!!global) {
138
- return global;
139
- }
140
- } catch (e) {
141
- try {
142
- if (!!window) {
143
- return window;
144
- }
145
- } catch (e) {
146
- return this;
147
- }
148
- }
149
- }
150
- ;
151
- var _RewireModuleId__ = null;
152
- function _getRewireModuleId__() {
153
- if (_RewireModuleId__ === null) {
154
- let globalVariable = _getGlobalObject();
155
- if (!globalVariable.__$$GLOBAL_REWIRE_NEXT_MODULE_ID__) {
156
- globalVariable.__$$GLOBAL_REWIRE_NEXT_MODULE_ID__ = 0;
157
- }
158
- _RewireModuleId__ = __$$GLOBAL_REWIRE_NEXT_MODULE_ID__++;
159
- }
160
- return _RewireModuleId__;
161
- }
162
- function _getRewireRegistry__() {
163
- let theGlobalVariable = _getGlobalObject();
164
- if (!theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__) {
165
- theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__ = Object.create(null);
166
- }
167
- return theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__;
168
- }
169
- function _getRewiredData__() {
170
- let moduleId = _getRewireModuleId__();
171
- let registry = _getRewireRegistry__();
172
- let rewireData = registry[moduleId];
173
- if (!rewireData) {
174
- registry[moduleId] = Object.create(null);
175
- rewireData = registry[moduleId];
176
- }
177
- return rewireData;
178
- }
179
- (function registerResetAll() {
180
- let theGlobalVariable = _getGlobalObject();
181
- if (!theGlobalVariable['__rewire_reset_all__']) {
182
- theGlobalVariable['__rewire_reset_all__'] = function () {
183
- theGlobalVariable.__$$GLOBAL_REWIRE_REGISTRY__ = Object.create(null);
184
- };
185
- }
186
- })();
187
- var INTENTIONAL_UNDEFINED = '__INTENTIONAL_UNDEFINED__';
188
- let _RewireAPI__ = {};
189
- (function () {
190
- function addPropertyToAPIObject(name, value) {
191
- Object.defineProperty(_RewireAPI__, name, {
192
- value: value,
193
- enumerable: false,
194
- configurable: true
195
- });
196
- }
197
- addPropertyToAPIObject('__get__', _get__);
198
- addPropertyToAPIObject('__GetDependency__', _get__);
199
- addPropertyToAPIObject('__Rewire__', _set__);
200
- addPropertyToAPIObject('__set__', _set__);
201
- addPropertyToAPIObject('__reset__', _reset__);
202
- addPropertyToAPIObject('__ResetDependency__', _reset__);
203
- addPropertyToAPIObject('__with__', _with__);
204
- })();
205
- function _get__(variableName) {
206
- let rewireData = _getRewiredData__();
207
- if (rewireData[variableName] === undefined) {
208
- return _get_original__(variableName);
209
- } else {
210
- var value = rewireData[variableName];
211
- if (value === INTENTIONAL_UNDEFINED) {
212
- return undefined;
213
- } else {
214
- return value;
215
- }
216
- }
217
- }
218
- function _get_original__(variableName) {
219
- switch (variableName) {
220
- case "__createBinding":
221
- return __createBinding;
222
- case "__setModuleDefault":
223
- return __setModuleDefault;
224
- case "__importStar":
225
- return __importStar;
226
- case "StandardMouseEvent":
227
- return StandardMouseEvent;
228
- case "DragMouseEvent":
229
- return DragMouseEvent;
230
- case "browser":
231
- return browser;
232
- case "platform":
233
- return platform;
234
- case "StandardWheelEvent":
235
- return StandardWheelEvent;
236
- }
237
- return undefined;
238
- }
239
- function _assign__(variableName, value) {
240
- let rewireData = _getRewiredData__();
241
- if (rewireData[variableName] === undefined) {
242
- return _set_original__(variableName, value);
243
- } else {
244
- return rewireData[variableName] = value;
245
- }
246
- }
247
- function _set_original__(variableName, _value) {
248
- switch (variableName) {}
249
- return undefined;
250
- }
251
- function _update_operation__(operation, variableName, prefix) {
252
- var oldValue = _get__(variableName);
253
- var newValue = operation === '++' ? oldValue + 1 : oldValue - 1;
254
- _assign__(variableName, newValue);
255
- return prefix ? newValue : oldValue;
256
- }
257
- function _set__(variableName, value) {
258
- let rewireData = _getRewiredData__();
259
- if (typeof variableName === 'object') {
260
- Object.keys(variableName).forEach(function (name) {
261
- rewireData[name] = variableName[name];
262
- });
263
- return function () {
264
- Object.keys(variableName).forEach(function (name) {
265
- _reset__(variableName);
266
- });
267
- };
268
- } else {
269
- if (value === undefined) {
270
- rewireData[variableName] = INTENTIONAL_UNDEFINED;
271
- } else {
272
- rewireData[variableName] = value;
273
- }
274
- return function () {
275
- _reset__(variableName);
276
- };
277
- }
278
- }
279
- function _reset__(variableName) {
280
- let rewireData = _getRewiredData__();
281
- delete rewireData[variableName];
282
- if (Object.keys(rewireData).length == 0) {
283
- delete _getRewireRegistry__()[_getRewireModuleId__];
284
- }
285
- ;
286
- }
287
- function _with__(object) {
288
- let rewireData = _getRewiredData__();
289
- var rewiredVariableNames = Object.keys(object);
290
- var previousValues = {};
291
- function reset() {
292
- rewiredVariableNames.forEach(function (variableName) {
293
- rewireData[variableName] = previousValues[variableName];
294
- });
295
- }
296
- return function (callback) {
297
- rewiredVariableNames.forEach(function (variableName) {
298
- previousValues[variableName] = rewireData[variableName];
299
- rewireData[variableName] = object[variableName];
300
- });
301
- let result = callback();
302
- if (!!result && typeof result.then == 'function') {
303
- result.then(reset).catch(reset);
304
- } else {
305
- reset();
306
- }
307
- return result;
308
- };
309
- }
310
- let _typeOfOriginalExport = typeof module.exports;
311
- function addNonEnumerableProperty(name, value) {
312
- Object.defineProperty(module.exports, name, {
313
- value: value,
314
- enumerable: false,
315
- configurable: true
316
- });
317
- }
318
- if ((_typeOfOriginalExport === 'object' || _typeOfOriginalExport === 'function') && Object.isExtensible(module.exports)) {
319
- addNonEnumerableProperty('__get__', _get__);
320
- addNonEnumerableProperty('__GetDependency__', _get__);
321
- addNonEnumerableProperty('__Rewire__', _set__);
322
- addNonEnumerableProperty('__set__', _set__);
323
- addNonEnumerableProperty('__reset__', _reset__);
324
- addNonEnumerableProperty('__ResetDependency__', _reset__);
325
- addNonEnumerableProperty('__with__', _with__);
326
- addNonEnumerableProperty('__RewireAPI__', _RewireAPI__);
327
- }
@@ -1,39 +0,0 @@
1
- import { Disposable, IDisposable } from '../common/lifecycle';
2
- export declare namespace EventType {
3
- const Tap = "-monaco-gesturetap";
4
- const Change = "-monaco-gesturechange";
5
- const Start = "-monaco-gesturestart";
6
- const End = "-monaco-gesturesend";
7
- const Contextmenu = "-monaco-gesturecontextmenu";
8
- }
9
- export interface GestureEvent extends MouseEvent {
10
- initialTarget: EventTarget | undefined;
11
- translationX: number;
12
- translationY: number;
13
- pageX: number;
14
- pageY: number;
15
- tapCount: number;
16
- }
17
- export declare class Gesture extends Disposable {
18
- private static readonly SCROLL_FRICTION;
19
- private static INSTANCE;
20
- private static readonly HOLD_DELAY;
21
- private dispatched;
22
- private readonly targets;
23
- private readonly ignoreTargets;
24
- private handle;
25
- private readonly activeTouches;
26
- private _lastSetTapCountTime;
27
- private static readonly CLEAR_TAP_COUNT_TIME;
28
- private constructor();
29
- static addTarget(element: HTMLElement): IDisposable;
30
- static ignoreTarget(element: HTMLElement): IDisposable;
31
- static isTouchDevice(): boolean;
32
- dispose(): void;
33
- private onTouchStart;
34
- private onTouchEnd;
35
- private newGestureEvent;
36
- private dispatchEvent;
37
- private inertia;
38
- private onTouchMove;
39
- }