native-fn 1.0.63 → 1.0.64

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.
Files changed (242) hide show
  1. package/README.md +2 -2
  2. package/dist/native.cjs +2 -2
  3. package/dist/native.min.cjs +1 -1
  4. package/dist/native.min.mjs +1 -1
  5. package/dist/native.mjs +2 -2
  6. package/dist/native.umd.js +2 -2
  7. package/dist/native.umd.min.js +1 -1
  8. package/dist/plugin/app/index.cjs +12 -7
  9. package/dist/plugin/app/index.d.ts +5 -0
  10. package/dist/plugin/app/index.min.cjs +1 -1
  11. package/dist/plugin/app/index.min.mjs +1 -1
  12. package/dist/plugin/app/index.mjs +12 -7
  13. package/dist/plugin/app/index.umd.js +12 -7
  14. package/dist/plugin/app/index.umd.min.js +1 -1
  15. package/dist/plugin/app/src/plugin/app/constants/index.d.ts +12 -0
  16. package/dist/plugin/app/src/plugin/app/cores/index.d.ts +3 -0
  17. package/dist/plugin/app/src/plugin/app/index.d.ts +1 -1
  18. package/dist/plugin/app/src/plugin/app/types/app.d.ts +6 -1
  19. package/dist/plugin/app/src/plugin/app/types/index.d.ts +2 -2
  20. package/dist/plugin/app/src/plugin/appearance/constants/index.d.ts +11 -0
  21. package/dist/plugin/app/src/plugin/appearance/cores/index.d.ts +3 -0
  22. package/dist/plugin/app/src/plugin/appearance/index.d.ts +8 -0
  23. package/dist/plugin/app/src/plugin/appearance/types/appearance.d.ts +6 -0
  24. package/dist/plugin/app/src/plugin/appearance/types/index.d.ts +13 -0
  25. package/dist/plugin/app/src/plugin/camera/constants/inedx.d.ts +4 -0
  26. package/dist/plugin/app/src/plugin/camera/cores/index.d.ts +3 -0
  27. package/dist/plugin/app/src/plugin/camera/index.d.ts +1 -1
  28. package/dist/plugin/app/src/plugin/camera/types/camera.d.ts +1 -1
  29. package/dist/plugin/app/src/plugin/camera/types/index.d.ts +1 -1
  30. package/dist/plugin/app/src/plugin/camera/utils/try-open-camera.d.ts +1 -1
  31. package/dist/plugin/app/src/plugin/clipboard/cores/index.d.ts +3 -0
  32. package/dist/plugin/app/src/plugin/fullscreen/cores/index.d.ts +35 -0
  33. package/dist/plugin/app/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
  34. package/dist/plugin/app/src/plugin/theme/constants/index.d.ts +14 -0
  35. package/dist/plugin/app/src/plugin/theme/cores/index.d.ts +3 -0
  36. package/dist/plugin/app/src/plugin/theme/index.d.ts +1 -1
  37. package/dist/plugin/app/src/plugin/theme/types/index.d.ts +1 -1
  38. package/dist/plugin/app/src/plugin/theme/types/theme.d.ts +1 -1
  39. package/dist/plugin/appearance/index.cjs +764 -0
  40. package/dist/plugin/appearance/index.d.ts +100 -0
  41. package/dist/plugin/appearance/index.min.cjs +1 -0
  42. package/dist/plugin/appearance/index.min.mjs +1 -0
  43. package/dist/plugin/appearance/index.mjs +762 -0
  44. package/dist/plugin/appearance/index.umd.js +770 -0
  45. package/dist/plugin/appearance/index.umd.min.js +1 -0
  46. package/dist/plugin/appearance/src/constants/platform.d.ts +67 -0
  47. package/dist/plugin/appearance/src/errors/plugin-not-extended-error.d.ts +2 -0
  48. package/dist/plugin/appearance/src/plugin/app/constants/index.d.ts +12 -0
  49. package/dist/plugin/appearance/src/plugin/app/cores/index.d.ts +3 -0
  50. package/dist/plugin/appearance/src/plugin/app/errors/url-open-error.d.ts +2 -0
  51. package/dist/plugin/appearance/src/plugin/app/index.d.ts +12 -0
  52. package/dist/plugin/appearance/src/plugin/app/types/app.d.ts +54 -0
  53. package/dist/plugin/appearance/src/plugin/app/types/index.d.ts +16 -0
  54. package/dist/plugin/appearance/src/plugin/app/utils/try-open-url.d.ts +16 -0
  55. package/dist/plugin/appearance/src/plugin/appearance/constants/index.d.ts +11 -0
  56. package/dist/plugin/appearance/src/plugin/appearance/cores/index.d.ts +3 -0
  57. package/dist/plugin/appearance/src/plugin/appearance/index.d.ts +8 -0
  58. package/dist/plugin/appearance/src/plugin/appearance/types/appearance.d.ts +6 -0
  59. package/dist/plugin/appearance/src/plugin/appearance/types/index.d.ts +13 -0
  60. package/dist/plugin/appearance/src/plugin/camera/constants/inedx.d.ts +4 -0
  61. package/dist/plugin/appearance/src/plugin/camera/cores/index.d.ts +3 -0
  62. package/dist/plugin/appearance/src/plugin/camera/index.d.ts +8 -0
  63. package/dist/plugin/appearance/src/plugin/camera/types/camera.d.ts +4 -0
  64. package/dist/plugin/appearance/src/plugin/camera/types/index.d.ts +13 -0
  65. package/dist/plugin/appearance/src/plugin/camera/utils/try-open-camera.d.ts +2 -0
  66. package/dist/plugin/appearance/src/plugin/clipboard/cores/index.d.ts +3 -0
  67. package/dist/plugin/appearance/src/plugin/clipboard/index.d.ts +5 -0
  68. package/dist/plugin/appearance/src/plugin/clipboard/types/clipboard.d.ts +4 -0
  69. package/dist/plugin/appearance/src/plugin/clipboard/types/index.d.ts +11 -0
  70. package/dist/plugin/appearance/src/plugin/fullscreen/cores/index.d.ts +35 -0
  71. package/dist/plugin/appearance/src/plugin/fullscreen/index.d.ts +5 -0
  72. package/dist/plugin/appearance/src/plugin/fullscreen/types/fullscreen.d.ts +17 -0
  73. package/dist/plugin/appearance/src/plugin/fullscreen/types/index.d.ts +11 -0
  74. package/dist/plugin/appearance/src/plugin/theme/constants/index.d.ts +14 -0
  75. package/dist/plugin/appearance/src/plugin/theme/cores/index.d.ts +3 -0
  76. package/dist/plugin/appearance/src/plugin/theme/errors/easing-error.d.ts +6 -0
  77. package/dist/plugin/appearance/src/plugin/theme/errors/unsupported-color-error.d.ts +2 -0
  78. package/dist/plugin/appearance/src/plugin/theme/index.d.ts +17 -0
  79. package/dist/plugin/appearance/src/plugin/theme/types/color.d.ts +17 -0
  80. package/dist/plugin/appearance/src/plugin/theme/types/easing-syntax.d.ts +16 -0
  81. package/dist/plugin/appearance/src/plugin/theme/types/index.d.ts +23 -0
  82. package/dist/plugin/appearance/src/plugin/theme/types/theme.d.ts +24 -0
  83. package/dist/plugin/appearance/src/plugin/theme/utils/parse-color.d.ts +2 -0
  84. package/dist/plugin/appearance/src/plugin/theme/utils/parse-easing-function.d.ts +2 -0
  85. package/dist/plugin/appearance/src/types/event-listener-util.d.ts +11 -0
  86. package/dist/plugin/appearance/src/types/index.d.ts +1 -0
  87. package/dist/plugin/appearance/src/types/native.d.ts +27 -0
  88. package/dist/plugin/appearance/src/types/platform.d.ts +16 -0
  89. package/dist/plugin/appearance/src/utils/assign.d.ts +1 -0
  90. package/dist/plugin/appearance/src/utils/compare-version.d.ts +1 -0
  91. package/dist/plugin/appearance/src/utils/create-custom-error.d.ts +6 -0
  92. package/dist/plugin/appearance/src/utils/create-hidden-element.d.ts +1 -0
  93. package/dist/plugin/appearance/src/utils/dispatch-click-event.d.ts +1 -0
  94. package/dist/plugin/appearance/src/utils/event-listener-utils.d.ts +3 -0
  95. package/dist/plugin/appearance/src/utils/get-topmost-window.d.ts +1 -0
  96. package/dist/plugin/appearance/src/utils/is-secure-context.d.ts +1 -0
  97. package/dist/plugin/camera/index.cjs +3 -3
  98. package/dist/plugin/camera/index.min.cjs +1 -1
  99. package/dist/plugin/camera/index.min.mjs +1 -1
  100. package/dist/plugin/camera/index.mjs +3 -3
  101. package/dist/plugin/camera/index.umd.js +3 -3
  102. package/dist/plugin/camera/index.umd.min.js +1 -1
  103. package/dist/plugin/camera/src/plugin/app/constants/index.d.ts +12 -0
  104. package/dist/plugin/camera/src/plugin/app/cores/index.d.ts +3 -0
  105. package/dist/plugin/camera/src/plugin/app/index.d.ts +1 -1
  106. package/dist/plugin/camera/src/plugin/app/types/app.d.ts +6 -1
  107. package/dist/plugin/camera/src/plugin/app/types/index.d.ts +2 -2
  108. package/dist/plugin/camera/src/plugin/appearance/constants/index.d.ts +11 -0
  109. package/dist/plugin/camera/src/plugin/appearance/cores/index.d.ts +3 -0
  110. package/dist/plugin/camera/src/plugin/appearance/index.d.ts +8 -0
  111. package/dist/plugin/camera/src/plugin/appearance/types/appearance.d.ts +6 -0
  112. package/dist/plugin/camera/src/plugin/appearance/types/index.d.ts +13 -0
  113. package/dist/plugin/camera/src/plugin/camera/constants/inedx.d.ts +4 -0
  114. package/dist/plugin/camera/src/plugin/camera/cores/index.d.ts +3 -0
  115. package/dist/plugin/camera/src/plugin/camera/index.d.ts +1 -1
  116. package/dist/plugin/camera/src/plugin/camera/types/camera.d.ts +1 -1
  117. package/dist/plugin/camera/src/plugin/camera/types/index.d.ts +1 -1
  118. package/dist/plugin/camera/src/plugin/camera/utils/try-open-camera.d.ts +1 -1
  119. package/dist/plugin/camera/src/plugin/clipboard/cores/index.d.ts +3 -0
  120. package/dist/plugin/camera/src/plugin/fullscreen/cores/index.d.ts +35 -0
  121. package/dist/plugin/camera/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
  122. package/dist/plugin/camera/src/plugin/theme/constants/index.d.ts +14 -0
  123. package/dist/plugin/camera/src/plugin/theme/cores/index.d.ts +3 -0
  124. package/dist/plugin/camera/src/plugin/theme/index.d.ts +1 -1
  125. package/dist/plugin/camera/src/plugin/theme/types/index.d.ts +1 -1
  126. package/dist/plugin/camera/src/plugin/theme/types/theme.d.ts +1 -1
  127. package/dist/plugin/clipboard/index.cjs +3 -3
  128. package/dist/plugin/clipboard/index.min.cjs +1 -1
  129. package/dist/plugin/clipboard/index.min.mjs +1 -1
  130. package/dist/plugin/clipboard/index.mjs +3 -3
  131. package/dist/plugin/clipboard/index.umd.js +3 -3
  132. package/dist/plugin/clipboard/index.umd.min.js +1 -1
  133. package/dist/plugin/clipboard/src/plugin/app/constants/index.d.ts +12 -0
  134. package/dist/plugin/clipboard/src/plugin/app/cores/index.d.ts +3 -0
  135. package/dist/plugin/clipboard/src/plugin/app/index.d.ts +1 -1
  136. package/dist/plugin/clipboard/src/plugin/app/types/app.d.ts +6 -1
  137. package/dist/plugin/clipboard/src/plugin/app/types/index.d.ts +2 -2
  138. package/dist/plugin/clipboard/src/plugin/appearance/constants/index.d.ts +11 -0
  139. package/dist/plugin/clipboard/src/plugin/appearance/cores/index.d.ts +3 -0
  140. package/dist/plugin/clipboard/src/plugin/appearance/index.d.ts +8 -0
  141. package/dist/plugin/clipboard/src/plugin/appearance/types/appearance.d.ts +6 -0
  142. package/dist/plugin/clipboard/src/plugin/appearance/types/index.d.ts +13 -0
  143. package/dist/plugin/clipboard/src/plugin/camera/constants/inedx.d.ts +4 -0
  144. package/dist/plugin/clipboard/src/plugin/camera/cores/index.d.ts +3 -0
  145. package/dist/plugin/clipboard/src/plugin/camera/index.d.ts +1 -1
  146. package/dist/plugin/clipboard/src/plugin/camera/types/camera.d.ts +1 -1
  147. package/dist/plugin/clipboard/src/plugin/camera/types/index.d.ts +1 -1
  148. package/dist/plugin/clipboard/src/plugin/camera/utils/try-open-camera.d.ts +1 -1
  149. package/dist/plugin/clipboard/src/plugin/clipboard/cores/index.d.ts +3 -0
  150. package/dist/plugin/clipboard/src/plugin/fullscreen/cores/index.d.ts +35 -0
  151. package/dist/plugin/clipboard/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
  152. package/dist/plugin/clipboard/src/plugin/theme/constants/index.d.ts +14 -0
  153. package/dist/plugin/clipboard/src/plugin/theme/cores/index.d.ts +3 -0
  154. package/dist/plugin/clipboard/src/plugin/theme/index.d.ts +1 -1
  155. package/dist/plugin/clipboard/src/plugin/theme/types/index.d.ts +1 -1
  156. package/dist/plugin/clipboard/src/plugin/theme/types/theme.d.ts +1 -1
  157. package/dist/plugin/fullscreen/index.cjs +322 -327
  158. package/dist/plugin/fullscreen/index.d.ts +10 -11
  159. package/dist/plugin/fullscreen/index.min.cjs +1 -1
  160. package/dist/plugin/fullscreen/index.min.mjs +1 -1
  161. package/dist/plugin/fullscreen/index.mjs +322 -327
  162. package/dist/plugin/fullscreen/index.umd.js +322 -327
  163. package/dist/plugin/fullscreen/index.umd.min.js +1 -1
  164. package/dist/plugin/fullscreen/src/plugin/app/constants/index.d.ts +12 -0
  165. package/dist/plugin/fullscreen/src/plugin/app/cores/index.d.ts +3 -0
  166. package/dist/plugin/fullscreen/src/plugin/app/index.d.ts +1 -1
  167. package/dist/plugin/fullscreen/src/plugin/app/types/app.d.ts +6 -1
  168. package/dist/plugin/fullscreen/src/plugin/app/types/index.d.ts +2 -2
  169. package/dist/plugin/fullscreen/src/plugin/appearance/constants/index.d.ts +11 -0
  170. package/dist/plugin/fullscreen/src/plugin/appearance/cores/index.d.ts +3 -0
  171. package/dist/plugin/fullscreen/src/plugin/appearance/index.d.ts +8 -0
  172. package/dist/plugin/fullscreen/src/plugin/appearance/types/appearance.d.ts +6 -0
  173. package/dist/plugin/fullscreen/src/plugin/appearance/types/index.d.ts +13 -0
  174. package/dist/plugin/fullscreen/src/plugin/camera/constants/inedx.d.ts +4 -0
  175. package/dist/plugin/fullscreen/src/plugin/camera/cores/index.d.ts +3 -0
  176. package/dist/plugin/fullscreen/src/plugin/camera/index.d.ts +1 -1
  177. package/dist/plugin/fullscreen/src/plugin/camera/types/camera.d.ts +1 -1
  178. package/dist/plugin/fullscreen/src/plugin/camera/types/index.d.ts +1 -1
  179. package/dist/plugin/fullscreen/src/plugin/camera/utils/try-open-camera.d.ts +1 -1
  180. package/dist/plugin/fullscreen/src/plugin/clipboard/cores/index.d.ts +3 -0
  181. package/dist/plugin/fullscreen/src/plugin/fullscreen/cores/index.d.ts +35 -0
  182. package/dist/plugin/fullscreen/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
  183. package/dist/plugin/fullscreen/src/plugin/theme/constants/index.d.ts +14 -0
  184. package/dist/plugin/fullscreen/src/plugin/theme/cores/index.d.ts +3 -0
  185. package/dist/plugin/fullscreen/src/plugin/theme/index.d.ts +1 -1
  186. package/dist/plugin/fullscreen/src/plugin/theme/types/index.d.ts +1 -1
  187. package/dist/plugin/fullscreen/src/plugin/theme/types/theme.d.ts +1 -1
  188. package/dist/plugin/theme/index.cjs +3 -3
  189. package/dist/plugin/theme/index.min.cjs +1 -1
  190. package/dist/plugin/theme/index.min.mjs +1 -1
  191. package/dist/plugin/theme/index.mjs +3 -3
  192. package/dist/plugin/theme/index.umd.js +3 -3
  193. package/dist/plugin/theme/index.umd.min.js +1 -1
  194. package/dist/plugin/theme/src/plugin/app/constants/index.d.ts +12 -0
  195. package/dist/plugin/theme/src/plugin/app/cores/index.d.ts +3 -0
  196. package/dist/plugin/theme/src/plugin/app/index.d.ts +1 -1
  197. package/dist/plugin/theme/src/plugin/app/types/app.d.ts +6 -1
  198. package/dist/plugin/theme/src/plugin/app/types/index.d.ts +2 -2
  199. package/dist/plugin/theme/src/plugin/appearance/constants/index.d.ts +11 -0
  200. package/dist/plugin/theme/src/plugin/appearance/cores/index.d.ts +3 -0
  201. package/dist/plugin/theme/src/plugin/appearance/index.d.ts +8 -0
  202. package/dist/plugin/theme/src/plugin/appearance/types/appearance.d.ts +6 -0
  203. package/dist/plugin/theme/src/plugin/appearance/types/index.d.ts +13 -0
  204. package/dist/plugin/theme/src/plugin/camera/constants/inedx.d.ts +4 -0
  205. package/dist/plugin/theme/src/plugin/camera/cores/index.d.ts +3 -0
  206. package/dist/plugin/theme/src/plugin/camera/index.d.ts +1 -1
  207. package/dist/plugin/theme/src/plugin/camera/types/camera.d.ts +1 -1
  208. package/dist/plugin/theme/src/plugin/camera/types/index.d.ts +1 -1
  209. package/dist/plugin/theme/src/plugin/camera/utils/try-open-camera.d.ts +1 -1
  210. package/dist/plugin/theme/src/plugin/clipboard/cores/index.d.ts +3 -0
  211. package/dist/plugin/theme/src/plugin/fullscreen/cores/index.d.ts +35 -0
  212. package/dist/plugin/theme/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
  213. package/dist/plugin/theme/src/plugin/theme/constants/index.d.ts +14 -0
  214. package/dist/plugin/theme/src/plugin/theme/cores/index.d.ts +3 -0
  215. package/dist/plugin/theme/src/plugin/theme/index.d.ts +1 -1
  216. package/dist/plugin/theme/src/plugin/theme/types/index.d.ts +1 -1
  217. package/dist/plugin/theme/src/plugin/theme/types/theme.d.ts +1 -1
  218. package/dist/src/plugin/app/constants/index.d.ts +12 -0
  219. package/dist/src/plugin/app/cores/index.d.ts +3 -0
  220. package/dist/src/plugin/app/index.d.ts +1 -1
  221. package/dist/src/plugin/app/types/app.d.ts +6 -1
  222. package/dist/src/plugin/app/types/index.d.ts +2 -2
  223. package/dist/src/plugin/appearance/constants/index.d.ts +11 -0
  224. package/dist/src/plugin/appearance/cores/index.d.ts +3 -0
  225. package/dist/src/plugin/appearance/index.d.ts +8 -0
  226. package/dist/src/plugin/appearance/types/appearance.d.ts +6 -0
  227. package/dist/src/plugin/appearance/types/index.d.ts +13 -0
  228. package/dist/src/plugin/camera/constants/inedx.d.ts +4 -0
  229. package/dist/src/plugin/camera/cores/index.d.ts +3 -0
  230. package/dist/src/plugin/camera/index.d.ts +1 -1
  231. package/dist/src/plugin/camera/types/camera.d.ts +1 -1
  232. package/dist/src/plugin/camera/types/index.d.ts +1 -1
  233. package/dist/src/plugin/camera/utils/try-open-camera.d.ts +1 -1
  234. package/dist/src/plugin/clipboard/cores/index.d.ts +3 -0
  235. package/dist/src/plugin/fullscreen/cores/index.d.ts +35 -0
  236. package/dist/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
  237. package/dist/src/plugin/theme/constants/index.d.ts +14 -0
  238. package/dist/src/plugin/theme/cores/index.d.ts +3 -0
  239. package/dist/src/plugin/theme/index.d.ts +1 -1
  240. package/dist/src/plugin/theme/types/index.d.ts +1 -1
  241. package/dist/src/plugin/theme/types/theme.d.ts +1 -1
  242. package/package.json +1 -1
