hina-cloud-js-sdk 3.1.7 → 3.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. package/.gitlab-ci.yml +2 -6
  2. package/build/hina.cjs.min.js +1 -0
  3. package/build/hina.esm.min.js +1 -1
  4. package/build/hina.min.js +1 -4
  5. package/build/hotAnalyse.min.js +1 -1
  6. package/package.json +2 -7
  7. package/packages/core/dist/index.cjs.js +64 -0
  8. package/packages/core/dist/index.cjs.js.map +1 -0
  9. package/packages/core/dist/index.d.ts +45 -0
  10. package/packages/core/dist/index.esm.js +62 -0
  11. package/packages/core/dist/index.esm.js.map +1 -0
  12. package/packages/core/dist/index.global.js +1199 -0
  13. package/packages/core/dist/index.global.js.map +1 -0
  14. package/packages/core/dist/index.js +1200 -0
  15. package/packages/core/dist/index.js.map +1 -0
  16. package/packages/monitor/dist/index.cjs.js +150 -0
  17. package/packages/monitor/dist/index.cjs.js.map +1 -0
  18. package/packages/monitor/dist/index.d.ts +35 -0
  19. package/packages/monitor/dist/index.esm.js +145 -0
  20. package/packages/monitor/dist/index.esm.js.map +1 -0
  21. package/packages/monitor/dist/index.global.js +1343 -0
  22. package/packages/monitor/dist/index.global.js.map +1 -0
  23. package/packages/monitor/dist/index.js +1344 -0
  24. package/packages/monitor/dist/index.js.map +1 -0
  25. package/packages/track/dist/index.cjs.js +1930 -0
  26. package/packages/track/dist/index.cjs.js.map +1 -0
  27. package/packages/track/dist/index.d.ts +212 -0
  28. package/packages/track/dist/index.esm.js +1925 -0
  29. package/packages/track/dist/index.esm.js.map +1 -0
  30. package/packages/track/dist/index.global.js +4259 -0
  31. package/packages/track/dist/index.global.js.map +1 -0
  32. package/packages/track/dist/index.js +4260 -0
  33. package/packages/track/dist/index.js.map +1 -0
  34. package/packages/types/dist/index.d.ts +603 -0
  35. package/packages/types/dist/index.esm.js +25 -0
  36. package/packages/types/dist/index.esm.js.map +1 -0
  37. package/packages/utils/dist/index.cjs.js +1535 -0
  38. package/packages/utils/dist/index.cjs.js.map +1 -0
  39. package/packages/utils/dist/index.d.ts +394 -0
  40. package/packages/utils/dist/index.esm.js +1465 -0
  41. package/packages/utils/dist/index.esm.js.map +1 -0
  42. package/packages/utils/dist/index.global.js +2507 -0
  43. package/packages/utils/dist/index.global.js.map +1 -0
  44. package/packages/utils/dist/index.js +2508 -0
  45. package/packages/utils/dist/index.js.map +1 -0
