custom-electron-titlebar 3.2.6 → 3.2.10
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/.github/FUNDING.yml +1 -0
- package/README.md +15 -24
- package/_config.yml +1 -0
- package/{lib → build}/browser/browser.d.ts +0 -0
- package/{lib → build}/browser/browser.js +0 -0
- package/{lib → build}/browser/browser.js.map +0 -0
- package/{lib → build}/browser/event.d.ts +0 -0
- package/{lib → build}/browser/event.js +2 -1
- package/{lib → build}/browser/event.js.map +1 -1
- package/{lib → build}/browser/iframe.d.ts +0 -0
- package/{lib → build}/browser/iframe.js +0 -0
- package/{lib → build}/browser/iframe.js.map +0 -0
- package/{lib → build}/browser/keyboardEvent.d.ts +0 -0
- package/{lib → build}/browser/keyboardEvent.js +0 -0
- package/{lib → build}/browser/keyboardEvent.js.map +0 -0
- package/{lib → build}/browser/mouseEvent.d.ts +0 -0
- package/{lib → build}/browser/mouseEvent.js +0 -0
- package/{lib → build}/browser/mouseEvent.js.map +0 -0
- package/{lib → build}/common/arrays.d.ts +0 -0
- package/{lib → build}/common/arrays.js +0 -0
- package/{lib → build}/common/arrays.js.map +0 -0
- package/{lib → build}/common/async.d.ts +0 -0
- package/{lib → build}/common/async.js +0 -0
- package/{lib → build}/common/async.js.map +0 -0
- package/{lib → build}/common/charCode.d.ts +0 -0
- package/{lib → build}/common/charCode.js +0 -0
- package/{lib → build}/common/charCode.js.map +0 -0
- package/{lib → build}/common/color.d.ts +0 -0
- package/{lib → build}/common/color.js +0 -0
- package/{lib → build}/common/color.js.map +0 -0
- package/{lib → build}/common/dom.d.ts +0 -0
- package/{lib → build}/common/dom.js +16 -14
- package/build/common/dom.js.map +1 -0
- package/{lib → build}/common/event.d.ts +0 -0
- package/{lib → build}/common/event.js +1 -1
- package/build/common/event.js.map +1 -0
- package/{lib → build}/common/iterator.d.ts +0 -0
- package/{lib → build}/common/iterator.js +0 -0
- package/{lib → build}/common/iterator.js.map +0 -0
- package/{lib → build}/common/keyCodes.d.ts +0 -0
- package/{lib → build}/common/keyCodes.js +0 -0
- package/{lib → build}/common/keyCodes.js.map +0 -0
- package/{lib → build}/common/lifecycle.d.ts +0 -0
- package/{lib → build}/common/lifecycle.js +0 -0
- package/{lib → build}/common/lifecycle.js.map +0 -0
- package/{lib → build}/common/linkedList.d.ts +0 -0
- package/{lib → build}/common/linkedList.js +0 -0
- package/{lib → build}/common/linkedList.js.map +0 -0
- package/{lib → build}/common/platform.d.ts +0 -0
- package/{lib → build}/common/platform.js +0 -0
- package/{lib → build}/common/platform.js.map +0 -0
- package/{lib → build}/index.d.ts +0 -0
- package/{lib → build}/index.js +0 -0
- package/{lib → build}/index.js.map +0 -0
- package/{lib → build}/menu/menu.d.ts +0 -0
- package/{lib → build}/menu/menu.js +38 -38
- package/build/menu/menu.js.map +1 -0
- package/{lib → build}/menu/menuitem.d.ts +10 -2
- package/{lib → build}/menu/menuitem.js +70 -34
- package/build/menu/menuitem.js.map +1 -0
- package/{lib → build}/menubar.d.ts +0 -0
- package/{lib → build}/menubar.js +29 -30
- package/build/menubar.js.map +1 -0
- package/{lib → build}/themebar.d.ts +0 -0
- package/{lib → build}/themebar.js +2 -2
- package/build/themebar.js.map +1 -0
- package/{lib → build}/titlebar.d.ts +0 -0
- package/{lib → build}/titlebar.js +61 -58
- package/build/titlebar.js.map +1 -0
- package/package.json +13 -7
- package/lib/common/dom.js.map +0 -1
- package/lib/common/enableNativeMenuCommands.d.ts +0 -1
- package/lib/common/enableNativeMenuCommands.js +0 -32
- package/lib/common/enableNativeMenuCommands.js.map +0 -1
- package/lib/common/event.js.map +0 -1
- package/lib/main.d.ts +0 -1
- package/lib/main.js +0 -14
- package/lib/main.js.map +0 -1
- package/lib/menu/menu.js.map +0 -1
- package/lib/menu/menuitem.js.map +0 -1
- package/lib/menubar.js.map +0 -1
- package/lib/themebar.js.map +0 -1
- package/lib/titlebar.js.map +0 -1
- package/lib/vs/base/browser/browser.js +0 -150
- package/lib/vs/base/browser/canIUse.js +0 -58
- package/lib/vs/base/browser/codicons.js +0 -37
- package/lib/vs/base/browser/contextmenu.js +0 -9
- package/lib/vs/base/browser/dnd.js +0 -113
- package/lib/vs/base/browser/dom.js +0 -1417
- package/lib/vs/base/browser/event.js +0 -36
- package/lib/vs/base/browser/fastDomNode.js +0 -265
- package/lib/vs/base/browser/formattedTextRenderer.js +0 -248
- package/lib/vs/base/browser/globalMouseMoveMonitor.js +0 -137
- package/lib/vs/base/browser/history.js +0 -9
- package/lib/vs/base/browser/iframe.js +0 -126
- package/lib/vs/base/browser/keyboardEvent.js +0 -599
- package/lib/vs/base/browser/mouseEvent.js +0 -155
- package/lib/vs/base/browser/touch.js +0 -315
- package/lib/vs/base/browser/ui/actionbar/actionViewItems.js +0 -397
- package/lib/vs/base/browser/ui/actionbar/actionbar.js +0 -583
- package/lib/vs/base/browser/ui/checkbox/checkbox.js +0 -251
- package/lib/vs/base/browser/ui/codicons/codiconLabel.js +0 -31
- package/lib/vs/base/browser/ui/codicons/codiconStyles.js +0 -47
- package/lib/vs/base/browser/ui/contextview/contextview.js +0 -367
- package/lib/vs/base/browser/ui/dropdown/dropdown.js +0 -256
- package/lib/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +0 -120
- package/lib/vs/base/browser/ui/keybindingLabel/keybindingLabel.js +0 -118
- package/lib/vs/base/browser/ui/list/list.js +0 -54
- package/lib/vs/base/browser/ui/list/listPaging.js +0 -322
- package/lib/vs/base/browser/ui/list/listView.js +0 -1388
- package/lib/vs/base/browser/ui/list/listWidget.js +0 -1709
- package/lib/vs/base/browser/ui/list/rangeMap.js +0 -223
- package/lib/vs/base/browser/ui/list/rowCache.js +0 -113
- package/lib/vs/base/browser/ui/list/splice.js +0 -23
- package/lib/vs/base/browser/ui/menu/menu.js +0 -1371
- package/lib/vs/base/browser/ui/menu/menubar.js +0 -1139
- package/lib/vs/base/browser/ui/scrollbar/abstractScrollbar.js +0 -278
- package/lib/vs/base/browser/ui/scrollbar/horizontalScrollbar.js +0 -115
- package/lib/vs/base/browser/ui/scrollbar/scrollableElement.js +0 -646
- package/lib/vs/base/browser/ui/scrollbar/scrollableElementOptions.js +0 -9
- package/lib/vs/base/browser/ui/scrollbar/scrollbarArrow.js +0 -106
- package/lib/vs/base/browser/ui/scrollbar/scrollbarState.js +0 -184
- package/lib/vs/base/browser/ui/scrollbar/scrollbarVisibilityController.js +0 -116
- package/lib/vs/base/browser/ui/scrollbar/verticalScrollbar.js +0 -114
- package/lib/vs/base/browser/ui/selectBox/selectBox.js +0 -85
- package/lib/vs/base/browser/ui/selectBox/selectBoxCustom.js +0 -985
- package/lib/vs/base/browser/ui/selectBox/selectBoxNative.js +0 -188
- package/lib/vs/base/browser/ui/toolbar/toolbar.js +0 -206
- package/lib/vs/base/browser/ui/widget.js +0 -69
- package/lib/vs/base/common/actions.js +0 -224
- package/lib/vs/base/common/amd.js +0 -31
- package/lib/vs/base/common/arrays.js +0 -641
- package/lib/vs/base/common/assert.js +0 -21
- package/lib/vs/base/common/async.js +0 -966
- package/lib/vs/base/common/buffer.js +0 -250
- package/lib/vs/base/common/cache.js +0 -40
- package/lib/vs/base/common/cancellation.js +0 -146
- package/lib/vs/base/common/charCode.js +0 -9
- package/lib/vs/base/common/codicon.js +0 -136
- package/lib/vs/base/common/codicons.js +0 -1378
- package/lib/vs/base/common/collections.js +0 -133
- package/lib/vs/base/common/color.js +0 -716
- package/lib/vs/base/common/comparers.js +0 -280
- package/lib/vs/base/common/console.js +0 -142
- package/lib/vs/base/common/date.js +0 -113
- package/lib/vs/base/common/decorators.js +0 -169
- package/lib/vs/base/common/errorMessage.js +0 -93
- package/lib/vs/base/common/errors.js +0 -213
- package/lib/vs/base/common/errorsWithActions.js +0 -28
- package/lib/vs/base/common/event.js +0 -873
- package/lib/vs/base/common/extpath.js +0 -401
- package/lib/vs/base/common/filters.js +0 -948
- package/lib/vs/base/common/functional.js +0 -28
- package/lib/vs/base/common/fuzzyScorer.js +0 -811
- package/lib/vs/base/common/glob.js +0 -696
- package/lib/vs/base/common/hash.js +0 -359
- package/lib/vs/base/common/history.js +0 -116
- package/lib/vs/base/common/htmlContent.js +0 -162
- package/lib/vs/base/common/idGenerator.js +0 -25
- package/lib/vs/base/common/iterator.js +0 -118
- package/lib/vs/base/common/json.js +0 -1624
- package/lib/vs/base/common/jsonEdit.js +0 -272
- package/lib/vs/base/common/jsonErrorMessages.js +0 -69
- package/lib/vs/base/common/jsonFormatter.js +0 -316
- package/lib/vs/base/common/jsonSchema.js +0 -9
- package/lib/vs/base/common/keyCodes.js +0 -591
- package/lib/vs/base/common/keybindingLabels.js +0 -231
- package/lib/vs/base/common/keybindingParser.js +0 -142
- package/lib/vs/base/common/labels.js +0 -430
- package/lib/vs/base/common/lazy.js +0 -71
- package/lib/vs/base/common/lifecycle.js +0 -308
- package/lib/vs/base/common/linkedList.js +0 -152
- package/lib/vs/base/common/linkedText.js +0 -73
- package/lib/vs/base/common/map.js +0 -1108
- package/lib/vs/base/common/marshalling.js +0 -80
- package/lib/vs/base/common/mime.js +0 -321
- package/lib/vs/base/common/navigator.js +0 -50
- package/lib/vs/base/common/network.js +0 -160
- package/lib/vs/base/common/normalization.js +0 -78
- package/lib/vs/base/common/numbers.js +0 -55
- package/lib/vs/base/common/objects.js +0 -268
- package/lib/vs/base/common/paging.js +0 -190
- package/lib/vs/base/common/parsers.js +0 -78
- package/lib/vs/base/common/path.js +0 -1550
- package/lib/vs/base/common/platform.js +0 -245
- package/lib/vs/base/common/process.js +0 -52
- package/lib/vs/base/common/processes.js +0 -32
- package/lib/vs/base/common/range.js +0 -79
- package/lib/vs/base/common/resourceTree.js +0 -185
- package/lib/vs/base/common/resources.js +0 -421
- package/lib/vs/base/common/scanCode.js +0 -1472
- package/lib/vs/base/common/scrollable.js +0 -397
- package/lib/vs/base/common/search.js +0 -55
- package/lib/vs/base/common/sequence.js +0 -64
- package/lib/vs/base/common/severity.js +0 -55
- package/lib/vs/base/common/skipList.js +0 -234
- package/lib/vs/base/common/stopwatch.js +0 -45
- package/lib/vs/base/common/stream.js +0 -418
- package/lib/vs/base/common/strings.js +0 -1283
- package/lib/vs/base/common/styler.js +0 -9
- package/lib/vs/base/common/types.js +0 -296
- package/lib/vs/base/common/uint.js +0 -46
- package/lib/vs/base/common/uri.js +0 -756
- package/lib/vs/base/common/uriIpc.js +0 -154
- package/lib/vs/base/common/uuid.js +0 -70
- package/lib/vs/nls.mock.js +0 -31
- package/lib/vs/platform/actions/browser/menuEntryActionViewItem.js +0 -342
- package/lib/vs/platform/actions/common/actions.js +0 -456
- package/lib/vs/platform/actions/common/menuService.js +0 -194
- package/lib/vs/platform/clipboard/browser/clipboardService.js +0 -99
- package/lib/vs/platform/clipboard/common/clipboardService.js +0 -14
- package/lib/vs/platform/contextkey/common/contextkey.js +0 -1210
- package/lib/vs/platform/contextkey/common/contextkeys.js +0 -23
- package/lib/vs/platform/contextview/browser/contextView.js +0 -15
- package/lib/vs/platform/contextview/browser/contextViewService.js +0 -96
- package/lib/vs/platform/environment/common/argv.js +0 -9
- package/lib/vs/platform/environment/common/environment.js +0 -15
- package/lib/vs/platform/instantiation/common/descriptors.js +0 -25
- package/lib/vs/platform/instantiation/common/extensions.js +0 -26
- package/lib/vs/platform/instantiation/common/graph.js +0 -93
- package/lib/vs/platform/instantiation/common/instantiation.js +0 -84
- package/lib/vs/platform/instantiation/common/instantiationService.js +0 -361
- package/lib/vs/platform/instantiation/common/serviceCollection.js +0 -39
- package/lib/vs/platform/keybinding/common/baseResolvedKeybinding.js +0 -73
- package/lib/vs/platform/keybinding/common/keybinding.js +0 -14
- package/lib/vs/platform/keybinding/common/keybindingResolver.js +0 -391
- package/lib/vs/platform/keybinding/common/keybindingsRegistry.js +0 -229
- package/lib/vs/platform/keybinding/common/resolvedKeybindingItem.js +0 -47
- package/lib/vs/platform/keybinding/common/usLayoutResolvedKeybinding.js +0 -160
- package/lib/vs/platform/layout/browser/layoutService.js +0 -14
- package/lib/vs/platform/menubar/common/menubar.js +0 -34
- package/lib/vs/platform/registry/common/platform.js +0 -38
- package/lib/vs/platform/theme/browser/checkbox.js +0 -32
- package/lib/vs/platform/theme/common/colorRegistry.js +0 -1154
- package/lib/vs/platform/theme/common/styler.js +0 -290
- package/lib/vs/platform/theme/common/theme.js +0 -21
- package/lib/vs/platform/theme/common/themeService.js +0 -176
- package/lib/vs/platform/theme/common/tokenClassificationRegistry.js +0 -540
- package/lib/vs/platform/theme/test/common/testThemeService.js +0 -98
|
@@ -1,359 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports.StringSHA1 = exports.Hasher = exports.stringHash = exports.doHash = exports.hash = void 0;
|
|
11
|
-
|
|
12
|
-
const strings = require("./strings");
|
|
13
|
-
/**
|
|
14
|
-
* Return a hash value for an object.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
function hash(obj) {
|
|
19
|
-
return doHash(obj, 0);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
exports.hash = hash;
|
|
23
|
-
|
|
24
|
-
function doHash(obj, hashVal) {
|
|
25
|
-
switch (typeof obj) {
|
|
26
|
-
case 'object':
|
|
27
|
-
if (obj === null) {
|
|
28
|
-
return numberHash(349, hashVal);
|
|
29
|
-
} else if (Array.isArray(obj)) {
|
|
30
|
-
return arrayHash(obj, hashVal);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return objectHash(obj, hashVal);
|
|
34
|
-
|
|
35
|
-
case 'string':
|
|
36
|
-
return stringHash(obj, hashVal);
|
|
37
|
-
|
|
38
|
-
case 'boolean':
|
|
39
|
-
return booleanHash(obj, hashVal);
|
|
40
|
-
|
|
41
|
-
case 'number':
|
|
42
|
-
return numberHash(obj, hashVal);
|
|
43
|
-
|
|
44
|
-
case 'undefined':
|
|
45
|
-
return numberHash(937, hashVal);
|
|
46
|
-
|
|
47
|
-
default:
|
|
48
|
-
return numberHash(617, hashVal);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
exports.doHash = doHash;
|
|
53
|
-
|
|
54
|
-
function numberHash(val, initialHashVal) {
|
|
55
|
-
return (initialHashVal << 5) - initialHashVal + val | 0; // hashVal * 31 + ch, keep as int32
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function booleanHash(b, initialHashVal) {
|
|
59
|
-
return numberHash(b ? 433 : 863, initialHashVal);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function stringHash(s, hashVal) {
|
|
63
|
-
hashVal = numberHash(149417, hashVal);
|
|
64
|
-
|
|
65
|
-
for (let i = 0, length = s.length; i < length; i++) {
|
|
66
|
-
hashVal = numberHash(s.charCodeAt(i), hashVal);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return hashVal;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
exports.stringHash = stringHash;
|
|
73
|
-
|
|
74
|
-
function arrayHash(arr, initialHashVal) {
|
|
75
|
-
initialHashVal = numberHash(104579, initialHashVal);
|
|
76
|
-
return arr.reduce((hashVal, item) => doHash(item, hashVal), initialHashVal);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function objectHash(obj, initialHashVal) {
|
|
80
|
-
initialHashVal = numberHash(181387, initialHashVal);
|
|
81
|
-
return Object.keys(obj).sort().reduce((hashVal, key) => {
|
|
82
|
-
hashVal = stringHash(key, hashVal);
|
|
83
|
-
return doHash(obj[key], hashVal);
|
|
84
|
-
}, initialHashVal);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
class Hasher {
|
|
88
|
-
constructor() {
|
|
89
|
-
this._value = 0;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
get value() {
|
|
93
|
-
return this._value;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
hash(obj) {
|
|
97
|
-
this._value = doHash(obj, this._value);
|
|
98
|
-
return this._value;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
exports.Hasher = Hasher;
|
|
104
|
-
|
|
105
|
-
function leftRotate(value, bits, totalBits = 32) {
|
|
106
|
-
// delta + bits = totalBits
|
|
107
|
-
const delta = totalBits - bits; // All ones, expect `delta` zeros aligned to the right
|
|
108
|
-
|
|
109
|
-
const mask = ~((1 << delta) - 1); // Join (value left-shifted `bits` bits) with (masked value right-shifted `delta` bits)
|
|
110
|
-
|
|
111
|
-
return (value << bits | (mask & value) >>> delta) >>> 0;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
function fill(dest, index = 0, count = dest.byteLength, value = 0) {
|
|
115
|
-
for (let i = 0; i < count; i++) {
|
|
116
|
-
dest[index + i] = value;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
function leftPad(value, length, char = '0') {
|
|
121
|
-
while (value.length < length) {
|
|
122
|
-
value = char + value;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return value;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function toHexString(value, bitsize = 32) {
|
|
129
|
-
return leftPad((value >>> 0).toString(16), bitsize / 4);
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* A SHA1 implementation that works with strings and does not allocate.
|
|
133
|
-
*/
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
class StringSHA1 {
|
|
137
|
-
constructor() {
|
|
138
|
-
this._h0 = 0x67452301;
|
|
139
|
-
this._h1 = 0xEFCDAB89;
|
|
140
|
-
this._h2 = 0x98BADCFE;
|
|
141
|
-
this._h3 = 0x10325476;
|
|
142
|
-
this._h4 = 0xC3D2E1F0;
|
|
143
|
-
this._buff = new Uint8Array(64
|
|
144
|
-
/* BLOCK_SIZE */
|
|
145
|
-
+ 3
|
|
146
|
-
/* to fit any utf-8 */
|
|
147
|
-
);
|
|
148
|
-
this._buffDV = new DataView(this._buff.buffer);
|
|
149
|
-
this._buffLen = 0;
|
|
150
|
-
this._totalLen = 0;
|
|
151
|
-
this._leftoverHighSurrogate = 0;
|
|
152
|
-
this._finished = false;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
update(str) {
|
|
156
|
-
const strLen = str.length;
|
|
157
|
-
|
|
158
|
-
if (strLen === 0) {
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
const buff = this._buff;
|
|
163
|
-
let buffLen = this._buffLen;
|
|
164
|
-
let leftoverHighSurrogate = this._leftoverHighSurrogate;
|
|
165
|
-
let charCode;
|
|
166
|
-
let offset;
|
|
167
|
-
|
|
168
|
-
if (leftoverHighSurrogate !== 0) {
|
|
169
|
-
charCode = leftoverHighSurrogate;
|
|
170
|
-
offset = -1;
|
|
171
|
-
leftoverHighSurrogate = 0;
|
|
172
|
-
} else {
|
|
173
|
-
charCode = str.charCodeAt(0);
|
|
174
|
-
offset = 0;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
while (true) {
|
|
178
|
-
let codePoint = charCode;
|
|
179
|
-
|
|
180
|
-
if (strings.isHighSurrogate(charCode)) {
|
|
181
|
-
if (offset + 1 < strLen) {
|
|
182
|
-
const nextCharCode = str.charCodeAt(offset + 1);
|
|
183
|
-
|
|
184
|
-
if (strings.isLowSurrogate(nextCharCode)) {
|
|
185
|
-
offset++;
|
|
186
|
-
codePoint = strings.computeCodePoint(charCode, nextCharCode);
|
|
187
|
-
} else {
|
|
188
|
-
// illegal => unicode replacement character
|
|
189
|
-
codePoint = 65533
|
|
190
|
-
/* UNICODE_REPLACEMENT */
|
|
191
|
-
;
|
|
192
|
-
}
|
|
193
|
-
} else {
|
|
194
|
-
// last character is a surrogate pair
|
|
195
|
-
leftoverHighSurrogate = charCode;
|
|
196
|
-
break;
|
|
197
|
-
}
|
|
198
|
-
} else if (strings.isLowSurrogate(charCode)) {
|
|
199
|
-
// illegal => unicode replacement character
|
|
200
|
-
codePoint = 65533
|
|
201
|
-
/* UNICODE_REPLACEMENT */
|
|
202
|
-
;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
buffLen = this._push(buff, buffLen, codePoint);
|
|
206
|
-
offset++;
|
|
207
|
-
|
|
208
|
-
if (offset < strLen) {
|
|
209
|
-
charCode = str.charCodeAt(offset);
|
|
210
|
-
} else {
|
|
211
|
-
break;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
this._buffLen = buffLen;
|
|
216
|
-
this._leftoverHighSurrogate = leftoverHighSurrogate;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
_push(buff, buffLen, codePoint) {
|
|
220
|
-
if (codePoint < 0x0080) {
|
|
221
|
-
buff[buffLen++] = codePoint;
|
|
222
|
-
} else if (codePoint < 0x0800) {
|
|
223
|
-
buff[buffLen++] = 0b11000000 | (codePoint & 0b00000000000000000000011111000000) >>> 6;
|
|
224
|
-
buff[buffLen++] = 0b10000000 | (codePoint & 0b00000000000000000000000000111111) >>> 0;
|
|
225
|
-
} else if (codePoint < 0x10000) {
|
|
226
|
-
buff[buffLen++] = 0b11100000 | (codePoint & 0b00000000000000001111000000000000) >>> 12;
|
|
227
|
-
buff[buffLen++] = 0b10000000 | (codePoint & 0b00000000000000000000111111000000) >>> 6;
|
|
228
|
-
buff[buffLen++] = 0b10000000 | (codePoint & 0b00000000000000000000000000111111) >>> 0;
|
|
229
|
-
} else {
|
|
230
|
-
buff[buffLen++] = 0b11110000 | (codePoint & 0b00000000000111000000000000000000) >>> 18;
|
|
231
|
-
buff[buffLen++] = 0b10000000 | (codePoint & 0b00000000000000111111000000000000) >>> 12;
|
|
232
|
-
buff[buffLen++] = 0b10000000 | (codePoint & 0b00000000000000000000111111000000) >>> 6;
|
|
233
|
-
buff[buffLen++] = 0b10000000 | (codePoint & 0b00000000000000000000000000111111) >>> 0;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
if (buffLen >= 64
|
|
237
|
-
/* BLOCK_SIZE */
|
|
238
|
-
) {
|
|
239
|
-
this._step();
|
|
240
|
-
|
|
241
|
-
buffLen -= 64
|
|
242
|
-
/* BLOCK_SIZE */
|
|
243
|
-
;
|
|
244
|
-
this._totalLen += 64
|
|
245
|
-
/* BLOCK_SIZE */
|
|
246
|
-
; // take last 3 in case of UTF8 overflow
|
|
247
|
-
|
|
248
|
-
buff[0] = buff[64
|
|
249
|
-
/* BLOCK_SIZE */
|
|
250
|
-
+ 0];
|
|
251
|
-
buff[1] = buff[64
|
|
252
|
-
/* BLOCK_SIZE */
|
|
253
|
-
+ 1];
|
|
254
|
-
buff[2] = buff[64
|
|
255
|
-
/* BLOCK_SIZE */
|
|
256
|
-
+ 2];
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
return buffLen;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
digest() {
|
|
263
|
-
if (!this._finished) {
|
|
264
|
-
this._finished = true;
|
|
265
|
-
|
|
266
|
-
if (this._leftoverHighSurrogate) {
|
|
267
|
-
// illegal => unicode replacement character
|
|
268
|
-
this._leftoverHighSurrogate = 0;
|
|
269
|
-
this._buffLen = this._push(this._buff, this._buffLen, 65533
|
|
270
|
-
/* UNICODE_REPLACEMENT */
|
|
271
|
-
);
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
this._totalLen += this._buffLen;
|
|
275
|
-
|
|
276
|
-
this._wrapUp();
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
return toHexString(this._h0) + toHexString(this._h1) + toHexString(this._h2) + toHexString(this._h3) + toHexString(this._h4);
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
_wrapUp() {
|
|
283
|
-
this._buff[this._buffLen++] = 0x80;
|
|
284
|
-
fill(this._buff, this._buffLen);
|
|
285
|
-
|
|
286
|
-
if (this._buffLen > 56) {
|
|
287
|
-
this._step();
|
|
288
|
-
|
|
289
|
-
fill(this._buff);
|
|
290
|
-
} // this will fit because the mantissa can cover up to 52 bits
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
const ml = 8 * this._totalLen;
|
|
294
|
-
|
|
295
|
-
this._buffDV.setUint32(56, Math.floor(ml / 4294967296), false);
|
|
296
|
-
|
|
297
|
-
this._buffDV.setUint32(60, ml % 4294967296, false);
|
|
298
|
-
|
|
299
|
-
this._step();
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
_step() {
|
|
303
|
-
const bigBlock32 = StringSHA1._bigBlock32;
|
|
304
|
-
const data = this._buffDV;
|
|
305
|
-
|
|
306
|
-
for (let j = 0; j < 64
|
|
307
|
-
/* 16*4 */
|
|
308
|
-
; j += 4) {
|
|
309
|
-
bigBlock32.setUint32(j, data.getUint32(j, false), false);
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
for (let j = 64; j < 320
|
|
313
|
-
/* 80*4 */
|
|
314
|
-
; j += 4) {
|
|
315
|
-
bigBlock32.setUint32(j, leftRotate(bigBlock32.getUint32(j - 12, false) ^ bigBlock32.getUint32(j - 32, false) ^ bigBlock32.getUint32(j - 56, false) ^ bigBlock32.getUint32(j - 64, false), 1), false);
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
let a = this._h0;
|
|
319
|
-
let b = this._h1;
|
|
320
|
-
let c = this._h2;
|
|
321
|
-
let d = this._h3;
|
|
322
|
-
let e = this._h4;
|
|
323
|
-
let f, k;
|
|
324
|
-
let temp;
|
|
325
|
-
|
|
326
|
-
for (let j = 0; j < 80; j++) {
|
|
327
|
-
if (j < 20) {
|
|
328
|
-
f = b & c | ~b & d;
|
|
329
|
-
k = 0x5A827999;
|
|
330
|
-
} else if (j < 40) {
|
|
331
|
-
f = b ^ c ^ d;
|
|
332
|
-
k = 0x6ED9EBA1;
|
|
333
|
-
} else if (j < 60) {
|
|
334
|
-
f = b & c | b & d | c & d;
|
|
335
|
-
k = 0x8F1BBCDC;
|
|
336
|
-
} else {
|
|
337
|
-
f = b ^ c ^ d;
|
|
338
|
-
k = 0xCA62C1D6;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
temp = leftRotate(a, 5) + f + e + k + bigBlock32.getUint32(j * 4, false) & 0xffffffff;
|
|
342
|
-
e = d;
|
|
343
|
-
d = c;
|
|
344
|
-
c = leftRotate(b, 30);
|
|
345
|
-
b = a;
|
|
346
|
-
a = temp;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
this._h0 = this._h0 + a & 0xffffffff;
|
|
350
|
-
this._h1 = this._h1 + b & 0xffffffff;
|
|
351
|
-
this._h2 = this._h2 + c & 0xffffffff;
|
|
352
|
-
this._h3 = this._h3 + d & 0xffffffff;
|
|
353
|
-
this._h4 = this._h4 + e & 0xffffffff;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
exports.StringSHA1 = StringSHA1;
|
|
359
|
-
StringSHA1._bigBlock32 = new DataView(new ArrayBuffer(320)); // 80 * 4 = 320
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports.HistoryNavigator = void 0;
|
|
11
|
-
|
|
12
|
-
const navigator_1 = require("./navigator");
|
|
13
|
-
|
|
14
|
-
class HistoryNavigator {
|
|
15
|
-
constructor(history = [], limit = 10) {
|
|
16
|
-
this._initialize(history);
|
|
17
|
-
|
|
18
|
-
this._limit = limit;
|
|
19
|
-
|
|
20
|
-
this._onChange();
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
getHistory() {
|
|
24
|
-
return this._elements;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
add(t) {
|
|
28
|
-
this._history.delete(t);
|
|
29
|
-
|
|
30
|
-
this._history.add(t);
|
|
31
|
-
|
|
32
|
-
this._onChange();
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
next() {
|
|
36
|
-
if (this._currentPosition() !== this._elements.length - 1) {
|
|
37
|
-
return this._navigator.next();
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
previous() {
|
|
44
|
-
if (this._currentPosition() !== 0) {
|
|
45
|
-
return this._navigator.previous();
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
current() {
|
|
52
|
-
return this._navigator.current();
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
first() {
|
|
56
|
-
return this._navigator.first();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
last() {
|
|
60
|
-
return this._navigator.last();
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
has(t) {
|
|
64
|
-
return this._history.has(t);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
clear() {
|
|
68
|
-
this._initialize([]);
|
|
69
|
-
|
|
70
|
-
this._onChange();
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
_onChange() {
|
|
74
|
-
this._reduceToLimit();
|
|
75
|
-
|
|
76
|
-
const elements = this._elements;
|
|
77
|
-
this._navigator = new navigator_1.ArrayNavigator(elements, 0, elements.length, elements.length);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
_reduceToLimit() {
|
|
81
|
-
const data = this._elements;
|
|
82
|
-
|
|
83
|
-
if (data.length > this._limit) {
|
|
84
|
-
this._initialize(data.slice(data.length - this._limit));
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
_currentPosition() {
|
|
89
|
-
const currentElement = this._navigator.current();
|
|
90
|
-
|
|
91
|
-
if (!currentElement) {
|
|
92
|
-
return -1;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
return this._elements.indexOf(currentElement);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
_initialize(history) {
|
|
99
|
-
this._history = new Set();
|
|
100
|
-
|
|
101
|
-
for (const entry of history) {
|
|
102
|
-
this._history.add(entry);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
get _elements() {
|
|
107
|
-
const elements = [];
|
|
108
|
-
|
|
109
|
-
this._history.forEach(e => elements.push(e));
|
|
110
|
-
|
|
111
|
-
return elements;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
exports.HistoryNavigator = HistoryNavigator;
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports.parseHrefAndDimensions = exports.removeMarkdownEscapes = exports.markedStringsEquals = exports.isMarkdownString = exports.isEmptyMarkdownString = exports.MarkdownString = void 0;
|
|
11
|
-
|
|
12
|
-
const arrays_1 = require("./arrays");
|
|
13
|
-
|
|
14
|
-
const codicons_1 = require("./codicons");
|
|
15
|
-
|
|
16
|
-
const errors_1 = require("./errors");
|
|
17
|
-
|
|
18
|
-
class MarkdownString {
|
|
19
|
-
constructor(_value = '', isTrustedOrOptions = false) {
|
|
20
|
-
var _a, _b;
|
|
21
|
-
|
|
22
|
-
this._value = _value;
|
|
23
|
-
|
|
24
|
-
if (typeof this._value !== 'string') {
|
|
25
|
-
throw errors_1.illegalArgument('value');
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (typeof isTrustedOrOptions === 'boolean') {
|
|
29
|
-
this._isTrusted = isTrustedOrOptions;
|
|
30
|
-
this._supportThemeIcons = false;
|
|
31
|
-
} else {
|
|
32
|
-
this._isTrusted = (_a = isTrustedOrOptions.isTrusted) !== null && _a !== void 0 ? _a : false;
|
|
33
|
-
this._supportThemeIcons = (_b = isTrustedOrOptions.supportThemeIcons) !== null && _b !== void 0 ? _b : false;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
get value() {
|
|
38
|
-
return this._value;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
get isTrusted() {
|
|
42
|
-
return this._isTrusted;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
get supportThemeIcons() {
|
|
46
|
-
return this._supportThemeIcons;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
appendText(value) {
|
|
50
|
-
// escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash
|
|
51
|
-
this._value += (this._supportThemeIcons ? codicons_1.escapeCodicons(value) : value).replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&').replace(/\n/g, '\n\n');
|
|
52
|
-
return this;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
appendMarkdown(value) {
|
|
56
|
-
this._value += value;
|
|
57
|
-
return this;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
appendCodeblock(langId, code) {
|
|
61
|
-
this._value += '\n```';
|
|
62
|
-
this._value += langId;
|
|
63
|
-
this._value += '\n';
|
|
64
|
-
this._value += code;
|
|
65
|
-
this._value += '\n```\n';
|
|
66
|
-
return this;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
exports.MarkdownString = MarkdownString;
|
|
72
|
-
|
|
73
|
-
function isEmptyMarkdownString(oneOrMany) {
|
|
74
|
-
if (isMarkdownString(oneOrMany)) {
|
|
75
|
-
return !oneOrMany.value;
|
|
76
|
-
} else if (Array.isArray(oneOrMany)) {
|
|
77
|
-
return oneOrMany.every(isEmptyMarkdownString);
|
|
78
|
-
} else {
|
|
79
|
-
return true;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
exports.isEmptyMarkdownString = isEmptyMarkdownString;
|
|
84
|
-
|
|
85
|
-
function isMarkdownString(thing) {
|
|
86
|
-
if (thing instanceof MarkdownString) {
|
|
87
|
-
return true;
|
|
88
|
-
} else if (thing && typeof thing === 'object') {
|
|
89
|
-
return typeof thing.value === 'string' && (typeof thing.isTrusted === 'boolean' || thing.isTrusted === undefined) && (typeof thing.supportThemeIcons === 'boolean' || thing.supportThemeIcons === undefined);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
return false;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
exports.isMarkdownString = isMarkdownString;
|
|
96
|
-
|
|
97
|
-
function markedStringsEquals(a, b) {
|
|
98
|
-
if (!a && !b) {
|
|
99
|
-
return true;
|
|
100
|
-
} else if (!a || !b) {
|
|
101
|
-
return false;
|
|
102
|
-
} else if (Array.isArray(a) && Array.isArray(b)) {
|
|
103
|
-
return arrays_1.equals(a, b, markdownStringEqual);
|
|
104
|
-
} else if (isMarkdownString(a) && isMarkdownString(b)) {
|
|
105
|
-
return markdownStringEqual(a, b);
|
|
106
|
-
} else {
|
|
107
|
-
return false;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
exports.markedStringsEquals = markedStringsEquals;
|
|
112
|
-
|
|
113
|
-
function markdownStringEqual(a, b) {
|
|
114
|
-
if (a === b) {
|
|
115
|
-
return true;
|
|
116
|
-
} else if (!a || !b) {
|
|
117
|
-
return false;
|
|
118
|
-
} else {
|
|
119
|
-
return a.value === b.value && a.isTrusted === b.isTrusted && a.supportThemeIcons === b.supportThemeIcons;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function removeMarkdownEscapes(text) {
|
|
124
|
-
if (!text) {
|
|
125
|
-
return text;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return text.replace(/\\([\\`*_{}[\]()#+\-.!])/g, '$1');
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
exports.removeMarkdownEscapes = removeMarkdownEscapes;
|
|
132
|
-
|
|
133
|
-
function parseHrefAndDimensions(href) {
|
|
134
|
-
const dimensions = [];
|
|
135
|
-
const splitted = href.split('|').map(s => s.trim());
|
|
136
|
-
href = splitted[0];
|
|
137
|
-
const parameters = splitted[1];
|
|
138
|
-
|
|
139
|
-
if (parameters) {
|
|
140
|
-
const heightFromParams = /height=(\d+)/.exec(parameters);
|
|
141
|
-
const widthFromParams = /width=(\d+)/.exec(parameters);
|
|
142
|
-
const height = heightFromParams ? heightFromParams[1] : '';
|
|
143
|
-
const width = widthFromParams ? widthFromParams[1] : '';
|
|
144
|
-
const widthIsFinite = isFinite(parseInt(width));
|
|
145
|
-
const heightIsFinite = isFinite(parseInt(height));
|
|
146
|
-
|
|
147
|
-
if (widthIsFinite) {
|
|
148
|
-
dimensions.push(`width="${width}"`);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
if (heightIsFinite) {
|
|
152
|
-
dimensions.push(`height="${height}"`);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
return {
|
|
157
|
-
href,
|
|
158
|
-
dimensions
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
exports.parseHrefAndDimensions = parseHrefAndDimensions;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports.defaultGenerator = exports.IdGenerator = void 0;
|
|
11
|
-
|
|
12
|
-
class IdGenerator {
|
|
13
|
-
constructor(prefix) {
|
|
14
|
-
this._prefix = prefix;
|
|
15
|
-
this._lastId = 0;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
nextId() {
|
|
19
|
-
return this._prefix + ++this._lastId;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
exports.IdGenerator = IdGenerator;
|
|
25
|
-
exports.defaultGenerator = new IdGenerator('id#');
|