@@ -256,7 +256,7 @@ function resolveSemanticAndroidVersion(version, defaultValue) {
256
256
  if (version.major === 21)
257
257
  return '5.0';
258
258
  if (version.major === 20)
259
- return '4.4W';
259
+ return '4.4';
260
260
  if (version.major === 19)
261
261
  return '4.4';
262
262
  if (version.major === 18)
@@ -490,6 +490,27 @@ Platform.isMobile = Platform.device === Devices.Mobile;
490
490
  Platform.isDesktop = Platform.device === Devices.Desktop;
491
491
  Platform.isStandalone = getIsStandalone(Platform.os);
492
492
 
493
+ var Index = {
494
+ get enabled() {
495
+ return getEnabled();
496
+ },
497
+ get element() {
498
+ return getElement();
499
+ },
500
+ get isFullscreen() {
501
+ return getIsFullscreen();
502
+ },
503
+ request: request,
504
+ exit: exit,
505
+ toggle: toggle,
506
+ onchange: onchange,
507
+ onerror: onerror,
508
+ };
509
+ var lastIOSVideo = null;
510
+ var lastElectronBrowserWindow = null;
511
+ var lastElectronBrowserWindowOptions = null;
512
+ var eventsBridged = false;
513
+ var api = detectApi();
493
514
  var API_VARIANTS = {
494
515
  standard: {
495
516
  enabled: 'fullscreenEnabled',
@@ -530,15 +551,15 @@ function detectApi() {
530
551
  var keys = ['webkit', 'moz', 'ms'];
531
552
  for (var i = 0; i < keys.length; i++) {
532
553
  var key = keys[i];
533
- var api = API_VARIANTS[key];
534
- if (api.enabled in globalThis.document || api.element in globalThis.document || api.exit in globalThis.document) {
554
+ var api_1 = API_VARIANTS[key];
555
+ if (api_1.enabled in globalThis.document || api_1.element in globalThis.document || api_1.exit in globalThis.document) {
535
556
  if (key === 'webkit' && 'webkitRequestFullScreen' in element)
536
- api.request = 'webkitRequestFullScreen';
537
- return api;
557
+ api_1.request = 'webkitRequestFullScreen';
558
+ return api_1;
538
559
  }
539
560
  }
540
561
  if ('webkitCurrentFullScreenElement' in globalThis.document) {
541
- var api = {
562
+ var api_2 = {
542
563
  enabled: 'webkitFullscreenEnabled',
543
564
  element: 'webkitCurrentFullScreenElement',
544
565
  request: 'webkitRequestFullscreen',
@@ -546,71 +567,79 @@ function detectApi() {
546
567
  events: API_VARIANTS.webkit.events,
547
568
  };
548
569
  if ('webkitRequestFullScreen' in element)
549
- api.request = 'webkitRequestFullScreen';
550
- return api;
570
+ api_2.request = 'webkitRequestFullScreen';
571
+ return api_2;
551
572
  }
552
573
  return null;
553
574
  }
554
- function createFullscreenUtils() {
555
- var api = detectApi();
556
- var lastIOSVideo = null;
557
- var lastElectronBrowserWindow = null;
558
- var lastElectronBrowserWindowOptions = null;
559
- var eventsBridged = false;
560
- function getDefaultTarget() {
561
- if (IS_ELECTRON) {
562
- var electron = require('electron');
563
- var focusedWindow = electron.BrowserWindow.getFocusedWindow();
564
- if (focusedWindow !== null)
565
- return focusedWindow;
566
- var allWindows = electron.BrowserWindow.getAllWindows();
567
- if (allWindows.length === 0)
568
- throw new Error();
569
- return allWindows[0];
570
- }
571
- if (OS.iOS === Platform.os) {
572
- var video = globalThis.document.querySelector('video');
573
- if (video === null)
574
- throw new Error();
575
- return video;
576
- }
577
- return globalThis.document.documentElement;
575
+ function getDefaultTarget() {
576
+ if (IS_ELECTRON) {
577
+ var electron = require('electron');
578
+ var focusedWindow = electron.BrowserWindow.getFocusedWindow();
579
+ if (focusedWindow !== null)
580
+ return focusedWindow;
581
+ var allWindows = electron.BrowserWindow.getAllWindows();
582
+ if (allWindows.length === 0)
583
+ throw new Error();
584
+ return allWindows[0];
578
585
  }
579
- function restoreElectronBrowserWindowOptions() {
580
- if (lastElectronBrowserWindowOptions !== null) {
581
- lastElectronBrowserWindow.fullScreenable = lastElectronBrowserWindowOptions.fullScreenable;
582
- lastElectronBrowserWindow.autoHideMenuBar = lastElectronBrowserWindowOptions.autoHideMenuBar;
583
- lastElectronBrowserWindowOptions = null;
584
- }
585
- lastElectronBrowserWindow = null;
586
+ if (OS.iOS === Platform.os) {
587
+ var video = globalThis.document.querySelector('video');
588
+ if (video === null)
589
+ throw new Error();
590
+ return video;
591
+ }
592
+ return globalThis.document.documentElement;
593
+ }
594
+ function restoreElectronBrowserWindowOptions() {
595
+ if (lastElectronBrowserWindowOptions !== null) {
596
+ lastElectronBrowserWindow.fullScreenable = lastElectronBrowserWindowOptions.fullScreenable;
597
+ lastElectronBrowserWindow.autoHideMenuBar = lastElectronBrowserWindowOptions.autoHideMenuBar;
598
+ lastElectronBrowserWindowOptions = null;
586
599
  }
587
- function bridgeEvents() {
588
- if (eventsBridged)
600
+ lastElectronBrowserWindow = null;
601
+ }
602
+ function bridgeEvents() {
603
+ if (eventsBridged)
604
+ return;
605
+ eventsBridged = true;
606
+ var dispatching = false;
607
+ function emit(type) {
608
+ if (dispatching)
589
609
  return;
590
- eventsBridged = true;
591
- var dispatching = false;
592
- function emit(type) {
593
- if (dispatching)
594
- return;
595
- dispatching = true;
596
- if (typeof globalThis.document !== 'undefined')
597
- globalThis.document.dispatchEvent(new Event(type, { bubbles: true, cancelable: false }));
598
- Promise.resolve().then(function () {
599
- dispatching = false;
600
- });
601
- }
602
- function emitChange() {
603
- emit('fullscreenchange');
604
- }
605
- function emitError() {
606
- emit('fullscreenerror');
607
- }
608
- if (IS_ELECTRON) {
609
- try {
610
- var electron = require('electron');
611
- var allWindows = electron.BrowserWindow.getAllWindows();
612
- var _loop_1 = function (i) {
613
- var currentWindow = allWindows[i];
610
+ dispatching = true;
611
+ if (typeof globalThis.document !== 'undefined')
612
+ globalThis.document.dispatchEvent(new Event(type, { bubbles: true, cancelable: false }));
613
+ Promise.resolve().then(function () {
614
+ dispatching = false;
615
+ });
616
+ }
617
+ function emitChange() {
618
+ emit('fullscreenchange');
619
+ }
620
+ function emitError() {
621
+ emit('fullscreenerror');
622
+ }
623
+ if (IS_ELECTRON) {
624
+ try {
625
+ var electron = require('electron');
626
+ var allWindows = electron.BrowserWindow.getAllWindows();
627
+ var _loop_1 = function (i) {
628
+ var currentWindow = allWindows[i];
629
+ currentWindow.on('enter-full-screen', function () {
630
+ lastElectronBrowserWindow = currentWindow;
631
+ emitChange();
632
+ });
633
+ currentWindow.on('leave-full-screen', function () {
634
+ restoreElectronBrowserWindowOptions();
635
+ emitChange();
636
+ });
637
+ };
638
+ for (var i = 0; i < allWindows.length; i++) {
639
+ _loop_1(i);
640
+ }
641
+ if (typeof electron.BrowserWindow.on === 'function') {
642
+ electron.BrowserWindow.on('browser-window-created', function (_, currentWindow) {
614
643
  currentWindow.on('enter-full-screen', function () {
615
644
  lastElectronBrowserWindow = currentWindow;
616
645
  emitChange();
@@ -619,223 +648,145 @@ function createFullscreenUtils() {
619
648
  restoreElectronBrowserWindowOptions();
620
649
  emitChange();
621
650
  });
622
- };
623
- for (var i = 0; i < allWindows.length; i++) {
624
- _loop_1(i);
625
- }
626
- if (typeof electron.BrowserWindow.on === 'function') {
627
- electron.BrowserWindow.on('browser-window-created', function (_, currentWindow) {
628
- currentWindow.on('enter-full-screen', function () {
629
- lastElectronBrowserWindow = currentWindow;
630
- emitChange();
631
- });
632
- currentWindow.on('leave-full-screen', function () {
633
- restoreElectronBrowserWindowOptions();
634
- emitChange();
635
- });
636
- });
637
- }
638
- }
639
- catch (_) {
640
- }
641
- }
642
- var changeEvents = ['webkitfullscreenchange', 'mozfullscreenchange', 'MSFullscreenChange'];
643
- var errorEvents = ['webkitfullscreenerror', 'mozfullscreenerror', 'MSFullscreenError'];
644
- for (var i = 0; i < changeEvents.length; i++) {
645
- if (typeof globalThis.document !== 'undefined')
646
- globalThis.document.addEventListener(changeEvents[i], emitChange, false);
647
- }
648
- for (var i = 0; i < errorEvents.length; i++) {
649
- if (typeof globalThis.document !== 'undefined')
650
- globalThis.document.addEventListener(errorEvents[i], emitError, false);
651
- }
652
- if (OS.iOS === Platform.os) {
653
- bridgeIOSVideoEvents();
654
- if (typeof globalThis.MutationObserver !== 'undefined') {
655
- var observer = new MutationObserver(function () {
656
- bridgeIOSVideoEvents();
657
651
  });
658
- observer.observe(globalThis.document.documentElement, { childList: true, subtree: true });
659
652
  }
660
653
  }
654
+ catch (_) {
655
+ }
661
656
  }
662
- function bridgeIOSVideoEvents() {
663
- if (typeof globalThis.document !== 'undefined') {
664
- var videos = globalThis.document.querySelectorAll('video');
665
- videos.forEach(function (video) {
666
- if (video.__fsBridged__ || !('webkitEnterFullscreen' in video || 'onwebkitbeginfullscreen' in video))
667
- return;
668
- function emitChange() {
669
- globalThis.document.dispatchEvent(new Event('fullscreenchange'));
670
- }
671
- video.addEventListener('webkitbeginfullscreen', emitChange, false);
672
- video.addEventListener('webkitendfullscreen', emitChange, false);
673
- video.__fsBridged__ = true;
657
+ var changeEvents = ['webkitfullscreenchange', 'mozfullscreenchange', 'MSFullscreenChange'];
658
+ var errorEvents = ['webkitfullscreenerror', 'mozfullscreenerror', 'MSFullscreenError'];
659
+ for (var i = 0; i < changeEvents.length; i++) {
660
+ if (typeof globalThis.document !== 'undefined')
661
+ globalThis.document.addEventListener(changeEvents[i], emitChange, false);
662
+ }
663
+ for (var i = 0; i < errorEvents.length; i++) {
664
+ if (typeof globalThis.document !== 'undefined')
665
+ globalThis.document.addEventListener(errorEvents[i], emitError, false);
666
+ }
667
+ if (OS.iOS === Platform.os) {
668
+ bridgeIOSVideoEvents();
669
+ if (typeof globalThis.MutationObserver !== 'undefined') {
670
+ var observer = new MutationObserver(function () {
671
+ bridgeIOSVideoEvents();
674
672
  });
673
+ observer.observe(globalThis.document.documentElement, { childList: true, subtree: true });
675
674
  }
676
675
  }
677
- function getEnabled() {
678
- if (IS_ELECTRON) {
679
- try {
680
- var electron = require('electron');
681
- return typeof electron.BrowserWindow.prototype.setFullScreen === 'function';
682
- }
683
- catch (_) {
684
- return false;
676
+ }
677
+ function bridgeIOSVideoEvents() {
678
+ if (typeof globalThis.document !== 'undefined') {
679
+ var videos = globalThis.document.querySelectorAll('video');
680
+ videos.forEach(function (video) {
681
+ if (video.__fsBridged__ || !('webkitEnterFullscreen' in video || 'onwebkitbeginfullscreen' in video))
682
+ return;
683
+ function emitChange() {
684
+ globalThis.document.dispatchEvent(new Event('fullscreenchange'));
685
685
  }
686
+ video.addEventListener('webkitbeginfullscreen', emitChange, false);
687
+ video.addEventListener('webkitendfullscreen', emitChange, false);
688
+ video.__fsBridged__ = true;
689
+ });
690
+ }
691
+ }
692
+ function getEnabled() {
693
+ if (IS_ELECTRON) {
694
+ try {
695
+ var electron = require('electron');
696
+ return typeof electron.BrowserWindow.prototype.setFullScreen === 'function';
686
697
  }
687
- if (api === null) {
688
- if (OS.iOS !== Platform.os)
689
- return false;
690
- var videos = globalThis.document.querySelectorAll('video');
691
- for (var i = 0; i < videos.length; i++) {
692
- var video = videos[i];
693
- if (video.webkitSupportsFullscreen || 'webkitEnterFullscreen' in video)
694
- return true;
695
- }
698
+ catch (_) {
696
699
  return false;
697
700
  }
698
- var enabledValue = globalThis.document[api.enabled];
699
- if (typeof enabledValue === 'boolean')
700
- return enabledValue;
701
- return typeof globalThis.document[api.element] !== 'undefined';
702
- }
703
- function getElement() {
704
- if (IS_ELECTRON) {
705
- if (lastElectronBrowserWindow !== null)
706
- return lastElectronBrowserWindow;
707
- try {
708
- var electron = require('electron');
709
- var allWindows = electron.BrowserWindow.getAllWindows();
710
- for (var i = 0; i < allWindows.length; i++) {
711
- var currentWindow = allWindows[i];
712
- if (currentWindow.isFullScreen() || (Platform.os === OS.MacOS && typeof currentWindow.isSimpleFullScreen === 'function' && currentWindow.isSimpleFullScreen()))
713
- return currentWindow;
714
- }
715
- return null;
716
- }
717
- catch (_) {
718
- return null;
701
+ }
702
+ if (api === null) {
703
+ if (OS.iOS !== Platform.os)
704
+ return false;
705
+ var videos = globalThis.document.querySelectorAll('video');
706
+ for (var i = 0; i < videos.length; i++) {
707
+ var video = videos[i];
708
+ if (video.webkitSupportsFullscreen || 'webkitEnterFullscreen' in video)
709
+ return true;
710
+ }
711
+ return false;
712
+ }
713
+ var enabledValue = globalThis.document[api.enabled];
714
+ if (typeof enabledValue === 'boolean')
715
+ return enabledValue;
716
+ return typeof globalThis.document[api.element] !== 'undefined';
717
+ }
718
+ function getElement() {
719
+ if (IS_ELECTRON) {
720
+ if (lastElectronBrowserWindow !== null)
721
+ return lastElectronBrowserWindow;
722
+ try {
723
+ var electron = require('electron');
724
+ var allWindows = electron.BrowserWindow.getAllWindows();
725
+ for (var i = 0; i < allWindows.length; i++) {
726
+ var currentWindow = allWindows[i];
727
+ if (currentWindow.isFullScreen() || (Platform.os === OS.MacOS && typeof currentWindow.isSimpleFullScreen === 'function' && currentWindow.isSimpleFullScreen()))
728
+ return currentWindow;
719
729
  }
730
+ return null;
720
731
  }
721
- if (api === null) {
722
- if (lastIOSVideo && lastIOSVideo.webkitDisplayingFullscreen)
723
- return lastIOSVideo;
732
+ catch (_) {
724
733
  return null;
725
734
  }
726
- var currentElement = globalThis.document[api.element];
727
- if (currentElement !== null && currentElement !== undefined)
728
- return currentElement;
729
- return null;
730
735
  }
731
- function getIsFullscreen() {
732
- return getElement() !== null;
736
+ if (api === null) {
737
+ if (lastIOSVideo && lastIOSVideo.webkitDisplayingFullscreen)
738
+ return lastIOSVideo;
739
+ return null;
733
740
  }
734
- function request(target, options) {
735
- if (target === void 0) { target = getDefaultTarget(); }
736
- if (IS_ELECTRON) {
737
- var browserWindow_1 = target;
738
- return new Promise(function (resolve, reject) {
739
- try {
740
- if (lastElectronBrowserWindow === null) {
741
- lastElectronBrowserWindowOptions = {
742
- fullScreenable: browserWindow_1.fullScreenable,
743
- autoHideMenuBar: browserWindow_1.autoHideMenuBar,
744
- };
745
- browserWindow_1.fullScreenable = true;
746
- browserWindow_1.autoHideMenuBar = true;
747
- }
748
- browserWindow_1.setFullScreen(true);
749
- lastElectronBrowserWindow = browserWindow_1;
750
- resolve();
751
- return;
752
- }
753
- catch (_) {
754
- reject();
755
- }
756
- });
757
- }
741
+ var currentElement = globalThis.document[api.element];
742
+ if (currentElement !== null && currentElement !== undefined)
743
+ return currentElement;
744
+ return null;
745
+ }
746
+ function getIsFullscreen() {
747
+ return getElement() !== null;
748
+ }
749
+ function request(target, options) {
750
+ if (target === void 0) { target = getDefaultTarget(); }
751
+ if (IS_ELECTRON) {
752
+ var browserWindow_1 = target;
758
753
  return new Promise(function (resolve, reject) {
759
- if (api !== null) {
760
- var method = target[api.request];
761
- if (typeof method === 'function') {
762
- try {
763
- var result = method.call(target, options);
764
- if (result !== undefined && typeof result.then === 'function') {
765
- result
766
- .then(function () {
767
- resolve();
768
- })
769
- .catch(function () {
770
- if (OS.iOS !== Platform.os) {
771
- reject();
772
- return;
773
- }
774
- fallbackToIOSVideo();
775
- });
776
- return;
777
- }
778
- else {
779
- resolve();
780
- return;
781
- }
782
- }
783
- catch (error) {
784
- if (OS.iOS !== Platform.os) {
785
- reject();
786
- return;
787
- }
788
- }
754
+ try {
755
+ if (lastElectronBrowserWindow === null) {
756
+ lastElectronBrowserWindowOptions = {
757
+ fullScreenable: browserWindow_1.fullScreenable,
758
+ autoHideMenuBar: browserWindow_1.autoHideMenuBar,
759
+ };
760
+ browserWindow_1.fullScreenable = true;
761
+ browserWindow_1.autoHideMenuBar = true;
789
762
  }
763
+ browserWindow_1.setFullScreen(true);
764
+ lastElectronBrowserWindow = browserWindow_1;
765
+ resolve();
766
+ return;
790
767
  }
791
- function fallbackToIOSVideo() {
792
- if (OS.iOS === Platform.os && target.tagName.toUpperCase() === 'VIDEO') {
793
- var video = target;
794
- if (video.webkitSupportsFullscreen && typeof video.webkitEnterFullscreen === 'function') {
795
- lastIOSVideo = video;
796
- bridgeIOSVideoEvents();
797
- video.webkitEnterFullscreen();
798
- resolve();
799
- return;
800
- }
801
- }
768
+ catch (_) {
802
769
  reject();
803
770
  }
804
- fallbackToIOSVideo();
805
771
  });
806
772
  }
807
- function exit() {
808
- if (IS_ELECTRON) {
809
- return new Promise(function (resolve, reject) {
773
+ return new Promise(function (resolve, reject) {
774
+ if (api !== null) {
775
+ var method = target[api.request];
776
+ if (typeof method === 'function') {
810
777
  try {
811
- if (lastElectronBrowserWindow !== null) {
812
- lastElectronBrowserWindow.setFullScreen(false);
813
- restoreElectronBrowserWindowOptions();
814
- }
815
- else {
816
- var browserWindow = getElement();
817
- if (browserWindow !== null)
818
- browserWindow.setFullScreen(false);
819
- }
820
- resolve();
821
- }
822
- catch (_) {
823
- reject();
824
- }
825
- });
826
- }
827
- return new Promise(function (resolve, reject) {
828
- if (api !== null) {
829
- var method = globalThis.document[api.exit];
830
- if (typeof method === 'function') {
831
- var result = method.call(globalThis.document);
778
+ var result = method.call(target, options);
832
779
  if (result !== undefined && typeof result.then === 'function') {
833
780
  result
834
781
  .then(function () {
835
782
  resolve();
836
783
  })
837
784
  .catch(function () {
838
- reject();
785
+ if (OS.iOS !== Platform.os) {
786
+ reject();
787
+ return;
788
+ }
789
+ fallbackToIOSVideo();
839
790
  });
840
791
  return;
841
792
  }
@@ -844,103 +795,147 @@ function createFullscreenUtils() {
844
795
  return;
845
796
  }
846
797
  }
798
+ catch (error) {
799
+ if (OS.iOS !== Platform.os) {
800
+ reject();
801
+ return;
802
+ }
803
+ }
847
804
  }
848
- if (OS.iOS === Platform.os && lastIOSVideo !== null) {
849
- if (typeof lastIOSVideo.webkitExitFullscreen === 'function' && lastIOSVideo.webkitDisplayingFullscreen === true) {
850
- lastIOSVideo.webkitExitFullscreen();
851
- lastIOSVideo = null;
805
+ }
806
+ function fallbackToIOSVideo() {
807
+ if (OS.iOS === Platform.os && target.tagName.toUpperCase() === 'VIDEO') {
808
+ var video = target;
809
+ if (video.webkitSupportsFullscreen && typeof video.webkitEnterFullscreen === 'function') {
810
+ lastIOSVideo = video;
811
+ bridgeIOSVideoEvents();
812
+ video.webkitEnterFullscreen();
852
813
  resolve();
853
814
  return;
854
815
  }
855
- var videos = globalThis.document.querySelectorAll('video');
856
- for (var i = 0; i < videos.length; i++) {
857
- var video = videos[i];
858
- if (typeof video.webkitExitFullscreen === 'function' && video.webkitDisplayingFullscreen === true) {
859
- video.webkitExitFullscreen();
860
- resolve();
861
- return;
862
- }
863
- }
864
816
  }
865
- if (!getElement()) {
817
+ reject();
818
+ }
819
+ fallbackToIOSVideo();
820
+ });
821
+ }
822
+ function exit() {
823
+ if (IS_ELECTRON) {
824
+ return new Promise(function (resolve, reject) {
825
+ try {
826
+ if (lastElectronBrowserWindow !== null) {
827
+ lastElectronBrowserWindow.setFullScreen(false);
828
+ restoreElectronBrowserWindowOptions();
829
+ }
830
+ else {
831
+ var browserWindow = getElement();
832
+ if (browserWindow !== null)
833
+ browserWindow.setFullScreen(false);
834
+ }
866
835
  resolve();
867
- return;
868
836
  }
869
- reject();
837
+ catch (_) {
838
+ reject();
839
+ }
870
840
  });
871
841
  }
872
- function toggle(target, options) {
873
- if (getIsFullscreen())
874
- return exit();
875
- else
876
- return request(target, options);
877
- }
878
- function onChange(handler) {
879
- var listeners = [];
880
- function listen(eventType) {
881
- function wrapper(event) {
882
- handler(event);
842
+ return new Promise(function (resolve, reject) {
843
+ if (api !== null) {
844
+ var method = globalThis.document[api.exit];
845
+ if (typeof method === 'function') {
846
+ var result = method.call(globalThis.document);
847
+ if (result !== undefined && typeof result.then === 'function') {
848
+ result
849
+ .then(function () {
850
+ resolve();
851
+ })
852
+ .catch(function () {
853
+ reject();
854
+ });
855
+ return;
856
+ }
857
+ else {
858
+ resolve();
859
+ return;
860
+ }
883
861
  }
884
- if (typeof globalThis.document === 'undefined')
862
+ }
863
+ if (OS.iOS === Platform.os && lastIOSVideo !== null) {
864
+ if (typeof lastIOSVideo.webkitExitFullscreen === 'function' && lastIOSVideo.webkitDisplayingFullscreen === true) {
865
+ lastIOSVideo.webkitExitFullscreen();
866
+ lastIOSVideo = null;
867
+ resolve();
885
868
  return;
886
- globalThis.document.addEventListener(eventType, wrapper, false);
887
- listeners.push(function () {
888
- globalThis.document.removeEventListener(eventType, wrapper, false);
889
- });
869
+ }
870
+ var videos = globalThis.document.querySelectorAll('video');
871
+ for (var i = 0; i < videos.length; i++) {
872
+ var video = videos[i];
873
+ if (typeof video.webkitExitFullscreen === 'function' && video.webkitDisplayingFullscreen === true) {
874
+ video.webkitExitFullscreen();
875
+ resolve();
876
+ return;
877
+ }
878
+ }
890
879
  }
891
- listen('fullscreenchange');
892
- return function () {
893
- listeners.forEach(function (cleanup) {
894
- cleanup();
895
- });
896
- };
880
+ if (!getElement()) {
881
+ resolve();
882
+ return;
883
+ }
884
+ reject();
885
+ });
886
+ }
887
+ function toggle(target, options) {
888
+ if (getIsFullscreen())
889
+ return exit();
890
+ else
891
+ return request(target, options);
892
+ }
893
+ function onchange(handler) {
894
+ var listeners = [];
895
+ function listen(eventType) {
896
+ function wrapper(event) {
897
+ handler(event);
898
+ }
899
+ if (typeof globalThis.document === 'undefined')
900
+ return;
901
+ globalThis.document.addEventListener(eventType, wrapper, false);
902
+ listeners.push(function () {
903
+ globalThis.document.removeEventListener(eventType, wrapper, false);
904
+ });
897
905
  }
898
- function onError(handler) {
899
- var listeners = [];
900
- function listen(eventType) {
901
- function wrapper(event) {
902
- handler(event);
903
- }
904
- if (typeof globalThis.document === 'undefined')
905
- return;
906
- globalThis.document.addEventListener(eventType, wrapper, false);
907
- listeners.push(function () {
908
- globalThis.document.removeEventListener(eventType, wrapper, false);
909
- });
906
+ listen('fullscreenchange');
907
+ return function () {
908
+ for (var i = 0; i < listeners.length; i++) {
909
+ listeners[i]();
910
910
  }
911
- listen('fullscreenerror');
912
- return function () {
913
- listeners.forEach(function (cleanup) {
914
- cleanup();
915
- });
916
- };
911
+ };
912
+ }
913
+ function onerror(handler) {
914
+ var listeners = [];
915
+ function listen(eventType) {
916
+ function wrapper(event) {
917
+ handler(event);
918
+ }
919
+ if (typeof globalThis.document === 'undefined')
920
+ return;
921
+ globalThis.document.addEventListener(eventType, wrapper, false);
922
+ listeners.push(function () {
923
+ globalThis.document.removeEventListener(eventType, wrapper, false);
924
+ });
917
925
  }
918
- bridgeEvents();
919
- return {
920
- get enabled() {
921
- return getEnabled();
922
- },
923
- get element() {
924
- return getElement();
925
- },
926
- get isFullscreen() {
927
- return getIsFullscreen();
928
- },
929
- request: request,
930
- exit: exit,
931
- toggle: toggle,
932
- onChange: onChange,
933
- onError: onError,
926
+ listen('fullscreenerror');
927
+ return function () {
928
+ for (var i = 0; i < listeners.length; i++) {
929
+ listeners[i]();
930
+ }
934
931
  };
935
932
  }
936
- var FullscreenUtils = createFullscreenUtils();
937
-
938
- var Fullscreen = FullscreenUtils;
933
+ bridgeEvents();
939
934
 
940
935
  var NativeFullscreenPlugin = {
941
936
  installed: false,
942
937
  name: 'Fullscreen',
943
- module: Fullscreen,
938
+ module: Index,
944
939
  Constants: {},
945
940
  Errors: {}
946
941
  };