native-fn 1.0.82 → 1.0.83

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/dist/index.d.ts +8 -1
  2. package/dist/native.cjs +4 -10
  3. package/dist/native.min.cjs +1 -1
  4. package/dist/native.min.mjs +1 -1
  5. package/dist/native.mjs +4 -10
  6. package/dist/native.umd.js +4 -10
  7. package/dist/native.umd.min.js +1 -1
  8. package/dist/plugin/app/index.cjs +102 -255
  9. package/dist/plugin/app/index.min.cjs +1 -1
  10. package/dist/plugin/app/index.min.mjs +1 -1
  11. package/dist/plugin/app/index.mjs +102 -255
  12. package/dist/plugin/app/index.umd.js +102 -255
  13. package/dist/plugin/app/index.umd.min.js +1 -1
  14. package/dist/plugin/app/src/plugin/appearance/constants/index.d.ts +2 -2
  15. package/dist/plugin/app/src/plugin/appearance/types/appearance.d.ts +0 -6
  16. package/dist/plugin/app/src/plugin/dimension/constants/index.d.ts +3 -0
  17. package/dist/plugin/app/src/plugin/dimension/types/dimension.d.ts +9 -6
  18. package/dist/plugin/app/src/plugin/dimension/types/dimensions.d.ts +11 -0
  19. package/dist/plugin/app/src/plugin/dimension/types/index.d.ts +2 -2
  20. package/dist/plugin/app/src/plugin/platform/constants/index.d.ts +1 -0
  21. package/dist/plugin/app/src/plugin/platform/cores/index.d.ts +0 -10
  22. package/dist/plugin/app/src/plugin/platform/types/platform.d.ts +3 -19
  23. package/dist/plugin/app/src/types/listener-entry.d.ts +6 -0
  24. package/dist/plugin/app/src/utils/request.d.ts +1 -0
  25. package/dist/plugin/appearance/index.cjs +55 -208
  26. package/dist/plugin/appearance/index.d.ts +1 -7
  27. package/dist/plugin/appearance/index.min.cjs +1 -1
  28. package/dist/plugin/appearance/index.min.mjs +1 -1
  29. package/dist/plugin/appearance/index.mjs +55 -208
  30. package/dist/plugin/appearance/index.umd.js +55 -208
  31. package/dist/plugin/appearance/index.umd.min.js +1 -1
  32. package/dist/plugin/appearance/src/plugin/appearance/constants/index.d.ts +2 -2
  33. package/dist/plugin/appearance/src/plugin/appearance/types/appearance.d.ts +0 -6
  34. package/dist/plugin/appearance/src/plugin/dimension/constants/index.d.ts +3 -0
  35. package/dist/plugin/appearance/src/plugin/dimension/types/dimension.d.ts +9 -6
  36. package/dist/plugin/appearance/src/plugin/dimension/types/dimensions.d.ts +11 -0
  37. package/dist/plugin/appearance/src/plugin/dimension/types/index.d.ts +2 -2
  38. package/dist/plugin/appearance/src/plugin/platform/constants/index.d.ts +1 -0
  39. package/dist/plugin/appearance/src/plugin/platform/cores/index.d.ts +0 -10
  40. package/dist/plugin/appearance/src/plugin/platform/types/platform.d.ts +3 -19
  41. package/dist/plugin/appearance/src/types/listener-entry.d.ts +6 -0
  42. package/dist/plugin/appearance/src/utils/request.d.ts +1 -0
  43. package/dist/plugin/clipboard/index.cjs +61 -214
  44. package/dist/plugin/clipboard/index.min.cjs +1 -1
  45. package/dist/plugin/clipboard/index.min.mjs +1 -1
  46. package/dist/plugin/clipboard/index.mjs +61 -214
  47. package/dist/plugin/clipboard/index.umd.js +61 -214
  48. package/dist/plugin/clipboard/index.umd.min.js +1 -1
  49. package/dist/plugin/clipboard/src/plugin/appearance/constants/index.d.ts +2 -2
  50. package/dist/plugin/clipboard/src/plugin/appearance/types/appearance.d.ts +0 -6
  51. package/dist/plugin/clipboard/src/plugin/dimension/constants/index.d.ts +3 -0
  52. package/dist/plugin/clipboard/src/plugin/dimension/types/dimension.d.ts +9 -6
  53. package/dist/plugin/clipboard/src/plugin/dimension/types/dimensions.d.ts +11 -0
  54. package/dist/plugin/clipboard/src/plugin/dimension/types/index.d.ts +2 -2
  55. package/dist/plugin/clipboard/src/plugin/platform/constants/index.d.ts +1 -0
  56. package/dist/plugin/clipboard/src/plugin/platform/cores/index.d.ts +0 -10
  57. package/dist/plugin/clipboard/src/plugin/platform/types/platform.d.ts +3 -19
  58. package/dist/plugin/clipboard/src/types/listener-entry.d.ts +6 -0
  59. package/dist/plugin/clipboard/src/utils/request.d.ts +1 -0
  60. package/dist/plugin/dimension/index.cjs +935 -1
  61. package/dist/plugin/dimension/index.d.ts +9 -0
  62. package/dist/plugin/dimension/index.min.cjs +1 -1
  63. package/dist/plugin/dimension/index.min.mjs +1 -1
  64. package/dist/plugin/dimension/index.mjs +935 -1
  65. package/dist/plugin/dimension/index.umd.js +935 -1
  66. package/dist/plugin/dimension/index.umd.min.js +1 -1
  67. package/dist/plugin/dimension/src/plugin/appearance/constants/index.d.ts +2 -2
  68. package/dist/plugin/dimension/src/plugin/appearance/types/appearance.d.ts +0 -6
  69. package/dist/plugin/dimension/src/plugin/dimension/constants/index.d.ts +3 -0
  70. package/dist/plugin/dimension/src/plugin/dimension/types/dimension.d.ts +9 -6
  71. package/dist/plugin/dimension/src/plugin/dimension/types/dimensions.d.ts +11 -0
  72. package/dist/plugin/dimension/src/plugin/dimension/types/index.d.ts +2 -2
  73. package/dist/plugin/dimension/src/plugin/platform/constants/index.d.ts +1 -0
  74. package/dist/plugin/dimension/src/plugin/platform/cores/index.d.ts +0 -10
  75. package/dist/plugin/dimension/src/plugin/platform/types/platform.d.ts +3 -19
  76. package/dist/plugin/dimension/src/types/listener-entry.d.ts +6 -0
  77. package/dist/plugin/dimension/src/utils/request.d.ts +1 -0
  78. package/dist/plugin/fullscreen/index.cjs +54 -207
  79. package/dist/plugin/fullscreen/index.min.cjs +1 -1
  80. package/dist/plugin/fullscreen/index.min.mjs +1 -1
  81. package/dist/plugin/fullscreen/index.mjs +54 -207
  82. package/dist/plugin/fullscreen/index.umd.js +54 -207
  83. package/dist/plugin/fullscreen/index.umd.min.js +1 -1
  84. package/dist/plugin/fullscreen/src/plugin/appearance/constants/index.d.ts +2 -2
  85. package/dist/plugin/fullscreen/src/plugin/appearance/types/appearance.d.ts +0 -6
  86. package/dist/plugin/fullscreen/src/plugin/dimension/constants/index.d.ts +3 -0
  87. package/dist/plugin/fullscreen/src/plugin/dimension/types/dimension.d.ts +9 -6
  88. package/dist/plugin/fullscreen/src/plugin/dimension/types/dimensions.d.ts +11 -0
  89. package/dist/plugin/fullscreen/src/plugin/dimension/types/index.d.ts +2 -2
  90. package/dist/plugin/fullscreen/src/plugin/platform/constants/index.d.ts +1 -0
  91. package/dist/plugin/fullscreen/src/plugin/platform/cores/index.d.ts +0 -10
  92. package/dist/plugin/fullscreen/src/plugin/platform/types/platform.d.ts +3 -19
  93. package/dist/plugin/fullscreen/src/types/listener-entry.d.ts +6 -0
  94. package/dist/plugin/fullscreen/src/utils/request.d.ts +1 -0
  95. package/dist/plugin/platform/index.cjs +50 -203
  96. package/dist/plugin/platform/index.d.ts +4 -20
  97. package/dist/plugin/platform/index.min.cjs +1 -1
  98. package/dist/plugin/platform/index.min.mjs +1 -1
  99. package/dist/plugin/platform/index.mjs +50 -203
  100. package/dist/plugin/platform/index.umd.js +50 -203
  101. package/dist/plugin/platform/index.umd.min.js +1 -1
  102. package/dist/plugin/platform/src/plugin/appearance/constants/index.d.ts +2 -2
  103. package/dist/plugin/platform/src/plugin/appearance/types/appearance.d.ts +0 -6
  104. package/dist/plugin/platform/src/plugin/dimension/constants/index.d.ts +3 -0
  105. package/dist/plugin/platform/src/plugin/dimension/types/dimension.d.ts +9 -6
  106. package/dist/plugin/platform/src/plugin/dimension/types/dimensions.d.ts +11 -0
  107. package/dist/plugin/platform/src/plugin/dimension/types/index.d.ts +2 -2
  108. package/dist/plugin/platform/src/plugin/platform/constants/index.d.ts +1 -0
  109. package/dist/plugin/platform/src/plugin/platform/cores/index.d.ts +0 -10
  110. package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +3 -19
  111. package/dist/plugin/platform/src/types/listener-entry.d.ts +6 -0
  112. package/dist/plugin/platform/src/utils/request.d.ts +1 -0
  113. package/dist/plugin/theme/index.cjs +51 -204
  114. package/dist/plugin/theme/index.min.cjs +1 -1
  115. package/dist/plugin/theme/index.min.mjs +1 -1
  116. package/dist/plugin/theme/index.mjs +51 -204
  117. package/dist/plugin/theme/index.umd.js +51 -204
  118. package/dist/plugin/theme/index.umd.min.js +1 -1
  119. package/dist/plugin/theme/src/plugin/appearance/constants/index.d.ts +2 -2
  120. package/dist/plugin/theme/src/plugin/appearance/types/appearance.d.ts +0 -6
  121. package/dist/plugin/theme/src/plugin/dimension/constants/index.d.ts +3 -0
  122. package/dist/plugin/theme/src/plugin/dimension/types/dimension.d.ts +9 -6
  123. package/dist/plugin/theme/src/plugin/dimension/types/dimensions.d.ts +11 -0
  124. package/dist/plugin/theme/src/plugin/dimension/types/index.d.ts +2 -2
  125. package/dist/plugin/theme/src/plugin/platform/constants/index.d.ts +1 -0
  126. package/dist/plugin/theme/src/plugin/platform/cores/index.d.ts +0 -10
  127. package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +3 -19
  128. package/dist/plugin/theme/src/types/listener-entry.d.ts +6 -0
  129. package/dist/plugin/theme/src/utils/request.d.ts +1 -0
  130. package/dist/src/plugin/appearance/constants/index.d.ts +2 -2
  131. package/dist/src/plugin/appearance/types/appearance.d.ts +0 -6
  132. package/dist/src/plugin/dimension/constants/index.d.ts +3 -0
  133. package/dist/src/plugin/dimension/types/dimension.d.ts +9 -6
  134. package/dist/src/plugin/dimension/types/dimensions.d.ts +11 -0
  135. package/dist/src/plugin/dimension/types/index.d.ts +2 -2
  136. package/dist/src/plugin/platform/constants/index.d.ts +1 -0
  137. package/dist/src/plugin/platform/cores/index.d.ts +0 -10
  138. package/dist/src/plugin/platform/types/platform.d.ts +3 -19
  139. package/dist/src/types/listener-entry.d.ts +6 -0
  140. package/dist/src/utils/request.d.ts +1 -0
  141. package/package.json +1 -1
