native-fn 1.0.82 → 1.0.83
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/index.d.ts +8 -1
- package/dist/native.cjs +4 -10
- package/dist/native.min.cjs +1 -1
- package/dist/native.min.mjs +1 -1
- package/dist/native.mjs +4 -10
- package/dist/native.umd.js +4 -10
- package/dist/native.umd.min.js +1 -1
- package/dist/plugin/app/index.cjs +102 -255
- package/dist/plugin/app/index.min.cjs +1 -1
- package/dist/plugin/app/index.min.mjs +1 -1
- package/dist/plugin/app/index.mjs +102 -255
- package/dist/plugin/app/index.umd.js +102 -255
- package/dist/plugin/app/index.umd.min.js +1 -1
- package/dist/plugin/app/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/appearance/types/appearance.d.ts +0 -6
- package/dist/plugin/app/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/app/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/app/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/app/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/app/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/app/src/plugin/platform/types/platform.d.ts +3 -19
- package/dist/plugin/app/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/app/src/utils/request.d.ts +1 -0
- package/dist/plugin/appearance/index.cjs +55 -208
- package/dist/plugin/appearance/index.d.ts +1 -7
- package/dist/plugin/appearance/index.min.cjs +1 -1
- package/dist/plugin/appearance/index.min.mjs +1 -1
- package/dist/plugin/appearance/index.mjs +55 -208
- package/dist/plugin/appearance/index.umd.js +55 -208
- package/dist/plugin/appearance/index.umd.min.js +1 -1
- package/dist/plugin/appearance/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/appearance/types/appearance.d.ts +0 -6
- package/dist/plugin/appearance/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/appearance/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/appearance/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/appearance/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/appearance/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/appearance/src/plugin/platform/types/platform.d.ts +3 -19
- package/dist/plugin/appearance/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/appearance/src/utils/request.d.ts +1 -0
- package/dist/plugin/clipboard/index.cjs +61 -214
- package/dist/plugin/clipboard/index.min.cjs +1 -1
- package/dist/plugin/clipboard/index.min.mjs +1 -1
- package/dist/plugin/clipboard/index.mjs +61 -214
- package/dist/plugin/clipboard/index.umd.js +61 -214
- package/dist/plugin/clipboard/index.umd.min.js +1 -1
- package/dist/plugin/clipboard/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/appearance/types/appearance.d.ts +0 -6
- package/dist/plugin/clipboard/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/clipboard/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/clipboard/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/clipboard/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/clipboard/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/clipboard/src/plugin/platform/types/platform.d.ts +3 -19
- package/dist/plugin/clipboard/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/clipboard/src/utils/request.d.ts +1 -0
- package/dist/plugin/dimension/index.cjs +935 -1
- package/dist/plugin/dimension/index.d.ts +9 -0
- package/dist/plugin/dimension/index.min.cjs +1 -1
- package/dist/plugin/dimension/index.min.mjs +1 -1
- package/dist/plugin/dimension/index.mjs +935 -1
- package/dist/plugin/dimension/index.umd.js +935 -1
- package/dist/plugin/dimension/index.umd.min.js +1 -1
- package/dist/plugin/dimension/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/dimension/src/plugin/appearance/types/appearance.d.ts +0 -6
- package/dist/plugin/dimension/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/dimension/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/dimension/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/dimension/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/dimension/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/dimension/src/plugin/platform/types/platform.d.ts +3 -19
- package/dist/plugin/dimension/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/dimension/src/utils/request.d.ts +1 -0
- package/dist/plugin/fullscreen/index.cjs +54 -207
- package/dist/plugin/fullscreen/index.min.cjs +1 -1
- package/dist/plugin/fullscreen/index.min.mjs +1 -1
- package/dist/plugin/fullscreen/index.mjs +54 -207
- package/dist/plugin/fullscreen/index.umd.js +54 -207
- package/dist/plugin/fullscreen/index.umd.min.js +1 -1
- package/dist/plugin/fullscreen/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/appearance/types/appearance.d.ts +0 -6
- package/dist/plugin/fullscreen/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/fullscreen/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/fullscreen/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/fullscreen/src/plugin/platform/types/platform.d.ts +3 -19
- package/dist/plugin/fullscreen/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/fullscreen/src/utils/request.d.ts +1 -0
- package/dist/plugin/platform/index.cjs +50 -203
- package/dist/plugin/platform/index.d.ts +4 -20
- package/dist/plugin/platform/index.min.cjs +1 -1
- package/dist/plugin/platform/index.min.mjs +1 -1
- package/dist/plugin/platform/index.mjs +50 -203
- package/dist/plugin/platform/index.umd.js +50 -203
- package/dist/plugin/platform/index.umd.min.js +1 -1
- package/dist/plugin/platform/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/platform/src/plugin/appearance/types/appearance.d.ts +0 -6
- package/dist/plugin/platform/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/platform/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/platform/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/platform/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/platform/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +3 -19
- package/dist/plugin/platform/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/platform/src/utils/request.d.ts +1 -0
- package/dist/plugin/theme/index.cjs +51 -204
- package/dist/plugin/theme/index.min.cjs +1 -1
- package/dist/plugin/theme/index.min.mjs +1 -1
- package/dist/plugin/theme/index.mjs +51 -204
- package/dist/plugin/theme/index.umd.js +51 -204
- package/dist/plugin/theme/index.umd.min.js +1 -1
- package/dist/plugin/theme/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/appearance/types/appearance.d.ts +0 -6
- package/dist/plugin/theme/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/theme/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/theme/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/theme/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +3 -19
- package/dist/plugin/theme/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/theme/src/utils/request.d.ts +1 -0
- package/dist/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/src/plugin/appearance/types/appearance.d.ts +0 -6
- package/dist/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/src/plugin/platform/types/platform.d.ts +3 -19
- package/dist/src/types/listener-entry.d.ts +6 -0
- package/dist/src/utils/request.d.ts +1 -0
- package/package.json +1 -1
|
@@ -96,6 +96,14 @@ var CrossPlatformFramework;
|
|
|
96
96
|
CrossPlatformFramework["Cordova"] = "Cordova";
|
|
97
97
|
})(CrossPlatformFramework || (CrossPlatformFramework = {}));
|
|
98
98
|
var USER_AGENT = typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgent === 'string' ? globalThis.navigator.userAgent : '';
|
|
99
|
+
var HIGH_ENTROPY_BRAND_NAME_MAP = {
|
|
100
|
+
'Google Chrome': 'Chrome',
|
|
101
|
+
'Microsoft Edge': 'Edge',
|
|
102
|
+
'Microsoft Edge WebView2': 'Edge WebView2',
|
|
103
|
+
'Android WebView': 'Chrome WebView',
|
|
104
|
+
'HeadlessChrome': 'Chrome Headless',
|
|
105
|
+
'OperaMobile': 'Opera Mobi',
|
|
106
|
+
};
|
|
99
107
|
|
|
100
108
|
var readyState = 'loading';
|
|
101
109
|
var readyCallback = [];
|
|
@@ -109,15 +117,9 @@ var Platform = {
|
|
|
109
117
|
get readyState() {
|
|
110
118
|
return readyState;
|
|
111
119
|
},
|
|
112
|
-
get network() {
|
|
113
|
-
return getNetwork();
|
|
114
|
-
},
|
|
115
120
|
get locale() {
|
|
116
121
|
return getLocale();
|
|
117
122
|
},
|
|
118
|
-
get dimension() {
|
|
119
|
-
return getDimension();
|
|
120
|
-
},
|
|
121
123
|
get device() {
|
|
122
124
|
if (this.os.name === OS.iOS || this.os.name === OS.Android)
|
|
123
125
|
return Devices.Mobile;
|
|
@@ -132,7 +134,7 @@ var Platform = {
|
|
|
132
134
|
return /; ?wv|applewebkit(?!.*safari)/i.test(this.userAgent);
|
|
133
135
|
},
|
|
134
136
|
get isNode() {
|
|
135
|
-
return typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined;
|
|
137
|
+
return typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && typeof globalThis.process.versions.node !== 'undefined';
|
|
136
138
|
},
|
|
137
139
|
get isStandalone() {
|
|
138
140
|
if (this.os.name === OS.iOS)
|
|
@@ -154,6 +156,33 @@ var Platform = {
|
|
|
154
156
|
}
|
|
155
157
|
}
|
|
156
158
|
};
|
|
159
|
+
function resolveWindowsVersion(string) {
|
|
160
|
+
if (typeof string === 'undefined')
|
|
161
|
+
return '';
|
|
162
|
+
var mapped = {
|
|
163
|
+
'4.90': 'ME',
|
|
164
|
+
'NT3.51': 'NT 3.11',
|
|
165
|
+
'NT4.0': 'NT 4.0',
|
|
166
|
+
'NT 5.0': '2000',
|
|
167
|
+
'NT 5.1': 'XP',
|
|
168
|
+
'NT 5.2': 'XP',
|
|
169
|
+
'NT 6.0': 'Vista',
|
|
170
|
+
'NT 6.1': '7',
|
|
171
|
+
'NT 6.2': '8',
|
|
172
|
+
'NT 6.3': '8.1',
|
|
173
|
+
'NT 6.4': '10',
|
|
174
|
+
'NT 10.0': '10',
|
|
175
|
+
'ARM': 'RT'
|
|
176
|
+
}[string];
|
|
177
|
+
if (typeof mapped !== 'undefined')
|
|
178
|
+
return mapped;
|
|
179
|
+
return string;
|
|
180
|
+
}
|
|
181
|
+
function resolveUnderscoreVersion(string) {
|
|
182
|
+
if (typeof string === 'undefined')
|
|
183
|
+
return '';
|
|
184
|
+
return string.replace(/_/g, '.');
|
|
185
|
+
}
|
|
157
186
|
var OS_RESOLVER_MAP = [
|
|
158
187
|
[/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
|
|
159
188
|
[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i, OS.Windows, resolveWindowsVersion],
|
|
@@ -212,14 +241,6 @@ var BROWSER_RESOLVER_MAP = [
|
|
|
212
241
|
[/mobile vr; rv:([\w.]+)\).+firefox/i, Browsers.Firefox],
|
|
213
242
|
[/firefox\/([\w.]+)/i, Browsers.Firefox],
|
|
214
243
|
];
|
|
215
|
-
var HIGH_ENTROPY_BRAND_NAME_MAP = {
|
|
216
|
-
'Google Chrome': 'Chrome',
|
|
217
|
-
'Microsoft Edge': 'Edge',
|
|
218
|
-
'Microsoft Edge WebView2': 'Edge WebView2',
|
|
219
|
-
'Android WebView': 'Chrome WebView',
|
|
220
|
-
'HeadlessChrome': 'Chrome Headless',
|
|
221
|
-
'OperaMobile': 'Opera Mobi',
|
|
222
|
-
};
|
|
223
244
|
function incrementPendingTasks() {
|
|
224
245
|
pendingTasks++;
|
|
225
246
|
}
|
|
@@ -240,33 +261,6 @@ function checkReady() {
|
|
|
240
261
|
readyCallback.length = 0;
|
|
241
262
|
}
|
|
242
263
|
}
|
|
243
|
-
function resolveWindowsVersion(string) {
|
|
244
|
-
if (string === undefined)
|
|
245
|
-
return '';
|
|
246
|
-
var mapped = {
|
|
247
|
-
'4.90': 'ME',
|
|
248
|
-
'NT3.51': 'NT 3.11',
|
|
249
|
-
'NT4.0': 'NT 4.0',
|
|
250
|
-
'NT 5.0': '2000',
|
|
251
|
-
'NT 5.1': 'XP',
|
|
252
|
-
'NT 5.2': 'XP',
|
|
253
|
-
'NT 6.0': 'Vista',
|
|
254
|
-
'NT 6.1': '7',
|
|
255
|
-
'NT 6.2': '8',
|
|
256
|
-
'NT 6.3': '8.1',
|
|
257
|
-
'NT 6.4': '10',
|
|
258
|
-
'NT 10.0': '10',
|
|
259
|
-
'ARM': 'RT'
|
|
260
|
-
}[string];
|
|
261
|
-
if (mapped !== undefined)
|
|
262
|
-
return mapped;
|
|
263
|
-
return string;
|
|
264
|
-
}
|
|
265
|
-
function resolveUnderscoreVersion(string) {
|
|
266
|
-
if (string === undefined)
|
|
267
|
-
return '';
|
|
268
|
-
return string.replace(/_/g, '.');
|
|
269
|
-
}
|
|
270
264
|
function resolveSemanticWindowsVersion(version, defaultValue) {
|
|
271
265
|
if (version.major === 10 && version.minor === 0 && version.build >= 22000)
|
|
272
266
|
return '11';
|
|
@@ -403,12 +397,12 @@ function resolveVersion(string, resolver) {
|
|
|
403
397
|
return resolver(string);
|
|
404
398
|
if (typeof resolver === 'string')
|
|
405
399
|
return resolver;
|
|
406
|
-
if (string === undefined)
|
|
400
|
+
if (typeof string === 'undefined')
|
|
407
401
|
return '';
|
|
408
402
|
return string;
|
|
409
403
|
}
|
|
410
404
|
function normalizeBrand(entry) {
|
|
411
|
-
if (entry === null || entry === undefined)
|
|
405
|
+
if (entry === null || typeof entry === 'undefined')
|
|
412
406
|
return { brand: '', version: '' };
|
|
413
407
|
if (typeof entry === 'string')
|
|
414
408
|
return { brand: entry, version: '' };
|
|
@@ -462,102 +456,13 @@ function getRenderer() {
|
|
|
462
456
|
return '';
|
|
463
457
|
}
|
|
464
458
|
}
|
|
465
|
-
function getNetwork() {
|
|
466
|
-
var network = {
|
|
467
|
-
isOnline: null,
|
|
468
|
-
effectiveType: null,
|
|
469
|
-
type: null,
|
|
470
|
-
downlink: null,
|
|
471
|
-
rtt: null,
|
|
472
|
-
saveData: null,
|
|
473
|
-
};
|
|
474
|
-
if (typeof globalThis.navigator !== 'undefined') {
|
|
475
|
-
if (typeof globalThis.navigator.onLine !== 'undefined')
|
|
476
|
-
network.isOnline = globalThis.navigator.onLine;
|
|
477
|
-
var connection = globalThis.navigator.connection || globalThis.navigator.mozConnection || globalThis.navigator.webkitConnection;
|
|
478
|
-
if (typeof connection !== 'undefined') {
|
|
479
|
-
if (typeof connection.effectiveType !== 'undefined')
|
|
480
|
-
network.effectiveType = connection.effectiveType;
|
|
481
|
-
if (typeof connection.type !== 'undefined')
|
|
482
|
-
network.type = connection.type;
|
|
483
|
-
if (typeof connection.downlink !== 'undefined')
|
|
484
|
-
network.downlink = connection.downlink;
|
|
485
|
-
if (typeof connection.rtt !== 'undefined')
|
|
486
|
-
network.rtt = connection.rtt;
|
|
487
|
-
if (typeof connection.saveData !== 'undefined')
|
|
488
|
-
network.saveData = connection.saveData;
|
|
489
|
-
return network;
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
if (Platform.isNode) {
|
|
493
|
-
try {
|
|
494
|
-
var os = require('os');
|
|
495
|
-
var networkInterfaces = os.networkInterfaces();
|
|
496
|
-
var networkInterfaceNames = Object.keys(networkInterfaces);
|
|
497
|
-
for (var i = 0; i < networkInterfaceNames.length; i++) {
|
|
498
|
-
var name_1 = networkInterfaceNames[i];
|
|
499
|
-
var networkInterface = networkInterfaces[name_1];
|
|
500
|
-
for (var j = 0; j < networkInterface.length; j++) {
|
|
501
|
-
var address = networkInterface[j];
|
|
502
|
-
if (!address.internal && address.family === 'IPv4')
|
|
503
|
-
network.isOnline = true;
|
|
504
|
-
}
|
|
505
|
-
if (network.isOnline)
|
|
506
|
-
break;
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
catch (_) {
|
|
510
|
-
}
|
|
511
|
-
try {
|
|
512
|
-
var childProcess = require('child_process');
|
|
513
|
-
if (Platform.os.name === OS.Windows) {
|
|
514
|
-
try {
|
|
515
|
-
var output = childProcess.execSync('netsh wlan show interfaces', { encoding: 'utf8', timeout: 5000 });
|
|
516
|
-
if (output.includes('State') && output.includes('connected'))
|
|
517
|
-
network.type = 'wifi';
|
|
518
|
-
}
|
|
519
|
-
catch (_) {
|
|
520
|
-
}
|
|
521
|
-
if (network.type === null) {
|
|
522
|
-
try {
|
|
523
|
-
var output = childProcess.execSync('ipconfig', { encoding: 'utf8', timeout: 5000 });
|
|
524
|
-
if (output.includes('Ethernet adapter'))
|
|
525
|
-
network.type = 'ethernet';
|
|
526
|
-
}
|
|
527
|
-
catch (_) {
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
if (network.type === null)
|
|
531
|
-
network.type = 'other';
|
|
532
|
-
}
|
|
533
|
-
else if (Platform.os.name === OS.MacOS) {
|
|
534
|
-
try {
|
|
535
|
-
var output = childProcess.execSync('networksetup -listallhardwareports', { encoding: 'utf8', timeout: 5000 });
|
|
536
|
-
var activeInterface = childProcess.execSync('route -n get default | grep interface', { encoding: 'utf8', timeout: 5000 });
|
|
537
|
-
if (activeInterface.includes('en0') && output.includes('Wi-Fi'))
|
|
538
|
-
network.type = 'wifi';
|
|
539
|
-
else if (activeInterface.includes('en') || output.includes('Ethernet'))
|
|
540
|
-
network.type = 'ethernet';
|
|
541
|
-
else
|
|
542
|
-
network.type = 'other';
|
|
543
|
-
}
|
|
544
|
-
catch (_) {
|
|
545
|
-
network.type = 'other';
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
catch (_) {
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
return network;
|
|
553
|
-
}
|
|
554
459
|
function normalizeLocale(locale) {
|
|
555
|
-
if (locale === null || locale === undefined)
|
|
460
|
+
if (locale === null || typeof locale === 'undefined')
|
|
556
461
|
return locale;
|
|
557
462
|
if (locale.length === 0)
|
|
558
463
|
return null;
|
|
559
464
|
locale = locale.replace(/_/g, '-');
|
|
560
|
-
if (locale === 'C' || locale === 'posix'
|
|
465
|
+
if (locale === 'C' || locale.toLowerCase() === 'posix')
|
|
561
466
|
return 'en-US';
|
|
562
467
|
if (locale.indexOf('.') !== -1)
|
|
563
468
|
return normalizeLocale(locale.split('.')[0]);
|
|
@@ -575,9 +480,9 @@ function normalizeLocale(locale) {
|
|
|
575
480
|
}
|
|
576
481
|
function getLocale() {
|
|
577
482
|
var locale = {
|
|
578
|
-
language:
|
|
483
|
+
language: null,
|
|
579
484
|
languages: [],
|
|
580
|
-
timezone:
|
|
485
|
+
timezone: null,
|
|
581
486
|
timezoneOffset: 0,
|
|
582
487
|
};
|
|
583
488
|
function addLanguages(language) {
|
|
@@ -587,7 +492,7 @@ function getLocale() {
|
|
|
587
492
|
function addLanguage(language) {
|
|
588
493
|
language = normalizeLocale(language);
|
|
589
494
|
if (typeof language === "string" && locale.languages.indexOf(language) === -1) {
|
|
590
|
-
if (locale.language
|
|
495
|
+
if (locale.language === null)
|
|
591
496
|
locale.language = language;
|
|
592
497
|
locale.languages.push(language);
|
|
593
498
|
}
|
|
@@ -645,6 +550,11 @@ function getLocale() {
|
|
|
645
550
|
}
|
|
646
551
|
catch (_) {
|
|
647
552
|
}
|
|
553
|
+
try {
|
|
554
|
+
locale.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
555
|
+
}
|
|
556
|
+
catch (_) {
|
|
557
|
+
}
|
|
648
558
|
}
|
|
649
559
|
if (typeof globalThis.navigator !== 'undefined') {
|
|
650
560
|
if (typeof globalThis.navigator.languages !== 'undefined')
|
|
@@ -658,13 +568,6 @@ function getLocale() {
|
|
|
658
568
|
if (typeof globalThis.navigator.systemLanguage !== 'undefined')
|
|
659
569
|
addLanguage(globalThis.navigator.systemLanguage);
|
|
660
570
|
}
|
|
661
|
-
try {
|
|
662
|
-
if (typeof Intl !== 'undefined') {
|
|
663
|
-
locale.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
catch (_) {
|
|
667
|
-
}
|
|
668
571
|
try {
|
|
669
572
|
locale.timezoneOffset = new Date().getTimezoneOffset();
|
|
670
573
|
}
|
|
@@ -672,63 +575,8 @@ function getLocale() {
|
|
|
672
575
|
}
|
|
673
576
|
return locale;
|
|
674
577
|
}
|
|
675
|
-
function getDimension() {
|
|
676
|
-
var dimension = {
|
|
677
|
-
innerWidth: -1,
|
|
678
|
-
innerHeight: -1,
|
|
679
|
-
outerWidth: -1,
|
|
680
|
-
outerHeight: -1,
|
|
681
|
-
scale: 1,
|
|
682
|
-
};
|
|
683
|
-
if (typeof globalThis.innerWidth !== 'undefined') {
|
|
684
|
-
dimension.innerWidth = globalThis.innerWidth;
|
|
685
|
-
dimension.innerHeight = globalThis.innerHeight;
|
|
686
|
-
dimension.outerWidth = globalThis.outerWidth;
|
|
687
|
-
dimension.outerHeight = globalThis.outerHeight;
|
|
688
|
-
dimension.scale = globalThis.devicePixelRatio || 1;
|
|
689
|
-
return dimension;
|
|
690
|
-
}
|
|
691
|
-
if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative) {
|
|
692
|
-
try {
|
|
693
|
-
var reactNative = require('react-native');
|
|
694
|
-
var dimensions = reactNative.Dimensions;
|
|
695
|
-
var pixelRatio = reactNative.PixelRatio;
|
|
696
|
-
var screenDimensions = dimensions.get('screen');
|
|
697
|
-
var windowDimensions = dimensions.get('window');
|
|
698
|
-
dimension.innerWidth = screenDimensions.width;
|
|
699
|
-
dimension.innerHeight = screenDimensions.height;
|
|
700
|
-
dimension.outerWidth = windowDimensions.width;
|
|
701
|
-
dimension.outerHeight = windowDimensions.height;
|
|
702
|
-
dimension.scale = pixelRatio.get();
|
|
703
|
-
return dimension;
|
|
704
|
-
}
|
|
705
|
-
catch (_) {
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron) {
|
|
709
|
-
try {
|
|
710
|
-
var electron = require('electron');
|
|
711
|
-
var screen_1 = electron.screen;
|
|
712
|
-
var browserWindow = electron.BrowserWindow;
|
|
713
|
-
var focusedWindow = browserWindow.getFocusedWindow() || browserWindow.getAllWindows()[0];
|
|
714
|
-
if (focusedWindow !== undefined) {
|
|
715
|
-
var contentSize = focusedWindow.getContentSize();
|
|
716
|
-
var size = focusedWindow.getSize();
|
|
717
|
-
dimension.innerWidth = contentSize[0];
|
|
718
|
-
dimension.innerHeight = contentSize[1];
|
|
719
|
-
dimension.outerWidth = size[0];
|
|
720
|
-
dimension.outerHeight = size[1];
|
|
721
|
-
dimension.scale = screen_1.getDisplayMatching(focusedWindow.getBounds()).scaleFactor;
|
|
722
|
-
}
|
|
723
|
-
return dimension;
|
|
724
|
-
}
|
|
725
|
-
catch (_) {
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
return dimension;
|
|
729
|
-
}
|
|
730
578
|
function init() {
|
|
731
|
-
if ((typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(USER_AGENT)))
|
|
579
|
+
if ((typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && typeof globalThis.process.versions.electron !== 'undefined') || (/ electron\//i.test(USER_AGENT)))
|
|
732
580
|
Platform.crossPlatformFramework = CrossPlatformFramework.Electron;
|
|
733
581
|
if (typeof globalThis.navigator !== 'undefined' && globalThis.navigator.product === 'ReactNative')
|
|
734
582
|
Platform.crossPlatformFramework = CrossPlatformFramework.ReactNative;
|
|
@@ -924,8 +772,7 @@ function init() {
|
|
|
924
772
|
finally {
|
|
925
773
|
decrementPendingTasks();
|
|
926
774
|
}
|
|
927
|
-
})
|
|
928
|
-
.catch(decrementPendingTasks);
|
|
775
|
+
});
|
|
929
776
|
}
|
|
930
777
|
checkReady();
|
|
931
778
|
}
|
|
@@ -1113,11 +960,11 @@ function onchange(listener, options) {
|
|
|
1113
960
|
var entry = { fn: listener, capture: false, once: false };
|
|
1114
961
|
if (typeof options === 'boolean')
|
|
1115
962
|
options = { capture: options };
|
|
1116
|
-
if (options.capture !== undefined)
|
|
963
|
+
if (typeof options.capture !== 'undefined')
|
|
1117
964
|
entry.capture = options.capture;
|
|
1118
|
-
if (options.once !== undefined)
|
|
965
|
+
if (typeof options.once !== 'undefined')
|
|
1119
966
|
entry.once = options.once;
|
|
1120
|
-
if (options.signal !== undefined)
|
|
967
|
+
if (typeof options.signal !== 'undefined')
|
|
1121
968
|
entry.signal = options.signal;
|
|
1122
969
|
var index = indexOfEntry(entry);
|
|
1123
970
|
if (index === -1) {
|
|
@@ -1133,13 +980,13 @@ function onchange(listener, options) {
|
|
|
1133
980
|
else if (ENTRIES[index].once && !entry.once) {
|
|
1134
981
|
ENTRIES[index].once = false;
|
|
1135
982
|
}
|
|
1136
|
-
if (entry.signal !== undefined) {
|
|
983
|
+
if (typeof entry.signal !== 'undefined') {
|
|
1137
984
|
if (entry.signal.aborted) {
|
|
1138
985
|
removeEntry(entry);
|
|
1139
986
|
}
|
|
1140
987
|
else {
|
|
1141
988
|
entry.signal.addEventListener('abort', function onAbort() {
|
|
1142
|
-
if (entry.signal !== undefined)
|
|
989
|
+
if (typeof entry.signal !== 'undefined')
|
|
1143
990
|
entry.signal.removeEventListener('abort', onAbort);
|
|
1144
991
|
removeEntry(entry);
|
|
1145
992
|
});
|