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.
- package/dist/index.d.ts +8 -1
- package/dist/native.cjs +4 -10
- package/dist/native.min.cjs +1 -1
- package/dist/native.min.mjs +1 -1
- package/dist/native.mjs +4 -10
- package/dist/native.umd.js +4 -10
- package/dist/native.umd.min.js +1 -1
- package/dist/plugin/app/index.cjs +102 -255
- package/dist/plugin/app/index.min.cjs +1 -1
- package/dist/plugin/app/index.min.mjs +1 -1
- package/dist/plugin/app/index.mjs +102 -255
- package/dist/plugin/app/index.umd.js +102 -255
- package/dist/plugin/app/index.umd.min.js +1 -1
- package/dist/plugin/app/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/appearance/types/appearance.d.ts +0 -6
- package/dist/plugin/app/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/app/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/app/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/app/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/app/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/app/src/plugin/platform/types/platform.d.ts +3 -19
- package/dist/plugin/app/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/app/src/utils/request.d.ts +1 -0
- package/dist/plugin/appearance/index.cjs +55 -208
- package/dist/plugin/appearance/index.d.ts +1 -7
- package/dist/plugin/appearance/index.min.cjs +1 -1
- package/dist/plugin/appearance/index.min.mjs +1 -1
- package/dist/plugin/appearance/index.mjs +55 -208
- package/dist/plugin/appearance/index.umd.js +55 -208
- package/dist/plugin/appearance/index.umd.min.js +1 -1
- package/dist/plugin/appearance/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/appearance/types/appearance.d.ts +0 -6
- package/dist/plugin/appearance/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/appearance/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/appearance/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/appearance/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/appearance/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/appearance/src/plugin/platform/types/platform.d.ts +3 -19
- package/dist/plugin/appearance/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/appearance/src/utils/request.d.ts +1 -0
- package/dist/plugin/clipboard/index.cjs +61 -214
- package/dist/plugin/clipboard/index.min.cjs +1 -1
- package/dist/plugin/clipboard/index.min.mjs +1 -1
- package/dist/plugin/clipboard/index.mjs +61 -214
- package/dist/plugin/clipboard/index.umd.js +61 -214
- package/dist/plugin/clipboard/index.umd.min.js +1 -1
- package/dist/plugin/clipboard/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/appearance/types/appearance.d.ts +0 -6
- package/dist/plugin/clipboard/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/clipboard/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/clipboard/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/clipboard/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/clipboard/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/clipboard/src/plugin/platform/types/platform.d.ts +3 -19
- package/dist/plugin/clipboard/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/clipboard/src/utils/request.d.ts +1 -0
- package/dist/plugin/dimension/index.cjs +935 -1
- package/dist/plugin/dimension/index.d.ts +9 -0
- package/dist/plugin/dimension/index.min.cjs +1 -1
- package/dist/plugin/dimension/index.min.mjs +1 -1
- package/dist/plugin/dimension/index.mjs +935 -1
- package/dist/plugin/dimension/index.umd.js +935 -1
- package/dist/plugin/dimension/index.umd.min.js +1 -1
- package/dist/plugin/dimension/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/dimension/src/plugin/appearance/types/appearance.d.ts +0 -6
- package/dist/plugin/dimension/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/dimension/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/dimension/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/dimension/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/dimension/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/dimension/src/plugin/platform/types/platform.d.ts +3 -19
- package/dist/plugin/dimension/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/dimension/src/utils/request.d.ts +1 -0
- package/dist/plugin/fullscreen/index.cjs +54 -207
- package/dist/plugin/fullscreen/index.min.cjs +1 -1
- package/dist/plugin/fullscreen/index.min.mjs +1 -1
- package/dist/plugin/fullscreen/index.mjs +54 -207
- package/dist/plugin/fullscreen/index.umd.js +54 -207
- package/dist/plugin/fullscreen/index.umd.min.js +1 -1
- package/dist/plugin/fullscreen/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/appearance/types/appearance.d.ts +0 -6
- package/dist/plugin/fullscreen/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/fullscreen/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/fullscreen/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/fullscreen/src/plugin/platform/types/platform.d.ts +3 -19
- package/dist/plugin/fullscreen/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/fullscreen/src/utils/request.d.ts +1 -0
- package/dist/plugin/platform/index.cjs +50 -203
- package/dist/plugin/platform/index.d.ts +4 -20
- package/dist/plugin/platform/index.min.cjs +1 -1
- package/dist/plugin/platform/index.min.mjs +1 -1
- package/dist/plugin/platform/index.mjs +50 -203
- package/dist/plugin/platform/index.umd.js +50 -203
- package/dist/plugin/platform/index.umd.min.js +1 -1
- package/dist/plugin/platform/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/platform/src/plugin/appearance/types/appearance.d.ts +0 -6
- package/dist/plugin/platform/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/platform/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/platform/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/platform/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/platform/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +3 -19
- package/dist/plugin/platform/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/platform/src/utils/request.d.ts +1 -0
- package/dist/plugin/theme/index.cjs +51 -204
- package/dist/plugin/theme/index.min.cjs +1 -1
- package/dist/plugin/theme/index.min.mjs +1 -1
- package/dist/plugin/theme/index.mjs +51 -204
- package/dist/plugin/theme/index.umd.js +51 -204
- package/dist/plugin/theme/index.umd.min.js +1 -1
- package/dist/plugin/theme/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/appearance/types/appearance.d.ts +0 -6
- package/dist/plugin/theme/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/theme/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/theme/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/theme/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +3 -19
- package/dist/plugin/theme/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/theme/src/utils/request.d.ts +1 -0
- package/dist/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/src/plugin/appearance/types/appearance.d.ts +0 -6
- package/dist/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/src/plugin/platform/types/platform.d.ts +3 -19
- package/dist/src/types/listener-entry.d.ts +6 -0
- package/dist/src/utils/request.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).Dimension=n()}(this,(function(){"use strict";return{installed:!1,name:"Dimension",module:{},Constants:{},Errors:{}}}));
|
|
1
|
+
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):(e="undefined"!=typeof globalThis?globalThis:e||self).Dimension=o()}(this,(function(){"use strict";var e,o,r,i,n;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(e||(e={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(o||(o={})),function(e){e.Unknown="Unknown",e.EdgeHTML="EdgeHTML",e.ArkWeb="ArkWeb",e.Blink="Blink",e.Presto="Presto",e.WebKit="WebKit",e.Trident="Trident",e.NetFront="NetFront",e.KHTML="KHTML",e.Tasman="Tasman",e.Gecko="Gecko"}(r||(r={})),function(e){e.Unknown="Unknown",e.Chrome="Chrome",e.Safari="Safari",e.Edge="Edge",e.Firefox="Firefox",e.Opera="Opera",e.IE="IE",e.SamsungInternet="SamsungInternet"}(i||(i={})),function(e){e.Unknown="Unknown",e.ReactNative="ReactNative",e.Electron="Electron",e.Cordova="Cordova"}(n||(n={}));var a=void 0!==globalThis.navigator&&"string"==typeof globalThis.navigator.userAgent?globalThis.navigator.userAgent:"",t={"Google Chrome":"Chrome","Microsoft Edge":"Edge","Microsoft Edge WebView2":"Edge WebView2","Android WebView":"Chrome WebView",HeadlessChrome:"Chrome Headless",OperaMobile:"Opera Mobi"},s=[];var l="loading",g=[],d=0,m={os:{name:e.Unknown,version:""},engine:{name:r.Unknown,version:""},browser:{name:i.Unknown,version:""},crossPlatformFramework:n.Unknown,userAgent:a,get readyState(){return l},get locale(){return function(){var e={language:null,languages:[],timezone:null,timezoneOffset:0};function o(e){for(var o=0;o<e.length;o++)r(e[o])}function r(o){"string"==typeof(o=W(o))&&-1===e.languages.indexOf(o)&&(null===e.language&&(e.language=o),e.languages.push(o))}if(m.crossPlatformFramework===n.ReactNative)try{var i=require("react-native").NativeModules;if(void 0!==i.SettingsManager){var a=i.SettingsManager;if(void 0!==a)if(void 0!==(s="function"==typeof a.getConstants?a.getConstants():a)&&void 0!==s.settings){var t=s.settings;"string"==typeof t.AppleLocale&&r(t.AppleLocale),Array.isArray(t.AppleLanguages)&&t.AppleLanguages.length>0&&o(t.AppleLanguages)}}if(void 0!==i.I18nManager){var s,l=i.I18nManager;if(void 0!==l)void 0!==(s="function"==typeof l.getConstants?l.getConstants():l)&&void 0!==s.localeIdentifier&&r(s.localeIdentifier)}}catch(e){}if(m.crossPlatformFramework===n.Electron)try{var g=require("electron").app;void 0!==g.getLocale&&r(g.getLocale()),void 0!==g.getSystemLocale&&r(g.getSystemLocale()),void 0!==g.getPreferredSystemLanguages&&o(g.getPreferredSystemLanguages())}catch(e){}if("undefined"!=typeof Intl){try{r(Intl.DateTimeFormat().resolvedOptions().locale)}catch(e){}try{e.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){}}void 0!==globalThis.navigator&&(void 0!==globalThis.navigator.languages&&o(globalThis.navigator.languages),void 0!==globalThis.navigator.language&&r(globalThis.navigator.language),void 0!==globalThis.navigator.userLanguage&&r(globalThis.navigator.userLanguage),void 0!==globalThis.navigator.browserLanguage&&r(globalThis.navigator.browserLanguage),void 0!==globalThis.navigator.systemLanguage&&r(globalThis.navigator.systemLanguage));try{e.timezoneOffset=(new Date).getTimezoneOffset()}catch(e){}return e}()},get device(){return this.os.name===e.iOS||this.os.name===e.Android?o.Mobile:this.os.name===e.Windows||this.os.name===e.MacOS?o.Desktop:o.Unknown},get renderer(){return function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var o=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===o)return"";if(o instanceof WebGLRenderingContext||"getParameter"in o&&"function"==typeof o.getParameter){var r=o.getExtension("WEBGL_debug_renderer_info");return null===r?o.getParameter(o.RENDERER):o.getParameter(r.UNMASKED_RENDERER_WEBGL)}return""}()},get isWebview(){return/; ?wv|applewebkit(?!.*safari)/i.test(this.userAgent)},get isNode(){return void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node},get isStandalone(){return this.os.name===e.iOS?"standalone"in globalThis.navigator&&!!globalThis.navigator.standalone:"matchMedia"in globalThis&&globalThis.matchMedia("(display-mode: standalone)").matches},onready:function(e){if("complete"===this.readyState)try{e(this)}catch(e){}else g.push(e)}};function c(e){if(void 0===e)return"";var o={"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10","NT 10.0":"10",ARM:"RT"}[e];return void 0!==o?o:e}function u(e){return void 0===e?"":e.replace(/_/g,".")}var v=[[/windows nt (6\.[23]); arm/i,e.Windows,c],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,c],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,c],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,c],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,c],[/windows ce\/?([\d.]*)/i,e.Windows,c],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,u],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,u],[/cfnetwork\/.+darwin/i,e.iOS,u],[/mac os x ?([\w. ]*)/i,e.MacOS,u],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,u],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],f=[[/windows.+ edge\/([\w.]+)/i,r.EdgeHTML],[/arkweb\/([\w.]+)/i,r.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,r.Blink],[/presto\/([\w.]+)/i,r.Presto],[/webkit\/([\w.]+)/i,r.WebKit],[/trident\/([\w.]+)/i,r.Trident],[/netfront\/([\w.]+)/i,r.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,r.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,r.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,r.Gecko]],h=[[/\b(?:crmo|crios)\/([\w.]+)/i,i.Chrome],[/webview.+edge\/([\w.]+)/i,i.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,i.Edge],[/opera mini\/([-\w.]+)/i,i.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,i.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,i.Opera],[/opios[\/ ]+([\w.]+)/i,i.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,i.Opera],[/\bopr\/([\w.]+)/i,i.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,i.IE],[/(?:ms|\()ie ([\w.]+)/i,i.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,i.IE],[/\bfocus\/([\w.]+)/i,i.Firefox],[/\bopt\/([\w.]+)/i,i.Opera],[/coast\/([\w.]+)/i,i.Opera],[/fxios\/([\w.-]+)/i,i.Firefox],[/samsungbrowser\/([\w.]+)/i,i.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,i.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,i.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,i.Chrome],[/chrome\/([\w.]+) mobile/i,i.Chrome],[/chrome\/v?([\w.]+)/i,i.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,i.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,i.Safari],[/version\/([\w.,]+) .*safari/i,i.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,i.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,i.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,i.Firefox],[/firefox\/([\w.]+)/i,i.Firefox]];function w(){d--,b()}function b(){if(0===d&&"loading"===l){l="complete";for(var e=0;e<g.length;e++)try{g[e](m)}catch(e){}g.length=0}}function p(e,o){return 10===e.major&&0===e.minor&&e.build>=22e3?"11":10===e.major&&0===e.minor&&e.build<22e3?"10":6===e.major&&3===e.minor?"8.1":6===e.major&&2===e.minor?"8":6===e.major&&1===e.minor?"7":6===e.major&&0===e.minor?"Vista":5===e.major&&1===e.minor||5===e.major&&2===e.minor?"XP":5===e.major&&0===e.minor?"2000":4===e.major&&90===e.minor?"ME":4===e.major&&0===e.minor?"NT 4.0":3===e.major&&51===e.minor?"NT 3.11":o}function T(e,o){return e.major>=24?e.major-9+"."+e.minor+"."+e.build:23===e.major?"14."+e.minor+"."+e.build:22===e.major?"13."+e.minor+"."+e.build:21===e.major?"12."+e.minor+"."+e.build:20===e.major?"11."+e.minor+"."+e.build:19===e.major?"10.15."+e.minor:18===e.major?"10.14."+e.minor:17===e.major?"10.13."+e.minor:16===e.major?"10.12."+e.minor:15===e.major?"10.11."+e.minor:14===e.major?"10.10."+e.minor:13===e.major?"10.9."+e.minor:e.major>=5&&e.major<=12?"10."+(e.major-4)+"."+e.minor:o}function j(e,o){return e.major>=36?"16":35===e.major?"15":34===e.major?"14":33===e.major?"13":32===e.major?"12.1":31===e.major?"12":30===e.major?"11":29===e.major?"10":28===e.major?"9":27===e.major?"8.1":26===e.major?"8.0":25===e.major?"7.1":24===e.major?"7.0":23===e.major?"6.0":22===e.major?"5.1":21===e.major?"5.0":20===e.major||19===e.major?"4.4":18===e.major?"4.3":17===e.major?"4.2":16===e.major?"4.1":15===e.major?"4.0.3":14===e.major?"4.0":13===e.major?"3.2":12===e.major?"3.1":11===e.major?"3.0":10===e.major?"2.3.3":9===e.major?"2.3":8===e.major?"2.2":7===e.major?"2.1":6===e.major?"2.0.1":5===e.major?"2.0":4===e.major?"1.6":3===e.major?"1.5":2===e.major?"1.1":1===e.major?"1.0":o}function k(e,o){return"function"==typeof o?o(e):"string"==typeof o?o:void 0===e?"":e}function y(e){var o=e.split(".");return{major:parseInt(o[0]||"0"),minor:parseInt(o[1]||"0"),build:parseInt(o[2]||"0")}}function E(){if(m.crossPlatformFramework=n.Cordova,void 0!==globalThis.device)switch(globalThis.device.platform){case"Android":m.os={name:e.Android,version:globalThis.device.version};break;case"iOS":m.os={name:e.iOS,version:globalThis.device.version}}w()}function W(e){if(null==e)return e;if(0===e.length)return null;if("C"===(e=e.replace(/_/g,"-"))||"posix"===e.toLowerCase())return"en-US";if(-1!==e.indexOf("."))return W(e.split(".")[0]);if(-1!==e.indexOf("@"))return W(e.split("@")[0]);var o=e.split("-");return 0===o.length?null:(o[0]=o[0].toLowerCase(),o.length>1&&2===o[1].length&&(o[1]=o[1].toUpperCase()),o.length>2&&4===o[1].length&&(o[1]=o[1].charAt(0).toUpperCase()+o[1].slice(1).toLowerCase()),o.join("-"))}!function(){(void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(a))&&(m.crossPlatformFramework=n.Electron),void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product&&(m.crossPlatformFramework=n.ReactNative);for(var r=0;r<v.length;r++){var s=(u=v[r])[0],l=u[1],g=u[2];if(null!==(W=m.userAgent.match(s))){m.os={name:l,version:k(W[1],g)};break}}for(m.os.name===e.iOS&&0===function(e,o){for(var r=e.split("."),i=o.split("."),n=Math.max(r.length,i.length),a=0;a<n;a++){var t=void 0,s=void 0;if((t=a<r.length?parseInt(r[a],10):0)>(s=a<i.length?parseInt(i[a],10):0))return 1;if(t<s)return-1}return 0}(m.os.version,"18.6")&&null!==(S=/\) Version\/([\d.]+)/.exec(m.userAgent))&&parseInt(S[1].substring(0,2),10)>=26&&(m.os.version=S[1]),r=0;r<f.length;r++){s=(u=f[r])[0];var c=u[1];g=u[2];if(null!==(W=m.userAgent.match(s))){m.engine={name:c,version:k(W[1],g)};break}}for(r=0;r<h.length;r++){s=(u=h[r])[0];var u,W,O=u[1];g=u[2];if(null!==(W=m.userAgent.match(s))){m.browser={name:O,version:k(W[1],g)};break}}if(m.crossPlatformFramework===n.ReactNative)try{l=(L=require("react-native").Platform).OS;var S=y(C=""+L.Version);switch(l){case"android":m.os={name:e.Android,version:j(S,C)};break;case"ios":m.os={name:e.iOS,version:C};break;case"windows":m.os={name:e.Windows,version:p(S,C)};break;case"macos":m.os={name:e.MacOS,version:C}}}catch(e){}if(m.isNode)try{var C,L=(l=require("os")).platform();S=y(C=l.release());switch(L){case"win32":m.os={name:e.Windows,version:p(S,C)};break;case"darwin":m.os={name:e.MacOS,version:T(S,C)};break;case"android":m.os={name:e.Android,version:C};break;case"linux":/android/i.test(C)&&(m.os={name:e.Android,version:C})}}catch(e){}void 0!==globalThis.document&&(void 0!==globalThis.device?E():globalThis.document.addEventListener("deviceready",E,!1)),void 0!==globalThis.navigator&&void 0!==globalThis.navigator.userAgentData&&void 0!==globalThis.navigator.userAgentData.getHighEntropyValues&&(d++,globalThis.navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(r){try{for(var n=r.fullVersionList||r.brands||[],a=r.platformVersion,s=r.platform,l=m.browser.name,g=null,d=0;d<n.length;d++){var c=null==(f=n[d])?{brand:"",version:""}:"string"==typeof f?{brand:f,version:""}:{brand:f.brand,version:f.version},u=c.version,v=c.brand;/not.a.brand/i.test(v)||((null===g||/Chrom/.test(g)&&"Chromium"!==v||"Edge"===g&&/WebView2/.test(v))&&(v=t[v]||v,null!==(g=l)&&!/Chrom/.test(g)&&/Chrom/.test(v)||("Chrome"===(l=v)||"Chrome WebView"===l||"Chrome Headless"===l?m.browser.name=i.Chrome:"Edge"===l||"Edge WebView2"===l?m.browser.name=i.Edge:"Opera Mobi"===l&&(m.browser.name=i.Opera),m.browser.version=u),g=v),"Chromium"===v&&(m.engine.version=u))}"string"==typeof a&&(m.os.name===e.Windows?m.os.version=parseInt(a.split(".")[0],10)>=13?"11":"10":m.os.version=a),"string"==typeof s&&(/android/i.test(s)?m.os.name=e.Android:/ios|iphone|ipad/i.test(s)?m.os.name=e.iOS:/windows|win32/i.test(s)?m.os.name=e.Windows:/macos|macintel/i.test(s)&&(m.os.name=e.MacOS)),!0===r.mobile&&(m.device=o.Mobile)}catch(e){}finally{w()}var f}))),b()}();var O=null;function S(){var e={innerWidth:-1,innerHeight:-1,outerWidth:-1,outerHeight:-1,scale:1};if(void 0!==globalThis.innerWidth)return e.innerWidth=globalThis.innerWidth,e.innerHeight=globalThis.innerHeight,e.outerWidth=globalThis.outerWidth,e.outerHeight=globalThis.outerHeight,e.scale=globalThis.devicePixelRatio||1,e;if(m.crossPlatformFramework===n.ReactNative)try{var o=require("react-native"),r=o.Dimensions,i=o.PixelRatio,a=r.get("screen"),t=r.get("window");return e.innerWidth=a.width,e.innerHeight=a.height,e.outerWidth=t.width,e.outerHeight=t.height,e.scale=i.get(),e}catch(e){}if(m.crossPlatformFramework===n.Electron)try{var s=require("electron"),l=s.screen,g=s.BrowserWindow,d=g.getFocusedWindow()||g.getAllWindows()[0];if(void 0!==d){var c=d.getContentSize(),u=d.getSize();e.innerWidth=c[0],e.innerHeight=c[1],e.outerWidth=u[0],e.outerHeight=u[1],e.scale=l.getDisplayMatching(d.getBounds()).scaleFactor}return e}catch(e){}return e}function C(){var e=S();O&&e.innerWidth===O.innerWidth&&e.innerHeight===O.innerHeight&&e.outerWidth===O.outerWidth&&e.outerHeight===O.outerHeight&&e.scale===O.scale||(O=e,L(e))}function L(e){for(var o=0;o<s.length;o++){var r=s[o];r.fn(e),r.once&&A(r)}}function A(e){var o,r=x(e);-1!==r&&s.splice(r,1),0===s.length&&(o=e.capture,O=null,"function"==typeof globalThis.removeEventListener&&globalThis.removeEventListener("resize",C,o))}function x(e){for(var o=0;o<s.length;o++)if(s[o].fn===e.fn&&s[o].capture===e.capture)return o;return-1}return{installed:!1,name:"Dimension",module:{get value(){return S()},onchange:function(e,o){void 0===o&&(o=!1);if(m.crossPlatformFramework===n.ReactNative)return function(e){try{var o=require("react-native").Dimensions.addEventListener("change",(function(o){e(S())}));return function(){o.remove()}}catch(e){}return function(){}}(e);if(m.crossPlatformFramework===n.Electron)return function(e){try{var o=require("electron").BrowserWindow,r=o.getFocusedWindow()||o.getAllWindows()[0];if(void 0!==r){var i=function(){e(S())};return r.on("resize",i),function(){r.removeListener("resize",i)}}}catch(e){}return function(){}}(e);var r={fn:e,capture:!1,once:!1};"boolean"==typeof o&&(o={capture:o});void 0!==o.capture&&(r.capture=o.capture);void 0!==o.once&&(r.once=o.once);void 0!==o.signal&&(r.signal=o.signal);var i=x(r);-1===i?(s.push(r),1===s.length&&(a=r.capture,O=S(),"function"==typeof globalThis.addEventListener&&globalThis.addEventListener("resize",C,a)),L(S())):s[i].once&&!r.once&&(s[i].once=!1);var a;void 0!==r.signal&&(r.signal.aborted?A(r):r.signal.addEventListener("abort",(function e(){void 0!==r.signal&&r.signal.removeEventListener("abort",e),A(r)})));return function(){A(r)}}},Constants:{},Errors:{}}}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ListenerEntry } from "
|
|
1
|
+
import { ListenerEntry } from "../../../types/listener-entry";
|
|
2
2
|
export declare enum Appearances {
|
|
3
3
|
Unknown = "unknown",
|
|
4
4
|
Light = "light",
|
|
@@ -8,4 +8,4 @@ export declare const MEDIA_QUERY_LIST: MediaQueryList;
|
|
|
8
8
|
export declare const SUPPORT_PREFERS_COLOR_SCHEME: boolean;
|
|
9
9
|
export declare const CONTEXT: CanvasRenderingContext2D | null;
|
|
10
10
|
export declare const SVG_PIXEL_DATA_URL: string;
|
|
11
|
-
export declare const ENTRIES: ListenerEntry[];
|
|
11
|
+
export declare const ENTRIES: ListenerEntry<Appearances>[];
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import { Appearances } from "../constants";
|
|
2
|
-
export declare interface ListenerEntry {
|
|
3
|
-
fn: (appearance: Appearances) => any;
|
|
4
|
-
capture: boolean;
|
|
5
|
-
once: boolean;
|
|
6
|
-
signal?: AbortSignal;
|
|
7
|
-
}
|
|
8
2
|
export declare interface AppearanceInstance {
|
|
9
3
|
get value(): Appearances;
|
|
10
4
|
set value(appearances: Exclude<Appearances, Appearances.Unknown>);
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
export declare interface ListenerEntry {
|
|
2
|
-
fn: () => any;
|
|
3
|
-
capture: boolean;
|
|
4
|
-
once: boolean;
|
|
5
|
-
signal?: AbortSignal;
|
|
6
|
-
}
|
|
7
1
|
export declare interface DimensionInstance {
|
|
2
|
+
get value(): Dimension;
|
|
3
|
+
onchange: any;
|
|
4
|
+
}
|
|
5
|
+
export declare interface Dimension {
|
|
6
|
+
outerWidth: number;
|
|
7
|
+
outerHeight: number;
|
|
8
|
+
innerWidth: number;
|
|
9
|
+
innerHeight: number;
|
|
10
|
+
scale: number;
|
|
8
11
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DimensionInstance } from "./
|
|
1
|
+
import { DimensionInstance } from "./dimensions";
|
|
2
2
|
import Dimension from "../cores";
|
|
3
|
-
export * from "./
|
|
3
|
+
export * from "./dimensions";
|
|
4
4
|
declare module 'native-fn' {
|
|
5
5
|
interface NativePlugins {
|
|
6
6
|
Dimension: DimensionInstance;
|
|
@@ -10,18 +10,8 @@ declare global {
|
|
|
10
10
|
browserLanguage?: string;
|
|
11
11
|
systemLanguage?: string;
|
|
12
12
|
userLanguage?: string;
|
|
13
|
-
connection?: NavigatorConnection;
|
|
14
|
-
mozConnection?: NavigatorConnection;
|
|
15
|
-
webkitConnection?: NavigatorConnection;
|
|
16
13
|
}
|
|
17
14
|
}
|
|
18
|
-
interface NavigatorConnection {
|
|
19
|
-
effectiveType?: 'slow-2g' | '2g' | '3g' | '4g';
|
|
20
|
-
type?: 'bluetooth' | 'cellular' | 'ethernet' | 'none' | 'wifi' | 'wimax' | 'other';
|
|
21
|
-
downlink?: number;
|
|
22
|
-
rtt?: number;
|
|
23
|
-
saveData?: boolean;
|
|
24
|
-
}
|
|
25
15
|
interface CordovaDevice {
|
|
26
16
|
platform: string;
|
|
27
17
|
version: string;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { Browsers, CrossPlatformFramework, Devices, Engines, OS } from "../constants";
|
|
2
|
+
export declare type VersionResolver = undefined | string | ((string: string | undefined) => string);
|
|
2
3
|
export declare interface PlatformInstance {
|
|
3
4
|
os: NameVersionPair<OS>;
|
|
4
5
|
engine: NameVersionPair<Engines>;
|
|
5
6
|
browser: NameVersionPair<Browsers>;
|
|
6
7
|
device: Devices;
|
|
7
8
|
crossPlatformFramework: CrossPlatformFramework;
|
|
8
|
-
network: Network;
|
|
9
9
|
locale: Locale;
|
|
10
|
-
dimension: Dimension;
|
|
11
10
|
renderer: string;
|
|
12
11
|
userAgent: string;
|
|
13
12
|
readyState: 'loading' | 'complete';
|
|
@@ -20,24 +19,9 @@ export declare interface NameVersionPair<T> {
|
|
|
20
19
|
name: T;
|
|
21
20
|
version: string;
|
|
22
21
|
}
|
|
23
|
-
export declare interface Network {
|
|
24
|
-
isOnline: boolean | null;
|
|
25
|
-
effectiveType: 'slow-2g' | '2g' | '3g' | '4g' | null;
|
|
26
|
-
type: 'bluetooth' | 'cellular' | 'ethernet' | 'none' | 'wifi' | 'wimax' | 'other' | null;
|
|
27
|
-
downlink: number | null;
|
|
28
|
-
rtt: number | null;
|
|
29
|
-
saveData: boolean | null;
|
|
30
|
-
}
|
|
31
|
-
export declare interface Dimension {
|
|
32
|
-
outerWidth: number;
|
|
33
|
-
outerHeight: number;
|
|
34
|
-
innerWidth: number;
|
|
35
|
-
innerHeight: number;
|
|
36
|
-
scale: number;
|
|
37
|
-
}
|
|
38
22
|
export declare interface Locale {
|
|
39
|
-
language: string;
|
|
23
|
+
language: string | null;
|
|
40
24
|
languages: string[];
|
|
41
|
-
timezone: string;
|
|
25
|
+
timezone: string | null;
|
|
42
26
|
timezoneOffset: number;
|
|
43
27
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function request<T = unknown>(url: string, options?: Record<string, any>): Promise<T>;
|
|
@@ -70,6 +70,14 @@ var CrossPlatformFramework;
|
|
|
70
70
|
CrossPlatformFramework["Cordova"] = "Cordova";
|
|
71
71
|
})(CrossPlatformFramework || (CrossPlatformFramework = {}));
|
|
72
72
|
var USER_AGENT = typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgent === 'string' ? globalThis.navigator.userAgent : '';
|
|
73
|
+
var HIGH_ENTROPY_BRAND_NAME_MAP = {
|
|
74
|
+
'Google Chrome': 'Chrome',
|
|
75
|
+
'Microsoft Edge': 'Edge',
|
|
76
|
+
'Microsoft Edge WebView2': 'Edge WebView2',
|
|
77
|
+
'Android WebView': 'Chrome WebView',
|
|
78
|
+
'HeadlessChrome': 'Chrome Headless',
|
|
79
|
+
'OperaMobile': 'Opera Mobi',
|
|
80
|
+
};
|
|
73
81
|
|
|
74
82
|
var readyState = 'loading';
|
|
75
83
|
var readyCallback = [];
|
|
@@ -83,15 +91,9 @@ var Platform = {
|
|
|
83
91
|
get readyState() {
|
|
84
92
|
return readyState;
|
|
85
93
|
},
|
|
86
|
-
get network() {
|
|
87
|
-
return getNetwork();
|
|
88
|
-
},
|
|
89
94
|
get locale() {
|
|
90
95
|
return getLocale();
|
|
91
96
|
},
|
|
92
|
-
get dimension() {
|
|
93
|
-
return getDimension();
|
|
94
|
-
},
|
|
95
97
|
get device() {
|
|
96
98
|
if (this.os.name === OS.iOS || this.os.name === OS.Android)
|
|
97
99
|
return Devices.Mobile;
|
|
@@ -106,7 +108,7 @@ var Platform = {
|
|
|
106
108
|
return /; ?wv|applewebkit(?!.*safari)/i.test(this.userAgent);
|
|
107
109
|
},
|
|
108
110
|
get isNode() {
|
|
109
|
-
return typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined;
|
|
111
|
+
return typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && typeof globalThis.process.versions.node !== 'undefined';
|
|
110
112
|
},
|
|
111
113
|
get isStandalone() {
|
|
112
114
|
if (this.os.name === OS.iOS)
|
|
@@ -128,6 +130,33 @@ var Platform = {
|
|
|
128
130
|
}
|
|
129
131
|
}
|
|
130
132
|
};
|
|
133
|
+
function resolveWindowsVersion(string) {
|
|
134
|
+
if (typeof string === 'undefined')
|
|
135
|
+
return '';
|
|
136
|
+
var mapped = {
|
|
137
|
+
'4.90': 'ME',
|
|
138
|
+
'NT3.51': 'NT 3.11',
|
|
139
|
+
'NT4.0': 'NT 4.0',
|
|
140
|
+
'NT 5.0': '2000',
|
|
141
|
+
'NT 5.1': 'XP',
|
|
142
|
+
'NT 5.2': 'XP',
|
|
143
|
+
'NT 6.0': 'Vista',
|
|
144
|
+
'NT 6.1': '7',
|
|
145
|
+
'NT 6.2': '8',
|
|
146
|
+
'NT 6.3': '8.1',
|
|
147
|
+
'NT 6.4': '10',
|
|
148
|
+
'NT 10.0': '10',
|
|
149
|
+
'ARM': 'RT'
|
|
150
|
+
}[string];
|
|
151
|
+
if (typeof mapped !== 'undefined')
|
|
152
|
+
return mapped;
|
|
153
|
+
return string;
|
|
154
|
+
}
|
|
155
|
+
function resolveUnderscoreVersion(string) {
|
|
156
|
+
if (typeof string === 'undefined')
|
|
157
|
+
return '';
|
|
158
|
+
return string.replace(/_/g, '.');
|
|
159
|
+
}
|
|
131
160
|
var OS_RESOLVER_MAP = [
|
|
132
161
|
[/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
|
|
133
162
|
[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i, OS.Windows, resolveWindowsVersion],
|
|
@@ -186,14 +215,6 @@ var BROWSER_RESOLVER_MAP = [
|
|
|
186
215
|
[/mobile vr; rv:([\w.]+)\).+firefox/i, Browsers.Firefox],
|
|
187
216
|
[/firefox\/([\w.]+)/i, Browsers.Firefox],
|
|
188
217
|
];
|
|
189
|
-
var HIGH_ENTROPY_BRAND_NAME_MAP = {
|
|
190
|
-
'Google Chrome': 'Chrome',
|
|
191
|
-
'Microsoft Edge': 'Edge',
|
|
192
|
-
'Microsoft Edge WebView2': 'Edge WebView2',
|
|
193
|
-
'Android WebView': 'Chrome WebView',
|
|
194
|
-
'HeadlessChrome': 'Chrome Headless',
|
|
195
|
-
'OperaMobile': 'Opera Mobi',
|
|
196
|
-
};
|
|
197
218
|
function incrementPendingTasks() {
|
|
198
219
|
pendingTasks++;
|
|
199
220
|
}
|
|
@@ -214,33 +235,6 @@ function checkReady() {
|
|
|
214
235
|
readyCallback.length = 0;
|
|
215
236
|
}
|
|
216
237
|
}
|
|
217
|
-
function resolveWindowsVersion(string) {
|
|
218
|
-
if (string === undefined)
|
|
219
|
-
return '';
|
|
220
|
-
var mapped = {
|
|
221
|
-
'4.90': 'ME',
|
|
222
|
-
'NT3.51': 'NT 3.11',
|
|
223
|
-
'NT4.0': 'NT 4.0',
|
|
224
|
-
'NT 5.0': '2000',
|
|
225
|
-
'NT 5.1': 'XP',
|
|
226
|
-
'NT 5.2': 'XP',
|
|
227
|
-
'NT 6.0': 'Vista',
|
|
228
|
-
'NT 6.1': '7',
|
|
229
|
-
'NT 6.2': '8',
|
|
230
|
-
'NT 6.3': '8.1',
|
|
231
|
-
'NT 6.4': '10',
|
|
232
|
-
'NT 10.0': '10',
|
|
233
|
-
'ARM': 'RT'
|
|
234
|
-
}[string];
|
|
235
|
-
if (mapped !== undefined)
|
|
236
|
-
return mapped;
|
|
237
|
-
return string;
|
|
238
|
-
}
|
|
239
|
-
function resolveUnderscoreVersion(string) {
|
|
240
|
-
if (string === undefined)
|
|
241
|
-
return '';
|
|
242
|
-
return string.replace(/_/g, '.');
|
|
243
|
-
}
|
|
244
238
|
function resolveSemanticWindowsVersion(version, defaultValue) {
|
|
245
239
|
if (version.major === 10 && version.minor === 0 && version.build >= 22000)
|
|
246
240
|
return '11';
|
|
@@ -377,12 +371,12 @@ function resolveVersion(string, resolver) {
|
|
|
377
371
|
return resolver(string);
|
|
378
372
|
if (typeof resolver === 'string')
|
|
379
373
|
return resolver;
|
|
380
|
-
if (string === undefined)
|
|
374
|
+
if (typeof string === 'undefined')
|
|
381
375
|
return '';
|
|
382
376
|
return string;
|
|
383
377
|
}
|
|
384
378
|
function normalizeBrand(entry) {
|
|
385
|
-
if (entry === null || entry === undefined)
|
|
379
|
+
if (entry === null || typeof entry === 'undefined')
|
|
386
380
|
return { brand: '', version: '' };
|
|
387
381
|
if (typeof entry === 'string')
|
|
388
382
|
return { brand: entry, version: '' };
|
|
@@ -436,102 +430,13 @@ function getRenderer() {
|
|
|
436
430
|
return '';
|
|
437
431
|
}
|
|
438
432
|
}
|
|
439
|
-
function getNetwork() {
|
|
440
|
-
var network = {
|
|
441
|
-
isOnline: null,
|
|
442
|
-
effectiveType: null,
|
|
443
|
-
type: null,
|
|
444
|
-
downlink: null,
|
|
445
|
-
rtt: null,
|
|
446
|
-
saveData: null,
|
|
447
|
-
};
|
|
448
|
-
if (typeof globalThis.navigator !== 'undefined') {
|
|
449
|
-
if (typeof globalThis.navigator.onLine !== 'undefined')
|
|
450
|
-
network.isOnline = globalThis.navigator.onLine;
|
|
451
|
-
var connection = globalThis.navigator.connection || globalThis.navigator.mozConnection || globalThis.navigator.webkitConnection;
|
|
452
|
-
if (typeof connection !== 'undefined') {
|
|
453
|
-
if (typeof connection.effectiveType !== 'undefined')
|
|
454
|
-
network.effectiveType = connection.effectiveType;
|
|
455
|
-
if (typeof connection.type !== 'undefined')
|
|
456
|
-
network.type = connection.type;
|
|
457
|
-
if (typeof connection.downlink !== 'undefined')
|
|
458
|
-
network.downlink = connection.downlink;
|
|
459
|
-
if (typeof connection.rtt !== 'undefined')
|
|
460
|
-
network.rtt = connection.rtt;
|
|
461
|
-
if (typeof connection.saveData !== 'undefined')
|
|
462
|
-
network.saveData = connection.saveData;
|
|
463
|
-
return network;
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
if (Platform.isNode) {
|
|
467
|
-
try {
|
|
468
|
-
var os = require('os');
|
|
469
|
-
var networkInterfaces = os.networkInterfaces();
|
|
470
|
-
var networkInterfaceNames = Object.keys(networkInterfaces);
|
|
471
|
-
for (var i = 0; i < networkInterfaceNames.length; i++) {
|
|
472
|
-
var name_1 = networkInterfaceNames[i];
|
|
473
|
-
var networkInterface = networkInterfaces[name_1];
|
|
474
|
-
for (var j = 0; j < networkInterface.length; j++) {
|
|
475
|
-
var address = networkInterface[j];
|
|
476
|
-
if (!address.internal && address.family === 'IPv4')
|
|
477
|
-
network.isOnline = true;
|
|
478
|
-
}
|
|
479
|
-
if (network.isOnline)
|
|
480
|
-
break;
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
catch (_) {
|
|
484
|
-
}
|
|
485
|
-
try {
|
|
486
|
-
var childProcess = require('child_process');
|
|
487
|
-
if (Platform.os.name === OS.Windows) {
|
|
488
|
-
try {
|
|
489
|
-
var output = childProcess.execSync('netsh wlan show interfaces', { encoding: 'utf8', timeout: 5000 });
|
|
490
|
-
if (output.includes('State') && output.includes('connected'))
|
|
491
|
-
network.type = 'wifi';
|
|
492
|
-
}
|
|
493
|
-
catch (_) {
|
|
494
|
-
}
|
|
495
|
-
if (network.type === null) {
|
|
496
|
-
try {
|
|
497
|
-
var output = childProcess.execSync('ipconfig', { encoding: 'utf8', timeout: 5000 });
|
|
498
|
-
if (output.includes('Ethernet adapter'))
|
|
499
|
-
network.type = 'ethernet';
|
|
500
|
-
}
|
|
501
|
-
catch (_) {
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
if (network.type === null)
|
|
505
|
-
network.type = 'other';
|
|
506
|
-
}
|
|
507
|
-
else if (Platform.os.name === OS.MacOS) {
|
|
508
|
-
try {
|
|
509
|
-
var output = childProcess.execSync('networksetup -listallhardwareports', { encoding: 'utf8', timeout: 5000 });
|
|
510
|
-
var activeInterface = childProcess.execSync('route -n get default | grep interface', { encoding: 'utf8', timeout: 5000 });
|
|
511
|
-
if (activeInterface.includes('en0') && output.includes('Wi-Fi'))
|
|
512
|
-
network.type = 'wifi';
|
|
513
|
-
else if (activeInterface.includes('en') || output.includes('Ethernet'))
|
|
514
|
-
network.type = 'ethernet';
|
|
515
|
-
else
|
|
516
|
-
network.type = 'other';
|
|
517
|
-
}
|
|
518
|
-
catch (_) {
|
|
519
|
-
network.type = 'other';
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
catch (_) {
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
return network;
|
|
527
|
-
}
|
|
528
433
|
function normalizeLocale(locale) {
|
|
529
|
-
if (locale === null || locale === undefined)
|
|
434
|
+
if (locale === null || typeof locale === 'undefined')
|
|
530
435
|
return locale;
|
|
531
436
|
if (locale.length === 0)
|
|
532
437
|
return null;
|
|
533
438
|
locale = locale.replace(/_/g, '-');
|
|
534
|
-
if (locale === 'C' || locale === 'posix'
|
|
439
|
+
if (locale === 'C' || locale.toLowerCase() === 'posix')
|
|
535
440
|
return 'en-US';
|
|
536
441
|
if (locale.indexOf('.') !== -1)
|
|
537
442
|
return normalizeLocale(locale.split('.')[0]);
|
|
@@ -549,9 +454,9 @@ function normalizeLocale(locale) {
|
|
|
549
454
|
}
|
|
550
455
|
function getLocale() {
|
|
551
456
|
var locale = {
|
|
552
|
-
language:
|
|
457
|
+
language: null,
|
|
553
458
|
languages: [],
|
|
554
|
-
timezone:
|
|
459
|
+
timezone: null,
|
|
555
460
|
timezoneOffset: 0,
|
|
556
461
|
};
|
|
557
462
|
function addLanguages(language) {
|
|
@@ -561,7 +466,7 @@ function getLocale() {
|
|
|
561
466
|
function addLanguage(language) {
|
|
562
467
|
language = normalizeLocale(language);
|
|
563
468
|
if (typeof language === "string" && locale.languages.indexOf(language) === -1) {
|
|
564
|
-
if (locale.language
|
|
469
|
+
if (locale.language === null)
|
|
565
470
|
locale.language = language;
|
|
566
471
|
locale.languages.push(language);
|
|
567
472
|
}
|
|
@@ -619,6 +524,11 @@ function getLocale() {
|
|
|
619
524
|
}
|
|
620
525
|
catch (_) {
|
|
621
526
|
}
|
|
527
|
+
try {
|
|
528
|
+
locale.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
529
|
+
}
|
|
530
|
+
catch (_) {
|
|
531
|
+
}
|
|
622
532
|
}
|
|
623
533
|
if (typeof globalThis.navigator !== 'undefined') {
|
|
624
534
|
if (typeof globalThis.navigator.languages !== 'undefined')
|
|
@@ -632,13 +542,6 @@ function getLocale() {
|
|
|
632
542
|
if (typeof globalThis.navigator.systemLanguage !== 'undefined')
|
|
633
543
|
addLanguage(globalThis.navigator.systemLanguage);
|
|
634
544
|
}
|
|
635
|
-
try {
|
|
636
|
-
if (typeof Intl !== 'undefined') {
|
|
637
|
-
locale.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
catch (_) {
|
|
641
|
-
}
|
|
642
545
|
try {
|
|
643
546
|
locale.timezoneOffset = new Date().getTimezoneOffset();
|
|
644
547
|
}
|
|
@@ -646,63 +549,8 @@ function getLocale() {
|
|
|
646
549
|
}
|
|
647
550
|
return locale;
|
|
648
551
|
}
|
|
649
|
-
function getDimension() {
|
|
650
|
-
var dimension = {
|
|
651
|
-
innerWidth: -1,
|
|
652
|
-
innerHeight: -1,
|
|
653
|
-
outerWidth: -1,
|
|
654
|
-
outerHeight: -1,
|
|
655
|
-
scale: 1,
|
|
656
|
-
};
|
|
657
|
-
if (typeof globalThis.innerWidth !== 'undefined') {
|
|
658
|
-
dimension.innerWidth = globalThis.innerWidth;
|
|
659
|
-
dimension.innerHeight = globalThis.innerHeight;
|
|
660
|
-
dimension.outerWidth = globalThis.outerWidth;
|
|
661
|
-
dimension.outerHeight = globalThis.outerHeight;
|
|
662
|
-
dimension.scale = globalThis.devicePixelRatio || 1;
|
|
663
|
-
return dimension;
|
|
664
|
-
}
|
|
665
|
-
if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative) {
|
|
666
|
-
try {
|
|
667
|
-
var reactNative = require('react-native');
|
|
668
|
-
var dimensions = reactNative.Dimensions;
|
|
669
|
-
var pixelRatio = reactNative.PixelRatio;
|
|
670
|
-
var screenDimensions = dimensions.get('screen');
|
|
671
|
-
var windowDimensions = dimensions.get('window');
|
|
672
|
-
dimension.innerWidth = screenDimensions.width;
|
|
673
|
-
dimension.innerHeight = screenDimensions.height;
|
|
674
|
-
dimension.outerWidth = windowDimensions.width;
|
|
675
|
-
dimension.outerHeight = windowDimensions.height;
|
|
676
|
-
dimension.scale = pixelRatio.get();
|
|
677
|
-
return dimension;
|
|
678
|
-
}
|
|
679
|
-
catch (_) {
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron) {
|
|
683
|
-
try {
|
|
684
|
-
var electron = require('electron');
|
|
685
|
-
var screen_1 = electron.screen;
|
|
686
|
-
var browserWindow = electron.BrowserWindow;
|
|
687
|
-
var focusedWindow = browserWindow.getFocusedWindow() || browserWindow.getAllWindows()[0];
|
|
688
|
-
if (focusedWindow !== undefined) {
|
|
689
|
-
var contentSize = focusedWindow.getContentSize();
|
|
690
|
-
var size = focusedWindow.getSize();
|
|
691
|
-
dimension.innerWidth = contentSize[0];
|
|
692
|
-
dimension.innerHeight = contentSize[1];
|
|
693
|
-
dimension.outerWidth = size[0];
|
|
694
|
-
dimension.outerHeight = size[1];
|
|
695
|
-
dimension.scale = screen_1.getDisplayMatching(focusedWindow.getBounds()).scaleFactor;
|
|
696
|
-
}
|
|
697
|
-
return dimension;
|
|
698
|
-
}
|
|
699
|
-
catch (_) {
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
return dimension;
|
|
703
|
-
}
|
|
704
552
|
function init() {
|
|
705
|
-
if ((typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(USER_AGENT)))
|
|
553
|
+
if ((typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && typeof globalThis.process.versions.electron !== 'undefined') || (/ electron\//i.test(USER_AGENT)))
|
|
706
554
|
Platform.crossPlatformFramework = CrossPlatformFramework.Electron;
|
|
707
555
|
if (typeof globalThis.navigator !== 'undefined' && globalThis.navigator.product === 'ReactNative')
|
|
708
556
|
Platform.crossPlatformFramework = CrossPlatformFramework.ReactNative;
|
|
@@ -898,8 +746,7 @@ function init() {
|
|
|
898
746
|
finally {
|
|
899
747
|
decrementPendingTasks();
|
|
900
748
|
}
|
|
901
|
-
})
|
|
902
|
-
.catch(decrementPendingTasks);
|
|
749
|
+
});
|
|
903
750
|
}
|
|
904
751
|
checkReady();
|
|
905
752
|
}
|
|
@@ -992,7 +839,7 @@ function getDefaultTarget() {
|
|
|
992
839
|
var electron = require('electron');
|
|
993
840
|
var browserWindow = electron.BrowserWindow;
|
|
994
841
|
var focusedWindow = browserWindow.getFocusedWindow() || browserWindow.getAllWindows()[0];
|
|
995
|
-
if (focusedWindow === undefined)
|
|
842
|
+
if (typeof focusedWindow === 'undefined')
|
|
996
843
|
throw new Error();
|
|
997
844
|
return focusedWindow;
|
|
998
845
|
}
|
|
@@ -1157,7 +1004,7 @@ function getElement() {
|
|
|
1157
1004
|
return null;
|
|
1158
1005
|
}
|
|
1159
1006
|
var currentElement = globalThis.document[api.element];
|
|
1160
|
-
if (currentElement !== null && currentElement !== undefined)
|
|
1007
|
+
if (currentElement !== null && typeof currentElement !== 'undefined')
|
|
1161
1008
|
return currentElement;
|
|
1162
1009
|
return null;
|
|
1163
1010
|
}
|
|
@@ -1194,7 +1041,7 @@ function request(target, options) {
|
|
|
1194
1041
|
if (typeof method === 'function') {
|
|
1195
1042
|
try {
|
|
1196
1043
|
var result = method.call(target, options);
|
|
1197
|
-
if (result !== undefined && typeof result.then === 'function') {
|
|
1044
|
+
if (typeof result !== 'undefined' && typeof result.then === 'function') {
|
|
1198
1045
|
result
|
|
1199
1046
|
.then(function () {
|
|
1200
1047
|
resolve();
|
|
@@ -1262,7 +1109,7 @@ function exit() {
|
|
|
1262
1109
|
var method = globalThis.document[api.exit];
|
|
1263
1110
|
if (typeof method === 'function') {
|
|
1264
1111
|
var result = method.call(globalThis.document);
|
|
1265
|
-
if (result !== undefined && typeof result.then === 'function') {
|
|
1112
|
+
if (typeof result !== 'undefined' && typeof result.then === 'function') {
|
|
1266
1113
|
result
|
|
1267
1114
|
.then(function () {
|
|
1268
1115
|
resolve();
|