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