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
|
@@ -23,7 +23,7 @@ var FALLBACK_MEDIA_QUERY_LIST = {
|
|
|
23
23
|
var MEDIA_QUERY_LIST = typeof globalThis.matchMedia !== 'undefined' ? globalThis.matchMedia('(prefers-color-scheme: dark)') : FALLBACK_MEDIA_QUERY_LIST;
|
|
24
24
|
var SUPPORT_PREFERS_COLOR_SCHEME = MEDIA_QUERY_LIST.media !== 'not all';
|
|
25
25
|
var CONTEXT = 'document' in globalThis ? globalThis.document.createElement('canvas').getContext('2d', { willReadFrequently: true }) : null;
|
|
26
|
-
var SVG_PIXEL_DATA_URL = 'data:image/svg+xml;base64,
|
|
26
|
+
var SVG_PIXEL_DATA_URL = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxIiBoZWlnaHQ9IjEiPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0wIDBoMXYxSDB6Ii8+PC9zdmc+';
|
|
27
27
|
var ENTRIES = [];
|
|
28
28
|
|
|
29
29
|
function compareVersion(lhs, rhs) {
|
|
@@ -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,11 +117,8 @@ var Platform = {
|
|
|
109
117
|
get readyState() {
|
|
110
118
|
return readyState;
|
|
111
119
|
},
|
|
112
|
-
get
|
|
113
|
-
return
|
|
114
|
-
},
|
|
115
|
-
get dimension() {
|
|
116
|
-
return getDimension();
|
|
120
|
+
get locale() {
|
|
121
|
+
return getLocale();
|
|
117
122
|
},
|
|
118
123
|
get device() {
|
|
119
124
|
if (this.os.name === OS.iOS || this.os.name === OS.Android)
|
|
@@ -125,17 +130,11 @@ var Platform = {
|
|
|
125
130
|
get renderer() {
|
|
126
131
|
return getRenderer();
|
|
127
132
|
},
|
|
128
|
-
get isMobile() {
|
|
129
|
-
return this.device === Devices.Mobile;
|
|
130
|
-
},
|
|
131
|
-
get isDesktop() {
|
|
132
|
-
return this.device === Devices.Desktop;
|
|
133
|
-
},
|
|
134
133
|
get isWebview() {
|
|
135
134
|
return /; ?wv|applewebkit(?!.*safari)/i.test(this.userAgent);
|
|
136
135
|
},
|
|
137
136
|
get isNode() {
|
|
138
|
-
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';
|
|
139
138
|
},
|
|
140
139
|
get isStandalone() {
|
|
141
140
|
if (this.os.name === OS.iOS)
|
|
@@ -157,6 +156,33 @@ var Platform = {
|
|
|
157
156
|
}
|
|
158
157
|
}
|
|
159
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
|
+
}
|
|
160
186
|
var OS_RESOLVER_MAP = [
|
|
161
187
|
[/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
|
|
162
188
|
[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i, OS.Windows, resolveWindowsVersion],
|
|
@@ -215,14 +241,6 @@ var BROWSER_RESOLVER_MAP = [
|
|
|
215
241
|
[/mobile vr; rv:([\w.]+)\).+firefox/i, Browsers.Firefox],
|
|
216
242
|
[/firefox\/([\w.]+)/i, Browsers.Firefox],
|
|
217
243
|
];
|
|
218
|
-
var HIGH_ENTROPY_BRAND_NAME_MAP = {
|
|
219
|
-
'Google Chrome': 'Chrome',
|
|
220
|
-
'Microsoft Edge': 'Edge',
|
|
221
|
-
'Microsoft Edge WebView2': 'Edge WebView2',
|
|
222
|
-
'Android WebView': 'Chrome WebView',
|
|
223
|
-
'HeadlessChrome': 'Chrome Headless',
|
|
224
|
-
'OperaMobile': 'Opera Mobi',
|
|
225
|
-
};
|
|
226
244
|
function incrementPendingTasks() {
|
|
227
245
|
pendingTasks++;
|
|
228
246
|
}
|
|
@@ -243,33 +261,6 @@ function checkReady() {
|
|
|
243
261
|
readyCallback.length = 0;
|
|
244
262
|
}
|
|
245
263
|
}
|
|
246
|
-
function resolveWindowsVersion(string) {
|
|
247
|
-
if (string === undefined)
|
|
248
|
-
return '';
|
|
249
|
-
var mapped = {
|
|
250
|
-
'4.90': 'ME',
|
|
251
|
-
'NT3.51': 'NT 3.11',
|
|
252
|
-
'NT4.0': 'NT 4.0',
|
|
253
|
-
'NT 5.0': '2000',
|
|
254
|
-
'NT 5.1': 'XP',
|
|
255
|
-
'NT 5.2': 'XP',
|
|
256
|
-
'NT 6.0': 'Vista',
|
|
257
|
-
'NT 6.1': '7',
|
|
258
|
-
'NT 6.2': '8',
|
|
259
|
-
'NT 6.3': '8.1',
|
|
260
|
-
'NT 6.4': '10',
|
|
261
|
-
'NT 10.0': '10',
|
|
262
|
-
'ARM': 'RT'
|
|
263
|
-
}[string];
|
|
264
|
-
if (mapped !== undefined)
|
|
265
|
-
return mapped;
|
|
266
|
-
return string;
|
|
267
|
-
}
|
|
268
|
-
function resolveUnderscoreVersion(string) {
|
|
269
|
-
if (string === undefined)
|
|
270
|
-
return '';
|
|
271
|
-
return string.replace(/_/g, '.');
|
|
272
|
-
}
|
|
273
264
|
function resolveSemanticWindowsVersion(version, defaultValue) {
|
|
274
265
|
if (version.major === 10 && version.minor === 0 && version.build >= 22000)
|
|
275
266
|
return '11';
|
|
@@ -406,12 +397,12 @@ function resolveVersion(string, resolver) {
|
|
|
406
397
|
return resolver(string);
|
|
407
398
|
if (typeof resolver === 'string')
|
|
408
399
|
return resolver;
|
|
409
|
-
if (string === undefined)
|
|
400
|
+
if (typeof string === 'undefined')
|
|
410
401
|
return '';
|
|
411
402
|
return string;
|
|
412
403
|
}
|
|
413
404
|
function normalizeBrand(entry) {
|
|
414
|
-
if (entry === null || entry === undefined)
|
|
405
|
+
if (entry === null || typeof entry === 'undefined')
|
|
415
406
|
return { brand: '', version: '' };
|
|
416
407
|
if (typeof entry === 'string')
|
|
417
408
|
return { brand: entry, version: '' };
|
|
@@ -465,152 +456,127 @@ function getRenderer() {
|
|
|
465
456
|
return '';
|
|
466
457
|
}
|
|
467
458
|
}
|
|
468
|
-
function
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
459
|
+
function normalizeLocale(locale) {
|
|
460
|
+
if (locale === null || typeof locale === 'undefined')
|
|
461
|
+
return locale;
|
|
462
|
+
if (locale.length === 0)
|
|
463
|
+
return null;
|
|
464
|
+
locale = locale.replace(/_/g, '-');
|
|
465
|
+
if (locale === 'C' || locale.toLowerCase() === 'posix')
|
|
466
|
+
return 'en-US';
|
|
467
|
+
if (locale.indexOf('.') !== -1)
|
|
468
|
+
return normalizeLocale(locale.split('.')[0]);
|
|
469
|
+
if (locale.indexOf('@') !== -1)
|
|
470
|
+
return normalizeLocale(locale.split('@')[0]);
|
|
471
|
+
var parts = locale.split('-');
|
|
472
|
+
if (parts.length === 0)
|
|
473
|
+
return null;
|
|
474
|
+
parts[0] = parts[0].toLowerCase();
|
|
475
|
+
if (parts.length > 1 && parts[1].length === 2)
|
|
476
|
+
parts[1] = parts[1].toUpperCase();
|
|
477
|
+
if (parts.length > 2 && parts[1].length === 4)
|
|
478
|
+
parts[1] = parts[1].charAt(0).toUpperCase() + parts[1].slice(1).toLowerCase();
|
|
479
|
+
return parts.join('-');
|
|
480
|
+
}
|
|
481
|
+
function getLocale() {
|
|
482
|
+
var locale = {
|
|
483
|
+
language: null,
|
|
484
|
+
languages: [],
|
|
485
|
+
timezone: null,
|
|
486
|
+
timezoneOffset: 0,
|
|
476
487
|
};
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
var connection = globalThis.navigator.connection || globalThis.navigator.mozConnection || globalThis.navigator.webkitConnection;
|
|
481
|
-
if (typeof connection !== 'undefined') {
|
|
482
|
-
if (typeof connection.effectiveType !== 'undefined')
|
|
483
|
-
network.effectiveType = connection.effectiveType;
|
|
484
|
-
if (typeof connection.type !== 'undefined')
|
|
485
|
-
network.type = connection.type;
|
|
486
|
-
if (typeof connection.downlink !== 'undefined')
|
|
487
|
-
network.downlink = connection.downlink;
|
|
488
|
-
if (typeof connection.rtt !== 'undefined')
|
|
489
|
-
network.rtt = connection.rtt;
|
|
490
|
-
if (typeof connection.saveData !== 'undefined')
|
|
491
|
-
network.saveData = connection.saveData;
|
|
492
|
-
return network;
|
|
493
|
-
}
|
|
488
|
+
function addLanguages(language) {
|
|
489
|
+
for (var i = 0; i < language.length; i++)
|
|
490
|
+
addLanguage(language[i]);
|
|
494
491
|
}
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
var name_1 = networkInterfaceNames[i];
|
|
502
|
-
var networkInterface = networkInterfaces[name_1];
|
|
503
|
-
for (var j = 0; j < networkInterface.length; j++) {
|
|
504
|
-
var address = networkInterface[j];
|
|
505
|
-
if (!address.internal && address.family === 'IPv4')
|
|
506
|
-
network.isOnline = true;
|
|
507
|
-
}
|
|
508
|
-
if (network.isOnline)
|
|
509
|
-
break;
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
catch (_) {
|
|
492
|
+
function addLanguage(language) {
|
|
493
|
+
language = normalizeLocale(language);
|
|
494
|
+
if (typeof language === "string" && locale.languages.indexOf(language) === -1) {
|
|
495
|
+
if (locale.language === null)
|
|
496
|
+
locale.language = language;
|
|
497
|
+
locale.languages.push(language);
|
|
513
498
|
}
|
|
499
|
+
}
|
|
500
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative) {
|
|
514
501
|
try {
|
|
515
|
-
var
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
if (
|
|
528
|
-
|
|
529
|
-
}
|
|
530
|
-
catch (_) {
|
|
502
|
+
var reactNative = require('react-native');
|
|
503
|
+
var nativeModules = reactNative.NativeModules;
|
|
504
|
+
if (typeof nativeModules.SettingsManager !== 'undefined') {
|
|
505
|
+
var settingManager = nativeModules.SettingsManager;
|
|
506
|
+
if (typeof settingManager !== 'undefined') {
|
|
507
|
+
var constant = typeof settingManager.getConstants === 'function'
|
|
508
|
+
? settingManager.getConstants()
|
|
509
|
+
: settingManager;
|
|
510
|
+
if (typeof constant !== 'undefined' && typeof constant.settings !== 'undefined') {
|
|
511
|
+
var settings = constant.settings;
|
|
512
|
+
if (typeof settings.AppleLocale === 'string')
|
|
513
|
+
addLanguage(settings.AppleLocale);
|
|
514
|
+
if (Array.isArray(settings.AppleLanguages) && settings.AppleLanguages.length > 0)
|
|
515
|
+
addLanguages(settings.AppleLanguages);
|
|
531
516
|
}
|
|
532
517
|
}
|
|
533
|
-
if (network.type === null)
|
|
534
|
-
network.type = 'other';
|
|
535
518
|
}
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
var
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
else
|
|
545
|
-
network.type = 'other';
|
|
546
|
-
}
|
|
547
|
-
catch (_) {
|
|
548
|
-
network.type = 'other';
|
|
519
|
+
if (typeof nativeModules.I18nManager !== 'undefined') {
|
|
520
|
+
var i18nManager = nativeModules.I18nManager;
|
|
521
|
+
if (typeof i18nManager !== 'undefined') {
|
|
522
|
+
var constant = typeof i18nManager.getConstants === 'function'
|
|
523
|
+
? i18nManager.getConstants()
|
|
524
|
+
: i18nManager;
|
|
525
|
+
if (typeof constant !== 'undefined' && typeof constant.localeIdentifier !== 'undefined')
|
|
526
|
+
addLanguage(constant.localeIdentifier);
|
|
549
527
|
}
|
|
550
528
|
}
|
|
551
529
|
}
|
|
552
530
|
catch (_) {
|
|
553
531
|
}
|
|
554
532
|
}
|
|
555
|
-
|
|
556
|
-
}
|
|
557
|
-
function getDimension() {
|
|
558
|
-
var dimension = {
|
|
559
|
-
innerWidth: -1,
|
|
560
|
-
innerHeight: -1,
|
|
561
|
-
outerWidth: -1,
|
|
562
|
-
outerHeight: -1,
|
|
563
|
-
scale: 1,
|
|
564
|
-
};
|
|
565
|
-
if (typeof globalThis.innerWidth !== 'undefined') {
|
|
566
|
-
dimension.innerWidth = globalThis.innerWidth;
|
|
567
|
-
dimension.innerHeight = globalThis.innerHeight;
|
|
568
|
-
dimension.outerWidth = globalThis.outerWidth;
|
|
569
|
-
dimension.outerHeight = globalThis.outerHeight;
|
|
570
|
-
dimension.scale = globalThis.devicePixelRatio || 1;
|
|
571
|
-
return dimension;
|
|
572
|
-
}
|
|
573
|
-
if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative) {
|
|
533
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron) {
|
|
574
534
|
try {
|
|
575
|
-
var
|
|
576
|
-
var
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
dimension.outerHeight = windowDimensions.height;
|
|
584
|
-
dimension.scale = pixelRatio.get();
|
|
585
|
-
return dimension;
|
|
535
|
+
var electron = require('electron');
|
|
536
|
+
var app = electron.app;
|
|
537
|
+
if (typeof app.getLocale !== 'undefined')
|
|
538
|
+
addLanguage(app.getLocale());
|
|
539
|
+
if (typeof app.getSystemLocale !== 'undefined')
|
|
540
|
+
addLanguage(app.getSystemLocale());
|
|
541
|
+
if (typeof app.getPreferredSystemLanguages !== 'undefined')
|
|
542
|
+
addLanguages(app.getPreferredSystemLanguages());
|
|
586
543
|
}
|
|
587
544
|
catch (_) {
|
|
588
545
|
}
|
|
589
546
|
}
|
|
590
|
-
if (
|
|
547
|
+
if (typeof Intl !== 'undefined') {
|
|
591
548
|
try {
|
|
592
|
-
|
|
593
|
-
var screen_1 = electron.screen;
|
|
594
|
-
var browserWindow = electron.BrowserWindow;
|
|
595
|
-
var focusedWindow = browserWindow.getFocusedWindow() || browserWindow.getAllWindows()[0];
|
|
596
|
-
if (focusedWindow !== undefined) {
|
|
597
|
-
var contentSize = focusedWindow.getContentSize();
|
|
598
|
-
var size = focusedWindow.getSize();
|
|
599
|
-
dimension.innerWidth = contentSize[0];
|
|
600
|
-
dimension.innerHeight = contentSize[1];
|
|
601
|
-
dimension.outerWidth = size[0];
|
|
602
|
-
dimension.outerHeight = size[1];
|
|
603
|
-
dimension.scale = screen_1.getDisplayMatching(focusedWindow.getBounds()).scaleFactor;
|
|
604
|
-
}
|
|
605
|
-
return dimension;
|
|
549
|
+
addLanguage(Intl.DateTimeFormat().resolvedOptions().locale);
|
|
606
550
|
}
|
|
607
551
|
catch (_) {
|
|
608
552
|
}
|
|
553
|
+
try {
|
|
554
|
+
locale.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
555
|
+
}
|
|
556
|
+
catch (_) {
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
if (typeof globalThis.navigator !== 'undefined') {
|
|
560
|
+
if (typeof globalThis.navigator.languages !== 'undefined')
|
|
561
|
+
addLanguages(globalThis.navigator.languages);
|
|
562
|
+
if (typeof globalThis.navigator.language !== 'undefined')
|
|
563
|
+
addLanguage(globalThis.navigator.language);
|
|
564
|
+
if (typeof globalThis.navigator.userLanguage !== 'undefined')
|
|
565
|
+
addLanguage(globalThis.navigator.userLanguage);
|
|
566
|
+
if (typeof globalThis.navigator.browserLanguage !== 'undefined')
|
|
567
|
+
addLanguage(globalThis.navigator.browserLanguage);
|
|
568
|
+
if (typeof globalThis.navigator.systemLanguage !== 'undefined')
|
|
569
|
+
addLanguage(globalThis.navigator.systemLanguage);
|
|
570
|
+
}
|
|
571
|
+
try {
|
|
572
|
+
locale.timezoneOffset = new Date().getTimezoneOffset();
|
|
609
573
|
}
|
|
610
|
-
|
|
574
|
+
catch (_) {
|
|
575
|
+
}
|
|
576
|
+
return locale;
|
|
611
577
|
}
|
|
612
578
|
function init() {
|
|
613
|
-
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)))
|
|
614
580
|
Platform.crossPlatformFramework = CrossPlatformFramework.Electron;
|
|
615
581
|
if (typeof globalThis.navigator !== 'undefined' && globalThis.navigator.product === 'ReactNative')
|
|
616
582
|
Platform.crossPlatformFramework = CrossPlatformFramework.ReactNative;
|
|
@@ -806,8 +772,7 @@ function init() {
|
|
|
806
772
|
finally {
|
|
807
773
|
decrementPendingTasks();
|
|
808
774
|
}
|
|
809
|
-
})
|
|
810
|
-
.catch(decrementPendingTasks);
|
|
775
|
+
});
|
|
811
776
|
}
|
|
812
777
|
checkReady();
|
|
813
778
|
}
|
|
@@ -825,23 +790,16 @@ var Appearance = {
|
|
|
825
790
|
onchange: onchange,
|
|
826
791
|
};
|
|
827
792
|
function getAppearanceFromEngine() {
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
resolve(Appearances.Light);
|
|
839
|
-
};
|
|
840
|
-
img.onerror = function () {
|
|
841
|
-
resolve(Appearances.Unknown);
|
|
842
|
-
};
|
|
843
|
-
img.src = SVG_PIXEL_DATA_URL;
|
|
844
|
-
});
|
|
793
|
+
var img = new Image();
|
|
794
|
+
img.src = SVG_PIXEL_DATA_URL;
|
|
795
|
+
if (CONTEXT === null)
|
|
796
|
+
return Appearances.Light;
|
|
797
|
+
CONTEXT.drawImage(img, 0, 0);
|
|
798
|
+
var data = CONTEXT.getImageData(0, 0, 1, 1).data;
|
|
799
|
+
if ((data[0] & data[1] & data[2]) < 255)
|
|
800
|
+
return Appearances.Dark;
|
|
801
|
+
else
|
|
802
|
+
return Appearances.Light;
|
|
845
803
|
}
|
|
846
804
|
function getAppearanceFromMediaQuery() {
|
|
847
805
|
if (!SUPPORT_PREFERS_COLOR_SCHEME)
|
|
@@ -870,18 +828,12 @@ function getAppearanceFromElectron() {
|
|
|
870
828
|
}
|
|
871
829
|
function getAppearance() {
|
|
872
830
|
if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative)
|
|
873
|
-
return
|
|
874
|
-
resolve(getAppearanceFromReactNative());
|
|
875
|
-
});
|
|
831
|
+
return getAppearanceFromReactNative();
|
|
876
832
|
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron)
|
|
877
|
-
return
|
|
878
|
-
resolve(getAppearanceFromElectron());
|
|
879
|
-
});
|
|
833
|
+
return getAppearanceFromElectron();
|
|
880
834
|
if (Platform.browser.name === Browsers.SamsungInternet)
|
|
881
835
|
return getAppearanceFromEngine();
|
|
882
|
-
return
|
|
883
|
-
resolve(getAppearanceFromMediaQuery());
|
|
884
|
-
});
|
|
836
|
+
return getAppearanceFromMediaQuery();
|
|
885
837
|
}
|
|
886
838
|
function setAppearance(appearance) {
|
|
887
839
|
if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative) {
|
|
@@ -904,18 +856,13 @@ function setAppearance(appearance) {
|
|
|
904
856
|
}
|
|
905
857
|
}
|
|
906
858
|
function startPolling() {
|
|
907
|
-
getAppearanceFromEngine()
|
|
908
|
-
.then(function (appearance) {
|
|
909
|
-
currentAppearance = appearance;
|
|
910
|
-
});
|
|
859
|
+
currentAppearance = getAppearanceFromEngine();
|
|
911
860
|
appearanceIntervalId = globalThis.setInterval(function () {
|
|
912
|
-
getAppearanceFromEngine()
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
}
|
|
918
|
-
});
|
|
861
|
+
var appearance = getAppearanceFromEngine();
|
|
862
|
+
if (appearance !== currentAppearance) {
|
|
863
|
+
currentAppearance = appearance;
|
|
864
|
+
notify(appearance);
|
|
865
|
+
}
|
|
919
866
|
}, 2000);
|
|
920
867
|
}
|
|
921
868
|
function stopPolling() {
|
|
@@ -994,12 +941,9 @@ function onchangeElectron(listener) {
|
|
|
994
941
|
var handleThemeChange_1 = function () {
|
|
995
942
|
listener(getAppearanceFromElectron());
|
|
996
943
|
};
|
|
997
|
-
|
|
998
|
-
electron_1.nativeTheme.on('updated', handleThemeChange_1);
|
|
999
|
-
}
|
|
944
|
+
electron_1.nativeTheme.on('updated', handleThemeChange_1);
|
|
1000
945
|
return function () {
|
|
1001
|
-
|
|
1002
|
-
electron_1.nativeTheme.removeListener('updated', handleThemeChange_1);
|
|
946
|
+
electron_1.nativeTheme.removeListener('updated', handleThemeChange_1);
|
|
1003
947
|
};
|
|
1004
948
|
}
|
|
1005
949
|
catch (_) {
|
|
@@ -1016,11 +960,11 @@ function onchange(listener, options) {
|
|
|
1016
960
|
var entry = { fn: listener, capture: false, once: false };
|
|
1017
961
|
if (typeof options === 'boolean')
|
|
1018
962
|
options = { capture: options };
|
|
1019
|
-
if (options.capture !== undefined)
|
|
963
|
+
if (typeof options.capture !== 'undefined')
|
|
1020
964
|
entry.capture = options.capture;
|
|
1021
|
-
if (options.once !== undefined)
|
|
965
|
+
if (typeof options.once !== 'undefined')
|
|
1022
966
|
entry.once = options.once;
|
|
1023
|
-
if (options.signal !== undefined)
|
|
967
|
+
if (typeof options.signal !== 'undefined')
|
|
1024
968
|
entry.signal = options.signal;
|
|
1025
969
|
var index = indexOfEntry(entry);
|
|
1026
970
|
if (index === -1) {
|
|
@@ -1031,19 +975,18 @@ function onchange(listener, options) {
|
|
|
1031
975
|
else
|
|
1032
976
|
addListener(entry.capture);
|
|
1033
977
|
}
|
|
1034
|
-
getAppearance()
|
|
1035
|
-
.then(notify);
|
|
978
|
+
notify(getAppearance());
|
|
1036
979
|
}
|
|
1037
980
|
else if (ENTRIES[index].once && !entry.once) {
|
|
1038
981
|
ENTRIES[index].once = false;
|
|
1039
982
|
}
|
|
1040
|
-
if (entry.signal !== undefined) {
|
|
983
|
+
if (typeof entry.signal !== 'undefined') {
|
|
1041
984
|
if (entry.signal.aborted) {
|
|
1042
985
|
removeEntry(entry);
|
|
1043
986
|
}
|
|
1044
987
|
else {
|
|
1045
988
|
entry.signal.addEventListener('abort', function onAbort() {
|
|
1046
|
-
if (entry.signal !== undefined)
|
|
989
|
+
if (typeof entry.signal !== 'undefined')
|
|
1047
990
|
entry.signal.removeEventListener('abort', onAbort);
|
|
1048
991
|
removeEntry(entry);
|
|
1049
992
|
});
|