native-fn 1.0.81 → 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 +189 -224
- package/dist/plugin/app/index.min.cjs +1 -1
- package/dist/plugin/app/index.min.mjs +1 -1
- package/dist/plugin/app/index.mjs +189 -224
- package/dist/plugin/app/index.umd.js +189 -224
- 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 +1 -7
- package/dist/plugin/app/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/app/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/app/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/app/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/app/src/plugin/dimension/types/dimension.d.ts +11 -0
- package/dist/plugin/app/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/app/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/app/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/app/src/plugin/platform/cores/index.d.ts +5 -10
- package/dist/plugin/app/src/plugin/platform/types/platform.d.ts +7 -18
- 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 +165 -222
- package/dist/plugin/appearance/index.d.ts +2 -8
- package/dist/plugin/appearance/index.min.cjs +1 -1
- package/dist/plugin/appearance/index.min.mjs +1 -1
- package/dist/plugin/appearance/index.mjs +165 -222
- package/dist/plugin/appearance/index.umd.js +165 -222
- 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 +1 -7
- package/dist/plugin/appearance/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/appearance/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/appearance/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/appearance/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/appearance/src/plugin/dimension/types/dimension.d.ts +11 -0
- package/dist/plugin/appearance/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/appearance/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/appearance/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/appearance/src/plugin/platform/cores/index.d.ts +5 -10
- package/dist/plugin/appearance/src/plugin/platform/types/platform.d.ts +7 -18
- 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 +148 -183
- package/dist/plugin/clipboard/index.min.cjs +1 -1
- package/dist/plugin/clipboard/index.min.mjs +1 -1
- package/dist/plugin/clipboard/index.mjs +148 -183
- package/dist/plugin/clipboard/index.umd.js +148 -183
- 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 +1 -7
- package/dist/plugin/clipboard/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/clipboard/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/clipboard/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/clipboard/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/clipboard/src/plugin/dimension/types/dimension.d.ts +11 -0
- package/dist/plugin/clipboard/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/clipboard/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/clipboard/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/clipboard/src/plugin/platform/cores/index.d.ts +5 -10
- package/dist/plugin/clipboard/src/plugin/platform/types/platform.d.ts +7 -18
- 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 +947 -0
- package/dist/plugin/dimension/index.d.ts +36 -0
- package/dist/plugin/dimension/index.min.cjs +1 -0
- package/dist/plugin/dimension/index.min.mjs +1 -0
- package/dist/plugin/dimension/index.mjs +945 -0
- package/dist/plugin/dimension/index.umd.js +953 -0
- package/dist/plugin/dimension/index.umd.min.js +1 -0
- package/dist/plugin/dimension/src/errors/plugin-not-extended-error.d.ts +2 -0
- package/dist/plugin/dimension/src/plugin/app/constants/index.d.ts +12 -0
- package/dist/plugin/dimension/src/plugin/app/cores/index.d.ts +13 -0
- package/dist/plugin/dimension/src/plugin/app/errors/url-open-error.d.ts +2 -0
- package/dist/plugin/dimension/src/plugin/app/index.d.ts +12 -0
- package/dist/plugin/dimension/src/plugin/app/types/app.d.ts +54 -0
- package/dist/plugin/dimension/src/plugin/app/types/index.d.ts +16 -0
- package/dist/plugin/dimension/src/plugin/appearance/constants/index.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/appearance/cores/index.d.ts +3 -0
- package/dist/plugin/dimension/src/plugin/appearance/index.d.ts +8 -0
- package/dist/plugin/dimension/src/plugin/appearance/types/appearance.d.ts +6 -0
- package/dist/plugin/dimension/src/plugin/appearance/types/index.d.ts +13 -0
- package/dist/plugin/dimension/src/plugin/clipboard/cores/index.d.ts +3 -0
- package/dist/plugin/dimension/src/plugin/clipboard/index.d.ts +5 -0
- package/dist/plugin/dimension/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/dimension/src/plugin/clipboard/types/clipboard.d.ts +4 -0
- package/dist/plugin/dimension/src/plugin/clipboard/types/index.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/dimension/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/dimension/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/dimension/src/plugin/dimension/types/dimension.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/dimension/src/plugin/fullscreen/cores/index.d.ts +35 -0
- package/dist/plugin/dimension/src/plugin/fullscreen/index.d.ts +5 -0
- package/dist/plugin/dimension/src/plugin/fullscreen/types/fullscreen.d.ts +10 -0
- package/dist/plugin/dimension/src/plugin/fullscreen/types/index.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/platform/constants/index.d.ts +43 -0
- package/dist/plugin/dimension/src/plugin/platform/cores/index.d.ts +35 -0
- package/dist/plugin/dimension/src/plugin/platform/index.d.ts +12 -0
- package/dist/plugin/dimension/src/plugin/platform/types/index.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/platform/types/platform.d.ts +27 -0
- package/dist/plugin/dimension/src/plugin/theme/constants/index.d.ts +2 -0
- package/dist/plugin/dimension/src/plugin/theme/cores/index.d.ts +3 -0
- package/dist/plugin/dimension/src/plugin/theme/index.d.ts +5 -0
- package/dist/plugin/dimension/src/plugin/theme/types/index.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/theme/types/theme.d.ts +4 -0
- package/dist/plugin/dimension/src/types/event-listener-util.d.ts +11 -0
- package/dist/plugin/dimension/src/types/index.d.ts +1 -0
- package/dist/plugin/dimension/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/dimension/src/types/native.d.ts +27 -0
- package/dist/plugin/dimension/src/utils/assign.d.ts +1 -0
- package/dist/plugin/dimension/src/utils/compare-version.d.ts +1 -0
- package/dist/plugin/dimension/src/utils/create-custom-error.d.ts +6 -0
- package/dist/plugin/dimension/src/utils/create-hidden-element.d.ts +1 -0
- package/dist/plugin/dimension/src/utils/dispatch-click-event.d.ts +1 -0
- package/dist/plugin/dimension/src/utils/event-listener-utils.d.ts +3 -0
- package/dist/plugin/dimension/src/utils/get-topmost-window.d.ts +1 -0
- package/dist/plugin/dimension/src/utils/is-secure-context.d.ts +1 -0
- package/dist/plugin/dimension/src/utils/request.d.ts +1 -0
- package/dist/plugin/fullscreen/index.cjs +156 -188
- package/dist/plugin/fullscreen/index.min.cjs +1 -1
- package/dist/plugin/fullscreen/index.min.mjs +1 -1
- package/dist/plugin/fullscreen/index.mjs +156 -188
- package/dist/plugin/fullscreen/index.umd.js +156 -188
- 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 +1 -7
- package/dist/plugin/fullscreen/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/types/dimension.d.ts +11 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/fullscreen/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/fullscreen/src/plugin/platform/cores/index.d.ts +5 -10
- package/dist/plugin/fullscreen/src/plugin/platform/types/platform.d.ts +7 -18
- 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 +137 -172
- package/dist/plugin/platform/index.d.ts +8 -19
- package/dist/plugin/platform/index.min.cjs +1 -1
- package/dist/plugin/platform/index.min.mjs +1 -1
- package/dist/plugin/platform/index.mjs +137 -172
- package/dist/plugin/platform/index.umd.js +137 -172
- 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 +1 -7
- package/dist/plugin/platform/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/platform/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/platform/src/plugin/dimension/types/dimension.d.ts +11 -0
- package/dist/plugin/platform/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/platform/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/platform/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/platform/src/plugin/platform/cores/index.d.ts +5 -10
- package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +7 -18
- 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 +138 -173
- package/dist/plugin/theme/index.min.cjs +1 -1
- package/dist/plugin/theme/index.min.mjs +1 -1
- package/dist/plugin/theme/index.mjs +138 -173
- package/dist/plugin/theme/index.umd.js +138 -173
- 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 +1 -7
- package/dist/plugin/theme/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/theme/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/theme/src/plugin/dimension/types/dimension.d.ts +11 -0
- package/dist/plugin/theme/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/theme/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/theme/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/theme/src/plugin/platform/cores/index.d.ts +5 -10
- package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +7 -18
- 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 +1 -7
- package/dist/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/src/plugin/dimension/index.d.ts +4 -0
- package/dist/src/plugin/dimension/types/dimension.d.ts +11 -0
- package/dist/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/src/plugin/platform/cores/index.d.ts +5 -10
- package/dist/src/plugin/platform/types/platform.d.ts +7 -18
- package/dist/src/types/listener-entry.d.ts +6 -0
- package/dist/src/utils/request.d.ts +1 -0
- package/package.json +15 -15
|
@@ -68,6 +68,14 @@ var CrossPlatformFramework;
|
|
|
68
68
|
CrossPlatformFramework["Cordova"] = "Cordova";
|
|
69
69
|
})(CrossPlatformFramework || (CrossPlatformFramework = {}));
|
|
70
70
|
var USER_AGENT = typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgent === 'string' ? globalThis.navigator.userAgent : '';
|
|
71
|
+
var HIGH_ENTROPY_BRAND_NAME_MAP = {
|
|
72
|
+
'Google Chrome': 'Chrome',
|
|
73
|
+
'Microsoft Edge': 'Edge',
|
|
74
|
+
'Microsoft Edge WebView2': 'Edge WebView2',
|
|
75
|
+
'Android WebView': 'Chrome WebView',
|
|
76
|
+
'HeadlessChrome': 'Chrome Headless',
|
|
77
|
+
'OperaMobile': 'Opera Mobi',
|
|
78
|
+
};
|
|
71
79
|
|
|
72
80
|
var readyState = 'loading';
|
|
73
81
|
var readyCallback = [];
|
|
@@ -81,11 +89,8 @@ var Platform = {
|
|
|
81
89
|
get readyState() {
|
|
82
90
|
return readyState;
|
|
83
91
|
},
|
|
84
|
-
get
|
|
85
|
-
return
|
|
86
|
-
},
|
|
87
|
-
get dimension() {
|
|
88
|
-
return getDimension();
|
|
92
|
+
get locale() {
|
|
93
|
+
return getLocale();
|
|
89
94
|
},
|
|
90
95
|
get device() {
|
|
91
96
|
if (this.os.name === OS.iOS || this.os.name === OS.Android)
|
|
@@ -97,17 +102,11 @@ var Platform = {
|
|
|
97
102
|
get renderer() {
|
|
98
103
|
return getRenderer();
|
|
99
104
|
},
|
|
100
|
-
get isMobile() {
|
|
101
|
-
return this.device === Devices.Mobile;
|
|
102
|
-
},
|
|
103
|
-
get isDesktop() {
|
|
104
|
-
return this.device === Devices.Desktop;
|
|
105
|
-
},
|
|
106
105
|
get isWebview() {
|
|
107
106
|
return /; ?wv|applewebkit(?!.*safari)/i.test(this.userAgent);
|
|
108
107
|
},
|
|
109
108
|
get isNode() {
|
|
110
|
-
return typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined;
|
|
109
|
+
return typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && typeof globalThis.process.versions.node !== 'undefined';
|
|
111
110
|
},
|
|
112
111
|
get isStandalone() {
|
|
113
112
|
if (this.os.name === OS.iOS)
|
|
@@ -129,6 +128,33 @@ var Platform = {
|
|
|
129
128
|
}
|
|
130
129
|
}
|
|
131
130
|
};
|
|
131
|
+
function resolveWindowsVersion(string) {
|
|
132
|
+
if (typeof string === 'undefined')
|
|
133
|
+
return '';
|
|
134
|
+
var mapped = {
|
|
135
|
+
'4.90': 'ME',
|
|
136
|
+
'NT3.51': 'NT 3.11',
|
|
137
|
+
'NT4.0': 'NT 4.0',
|
|
138
|
+
'NT 5.0': '2000',
|
|
139
|
+
'NT 5.1': 'XP',
|
|
140
|
+
'NT 5.2': 'XP',
|
|
141
|
+
'NT 6.0': 'Vista',
|
|
142
|
+
'NT 6.1': '7',
|
|
143
|
+
'NT 6.2': '8',
|
|
144
|
+
'NT 6.3': '8.1',
|
|
145
|
+
'NT 6.4': '10',
|
|
146
|
+
'NT 10.0': '10',
|
|
147
|
+
'ARM': 'RT'
|
|
148
|
+
}[string];
|
|
149
|
+
if (typeof mapped !== 'undefined')
|
|
150
|
+
return mapped;
|
|
151
|
+
return string;
|
|
152
|
+
}
|
|
153
|
+
function resolveUnderscoreVersion(string) {
|
|
154
|
+
if (typeof string === 'undefined')
|
|
155
|
+
return '';
|
|
156
|
+
return string.replace(/_/g, '.');
|
|
157
|
+
}
|
|
132
158
|
var OS_RESOLVER_MAP = [
|
|
133
159
|
[/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
|
|
134
160
|
[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i, OS.Windows, resolveWindowsVersion],
|
|
@@ -187,14 +213,6 @@ var BROWSER_RESOLVER_MAP = [
|
|
|
187
213
|
[/mobile vr; rv:([\w.]+)\).+firefox/i, Browsers.Firefox],
|
|
188
214
|
[/firefox\/([\w.]+)/i, Browsers.Firefox],
|
|
189
215
|
];
|
|
190
|
-
var HIGH_ENTROPY_BRAND_NAME_MAP = {
|
|
191
|
-
'Google Chrome': 'Chrome',
|
|
192
|
-
'Microsoft Edge': 'Edge',
|
|
193
|
-
'Microsoft Edge WebView2': 'Edge WebView2',
|
|
194
|
-
'Android WebView': 'Chrome WebView',
|
|
195
|
-
'HeadlessChrome': 'Chrome Headless',
|
|
196
|
-
'OperaMobile': 'Opera Mobi',
|
|
197
|
-
};
|
|
198
216
|
function incrementPendingTasks() {
|
|
199
217
|
pendingTasks++;
|
|
200
218
|
}
|
|
@@ -215,33 +233,6 @@ function checkReady() {
|
|
|
215
233
|
readyCallback.length = 0;
|
|
216
234
|
}
|
|
217
235
|
}
|
|
218
|
-
function resolveWindowsVersion(string) {
|
|
219
|
-
if (string === undefined)
|
|
220
|
-
return '';
|
|
221
|
-
var mapped = {
|
|
222
|
-
'4.90': 'ME',
|
|
223
|
-
'NT3.51': 'NT 3.11',
|
|
224
|
-
'NT4.0': 'NT 4.0',
|
|
225
|
-
'NT 5.0': '2000',
|
|
226
|
-
'NT 5.1': 'XP',
|
|
227
|
-
'NT 5.2': 'XP',
|
|
228
|
-
'NT 6.0': 'Vista',
|
|
229
|
-
'NT 6.1': '7',
|
|
230
|
-
'NT 6.2': '8',
|
|
231
|
-
'NT 6.3': '8.1',
|
|
232
|
-
'NT 6.4': '10',
|
|
233
|
-
'NT 10.0': '10',
|
|
234
|
-
'ARM': 'RT'
|
|
235
|
-
}[string];
|
|
236
|
-
if (mapped !== undefined)
|
|
237
|
-
return mapped;
|
|
238
|
-
return string;
|
|
239
|
-
}
|
|
240
|
-
function resolveUnderscoreVersion(string) {
|
|
241
|
-
if (string === undefined)
|
|
242
|
-
return '';
|
|
243
|
-
return string.replace(/_/g, '.');
|
|
244
|
-
}
|
|
245
236
|
function resolveSemanticWindowsVersion(version, defaultValue) {
|
|
246
237
|
if (version.major === 10 && version.minor === 0 && version.build >= 22000)
|
|
247
238
|
return '11';
|
|
@@ -378,12 +369,12 @@ function resolveVersion(string, resolver) {
|
|
|
378
369
|
return resolver(string);
|
|
379
370
|
if (typeof resolver === 'string')
|
|
380
371
|
return resolver;
|
|
381
|
-
if (string === undefined)
|
|
372
|
+
if (typeof string === 'undefined')
|
|
382
373
|
return '';
|
|
383
374
|
return string;
|
|
384
375
|
}
|
|
385
376
|
function normalizeBrand(entry) {
|
|
386
|
-
if (entry === null || entry === undefined)
|
|
377
|
+
if (entry === null || typeof entry === 'undefined')
|
|
387
378
|
return { brand: '', version: '' };
|
|
388
379
|
if (typeof entry === 'string')
|
|
389
380
|
return { brand: entry, version: '' };
|
|
@@ -437,152 +428,127 @@ function getRenderer() {
|
|
|
437
428
|
return '';
|
|
438
429
|
}
|
|
439
430
|
}
|
|
440
|
-
function
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
431
|
+
function normalizeLocale(locale) {
|
|
432
|
+
if (locale === null || typeof locale === 'undefined')
|
|
433
|
+
return locale;
|
|
434
|
+
if (locale.length === 0)
|
|
435
|
+
return null;
|
|
436
|
+
locale = locale.replace(/_/g, '-');
|
|
437
|
+
if (locale === 'C' || locale.toLowerCase() === 'posix')
|
|
438
|
+
return 'en-US';
|
|
439
|
+
if (locale.indexOf('.') !== -1)
|
|
440
|
+
return normalizeLocale(locale.split('.')[0]);
|
|
441
|
+
if (locale.indexOf('@') !== -1)
|
|
442
|
+
return normalizeLocale(locale.split('@')[0]);
|
|
443
|
+
var parts = locale.split('-');
|
|
444
|
+
if (parts.length === 0)
|
|
445
|
+
return null;
|
|
446
|
+
parts[0] = parts[0].toLowerCase();
|
|
447
|
+
if (parts.length > 1 && parts[1].length === 2)
|
|
448
|
+
parts[1] = parts[1].toUpperCase();
|
|
449
|
+
if (parts.length > 2 && parts[1].length === 4)
|
|
450
|
+
parts[1] = parts[1].charAt(0).toUpperCase() + parts[1].slice(1).toLowerCase();
|
|
451
|
+
return parts.join('-');
|
|
452
|
+
}
|
|
453
|
+
function getLocale() {
|
|
454
|
+
var locale = {
|
|
455
|
+
language: null,
|
|
456
|
+
languages: [],
|
|
457
|
+
timezone: null,
|
|
458
|
+
timezoneOffset: 0,
|
|
448
459
|
};
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
var connection = globalThis.navigator.connection || globalThis.navigator.mozConnection || globalThis.navigator.webkitConnection;
|
|
453
|
-
if (typeof connection !== 'undefined') {
|
|
454
|
-
if (typeof connection.effectiveType !== 'undefined')
|
|
455
|
-
network.effectiveType = connection.effectiveType;
|
|
456
|
-
if (typeof connection.type !== 'undefined')
|
|
457
|
-
network.type = connection.type;
|
|
458
|
-
if (typeof connection.downlink !== 'undefined')
|
|
459
|
-
network.downlink = connection.downlink;
|
|
460
|
-
if (typeof connection.rtt !== 'undefined')
|
|
461
|
-
network.rtt = connection.rtt;
|
|
462
|
-
if (typeof connection.saveData !== 'undefined')
|
|
463
|
-
network.saveData = connection.saveData;
|
|
464
|
-
return network;
|
|
465
|
-
}
|
|
460
|
+
function addLanguages(language) {
|
|
461
|
+
for (var i = 0; i < language.length; i++)
|
|
462
|
+
addLanguage(language[i]);
|
|
466
463
|
}
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
var name_1 = networkInterfaceNames[i];
|
|
474
|
-
var networkInterface = networkInterfaces[name_1];
|
|
475
|
-
for (var j = 0; j < networkInterface.length; j++) {
|
|
476
|
-
var address = networkInterface[j];
|
|
477
|
-
if (!address.internal && address.family === 'IPv4')
|
|
478
|
-
network.isOnline = true;
|
|
479
|
-
}
|
|
480
|
-
if (network.isOnline)
|
|
481
|
-
break;
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
catch (_) {
|
|
464
|
+
function addLanguage(language) {
|
|
465
|
+
language = normalizeLocale(language);
|
|
466
|
+
if (typeof language === "string" && locale.languages.indexOf(language) === -1) {
|
|
467
|
+
if (locale.language === null)
|
|
468
|
+
locale.language = language;
|
|
469
|
+
locale.languages.push(language);
|
|
485
470
|
}
|
|
471
|
+
}
|
|
472
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative) {
|
|
486
473
|
try {
|
|
487
|
-
var
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
if (
|
|
500
|
-
|
|
501
|
-
}
|
|
502
|
-
catch (_) {
|
|
474
|
+
var reactNative = require('react-native');
|
|
475
|
+
var nativeModules = reactNative.NativeModules;
|
|
476
|
+
if (typeof nativeModules.SettingsManager !== 'undefined') {
|
|
477
|
+
var settingManager = nativeModules.SettingsManager;
|
|
478
|
+
if (typeof settingManager !== 'undefined') {
|
|
479
|
+
var constant = typeof settingManager.getConstants === 'function'
|
|
480
|
+
? settingManager.getConstants()
|
|
481
|
+
: settingManager;
|
|
482
|
+
if (typeof constant !== 'undefined' && typeof constant.settings !== 'undefined') {
|
|
483
|
+
var settings = constant.settings;
|
|
484
|
+
if (typeof settings.AppleLocale === 'string')
|
|
485
|
+
addLanguage(settings.AppleLocale);
|
|
486
|
+
if (Array.isArray(settings.AppleLanguages) && settings.AppleLanguages.length > 0)
|
|
487
|
+
addLanguages(settings.AppleLanguages);
|
|
503
488
|
}
|
|
504
489
|
}
|
|
505
|
-
if (network.type === null)
|
|
506
|
-
network.type = 'other';
|
|
507
490
|
}
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
var
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
else
|
|
517
|
-
network.type = 'other';
|
|
518
|
-
}
|
|
519
|
-
catch (_) {
|
|
520
|
-
network.type = 'other';
|
|
491
|
+
if (typeof nativeModules.I18nManager !== 'undefined') {
|
|
492
|
+
var i18nManager = nativeModules.I18nManager;
|
|
493
|
+
if (typeof i18nManager !== 'undefined') {
|
|
494
|
+
var constant = typeof i18nManager.getConstants === 'function'
|
|
495
|
+
? i18nManager.getConstants()
|
|
496
|
+
: i18nManager;
|
|
497
|
+
if (typeof constant !== 'undefined' && typeof constant.localeIdentifier !== 'undefined')
|
|
498
|
+
addLanguage(constant.localeIdentifier);
|
|
521
499
|
}
|
|
522
500
|
}
|
|
523
501
|
}
|
|
524
502
|
catch (_) {
|
|
525
503
|
}
|
|
526
504
|
}
|
|
527
|
-
|
|
528
|
-
}
|
|
529
|
-
function getDimension() {
|
|
530
|
-
var dimension = {
|
|
531
|
-
innerWidth: -1,
|
|
532
|
-
innerHeight: -1,
|
|
533
|
-
outerWidth: -1,
|
|
534
|
-
outerHeight: -1,
|
|
535
|
-
scale: 1,
|
|
536
|
-
};
|
|
537
|
-
if (typeof globalThis.innerWidth !== 'undefined') {
|
|
538
|
-
dimension.innerWidth = globalThis.innerWidth;
|
|
539
|
-
dimension.innerHeight = globalThis.innerHeight;
|
|
540
|
-
dimension.outerWidth = globalThis.outerWidth;
|
|
541
|
-
dimension.outerHeight = globalThis.outerHeight;
|
|
542
|
-
dimension.scale = globalThis.devicePixelRatio || 1;
|
|
543
|
-
return dimension;
|
|
544
|
-
}
|
|
545
|
-
if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative) {
|
|
505
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron) {
|
|
546
506
|
try {
|
|
547
|
-
var
|
|
548
|
-
var
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
dimension.outerHeight = windowDimensions.height;
|
|
556
|
-
dimension.scale = pixelRatio.get();
|
|
557
|
-
return dimension;
|
|
507
|
+
var electron = require('electron');
|
|
508
|
+
var app = electron.app;
|
|
509
|
+
if (typeof app.getLocale !== 'undefined')
|
|
510
|
+
addLanguage(app.getLocale());
|
|
511
|
+
if (typeof app.getSystemLocale !== 'undefined')
|
|
512
|
+
addLanguage(app.getSystemLocale());
|
|
513
|
+
if (typeof app.getPreferredSystemLanguages !== 'undefined')
|
|
514
|
+
addLanguages(app.getPreferredSystemLanguages());
|
|
558
515
|
}
|
|
559
516
|
catch (_) {
|
|
560
517
|
}
|
|
561
518
|
}
|
|
562
|
-
if (
|
|
519
|
+
if (typeof Intl !== 'undefined') {
|
|
563
520
|
try {
|
|
564
|
-
|
|
565
|
-
var screen_1 = electron.screen;
|
|
566
|
-
var browserWindow = electron.BrowserWindow;
|
|
567
|
-
var focusedWindow = browserWindow.getFocusedWindow() || browserWindow.getAllWindows()[0];
|
|
568
|
-
if (focusedWindow !== undefined) {
|
|
569
|
-
var contentSize = focusedWindow.getContentSize();
|
|
570
|
-
var size = focusedWindow.getSize();
|
|
571
|
-
dimension.innerWidth = contentSize[0];
|
|
572
|
-
dimension.innerHeight = contentSize[1];
|
|
573
|
-
dimension.outerWidth = size[0];
|
|
574
|
-
dimension.outerHeight = size[1];
|
|
575
|
-
dimension.scale = screen_1.getDisplayMatching(focusedWindow.getBounds()).scaleFactor;
|
|
576
|
-
}
|
|
577
|
-
return dimension;
|
|
521
|
+
addLanguage(Intl.DateTimeFormat().resolvedOptions().locale);
|
|
578
522
|
}
|
|
579
523
|
catch (_) {
|
|
580
524
|
}
|
|
525
|
+
try {
|
|
526
|
+
locale.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
527
|
+
}
|
|
528
|
+
catch (_) {
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
if (typeof globalThis.navigator !== 'undefined') {
|
|
532
|
+
if (typeof globalThis.navigator.languages !== 'undefined')
|
|
533
|
+
addLanguages(globalThis.navigator.languages);
|
|
534
|
+
if (typeof globalThis.navigator.language !== 'undefined')
|
|
535
|
+
addLanguage(globalThis.navigator.language);
|
|
536
|
+
if (typeof globalThis.navigator.userLanguage !== 'undefined')
|
|
537
|
+
addLanguage(globalThis.navigator.userLanguage);
|
|
538
|
+
if (typeof globalThis.navigator.browserLanguage !== 'undefined')
|
|
539
|
+
addLanguage(globalThis.navigator.browserLanguage);
|
|
540
|
+
if (typeof globalThis.navigator.systemLanguage !== 'undefined')
|
|
541
|
+
addLanguage(globalThis.navigator.systemLanguage);
|
|
542
|
+
}
|
|
543
|
+
try {
|
|
544
|
+
locale.timezoneOffset = new Date().getTimezoneOffset();
|
|
545
|
+
}
|
|
546
|
+
catch (_) {
|
|
581
547
|
}
|
|
582
|
-
return
|
|
548
|
+
return locale;
|
|
583
549
|
}
|
|
584
550
|
function init() {
|
|
585
|
-
if ((typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(USER_AGENT)))
|
|
551
|
+
if ((typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && typeof globalThis.process.versions.electron !== 'undefined') || (/ electron\//i.test(USER_AGENT)))
|
|
586
552
|
Platform.crossPlatformFramework = CrossPlatformFramework.Electron;
|
|
587
553
|
if (typeof globalThis.navigator !== 'undefined' && globalThis.navigator.product === 'ReactNative')
|
|
588
554
|
Platform.crossPlatformFramework = CrossPlatformFramework.ReactNative;
|
|
@@ -778,8 +744,7 @@ function init() {
|
|
|
778
744
|
finally {
|
|
779
745
|
decrementPendingTasks();
|
|
780
746
|
}
|
|
781
|
-
})
|
|
782
|
-
.catch(decrementPendingTasks);
|
|
747
|
+
});
|
|
783
748
|
}
|
|
784
749
|
checkReady();
|
|
785
750
|
}
|
|
@@ -794,7 +759,7 @@ var Theme = {
|
|
|
794
759
|
return getThemeColor();
|
|
795
760
|
},
|
|
796
761
|
set value(color) {
|
|
797
|
-
if (color === undefined)
|
|
762
|
+
if (typeof color === 'undefined')
|
|
798
763
|
removeThemeColor();
|
|
799
764
|
else
|
|
800
765
|
setThemeColor(color);
|