native-fn 1.0.42 → 1.0.43
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/native.cjs +362 -6
- package/dist/native.min.cjs +1 -1
- package/dist/native.min.mjs +1 -1
- package/dist/native.mjs +362 -6
- package/dist/native.umd.js +362 -6
- package/dist/native.umd.min.js +1 -1
- package/dist/plugin/app/index.cjs +262 -98
- package/dist/plugin/app/index.min.cjs +1 -1
- package/dist/plugin/app/index.min.mjs +1 -1
- package/dist/plugin/app/index.mjs +262 -98
- package/dist/plugin/app/index.umd.js +262 -98
- package/dist/plugin/app/index.umd.min.js +1 -1
- package/dist/plugin/app/src/constants/platform.d.ts +3 -13
- package/dist/plugin/app/src/types/platform.d.ts +17 -0
- package/dist/plugin/app/src/utils/create-hidden-element.d.ts +1 -1
- package/dist/plugin/camera/index.cjs +248 -86
- package/dist/plugin/camera/index.min.cjs +1 -1
- package/dist/plugin/camera/index.min.mjs +1 -1
- package/dist/plugin/camera/index.mjs +248 -86
- package/dist/plugin/camera/index.umd.js +248 -86
- package/dist/plugin/camera/index.umd.min.js +1 -1
- package/dist/plugin/camera/src/constants/platform.d.ts +3 -13
- package/dist/plugin/camera/src/types/platform.d.ts +17 -0
- package/dist/plugin/camera/src/utils/create-hidden-element.d.ts +1 -1
- package/dist/plugin/clipboard/index.cjs +6 -0
- package/dist/plugin/clipboard/index.min.cjs +1 -1
- package/dist/plugin/clipboard/index.min.mjs +1 -1
- package/dist/plugin/clipboard/index.mjs +6 -0
- package/dist/plugin/clipboard/index.umd.js +6 -0
- package/dist/plugin/clipboard/index.umd.min.js +1 -1
- package/dist/plugin/clipboard/src/constants/platform.d.ts +3 -13
- package/dist/plugin/clipboard/src/types/platform.d.ts +17 -0
- package/dist/plugin/clipboard/src/utils/create-hidden-element.d.ts +1 -1
- package/dist/plugin/fullscreen/index.cjs +241 -82
- package/dist/plugin/fullscreen/index.min.cjs +1 -1
- package/dist/plugin/fullscreen/index.min.mjs +1 -1
- package/dist/plugin/fullscreen/index.mjs +241 -82
- package/dist/plugin/fullscreen/index.umd.js +241 -82
- package/dist/plugin/fullscreen/index.umd.min.js +1 -1
- package/dist/plugin/fullscreen/src/constants/platform.d.ts +3 -13
- package/dist/plugin/fullscreen/src/types/platform.d.ts +17 -0
- package/dist/plugin/fullscreen/src/utils/create-hidden-element.d.ts +1 -1
- package/dist/plugin/theme/index.cjs +252 -91
- package/dist/plugin/theme/index.min.cjs +1 -1
- package/dist/plugin/theme/index.min.mjs +1 -1
- package/dist/plugin/theme/index.mjs +252 -91
- package/dist/plugin/theme/index.umd.js +252 -91
- package/dist/plugin/theme/index.umd.min.js +1 -1
- package/dist/plugin/theme/src/constants/platform.d.ts +3 -13
- package/dist/plugin/theme/src/types/platform.d.ts +17 -0
- package/dist/plugin/theme/src/utils/create-hidden-element.d.ts +1 -1
- package/dist/src/constants/platform.d.ts +3 -13
- package/dist/src/types/platform.d.ts +17 -0
- package/dist/src/utils/create-hidden-element.d.ts +1 -1
- package/package.json +1 -8
|
@@ -4,7 +4,23 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Fullscreen = factory());
|
|
5
5
|
})(this, (function () { 'use strict';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
function dynamicImport(moduleName) {
|
|
8
|
+
if ('require' in globalThis && typeof globalThis.require === 'function') {
|
|
9
|
+
try {
|
|
10
|
+
return Promise.resolve(globalThis.require(moduleName));
|
|
11
|
+
}
|
|
12
|
+
catch (_) {
|
|
13
|
+
return Promise.resolve(null);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return import(moduleName)
|
|
17
|
+
.then(function (module) {
|
|
18
|
+
return (module.default || module);
|
|
19
|
+
})
|
|
20
|
+
.catch(function () {
|
|
21
|
+
return Promise.resolve(null);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
8
24
|
|
|
9
25
|
var OS;
|
|
10
26
|
(function (OS) {
|
|
@@ -45,42 +61,22 @@
|
|
|
45
61
|
Browsers["IE"] = "IE";
|
|
46
62
|
Browsers["SamsungInternet"] = "SamsungInternet";
|
|
47
63
|
})(Browsers || (Browsers = {}));
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
'ARM': 'RT'
|
|
65
|
-
}[string];
|
|
66
|
-
if (mapped !== undefined)
|
|
67
|
-
return mapped;
|
|
68
|
-
return string;
|
|
69
|
-
}
|
|
70
|
-
function resolveUnderscoreVersion(string) {
|
|
71
|
-
if (string === undefined)
|
|
72
|
-
return '';
|
|
73
|
-
return string.replace(/_/g, '.');
|
|
74
|
-
}
|
|
75
|
-
function resolveVersion(string, resolver) {
|
|
76
|
-
if (typeof resolver === 'function')
|
|
77
|
-
return resolver(string);
|
|
78
|
-
if (typeof resolver === 'string')
|
|
79
|
-
return resolver;
|
|
80
|
-
if (string === undefined)
|
|
81
|
-
return '';
|
|
82
|
-
return string;
|
|
83
|
-
}
|
|
64
|
+
var Platform = {
|
|
65
|
+
device: Devices.Unknown,
|
|
66
|
+
os: OS.Unknown,
|
|
67
|
+
osVersion: '',
|
|
68
|
+
engine: Engines.Unknown,
|
|
69
|
+
engineVersion: '',
|
|
70
|
+
browser: Browsers.Unknown,
|
|
71
|
+
browserVersion: '',
|
|
72
|
+
renderer: getRenderer(),
|
|
73
|
+
userAgent: navigator.userAgent,
|
|
74
|
+
isWebview: false,
|
|
75
|
+
isMobile: false,
|
|
76
|
+
isDesktop: false,
|
|
77
|
+
isStandalone: false,
|
|
78
|
+
isNodeJS: getIsNode(),
|
|
79
|
+
};
|
|
84
80
|
var OS_RESOLVER_MAP = [
|
|
85
81
|
[/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
|
|
86
82
|
[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i, OS.Windows, resolveWindowsVersion],
|
|
@@ -139,77 +135,240 @@
|
|
|
139
135
|
[/mobile vr; rv:([\w.]+)\).+firefox/i, Browsers.Firefox],
|
|
140
136
|
[/firefox\/([\w.]+)/i, Browsers.Firefox],
|
|
141
137
|
];
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
138
|
+
function resolveWindowsVersion(string) {
|
|
139
|
+
if (string === undefined)
|
|
140
|
+
return '';
|
|
141
|
+
var mapped = {
|
|
142
|
+
'4.90': 'ME',
|
|
143
|
+
'NT3.51': 'NT 3.11',
|
|
144
|
+
'NT4.0': 'NT 4.0',
|
|
145
|
+
'NT 5.0': '2000',
|
|
146
|
+
'NT 5.1': 'XP',
|
|
147
|
+
'NT 5.2': 'XP',
|
|
148
|
+
'NT 6.0': 'Vista',
|
|
149
|
+
'NT 6.1': '7',
|
|
150
|
+
'NT 6.2': '8',
|
|
151
|
+
'NT 6.3': '8.1',
|
|
152
|
+
'NT 6.4': '10',
|
|
153
|
+
'NT 10.0': '10',
|
|
154
|
+
'ARM': 'RT'
|
|
155
|
+
}[string];
|
|
156
|
+
if (mapped !== undefined)
|
|
157
|
+
return mapped;
|
|
158
|
+
return string;
|
|
159
|
+
}
|
|
160
|
+
function resolveUnderscoreVersion(string) {
|
|
161
|
+
if (string === undefined)
|
|
162
|
+
return '';
|
|
163
|
+
return string.replace(/_/g, '.');
|
|
164
|
+
}
|
|
165
|
+
function resolveVersion(string, resolver) {
|
|
166
|
+
if (typeof resolver === 'function')
|
|
167
|
+
return resolver(string);
|
|
168
|
+
if (typeof resolver === 'string')
|
|
169
|
+
return resolver;
|
|
170
|
+
if (string === undefined)
|
|
171
|
+
return '';
|
|
172
|
+
return string;
|
|
173
|
+
}
|
|
174
|
+
function normalizeBrand(entry) {
|
|
175
|
+
if (entry === null || entry === undefined)
|
|
176
|
+
return { brand: '', version: '' };
|
|
177
|
+
if (typeof entry === 'string')
|
|
178
|
+
return { brand: entry, version: '' };
|
|
179
|
+
return { brand: entry.brand, version: entry.version };
|
|
180
|
+
}
|
|
181
|
+
function getRenderer() {
|
|
182
|
+
if (typeof globalThis.document === 'undefined')
|
|
183
|
+
return '';
|
|
184
|
+
var canvas = globalThis.document.createElement('canvas');
|
|
185
|
+
if (typeof canvas.getContext !== 'function')
|
|
186
|
+
return '';
|
|
187
|
+
var context = canvas.getContext('webgl2') || canvas.getContext('experimental-webgl') || canvas.getContext('webgl');
|
|
188
|
+
if (context === null)
|
|
189
|
+
return '';
|
|
190
|
+
if (context instanceof WebGLRenderingContext || 'getParameter' in context && typeof context.getParameter === 'function') {
|
|
191
|
+
var extension = context.getExtension('WEBGL_debug_renderer_info');
|
|
192
|
+
if (extension === null)
|
|
193
|
+
return context.getParameter(context.RENDERER);
|
|
194
|
+
else
|
|
195
|
+
return context.getParameter(extension.UNMASKED_RENDERER_WEBGL);
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
return '';
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
function getIsStandalone(os) {
|
|
202
|
+
if (!('matchMedia' in globalThis))
|
|
203
|
+
return false;
|
|
204
|
+
if (os === OS.iOS)
|
|
205
|
+
return 'standalone' in navigator && !!navigator.standalone;
|
|
206
|
+
return globalThis.matchMedia('(display-mode: standalone)').matches;
|
|
207
|
+
}
|
|
208
|
+
function getIsWebview() {
|
|
209
|
+
return /; ?wv|applewebkit(?!.*safari)/i.test(Platform.userAgent);
|
|
210
|
+
}
|
|
211
|
+
function getIsNode() {
|
|
212
|
+
return typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined;
|
|
213
|
+
}
|
|
214
|
+
function getNodeOSVersion(string) {
|
|
215
|
+
var parts = string.split('.');
|
|
216
|
+
return {
|
|
217
|
+
major: parseInt(parts[0] || '0'),
|
|
218
|
+
minor: parseInt(parts[1] || '0'),
|
|
219
|
+
build: parseInt(parts[2] || '0')
|
|
220
|
+
};
|
|
221
|
+
}
|
|
146
222
|
for (var i = 0; i < OS_RESOLVER_MAP.length; i++) {
|
|
147
223
|
var map = OS_RESOLVER_MAP[i];
|
|
148
224
|
var regexp = map[0];
|
|
149
225
|
var os = map[1];
|
|
150
226
|
var resolver = map[2];
|
|
151
|
-
var matched =
|
|
227
|
+
var matched = Platform.userAgent.match(regexp);
|
|
152
228
|
if (matched !== null) {
|
|
153
|
-
|
|
154
|
-
resolveVersion(matched[1], resolver);
|
|
229
|
+
Platform.os = os;
|
|
230
|
+
Platform.osVersion = resolveVersion(matched[1], resolver);
|
|
155
231
|
if (os === OS.iOS || os === OS.Android)
|
|
156
|
-
|
|
232
|
+
Platform.device = Devices.Mobile;
|
|
157
233
|
else if (os === OS.Windows || os === OS.MacOS)
|
|
158
|
-
|
|
234
|
+
Platform.device = Devices.Desktop;
|
|
159
235
|
break;
|
|
160
236
|
}
|
|
161
237
|
}
|
|
162
238
|
for (var i = 0; i < ENGINE_RESOLVER_MAP.length; i++) {
|
|
163
239
|
var map = ENGINE_RESOLVER_MAP[i];
|
|
164
240
|
var regexp = map[0];
|
|
165
|
-
map[1];
|
|
241
|
+
var engine = map[1];
|
|
166
242
|
var resolver = map[2];
|
|
167
|
-
var matched =
|
|
243
|
+
var matched = Platform.userAgent.match(regexp);
|
|
168
244
|
if (matched !== null) {
|
|
169
|
-
|
|
245
|
+
Platform.engine = engine;
|
|
246
|
+
Platform.engineVersion = resolveVersion(matched[1], resolver);
|
|
170
247
|
break;
|
|
171
248
|
}
|
|
172
249
|
}
|
|
173
250
|
for (var i = 0; i < BROWSER_RESOLVER_MAP.length; i++) {
|
|
174
251
|
var map = BROWSER_RESOLVER_MAP[i];
|
|
175
252
|
var regexp = map[0];
|
|
176
|
-
map[1];
|
|
253
|
+
var browser = map[1];
|
|
177
254
|
var resolver = map[2];
|
|
178
|
-
var matched =
|
|
255
|
+
var matched = Platform.userAgent.match(regexp);
|
|
179
256
|
if (matched !== null) {
|
|
180
|
-
|
|
257
|
+
Platform.browser = browser;
|
|
258
|
+
Platform.browserVersion = resolveVersion(matched[1], resolver);
|
|
181
259
|
break;
|
|
182
260
|
}
|
|
183
261
|
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
262
|
+
if (Platform.isNodeJS) {
|
|
263
|
+
dynamicImport('os')
|
|
264
|
+
.then(function (os) {
|
|
265
|
+
if (os === null)
|
|
266
|
+
return;
|
|
267
|
+
var platform = os.platform();
|
|
268
|
+
var release = os.release();
|
|
269
|
+
var version = getNodeOSVersion(release);
|
|
270
|
+
switch (platform) {
|
|
271
|
+
case 'win32':
|
|
272
|
+
Platform.os = OS.Windows;
|
|
273
|
+
if (version.major === 10 && version.minor === 0 && version.build >= 22000)
|
|
274
|
+
Platform.osVersion = '11';
|
|
275
|
+
else if (version.major === 10 && version.minor === 0 && version.build < 22000)
|
|
276
|
+
Platform.osVersion = '10';
|
|
277
|
+
else if (version.major === 6 && version.minor === 3)
|
|
278
|
+
Platform.osVersion = '8.1';
|
|
279
|
+
else if (version.major === 6 && version.minor === 2)
|
|
280
|
+
Platform.osVersion = '8';
|
|
281
|
+
else if (version.major === 6 && version.minor === 1)
|
|
282
|
+
Platform.osVersion = '7';
|
|
283
|
+
else if (version.major === 6 && version.minor === 0)
|
|
284
|
+
Platform.osVersion = 'Vista';
|
|
285
|
+
else if (version.major === 5 && version.minor === 1)
|
|
286
|
+
Platform.osVersion = 'XP';
|
|
287
|
+
else if (version.major === 5 && version.minor === 2)
|
|
288
|
+
Platform.osVersion = 'XP';
|
|
289
|
+
else if (version.major === 5 && version.minor === 0)
|
|
290
|
+
Platform.osVersion = '2000';
|
|
291
|
+
else if (version.major === 4 && version.minor === 90)
|
|
292
|
+
Platform.osVersion = 'ME';
|
|
293
|
+
else if (version.major === 4 && version.minor === 0)
|
|
294
|
+
Platform.osVersion = 'NT 4.0';
|
|
295
|
+
else if (version.major === 3 && version.minor === 51)
|
|
296
|
+
Platform.osVersion = 'NT 3.11';
|
|
297
|
+
else
|
|
298
|
+
Platform.osVersion = release;
|
|
299
|
+
break;
|
|
300
|
+
case 'darwin':
|
|
301
|
+
Platform.os = OS.MacOS;
|
|
302
|
+
if (version.major >= 24)
|
|
303
|
+
Platform.osVersion = '' + (version.major - 9);
|
|
304
|
+
else if (version.major === 23)
|
|
305
|
+
Platform.osVersion = '14';
|
|
306
|
+
else if (version.major === 22)
|
|
307
|
+
Platform.osVersion = '13';
|
|
308
|
+
else if (version.major === 21)
|
|
309
|
+
Platform.osVersion = '12';
|
|
310
|
+
else if (version.major === 20)
|
|
311
|
+
Platform.osVersion = '11';
|
|
312
|
+
else if (version.major === 19)
|
|
313
|
+
Platform.osVersion = '10.15';
|
|
314
|
+
else if (version.major === 18)
|
|
315
|
+
Platform.osVersion = '10.14';
|
|
316
|
+
else if (version.major === 17)
|
|
317
|
+
Platform.osVersion = '10.13';
|
|
318
|
+
else if (version.major === 16)
|
|
319
|
+
Platform.osVersion = '10.12';
|
|
320
|
+
else if (version.major === 15)
|
|
321
|
+
Platform.osVersion = '10.11';
|
|
322
|
+
else if (version.major === 14)
|
|
323
|
+
Platform.osVersion = '10.10';
|
|
324
|
+
else if (version.major === 13)
|
|
325
|
+
Platform.osVersion = '10.9';
|
|
326
|
+
else if (version.major >= 5 && version.major <= 12)
|
|
327
|
+
Platform.osVersion = '10.' + (version.major - 4);
|
|
328
|
+
else
|
|
329
|
+
Platform.osVersion = release;
|
|
330
|
+
break;
|
|
331
|
+
case 'android':
|
|
332
|
+
Platform.os = OS.Android;
|
|
333
|
+
Platform.osVersion = release;
|
|
334
|
+
break;
|
|
335
|
+
case 'linux':
|
|
336
|
+
if (/android/i.test(release)) {
|
|
337
|
+
Platform.os = OS.Android;
|
|
338
|
+
Platform.osVersion = release;
|
|
339
|
+
}
|
|
340
|
+
break;
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
if (navigator.userAgentData !== undefined && navigator.userAgentData.getHighEntropyValues !== undefined) {
|
|
345
|
+
navigator
|
|
346
|
+
.userAgentData
|
|
347
|
+
.getHighEntropyValues(['brands', 'fullVersionList', 'mobile', 'model', 'platform', 'platformVersion', 'architecture', 'formFactors', 'bitness', 'uaFullVersion', 'wow64'])
|
|
348
|
+
.then(function (result) {
|
|
349
|
+
var brands = result.fullVersionList || result.brands || [];
|
|
350
|
+
var platformVersion = result.platformVersion;
|
|
351
|
+
for (var i = 0; i < brands.length; i++) {
|
|
352
|
+
var brand = normalizeBrand(brands[i]);
|
|
353
|
+
var brandName = brand.brand;
|
|
354
|
+
var brandVersion = brand.version;
|
|
355
|
+
if (/not.a.brand/i.test(brandName))
|
|
356
|
+
continue;
|
|
357
|
+
if (brandName === "Chromium")
|
|
358
|
+
Platform.engineVersion = brandVersion;
|
|
359
|
+
}
|
|
360
|
+
if (typeof platformVersion === 'string') {
|
|
361
|
+
if (Platform.os === OS.Windows && parseInt(platformVersion.replace(/[^\d.]/g, '').split('.')[0], 10) >= 13)
|
|
362
|
+
Platform.osVersion = '11';
|
|
363
|
+
else
|
|
364
|
+
Platform.osVersion = platformVersion;
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
Platform.isMobile = Platform.device === Devices.Mobile;
|
|
369
|
+
Platform.isDesktop = Platform.device === Devices.Desktop;
|
|
370
|
+
Platform.isWebview = getIsWebview();
|
|
371
|
+
Platform.isStandalone = getIsStandalone(Platform.os);
|
|
213
372
|
|
|
214
373
|
var API_VARIANTS = {
|
|
215
374
|
standard: {
|
|
@@ -271,7 +430,7 @@
|
|
|
271
430
|
return null;
|
|
272
431
|
}
|
|
273
432
|
function isIOS() {
|
|
274
|
-
return OS.iOS ===
|
|
433
|
+
return OS.iOS === Platform.os;
|
|
275
434
|
}
|
|
276
435
|
function createFullscreenUtils() {
|
|
277
436
|
var api = detectApi();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).Fullscreen=n()}(this,(function(){"use strict";var e,n,r,i,t=navigator.userAgent;function o(e){if(void 0===e)return"";var n={"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10","NT 10.0":"10",ARM:"RT"}[e];return void 0!==n?n:e}function l(e){return void 0===e?"":e.replace(/_/g,".")}function u(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(e||(e={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(n||(n={})),function(e){e.Unknown="Unknown",e.EdgeHTML="EdgeHTML",e.ArkWeb="ArkWeb",e.Blink="Blink",e.Presto="Presto",e.WebKit="WebKit",e.Trident="Trident",e.NetFront="NetFront",e.KHTML="KHTML",e.Tasman="Tasman",e.Gecko="Gecko"}(r||(r={})),function(e){e.Unknown="Unknown",e.Chrome="Chrome",e.Safari="Safari",e.Edge="Edge",e.Firefox="Firefox",e.Opera="Opera",e.IE="IE",e.SamsungInternet="SamsungInternet"}(i||(i={}));var a=[[/windows nt (6\.[23]); arm/i,e.Windows,o],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,o],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,o],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,o],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,o],[/windows ce\/?([\d.]*)/i,e.Windows,o],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,l],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,l],[/cfnetwork\/.+darwin/i,e.iOS,l],[/mac os x ?([\w. ]*)/i,e.MacOS,l],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,l],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],c=[[/windows.+ edge\/([\w.]+)/i,r.EdgeHTML],[/arkweb\/([\w.]+)/i,r.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,r.Blink],[/presto\/([\w.]+)/i,r.Presto],[/webkit\/([\w.]+)/i,r.WebKit],[/trident\/([\w.]+)/i,r.Trident],[/netfront\/([\w.]+)/i,r.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,r.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,r.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,r.Gecko]],s=[[/\b(?:crmo|crios)\/([\w.]+)/i,i.Chrome],[/webview.+edge\/([\w.]+)/i,i.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,i.Edge],[/opera mini\/([-\w.]+)/i,i.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,i.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,i.Opera],[/opios[\/ ]+([\w.]+)/i,i.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,i.Opera],[/\bopr\/([\w.]+)/i,i.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,i.IE],[/(?:ms|\()ie ([\w.]+)/i,i.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,i.IE],[/\bfocus\/([\w.]+)/i,i.Firefox],[/\bopt\/([\w.]+)/i,i.Opera],[/coast\/([\w.]+)/i,i.Opera],[/fxios\/([\w.-]+)/i,i.Firefox],[/samsungbrowser\/([\w.]+)/i,i.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,i.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,i.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,i.Chrome],[/chrome\/([\w.]+) mobile/i,i.Chrome],[/chrome\/v?([\w.]+)/i,i.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,i.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,i.Safari],[/version\/([\w.,]+) .*safari/i,i.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,i.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,i.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,i.Firefox],[/firefox\/([\w.]+)/i,i.Firefox]],f=(n.Unknown,e.Unknown);r.Unknown,i.Unknown;for(var d=0;d<a.length;d++){var w=(v=a[d])[0],b=v[1],m=v[2];if(null!==(g=t.match(w))){f=b,u(g[1],m),b===e.iOS||b===e.Android?n.Mobile:b!==e.Windows&&b!==e.MacOS||n.Desktop;break}}for(d=0;d<c.length;d++){w=(v=c[d])[0];v[1];m=v[2];if(null!==(g=t.match(w))){u(g[1],m);break}}for(d=0;d<s.length;d++){var v;w=(v=s[d])[0];v[1];var g;m=v[2];if(null!==(g=t.match(w))){u(g[1],m);break}}!function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var n=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===n)return"";if(n instanceof WebGLRenderingContext||"getParameter"in n&&"function"==typeof n.getParameter){var r=n.getExtension("WEBGL_debug_renderer_info");return null===r?n.getParameter(n.RENDERER):n.getParameter(r.UNMASKED_RENDERER_WEBGL)}}(),n.Mobile,n.Desktop,"matchMedia"in globalThis&&(f===e.iOS?"standalone"in navigator&&navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches);var h={standard:{enabled:"fullscreenEnabled",element:"fullscreenElement",request:"requestFullscreen",exit:"exitFullscreen",events:{change:"fullscreenchange",error:"fullscreenerror"}},webkit:{enabled:"webkitFullscreenEnabled",element:"webkitFullscreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:{change:"webkitfullscreenchange",error:"webkitfullscreenerror"}},moz:{enabled:"mozFullScreenEnabled",element:"mozFullScreenElement",request:"mozRequestFullScreen",exit:"mozCancelFullScreen",events:{change:"mozfullscreenchange",error:"mozfullscreenerror"}},ms:{enabled:"msFullscreenEnabled",element:"msFullscreenElement",request:"msRequestFullscreen",exit:"msExitFullscreen",events:{change:"MSFullscreenChange",error:"MSFullscreenError"}}};function k(){return e.iOS===f}var E=function(){var e=function(){var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return h.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var i=n[r];if((t=h[i]).enabled in globalThis.document||t.element in globalThis.document||t.exit in globalThis.document)return"webkit"===i&&"webkitRequestFullScreen"in e&&(t.request="webkitRequestFullScreen"),t}if("webkitCurrentFullScreenElement"in globalThis.document){var t={enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:h.webkit.events};return"webkitRequestFullScreen"in e&&(t.request="webkitRequestFullScreen"),t}return null}(),n=null,r=!1;function i(){document.querySelectorAll("video").forEach((function(e){function n(){document.dispatchEvent(new Event("fullscreenchange"))}e.__fsBridged__||!("webkitEnterFullscreen"in e)&&!("onwebkitbeginfullscreen"in e)||(e.addEventListener("webkitbeginfullscreen",n,!1),e.addEventListener("webkitendfullscreen",n,!1),e.__fsBridged__=!0)}))}function t(){if(null===e)return n&&n.webkitDisplayingFullscreen?n:null;var r=document[e.element];return null!=r?r:null}function o(){return null!==t()}function l(r,t){return new Promise((function(o,l){if(null!==e){var u=r[e.request];if("function"==typeof u)try{var a=u.call(r,t);return void 0!==a&&"function"==typeof a.then?void a.then((function(){o()})).catch((function(){k()?c():l()})):void o()}catch(e){if(!k())return void l()}}function c(){if(k()&&"VIDEO"===r.tagName.toUpperCase()){var e=r;if(e.webkitSupportsFullscreen&&"function"==typeof e.webkitEnterFullscreen)return n=e,i(),e.webkitEnterFullscreen(),void o()}l()}c()}))}function u(){return new Promise((function(r,i){if(null!==e){var o=document[e.exit];if("function"==typeof o){var l=o.call(document);return void 0!==l&&"function"==typeof l.then?void l.then((function(){r()})).catch((function(){i()})):void r()}}if(k()&&null!==n){if("function"==typeof n.webkitExitFullscreen&&!0===n.webkitDisplayingFullscreen)return n.webkitExitFullscreen(),n=null,void r();for(var u=document.querySelectorAll("video"),a=0;a<u.length;a++){var c=u[a];if("function"==typeof c.webkitExitFullscreen&&!0===c.webkitDisplayingFullscreen)return c.webkitExitFullscreen(),void r()}}t()?i():r()}))}return function(){if(!r){r=!0;var e=!1;if(["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"].forEach((function(e){globalThis.document.addEventListener(e,t,!1)})),["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"].forEach((function(e){globalThis.document.addEventListener(e,o,!1)})),k())i(),new MutationObserver((function(){i()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function n(n){e||(e=!0,globalThis.document.dispatchEvent(new Event(n,{bubbles:!0,cancelable:!1})),Promise.resolve().then((function(){e=!1})))}function t(){n("fullscreenchange")}function o(){n("fullscreenerror")}}(),{get enabled(){return function(){if(null===e){if(!k())return!1;for(var n=document.querySelectorAll("video"),r=0;r<n.length;r++){var i=n[r];if(i.webkitSupportsFullscreen||"webkitEnterFullscreen"in i)return!0}return!1}var t=document[e.enabled];return"boolean"==typeof t?t:void 0!==document[e.element]}()},get element(){return t()},get isFullscreen(){return o()},request:l,exit:u,toggle:function(e,n){return o()?u():l(e,n)},onChange:function(e){var n=[];return function(r){function i(n){e(n)}document.addEventListener(r,i,!1),n.push((function(){document.removeEventListener(r,i,!1)}))}("fullscreenchange"),function(){n.forEach((function(e){e()}))}},onError:function(e){var n=[];return function(r){function i(n){e(n)}document.addEventListener(r,i,!1),n.push((function(){document.removeEventListener(r,i,!1)}))}("fullscreenerror"),function(){n.forEach((function(e){e()}))}}}}();return{installed:!1,name:"Fullscreen",module:E,Constants:{},Errors:{}}}));
|
|
1
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).Fullscreen=n()}(this,(function(){"use strict";var e,n,r,i;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(e||(e={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(n||(n={})),function(e){e.Unknown="Unknown",e.EdgeHTML="EdgeHTML",e.ArkWeb="ArkWeb",e.Blink="Blink",e.Presto="Presto",e.WebKit="WebKit",e.Trident="Trident",e.NetFront="NetFront",e.KHTML="KHTML",e.Tasman="Tasman",e.Gecko="Gecko"}(r||(r={})),function(e){e.Unknown="Unknown",e.Chrome="Chrome",e.Safari="Safari",e.Edge="Edge",e.Firefox="Firefox",e.Opera="Opera",e.IE="IE",e.SamsungInternet="SamsungInternet"}(i||(i={}));var o={device:n.Unknown,os:e.Unknown,osVersion:"",engine:r.Unknown,engineVersion:"",browser:i.Unknown,browserVersion:"",renderer:function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var n=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===n)return"";if(n instanceof WebGLRenderingContext||"getParameter"in n&&"function"==typeof n.getParameter){var r=n.getExtension("WEBGL_debug_renderer_info");return null===r?n.getParameter(n.RENDERER):n.getParameter(r.UNMASKED_RENDERER_WEBGL)}return""}(),userAgent:navigator.userAgent,isWebview:!1,isMobile:!1,isDesktop:!1,isStandalone:!1,isNodeJS:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node},t=[[/windows nt (6\.[23]); arm/i,e.Windows,a],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,a],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,a],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,a],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,a],[/windows ce\/?([\d.]*)/i,e.Windows,a],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,u],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,u],[/cfnetwork\/.+darwin/i,e.iOS,u],[/mac os x ?([\w. ]*)/i,e.MacOS,u],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,u],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],l=[[/windows.+ edge\/([\w.]+)/i,r.EdgeHTML],[/arkweb\/([\w.]+)/i,r.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,r.Blink],[/presto\/([\w.]+)/i,r.Presto],[/webkit\/([\w.]+)/i,r.WebKit],[/trident\/([\w.]+)/i,r.Trident],[/netfront\/([\w.]+)/i,r.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,r.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,r.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,r.Gecko]],s=[[/\b(?:crmo|crios)\/([\w.]+)/i,i.Chrome],[/webview.+edge\/([\w.]+)/i,i.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,i.Edge],[/opera mini\/([-\w.]+)/i,i.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,i.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,i.Opera],[/opios[\/ ]+([\w.]+)/i,i.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,i.Opera],[/\bopr\/([\w.]+)/i,i.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,i.IE],[/(?:ms|\()ie ([\w.]+)/i,i.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,i.IE],[/\bfocus\/([\w.]+)/i,i.Firefox],[/\bopt\/([\w.]+)/i,i.Opera],[/coast\/([\w.]+)/i,i.Opera],[/fxios\/([\w.-]+)/i,i.Firefox],[/samsungbrowser\/([\w.]+)/i,i.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,i.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,i.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,i.Chrome],[/chrome\/([\w.]+) mobile/i,i.Chrome],[/chrome\/v?([\w.]+)/i,i.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,i.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,i.Safari],[/version\/([\w.,]+) .*safari/i,i.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,i.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,i.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,i.Firefox],[/firefox\/([\w.]+)/i,i.Firefox]];function a(e){if(void 0===e)return"";var n={"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10","NT 10.0":"10",ARM:"RT"}[e];return void 0!==n?n:e}function u(e){return void 0===e?"":e.replace(/_/g,".")}function c(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}for(var d=0;d<t.length;d++){var f=(v=t[d])[0],m=v[1],b=v[2];if(null!==(g=o.userAgent.match(f))){o.os=m,o.osVersion=c(g[1],b),m===e.iOS||m===e.Android?o.device=n.Mobile:m!==e.Windows&&m!==e.MacOS||(o.device=n.Desktop);break}}for(d=0;d<l.length;d++){f=(v=l[d])[0];var w=v[1];b=v[2];if(null!==(g=o.userAgent.match(f))){o.engine=w,o.engineVersion=c(g[1],b);break}}for(d=0;d<s.length;d++){f=(v=s[d])[0];var v,g,h=v[1];b=v[2];if(null!==(g=o.userAgent.match(f))){o.browser=h,o.browserVersion=c(g[1],b);break}}o.isNodeJS&&function(e){if("require"in globalThis&&"function"==typeof globalThis.require)try{return Promise.resolve(globalThis.require(e))}catch(e){return Promise.resolve(null)}return import(e).then((function(e){return e.default||e})).catch((function(){return Promise.resolve(null)}))}("os").then((function(n){if(null!==n){var r,i=n.platform(),t=n.release(),l=(r=t.split("."),{major:parseInt(r[0]||"0"),minor:parseInt(r[1]||"0"),build:parseInt(r[2]||"0")});switch(i){case"win32":o.os=e.Windows,o.osVersion=10===l.major&&0===l.minor&&l.build>=22e3?"11":10===l.major&&0===l.minor&&l.build<22e3?"10":6===l.major&&3===l.minor?"8.1":6===l.major&&2===l.minor?"8":6===l.major&&1===l.minor?"7":6===l.major&&0===l.minor?"Vista":5===l.major&&1===l.minor||5===l.major&&2===l.minor?"XP":5===l.major&&0===l.minor?"2000":4===l.major&&90===l.minor?"ME":4===l.major&&0===l.minor?"NT 4.0":3===l.major&&51===l.minor?"NT 3.11":t;break;case"darwin":o.os=e.MacOS,o.osVersion=l.major>=24?""+(l.major-9):23===l.major?"14":22===l.major?"13":21===l.major?"12":20===l.major?"11":19===l.major?"10.15":18===l.major?"10.14":17===l.major?"10.13":16===l.major?"10.12":15===l.major?"10.11":14===l.major?"10.10":13===l.major?"10.9":l.major>=5&&l.major<=12?"10."+(l.major-4):t;break;case"android":o.os=e.Android,o.osVersion=t;break;case"linux":/android/i.test(t)&&(o.os=e.Android,o.osVersion=t)}}})),void 0!==navigator.userAgentData&&void 0!==navigator.userAgentData.getHighEntropyValues&&navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(n){for(var r,i=n.fullVersionList||n.brands||[],t=n.platformVersion,l=0;l<i.length;l++){var s=null==(r=i[l])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},a=s.brand,u=s.version;/not.a.brand/i.test(a)||"Chromium"===a&&(o.engineVersion=u)}"string"==typeof t&&(o.os===e.Windows&&parseInt(t.replace(/[^\d.]/g,"").split(".")[0],10)>=13?o.osVersion="11":o.osVersion=t)})),o.isMobile=o.device===n.Mobile,o.isDesktop=o.device===n.Desktop,o.isWebview=/; ?wv|applewebkit(?!.*safari)/i.test(o.userAgent),o.isStandalone=function(n){return"matchMedia"in globalThis&&(n===e.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(o.os);var p={standard:{enabled:"fullscreenEnabled",element:"fullscreenElement",request:"requestFullscreen",exit:"exitFullscreen",events:{change:"fullscreenchange",error:"fullscreenerror"}},webkit:{enabled:"webkitFullscreenEnabled",element:"webkitFullscreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:{change:"webkitfullscreenchange",error:"webkitfullscreenerror"}},moz:{enabled:"mozFullScreenEnabled",element:"mozFullScreenElement",request:"mozRequestFullScreen",exit:"mozCancelFullScreen",events:{change:"mozfullscreenchange",error:"mozfullscreenerror"}},ms:{enabled:"msFullscreenEnabled",element:"msFullscreenElement",request:"msRequestFullscreen",exit:"msExitFullscreen",events:{change:"MSFullscreenChange",error:"MSFullscreenError"}}};function k(){return e.iOS===o.os}var E=function(){var e=function(){var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return p.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var i=n[r];if((o=p[i]).enabled in globalThis.document||o.element in globalThis.document||o.exit in globalThis.document)return"webkit"===i&&"webkitRequestFullScreen"in e&&(o.request="webkitRequestFullScreen"),o}if("webkitCurrentFullScreenElement"in globalThis.document){var o={enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:p.webkit.events};return"webkitRequestFullScreen"in e&&(o.request="webkitRequestFullScreen"),o}return null}(),n=null,r=!1;function i(){document.querySelectorAll("video").forEach((function(e){function n(){document.dispatchEvent(new Event("fullscreenchange"))}e.__fsBridged__||!("webkitEnterFullscreen"in e)&&!("onwebkitbeginfullscreen"in e)||(e.addEventListener("webkitbeginfullscreen",n,!1),e.addEventListener("webkitendfullscreen",n,!1),e.__fsBridged__=!0)}))}function o(){if(null===e)return n&&n.webkitDisplayingFullscreen?n:null;var r=document[e.element];return null!=r?r:null}function t(){return null!==o()}function l(r,o){return new Promise((function(t,l){if(null!==e){var s=r[e.request];if("function"==typeof s)try{var a=s.call(r,o);return void 0!==a&&"function"==typeof a.then?void a.then((function(){t()})).catch((function(){k()?u():l()})):void t()}catch(e){if(!k())return void l()}}function u(){if(k()&&"VIDEO"===r.tagName.toUpperCase()){var e=r;if(e.webkitSupportsFullscreen&&"function"==typeof e.webkitEnterFullscreen)return n=e,i(),e.webkitEnterFullscreen(),void t()}l()}u()}))}function s(){return new Promise((function(r,i){if(null!==e){var t=document[e.exit];if("function"==typeof t){var l=t.call(document);return void 0!==l&&"function"==typeof l.then?void l.then((function(){r()})).catch((function(){i()})):void r()}}if(k()&&null!==n){if("function"==typeof n.webkitExitFullscreen&&!0===n.webkitDisplayingFullscreen)return n.webkitExitFullscreen(),n=null,void r();for(var s=document.querySelectorAll("video"),a=0;a<s.length;a++){var u=s[a];if("function"==typeof u.webkitExitFullscreen&&!0===u.webkitDisplayingFullscreen)return u.webkitExitFullscreen(),void r()}}o()?i():r()}))}return function(){if(!r){r=!0;var e=!1;if(["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"].forEach((function(e){globalThis.document.addEventListener(e,o,!1)})),["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"].forEach((function(e){globalThis.document.addEventListener(e,t,!1)})),k())i(),new MutationObserver((function(){i()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function n(n){e||(e=!0,globalThis.document.dispatchEvent(new Event(n,{bubbles:!0,cancelable:!1})),Promise.resolve().then((function(){e=!1})))}function o(){n("fullscreenchange")}function t(){n("fullscreenerror")}}(),{get enabled(){return function(){if(null===e){if(!k())return!1;for(var n=document.querySelectorAll("video"),r=0;r<n.length;r++){var i=n[r];if(i.webkitSupportsFullscreen||"webkitEnterFullscreen"in i)return!0}return!1}var o=document[e.enabled];return"boolean"==typeof o?o:void 0!==document[e.element]}()},get element(){return o()},get isFullscreen(){return t()},request:l,exit:s,toggle:function(e,n){return t()?s():l(e,n)},onChange:function(e){var n=[];return function(r){function i(n){e(n)}document.addEventListener(r,i,!1),n.push((function(){document.removeEventListener(r,i,!1)}))}("fullscreenchange"),function(){n.forEach((function(e){e()}))}},onError:function(e){var n=[];return function(r){function i(n){e(n)}document.addEventListener(r,i,!1),n.push((function(){document.removeEventListener(r,i,!1)}))}("fullscreenerror"),function(){n.forEach((function(e){e()}))}}}}();return{installed:!1,name:"Fullscreen",module:E,Constants:{},Errors:{}}}));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PlatformInstance } from "../types/platform";
|
|
1
2
|
declare global {
|
|
2
3
|
interface Navigator {
|
|
3
4
|
userAgentData?: UserAgentData;
|
|
@@ -51,16 +52,5 @@ export declare enum Browsers {
|
|
|
51
52
|
IE = "IE",
|
|
52
53
|
SamsungInternet = "SamsungInternet"
|
|
53
54
|
}
|
|
54
|
-
|
|
55
|
-
export
|
|
56
|
-
export declare let OS_VERSION: string;
|
|
57
|
-
export declare let ENGINE_NAME: Engines;
|
|
58
|
-
export declare let ENGINE_VERSION: string;
|
|
59
|
-
export declare let BROWSER_NAME: Browsers;
|
|
60
|
-
export declare let BROWSER_VERSION: string;
|
|
61
|
-
export declare const RENDERER: string;
|
|
62
|
-
export declare const IS_WEBVIEW: boolean;
|
|
63
|
-
export declare const IS_MOBILE: boolean;
|
|
64
|
-
export declare const IS_DESKTOP: boolean;
|
|
65
|
-
export declare const IS_STANDALONE: boolean;
|
|
66
|
-
export {};
|
|
55
|
+
declare const Platform: PlatformInstance;
|
|
56
|
+
export default Platform;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Browsers, Devices, Engines, OS } from "../constants/platform";
|
|
2
|
+
export declare interface PlatformInstance {
|
|
3
|
+
os: OS;
|
|
4
|
+
device: Devices;
|
|
5
|
+
engine: Engines;
|
|
6
|
+
browser: Browsers;
|
|
7
|
+
osVersion: string;
|
|
8
|
+
engineVersion: string;
|
|
9
|
+
browserVersion: string;
|
|
10
|
+
renderer: string;
|
|
11
|
+
userAgent: string;
|
|
12
|
+
isWebview: boolean;
|
|
13
|
+
isStandalone: boolean;
|
|
14
|
+
isMobile: boolean;
|
|
15
|
+
isDesktop: boolean;
|
|
16
|
+
isNodeJS: boolean;
|
|
17
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function createHiddenElement<K extends keyof HTMLElementTagNameMap>(tagName: K, focusable?: boolean): HTMLElementTagNameMap[K];
|
|
1
|
+
export default function createHiddenElement<K extends keyof HTMLElementTagNameMap>(tagName: K, focusable?: boolean): HTMLElementTagNameMap[K] | undefined;
|