@@ -68,6 +68,14 @@ var CrossPlatformFramework;
68
68
  CrossPlatformFramework["Cordova"] = "Cordova";
69
69
  })(CrossPlatformFramework || (CrossPlatformFramework = {}));
70
70
  var USER_AGENT = typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgent === 'string' ? globalThis.navigator.userAgent : '';
71
+ var HIGH_ENTROPY_BRAND_NAME_MAP = {
72
+ 'Google Chrome': 'Chrome',
73
+ 'Microsoft Edge': 'Edge',
74
+ 'Microsoft Edge WebView2': 'Edge WebView2',
75
+ 'Android WebView': 'Chrome WebView',
76
+ 'HeadlessChrome': 'Chrome Headless',
77
+ 'OperaMobile': 'Opera Mobi',
78
+ };
71
79
 
72
80
  var readyState = 'loading';
73
81
  var readyCallback = [];
@@ -81,15 +89,9 @@ var Platform = {
81
89
  get readyState() {
82
90
  return readyState;
83
91
  },
84
- get network() {
85
- return getNetwork();
86
- },
87
92
  get locale() {
88
93
  return getLocale();
89
94
  },
90
- get dimension() {
91
- return getDimension();
92
- },
93
95
  get device() {
94
96
  if (this.os.name === OS.iOS || this.os.name === OS.Android)
95
97
  return Devices.Mobile;
@@ -104,7 +106,7 @@ var Platform = {
104
106
  return /; ?wv|applewebkit(?!.*safari)/i.test(this.userAgent);
105
107
  },
106
108
  get isNode() {
107
- return typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined;
109
+ return typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && typeof globalThis.process.versions.node !== 'undefined';
108
110
  },
109
111
  get isStandalone() {
110
112
  if (this.os.name === OS.iOS)
@@ -126,6 +128,33 @@ var Platform = {
126
128
  }
127
129
  }
128
130
  };
131
+ function resolveWindowsVersion(string) {
132
+ if (typeof string === 'undefined')
133
+ return '';
134
+ var mapped = {
135
+ '4.90': 'ME',
136
+ 'NT3.51': 'NT 3.11',
137
+ 'NT4.0': 'NT 4.0',
138
+ 'NT 5.0': '2000',
139
+ 'NT 5.1': 'XP',
140
+ 'NT 5.2': 'XP',
141
+ 'NT 6.0': 'Vista',
142
+ 'NT 6.1': '7',
143
+ 'NT 6.2': '8',
144
+ 'NT 6.3': '8.1',
145
+ 'NT 6.4': '10',
146
+ 'NT 10.0': '10',
147
+ 'ARM': 'RT'
148
+ }[string];
149
+ if (typeof mapped !== 'undefined')
150
+ return mapped;
151
+ return string;
152
+ }
153
+ function resolveUnderscoreVersion(string) {
154
+ if (typeof string === 'undefined')
155
+ return '';
156
+ return string.replace(/_/g, '.');
157
+ }
129
158
  var OS_RESOLVER_MAP = [
130
159
  [/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
131
160
  [/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i, OS.Windows, resolveWindowsVersion],
@@ -184,14 +213,6 @@ var BROWSER_RESOLVER_MAP = [
184
213
  [/mobile vr; rv:([\w.]+)\).+firefox/i, Browsers.Firefox],
185
214
  [/firefox\/([\w.]+)/i, Browsers.Firefox],
186
215
  ];
187
- var HIGH_ENTROPY_BRAND_NAME_MAP = {
188
- 'Google Chrome': 'Chrome',
189
- 'Microsoft Edge': 'Edge',
190
- 'Microsoft Edge WebView2': 'Edge WebView2',
191
- 'Android WebView': 'Chrome WebView',
192
- 'HeadlessChrome': 'Chrome Headless',
193
- 'OperaMobile': 'Opera Mobi',
194
- };
195
216
  function incrementPendingTasks() {
196
217
  pendingTasks++;
197
218
  }
@@ -212,33 +233,6 @@ function checkReady() {
212
233
  readyCallback.length = 0;
213
234
  }
214
235
  }
215
- function resolveWindowsVersion(string) {
216
- if (string === undefined)
217
- return '';
218
- var mapped = {
219
- '4.90': 'ME',
220
- 'NT3.51': 'NT 3.11',
221
- 'NT4.0': 'NT 4.0',
222
- 'NT 5.0': '2000',
223
- 'NT 5.1': 'XP',
224
- 'NT 5.2': 'XP',
225
- 'NT 6.0': 'Vista',
226
- 'NT 6.1': '7',
227
- 'NT 6.2': '8',
228
- 'NT 6.3': '8.1',
229
- 'NT 6.4': '10',
230
- 'NT 10.0': '10',
231
- 'ARM': 'RT'
232
- }[string];
233
- if (mapped !== undefined)
234
- return mapped;
235
- return string;
236
- }
237
- function resolveUnderscoreVersion(string) {
238
- if (string === undefined)
239
- return '';
240
- return string.replace(/_/g, '.');
241
- }
242
236
  function resolveSemanticWindowsVersion(version, defaultValue) {
243
237
  if (version.major === 10 && version.minor === 0 && version.build >= 22000)
244
238
  return '11';
@@ -375,12 +369,12 @@ function resolveVersion(string, resolver) {
375
369
  return resolver(string);
376
370
  if (typeof resolver === 'string')
377
371
  return resolver;
378
- if (string === undefined)
372
+ if (typeof string === 'undefined')
379
373
  return '';
380
374
  return string;
381
375
  }
382
376
  function normalizeBrand(entry) {
383
- if (entry === null || entry === undefined)
377
+ if (entry === null || typeof entry === 'undefined')
384
378
  return { brand: '', version: '' };
385
379
  if (typeof entry === 'string')
386
380
  return { brand: entry, version: '' };
@@ -434,102 +428,13 @@ function getRenderer() {
434
428
  return '';
435
429
  }
436
430
  }
437
- function getNetwork() {
438
- var network = {
439
- isOnline: null,
440
- effectiveType: null,
441
- type: null,
442
- downlink: null,
443
- rtt: null,
444
- saveData: null,
445
- };
446
- if (typeof globalThis.navigator !== 'undefined') {
447
- if (typeof globalThis.navigator.onLine !== 'undefined')
448
- network.isOnline = globalThis.navigator.onLine;
449
- var connection = globalThis.navigator.connection || globalThis.navigator.mozConnection || globalThis.navigator.webkitConnection;
450
- if (typeof connection !== 'undefined') {
451
- if (typeof connection.effectiveType !== 'undefined')
452
- network.effectiveType = connection.effectiveType;
453
- if (typeof connection.type !== 'undefined')
454
- network.type = connection.type;
455
- if (typeof connection.downlink !== 'undefined')
456
- network.downlink = connection.downlink;
457
- if (typeof connection.rtt !== 'undefined')
458
- network.rtt = connection.rtt;
459
- if (typeof connection.saveData !== 'undefined')
460
- network.saveData = connection.saveData;
461
- return network;
462
- }
463
- }
464
- if (Platform.isNode) {
465
- try {
466
- var os = require('os');
467
- var networkInterfaces = os.networkInterfaces();
468
- var networkInterfaceNames = Object.keys(networkInterfaces);
469
- for (var i = 0; i < networkInterfaceNames.length; i++) {
470
- var name_1 = networkInterfaceNames[i];
471
- var networkInterface = networkInterfaces[name_1];
472
- for (var j = 0; j < networkInterface.length; j++) {
473
- var address = networkInterface[j];
474
- if (!address.internal && address.family === 'IPv4')
475
- network.isOnline = true;
476
- }
477
- if (network.isOnline)
478
- break;
479
- }
480
- }
481
- catch (_) {
482
- }
483
- try {
484
- var childProcess = require('child_process');
485
- if (Platform.os.name === OS.Windows) {
486
- try {
487
- var output = childProcess.execSync('netsh wlan show interfaces', { encoding: 'utf8', timeout: 5000 });
488
- if (output.includes('State') && output.includes('connected'))
489
- network.type = 'wifi';
490
- }
491
- catch (_) {
492
- }
493
- if (network.type === null) {
494
- try {
495
- var output = childProcess.execSync('ipconfig', { encoding: 'utf8', timeout: 5000 });
496
- if (output.includes('Ethernet adapter'))
497
- network.type = 'ethernet';
498
- }
499
- catch (_) {
500
- }
501
- }
502
- if (network.type === null)
503
- network.type = 'other';
504
- }
505
- else if (Platform.os.name === OS.MacOS) {
506
- try {
507
- var output = childProcess.execSync('networksetup -listallhardwareports', { encoding: 'utf8', timeout: 5000 });
508
- var activeInterface = childProcess.execSync('route -n get default | grep interface', { encoding: 'utf8', timeout: 5000 });
509
- if (activeInterface.includes('en0') && output.includes('Wi-Fi'))
510
- network.type = 'wifi';
511
- else if (activeInterface.includes('en') || output.includes('Ethernet'))
512
- network.type = 'ethernet';
513
- else
514
- network.type = 'other';
515
- }
516
- catch (_) {
517
- network.type = 'other';
518
- }
519
- }
520
- }
521
- catch (_) {
522
- }
523
- }
524
- return network;
525
- }
526
431
  function normalizeLocale(locale) {
527
- if (locale === null || locale === undefined)
432
+ if (locale === null || typeof locale === 'undefined')
528
433
  return locale;
529
434
  if (locale.length === 0)
530
435
  return null;
531
436
  locale = locale.replace(/_/g, '-');
532
- if (locale === 'C' || locale === 'posix' || locale === 'POSIX')
437
+ if (locale === 'C' || locale.toLowerCase() === 'posix')
533
438
  return 'en-US';
534
439
  if (locale.indexOf('.') !== -1)
535
440
  return normalizeLocale(locale.split('.')[0]);
@@ -547,9 +452,9 @@ function normalizeLocale(locale) {
547
452
  }
548
453
  function getLocale() {
549
454
  var locale = {
550
- language: '',
455
+ language: null,
551
456
  languages: [],
552
- timezone: '',
457
+ timezone: null,
553
458
  timezoneOffset: 0,
554
459
  };
555
460
  function addLanguages(language) {
@@ -559,7 +464,7 @@ function getLocale() {
559
464
  function addLanguage(language) {
560
465
  language = normalizeLocale(language);
561
466
  if (typeof language === "string" && locale.languages.indexOf(language) === -1) {
562
- if (locale.language.length === 0)
467
+ if (locale.language === null)
563
468
  locale.language = language;
564
469
  locale.languages.push(language);
565
470
  }
@@ -617,6 +522,11 @@ function getLocale() {
617
522
  }
618
523
  catch (_) {
619
524
  }
525
+ try {
526
+ locale.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
527
+ }
528
+ catch (_) {
529
+ }
620
530
  }
621
531
  if (typeof globalThis.navigator !== 'undefined') {
622
532
  if (typeof globalThis.navigator.languages !== 'undefined')
@@ -630,13 +540,6 @@ function getLocale() {
630
540
  if (typeof globalThis.navigator.systemLanguage !== 'undefined')
631
541
  addLanguage(globalThis.navigator.systemLanguage);
632
542
  }
633
- try {
634
- if (typeof Intl !== 'undefined') {
635
- locale.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
636
- }
637
- }
638
- catch (_) {
639
- }
640
543
  try {
641
544
  locale.timezoneOffset = new Date().getTimezoneOffset();
642
545
  }
@@ -644,63 +547,8 @@ function getLocale() {
644
547
  }
645
548
  return locale;
646
549
  }
647
- function getDimension() {
648
- var dimension = {
649
- innerWidth: -1,
650
- innerHeight: -1,
651
- outerWidth: -1,
652
- outerHeight: -1,
653
- scale: 1,
654
- };
655
- if (typeof globalThis.innerWidth !== 'undefined') {
656
- dimension.innerWidth = globalThis.innerWidth;
657
- dimension.innerHeight = globalThis.innerHeight;
658
- dimension.outerWidth = globalThis.outerWidth;
659
- dimension.outerHeight = globalThis.outerHeight;
660
- dimension.scale = globalThis.devicePixelRatio || 1;
661
- return dimension;
662
- }
663
- if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative) {
664
- try {
665
- var reactNative = require('react-native');
666
- var dimensions = reactNative.Dimensions;
667
- var pixelRatio = reactNative.PixelRatio;
668
- var screenDimensions = dimensions.get('screen');
669
- var windowDimensions = dimensions.get('window');
670
- dimension.innerWidth = screenDimensions.width;
671
- dimension.innerHeight = screenDimensions.height;
672
- dimension.outerWidth = windowDimensions.width;
673
- dimension.outerHeight = windowDimensions.height;
674
- dimension.scale = pixelRatio.get();
675
- return dimension;
676
- }
677
- catch (_) {
678
- }
679
- }
680
- if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron) {
681
- try {
682
- var electron = require('electron');
683
- var screen_1 = electron.screen;
684
- var browserWindow = electron.BrowserWindow;
685
- var focusedWindow = browserWindow.getFocusedWindow() || browserWindow.getAllWindows()[0];
686
- if (focusedWindow !== undefined) {
687
- var contentSize = focusedWindow.getContentSize();
688
- var size = focusedWindow.getSize();
689
- dimension.innerWidth = contentSize[0];
690
- dimension.innerHeight = contentSize[1];
691
- dimension.outerWidth = size[0];
692
- dimension.outerHeight = size[1];
693
- dimension.scale = screen_1.getDisplayMatching(focusedWindow.getBounds()).scaleFactor;
694
- }
695
- return dimension;
696
- }
697
- catch (_) {
698
- }
699
- }
700
- return dimension;
701
- }
702
550
  function init() {
703
- if ((typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(USER_AGENT)))
551
+ if ((typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && typeof globalThis.process.versions.electron !== 'undefined') || (/ electron\//i.test(USER_AGENT)))
704
552
  Platform.crossPlatformFramework = CrossPlatformFramework.Electron;
705
553
  if (typeof globalThis.navigator !== 'undefined' && globalThis.navigator.product === 'ReactNative')
706
554
  Platform.crossPlatformFramework = CrossPlatformFramework.ReactNative;
@@ -896,8 +744,7 @@ function init() {
896
744
  finally {
897
745
  decrementPendingTasks();
898
746
  }
899
- })
900
- .catch(decrementPendingTasks);
747
+ });
901
748
  }
902
749
  checkReady();
903
750
  }
@@ -912,7 +759,7 @@ var Theme = {
912
759
  return getThemeColor();
913
760
  },
914
761
  set value(color) {
915
- if (color === undefined)
762
+ if (typeof color === 'undefined')
916
763
  removeThemeColor();
917
764
  else
918
765
  setThemeColor(color);