custom-electron-titlebar 4.2.0 → 4.2.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.
- package/dist/base/browser/browser.d.ts +26 -0
- package/dist/base/browser/browser.js +317 -0
- package/dist/base/browser/event.d.ts +12 -0
- package/dist/base/browser/event.js +215 -0
- package/dist/base/browser/keyboardEvent.d.ts +38 -0
- package/dist/base/browser/keyboardEvent.js +466 -0
- package/dist/base/browser/mouseEvent.d.ts +61 -0
- package/dist/base/browser/mouseEvent.js +327 -0
- package/dist/base/browser/touch.d.ts +39 -0
- package/dist/base/browser/touch.js +454 -0
- package/dist/base/common/arrays.d.ts +10 -0
- package/dist/base/common/arrays.js +210 -0
- package/dist/base/common/async.d.ts +35 -0
- package/dist/base/common/async.js +280 -0
- package/dist/base/common/charCode.d.ts +405 -0
- package/dist/base/common/charCode.js +9 -0
- package/dist/base/common/color.d.ts +159 -0
- package/dist/base/common/color.js +709 -0
- package/dist/base/common/decorators.d.ts +6 -0
- package/dist/base/common/decorators.js +300 -0
- package/dist/base/common/dom.d.ts +221 -0
- package/dist/base/common/dom.js +1478 -0
- package/dist/base/common/event.d.ts +213 -0
- package/dist/base/common/event.js +804 -0
- package/dist/base/common/iterator.d.ts +69 -0
- package/dist/base/common/iterator.js +381 -0
- package/dist/base/common/keyCodes.d.ts +478 -0
- package/dist/base/common/keyCodes.js +479 -0
- package/dist/base/common/lifecycle.d.ts +17 -0
- package/dist/base/common/lifecycle.js +258 -0
- package/dist/base/common/linkedList.d.ts +17 -0
- package/dist/base/common/linkedList.js +319 -0
- package/dist/base/common/platform.d.ts +33 -0
- package/dist/base/common/platform.js +302 -0
- package/dist/base/common/strings.d.ts +23 -0
- package/dist/base/common/strings.js +273 -0
- package/dist/consts.d.ts +49 -0
- package/dist/consts.js +303 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +211 -0
- package/dist/main/attach-titlebar-to-window.d.ts +3 -0
- package/dist/main/attach-titlebar-to-window.js +207 -0
- package/dist/main/index.d.ts +3 -0
- package/dist/main/index.js +202 -0
- package/dist/main/setup-titlebar.d.ts +2 -0
- package/dist/main/setup-titlebar.js +242 -0
- package/dist/menubar/index.d.ts +86 -0
- package/dist/menubar/index.js +1118 -0
- package/dist/menubar/menu/index.d.ts +46 -0
- package/dist/menubar/menu/index.js +556 -0
- package/dist/menubar/menu/item.d.ts +67 -0
- package/dist/menubar/menu/item.js +575 -0
- package/dist/menubar/menu/separator.d.ts +11 -0
- package/dist/menubar/menu/separator.js +213 -0
- package/dist/menubar/menu/submenu.d.ts +32 -0
- package/dist/menubar/menu/submenu.js +372 -0
- package/dist/menubar/menubar-options.d.ts +55 -0
- package/dist/menubar/menubar-options.js +9 -0
- package/dist/titlebar/index.d.ts +99 -0
- package/dist/titlebar/index.js +663 -0
- package/dist/titlebar/options.d.ts +84 -0
- package/dist/titlebar/options.js +9 -0
- package/dist/titlebar/themebar.d.ts +20 -0
- package/dist/titlebar/themebar.js +267 -0
- package/package.json +1 -1
|
@@ -0,0 +1,327 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
}
|