@kdcloudjs/kwc-shared-utils 0.0.4 → 0.0.5
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/client/index.cjs.js +1 -1
- package/dist/client/index.esm.js +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/shared/{index-B436uFgh.cjs.js → index-CNBHeIX7.cjs.js} +2 -2
- package/dist/shared/{index-B436uFgh.cjs.js.map → index-CNBHeIX7.cjs.js.map} +1 -1
- package/dist/shared/{index-pPqP08Tl.esm.js → index-Cqlu4UVy.esm.js} +2 -2
- package/dist/shared/{index-pPqP08Tl.esm.js.map → index-Cqlu4UVy.esm.js.map} +1 -1
- package/package.json +4 -4
package/dist/client/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var s=require("../shared/index-
|
|
1
|
+
"use strict";var s=require("../shared/index-CNBHeIX7.cjs.js");exports.getAppName=s.getApp,exports.getBrowserName=s.getBrowser,exports.isChrome=s.isChrome,exports.isChromiumEdge=s.isChromiumEdge,exports.isDD=s.isDD,exports.isEdge=s.isEdge,exports.isFeiShu=s.isFeiShu,exports.isFirefox=s.isFirefox,exports.isIE=s.isIE,exports.isLegacyEdge=s.isLegacyEdge,exports.isMobile=s.isMobile,exports.isPC=s.isPC,exports.isSafari=s.isSafari,exports.isWX=s.isWX,exports.isWeLink=s.isWeLink,exports.isWxWork=s.isWxWork,exports.isYzj=s.isYzj,exports.isYzjDesktop=s.isYzjDesktop,exports.isYzjOldDesktop=s.isYzjOldDesktop;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/client/index.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{g as getAppName,k as getBrowserName,l as isChrome,m as isChromiumEdge,a as isDD,n as isEdge,b as isFeiShu,p as isFirefox,q as isIE,o as isLegacyEdge,s as isMobile,t as isPC,r as isSafari,e as isWX,c as isWeLink,d as isWxWork,f as isYzj,h as isYzjDesktop,j as isYzjOldDesktop}from"../shared/index-
|
|
1
|
+
export{g as getAppName,k as getBrowserName,l as isChrome,m as isChromiumEdge,a as isDD,n as isEdge,b as isFeiShu,p as isFirefox,q as isIE,o as isLegacyEdge,s as isMobile,t as isPC,r as isSafari,e as isWX,c as isWeLink,d as isWxWork,f as isYzj,h as isYzjDesktop,j as isYzjOldDesktop}from"../shared/index-Cqlu4UVy.esm.js";
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("./shared/index-CKzrFqj6.cjs.js"),r=require("./shared/index-B0ILkJm3.cjs.js"),s=require("./shared/index-C96d8r7U.cjs.js"),i=require("./shared/index-
|
|
1
|
+
"use strict";var e=require("./shared/index-CKzrFqj6.cjs.js"),r=require("./shared/index-B0ILkJm3.cjs.js"),s=require("./shared/index-C96d8r7U.cjs.js"),i=require("./shared/index-CNBHeIX7.cjs.js"),d=require("./shared/index-Dtu_3V-z.cjs.js"),x=require("./shared/index-UhtWZvgp.cjs.js"),n=require("./shared/index-CGzlSIt0.cjs.js");exports.platformResourceLoader=e.index,exports.openApiAdapter=r.index,exports.bosApi=s.index,exports.client=i.index,exports.messageService=d.index,exports.kingdeeDataService=x.index,exports.sendBosPlatformEvent=n.index;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{i as platformResourceLoader}from"./shared/index-D_DekteB.esm.js";export{i as openApiAdapter}from"./shared/index-CXYAeW-7.esm.js";export{i as bosApi}from"./shared/index-RQMVLnNM.esm.js";export{i as client}from"./shared/index-
|
|
1
|
+
export{i as platformResourceLoader}from"./shared/index-D_DekteB.esm.js";export{i as openApiAdapter}from"./shared/index-CXYAeW-7.esm.js";export{i as bosApi}from"./shared/index-RQMVLnNM.esm.js";export{i as client}from"./shared/index-Cqlu4UVy.esm.js";export{i as messageService}from"./shared/index-ChQWdmu9.esm.js";export{i as kingdeeDataService}from"./shared/index-KT-nyvfl.esm.js";export{i as sendBosPlatformEvent}from"./shared/index-qaD2HVRQ.esm.js";
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e="yunzhijia",t="yunzhijia_desktop",n="yunzhijia_old_desktop",r="weixin",o="dingding",i="wxwork",s="welink",u="feishu",a="unknown";function g(){const e=navigator.userAgent;return/Qing\/.*;(iOS|iPhone|Android|iPadOS|Harmony)/.test(e)}function c(){const e=navigator.userAgent;return/App\/cloudhub/.test(e)}function d(){const e=navigator.userAgent;return/clientId:10204/.test(e)}function x(){const e=navigator.userAgent;return e.indexOf("MicroMessenger")>-1&&e.indexOf("wxwork")<0}function f(){const e=navigator.userAgent;return e.indexOf("MicroMessenger")>-1&&e.indexOf("wxwork")>-1}function p(){const e=navigator.userAgent,t=e.indexOf("DingTalk")>-1,n=-1===e.indexOf("MiniProgram")&&-1===e.indexOf("dd-web");return t&&n}function w(){const e=navigator.userAgent;return e.indexOf("welink")>-1||e.indexOf("cloudlink")>-1}function k(){return navigator.userAgent.indexOf("Lark/")>-1}function A(){return g()?e:c()?t:d()?n:x()?r:f()?i:p()?o:w?s:k()?u:a}function h(){const e=navigator.userAgent.toLowerCase();return/chrome|crios/.test(e)&&!/edg|edge|opr|opera|fxios|samsungbrowser/.test(e)}function m(){const e=navigator.userAgent.toLowerCase();return/edg/.test(e)}function v(){const e=navigator.userAgent.toLowerCase();return/edge/.test(e)&&!/edg/.test(e)}function l(){return m()||v()}function O(){const e=navigator.userAgent.toLowerCase();return/firefox|fxios/.test(e)}function C(){const e=navigator.userAgent.toLowerCase();return/msie|trident/.test(e)}function L(){const e=navigator.userAgent.toLowerCase();return/safari/.test(e)&&!/chrome|crios|edg|edge|fxios|opr|opera/.test(e)}const j="chrome",z="edge",D="firefox",M="ie",E="safari",P="unknown";function W(){return h()?j:l()?z:O()?D:L()?E:C()?M:P}function b(){const e=navigator.userAgent.toLowerCase()
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
"use strict";const e="yunzhijia",t="yunzhijia_desktop",n="yunzhijia_old_desktop",r="weixin",o="dingding",i="wxwork",s="welink",u="feishu",a="unknown";function g(){const e=navigator.userAgent;return/Qing\/.*;(iOS|iPhone|Android|iPadOS|Harmony)/.test(e)}function c(){const e=navigator.userAgent;return/App\/cloudhub/.test(e)}function d(){const e=navigator.userAgent;return/clientId:10204/.test(e)}function x(){const e=navigator.userAgent;return e.indexOf("MicroMessenger")>-1&&e.indexOf("wxwork")<0}function f(){const e=navigator.userAgent;return e.indexOf("MicroMessenger")>-1&&e.indexOf("wxwork")>-1}function p(){const e=navigator.userAgent,t=e.indexOf("DingTalk")>-1,n=-1===e.indexOf("MiniProgram")&&-1===e.indexOf("dd-web");return t&&n}function w(){const e=navigator.userAgent;return e.indexOf("welink")>-1||e.indexOf("cloudlink")>-1}function k(){return navigator.userAgent.indexOf("Lark/")>-1}function A(){return g()?e:c()?t:d()?n:x()?r:f()?i:p()?o:w?s:k()?u:a}function h(){const e=navigator.userAgent.toLowerCase();return/chrome|crios/.test(e)&&!/edg|edge|opr|opera|fxios|samsungbrowser/.test(e)}function m(){const e=navigator.userAgent.toLowerCase();return/edg/.test(e)}function v(){const e=navigator.userAgent.toLowerCase();return/edge/.test(e)&&!/edg/.test(e)}function l(){return m()||v()}function O(){const e=navigator.userAgent.toLowerCase();return/firefox|fxios/.test(e)}function C(){const e=navigator.userAgent.toLowerCase();return/msie|trident/.test(e)}function L(){const e=navigator.userAgent.toLowerCase();return/safari/.test(e)&&!/chrome|crios|edg|edge|fxios|opr|opera/.test(e)}const j="chrome",z="edge",D="firefox",M="ie",E="safari",P="unknown";function W(){return h()?j:l()?z:O()?D:L()?E:C()?M:P}function b(){const e=navigator.userAgent.toLowerCase(),t=/Android|iPhone|iPad/i.test(e)||/Harmony/i.test(e)&&/Mobile/i.test(e),n="ontouchstart"in window||navigator.maxTouchPoints>0,r=/Macintosh/i.test(e)&&n;return t||r}function y(){return!b()}var _=Object.freeze({__proto__:null,getAppName:A,getBrowserName:W,isChrome:h,isChromiumEdge:m,isDD:p,isEdge:l,isFeiShu:k,isFirefox:O,isIE:C,isLegacyEdge:v,isMobile:b,isPC:y,isSafari:L,isWX:x,isWeLink:w,isWxWork:f,isYzj:g,isYzjDesktop:c,isYzjOldDesktop:d});exports.getApp=A,exports.getBrowser=W,exports.index=_,exports.isChrome=h,exports.isChromiumEdge=m,exports.isDD=p,exports.isEdge=l,exports.isFeiShu=k,exports.isFirefox=O,exports.isIE=C,exports.isLegacyEdge=v,exports.isMobile=b,exports.isPC=y,exports.isSafari=L,exports.isWX=x,exports.isWeLink=w,exports.isWxWork=f,exports.isYzj=g,exports.isYzjDesktop=c,exports.isYzjOldDesktop=d;
|
|
2
|
+
//# sourceMappingURL=index-CNBHeIX7.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-CNBHeIX7.cjs.js","sources":["../../src/modules/client/app.js","../../src/modules/client/browser.js","../../src/modules/client/device.js"],"sourcesContent":["const App = {\n yzj: 'yunzhijia',\n yzjDesktop: 'yunzhijia_desktop',\n yzjOldDesktop: 'yunzhijia_old_desktop',\n wx: 'weixin',\n dd: 'dingding',\n wxwork: 'wxwork',\n welink: 'welink',\n feishu: 'feishu',\n unknown: 'unknown'\n}\n\nexport function isYzj() {\n const agent = navigator.userAgent;\n return /Qing\\/.*;(iOS|iPhone|Android|iPadOS|Harmony)/.test(agent);\n}\n\nexport function isYzjDesktop() {\n const agent = navigator.userAgent;\n return /App\\/cloudhub/.test(agent);\n}\n\nexport function isYzjOldDesktop() {\n const agent = navigator.userAgent;\n return /clientId:10204/.test(agent);\n}\n\nexport function isWX() {\n const agent = navigator.userAgent;\n return agent.indexOf('MicroMessenger') > -1 && agent.indexOf('wxwork') < 0;\n}\n\nexport function isWxWork() {\n const agent = navigator.userAgent;\n return agent.indexOf('MicroMessenger') > -1 && agent.indexOf('wxwork') > -1;\n}\n\nexport function isDD() {\n const agent = navigator.userAgent;\n const _isDD = agent.indexOf('DingTalk') > -1;\n const isDDMiniProgram = agent.indexOf('MiniProgram') === -1 && agent.indexOf('dd-web') === -1;\n return _isDD && isDDMiniProgram;\n}\n\nexport function isWeLink() {\n const agent = navigator.userAgent;\n return agent.indexOf('welink') > -1 || agent.indexOf('cloudlink') > -1;\n}\n\nexport function isFeiShu() {\n const agent = navigator.userAgent;\n return agent.indexOf('Lark/') > -1;\n}\n\nexport function getApp() {\n if (isYzj()) return App.yzj;\n else if (isYzjDesktop()) return App.yzjDesktop;\n else if (isYzjOldDesktop()) return App.yzjOldDesktop;\n else if (isWX()) return App.wx;\n else if (isWxWork()) return App.wxwork;\n else if (isDD()) return App.dd;\n else if (isWeLink) return App.welink;\n else if (isFeiShu()) return App.feishu;\n else return App.unknown;\n}\n\nexport default getApp;\n","export function isChrome() {\n const userAgent = navigator.userAgent.toLowerCase();\n return /chrome|crios/.test(userAgent) && !/edg|edge|opr|opera|fxios|samsungbrowser/.test(userAgent);\n}\n\nexport function isChromiumEdge() {\n const userAgent = navigator.userAgent.toLowerCase();\n return /edg/.test(userAgent);\n}\n\nexport function isLegacyEdge() {\n const userAgent = navigator.userAgent.toLowerCase();\n return /edge/.test(userAgent) && !/edg/.test(userAgent);\n}\n\nexport function isEdge() {\n return isChromiumEdge() || isLegacyEdge();\n}\n\nexport function isFirefox() {\n const userAgent = navigator.userAgent.toLowerCase();\n return /firefox|fxios/.test(userAgent);\n}\n\nexport function isIE() {\n const userAgent = navigator.userAgent.toLowerCase();\n return /msie|trident/.test(userAgent);\n}\n\nexport function isSafari() {\n const userAgent = navigator.userAgent.toLowerCase();\n return /safari/.test(userAgent) && !/chrome|crios|edg|edge|fxios|opr|opera/.test(userAgent);\n}\n\nconst Browser = {\n chrome: 'chrome',\n edge: 'edge',\n firefox: 'firefox',\n ie: 'ie',\n safari: 'safari',\n unknown: 'unknown'\n}\n\nexport function getBrowser() {\n if (isChrome()) return Browser.chrome;\n else if (isEdge()) return Browser.edge;\n else if (isFirefox()) return Browser.firefox;\n else if (isSafari()) return Browser.safari;\n else if (isIE()) return Browser.ie;\n else return Browser.unknown;\n}\n\nexport default getBrowser;\n","export function isMobile() {\n const userAgent = navigator.userAgent.toLowerCase()\n const _isMobile = /Android|iPhone|iPad/i.test(userAgent) || (/Harmony/i.test(userAgent) && /Mobile/i.test(userAgent))\n\n // 检测触摸屏设备(增强平板识别)\n const isTouchScreen = 'ontouchstart' in window || navigator.maxTouchPoints > 0\n\n // 特殊处理iPad:iPadOS 13+的UA包含Macintosh但支持触摸\n const isiPad = /Macintosh/i.test(userAgent) && isTouchScreen\n\n return _isMobile || isiPad\n}\n\nexport function isPC() {\n return !isMobile();\n}"],"names":["App","isYzj","agent","navigator","userAgent","test","isYzjDesktop","isYzjOldDesktop","isWX","indexOf","isWxWork","isDD","_isDD","isDDMiniProgram","isWeLink","isFeiShu","getApp","isChrome","toLowerCase","isChromiumEdge","isLegacyEdge","isEdge","isFirefox","isIE","isSafari","Browser","getBrowser","isMobile","_isMobile","isTouchScreen","window","maxTouchPoints","isiPad","isPC"],"mappings":"aAAA,MAAMA,EACC,YADDA,EAEQ,oBAFRA,EAGW,wBAHXA,EAIA,SAJAA,EAKA,WALAA,EAMI,SANJA,EAOI,SAPJA,EAQI,SARJA,EASK,UAGJ,SAASC,IACd,MAAMC,EAAQC,UAAUC,UACxB,MAAO,+CAA+CC,KAAKH,EAC7D,CAEO,SAASI,IACd,MAAMJ,EAAQC,UAAUC,UACxB,MAAO,gBAAgBC,KAAKH,EAC9B,CAEO,SAASK,IACd,MAAML,EAAQC,UAAUC,UACxB,MAAO,iBAAiBC,KAAKH,EAC/B,CAEO,SAASM,IACd,MAAMN,EAAQC,UAAUC,UACxB,OAAOF,EAAMO,QAAQ,mBAAoB,GAAMP,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,SADJA,EAEE,OAFFA,EAGK,UAHLA,EAIA,KAJAA,EAKI,SALJA,EAMK,UAGJ,SAASC,IACd,OAAIT,IAAmBQ,EACdJ,IAAiBI,EACjBH,IAAoBG,EACpBD,IAAmBC,EACnBF,IAAeE,EACZA,CACd,CClDO,SAASE,IACd,MAAMvB,EAAYD,UAAUC,UAAUc,cAChCU,EAAY,uBAAuBvB,KAAKD,IAAe,WAAWC,KAAKD,IAAc,UAAUC,KAAKD,GAGpGyB,EAAgB,iBAAkBC,QAAU3B,UAAU4B,eAAiB,EAGvEC,EAAS,aAAa3B,KAAKD,IAAcyB,EAE/C,OAAOD,GAAaI,CACtB,CAEO,SAASC,IACd,OAAQN,GACV"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e="yunzhijia",n="yunzhijia_desktop",t="yunzhijia_old_desktop",r="weixin",
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
const e="yunzhijia",n="yunzhijia_desktop",t="yunzhijia_old_desktop",r="weixin",i="dingding",o="wxwork",s="welink",a="feishu",u="unknown";function g(){const e=navigator.userAgent;return/Qing\/.*;(iOS|iPhone|Android|iPadOS|Harmony)/.test(e)}function c(){const e=navigator.userAgent;return/App\/cloudhub/.test(e)}function f(){const e=navigator.userAgent;return/clientId:10204/.test(e)}function d(){const e=navigator.userAgent;return e.indexOf("MicroMessenger")>-1&&e.indexOf("wxwork")<0}function w(){const e=navigator.userAgent;return e.indexOf("MicroMessenger")>-1&&e.indexOf("wxwork")>-1}function x(){const e=navigator.userAgent,n=e.indexOf("DingTalk")>-1,t=-1===e.indexOf("MiniProgram")&&-1===e.indexOf("dd-web");return n&&t}function A(){const e=navigator.userAgent;return e.indexOf("welink")>-1||e.indexOf("cloudlink")>-1}function h(){return navigator.userAgent.indexOf("Lark/")>-1}function k(){return g()?e:c()?n:f()?t:d()?r:w()?o:x()?i:A?s:h()?a:u}function v(){const e=navigator.userAgent.toLowerCase();return/chrome|crios/.test(e)&&!/edg|edge|opr|opera|fxios|samsungbrowser/.test(e)}function m(){const e=navigator.userAgent.toLowerCase();return/edg/.test(e)}function p(){const e=navigator.userAgent.toLowerCase();return/edge/.test(e)&&!/edg/.test(e)}function l(){return m()||p()}function O(){const e=navigator.userAgent.toLowerCase();return/firefox|fxios/.test(e)}function C(){const e=navigator.userAgent.toLowerCase();return/msie|trident/.test(e)}function L(){const e=navigator.userAgent.toLowerCase();return/safari/.test(e)&&!/chrome|crios|edg|edge|fxios|opr|opera/.test(e)}const j="chrome",M="edge",b="firefox",z="ie",P="safari",_="unknown";function y(){return v()?j:l()?M:O()?b:L()?P:C()?z:_}function D(){const e=navigator.userAgent.toLowerCase(),n=/Android|iPhone|iPad/i.test(e)||/Harmony/i.test(e)&&/Mobile/i.test(e),t="ontouchstart"in window||navigator.maxTouchPoints>0,r=/Macintosh/i.test(e)&&t;return n||r}function E(){return!D()}var S=Object.freeze({__proto__:null,getAppName:k,getBrowserName:y,isChrome:v,isChromiumEdge:m,isDD:x,isEdge:l,isFeiShu:h,isFirefox:O,isIE:C,isLegacyEdge:p,isMobile:D,isPC:E,isSafari:L,isWX:d,isWeLink:A,isWxWork:w,isYzj:g,isYzjDesktop:c,isYzjOldDesktop:f});export{x as a,h as b,A as c,w as d,d as e,g as f,k as g,c as h,S as i,f as j,y as k,v as l,m,l as n,p as o,O as p,C as q,L as r,D as s,E as t};
|
|
2
|
+
//# sourceMappingURL=index-Cqlu4UVy.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-Cqlu4UVy.esm.js","sources":["../../src/modules/client/app.js","../../src/modules/client/browser.js","../../src/modules/client/device.js"],"sourcesContent":["const App = {\n yzj: 'yunzhijia',\n yzjDesktop: 'yunzhijia_desktop',\n yzjOldDesktop: 'yunzhijia_old_desktop',\n wx: 'weixin',\n dd: 'dingding',\n wxwork: 'wxwork',\n welink: 'welink',\n feishu: 'feishu',\n unknown: 'unknown'\n}\n\nexport function isYzj() {\n const agent = navigator.userAgent;\n return /Qing\\/.*;(iOS|iPhone|Android|iPadOS|Harmony)/.test(agent);\n}\n\nexport function isYzjDesktop() {\n const agent = navigator.userAgent;\n return /App\\/cloudhub/.test(agent);\n}\n\nexport function isYzjOldDesktop() {\n const agent = navigator.userAgent;\n return /clientId:10204/.test(agent);\n}\n\nexport function isWX() {\n const agent = navigator.userAgent;\n return agent.indexOf('MicroMessenger') > -1 && agent.indexOf('wxwork') < 0;\n}\n\nexport function isWxWork() {\n const agent = navigator.userAgent;\n return agent.indexOf('MicroMessenger') > -1 && agent.indexOf('wxwork') > -1;\n}\n\nexport function isDD() {\n const agent = navigator.userAgent;\n const _isDD = agent.indexOf('DingTalk') > -1;\n const isDDMiniProgram = agent.indexOf('MiniProgram') === -1 && agent.indexOf('dd-web') === -1;\n return _isDD && isDDMiniProgram;\n}\n\nexport function isWeLink() {\n const agent = navigator.userAgent;\n return agent.indexOf('welink') > -1 || agent.indexOf('cloudlink') > -1;\n}\n\nexport function isFeiShu() {\n const agent = navigator.userAgent;\n return agent.indexOf('Lark/') > -1;\n}\n\nexport function getApp() {\n if (isYzj()) return App.yzj;\n else if (isYzjDesktop()) return App.yzjDesktop;\n else if (isYzjOldDesktop()) return App.yzjOldDesktop;\n else if (isWX()) return App.wx;\n else if (isWxWork()) return App.wxwork;\n else if (isDD()) return App.dd;\n else if (isWeLink) return App.welink;\n else if (isFeiShu()) return App.feishu;\n else return App.unknown;\n}\n\nexport default getApp;\n","export function isChrome() {\n const userAgent = navigator.userAgent.toLowerCase();\n return /chrome|crios/.test(userAgent) && !/edg|edge|opr|opera|fxios|samsungbrowser/.test(userAgent);\n}\n\nexport function isChromiumEdge() {\n const userAgent = navigator.userAgent.toLowerCase();\n return /edg/.test(userAgent);\n}\n\nexport function isLegacyEdge() {\n const userAgent = navigator.userAgent.toLowerCase();\n return /edge/.test(userAgent) && !/edg/.test(userAgent);\n}\n\nexport function isEdge() {\n return isChromiumEdge() || isLegacyEdge();\n}\n\nexport function isFirefox() {\n const userAgent = navigator.userAgent.toLowerCase();\n return /firefox|fxios/.test(userAgent);\n}\n\nexport function isIE() {\n const userAgent = navigator.userAgent.toLowerCase();\n return /msie|trident/.test(userAgent);\n}\n\nexport function isSafari() {\n const userAgent = navigator.userAgent.toLowerCase();\n return /safari/.test(userAgent) && !/chrome|crios|edg|edge|fxios|opr|opera/.test(userAgent);\n}\n\nconst Browser = {\n chrome: 'chrome',\n edge: 'edge',\n firefox: 'firefox',\n ie: 'ie',\n safari: 'safari',\n unknown: 'unknown'\n}\n\nexport function getBrowser() {\n if (isChrome()) return Browser.chrome;\n else if (isEdge()) return Browser.edge;\n else if (isFirefox()) return Browser.firefox;\n else if (isSafari()) return Browser.safari;\n else if (isIE()) return Browser.ie;\n else return Browser.unknown;\n}\n\nexport default getBrowser;\n","export function isMobile() {\n const userAgent = navigator.userAgent.toLowerCase()\n const _isMobile = /Android|iPhone|iPad/i.test(userAgent) || (/Harmony/i.test(userAgent) && /Mobile/i.test(userAgent))\n\n // 检测触摸屏设备(增强平板识别)\n const isTouchScreen = 'ontouchstart' in window || navigator.maxTouchPoints > 0\n\n // 特殊处理iPad:iPadOS 13+的UA包含Macintosh但支持触摸\n const isiPad = /Macintosh/i.test(userAgent) && isTouchScreen\n\n return _isMobile || isiPad\n}\n\nexport function isPC() {\n return !isMobile();\n}"],"names":["App","isYzj","agent","navigator","userAgent","test","isYzjDesktop","isYzjOldDesktop","isWX","indexOf","isWxWork","isDD","_isDD","isDDMiniProgram","isWeLink","isFeiShu","getApp","isChrome","toLowerCase","isChromiumEdge","isLegacyEdge","isEdge","isFirefox","isIE","isSafari","Browser","getBrowser","isMobile","_isMobile","isTouchScreen","window","maxTouchPoints","isiPad","isPC"],"mappings":"AAAA,MAAMA,EACC,YADDA,EAEQ,oBAFRA,EAGW,wBAHXA,EAIA,SAJAA,EAKA,WALAA,EAMI,SANJA,EAOI,SAPJA,EAQI,SARJA,EASK,UAGJ,SAASC,IACd,M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B,CAEO,SAASE,IACd,MAAMlB,EAAYD,UAAUC,UAAUc,cACtC,MAAO,gBAAgBb,KAAKD,EAC9B,CAEO,SAASmB,IACd,MAAMnB,EAAYD,UAAUC,UAAUc,cACtC,MAAO,eAAeb,KAAKD,EAC7B,CAEO,SAASoB,IACd,MAAMpB,EAAYD,UAAUC,UAAUc,cACtC,MAAO,SAASb,KAAKD,KAAe,wCAAwCC,KAAKD,EACnF,CAEA,MAAMqB,EACI,SADJA,EAEE,OAFFA,EAGK,UAHLA,EAIA,KAJAA,EAKI,SALJA,EAMK,UAGJ,SAASC,IACd,OAAIT,IAAmBQ,EACdJ,IAAiBI,EACjBH,IAAoBG,EACpBD,IAAmBC,EACnBF,IAAeE,EACZA,CACd,CClDO,SAASE,IACd,MAAMvB,EAAYD,UAAUC,UAAUc,cAChCU,EAAY,uBAAuBvB,KAAKD,IAAe,WAAWC,KAAKD,IAAc,UAAUC,KAAKD,GAGpGyB,EAAgB,iBAAkBC,QAAU3B,UAAU4B,eAAiB,EAGvEC,EAAS,aAAa3B,KAAKD,IAAcyB,EAE/C,OAAOD,GAAaI,CACtB,CAEO,SAASC,IACd,OAAQN,GACV"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kdcloudjs/kwc-shared-utils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "share-utils for kwc",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@rollup/plugin-commonjs": "^28.0.6",
|
|
27
27
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
28
|
-
"rollup": "^4.50.0"
|
|
29
|
-
"rollup-plugin-terser": "^7.0.2"
|
|
28
|
+
"rollup": "^4.50.0"
|
|
30
29
|
},
|
|
31
30
|
"devDependencies": {
|
|
31
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
32
32
|
"rollup-plugin-clear": "^2.0.7"
|
|
33
33
|
}
|
|
34
|
-
}
|
|
34
|
+
}
|