@@ -1 +1 @@
1
- var e,t;e=this,t=function(){var e=document.createElement("script");function t(){var e=!1,t=315,n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0;!function(e){var t=document.createElement("style");t.type="text/css";try{t.appendChild(document.createTextNode(e))}catch(n){t.styleSheet.cssText=e}var n=document.getElementsByTagName("head")[0],o=document.getElementsByTagName("script")[0];n?n.children.length?n.insertBefore(t,n.children[0]):n.appendChild(t):o.parentNode.insertBefore(t,o)}('\n .hina-click-area:before{\n pointer-events: none;\n cursor: pointer;\n content: "";\n width: 100%;\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n background: rgba(56, 166, 251, 0.6);\n box-shadow: rgba(0, 0, 0, 0.6) 0px 2px 4px;\n cursor: pointer\n }\n .hina-click-area:after{\n pointer-events: none;\n height: 14px;\n line-height: 14px;\n margin: -7px 0 0 -28px;\n width: 56px;\n color: #fff;\n content: attr(data-click);\n font-size: 14px;\n font-weight: 700;\n left: 50%;\n line-height: 1em;\n position: absolute;\n text-align: center;\n text-indent: 0;\n text-shadow: 1px 1px 2px #000;\n top: 50%;\n z-index: 999;\n}\n');var o,i,l,d=function(o){var i,l,d,a,s=null===(i=o.data)||void 0===i?void 0:i.type;if("view"===s){var r,c,p,u,v=null===(r=o.data)||void 0===r?void 0:r.lastGraph;$("body > .shadeBoxWrap").remove();for(var h=0;h<(null==v?void 0:v.length);h++){var x=v[h].H_element_selector;$(x).removeClass("hina-click-area")}e=!1,window.removeEventListener("scroll",(function(){}),!0);for(var f=null===(c=o.data)||void 0===c||null===(p=c.viewData)||void 0===p?void 0:p[0],w=null===(u=[null==f?void 0:f.view100,null==f?void 0:f.view90,null==f?void 0:f.view80,null==f?void 0:f.view70,null==f?void 0:f.view60,null==f?void 0:f.view50,null==f?void 0:f.view40,null==f?void 0:f.view30,null==f?void 0:f.view20,null==f?void 0:f.view10])||void 0===u?void 0:u.map((function(e){return e+n})),b=new Array(10).fill(1).map((function(e,t){return 10*(t+1)})).reverse(),m=function(e){return"\n <span \n style='\n font-size:12px;\n position:absolute;\n padding: 0 12px;\n top: -24px;\n height: 26px;\n line-height: 26px;\n left: 0;\n background: #E6F1FB;\n color: #0174df;\n border-radius: 2px;\n '>\n ".concat(e,"%\n </span>\n ")},y=0;y<b.length;y++){var g=document.createElement("div");g.setAttribute("style","\n border-bottom: 1px dashed #0174df;\n height: 1px;\n width: 100%;\n position: absolute;\n top: 50px;\n z-index:999;\n "),g.setAttribute("class","viewBaseLineStyle");var _=f["view".concat(b[y])];g.style.top="".concat(_+n,"px"),0!==y?f["view".concat(b[y])]-f["view".concat(b[y-1])]>26&&(g.innerHTML=m(b[y])):f["view".concat(b[y])]>26&&(g.innerHTML=m(b[y])),document.body.appendChild(g)}var k=document.createElement("div");k.setAttribute("style","\n border-bottom: 1px solid #0174df;\n height: 1px;\n width: 100%;\n position: absolute;\n z-index: 9999;\n top: 0;\n "),k.setAttribute("class","viewMoveLineStyle"),document.body.appendChild(k),$(document).on("mousemove",(l=function(e){k.style.top="".concat(e.pageY,"px");var t=function(e,t){for(var n=0;n<e.length;n++)if(e[n]>t)return n}(w,e.pageY),n=b[t];k.innerHTML="\n <span \n style='\n font-size:12px;\n height:26px;\n line-height: 26px;\n background: #E6F1FB;\n color: #0174df;\n border-radius: 2px;\n left:50%;\n margin-left:-65px;\n position: absolute;\n top:-13px;\n padding: 0 5px;\n '>\n ".concat(n||0,"%的用户浏览到这里\n </span>\n ")},d=150,a=Date.now(),function(){var e=arguments;Date.now()-a>=d&&(l.apply(this,e),a=Date.now())}))}else if("click"===s){var E,H,B;e=!0,$("body > .viewBaseLineStyle").remove(),$("body > .viewMoveLineStyle").remove();var C=null===(E=o.data)||void 0===E?void 0:E.hotData,A=null===(H=o.data)||void 0===H?void 0:H.isResize,L=null===(B=o.data)||void 0===B?void 0:B.lastGraph;if(A&&$("body > .shadeBoxWrap").remove(),null==C||!C.length){for(var W=0;W<(null==L?void 0:L.length);W++){var T=L[W].H_element_selector;$(T).removeClass("hina-click-area")}return}for(var S=function(){var e,n,o,i,l,d,a,s,r=C[z];r.H_element_content;var c=r.H_element_selector;r.button_click_prop;var p=r.button_click_rate;r.button_click_times,r.button_click_users,r.his_H_element_content;var u=document.createElement("div");u.setAttribute("style","position: relative;\n "),u.setAttribute("class","hina-click-area");var v=function(e){var n=e.H_element_content;e.H_element_selector;var o=e.button_click_prop,i=e.button_click_rate,l=e.button_click_times,d=e.button_click_users,a=e.his_H_element_content,s="\n <div style='padding: 8px;'>\n <div style='color: #CACACA'>当前内容:</div>\n <div style='white-space:nowrap;overflow:hidden;text-overflow:ellipsis;'>".concat(n||"-","</div>\n </div>\n <div style='background: #444; height:1px;'></div>\n <div style='padding: 8px;'>\n <table style='width:100%;color:#fff;font-size:13px;background:#333;border:1px solid #333;'>\n <tr>\n <td>点击次数:</td>\n <td style='text-align:right;'>").concat(l,"</td>\n </tr>\n <tr>\n <td>点击人数:</td>\n <td style='text-align:right;'>").concat(d,"</td>\n </tr>\n <tr>\n <td>点击率:</td>\n <td style='text-align:right;'>").concat(i,"</td>\n </tr>\n <tr>\n <td>点击占比:</td>\n <td style='text-align:right;'>").concat(o,"</td>\n </tr>\n </table>\n </div>\n <div style='background: #444; height:1px;'></div>\n <div style='padding: 8px;'>\n <div style='color: #CACACA;'>历史内容:</div>\n <div style='white-space:nowrap;overflow:hidden;text-overflow:ellipsis;'>").concat(a||"-","</div>\n </div>\n <div style='background: #444; height:1px;'></div>\n <div style='padding: 6px 8px;' class='user-list' hina-tag-disable='true'>\n <p style='color:#2a90e2;text-decoration: none;'>查看用户列表</p>\n </div>\n "),r=document.createElement("div");return document.body.appendChild(r),r.setAttribute("class","shadeBoxWrap"),r.setAttribute("style","\n border-radius:3px;\n display: none;\n border:1px solid #000;\n cursor: pointer;\n position: absolute;\n left:0;\n top:0;\n background: #333;\n line-height:24px;\n font-size:13px;\n width:".concat(220,"px;\n height:").concat(t,"px;\n color: #fff;\n box-shadow: 0 2px 4px rgba(0,0,0,0.24);\n z-index:9999;\n ")),r.innerHTML=s,r}(C[z]),h=null===(e=$(c))||void 0===e||null===(n=e.offset())||void 0===n?void 0:n.left,x=window.scrollY,f=$(window).width(),w=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,b=null===(o=$(c))||void 0===o||null===(i=o.position())||void 0===i?void 0:i.top,m=null===(l=$(c))||void 0===l||null===(d=l.offset())||void 0===d?void 0:d.top,y=null===(a=$(c))||void 0===a?void 0:a.css("width"),g=null===(s=$(c))||void 0===s?void 0:s.css("height");$(c).addClass("hina-click-area"),$(c).css("position","relative"),$("".concat(c,":before")).css("position","absolute"),$(c).attr("data-click",p),[y,g,"undefined"].includes("0px")&&($(c).removeClass("display","inline-block"),$(c).css("width","15px"),$(c).css("height","15px")),$(c).mouseenter((function(){if($("body > .shadeBoxWrap > .user-list > p").attr("drillSelector",c),m<50?$("body > .shadeBoxWrap").css("position","fixed"):$("body > .shadeBoxWrap").css("position","absolute"),v.style.display="block",f-h<220)return v.style.left="".concat(h-220,"px"),void(v.style.top="".concat(m>t?m+parseFloat(g)-t:m,"px"));v.style.left="".concat(h,"px"),w-m>t?window.scrollY>t?v.style.top="".concat(b+parseFloat(g),"px"):v.style.top="".concat(m+parseFloat(g)-x,"px"):v.style.top="".concat(m-t,"px");var e=parseInt(v.style.top);e-=window.__POWERED_BY_WUJIE__?40:0,v.style.top=e+"px"})),$(c).mouseleave((function(){})),v.addEventListener("mouseenter",(function(){v.style.display="block"})),v.addEventListener("mouseleave",(function(){$("body > .shadeBoxWrap").css("display","none")}))},z=0;z<(null==C?void 0:C.length);z++)S();$("body > .shadeBoxWrap > .user-list > p").on("click",(function(e){var t,n,i,l,d,a;o.stopPropagation(),window.__POWERED_BY_WUJIE__?window.$wujie.bus.$emit("hotClick",{eleSelector:null==e||null===(t=e.target)||void 0===t||null===(n=t.attributes)||void 0===n||null===(i=n.drillselector)||void 0===i?void 0:i.value,isHotSdkPost:!0}):window.parent.postMessage({eleSelector:null==e||null===(l=e.target)||void 0===l||null===(d=l.attributes)||void 0===d||null===(a=d.drillselector)||void 0===a?void 0:a.value,isHotSdkPost:!0},"*")}))}};return window.__POWERED_BY_WUJIE__?window.$wujie.bus.$on("hotView",(function(e){d(e)})):window.addEventListener("message",(function(e){d(e)}),!1),window.addEventListener("scroll",(o=function(){e&&window.parent.postMessage({isRefush:!0,isHotSdkPost:!0},"*")},i=800,l=null,function(){null!==l&&clearTimeout(l),l=setTimeout(o,i)}),!0),{getHotClickData:d}}return e.async="async",e.src="https://s3-model.hinadt.com/files/jquery.min.js",e.type="text/javascript",e.addEventListener("load",t),document.head.appendChild(e),t},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self)["hina-epm"]=t();
1
+ var e,n;e=this,n=function(){function e(){var e=!1,n=315,t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0;!function(e){var n=document.createElement("style");n.type="text/css";try{n.appendChild(document.createTextNode(e))}catch(t){n.styleSheet.cssText=e}var t=document.getElementsByTagName("head")[0],o=document.getElementsByTagName("script")[0];t?t.children.length?t.insertBefore(n,t.children[0]):t.appendChild(n):o.parentNode.insertBefore(n,o)}('\n .hina-click-area:before{\n pointer-events: none;\n cursor: pointer;\n content: "";\n width: 100%;\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n background: rgba(56, 166, 251, 0.6);\n box-shadow: rgba(0, 0, 0, 0.6) 0px 2px 4px;\n cursor: pointer\n }\n .hina-click-area:after{\n pointer-events: none;\n height: 14px;\n line-height: 14px;\n margin: -7px 0 0 -28px;\n width: 56px;\n color: #fff;\n content: attr(data-click);\n font-size: 14px;\n font-weight: 700;\n left: 50%;\n line-height: 1em;\n position: absolute;\n text-align: center;\n text-indent: 0;\n text-shadow: 1px 1px 2px #000;\n top: 50%;\n z-index: 999;\n}\n');var o,i,l,d=function(o){var i,l,d,a,s=null===(i=o.data)||void 0===i?void 0:i.type;if("view"===s){var r,c,p,u,v=null===(r=o.data)||void 0===r?void 0:r.lastGraph;$("body > .shadeBoxWrap").remove();for(var h=0;h<(null==v?void 0:v.length);h++){var x=v[h].H_element_selector;$(x).removeClass("hina-click-area")}e=!1,window.removeEventListener("scroll",(function(){}),!0);for(var f=null===(c=o.data)||void 0===c||null===(p=c.viewData)||void 0===p?void 0:p[0],w=null===(u=[null==f?void 0:f.view100,null==f?void 0:f.view90,null==f?void 0:f.view80,null==f?void 0:f.view70,null==f?void 0:f.view60,null==f?void 0:f.view50,null==f?void 0:f.view40,null==f?void 0:f.view30,null==f?void 0:f.view20,null==f?void 0:f.view10])||void 0===u?void 0:u.map((function(e){return e+t})),b=new Array(10).fill(1).map((function(e,n){return 10*(n+1)})).reverse(),g=function(e){return"\n <span \n style='\n font-size:12px;\n position:absolute;\n padding: 0 12px;\n top: -24px;\n height: 26px;\n line-height: 26px;\n left: 0;\n background: #E6F1FB;\n color: #0174df;\n border-radius: 2px;\n '>\n ".concat(e,"%\n </span>\n ")},y=0;y<b.length;y++){var m=document.createElement("div");m.setAttribute("style","\n border-bottom: 1px dashed #0174df;\n height: 1px;\n width: 100%;\n position: absolute;\n top: 50px;\n z-index:999;\n "),m.setAttribute("class","viewBaseLineStyle");var _=f["view".concat(b[y])];m.style.top="".concat(_+t,"px"),0!==y?f["view".concat(b[y])]-f["view".concat(b[y-1])]>26&&(m.innerHTML=g(b[y])):f["view".concat(b[y])]>26&&(m.innerHTML=g(b[y])),document.body.appendChild(m)}var k=document.createElement("div");k.setAttribute("style","\n border-bottom: 1px solid #0174df;\n height: 1px;\n width: 100%;\n position: absolute;\n z-index: 9999;\n top: 0;\n "),k.setAttribute("class","viewMoveLineStyle"),document.body.appendChild(k),$(document).on("mousemove",(l=function(e){k.style.top="".concat(e.pageY,"px");var n=function(e,n){for(var t=0;t<e.length;t++)if(e[t]>n)return t}(w,e.pageY),t=b[n];k.innerHTML="\n <span \n style='\n font-size:12px;\n height:26px;\n line-height: 26px;\n background: #E6F1FB;\n color: #0174df;\n border-radius: 2px;\n left:50%;\n margin-left:-65px;\n position: absolute;\n top:-13px;\n padding: 0 5px;\n '>\n ".concat(t||0,"%的用户浏览到这里\n </span>\n ")},d=150,a=Date.now(),function(){var e=arguments;Date.now()-a>=d&&(l.apply(this,e),a=Date.now())}))}else if("click"===s){var E,B,H;e=!0,$("body > .viewBaseLineStyle").remove(),$("body > .viewMoveLineStyle").remove();var C=null===(E=o.data)||void 0===E?void 0:E.hotData,A=null===(B=o.data)||void 0===B?void 0:B.isResize,W=null===(H=o.data)||void 0===H?void 0:H.lastGraph;if(A&&$("body > .shadeBoxWrap").remove(),null==C||!C.length){for(var L=0;L<(null==W?void 0:W.length);L++){var T=W[L].H_element_selector;$(T).removeClass("hina-click-area")}return}for(var S=function(){var e,t,o,i,l,d,a,s,r=C[z],c=r.H_element_selector,p=r.button_click_rate,u=document.createElement("div");u.setAttribute("style","position: relative;\n "),u.setAttribute("class","hina-click-area");var v=function(e){var t=e.H_element_content,o=e.button_click_prop,i=e.button_click_rate,l=e.button_click_times,d=e.button_click_users,a=e.his_H_element_content,s="\n <div style='padding: 8px;'>\n <div style='color: #CACACA'>当前内容:</div>\n <div style='white-space:nowrap;overflow:hidden;text-overflow:ellipsis;'>".concat(t||"-","</div>\n </div>\n <div style='background: #444; height:1px;'></div>\n <div style='padding: 8px;'>\n <table style='width:100%;color:#fff;font-size:13px;background:#333;border:1px solid #333;'>\n <tr>\n <td>点击次数:</td>\n <td style='text-align:right;'>").concat(l,"</td>\n </tr>\n <tr>\n <td>点击人数:</td>\n <td style='text-align:right;'>").concat(d,"</td>\n </tr>\n <tr>\n <td>点击率:</td>\n <td style='text-align:right;'>").concat(i,"</td>\n </tr>\n <tr>\n <td>点击占比:</td>\n <td style='text-align:right;'>").concat(o,"</td>\n </tr>\n </table>\n </div>\n <div style='background: #444; height:1px;'></div>\n <div style='padding: 8px;'>\n <div style='color: #CACACA;'>历史内容:</div>\n <div style='white-space:nowrap;overflow:hidden;text-overflow:ellipsis;'>").concat(a||"-","</div>\n </div>\n <div style='background: #444; height:1px;'></div>\n <div style='padding: 6px 8px;' class='user-list' hina-tag-disable='true'>\n <p style='color:#2a90e2;text-decoration: none;'>查看用户列表</p>\n </div>\n "),r=document.createElement("div");return document.body.appendChild(r),r.setAttribute("class","shadeBoxWrap"),r.setAttribute("style","\n border-radius:3px;\n display: none;\n border:1px solid #000;\n cursor: pointer;\n position: absolute;\n left:0;\n top:0;\n background: #333;\n line-height:24px;\n font-size:13px;\n width:".concat(220,"px;\n height:").concat(n,"px;\n color: #fff;\n box-shadow: 0 2px 4px rgba(0,0,0,0.24);\n z-index:9999;\n ")),r.innerHTML=s,r}(C[z]),h=null===(e=$(c))||void 0===e||null===(t=e.offset())||void 0===t?void 0:t.left,x=window.scrollY,f=$(window).width(),w=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,b=null===(o=$(c))||void 0===o||null===(i=o.position())||void 0===i?void 0:i.top,g=null===(l=$(c))||void 0===l||null===(d=l.offset())||void 0===d?void 0:d.top,y=null===(a=$(c))||void 0===a?void 0:a.css("width"),m=null===(s=$(c))||void 0===s?void 0:s.css("height");$(c).addClass("hina-click-area"),$(c).css("position","relative"),$("".concat(c,":before")).css("position","absolute"),$(c).attr("data-click",p),[y,m,"undefined"].includes("0px")&&($(c).removeClass("display","inline-block"),$(c).css("width","15px"),$(c).css("height","15px")),$(c).mouseenter((function(){if($("body > .shadeBoxWrap > .user-list > p").attr("drillSelector",c),g<50?$("body > .shadeBoxWrap").css("position","fixed"):$("body > .shadeBoxWrap").css("position","absolute"),v.style.display="block",f-h<220)return v.style.left="".concat(h-220,"px"),void(v.style.top="".concat(g>n?g+parseFloat(m)-n:g,"px"));v.style.left="".concat(h,"px"),w-g>n?window.scrollY>n?v.style.top="".concat(b+parseFloat(m),"px"):v.style.top="".concat(g+parseFloat(m)-x,"px"):v.style.top="".concat(g-n,"px");var e=parseInt(v.style.top);e-=window.__POWERED_BY_WUJIE__?40:0,v.style.top=e+"px"})),$(c).mouseleave((function(){})),v.addEventListener("mouseenter",(function(){v.style.display="block"})),v.addEventListener("mouseleave",(function(){$("body > .shadeBoxWrap").css("display","none")}))},z=0;z<(null==C?void 0:C.length);z++)S();$("body > .shadeBoxWrap > .user-list > p").on("click",(function(e){var n,t,i,l,d,a;o.stopPropagation(),window.__POWERED_BY_WUJIE__?window.$wujie.bus.$emit("hotClick",{eleSelector:null==e||null===(n=e.target)||void 0===n||null===(t=n.attributes)||void 0===t||null===(i=t.drillselector)||void 0===i?void 0:i.value,isHotSdkPost:!0}):window.parent.postMessage({eleSelector:null==e||null===(l=e.target)||void 0===l||null===(d=l.attributes)||void 0===d||null===(a=d.drillselector)||void 0===a?void 0:a.value,isHotSdkPost:!0},"*")}))}};return window.__POWERED_BY_WUJIE__?window.$wujie.bus.$on("hotView",(function(e){d(e)})):window.addEventListener("message",(function(e){d(e)}),!1),window.addEventListener("scroll",(o=function(){e&&window.parent.postMessage({isRefush:!0,isHotSdkPost:!0},"*")},i=800,l=null,function(){null!==l&&clearTimeout(l),l=setTimeout(o,i)}),!0),{getHotClickData:d}}return setTimeout((function(){e()}),10),e},"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).hina=n();
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "hina-cloud-js-sdk",
3
- "version": "3.1.7",
3
+ "version": "3.1.8",
4
4
  "description": "hinaCloud javascript sdk",
