zmp-sdk 2.25.0-rc.2 → 2.25.0-rc.3

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.
@@ -1 +1 @@
1
- import{mpDomain as i,mpPath as t}from"../constants.js";import o from"../utils/silent.js";import{PlatformType as n}from"../types/enum.js";function e(o){var n=window.location.hostname.includes(i)&&window.location.pathname.startsWith(t);return{isMp:window.location.hostname.includes(i)&&window.location.pathname.startsWith(t),isMpWeb:n&&/zalo/.test(o)}}var r=function(i){return i.isAndroid?n.android:i.isIOS?n.iOS:n.unknown};function a(i){var t=i.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function s(){var i=function(){var i=o((function(){return window.navigator.userAgent.toLowerCase()}))();if(i){var t=function(i){return{isAndroid:/android/i.test(i)&&!/iemobile/.test(i),isIOS:/iphone|ios|ipad|ipod/.test(i)&&!/iemobile/.test(i),isMobile:/android|iphone|ios|ipad|ipod|iemobile/.test(i),isZalo:/zalo/.test(i)}}(i);return{appEnv:e(i),platform:t,platformName:r(t),zaloVersion:a(i)}}}();if(i)return i}export{s as default};
1
+ import{mpDomain as i,mpPath as o}from"../constants.js";import t from"../utils/silent.js";import{PlatformType as n}from"../types/enum.js";var e=function(i){return i.isAndroid?n.android:i.isIOS?n.iOS:n.unknown};function s(i){var o=i.split("zalo")[1];return o&&o.replace(" ","").split("/")[1]||""}function a(){var n=function(){var n=t((function(){return window.navigator.userAgent.toLowerCase()}))();if(n){var a=function(i){return{isAndroid:/android/i.test(i)&&!/iemobile/.test(i),isIOS:/iphone|ios|ipad|ipod/.test(i)&&!/iemobile/.test(i),isMobile:/android|iphone|ios|ipad|ipod|iemobile/.test(i),isZalo:/zalo/.test(i)}}(n);return{appEnv:(window.location.hostname.includes(i)&&window.location.pathname.startsWith(o),{isMp:window.location.hostname.includes(i)&&window.location.pathname.startsWith(o),isMpWeb:window.location.hostname.includes("localhost")}),platform:a,platformName:e(a),zaloVersion:s(n)}}}();if(n)return n}export{a as default};
@@ -1 +1 @@
1
- import o from'./../../../external/@swc/helpers/src/_async_to_generator.mjs.js';import n from'./../../../external/@swc/helpers/src/_class_call_check.mjs.js';import t from'./../../../external/@swc/helpers/src/_object_spread.mjs.js';import i from"../../../utils/lodash.js";import e from"../../call/index.js";import{HIDE_ACTION_BAR as r,SHOW_ACTION_BAR as a,MINI_APP_INTERNAL_LINK as s,APP_ID as u,ACTION_LEFT_BUTTON_TYPE as l}from"../../../constants.js";import{StatusBarType as c,AndroidBottomNavigationBarType as f,IOSSafeAreaBottomType as d}from"../../../types/enum.js";import{__generator as h}from'./../../../external/tslib/tslib.es6.js';import m from"../../../appEnv/getEnv.js";var p=function(){function p(){var o,t,e,f,d,h,m,v,g,T,C,_,A,B,E,O,b;n(this,p),this.initConfig=window.APP_CONFIG;var w=i.isString(null===(o=this.initConfig)||void 0===o||null===(t=o.app)||void 0===t?void 0:t.headerColor)&&(null===(e=this.initConfig)||void 0===e||null===(f=e.app)||void 0===f||null===(d=f.headerColor)||void 0===d?void 0:d.length)>0?a:r;this.hideIOSSafeAreaBottom=!1,this.hideAndroidBottomNavigationBar=!1;var I="none"===(null===(h=this.initConfig)||void 0===h||null===(m=h.app)||void 0===m?void 0:m.leftButton)||"home"===(null===(v=this.initConfig)||void 0===v||null===(g=v.app)||void 0===g?void 0:g.leftButton)?l.HIDE_BACK:l.SHOW_BACK,y="home"===(null===(T=this.initConfig)||void 0===T||null===(C=T.app)||void 0===C?void 0:C.leftButton)||"both"===(null===(_=this.initConfig)||void 0===_||null===(A=_.app)||void 0===A?void 0:A.leftButton)?l.SHOW_HOME:l.HIDE_HOME,H=new URL(location.href);this.config={actionbarType:w,buttonType:I,statusbarType:c.normal,dataConfig:{backgroundColor:(null===(B=this.initConfig)||void 0===B||null===(E=B.app)||void 0===E?void 0:E.headerColor)||"",textColor:(null===(O=this.initConfig)||void 0===O||null===(b=O.app)||void 0===b?void 0:b.textColor)||"",viewInLeftType:I,confirmToExit:1},homeConfig:{enable:y,url:"".concat(s,"/").concat(u,"/").concat(H.search)}}}var v=p.prototype;return v.setNavigationBarTitle=function(n){return o((function(){return h(this,(function(o){return[2,new Promise((function(o,t){e("CHANGE_TITLE_HEADER",{title:n},{success:function(n){o()},fail:function(o){t(o)}},{timeout:!1})}))]}))}))()},v.setNavigationBarLeftButton=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"back",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this;return o((function(){var o,a;return h(this,(function(s){return o="none"===n||"home"===n?l.HIDE_BACK:l.SHOW_BACK,a="home"===n||"both"===n?l.SHOW_HOME:l.HIDE_HOME,r.config.buttonType=o,r.config.dataConfig.viewInLeftType=o,r.config.dataConfig.confirmToExit=i,r.config.homeConfig.enable=a,[2,new Promise((function(o,n){e("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",t({},r.config),{success:function(n){o()},fail:function(o){n(o)}},{timeout:!1})}))]}))}))()},v.setAndroidBottomNavigationBar=function(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return o((function(){var o,i,r;return h(this,(function(a){return i=n?f.hide:f.show,r=null===(o=m())||void 0===o?void 0:o.platform,[2,new Promise((function(o,a){if(!(null==r?void 0:r.isAndroid))return o();e("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(i){t.hideAndroidBottomNavigationBar=!!n,window.ANDROID_BOTTOM_NAVIGATION_BAR_HIDDEN=!!n,o()},fail:function(o){a(o)}},{timeout:!1})}))]}))}))()},v.setIOSBottomSafeArea=function(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return o((function(){var o,i,r;return h(this,(function(a){return i=n?d.hide:d.show,r=null===(o=m())||void 0===o?void 0:o.platform,[2,new Promise((function(o,a){if(!(null==r?void 0:r.isIOS))return o();e("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(i){t.hideIOSSafeAreaBottom=!!n,window.IOS_BOTTOM_SAFE_AREA_HIDDEN=!!n,o()},fail:function(o){a(o)}},{timeout:!1})}))]}))}))()},v.configHeader=function(n){var s=this;return o((function(){var o;return h(this,(function(u){return o=s.config,i.isString(n.headerColor)&&(o.dataConfig.backgroundColor=n.headerColor),i.isString(n.headerTextColor)&&(o.dataConfig.textColor=n.headerTextColor),!0===n.hideActionBar?o.actionbarType=r:!1===n.hideActionBar&&(o.actionbarType=a),"normal"===n.statusBarType?o.statusbarType=c.normal:"hidden"===n.statusBarType?o.statusbarType=c.hidden:"transparent"===n.statusBarType&&(o.statusbarType=c.transparent),[2,new Promise((function(n,i){e("CHANGE_ACTIONBAR",t({},o),{success:function(i){s.config=t({},o),window.STATUS_BAR_TYPE=s.config.statusbarType,window.ACTION_BAR_TYPE=s.config.actionbarType,n()},fail:function(o){i(o)}},{timeout:!1})}))]}))}))()},p.getInstance=function(){return p.instance||(p.instance=new p),p.instance},p}().getInstance();export{p as default};
1
+ import o from'./../../../external/@swc/helpers/src/_async_to_generator.mjs.js';import t from'./../../../external/@swc/helpers/src/_class_call_check.mjs.js';import n from'./../../../external/@swc/helpers/src/_object_spread.mjs.js';import i from"../../../utils/lodash.js";import e from"../../call/index.js";import{HIDE_ACTION_BAR as r,SHOW_ACTION_BAR as a,MINI_APP_INTERNAL_LINK as s,APP_ID as u,ACTION_LEFT_BUTTON_TYPE as l}from"../../../constants.js";import{StatusBarType as c,AndroidBottomNavigationBarType as f,IOSSafeAreaBottomType as d}from"../../../types/enum.js";import{__generator as h}from'./../../../external/tslib/tslib.es6.js';import v from"../../../appEnv/getEnv.js";var p=function(){function p(){var o,n,e,f,d,h,v,m,g,T,_,C,A,B,E,O,w;t(this,p),this.initConfig=window.APP_CONFIG;var I=i.isString(null===(o=this.initConfig)||void 0===o||null===(n=o.app)||void 0===n?void 0:n.headerColor)&&(null===(e=this.initConfig)||void 0===e||null===(f=e.app)||void 0===f||null===(d=f.headerColor)||void 0===d?void 0:d.length)>0?a:r;this.hideIOSSafeAreaBottom=!1,this.hideAndroidBottomNavigationBar=!1;var b="none"===(null===(h=this.initConfig)||void 0===h||null===(v=h.app)||void 0===v?void 0:v.leftButton)||"home"===(null===(m=this.initConfig)||void 0===m||null===(g=m.app)||void 0===g?void 0:g.leftButton)?l.HIDE_BACK:l.SHOW_BACK,H="home"===(null===(T=this.initConfig)||void 0===T||null===(_=T.app)||void 0===_?void 0:_.leftButton)||"both"===(null===(C=this.initConfig)||void 0===C||null===(A=C.app)||void 0===A?void 0:A.leftButton)?l.SHOW_HOME:l.HIDE_HOME,S=new URL(location.href);this.config={actionbarType:I,buttonType:b,statusbarType:c.normal,dataConfig:{backgroundColor:(null===(B=this.initConfig)||void 0===B||null===(E=B.app)||void 0===E?void 0:E.headerColor)||"",textColor:(null===(O=this.initConfig)||void 0===O||null===(w=O.app)||void 0===w?void 0:w.textColor)||"",viewInLeftType:b,confirmToExit:1},homeConfig:{enable:H,url:"".concat(s,"/").concat(u,"/").concat(S.search)}}}var m=p.prototype;return m.setNavigationBarTitle=function(t){return o((function(){return h(this,(function(o){return[2,new Promise((function(o,n){e("CHANGE_TITLE_HEADER",{title:t},{success:function(t){o()},fail:function(o){n(o)}},{timeout:!1})}))]}))}))()},m.setNavigationBarLeftButton=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"back",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this;return o((function(){var o,a;return h(this,(function(s){return o="none"===t||"home"===t?l.HIDE_BACK:l.SHOW_BACK,a="home"===t||"both"===t?l.SHOW_HOME:l.HIDE_HOME,r.config.buttonType=o,r.config.dataConfig.viewInLeftType=o,r.config.dataConfig.confirmToExit=i,r.config.homeConfig.enable=a,[2,new Promise((function(o,t){e("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",n({},r.config),{success:function(t){o()},fail:function(o){t(o)}},{timeout:!1})}))]}))}))()},m.setAndroidBottomNavigationBar=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;return o((function(){var o,i,r;return h(this,(function(a){return i=t?f.hide:f.show,r=null===(o=v())||void 0===o?void 0:o.platform,[2,new Promise((function(o,a){if(!(null==r?void 0:r.isAndroid))return o();e("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(i){n.hideAndroidBottomNavigationBar=!!t,window.ANDROID_BOTTOM_NAVIGATION_BAR_HIDDEN=!!t,o()},fail:function(o){a(o)}},{timeout:!1})}))]}))}))()},m.setIOSBottomSafeArea=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;return o((function(){var o,i,r;return h(this,(function(a){return i=t?d.hide:d.show,r=null===(o=v())||void 0===o?void 0:o.platform,[2,new Promise((function(o,a){if(!(null==r?void 0:r.isIOS))return o();e("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(i){n.hideIOSSafeAreaBottom=!!t,window.IOS_BOTTOM_SAFE_AREA_HIDDEN=!!t,o()},fail:function(o){a(o)}},{timeout:!1})}))]}))}))()},m.configHeader=function(t){var s=this;return o((function(){var o;return h(this,(function(u){return o=s.config,i.isString(t.headerColor)&&(o.dataConfig.backgroundColor=t.headerColor),i.isString(t.headerTextColor)&&(o.dataConfig.textColor=t.headerTextColor),!0===t.hideActionBar?o.actionbarType=r:!1===t.hideActionBar&&(o.actionbarType=a),"normal"===t.statusBarType?o.statusbarType=c.normal:"hidden"===t.statusBarType?o.statusbarType=c.hidden:"transparent"===t.statusBarType&&(o.statusbarType=c.transparent),window.ANDROID_STATUS_BAR_HEIGHT=ZaloJavaScriptInterface.getStatusBarHeight()/window.devicePixelRatio,[2,new Promise((function(t,i){e("CHANGE_ACTIONBAR",n({},o),{success:function(i){s.config=n({},o),window.STATUS_BAR_TYPE=s.config.statusbarType,window.ACTION_BAR_TYPE=s.config.actionbarType,t()},fail:function(o){i(o)}},{timeout:!1})}))]}))}))()},p.getInstance=function(){return p.instance||(p.instance=new p),p.instance},p}().getInstance();export{p as default};
@@ -1 +1 @@
1
- var r="2.25.0-rc.2";export{r as version};
1
+ var r="2.25.0-rc.3";export{r as version};