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
@@ -254,7 +254,7 @@ function resolveSemanticAndroidVersion(version, defaultValue) {
254
254
  if (version.major === 21)
255
255
  return '5.0';
256
256
  if (version.major === 20)
257
- return '4.4W';
257
+ return '4.4';
258
258
  if (version.major === 19)
259
259
  return '4.4';
260
260
  if (version.major === 18)
@@ -488,6 +488,27 @@ Platform.isMobile = Platform.device === Devices.Mobile;
488
488
  Platform.isDesktop = Platform.device === Devices.Desktop;
489
489
  Platform.isStandalone = getIsStandalone(Platform.os);
490
490
 
491
+ var Index = {
492
+ get enabled() {
493
+ return getEnabled();
494
+ },
495
+ get element() {
496
+ return getElement();
497
+ },
498
+ get isFullscreen() {
499
+ return getIsFullscreen();
500
+ },
501
+ request: request,
502
+ exit: exit,
503
+ toggle: toggle,
504
+ onchange: onchange,
505
+ onerror: onerror,
506
+ };
507
+ var lastIOSVideo = null;
508
+ var lastElectronBrowserWindow = null;
509
+ var lastElectronBrowserWindowOptions = null;
510
+ var eventsBridged = false;
511
+ var api = detectApi();
491
512
  var API_VARIANTS = {
492
513
  standard: {
493
514
  enabled: 'fullscreenEnabled',
@@ -528,15 +549,15 @@ function detectApi() {
528
549
  var keys = ['webkit', 'moz', 'ms'];
529
550
  for (var i = 0; i < keys.length; i++) {
530
551
  var key = keys[i];
531
- var api = API_VARIANTS[key];
532
- if (api.enabled in globalThis.document || api.element in globalThis.document || api.exit in globalThis.document) {
552
+ var api_1 = API_VARIANTS[key];
553
+ if (api_1.enabled in globalThis.document || api_1.element in globalThis.document || api_1.exit in globalThis.document) {
533
554
  if (key === 'webkit' && 'webkitRequestFullScreen' in element)
534
- api.request = 'webkitRequestFullScreen';
535
- return api;
555
+ api_1.request = 'webkitRequestFullScreen';
556
+ return api_1;
536
557
  }
537
558
  }
538
559
  if ('webkitCurrentFullScreenElement' in globalThis.document) {
539
- var api = {
560
+ var api_2 = {
540
561
  enabled: 'webkitFullscreenEnabled',
541
562
  element: 'webkitCurrentFullScreenElement',
542
563
  request: 'webkitRequestFullscreen',
@@ -544,71 +565,79 @@ function detectApi() {
544
565
  events: API_VARIANTS.webkit.events,
545
566
  };
546
567
  if ('webkitRequestFullScreen' in element)
547
- api.request = 'webkitRequestFullScreen';
548
- return api;
568
+ api_2.request = 'webkitRequestFullScreen';
569
+ return api_2;
549
570
  }
550
571
  return null;
551
572
  }
552
- function createFullscreenUtils() {
553
- var api = detectApi();
554
- var lastIOSVideo = null;
555
- var lastElectronBrowserWindow = null;
556
- var lastElectronBrowserWindowOptions = null;
557
- var eventsBridged = false;
558
- function getDefaultTarget() {
559
- if (IS_ELECTRON) {
560
- var electron = require('electron');
561
- var focusedWindow = electron.BrowserWindow.getFocusedWindow();
562
- if (focusedWindow !== null)
563
- return focusedWindow;
564
- var allWindows = electron.BrowserWindow.getAllWindows();
565
- if (allWindows.length === 0)
566
- throw new Error();
567
- return allWindows[0];
568
- }
569
- if (OS.iOS === Platform.os) {
570
- var video = globalThis.document.querySelector('video');
571
- if (video === null)
572
- throw new Error();
573
- return video;
574
- }
575
- return globalThis.document.documentElement;
573
+ function getDefaultTarget() {
574
+ if (IS_ELECTRON) {
575
+ var electron = require('electron');
576
+ var focusedWindow = electron.BrowserWindow.getFocusedWindow();
577
+ if (focusedWindow !== null)
578
+ return focusedWindow;
579
+ var allWindows = electron.BrowserWindow.getAllWindows();
580
+ if (allWindows.length === 0)
581
+ throw new Error();
582
+ return allWindows[0];
576
583
  }
577
- function restoreElectronBrowserWindowOptions() {
578
- if (lastElectronBrowserWindowOptions !== null) {
579
- lastElectronBrowserWindow.fullScreenable = lastElectronBrowserWindowOptions.fullScreenable;
580
- lastElectronBrowserWindow.autoHideMenuBar = lastElectronBrowserWindowOptions.autoHideMenuBar;
581
- lastElectronBrowserWindowOptions = null;
582
- }
583
- lastElectronBrowserWindow = null;
584
+ if (OS.iOS === Platform.os) {
585
+ var video = globalThis.document.querySelector('video');
586
+ if (video === null)
587
+ throw new Error();
588
+ return video;
589
+ }
590
+ return globalThis.document.documentElement;
591
+ }
592
+ function restoreElectronBrowserWindowOptions() {
593
+ if (lastElectronBrowserWindowOptions !== null) {
594
+ lastElectronBrowserWindow.fullScreenable = lastElectronBrowserWindowOptions.fullScreenable;
595
+ lastElectronBrowserWindow.autoHideMenuBar = lastElectronBrowserWindowOptions.autoHideMenuBar;
596
+ lastElectronBrowserWindowOptions = null;
584
597
  }
585
- function bridgeEvents() {
586
- if (eventsBridged)
598
+ lastElectronBrowserWindow = null;
599
+ }
600
+ function bridgeEvents() {
601
+ if (eventsBridged)
602
+ return;
603
+ eventsBridged = true;
604
+ var dispatching = false;
605
+ function emit(type) {
606
+ if (dispatching)
587
607
  return;
588
- eventsBridged = true;
589
- var dispatching = false;
590
- function emit(type) {
591
- if (dispatching)
592
- return;
593
- dispatching = true;
594
- if (typeof globalThis.document !== 'undefined')
595
- globalThis.document.dispatchEvent(new Event(type, { bubbles: true, cancelable: false }));
596
- Promise.resolve().then(function () {
597
- dispatching = false;
598
- });
599
- }
600
- function emitChange() {
601
- emit('fullscreenchange');
602
- }
603
- function emitError() {
604
- emit('fullscreenerror');
605
- }
606
- if (IS_ELECTRON) {
607
- try {
608
- var electron = require('electron');
609
- var allWindows = electron.BrowserWindow.getAllWindows();
610
- var _loop_1 = function (i) {
611
- var currentWindow = allWindows[i];
608
+ dispatching = true;
609
+ if (typeof globalThis.document !== 'undefined')
610
+ globalThis.document.dispatchEvent(new Event(type, { bubbles: true, cancelable: false }));
611
+ Promise.resolve().then(function () {
612
+ dispatching = false;
613
+ });
614
+ }
615
+ function emitChange() {
616
+ emit('fullscreenchange');
617
+ }
618
+ function emitError() {
619
+ emit('fullscreenerror');
620
+ }
621
+ if (IS_ELECTRON) {
622
+ try {
623
+ var electron = require('electron');
624
+ var allWindows = electron.BrowserWindow.getAllWindows();
625
+ var _loop_1 = function (i) {
626
+ var currentWindow = allWindows[i];
627
+ currentWindow.on('enter-full-screen', function () {
628
+ lastElectronBrowserWindow = currentWindow;
629
+ emitChange();
630
+ });
631
+ currentWindow.on('leave-full-screen', function () {
632
+ restoreElectronBrowserWindowOptions();
633
+ emitChange();
634
+ });
635
+ };
636
+ for (var i = 0; i < allWindows.length; i++) {
637
+ _loop_1(i);
638
+ }
639
+ if (typeof electron.BrowserWindow.on === 'function') {
640
+ electron.BrowserWindow.on('browser-window-created', function (_, currentWindow) {
612
641
  currentWindow.on('enter-full-screen', function () {
613
642
  lastElectronBrowserWindow = currentWindow;
614
643
  emitChange();
@@ -617,223 +646,145 @@ function createFullscreenUtils() {
617
646
  restoreElectronBrowserWindowOptions();
618
647
  emitChange();
619
648
  });
620
- };
621
- for (var i = 0; i < allWindows.length; i++) {
622
- _loop_1(i);
623
- }
624
- if (typeof electron.BrowserWindow.on === 'function') {
625
- electron.BrowserWindow.on('browser-window-created', function (_, currentWindow) {
626
- currentWindow.on('enter-full-screen', function () {
627
- lastElectronBrowserWindow = currentWindow;
628
- emitChange();
629
- });
630
- currentWindow.on('leave-full-screen', function () {
631
- restoreElectronBrowserWindowOptions();
632
- emitChange();
633
- });
634
- });
635
- }
636
- }
637
- catch (_) {
638
- }
639
- }
640
- var changeEvents = ['webkitfullscreenchange', 'mozfullscreenchange', 'MSFullscreenChange'];
641
- var errorEvents = ['webkitfullscreenerror', 'mozfullscreenerror', 'MSFullscreenError'];
642
- for (var i = 0; i < changeEvents.length; i++) {
643
- if (typeof globalThis.document !== 'undefined')
644
- globalThis.document.addEventListener(changeEvents[i], emitChange, false);
645
- }
646
- for (var i = 0; i < errorEvents.length; i++) {
647
- if (typeof globalThis.document !== 'undefined')
648
- globalThis.document.addEventListener(errorEvents[i], emitError, false);
649
- }
650
- if (OS.iOS === Platform.os) {
651
- bridgeIOSVideoEvents();
652
- if (typeof globalThis.MutationObserver !== 'undefined') {
653
- var observer = new MutationObserver(function () {
654
- bridgeIOSVideoEvents();
655
649
  });
656
- observer.observe(globalThis.document.documentElement, { childList: true, subtree: true });
657
650
  }
658
651
  }
652
+ catch (_) {
653
+ }
659
654
  }
660
- function bridgeIOSVideoEvents() {
661
- if (typeof globalThis.document !== 'undefined') {
662
- var videos = globalThis.document.querySelectorAll('video');
663
- videos.forEach(function (video) {
664
- if (video.__fsBridged__ || !('webkitEnterFullscreen' in video || 'onwebkitbeginfullscreen' in video))
665
- return;
666
- function emitChange() {
667
- globalThis.document.dispatchEvent(new Event('fullscreenchange'));
668
- }
669
- video.addEventListener('webkitbeginfullscreen', emitChange, false);
670
- video.addEventListener('webkitendfullscreen', emitChange, false);
671
- video.__fsBridged__ = true;
655
+ var changeEvents = ['webkitfullscreenchange', 'mozfullscreenchange', 'MSFullscreenChange'];
656
+ var errorEvents = ['webkitfullscreenerror', 'mozfullscreenerror', 'MSFullscreenError'];
657
+ for (var i = 0; i < changeEvents.length; i++) {
658
+ if (typeof globalThis.document !== 'undefined')
659
+ globalThis.document.addEventListener(changeEvents[i], emitChange, false);
660
+ }
661
+ for (var i = 0; i < errorEvents.length; i++) {
662
+ if (typeof globalThis.document !== 'undefined')
663
+ globalThis.document.addEventListener(errorEvents[i], emitError, false);
664
+ }
665
+ if (OS.iOS === Platform.os) {
666
+ bridgeIOSVideoEvents();
667
+ if (typeof globalThis.MutationObserver !== 'undefined') {
668
+ var observer = new MutationObserver(function () {
669
+ bridgeIOSVideoEvents();
672
670
  });
671
+ observer.observe(globalThis.document.documentElement, { childList: true, subtree: true });
673
672
  }
674
673
  }
675
- function getEnabled() {
676
- if (IS_ELECTRON) {
677
- try {
678
- var electron = require('electron');
679
- return typeof electron.BrowserWindow.prototype.setFullScreen === 'function';
680
- }
681
- catch (_) {
682
- return false;
674
+ }
675
+ function bridgeIOSVideoEvents() {
676
+ if (typeof globalThis.document !== 'undefined') {
677
+ var videos = globalThis.document.querySelectorAll('video');
678
+ videos.forEach(function (video) {
679
+ if (video.__fsBridged__ || !('webkitEnterFullscreen' in video || 'onwebkitbeginfullscreen' in video))
680
+ return;
681
+ function emitChange() {
682
+ globalThis.document.dispatchEvent(new Event('fullscreenchange'));
683
683
  }
684
+ video.addEventListener('webkitbeginfullscreen', emitChange, false);
685
+ video.addEventListener('webkitendfullscreen', emitChange, false);
686
+ video.__fsBridged__ = true;
687
+ });
688
+ }
689
+ }
690
+ function getEnabled() {
691
+ if (IS_ELECTRON) {
692
+ try {
693
+ var electron = require('electron');
694
+ return typeof electron.BrowserWindow.prototype.setFullScreen === 'function';
684
695
  }
685
- if (api === null) {
686
- if (OS.iOS !== Platform.os)
687
- return false;
688
- var videos = globalThis.document.querySelectorAll('video');
689
- for (var i = 0; i < videos.length; i++) {
690
- var video = videos[i];
691
- if (video.webkitSupportsFullscreen || 'webkitEnterFullscreen' in video)
692
- return true;
693
- }
696
+ catch (_) {
694
697
  return false;
695
698
  }
696
- var enabledValue = globalThis.document[api.enabled];
697
- if (typeof enabledValue === 'boolean')
698
- return enabledValue;
699
- return typeof globalThis.document[api.element] !== 'undefined';
700
- }
701
- function getElement() {
702
- if (IS_ELECTRON) {
703
- if (lastElectronBrowserWindow !== null)
704
- return lastElectronBrowserWindow;
705
- try {
706
- var electron = require('electron');
707
- var allWindows = electron.BrowserWindow.getAllWindows();
708
- for (var i = 0; i < allWindows.length; i++) {
709
- var currentWindow = allWindows[i];
710
- if (currentWindow.isFullScreen() || (Platform.os === OS.MacOS && typeof currentWindow.isSimpleFullScreen === 'function' && currentWindow.isSimpleFullScreen()))
711
- return currentWindow;
712
- }
713
- return null;
714
- }
715
- catch (_) {
716
- return null;
699
+ }
700
+ if (api === null) {
701
+ if (OS.iOS !== Platform.os)
702
+ return false;
703
+ var videos = globalThis.document.querySelectorAll('video');
704
+ for (var i = 0; i < videos.length; i++) {
705
+ var video = videos[i];
706
+ if (video.webkitSupportsFullscreen || 'webkitEnterFullscreen' in video)
707
+ return true;
708
+ }
709
+ return false;
710
+ }
711
+ var enabledValue = globalThis.document[api.enabled];
712
+ if (typeof enabledValue === 'boolean')
713
+ return enabledValue;
714
+ return typeof globalThis.document[api.element] !== 'undefined';
715
+ }
716
+ function getElement() {
717
+ if (IS_ELECTRON) {
718
+ if (lastElectronBrowserWindow !== null)
719
+ return lastElectronBrowserWindow;
720
+ try {
721
+ var electron = require('electron');
722
+ var allWindows = electron.BrowserWindow.getAllWindows();
723
+ for (var i = 0; i < allWindows.length; i++) {
724
+ var currentWindow = allWindows[i];
725
+ if (currentWindow.isFullScreen() || (Platform.os === OS.MacOS && typeof currentWindow.isSimpleFullScreen === 'function' && currentWindow.isSimpleFullScreen()))
726
+ return currentWindow;
717
727
  }
728
+ return null;
718
729
  }
719
- if (api === null) {
720
- if (lastIOSVideo && lastIOSVideo.webkitDisplayingFullscreen)
721
- return lastIOSVideo;
730
+ catch (_) {
722
731
  return null;
723
732
  }
724
- var currentElement = globalThis.document[api.element];
725
- if (currentElement !== null && currentElement !== undefined)
726
- return currentElement;
727
- return null;
728
733
  }
729
- function getIsFullscreen() {
730
- return getElement() !== null;
734
+ if (api === null) {
735
+ if (lastIOSVideo && lastIOSVideo.webkitDisplayingFullscreen)
736
+ return lastIOSVideo;
737
+ return null;
731
738
  }
732
- function request(target, options) {
733
- if (target === void 0) { target = getDefaultTarget(); }
734
- if (IS_ELECTRON) {
735
- var browserWindow_1 = target;
736
- return new Promise(function (resolve, reject) {
737
- try {
738
- if (lastElectronBrowserWindow === null) {
739
- lastElectronBrowserWindowOptions = {
740
- fullScreenable: browserWindow_1.fullScreenable,
741
- autoHideMenuBar: browserWindow_1.autoHideMenuBar,
742
- };
743
- browserWindow_1.fullScreenable = true;
744
- browserWindow_1.autoHideMenuBar = true;
745
- }
746
- browserWindow_1.setFullScreen(true);
747
- lastElectronBrowserWindow = browserWindow_1;
748
- resolve();
749
- return;
750
- }
751
- catch (_) {
752
- reject();
753
- }
754
- });
755
- }
739
+ var currentElement = globalThis.document[api.element];
740
+ if (currentElement !== null && currentElement !== undefined)
741
+ return currentElement;
742
+ return null;
743
+ }
744
+ function getIsFullscreen() {
745
+ return getElement() !== null;
746
+ }
747
+ function request(target, options) {
748
+ if (target === void 0) { target = getDefaultTarget(); }
749
+ if (IS_ELECTRON) {
750
+ var browserWindow_1 = target;
756
751
  return new Promise(function (resolve, reject) {
757
- if (api !== null) {
758
- var method = target[api.request];
759
- if (typeof method === 'function') {
760
- try {
761
- var result = method.call(target, options);
762
- if (result !== undefined && typeof result.then === 'function') {
763
- result
764
- .then(function () {
765
- resolve();
766
- })
767
- .catch(function () {
768
- if (OS.iOS !== Platform.os) {
769
- reject();
770
- return;
771
- }
772
- fallbackToIOSVideo();
773
- });
774
- return;
775
- }
776
- else {
777
- resolve();
778
- return;
779
- }
780
- }
781
- catch (error) {
782
- if (OS.iOS !== Platform.os) {
783
- reject();
784
- return;
785
- }
786
- }
752
+ try {
753
+ if (lastElectronBrowserWindow === null) {
754
+ lastElectronBrowserWindowOptions = {
755
+ fullScreenable: browserWindow_1.fullScreenable,
756
+ autoHideMenuBar: browserWindow_1.autoHideMenuBar,
757
+ };
758
+ browserWindow_1.fullScreenable = true;
759
+ browserWindow_1.autoHideMenuBar = true;
787
760
  }
761
+ browserWindow_1.setFullScreen(true);
762
+ lastElectronBrowserWindow = browserWindow_1;
763
+ resolve();
764
+ return;
788
765
  }
789
- function fallbackToIOSVideo() {
790
- if (OS.iOS === Platform.os && target.tagName.toUpperCase() === 'VIDEO') {
791
- var video = target;
792
- if (video.webkitSupportsFullscreen && typeof video.webkitEnterFullscreen === 'function') {
793
- lastIOSVideo = video;
794
- bridgeIOSVideoEvents();
795
- video.webkitEnterFullscreen();
796
- resolve();
797
- return;
798
- }
799
- }
766
+ catch (_) {
800
767
  reject();
801
768
  }
802
- fallbackToIOSVideo();
803
769
  });
804
770
  }
805
- function exit() {
806
- if (IS_ELECTRON) {
807
- return new Promise(function (resolve, reject) {
771
+ return new Promise(function (resolve, reject) {
772
+ if (api !== null) {
773
+ var method = target[api.request];
774
+ if (typeof method === 'function') {
808
775
  try {
809
- if (lastElectronBrowserWindow !== null) {
810
- lastElectronBrowserWindow.setFullScreen(false);
811
- restoreElectronBrowserWindowOptions();
812
- }
813
- else {
814
- var browserWindow = getElement();
815
- if (browserWindow !== null)
816
- browserWindow.setFullScreen(false);
817
- }
818
- resolve();
819
- }
820
- catch (_) {
821
- reject();
822
- }
823
- });
824
- }
825
- return new Promise(function (resolve, reject) {
826
- if (api !== null) {
827
- var method = globalThis.document[api.exit];
828
- if (typeof method === 'function') {
829
- var result = method.call(globalThis.document);
776
+ var result = method.call(target, options);
830
777
  if (result !== undefined && typeof result.then === 'function') {
831
778
  result
832
779
  .then(function () {
833
780
  resolve();
834
781
  })
835
782
  .catch(function () {
836
- reject();
783
+ if (OS.iOS !== Platform.os) {
784
+ reject();
785
+ return;
786
+ }
787
+ fallbackToIOSVideo();
837
788
  });
838
789
  return;
839
790
  }
@@ -842,103 +793,147 @@ function createFullscreenUtils() {
842
793
  return;
843
794
  }
844
795
  }
796
+ catch (error) {
797
+ if (OS.iOS !== Platform.os) {
798
+ reject();
799
+ return;
800
+ }
801
+ }
845
802
  }
846
- if (OS.iOS === Platform.os && lastIOSVideo !== null) {
847
- if (typeof lastIOSVideo.webkitExitFullscreen === 'function' && lastIOSVideo.webkitDisplayingFullscreen === true) {
848
- lastIOSVideo.webkitExitFullscreen();
849
- lastIOSVideo = null;
803
+ }
804
+ function fallbackToIOSVideo() {
805
+ if (OS.iOS === Platform.os && target.tagName.toUpperCase() === 'VIDEO') {
806
+ var video = target;
807
+ if (video.webkitSupportsFullscreen && typeof video.webkitEnterFullscreen === 'function') {
808
+ lastIOSVideo = video;
809
+ bridgeIOSVideoEvents();
810
+ video.webkitEnterFullscreen();
850
811
  resolve();
851
812
  return;
852
813
  }
853
- var videos = globalThis.document.querySelectorAll('video');
854
- for (var i = 0; i < videos.length; i++) {
855
- var video = videos[i];
856
- if (typeof video.webkitExitFullscreen === 'function' && video.webkitDisplayingFullscreen === true) {
857
- video.webkitExitFullscreen();
858
- resolve();
859
- return;
860
- }
861
- }
862
814
  }
863
- if (!getElement()) {
815
+ reject();
816
+ }
817
+ fallbackToIOSVideo();
818
+ });
819
+ }
820
+ function exit() {
821
+ if (IS_ELECTRON) {
822
+ return new Promise(function (resolve, reject) {
823
+ try {
824
+ if (lastElectronBrowserWindow !== null) {
825
+ lastElectronBrowserWindow.setFullScreen(false);
826
+ restoreElectronBrowserWindowOptions();
827
+ }
828
+ else {
829
+ var browserWindow = getElement();
830
+ if (browserWindow !== null)
831
+ browserWindow.setFullScreen(false);
832
+ }
864
833
  resolve();
865
- return;
866
834
  }
867
- reject();
835
+ catch (_) {
836
+ reject();
837
+ }
868
838
  });
869
839
  }
870
- function toggle(target, options) {
871
- if (getIsFullscreen())
872
- return exit();
873
- else
874
- return request(target, options);
875
- }
876
- function onChange(handler) {
877
- var listeners = [];
878
- function listen(eventType) {
879
- function wrapper(event) {
880
- handler(event);
840
+ return new Promise(function (resolve, reject) {
841
+ if (api !== null) {
842
+ var method = globalThis.document[api.exit];
843
+ if (typeof method === 'function') {
844
+ var result = method.call(globalThis.document);
845
+ if (result !== undefined && typeof result.then === 'function') {
846
+ result
847
+ .then(function () {
848
+ resolve();
849
+ })
850
+ .catch(function () {
851
+ reject();
852
+ });
853
+ return;
854
+ }
855
+ else {
856
+ resolve();
857
+ return;
858
+ }
881
859
  }
882
- if (typeof globalThis.document === 'undefined')
860
+ }
861
+ if (OS.iOS === Platform.os && lastIOSVideo !== null) {
862
+ if (typeof lastIOSVideo.webkitExitFullscreen === 'function' && lastIOSVideo.webkitDisplayingFullscreen === true) {
863
+ lastIOSVideo.webkitExitFullscreen();
864
+ lastIOSVideo = null;
865
+ resolve();
883
866
  return;
884
- globalThis.document.addEventListener(eventType, wrapper, false);
885
- listeners.push(function () {
886
- globalThis.document.removeEventListener(eventType, wrapper, false);
887
- });
867
+ }
868
+ var videos = globalThis.document.querySelectorAll('video');
869
+ for (var i = 0; i < videos.length; i++) {
870
+ var video = videos[i];
871
+ if (typeof video.webkitExitFullscreen === 'function' && video.webkitDisplayingFullscreen === true) {
872
+ video.webkitExitFullscreen();
873
+ resolve();
874
+ return;
875
+ }
876
+ }
888
877
  }
889
- listen('fullscreenchange');
890
- return function () {
891
- listeners.forEach(function (cleanup) {
892
- cleanup();
893
- });
894
- };
878
+ if (!getElement()) {
879
+ resolve();
880
+ return;
881
+ }
882
+ reject();
883
+ });
884
+ }
885
+ function toggle(target, options) {
886
+ if (getIsFullscreen())
887
+ return exit();
888
+ else
889
+ return request(target, options);
890
+ }
891
+ function onchange(handler) {
892
+ var listeners = [];
893
+ function listen(eventType) {
894
+ function wrapper(event) {
895
+ handler(event);
896
+ }
897
+ if (typeof globalThis.document === 'undefined')
898
+ return;
899
+ globalThis.document.addEventListener(eventType, wrapper, false);
900
+ listeners.push(function () {
901
+ globalThis.document.removeEventListener(eventType, wrapper, false);
902
+ });
895
903
  }
896
- function onError(handler) {
897
- var listeners = [];
898
- function listen(eventType) {
899
- function wrapper(event) {
900
- handler(event);
901
- }
902
- if (typeof globalThis.document === 'undefined')
903
- return;
904
- globalThis.document.addEventListener(eventType, wrapper, false);
905
- listeners.push(function () {
906
- globalThis.document.removeEventListener(eventType, wrapper, false);
907
- });
904
+ listen('fullscreenchange');
905
+ return function () {
906
+ for (var i = 0; i < listeners.length; i++) {
907
+ listeners[i]();
908
908
  }
909
- listen('fullscreenerror');
910
- return function () {
911
- listeners.forEach(function (cleanup) {
912
- cleanup();
913
- });
914
- };
909
+ };
910
+ }
911
+ function onerror(handler) {
912
+ var listeners = [];
913
+ function listen(eventType) {
914
+ function wrapper(event) {
915
+ handler(event);
916
+ }
917
+ if (typeof globalThis.document === 'undefined')
918
+ return;
919
+ globalThis.document.addEventListener(eventType, wrapper, false);
920
+ listeners.push(function () {
921
+ globalThis.document.removeEventListener(eventType, wrapper, false);
922
+ });
915
923
  }
916
- bridgeEvents();
917
- return {
918
- get enabled() {
919
- return getEnabled();
920
- },
921
- get element() {
922
- return getElement();
923
- },
924
- get isFullscreen() {
925
- return getIsFullscreen();
926
- },
927
- request: request,
928
- exit: exit,
929
- toggle: toggle,
930
- onChange: onChange,
931
- onError: onError,
924
+ listen('fullscreenerror');
925
+ return function () {
926
+ for (var i = 0; i < listeners.length; i++) {
927
+ listeners[i]();
928
+ }
932
929
  };
933
930
  }
934
- var FullscreenUtils = createFullscreenUtils();
935
-
936
- var Fullscreen = FullscreenUtils;
931
+ bridgeEvents();
937
932
 
938
933
  var NativeFullscreenPlugin = {
939
934
  installed: false,
940
935
  name: 'Fullscreen',
941
- module: Fullscreen,
936
+ module: Index,
942
937
  Constants: {},
943
938
  Errors: {}
944
939
  };