native-fn 1.0.71 → 1.0.73
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 +2 -507
- package/dist/native.min.cjs +1 -1
- package/dist/native.min.mjs +1 -1
- package/dist/native.mjs +2 -507
- package/dist/native.umd.js +2 -507
- package/dist/native.umd.min.js +1 -1
- package/dist/plugin/app/index.cjs +435 -423
- package/dist/plugin/app/index.d.ts +8 -33
- package/dist/plugin/app/index.min.cjs +1 -1
- package/dist/plugin/app/index.min.mjs +1 -1
- package/dist/plugin/app/index.mjs +435 -423
- package/dist/plugin/app/index.umd.js +435 -423
- package/dist/plugin/app/index.umd.min.js +1 -1
- package/dist/plugin/app/src/plugin/app/cores/index.d.ts +0 -4
- package/dist/plugin/app/src/plugin/app/types/app.d.ts +1 -1
- package/dist/plugin/app/src/plugin/camera/cores/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
- package/dist/plugin/app/src/plugin/platform/constants/index.d.ts +42 -0
- package/dist/plugin/app/src/plugin/platform/cores/index.d.ts +28 -0
- package/dist/plugin/app/src/plugin/platform/index.d.ts +3 -2
- package/dist/plugin/app/src/plugin/platform/types/index.d.ts +4 -0
- package/dist/plugin/app/src/plugin/platform/types/platform.d.ts +5 -2
- package/dist/plugin/app/src/plugin/theme/constants/index.d.ts +0 -12
- package/dist/plugin/app/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/theme/index.d.ts +1 -13
- package/dist/plugin/app/src/plugin/theme/types/index.d.ts +0 -12
- package/dist/plugin/app/src/plugin/theme/types/theme.d.ts +2 -22
- package/dist/plugin/appearance/index.cjs +30 -16
- package/dist/plugin/appearance/index.min.cjs +1 -1
- package/dist/plugin/appearance/index.min.mjs +1 -1
- package/dist/plugin/appearance/index.mjs +30 -16
- package/dist/plugin/appearance/index.umd.js +30 -16
- package/dist/plugin/appearance/index.umd.min.js +1 -1
- package/dist/plugin/appearance/src/plugin/app/cores/index.d.ts +0 -4
- package/dist/plugin/appearance/src/plugin/app/types/app.d.ts +1 -1
- package/dist/plugin/appearance/src/plugin/camera/cores/index.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
- package/dist/plugin/appearance/src/plugin/platform/constants/index.d.ts +42 -0
- package/dist/plugin/appearance/src/plugin/platform/cores/index.d.ts +28 -0
- package/dist/plugin/appearance/src/plugin/platform/index.d.ts +12 -0
- package/dist/plugin/appearance/src/plugin/platform/types/index.d.ts +11 -0
- package/dist/plugin/appearance/src/plugin/platform/types/platform.d.ts +18 -0
- package/dist/plugin/appearance/src/plugin/theme/constants/index.d.ts +0 -12
- package/dist/plugin/appearance/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/theme/index.d.ts +1 -13
- package/dist/plugin/appearance/src/plugin/theme/types/index.d.ts +0 -12
- package/dist/plugin/appearance/src/plugin/theme/types/theme.d.ts +2 -22
- package/dist/plugin/camera/index.cjs +118 -109
- package/dist/plugin/camera/index.min.cjs +1 -1
- package/dist/plugin/camera/index.min.mjs +1 -1
- package/dist/plugin/camera/index.mjs +118 -109
- package/dist/plugin/camera/index.umd.js +118 -109
- package/dist/plugin/camera/index.umd.min.js +1 -1
- package/dist/plugin/camera/src/plugin/app/cores/index.d.ts +0 -4
- package/dist/plugin/camera/src/plugin/app/types/app.d.ts +1 -1
- package/dist/plugin/camera/src/plugin/camera/cores/index.d.ts +2 -2
- package/dist/plugin/camera/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/plugin/camera/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/plugin/camera/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
- package/dist/plugin/camera/src/plugin/platform/constants/index.d.ts +42 -0
- package/dist/plugin/camera/src/plugin/platform/cores/index.d.ts +28 -0
- package/dist/plugin/camera/src/plugin/platform/index.d.ts +3 -2
- package/dist/plugin/camera/src/plugin/platform/types/index.d.ts +4 -0
- package/dist/plugin/camera/src/plugin/platform/types/platform.d.ts +5 -2
- package/dist/plugin/camera/src/plugin/theme/constants/index.d.ts +0 -12
- package/dist/plugin/camera/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/plugin/camera/src/plugin/theme/index.d.ts +1 -13
- package/dist/plugin/camera/src/plugin/theme/types/index.d.ts +0 -12
- package/dist/plugin/camera/src/plugin/theme/types/theme.d.ts +2 -22
- package/dist/plugin/clipboard/index.cjs +226 -212
- package/dist/plugin/clipboard/index.min.cjs +1 -1
- package/dist/plugin/clipboard/index.min.mjs +1 -1
- package/dist/plugin/clipboard/index.mjs +226 -212
- package/dist/plugin/clipboard/index.umd.js +226 -212
- package/dist/plugin/clipboard/index.umd.min.js +1 -1
- package/dist/plugin/clipboard/src/plugin/app/cores/index.d.ts +0 -4
- package/dist/plugin/clipboard/src/plugin/app/types/app.d.ts +1 -1
- package/dist/plugin/clipboard/src/plugin/camera/cores/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
- package/dist/plugin/clipboard/src/plugin/platform/constants/index.d.ts +42 -0
- package/dist/plugin/clipboard/src/plugin/platform/cores/index.d.ts +28 -0
- package/dist/plugin/clipboard/src/plugin/platform/index.d.ts +3 -2
- package/dist/plugin/clipboard/src/plugin/platform/types/index.d.ts +4 -0
- package/dist/plugin/clipboard/src/plugin/platform/types/platform.d.ts +5 -2
- package/dist/plugin/clipboard/src/plugin/theme/constants/index.d.ts +0 -12
- package/dist/plugin/clipboard/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/theme/index.d.ts +1 -13
- package/dist/plugin/clipboard/src/plugin/theme/types/index.d.ts +0 -12
- package/dist/plugin/clipboard/src/plugin/theme/types/theme.d.ts +2 -22
- package/dist/plugin/fullscreen/index.cjs +34 -20
- package/dist/plugin/fullscreen/index.d.ts +4 -13
- package/dist/plugin/fullscreen/index.min.cjs +1 -1
- package/dist/plugin/fullscreen/index.min.mjs +1 -1
- package/dist/plugin/fullscreen/index.mjs +34 -20
- package/dist/plugin/fullscreen/index.umd.js +34 -20
- package/dist/plugin/fullscreen/index.umd.min.js +1 -1
- package/dist/plugin/fullscreen/src/plugin/app/cores/index.d.ts +0 -4
- package/dist/plugin/fullscreen/src/plugin/app/types/app.d.ts +1 -1
- package/dist/plugin/fullscreen/src/plugin/camera/cores/index.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
- package/dist/plugin/fullscreen/src/plugin/platform/constants/index.d.ts +42 -0
- package/dist/plugin/fullscreen/src/plugin/platform/cores/index.d.ts +28 -0
- package/dist/plugin/fullscreen/src/plugin/platform/index.d.ts +3 -2
- package/dist/plugin/fullscreen/src/plugin/platform/types/index.d.ts +4 -0
- package/dist/plugin/fullscreen/src/plugin/platform/types/platform.d.ts +5 -2
- package/dist/plugin/fullscreen/src/plugin/theme/constants/index.d.ts +0 -12
- package/dist/plugin/fullscreen/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/theme/index.d.ts +1 -13
- package/dist/plugin/fullscreen/src/plugin/theme/types/index.d.ts +0 -12
- package/dist/plugin/fullscreen/src/plugin/theme/types/theme.d.ts +2 -22
- package/dist/plugin/platform/index.cjs +356 -109
- package/dist/plugin/platform/index.d.ts +15 -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 +356 -109
- package/dist/plugin/platform/index.umd.js +356 -109
- package/dist/plugin/platform/index.umd.min.js +1 -1
- package/dist/plugin/platform/src/plugin/app/constants/index.d.ts +12 -0
- package/dist/plugin/platform/src/plugin/app/cores/index.d.ts +13 -0
- package/dist/plugin/platform/src/plugin/app/index.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/app/types/app.d.ts +11 -2
- package/dist/plugin/platform/src/plugin/app/types/index.d.ts +2 -2
- package/dist/plugin/platform/src/plugin/appearance/constants/index.d.ts +11 -0
- package/dist/plugin/platform/src/plugin/appearance/cores/index.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/appearance/index.d.ts +8 -0
- package/dist/plugin/platform/src/plugin/appearance/types/appearance.d.ts +12 -0
- package/dist/plugin/platform/src/plugin/appearance/types/index.d.ts +13 -0
- package/dist/plugin/platform/src/plugin/camera/constants/inedx.d.ts +4 -0
- package/dist/plugin/platform/src/plugin/camera/cores/index.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/camera/index.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/camera/types/camera.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/camera/types/index.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/camera/utils/try-open-camera.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/clipboard/cores/index.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/fullscreen/cores/index.d.ts +35 -0
- package/dist/plugin/platform/src/plugin/fullscreen/types/fullscreen.d.ts +5 -5
- package/dist/plugin/platform/src/plugin/platform/constants/index.d.ts +42 -0
- package/dist/plugin/platform/src/plugin/platform/cores/index.d.ts +28 -0
- package/dist/plugin/platform/src/plugin/platform/index.d.ts +3 -2
- package/dist/plugin/platform/src/plugin/platform/types/index.d.ts +4 -0
- package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +5 -2
- package/dist/plugin/platform/src/plugin/theme/constants/index.d.ts +2 -0
- package/dist/plugin/platform/src/plugin/theme/cores/index.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/theme/index.d.ts +1 -13
- package/dist/plugin/platform/src/plugin/theme/types/index.d.ts +0 -12
- package/dist/plugin/platform/src/plugin/theme/types/theme.d.ts +2 -21
- package/dist/plugin/platform/src/utils/create-hidden-element.d.ts +1 -1
- package/dist/plugin/theme/index.cjs +63 -906
- package/dist/plugin/theme/index.d.ts +4 -87
- package/dist/plugin/theme/index.min.cjs +1 -1
- package/dist/plugin/theme/index.min.mjs +1 -1
- package/dist/plugin/theme/index.mjs +63 -906
- package/dist/plugin/theme/index.umd.js +63 -906
- package/dist/plugin/theme/index.umd.min.js +1 -1
- package/dist/plugin/theme/src/plugin/app/cores/index.d.ts +0 -4
- package/dist/plugin/theme/src/plugin/app/types/app.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/camera/cores/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
- package/dist/plugin/theme/src/plugin/platform/constants/index.d.ts +42 -0
- package/dist/plugin/theme/src/plugin/platform/cores/index.d.ts +28 -0
- package/dist/plugin/theme/src/plugin/platform/index.d.ts +3 -2
- package/dist/plugin/theme/src/plugin/platform/types/index.d.ts +4 -0
- package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +5 -2
- package/dist/plugin/theme/src/plugin/theme/constants/index.d.ts +0 -12
- package/dist/plugin/theme/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/theme/index.d.ts +1 -13
- package/dist/plugin/theme/src/plugin/theme/types/index.d.ts +0 -12
- package/dist/plugin/theme/src/plugin/theme/types/theme.d.ts +2 -22
- package/dist/src/plugin/app/cores/index.d.ts +0 -4
- package/dist/src/plugin/app/types/app.d.ts +1 -1
- package/dist/src/plugin/camera/cores/index.d.ts +2 -2
- package/dist/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
- package/dist/src/plugin/platform/constants/index.d.ts +42 -0
- package/dist/src/plugin/platform/cores/index.d.ts +28 -0
- package/dist/src/plugin/platform/index.d.ts +3 -2
- package/dist/src/plugin/platform/types/index.d.ts +4 -0
- package/dist/src/plugin/platform/types/platform.d.ts +5 -2
- package/dist/src/plugin/theme/constants/index.d.ts +0 -12
- package/dist/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/src/plugin/theme/index.d.ts +1 -13
- package/dist/src/plugin/theme/types/index.d.ts +0 -12
- package/dist/src/plugin/theme/types/theme.d.ts +2 -22
- package/package.json +1 -1
|
@@ -60,24 +60,31 @@ var Browsers;
|
|
|
60
60
|
Browsers["IE"] = "IE";
|
|
61
61
|
Browsers["SamsungInternet"] = "SamsungInternet";
|
|
62
62
|
})(Browsers || (Browsers = {}));
|
|
63
|
-
var
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
var CrossPlatformFramework;
|
|
64
|
+
(function (CrossPlatformFramework) {
|
|
65
|
+
CrossPlatformFramework["NotACrossPlatformFramework"] = "NotACrossPlatformFramework";
|
|
66
|
+
CrossPlatformFramework["ReactNative"] = "ReactNative";
|
|
67
|
+
CrossPlatformFramework["Electron"] = "Electron";
|
|
68
|
+
CrossPlatformFramework["Cordova"] = "Cordova";
|
|
69
|
+
})(CrossPlatformFramework || (CrossPlatformFramework = {}));
|
|
70
|
+
var USER_AGENT = typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgent === 'string' ? globalThis.navigator.userAgent : '';
|
|
71
|
+
|
|
67
72
|
var Platform = {
|
|
68
73
|
device: Devices.Unknown,
|
|
69
74
|
os: OS.Unknown,
|
|
70
|
-
osVersion: '',
|
|
71
75
|
engine: Engines.Unknown,
|
|
72
|
-
engineVersion: '',
|
|
73
76
|
browser: Browsers.Unknown,
|
|
77
|
+
crossPlatformFramework: CrossPlatformFramework.NotACrossPlatformFramework,
|
|
78
|
+
osVersion: '',
|
|
79
|
+
engineVersion: '',
|
|
74
80
|
browserVersion: '',
|
|
75
81
|
renderer: getRenderer(),
|
|
76
|
-
userAgent:
|
|
82
|
+
userAgent: USER_AGENT,
|
|
83
|
+
isNode: typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined,
|
|
77
84
|
isMobile: false,
|
|
78
85
|
isDesktop: false,
|
|
79
86
|
isStandalone: false,
|
|
80
|
-
isWebview: /; ?wv|applewebkit(?!.*safari)/i.test(
|
|
87
|
+
isWebview: /; ?wv|applewebkit(?!.*safari)/i.test(USER_AGENT),
|
|
81
88
|
};
|
|
82
89
|
var OS_RESOLVER_MAP = [
|
|
83
90
|
[/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
|
|
@@ -346,6 +353,12 @@ function getSemanticVersion(string) {
|
|
|
346
353
|
build: parseInt(parts[2] || '0')
|
|
347
354
|
};
|
|
348
355
|
}
|
|
356
|
+
if ((typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(USER_AGENT))) {
|
|
357
|
+
Platform.crossPlatformFramework = CrossPlatformFramework.Electron;
|
|
358
|
+
}
|
|
359
|
+
if (typeof globalThis.navigator !== 'undefined' && globalThis.navigator.product === 'ReactNative') {
|
|
360
|
+
Platform.crossPlatformFramework = CrossPlatformFramework.ReactNative;
|
|
361
|
+
}
|
|
349
362
|
for (var i = 0; i < OS_RESOLVER_MAP.length; i++) {
|
|
350
363
|
var map = OS_RESOLVER_MAP[i];
|
|
351
364
|
var regexp = map[0];
|
|
@@ -387,7 +400,7 @@ for (var i = 0; i < BROWSER_RESOLVER_MAP.length; i++) {
|
|
|
387
400
|
break;
|
|
388
401
|
}
|
|
389
402
|
}
|
|
390
|
-
if (
|
|
403
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative) {
|
|
391
404
|
try {
|
|
392
405
|
var reactNative = require('react-native');
|
|
393
406
|
var platform = reactNative.Platform;
|
|
@@ -416,7 +429,7 @@ if (IS_REACT_NATIVE) {
|
|
|
416
429
|
catch (_) {
|
|
417
430
|
}
|
|
418
431
|
}
|
|
419
|
-
if (
|
|
432
|
+
if (Platform.isNode) {
|
|
420
433
|
try {
|
|
421
434
|
var os = require('os');
|
|
422
435
|
var platform = os.platform();
|
|
@@ -448,6 +461,7 @@ if (IS_NODE_JS) {
|
|
|
448
461
|
}
|
|
449
462
|
if (typeof globalThis.document !== 'undefined') {
|
|
450
463
|
globalThis.document.addEventListener("deviceready", function () {
|
|
464
|
+
Platform.crossPlatformFramework = CrossPlatformFramework.Cordova;
|
|
451
465
|
if (Platform.os === OS.Unknown && typeof globalThis.device !== 'undefined') {
|
|
452
466
|
switch (globalThis.device.platform) {
|
|
453
467
|
case 'Android':
|
|
@@ -490,7 +504,7 @@ Platform.isMobile = Platform.device === Devices.Mobile;
|
|
|
490
504
|
Platform.isDesktop = Platform.device === Devices.Desktop;
|
|
491
505
|
Platform.isStandalone = getIsStandalone(Platform.os);
|
|
492
506
|
|
|
493
|
-
var
|
|
507
|
+
var Fullscreen = {
|
|
494
508
|
get enabled() {
|
|
495
509
|
return getEnabled();
|
|
496
510
|
},
|
|
@@ -542,7 +556,7 @@ var API_VARIANTS = {
|
|
|
542
556
|
},
|
|
543
557
|
};
|
|
544
558
|
function detectApi() {
|
|
545
|
-
if (
|
|
559
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron)
|
|
546
560
|
return null;
|
|
547
561
|
var element = globalThis.document.documentElement;
|
|
548
562
|
if ('fullscreenEnabled' in globalThis.document || 'exitFullscreen' in globalThis.document) {
|
|
@@ -573,7 +587,7 @@ function detectApi() {
|
|
|
573
587
|
return null;
|
|
574
588
|
}
|
|
575
589
|
function getDefaultTarget() {
|
|
576
|
-
if (
|
|
590
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron) {
|
|
577
591
|
var electron = require('electron');
|
|
578
592
|
var focusedWindow = electron.BrowserWindow.getFocusedWindow();
|
|
579
593
|
if (focusedWindow !== null)
|
|
@@ -583,7 +597,7 @@ function getDefaultTarget() {
|
|
|
583
597
|
throw new Error();
|
|
584
598
|
return allWindows[0];
|
|
585
599
|
}
|
|
586
|
-
if (
|
|
600
|
+
if (Platform.os === OS.iOS) {
|
|
587
601
|
var video = globalThis.document.querySelector('video');
|
|
588
602
|
if (video === null)
|
|
589
603
|
throw new Error();
|
|
@@ -620,7 +634,7 @@ function bridgeEvents() {
|
|
|
620
634
|
function emitError() {
|
|
621
635
|
emit('fullscreenerror');
|
|
622
636
|
}
|
|
623
|
-
if (
|
|
637
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron) {
|
|
624
638
|
try {
|
|
625
639
|
var electron = require('electron');
|
|
626
640
|
var allWindows = electron.BrowserWindow.getAllWindows();
|
|
@@ -690,7 +704,7 @@ function bridgeIOSVideoEvents() {
|
|
|
690
704
|
}
|
|
691
705
|
}
|
|
692
706
|
function getEnabled() {
|
|
693
|
-
if (
|
|
707
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron) {
|
|
694
708
|
try {
|
|
695
709
|
var electron = require('electron');
|
|
696
710
|
return typeof electron.BrowserWindow.prototype.setFullScreen === 'function';
|
|
@@ -716,7 +730,7 @@ function getEnabled() {
|
|
|
716
730
|
return typeof globalThis.document[api.element] !== 'undefined';
|
|
717
731
|
}
|
|
718
732
|
function getElement() {
|
|
719
|
-
if (
|
|
733
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron) {
|
|
720
734
|
if (lastElectronBrowserWindow !== null)
|
|
721
735
|
return lastElectronBrowserWindow;
|
|
722
736
|
try {
|
|
@@ -748,7 +762,7 @@ function getIsFullscreen() {
|
|
|
748
762
|
}
|
|
749
763
|
function request(target, options) {
|
|
750
764
|
if (target === void 0) { target = getDefaultTarget(); }
|
|
751
|
-
if (
|
|
765
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron) {
|
|
752
766
|
var browserWindow_1 = target;
|
|
753
767
|
return new Promise(function (resolve, reject) {
|
|
754
768
|
try {
|
|
@@ -820,7 +834,7 @@ function request(target, options) {
|
|
|
820
834
|
});
|
|
821
835
|
}
|
|
822
836
|
function exit() {
|
|
823
|
-
if (
|
|
837
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron) {
|
|
824
838
|
return new Promise(function (resolve, reject) {
|
|
825
839
|
try {
|
|
826
840
|
if (lastElectronBrowserWindow !== null) {
|
|
@@ -935,7 +949,7 @@ bridgeEvents();
|
|
|
935
949
|
var NativeFullscreenPlugin = {
|
|
936
950
|
installed: false,
|
|
937
951
|
name: 'Fullscreen',
|
|
938
|
-
module:
|
|
952
|
+
module: Fullscreen,
|
|
939
953
|
Constants: {},
|
|
940
954
|
Errors: {}
|
|
941
955
|
};
|
|
@@ -66,24 +66,31 @@
|
|
|
66
66
|
Browsers["IE"] = "IE";
|
|
67
67
|
Browsers["SamsungInternet"] = "SamsungInternet";
|
|
68
68
|
})(Browsers || (Browsers = {}));
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
var CrossPlatformFramework;
|
|
70
|
+
(function (CrossPlatformFramework) {
|
|
71
|
+
CrossPlatformFramework["NotACrossPlatformFramework"] = "NotACrossPlatformFramework";
|
|
72
|
+
CrossPlatformFramework["ReactNative"] = "ReactNative";
|
|
73
|
+
CrossPlatformFramework["Electron"] = "Electron";
|
|
74
|
+
CrossPlatformFramework["Cordova"] = "Cordova";
|
|
75
|
+
})(CrossPlatformFramework || (CrossPlatformFramework = {}));
|
|
76
|
+
var USER_AGENT = typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgent === 'string' ? globalThis.navigator.userAgent : '';
|
|
77
|
+
|
|
73
78
|
var Platform = {
|
|
74
79
|
device: Devices.Unknown,
|
|
75
80
|
os: OS.Unknown,
|
|
76
|
-
osVersion: '',
|
|
77
81
|
engine: Engines.Unknown,
|
|
78
|
-
engineVersion: '',
|
|
79
82
|
browser: Browsers.Unknown,
|
|
83
|
+
crossPlatformFramework: CrossPlatformFramework.NotACrossPlatformFramework,
|
|
84
|
+
osVersion: '',
|
|
85
|
+
engineVersion: '',
|
|
80
86
|
browserVersion: '',
|
|
81
87
|
renderer: getRenderer(),
|
|
82
|
-
userAgent:
|
|
88
|
+
userAgent: USER_AGENT,
|
|
89
|
+
isNode: typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined,
|
|
83
90
|
isMobile: false,
|
|
84
91
|
isDesktop: false,
|
|
85
92
|
isStandalone: false,
|
|
86
|
-
isWebview: /; ?wv|applewebkit(?!.*safari)/i.test(
|
|
93
|
+
isWebview: /; ?wv|applewebkit(?!.*safari)/i.test(USER_AGENT),
|
|
87
94
|
};
|
|
88
95
|
var OS_RESOLVER_MAP = [
|
|
89
96
|
[/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
|
|
@@ -352,6 +359,12 @@
|
|
|
352
359
|
build: parseInt(parts[2] || '0')
|
|
353
360
|
};
|
|
354
361
|
}
|
|
362
|
+
if ((typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(USER_AGENT))) {
|
|
363
|
+
Platform.crossPlatformFramework = CrossPlatformFramework.Electron;
|
|
364
|
+
}
|
|
365
|
+
if (typeof globalThis.navigator !== 'undefined' && globalThis.navigator.product === 'ReactNative') {
|
|
366
|
+
Platform.crossPlatformFramework = CrossPlatformFramework.ReactNative;
|
|
367
|
+
}
|
|
355
368
|
for (var i = 0; i < OS_RESOLVER_MAP.length; i++) {
|
|
356
369
|
var map = OS_RESOLVER_MAP[i];
|
|
357
370
|
var regexp = map[0];
|
|
@@ -393,7 +406,7 @@
|
|
|
393
406
|
break;
|
|
394
407
|
}
|
|
395
408
|
}
|
|
396
|
-
if (
|
|
409
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative) {
|
|
397
410
|
try {
|
|
398
411
|
var reactNative = require('react-native');
|
|
399
412
|
var platform = reactNative.Platform;
|
|
@@ -422,7 +435,7 @@
|
|
|
422
435
|
catch (_) {
|
|
423
436
|
}
|
|
424
437
|
}
|
|
425
|
-
if (
|
|
438
|
+
if (Platform.isNode) {
|
|
426
439
|
try {
|
|
427
440
|
var os = require('os');
|
|
428
441
|
var platform = os.platform();
|
|
@@ -454,6 +467,7 @@
|
|
|
454
467
|
}
|
|
455
468
|
if (typeof globalThis.document !== 'undefined') {
|
|
456
469
|
globalThis.document.addEventListener("deviceready", function () {
|
|
470
|
+
Platform.crossPlatformFramework = CrossPlatformFramework.Cordova;
|
|
457
471
|
if (Platform.os === OS.Unknown && typeof globalThis.device !== 'undefined') {
|
|
458
472
|
switch (globalThis.device.platform) {
|
|
459
473
|
case 'Android':
|
|
@@ -496,7 +510,7 @@
|
|
|
496
510
|
Platform.isDesktop = Platform.device === Devices.Desktop;
|
|
497
511
|
Platform.isStandalone = getIsStandalone(Platform.os);
|
|
498
512
|
|
|
499
|
-
var
|
|
513
|
+
var Fullscreen = {
|
|
500
514
|
get enabled() {
|
|
501
515
|
return getEnabled();
|
|
502
516
|
},
|
|
@@ -548,7 +562,7 @@
|
|
|
548
562
|
},
|
|
549
563
|
};
|
|
550
564
|
function detectApi() {
|
|
551
|
-
if (
|
|
565
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron)
|
|
552
566
|
return null;
|
|
553
567
|
var element = globalThis.document.documentElement;
|
|
554
568
|
if ('fullscreenEnabled' in globalThis.document || 'exitFullscreen' in globalThis.document) {
|
|
@@ -579,7 +593,7 @@
|
|
|
579
593
|
return null;
|
|
580
594
|
}
|
|
581
595
|
function getDefaultTarget() {
|
|
582
|
-
if (
|
|
596
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron) {
|
|
583
597
|
var electron = require('electron');
|
|
584
598
|
var focusedWindow = electron.BrowserWindow.getFocusedWindow();
|
|
585
599
|
if (focusedWindow !== null)
|
|
@@ -589,7 +603,7 @@
|
|
|
589
603
|
throw new Error();
|
|
590
604
|
return allWindows[0];
|
|
591
605
|
}
|
|
592
|
-
if (
|
|
606
|
+
if (Platform.os === OS.iOS) {
|
|
593
607
|
var video = globalThis.document.querySelector('video');
|
|
594
608
|
if (video === null)
|
|
595
609
|
throw new Error();
|
|
@@ -626,7 +640,7 @@
|
|
|
626
640
|
function emitError() {
|
|
627
641
|
emit('fullscreenerror');
|
|
628
642
|
}
|
|
629
|
-
if (
|
|
643
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron) {
|
|
630
644
|
try {
|
|
631
645
|
var electron = require('electron');
|
|
632
646
|
var allWindows = electron.BrowserWindow.getAllWindows();
|
|
@@ -696,7 +710,7 @@
|
|
|
696
710
|
}
|
|
697
711
|
}
|
|
698
712
|
function getEnabled() {
|
|
699
|
-
if (
|
|
713
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron) {
|
|
700
714
|
try {
|
|
701
715
|
var electron = require('electron');
|
|
702
716
|
return typeof electron.BrowserWindow.prototype.setFullScreen === 'function';
|
|
@@ -722,7 +736,7 @@
|
|
|
722
736
|
return typeof globalThis.document[api.element] !== 'undefined';
|
|
723
737
|
}
|
|
724
738
|
function getElement() {
|
|
725
|
-
if (
|
|
739
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron) {
|
|
726
740
|
if (lastElectronBrowserWindow !== null)
|
|
727
741
|
return lastElectronBrowserWindow;
|
|
728
742
|
try {
|
|
@@ -754,7 +768,7 @@
|
|
|
754
768
|
}
|
|
755
769
|
function request(target, options) {
|
|
756
770
|
if (target === void 0) { target = getDefaultTarget(); }
|
|
757
|
-
if (
|
|
771
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron) {
|
|
758
772
|
var browserWindow_1 = target;
|
|
759
773
|
return new Promise(function (resolve, reject) {
|
|
760
774
|
try {
|
|
@@ -826,7 +840,7 @@
|
|
|
826
840
|
});
|
|
827
841
|
}
|
|
828
842
|
function exit() {
|
|
829
|
-
if (
|
|
843
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron) {
|
|
830
844
|
return new Promise(function (resolve, reject) {
|
|
831
845
|
try {
|
|
832
846
|
if (lastElectronBrowserWindow !== null) {
|
|
@@ -941,7 +955,7 @@
|
|
|
941
955
|
var NativeFullscreenPlugin = {
|
|
942
956
|
installed: false,
|
|
943
957
|
name: 'Fullscreen',
|
|
944
|
-
module:
|
|
958
|
+
module: Fullscreen,
|
|
945
959
|
Constants: {},
|
|
946
960
|
Errors: {}
|
|
947
961
|
};
|
|
@@ -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,o;!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"}(o||(o={}));var i=void 0!==globalThis.navigator&&"string"==typeof globalThis.navigator.userAgent?globalThis.navigator.userAgent:"",t=void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,l=void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(i),a=void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product,s={device:n.Unknown,os:e.Unknown,osVersion:"",engine:r.Unknown,engineVersion:"",browser:o.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:i,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(i)},u=[[/windows nt (6\.[23]); arm/i,e.Windows,m],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,m],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,m],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,m],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,m],[/windows ce\/?([\d.]*)/i,e.Windows,m],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,f],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,f],[/cfnetwork\/.+darwin/i,e.iOS,f],[/mac os x ?([\w. ]*)/i,e.MacOS,f],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,f],[/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]],d=[[/\b(?:crmo|crios)\/([\w.]+)/i,o.Chrome],[/webview.+edge\/([\w.]+)/i,o.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,o.Edge],[/opera mini\/([-\w.]+)/i,o.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,o.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,o.Opera],[/opios[\/ ]+([\w.]+)/i,o.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,o.Opera],[/\bopr\/([\w.]+)/i,o.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,o.IE],[/(?:ms|\()ie ([\w.]+)/i,o.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,o.IE],[/\bfocus\/([\w.]+)/i,o.Firefox],[/\bopt\/([\w.]+)/i,o.Opera],[/coast\/([\w.]+)/i,o.Opera],[/fxios\/([\w.-]+)/i,o.Firefox],[/samsungbrowser\/([\w.]+)/i,o.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,o.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,o.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,o.Chrome],[/chrome\/([\w.]+) mobile/i,o.Chrome],[/chrome\/v?([\w.]+)/i,o.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/version\/([\w.,]+) .*safari/i,o.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,o.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,o.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,o.Firefox],[/firefox\/([\w.]+)/i,o.Firefox]];function m(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 f(e){return void 0===e?"":e.replace(/_/g,".")}function b(e,n){return 10===e.major&&0===e.minor&&e.build>=22e3?"11":10===e.major&&0===e.minor&&e.build<22e3?"10":6===e.major&&3===e.minor?"8.1":6===e.major&&2===e.minor?"8":6===e.major&&1===e.minor?"7":6===e.major&&0===e.minor?"Vista":5===e.major&&1===e.minor||5===e.major&&2===e.minor?"XP":5===e.major&&0===e.minor?"2000":4===e.major&&90===e.minor?"ME":4===e.major&&0===e.minor?"NT 4.0":3===e.major&&51===e.minor?"NT 3.11":n}function w(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}function g(e){var n=e.split(".");return{major:parseInt(n[0]||"0"),minor:parseInt(n[1]||"0"),build:parseInt(n[2]||"0")}}for(var v=0;v<u.length;v++){var h=(E=u[v])[0],p=E[1],k=E[2];if(null!==(S=s.userAgent.match(h))){s.os=p,s.osVersion=w(S[1],k);break}}s.os===e.iOS&&0===function(e,n){for(var r=e.split("."),o=n.split("."),i=Math.max(r.length,o.length),t=0;t<i;t++){var l=void 0,a=void 0;if((l=t<r.length?parseInt(r[t],10):0)>(a=t<o.length?parseInt(o[t],10):0))return 1;if(l<a)return-1}return 0}(s.osVersion,"18.6")&&(null!==(F=/\) Version\/([\d.]+)/.exec(s.userAgent))&&parseInt(F[1].substring(0,2),10)>=26&&(s.osVersion=F[1]));for(v=0;v<c.length;v++){h=(E=c[v])[0];var T=E[1];k=E[2];if(null!==(S=s.userAgent.match(h))){s.engine=T,s.engineVersion=w(S[1],k);break}}for(v=0;v<d.length;v++){h=(E=d[v])[0];var E,S,j=E[1];k=E[2];if(null!==(S=s.userAgent.match(h))){s.browser=j,s.browserVersion=w(S[1],k);break}}if(a)try{p=(y=require("react-native").Platform).OS;var F=g(x=""+y.Version);switch(p){case"android":s.os=e.Android,s.osVersion=function(e,n){return e.major>=36?"16":35===e.major?"15":34===e.major?"14":33===e.major?"13":32===e.major?"12.1":31===e.major?"12":30===e.major?"11":29===e.major?"10":28===e.major?"9":27===e.major?"8.1":26===e.major?"8.0":25===e.major?"7.1":24===e.major?"7.0":23===e.major?"6.0":22===e.major?"5.1":21===e.major?"5.0":20===e.major||19===e.major?"4.4":18===e.major?"4.3":17===e.major?"4.2":16===e.major?"4.1":15===e.major?"4.0.3":14===e.major?"4.0":13===e.major?"3.2":12===e.major?"3.1":11===e.major?"3.0":10===e.major?"2.3.3":9===e.major?"2.3":8===e.major?"2.2":7===e.major?"2.1":6===e.major?"2.0.1":5===e.major?"2.0":4===e.major?"1.6":3===e.major?"1.5":2===e.major?"1.1":1===e.major?"1.0":n}(F,x);break;case"ios":s.os=e.iOS,s.osVersion=x;break;case"windows":s.os=e.Windows,s.osVersion=b(F,x);break;case"macos":s.os=e.MacOS,s.osVersion=x}}catch(e){}if(t)try{var x,y=(p=require("os")).platform();F=g(x=p.release());switch(y){case"win32":s.os=e.Windows,s.osVersion=b(F,x);break;case"darwin":s.os=e.MacOS,s.osVersion=function(e,n){return e.major>=24?e.major-9+"."+e.minor+"."+e.build:23===e.major?"14."+e.minor+"."+e.build:22===e.major?"13."+e.minor+"."+e.build:21===e.major?"12."+e.minor+"."+e.build:20===e.major?"11."+e.minor+"."+e.build:19===e.major?"10.15."+e.minor:18===e.major?"10.14."+e.minor:17===e.major?"10.13."+e.minor:16===e.major?"10.12."+e.minor:15===e.major?"10.11."+e.minor:14===e.major?"10.10."+e.minor:13===e.major?"10.9."+e.minor:e.major>=5&&e.major<=12?"10."+(e.major-4)+"."+e.minor:n}(F,x);break;case"android":s.os=e.Android,s.osVersion=x;break;case"linux":/android/i.test(x)&&(s.os=e.Android,s.osVersion=x)}}catch(e){}void 0!==globalThis.document&&globalThis.document.addEventListener("deviceready",(function(){if(s.os===e.Unknown&&void 0!==globalThis.device){switch(globalThis.device.platform){case"Android":s.os=e.Android;break;case"iOS":s.os=e.iOS}s.osVersion=globalThis.device.version}}),!1),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,o=n.fullVersionList||n.brands||[],i=n.platformVersion,t=0;t<o.length;t++){var l=null==(r=o[t])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},a=l.brand,u=l.version;/not.a.brand/i.test(a)||"Chromium"===a&&(s.engineVersion=u)}"string"==typeof i&&(s.os===e.Windows&&parseInt(i.replace(/[^\d.]/g,"").split(".")[0],10)>=13?s.osVersion="11":s.osVersion=i)})),s.device=s.os===e.iOS||s.os===e.Android?n.Mobile:s.os===e.Windows||s.os===e.MacOS?n.Desktop:n.Unknown,s.isMobile=s.device===n.Mobile,s.isDesktop=s.device===n.Desktop,s.isStandalone=function(n){return"matchMedia"in globalThis&&(n===e.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(s.os);var O={get enabled(){return function(){if(l)try{return"function"==typeof require("electron").BrowserWindow.prototype.setFullScreen}catch(e){return!1}if(null===q){if(e.iOS!==s.os)return!1;for(var n=globalThis.document.querySelectorAll("video"),r=0;r<n.length;r++){var o=n[r];if(o.webkitSupportsFullscreen||"webkitEnterFullscreen"in o)return!0}return!1}var i=globalThis.document[q.enabled];return"boolean"==typeof i?i:void 0!==globalThis.document[q.element]}()},get element(){return B()},get isFullscreen(){return R()},request:D,exit:I,toggle:function(e,n){return R()?I():D(e,n)},onchange:function(e){var n=[];return function(r){function o(n){e(n)}if(void 0===globalThis.document)return;globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)}))}("fullscreenchange"),function(){for(var e=0;e<n.length;e++)n[e]()}},onerror:function(e){var n=[];return function(r){function o(n){e(n)}if(void 0===globalThis.document)return;globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)}))}("fullscreenerror"),function(){for(var e=0;e<n.length;e++)n[e]()}}},M=null,W=null,V=null,A=!1,q=function(){if(l)return null;var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return N.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r],i=N[o];if(i.enabled in globalThis.document||i.element in globalThis.document||i.exit in globalThis.document)return"webkit"===o&&"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}if("webkitCurrentFullScreenElement"in globalThis.document){var t={enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:N.webkit.events};return"webkitRequestFullScreen"in e&&(t.request="webkitRequestFullScreen"),t}return null}(),N={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 L(){null!==V&&(W.fullScreenable=V.fullScreenable,W.autoHideMenuBar=V.autoHideMenuBar,V=null),W=null}function C(){void 0!==globalThis.document&&globalThis.document.querySelectorAll("video").forEach((function(e){function n(){globalThis.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 B(){if(l){if(null!==W)return W;try{for(var n=require("electron").BrowserWindow.getAllWindows(),r=0;r<n.length;r++){var o=n[r];if(o.isFullScreen()||s.os===e.MacOS&&"function"==typeof o.isSimpleFullScreen&&o.isSimpleFullScreen())return o}return null}catch(e){return null}}if(null===q)return M&&M.webkitDisplayingFullscreen?M:null;var i=globalThis.document[q.element];return null!=i?i:null}function R(){return null!==B()}function D(n,r){if(void 0===n&&(n=function(){if(l){var n=require("electron"),r=n.BrowserWindow.getFocusedWindow();if(null!==r)return r;var o=n.BrowserWindow.getAllWindows();if(0===o.length)throw new Error;return o[0]}if(e.iOS===s.os){var i=globalThis.document.querySelector("video");if(null===i)throw new Error;return i}return globalThis.document.documentElement}()),l){var o=n;return new Promise((function(e,n){try{return null===W&&(V={fullScreenable:o.fullScreenable,autoHideMenuBar:o.autoHideMenuBar},o.fullScreenable=!0,o.autoHideMenuBar=!0),o.setFullScreen(!0),W=o,void e()}catch(e){n()}}))}return new Promise((function(o,i){if(null!==q){var t=n[q.request];if("function"==typeof t)try{var l=t.call(n,r);return void 0!==l&&"function"==typeof l.then?void l.then((function(){o()})).catch((function(){e.iOS===s.os?a():i()})):void o()}catch(n){if(e.iOS!==s.os)return void i()}}function a(){if(e.iOS===s.os&&"VIDEO"===n.tagName.toUpperCase()){var r=n;if(r.webkitSupportsFullscreen&&"function"==typeof r.webkitEnterFullscreen)return M=r,C(),r.webkitEnterFullscreen(),void o()}i()}a()}))}function I(){return new Promise(l?function(e,n){try{if(null!==W)W.setFullScreen(!1),L();else{var r=B();null!==r&&r.setFullScreen(!1)}e()}catch(e){n()}}:function(n,r){if(null!==q){var o=globalThis.document[q.exit];if("function"==typeof o){var i=o.call(globalThis.document);return void 0!==i&&"function"==typeof i.then?void i.then((function(){n()})).catch((function(){r()})):void n()}}if(e.iOS===s.os&&null!==M){if("function"==typeof M.webkitExitFullscreen&&!0===M.webkitDisplayingFullscreen)return M.webkitExitFullscreen(),M=null,void n();for(var t=globalThis.document.querySelectorAll("video"),l=0;l<t.length;l++){var a=t[l];if("function"==typeof a.webkitExitFullscreen&&!0===a.webkitDisplayingFullscreen)return a.webkitExitFullscreen(),void n()}}B()?r():n()})}return function(){if(!A){A=!0;var n=!1;if(l)try{for(var r=require("electron"),o=r.BrowserWindow.getAllWindows(),i=function(e){var n=o[e];n.on("enter-full-screen",(function(){W=n,d()})),n.on("leave-full-screen",(function(){L(),d()}))},t=0;t<o.length;t++)i(t);"function"==typeof r.BrowserWindow.on&&r.BrowserWindow.on("browser-window-created",(function(e,n){n.on("enter-full-screen",(function(){W=n,d()})),n.on("leave-full-screen",(function(){L(),d()}))}))}catch(e){}var a=["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],u=["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"];for(t=0;t<a.length;t++)void 0!==globalThis.document&&globalThis.document.addEventListener(a[t],d,!1);for(t=0;t<u.length;t++)void 0!==globalThis.document&&globalThis.document.addEventListener(u[t],m,!1);if(e.iOS===s.os)if(C(),void 0!==globalThis.MutationObserver)new MutationObserver((function(){C()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function c(e){n||(n=!0,void 0!==globalThis.document&&globalThis.document.dispatchEvent(new Event(e,{bubbles:!0,cancelable:!1})),Promise.resolve().then((function(){n=!1})))}function d(){c("fullscreenchange")}function m(){c("fullscreenerror")}}(),{installed:!1,name:"Fullscreen",module:O,Constants:{},Errors:{}}}));
|
|
1
|
+
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(e="undefined"!=typeof globalThis?globalThis:e||self).Fullscreen=r()}(this,(function(){"use strict";var e,r,n,o,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"}(r||(r={})),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"}(n||(n={})),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"}(o||(o={})),function(e){e.NotACrossPlatformFramework="NotACrossPlatformFramework",e.ReactNative="ReactNative",e.Electron="Electron",e.Cordova="Cordova"}(i||(i={}));var t=void 0!==globalThis.navigator&&"string"==typeof globalThis.navigator.userAgent?globalThis.navigator.userAgent:"",l={device:r.Unknown,os:e.Unknown,engine:n.Unknown,browser:o.Unknown,crossPlatformFramework:i.NotACrossPlatformFramework,osVersion:"",engineVersion:"",browserVersion:"",renderer:function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var r=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===r)return"";if(r instanceof WebGLRenderingContext||"getParameter"in r&&"function"==typeof r.getParameter){var n=r.getExtension("WEBGL_debug_renderer_info");return null===n?r.getParameter(r.RENDERER):r.getParameter(n.UNMASKED_RENDERER_WEBGL)}return""}(),userAgent:t,isNode:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(t)},a=[[/windows nt (6\.[23]); arm/i,e.Windows,c],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,c],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,c],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,c],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,c],[/windows ce\/?([\d.]*)/i,e.Windows,c],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,d],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,d],[/cfnetwork\/.+darwin/i,e.iOS,d],[/mac os x ?([\w. ]*)/i,e.MacOS,d],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,d],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],s=[[/windows.+ edge\/([\w.]+)/i,n.EdgeHTML],[/arkweb\/([\w.]+)/i,n.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,n.Blink],[/presto\/([\w.]+)/i,n.Presto],[/webkit\/([\w.]+)/i,n.WebKit],[/trident\/([\w.]+)/i,n.Trident],[/netfront\/([\w.]+)/i,n.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,n.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,n.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,n.Gecko]],u=[[/\b(?:crmo|crios)\/([\w.]+)/i,o.Chrome],[/webview.+edge\/([\w.]+)/i,o.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,o.Edge],[/opera mini\/([-\w.]+)/i,o.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,o.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,o.Opera],[/opios[\/ ]+([\w.]+)/i,o.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,o.Opera],[/\bopr\/([\w.]+)/i,o.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,o.IE],[/(?:ms|\()ie ([\w.]+)/i,o.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,o.IE],[/\bfocus\/([\w.]+)/i,o.Firefox],[/\bopt\/([\w.]+)/i,o.Opera],[/coast\/([\w.]+)/i,o.Opera],[/fxios\/([\w.-]+)/i,o.Firefox],[/samsungbrowser\/([\w.]+)/i,o.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,o.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,o.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,o.Chrome],[/chrome\/([\w.]+) mobile/i,o.Chrome],[/chrome\/v?([\w.]+)/i,o.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/version\/([\w.,]+) .*safari/i,o.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,o.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,o.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,o.Firefox],[/firefox\/([\w.]+)/i,o.Firefox]];function c(e){if(void 0===e)return"";var r={"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!==r?r:e}function d(e){return void 0===e?"":e.replace(/_/g,".")}function m(e,r){return 10===e.major&&0===e.minor&&e.build>=22e3?"11":10===e.major&&0===e.minor&&e.build<22e3?"10":6===e.major&&3===e.minor?"8.1":6===e.major&&2===e.minor?"8":6===e.major&&1===e.minor?"7":6===e.major&&0===e.minor?"Vista":5===e.major&&1===e.minor||5===e.major&&2===e.minor?"XP":5===e.major&&0===e.minor?"2000":4===e.major&&90===e.minor?"ME":4===e.major&&0===e.minor?"NT 4.0":3===e.major&&51===e.minor?"NT 3.11":r}function f(e,r){return"function"==typeof r?r(e):"string"==typeof r?r:void 0===e?"":e}function b(e){var r=e.split(".");return{major:parseInt(r[0]||"0"),minor:parseInt(r[1]||"0"),build:parseInt(r[2]||"0")}}(void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(t))&&(l.crossPlatformFramework=i.Electron),void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product&&(l.crossPlatformFramework=i.ReactNative);for(var w=0;w<a.length;w++){var g=(k=a[w])[0],v=k[1],h=k[2];if(null!==(E=l.userAgent.match(g))){l.os=v,l.osVersion=f(E[1],h);break}}l.os===e.iOS&&0===function(e,r){for(var n=e.split("."),o=r.split("."),i=Math.max(n.length,o.length),t=0;t<i;t++){var l=void 0,a=void 0;if((l=t<n.length?parseInt(n[t],10):0)>(a=t<o.length?parseInt(o[t],10):0))return 1;if(l<a)return-1}return 0}(l.osVersion,"18.6")&&(null!==(F=/\) Version\/([\d.]+)/.exec(l.userAgent))&&parseInt(F[1].substring(0,2),10)>=26&&(l.osVersion=F[1]));for(w=0;w<s.length;w++){g=(k=s[w])[0];var p=k[1];h=k[2];if(null!==(E=l.userAgent.match(g))){l.engine=p,l.engineVersion=f(E[1],h);break}}for(w=0;w<u.length;w++){g=(k=u[w])[0];var k,E,T=k[1];h=k[2];if(null!==(E=l.userAgent.match(g))){l.browser=T,l.browserVersion=f(E[1],h);break}}if(l.crossPlatformFramework===i.ReactNative)try{v=(j=require("react-native").Platform).OS;var F=b(S=""+j.Version);switch(v){case"android":l.os=e.Android,l.osVersion=function(e,r){return e.major>=36?"16":35===e.major?"15":34===e.major?"14":33===e.major?"13":32===e.major?"12.1":31===e.major?"12":30===e.major?"11":29===e.major?"10":28===e.major?"9":27===e.major?"8.1":26===e.major?"8.0":25===e.major?"7.1":24===e.major?"7.0":23===e.major?"6.0":22===e.major?"5.1":21===e.major?"5.0":20===e.major||19===e.major?"4.4":18===e.major?"4.3":17===e.major?"4.2":16===e.major?"4.1":15===e.major?"4.0.3":14===e.major?"4.0":13===e.major?"3.2":12===e.major?"3.1":11===e.major?"3.0":10===e.major?"2.3.3":9===e.major?"2.3":8===e.major?"2.2":7===e.major?"2.1":6===e.major?"2.0.1":5===e.major?"2.0":4===e.major?"1.6":3===e.major?"1.5":2===e.major?"1.1":1===e.major?"1.0":r}(F,S);break;case"ios":l.os=e.iOS,l.osVersion=S;break;case"windows":l.os=e.Windows,l.osVersion=m(F,S);break;case"macos":l.os=e.MacOS,l.osVersion=S}}catch(e){}if(l.isNode)try{var S,j=(v=require("os")).platform();F=b(S=v.release());switch(j){case"win32":l.os=e.Windows,l.osVersion=m(F,S);break;case"darwin":l.os=e.MacOS,l.osVersion=function(e,r){return e.major>=24?e.major-9+"."+e.minor+"."+e.build:23===e.major?"14."+e.minor+"."+e.build:22===e.major?"13."+e.minor+"."+e.build:21===e.major?"12."+e.minor+"."+e.build:20===e.major?"11."+e.minor+"."+e.build:19===e.major?"10.15."+e.minor:18===e.major?"10.14."+e.minor:17===e.major?"10.13."+e.minor:16===e.major?"10.12."+e.minor:15===e.major?"10.11."+e.minor:14===e.major?"10.10."+e.minor:13===e.major?"10.9."+e.minor:e.major>=5&&e.major<=12?"10."+(e.major-4)+"."+e.minor:r}(F,S);break;case"android":l.os=e.Android,l.osVersion=S;break;case"linux":/android/i.test(S)&&(l.os=e.Android,l.osVersion=S)}}catch(e){}void 0!==globalThis.document&&globalThis.document.addEventListener("deviceready",(function(){if(l.crossPlatformFramework=i.Cordova,l.os===e.Unknown&&void 0!==globalThis.device){switch(globalThis.device.platform){case"Android":l.os=e.Android;break;case"iOS":l.os=e.iOS}l.osVersion=globalThis.device.version}}),!1),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(r){for(var n,o=r.fullVersionList||r.brands||[],i=r.platformVersion,t=0;t<o.length;t++){var a=null==(n=o[t])?{brand:"",version:""}:"string"==typeof n?{brand:n,version:""}:{brand:n.brand,version:n.version},s=a.brand,u=a.version;/not.a.brand/i.test(s)||"Chromium"===s&&(l.engineVersion=u)}"string"==typeof i&&(l.os===e.Windows&&parseInt(i.replace(/[^\d.]/g,"").split(".")[0],10)>=13?l.osVersion="11":l.osVersion=i)})),l.device=l.os===e.iOS||l.os===e.Android?r.Mobile:l.os===e.Windows||l.os===e.MacOS?r.Desktop:r.Unknown,l.isMobile=l.device===r.Mobile,l.isDesktop=l.device===r.Desktop,l.isStandalone=function(r){return"matchMedia"in globalThis&&(r===e.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(l.os);var x={get enabled(){return function(){if(l.crossPlatformFramework===i.Electron)try{return"function"==typeof require("electron").BrowserWindow.prototype.setFullScreen}catch(e){return!1}if(null===W){if(e.iOS!==l.os)return!1;for(var r=globalThis.document.querySelectorAll("video"),n=0;n<r.length;n++){var o=r[n];if(o.webkitSupportsFullscreen||"webkitEnterFullscreen"in o)return!0}return!1}var t=globalThis.document[W.enabled];return"boolean"==typeof t?t:void 0!==globalThis.document[W.element]}()},get element(){return q()},get isFullscreen(){return C()},request:R,exit:L,toggle:function(e,r){return C()?L():R(e,r)},onchange:function(e){var r=[];return function(n){function o(r){e(r)}if(void 0===globalThis.document)return;globalThis.document.addEventListener(n,o,!1),r.push((function(){globalThis.document.removeEventListener(n,o,!1)}))}("fullscreenchange"),function(){for(var e=0;e<r.length;e++)r[e]()}},onerror:function(e){var r=[];return function(n){function o(r){e(r)}if(void 0===globalThis.document)return;globalThis.document.addEventListener(n,o,!1),r.push((function(){globalThis.document.removeEventListener(n,o,!1)}))}("fullscreenerror"),function(){for(var e=0;e<r.length;e++)r[e]()}}},y=null,O=null,M=null,A=!1,W=function(){if(l.crossPlatformFramework===i.Electron)return null;var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return N.standard;for(var r=["webkit","moz","ms"],n=0;n<r.length;n++){var o=r[n],t=N[o];if(t.enabled in globalThis.document||t.element in globalThis.document||t.exit in globalThis.document)return"webkit"===o&&"webkitRequestFullScreen"in e&&(t.request="webkitRequestFullScreen"),t}if("webkitCurrentFullScreenElement"in globalThis.document){var a={enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:N.webkit.events};return"webkitRequestFullScreen"in e&&(a.request="webkitRequestFullScreen"),a}return null}(),N={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 V(){null!==M&&(O.fullScreenable=M.fullScreenable,O.autoHideMenuBar=M.autoHideMenuBar,M=null),O=null}function P(){void 0!==globalThis.document&&globalThis.document.querySelectorAll("video").forEach((function(e){function r(){globalThis.document.dispatchEvent(new Event("fullscreenchange"))}e.__fsBridged__||!("webkitEnterFullscreen"in e)&&!("onwebkitbeginfullscreen"in e)||(e.addEventListener("webkitbeginfullscreen",r,!1),e.addEventListener("webkitendfullscreen",r,!1),e.__fsBridged__=!0)}))}function q(){if(l.crossPlatformFramework===i.Electron){if(null!==O)return O;try{for(var r=require("electron").BrowserWindow.getAllWindows(),n=0;n<r.length;n++){var o=r[n];if(o.isFullScreen()||l.os===e.MacOS&&"function"==typeof o.isSimpleFullScreen&&o.isSimpleFullScreen())return o}return null}catch(e){return null}}if(null===W)return y&&y.webkitDisplayingFullscreen?y:null;var t=globalThis.document[W.element];return null!=t?t:null}function C(){return null!==q()}function R(r,n){if(void 0===r&&(r=function(){if(l.crossPlatformFramework===i.Electron){var r=require("electron"),n=r.BrowserWindow.getFocusedWindow();if(null!==n)return n;var o=r.BrowserWindow.getAllWindows();if(0===o.length)throw new Error;return o[0]}if(l.os===e.iOS){var t=globalThis.document.querySelector("video");if(null===t)throw new Error;return t}return globalThis.document.documentElement}()),l.crossPlatformFramework===i.Electron){var o=r;return new Promise((function(e,r){try{return null===O&&(M={fullScreenable:o.fullScreenable,autoHideMenuBar:o.autoHideMenuBar},o.fullScreenable=!0,o.autoHideMenuBar=!0),o.setFullScreen(!0),O=o,void e()}catch(e){r()}}))}return new Promise((function(o,i){if(null!==W){var t=r[W.request];if("function"==typeof t)try{var a=t.call(r,n);return void 0!==a&&"function"==typeof a.then?void a.then((function(){o()})).catch((function(){e.iOS===l.os?s():i()})):void o()}catch(r){if(e.iOS!==l.os)return void i()}}function s(){if(e.iOS===l.os&&"VIDEO"===r.tagName.toUpperCase()){var n=r;if(n.webkitSupportsFullscreen&&"function"==typeof n.webkitEnterFullscreen)return y=n,P(),n.webkitEnterFullscreen(),void o()}i()}s()}))}function L(){return l.crossPlatformFramework===i.Electron?new Promise((function(e,r){try{if(null!==O)O.setFullScreen(!1),V();else{var n=q();null!==n&&n.setFullScreen(!1)}e()}catch(e){r()}})):new Promise((function(r,n){if(null!==W){var o=globalThis.document[W.exit];if("function"==typeof o){var i=o.call(globalThis.document);return void 0!==i&&"function"==typeof i.then?void i.then((function(){r()})).catch((function(){n()})):void r()}}if(e.iOS===l.os&&null!==y){if("function"==typeof y.webkitExitFullscreen&&!0===y.webkitDisplayingFullscreen)return y.webkitExitFullscreen(),y=null,void r();for(var t=globalThis.document.querySelectorAll("video"),a=0;a<t.length;a++){var s=t[a];if("function"==typeof s.webkitExitFullscreen&&!0===s.webkitDisplayingFullscreen)return s.webkitExitFullscreen(),void r()}}q()?n():r()}))}return function(){if(!A){A=!0;var r=!1;if(l.crossPlatformFramework===i.Electron)try{for(var n=require("electron"),o=n.BrowserWindow.getAllWindows(),t=function(e){var r=o[e];r.on("enter-full-screen",(function(){O=r,d()})),r.on("leave-full-screen",(function(){V(),d()}))},a=0;a<o.length;a++)t(a);"function"==typeof n.BrowserWindow.on&&n.BrowserWindow.on("browser-window-created",(function(e,r){r.on("enter-full-screen",(function(){O=r,d()})),r.on("leave-full-screen",(function(){V(),d()}))}))}catch(e){}var s=["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],u=["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"];for(a=0;a<s.length;a++)void 0!==globalThis.document&&globalThis.document.addEventListener(s[a],d,!1);for(a=0;a<u.length;a++)void 0!==globalThis.document&&globalThis.document.addEventListener(u[a],m,!1);if(e.iOS===l.os)if(P(),void 0!==globalThis.MutationObserver)new MutationObserver((function(){P()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function c(e){r||(r=!0,void 0!==globalThis.document&&globalThis.document.dispatchEvent(new Event(e,{bubbles:!0,cancelable:!1})),Promise.resolve().then((function(){r=!1})))}function d(){c("fullscreenchange")}function m(){c("fullscreenerror")}}(),{installed:!1,name:"Fullscreen",module:x,Constants:{},Errors:{}}}));
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AppInstance } from "../types";
|
|
2
2
|
declare global {
|
|
3
|
-
var electronBridge: ElectronShell;
|
|
4
3
|
interface Document {
|
|
5
4
|
webkitVisibilityState?: 'hidden' | 'visible';
|
|
6
5
|
mozVisibilityState?: 'hidden' | 'visible';
|
|
@@ -10,8 +9,5 @@ declare global {
|
|
|
10
9
|
msHidden?: boolean;
|
|
11
10
|
}
|
|
12
11
|
}
|
|
13
|
-
interface ElectronShell {
|
|
14
|
-
openExternal(url: string): Promise<void>;
|
|
15
|
-
}
|
|
16
12
|
declare const App: AppInstance;
|
|
17
13
|
export default App;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CameraInstance } from "../types";
|
|
2
|
-
declare const
|
|
3
|
-
export default
|
|
2
|
+
declare const Camera: CameraInstance;
|
|
3
|
+
export default Camera;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ClipboardInstance } from "../types";
|
|
2
|
-
declare const
|
|
3
|
-
export default
|
|
2
|
+
declare const Clipboard: ClipboardInstance;
|
|
3
|
+
export default Clipboard;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FullscreenInstance } from "../types";
|
|
2
|
-
declare const
|
|
2
|
+
declare const Fullscreen: FullscreenInstance;
|
|
3
3
|
declare global {
|
|
4
4
|
interface HTMLVideoElement {
|
|
5
5
|
webkitEnterFullscreen?: () => void;
|
|
@@ -32,4 +32,4 @@ declare global {
|
|
|
32
32
|
msRequestFullscreen?: () => Promise<void>;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
export default
|
|
35
|
+
export default Fullscreen;
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
export declare interface FullscreenInstance {
|
|
2
2
|
enabled: boolean;
|
|
3
|
-
element:
|
|
3
|
+
element: any;
|
|
4
4
|
isFullscreen: boolean;
|
|
5
|
-
request(target?:
|
|
5
|
+
request(target?: any, options?: FullscreenOptions): Promise<void>;
|
|
6
6
|
exit(): Promise<void>;
|
|
7
|
-
toggle(target?:
|
|
7
|
+
toggle(target?: any, options?: FullscreenOptions): Promise<void>;
|
|
8
8
|
onchange(handler: (event: Event) => void): () => void;
|
|
9
9
|
onerror(handler: (event: Event) => void): () => void;
|
|
10
10
|
}
|
|
11
|
-
export declare type BrowserWindow = import('electron').BrowserWindow;
|
|
12
|
-
export declare type IsElectron = typeof process extends {
|
|
13
|
-
versions: {
|
|
14
|
-
electron: string;
|
|
15
|
-
};
|
|
16
|
-
} ? true : false;
|
|
17
|
-
export declare type FullscreenTarget = IsElectron extends true ? BrowserWindow : Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare enum OS {
|
|
2
|
+
Unknown = "Unknown",
|
|
3
|
+
Android = "Android",
|
|
4
|
+
iOS = "iOS",
|
|
5
|
+
Windows = "Windows",
|
|
6
|
+
MacOS = "MacOS"
|
|
7
|
+
}
|
|
8
|
+
export declare enum Devices {
|
|
9
|
+
Unknown = "Unknown",
|
|
10
|
+
Mobile = "Mobile",
|
|
11
|
+
Desktop = "Desktop"
|
|
12
|
+
}
|
|
13
|
+
export declare enum Engines {
|
|
14
|
+
Unknown = "Unknown",
|
|
15
|
+
EdgeHTML = "EdgeHTML",
|
|
16
|
+
ArkWeb = "ArkWeb",
|
|
17
|
+
Blink = "Blink",
|
|
18
|
+
Presto = "Presto",
|
|
19
|
+
WebKit = "WebKit",
|
|
20
|
+
Trident = "Trident",
|
|
21
|
+
NetFront = "NetFront",
|
|
22
|
+
KHTML = "KHTML",
|
|
23
|
+
Tasman = "Tasman",
|
|
24
|
+
Gecko = "Gecko"
|
|
25
|
+
}
|
|
26
|
+
export declare enum Browsers {
|
|
27
|
+
Unknown = "Unknown",
|
|
28
|
+
Chrome = "Chrome",
|
|
29
|
+
Safari = "Safari",
|
|
30
|
+
Edge = "Edge",
|
|
31
|
+
Firefox = "Firefox",
|
|
32
|
+
Opera = "Opera",
|
|
33
|
+
IE = "IE",
|
|
34
|
+
SamsungInternet = "SamsungInternet"
|
|
35
|
+
}
|
|
36
|
+
export declare enum CrossPlatformFramework {
|
|
37
|
+
NotACrossPlatformFramework = "NotACrossPlatformFramework",
|
|
38
|
+
ReactNative = "ReactNative",
|
|
39
|
+
Electron = "Electron",
|
|
40
|
+
Cordova = "Cordova"
|
|
41
|
+
}
|
|
42
|
+
export declare const USER_AGENT: string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { PlatformInstance } from "../types";
|
|
2
|
+
declare global {
|
|
3
|
+
var cordova: string | undefined;
|
|
4
|
+
var device: CordovaDevice | undefined;
|
|
5
|
+
interface Navigator {
|
|
6
|
+
userAgent?: string;
|
|
7
|
+
userAgentData?: UserAgentData;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
interface CordovaDevice {
|
|
11
|
+
platform: string;
|
|
12
|
+
version: string;
|
|
13
|
+
}
|
|
14
|
+
interface ModernUserAgentDataBrand {
|
|
15
|
+
brand: string;
|
|
16
|
+
version: string;
|
|
17
|
+
}
|
|
18
|
+
type UserAgentDataBrand = ModernUserAgentDataBrand | string | null | undefined;
|
|
19
|
+
interface UserAgentDataValues {
|
|
20
|
+
brands?: UserAgentDataBrand[];
|
|
21
|
+
fullVersionList?: UserAgentDataBrand[];
|
|
22
|
+
platformVersion?: string | null | undefined;
|
|
23
|
+
}
|
|
24
|
+
interface UserAgentData {
|
|
25
|
+
getHighEntropyValues?(hints: string[]): Promise<UserAgentDataValues>;
|
|
26
|
+
}
|
|
27
|
+
declare const Platform: PlatformInstance;
|
|
28
|
+
export default Platform;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { NativePlugin } from "../../types";
|
|
2
|
-
import
|
|
3
|
-
import { Browsers, Devices, Engines, OS } from "
|
|
2
|
+
import { PlatformInstance } from "./types";
|
|
3
|
+
import { Browsers, CrossPlatformFramework, Devices, Engines, OS } from "./constants";
|
|
4
4
|
export * from "./types";
|
|
5
5
|
declare const NativePlatformPlugin: NativePlugin<'Platform', PlatformInstance, {
|
|
6
6
|
OS: typeof OS;
|
|
7
7
|
Devices: typeof Devices;
|
|
8
8
|
Engines: typeof Engines;
|
|
9
9
|
Browsers: typeof Browsers;
|
|
10
|
+
CrossPlatformFramework: typeof CrossPlatformFramework;
|
|
10
11
|
}, {}>;
|
|
11
12
|
export default NativePlatformPlugin;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import { Devices, Engines,
|
|
1
|
+
import { Browsers, CrossPlatformFramework, Devices, Engines, OS } from "../constants";
|
|
2
2
|
export declare interface PlatformInstance {
|
|
3
3
|
os: OS;
|
|
4
4
|
device: Devices;
|
|
5
5
|
engine: Engines;
|
|
6
6
|
browser: Browsers;
|
|
7
|
+
crossPlatformFramework: CrossPlatformFramework;
|
|
7
8
|
osVersion: string;
|
|
8
9
|
engineVersion: string;
|
|
9
10
|
browserVersion: string;
|
|
10
11
|
renderer: string;
|
|
11
|
-
|
|
12
|
+
userAgent: string;
|
|
13
|
+
isNode: boolean;
|
|
12
14
|
isStandalone: boolean;
|
|
13
15
|
isMobile: boolean;
|
|
14
16
|
isDesktop: boolean;
|
|
17
|
+
isWebview: boolean;
|
|
15
18
|
}
|
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
import type { ListenerEntry } from "../types";
|
|
2
|
-
export declare enum Appearances {
|
|
3
|
-
Unknown = "unknown",
|
|
4
|
-
Light = "light",
|
|
5
|
-
Dark = "dark"
|
|
6
|
-
}
|
|
7
|
-
export declare const MEDIA_QUERY_LIST: MediaQueryList;
|
|
8
|
-
export declare const SUPPORT_PREFERS_COLOR_SCHEME: boolean;
|
|
9
|
-
export declare const IS_FULL_SUPPORT_THEME_COLOR: boolean;
|
|
10
|
-
export declare const CONTEXT: CanvasRenderingContext2D | null;
|
|
11
|
-
export declare const SVG_PIXEL_DATA_URL: string;
|
|
12
1
|
export declare const IS_IE_MOBILE: boolean;
|
|
13
2
|
export declare const IS_WINDOWS_PHONE: boolean;
|
|
14
|
-
export declare const ENTRIES: ListenerEntry[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ThemeInstance } from "../types";
|
|
2
|
-
declare const
|
|
3
|
-
export default
|
|
2
|
+
declare const Theme: ThemeInstance;
|
|
3
|
+
export default Theme;
|