5
- "main": "build/hina.min.js",
5
+ "main": "build/hina.cjs.min.js",
6
6
  "jsnext:main": "build/hina.esm.min.js",
7
7
  "scripts": {
8
8
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -40,11 +40,6 @@
40
40
  "author": "",
41
41
  "license": "ISC",
42
42
  "dependencies": {
43
- "@sentry/browser": "^7.105.0",
44
- "axios": "^1.6.7",
45
- "crypto": "^1.0.1",
46
- "hina-cloud-js-sdk": "^3.1.4",
47
- "jquery": "^3.7.1",
48
43
  "mobile-detect": "^1.4.5",
49
44
  "raven-js": "^3.27.2"
50
45
  }
@@ -0,0 +1,64 @@
1
+ 'use strict';
2
+
3
+ var hinaCloudTypes = require('hina-cloud-types');
4
+ var hinaCloudUtils = require('hina-cloud-utils');
5
+
6
+ var BaseCore = /** @class */ (function () {
7
+ function BaseCore(options, useInstancing) {
8
+ if (useInstancing === void 0) { useInstancing = true; }
9
+ /**
10
+ * SDK是否已准备就绪
11
+ */
12
+ this.isReady = false;
13
+ /**
14
+ * 控制台前缀
15
+ */
16
+ this.consolePrefix = '';
17
+ /**
18
+ * 初始化SDK的方式,默认为true,即通过new的方式初始化SDK,如果使用函数调用初始化SDK,则设置为false
19
+ */
20
+ this.useInstancing = true;
21
+ this.options = options;
22
+ this.useInstancing = useInstancing;
23
+ }
24
+ /**
25
+ * 打印日志
26
+ * @param message 日志消息
27
+ * @param type 日志类型
28
+ */
29
+ BaseCore.prototype.log = function (message, type) {
30
+ if (type === void 0) { type = hinaCloudTypes.ConsoleTypes.LOG; }
31
+ var showLog = this.options.showLog;
32
+ if (!hinaCloudUtils.supportConsole() || !showLog)
33
+ return;
34
+ if (typeof message === 'string' && this.consolePrefix) {
35
+ message = "".concat(this.consolePrefix, "\uFF1A").concat(message);
36
+ }
37
+ hinaCloudUtils.log(message, type);
38
+ };
39
+ /**
40
+ * 执行插件
41
+ * @param plugins
42
+ */
43
+ BaseCore.prototype.runPlugins = function (plugins) {
44
+ var _this = this;
45
+ var _loop_1 = function (i) {
46
+ var plugin = plugins[i];
47
+ plugin.init(function (data) {
48
+ if (!plugin.transform)
49
+ return;
50
+ var result = plugin.transform(data);
51
+ if (!result)
52
+ return;
53
+ _this.report(result);
54
+ });
55
+ };
56
+ for (var i = 0; i < plugins.length; i++) {
57
+ _loop_1(i);
58
+ }
59
+ };
60
+ return BaseCore;
61
+ }());
62
+
63
+ exports.BaseCore = BaseCore;
64
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,45 @@
1
+ import { BaseOptions, ConsoleTypes, PluginBase, IAnyObject, AnyFn, ReportType } from 'hina-cloud-types';
2
+
3
+ declare abstract class BaseCore<O extends BaseOptions> {
4
+ /**
5
+ * 配置信息
6
+ */
7
+ options: O;
8
+ /**
9
+ * SDK是否已准备就绪
10
+ */
11
+ isReady: boolean;
12
+ /**
13
+ * 控制台前缀
14
+ */
15
+ consolePrefix: string;
16
+ /**
17
+ * 初始化SDK的方式,默认为true,即通过new的方式初始化SDK,如果使用函数调用初始化SDK,则设置为false
18
+ */
19
+ useInstancing: boolean;
20
+ protected constructor(options: O, useInstancing?: boolean);
21
+ /**
22
+ * 打印日志
23
+ * @param message 日志消息
24
+ * @param type 日志类型
25
+ */
26
+ log(message: any, type?: ConsoleTypes): void;
27
+ /**
28
+ * 执行插件
29
+ * @param plugins
30
+ */
31
+ runPlugins(plugins: PluginBase<BaseOptions>[]): void;
32
+ /**
33
+ * 抽象方法 注册/初始化SDK
34
+ */
35
+ abstract init(options: O): Promise<void> | void;
36
+ /**
37
+ * 抽象方法,端的请求方式不一致,需要自己实现
38
+ * @param data 上报的数据
39
+ * @param callback 回调函数
40
+ * @param type 发送方式
41
+ */
42
+ abstract report(data: IAnyObject, callback?: AnyFn, type?: ReportType): void;
43
+ }
44
+
45
+ export { BaseCore };
@@ -0,0 +1,62 @@
1
+ import { ConsoleTypes } from 'hina-cloud-types';
2
+ import { supportConsole, log } from 'hina-cloud-utils';
3
+
4
+ var BaseCore = /** @class */ (function () {
5
+ function BaseCore(options, useInstancing) {
6
+ if (useInstancing === void 0) { useInstancing = true; }
7
+ /**
8
+ * SDK是否已准备就绪
9
+ */
10
+ this.isReady = false;
11
+ /**
12
+ * 控制台前缀
13
+ */
14
+ this.consolePrefix = '';
15
+ /**
16
+ * 初始化SDK的方式,默认为true,即通过new的方式初始化SDK,如果使用函数调用初始化SDK,则设置为false
17
+ */
18
+ this.useInstancing = true;
19
+ this.options = options;
20
+ this.useInstancing = useInstancing;
21
+ }
22
+ /**
23
+ * 打印日志
24
+ * @param message 日志消息
25
+ * @param type 日志类型
26
+ */
27
+ BaseCore.prototype.log = function (message, type) {
28
+ if (type === void 0) { type = ConsoleTypes.LOG; }
29
+ var showLog = this.options.showLog;
30
+ if (!supportConsole() || !showLog)
31
+ return;
32
+ if (typeof message === 'string' && this.consolePrefix) {
33
+ message = "".concat(this.consolePrefix, "\uFF1A").concat(message);
34
+ }
35
+ log(message, type);
36
+ };
37
+ /**
38
+ * 执行插件
39
+ * @param plugins
40
+ */
41
+ BaseCore.prototype.runPlugins = function (plugins) {
42
+ var _this = this;
43
+ var _loop_1 = function (i) {
44
+ var plugin = plugins[i];
45
+ plugin.init(function (data) {
46
+ if (!plugin.transform)
47
+ return;
48
+ var result = plugin.transform(data);
49
+ if (!result)
50
+ return;
51
+ _this.report(result);
52
+ });
53
+ };
54
+ for (var i = 0; i < plugins.length; i++) {
55
+ _loop_1(i);
56
+ }
57
+ };
58
+ return BaseCore;
59
+ }());
60
+
61
+ export { BaseCore };
62
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}