@alipay/ams-checkout 0.0.1732691889-dev.1 → 0.0.1732691889-dev.11

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.
@@ -5,10 +5,10 @@
5
5
  * 1. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE; and
6
6
  * 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
7
7
  */
8
- import { ANIMATION_TIME, closeImg, COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CONTAINER_ID, COMPONENT_CLOSE_MASK_ID, COMPONENT_RETENTION_ID, COMPONENT_SECTION_ID, LOADING_ID, MOCKUP_ID } from "../constant";
8
+ import { ANIMATION_TIME, closeImg, COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CONTAINER_ID, COMPONENT_CLOSE_MASK_BLOCK_ID, COMPONENT_RETENTION_ID, COMPONENT_SECTION_ID, LOADING_ID, MOCKUP_ID } from "../constant";
9
9
  import { PlatformEnum } from "../types";
10
10
  import { addSetFontSizeEvent, amsSetSize, getDesignFontSize } from "../util";
11
- var componentCss = ".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n\n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translate(-50%, -50%) scale(0.4);\n opacity: 0\n }\n\n 100% {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n.asm-component-close-block-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-block-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n.asm-component-mask-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n top: 10px;\n cursor: pointer;\n }\n \n.asm-component-mask-close-block-mobile {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n bottom: 0;\n cursor: pointer;\n z-index: 1012;\n}\n\n.asm-component-mask-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.asm-component-mask-close-block-btn {\n width: 24px;\n height: 24px;\n object-fit: fill;\n position: absolute;\n right: 8px;\n top: 8px;\n }\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n border-radius: 12px 12px 0 0;\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 159px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 144px;\n}\n.".concat(MOCKUP_ID, "-hidden{\nanimation: ").concat(MOCKUP_ID, "-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes ").concat(MOCKUP_ID, "-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n");
11
+ var componentCss = ".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n\n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translate(-50%, -50%) scale(0.4);\n opacity: 0\n }\n\n 100% {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n.asm-component-close-block-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-block-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n.ams-component-mask-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n top: 10px;\n cursor: pointer;\n z-index: 1013;\n}\n \n.ams-component-mask-close-block-mobile {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n cursor: pointer;\n z-index: 1012;\n}\n\n.ams-component-mask-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.ams-component-mask-close-block-btn {\n width: 24px;\n height: 24px;\n object-fit: fill;\n position: absolute;\n right: 8px;\n top: 8px;\n}\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n border-radius: 12px 12px 0 0;\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 159px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 144px;\n}\n.".concat(MOCKUP_ID, "-hidden{\nanimation: ").concat(MOCKUP_ID, "-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes ").concat(MOCKUP_ID, "-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n");
12
12
  export var componentAddCSS = function componentAddCSS() {
13
13
  var style = document.createElement('style');
14
14
  style.type = 'text/css';
@@ -49,16 +49,15 @@ export var createCloseBtn = function createCloseBtn(platform, closeBtnFunc) {
49
49
  };
50
50
  export var createMaskCloseButton = function createMaskCloseButton(platform, closeBtnFunc) {
51
51
  var clickEventName = platform === PlatformEnum.mobile ? 'touchend' : 'click';
52
- var container = document.getElementById(MOCKUP_ID);
53
- var closeBtnHTML = "<div class='".concat(COMPONENT_CLOSE_MASK_ID, "-btn'>\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M19.5673 4.49829L19.424 4.36736L19.3027 4.27821L19.1702 4.19928C18.5417 3.86236 17.7834 3.96479 17.2841 4.46433L11.9986 9.7512L6.73275 4.4853L6.67045 4.42539C6.01464 3.85742 5.07067 3.85791 4.49751 4.42864L4.38538 4.54934L4.27757 4.69333L4.19868 4.8259C3.862 5.45451 3.96432 6.21286 4.46349 6.71225L9.75274 12.0006L4.42833 17.3276C3.85705 17.9874 3.85754 18.9315 4.42789 19.5048L4.54854 19.6169L4.6925 19.7248L4.82504 19.8038C5.45353 20.1407 6.21179 20.0383 6.71105 19.5388L11.9986 14.2489L17.321 19.574C17.9915 20.1551 18.9356 20.1352 19.5317 19.5388L19.6383 19.4206L19.7338 19.2891C20.1447 18.6603 20.0683 17.8276 19.5316 17.2907L14.2454 12.0016L19.5077 6.73713L19.605 6.63362C20.1455 6.00703 20.1297 5.06361 19.5673 4.49829Z\" fill=\"#EEEEEE\"/>\n</svg>\n </div>");
52
+ var closeBtnHTML = "<div class='".concat(COMPONENT_CLOSE_MASK_BLOCK_ID, "-btn'>\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M19.5673 4.49829L19.424 4.36736L19.3027 4.27821L19.1702 4.19928C18.5417 3.86236 17.7834 3.96479 17.2841 4.46433L11.9986 9.7512L6.73275 4.4853L6.67045 4.42539C6.01464 3.85742 5.07067 3.85791 4.49751 4.42864L4.38538 4.54934L4.27757 4.69333L4.19868 4.8259C3.862 5.45451 3.96432 6.21286 4.46349 6.71225L9.75274 12.0006L4.42833 17.3276C3.85705 17.9874 3.85754 18.9315 4.42789 19.5048L4.54854 19.6169L4.6925 19.7248L4.82504 19.8038C5.45353 20.1407 6.21179 20.0383 6.71105 19.5388L11.9986 14.2489L17.321 19.574C17.9915 20.1551 18.9356 20.1352 19.5317 19.5388L19.6383 19.4206L19.7338 19.2891C20.1447 18.6603 20.0683 17.8276 19.5316 17.2907L14.2454 12.0016L19.5077 6.73713L19.605 6.63362C20.1455 6.00703 20.1297 5.06361 19.5673 4.49829Z\" fill=\"#EEEEEE\"/>\n</svg>\n </div>");
54
53
  var closeBlock = document.createElement('div');
55
- closeBlock.classList.add("".concat(COMPONENT_CLOSE_MASK_ID, "-").concat(platform), "".concat(COMPONENT_CLOSE_MASK_ID, "-hidden"));
56
- closeBlock.id = COMPONENT_CLOSE_MASK_ID;
54
+ closeBlock.classList.add("".concat(COMPONENT_CLOSE_MASK_BLOCK_ID, "-").concat(platform), "".concat(COMPONENT_CLOSE_MASK_BLOCK_ID, "-hidden"));
55
+ closeBlock.id = COMPONENT_CLOSE_MASK_BLOCK_ID;
57
56
  closeBlock.innerHTML = closeBtnHTML;
58
57
  closeBlock.addEventListener(clickEventName, function () {
59
58
  closeBtnFunc();
60
59
  });
61
- if (container) container.appendChild(closeBlock);
60
+ document.body.appendChild(closeBlock);
62
61
  };
63
62
 
64
63
  /**
@@ -112,6 +112,10 @@ export declare const EVENT: {
112
112
  name: string;
113
113
  uniqueKey: string;
114
114
  };
115
+ closeCallback: {
116
+ name: string;
117
+ uniqueKey: string;
118
+ };
115
119
  eventCallback: {
116
120
  name: string;
117
121
  uniqueKey: string;
@@ -199,7 +203,7 @@ export declare const COMPONENT_CONTAINER_ID = "ams-component-container";
199
203
  export declare const COMPONENT_SECTION_ID = "ams-component-section";
200
204
  export declare const COMPONENT_IFRAME_TAG_ID = "ams-checkout-component";
201
205
  export declare const COMPONENT_CLOSE_BLOCK_ID = "asm-component-close-block";
202
- export declare const COMPONENT_CLOSE_MASK_ID = "asm-component-mask-close-block";
206
+ export declare const COMPONENT_CLOSE_MASK_BLOCK_ID = "ams-component-mask-close-block";
203
207
  export declare const COMPONENT_RETENTION_ID = "ams-component-retention";
204
208
  export declare const MOCKUP_ID = "ams-component-mockup";
205
209
  export declare const LOADING_ID = "ams-component-loading";
@@ -112,6 +112,11 @@ export var EVENT = {
112
112
  name: 'onClose',
113
113
  uniqueKey: 'userOnClose'
114
114
  },
115
+ // 标记 SDK 回调事件
116
+ closeCallback: {
117
+ name: 'onCloseCallback',
118
+ uniqueKey: 'closeCallback'
119
+ },
115
120
  eventCallback: {
116
121
  name: 'onEventCallback',
117
122
  uniqueKey: 'userEventCallback'
@@ -201,7 +206,7 @@ export var COMPONENT_CONTAINER_ID = 'ams-component-container';
201
206
  export var COMPONENT_SECTION_ID = 'ams-component-section';
202
207
  export var COMPONENT_IFRAME_TAG_ID = 'ams-checkout-component';
203
208
  export var COMPONENT_CLOSE_BLOCK_ID = 'asm-component-close-block';
204
- export var COMPONENT_CLOSE_MASK_ID = 'asm-component-mask-close-block';
209
+ export var COMPONENT_CLOSE_MASK_BLOCK_ID = 'ams-component-mask-close-block';
205
210
  export var COMPONENT_RETENTION_ID = 'ams-component-retention';
206
211
  export var MOCKUP_ID = 'ams-component-mockup';
207
212
  export var LOADING_ID = 'ams-component-loading';
@@ -22,5 +22,6 @@ export declare class AntomSDKCore {
22
22
  getPaymentContext(): PaymentContext;
23
23
  destroy(): void;
24
24
  private handleBehaviorRender;
25
+ private handleClose;
25
26
  private cleanRender;
26
27
  }
@@ -10,7 +10,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
10
10
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
11
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
12
12
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
- import { DisplayTypeEnum } from "../../types";
13
+ import { DisplayTypeEnum, eventCodeEnum } from "../../types";
14
14
  import { DisplayInfo } from "../index";
15
15
  import { v4 as uuid } from 'uuid';
16
16
  import { ServiceProvider } from "../service";
@@ -150,6 +150,18 @@ export var AntomSDKCore = /*#__PURE__*/function () {
150
150
  return _ref2.apply(this, arguments);
151
151
  };
152
152
  }());
153
+ eventCenter.listen(EVENT.closeCallback.name, function () {
154
+ var _options$onClose;
155
+ (_options$onClose = options.onClose) === null || _options$onClose === void 0 || _options$onClose.call(options);
156
+ });
157
+ eventCenter.listen(EVENT.eventCallback.name, function (data) {
158
+ var _options$onEventCallb;
159
+ (_options$onEventCallb = options.onEventCallback) === null || _options$onEventCallb === void 0 || _options$onEventCallb.call(options, data);
160
+ });
161
+ eventCenter.listen(EVENT.error.name, function (data) {
162
+ var _options$onError;
163
+ (_options$onError = options.onError) === null || _options$onError === void 0 || _options$onError.call(options, data);
164
+ });
153
165
 
154
166
  // execute additional logic from specified product
155
167
  if (this.productProcessors[sdkMetaData.productScene]) {
@@ -291,11 +303,7 @@ export var AntomSDKCore = /*#__PURE__*/function () {
291
303
  showRetentionPopup();
292
304
  return;
293
305
  } else {
294
- _this2.cleanRender();
295
- eventCenter.dispatchToApp({
296
- event: EVENT.close.name,
297
- data: {}
298
- });
306
+ _this2.handleClose();
299
307
  }
300
308
  };
301
309
 
@@ -322,12 +330,8 @@ export var AntomSDKCore = /*#__PURE__*/function () {
322
330
  createRetentionPopup(platform, function () {
323
331
  hideRetentionPopup();
324
332
  }, function () {
325
- eventCenter.dispatchToApp({
326
- event: EVENT.close.name,
327
- data: {}
328
- });
329
333
  hideRetentionPopup();
330
- _this2.cleanRender();
334
+ _this2.handleClose();
331
335
  });
332
336
  createMockup({
333
337
  platform: platform,
@@ -338,6 +342,19 @@ export var AntomSDKCore = /*#__PURE__*/function () {
338
342
  return;
339
343
  }
340
344
  }
345
+ }, {
346
+ key: "handleClose",
347
+ value: function handleClose() {
348
+ var eventCenter = ServiceProvider.getInstance(this.instanceId).getService('EventCenter');
349
+ eventCenter.emit(EVENT.closeCallback.name, {});
350
+ eventCenter.emit(EVENT.eventCallback.name, {
351
+ code: eventCodeEnum.SDK_PAYMENT_CANCEL,
352
+ result: {
353
+ result: {}
354
+ }
355
+ });
356
+ this.cleanRender();
357
+ }
341
358
  }, {
342
359
  key: "cleanRender",
343
360
  value: function cleanRender() {
@@ -24,7 +24,9 @@ export declare class ContainerService implements Service {
24
24
  startHideAnim(): void;
25
25
  private addCapabilityToEventCenter;
26
26
  private addCapabilityToApiBusManager;
27
+ private updateMaskCloseBtn;
27
28
  private handleSizeChanged;
28
29
  private handleAppHeartBeat;
29
30
  private changeCloseBtnVisibility;
31
+ private handleMaskCloseBtnShow;
30
32
  }
@@ -11,7 +11,7 @@ import { DisplayTypeEnum } from "../../../types";
11
11
  import { createIframe, createPreloadIframe, startSizeChangeAnim } from "./utils";
12
12
  import { addInlineLoading, createInlineBaseElement } from "../../../component/component.inline.style";
13
13
  import { addPopupLoading, createBaseElement } from "../../../component/component.popup.style";
14
- import { COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CONTAINER_ID, ERRORMESSAGE, LOADING_ID, MOCKUP_ID } from "../../../constant";
14
+ import { COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CLOSE_MASK_BLOCK_ID, COMPONENT_CONTAINER_ID, ERRORMESSAGE, LOADING_ID, MOCKUP_ID } from "../../../constant";
15
15
  import { ServiceProvider } from "../index";
16
16
  import { EVENT, TIMEOUT_WEB_APP_HEART_BEAT, TIME_DELAY_SEND_HEART_BEAT } from "../../../constant";
17
17
  import { PopupManager } from "./popup";
@@ -82,6 +82,8 @@ export var ContainerService = /*#__PURE__*/function () {
82
82
  }
83
83
  var container = document.getElementById(COMPONENT_CONTAINER_ID);
84
84
  if (container) container === null || container === void 0 || container.remove();
85
+ this.webApp = null;
86
+ this.eventCenter.cleanIFrames();
85
87
 
86
88
  // animation
87
89
  (_document$getElementB = document.getElementById("".concat(COMPONENT_CONTAINER_ID, "-").concat(displayInfo.platform, "-animation-style"))) === null || _document$getElementB === void 0 || _document$getElementB.remove();
@@ -204,6 +206,9 @@ export var ContainerService = /*#__PURE__*/function () {
204
206
  this.eventCenter.listen(EVENT.hideCloseButton.name, function () {
205
207
  _this2.changeCloseBtnVisibility(false);
206
208
  });
209
+ this.eventCenter.listen(EVENT.setMaskCloseButton.name, function (data) {
210
+ _this2.handleMaskCloseBtnShow(data);
211
+ });
207
212
  this.eventCenter.listen(EVENT.appHeartBeat.name, function () {
208
213
  _this2.handleAppHeartBeat();
209
214
  });
@@ -211,6 +216,21 @@ export var ContainerService = /*#__PURE__*/function () {
211
216
  }, {
212
217
  key: "addCapabilityToApiBusManager",
213
218
  value: function addCapabilityToApiBusManager() {}
219
+ }, {
220
+ key: "updateMaskCloseBtn",
221
+ value: function updateMaskCloseBtn(data) {
222
+ var maskCloseBtn = document.getElementById("".concat(COMPONENT_CLOSE_MASK_BLOCK_ID));
223
+ if (maskCloseBtn) {
224
+ if (this.displayInfo.platform === 'desktop') {
225
+ var windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
226
+ var windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
227
+ maskCloseBtn.style.top = "".concat((windowHeight - data.height) / 2 - 42, "px");
228
+ maskCloseBtn.style.right = "".concat((windowWidth - data.width) / 2 + 18, "px");
229
+ } else {
230
+ maskCloseBtn.style.bottom = "".concat(data.height + 2, "px");
231
+ }
232
+ }
233
+ }
214
234
  }, {
215
235
  key: "handleSizeChanged",
216
236
  value: function handleSizeChanged(data) {
@@ -239,6 +259,8 @@ export var ContainerService = /*#__PURE__*/function () {
239
259
  }
240
260
  // 关闭loading,保留蒙层
241
261
  this.dismissLoading();
262
+ // 更新弹窗关闭按钮位置
263
+ this.updateMaskCloseBtn(data);
242
264
  }
243
265
  if (this.displayInfo.type === DisplayTypeEnum.inline) {
244
266
  var _document$getElementB3;
@@ -293,6 +315,16 @@ export var ContainerService = /*#__PURE__*/function () {
293
315
  closeBlock === null || closeBlock === void 0 || closeBlock.classList.add("".concat(COMPONENT_CLOSE_BLOCK_ID, "-hidden"));
294
316
  }
295
317
  }
318
+ }, {
319
+ key: "handleMaskCloseBtnShow",
320
+ value: function handleMaskCloseBtnShow(data) {
321
+ var closeBlock = document.getElementById(COMPONENT_CLOSE_MASK_BLOCK_ID);
322
+ if ((data === null || data === void 0 ? void 0 : data.status) === 'show') {
323
+ closeBlock === null || closeBlock === void 0 || closeBlock.classList.remove("".concat(COMPONENT_CLOSE_MASK_BLOCK_ID, "-hidden"));
324
+ } else {
325
+ closeBlock === null || closeBlock === void 0 || closeBlock.classList.add("".concat(COMPONENT_CLOSE_MASK_BLOCK_ID, "-hidden"));
326
+ }
327
+ }
296
328
  }]);
297
329
  return ContainerService;
298
330
  }();
@@ -27,6 +27,10 @@ export declare class EventCenter implements Service {
27
27
  * @param domain - The domain of the app.
28
28
  */
29
29
  addIFrame(iframe: HTMLIFrameElement): void;
30
+ /**
31
+ * Cleans iframes when web app close
32
+ */
33
+ cleanIFrames(): void;
30
34
  removeIFrame(iframe: HTMLIFrameElement): void;
31
35
  /**
32
36
  * Handles messages received from the app.
@@ -42,8 +46,9 @@ export declare class EventCenter implements Service {
42
46
  * Listens to an event by adding a callback function.
43
47
  * @param name - The name of the event to listen for.
44
48
  * @param func - The callback function to execute when the event is emitted.
49
+ * @param isAppend - Append to event handlers as chain, default value is false
45
50
  */
46
- listen(name: string, func: IListener): void;
51
+ listen(name: string, func: IListener, isAppend?: boolean): void;
47
52
  /**
48
53
  * Unsubscribes from an event. If a function is provided, only that function is removed.
49
54
  * @param name - The name of the event to unlisten to.
@@ -72,6 +72,15 @@ export var EventCenter = /*#__PURE__*/function () {
72
72
  origin: getIframeOrigin(iframe)
73
73
  });
74
74
  }
75
+
76
+ /**
77
+ * Cleans iframes when web app close
78
+ */
79
+ }, {
80
+ key: "cleanIFrames",
81
+ value: function cleanIFrames() {
82
+ this.iframes = [];
83
+ }
75
84
  }, {
76
85
  key: "removeIFrame",
77
86
  value: function removeIFrame(iframe) {
@@ -99,11 +108,11 @@ export var EventCenter = /*#__PURE__*/function () {
99
108
  }
100
109
  var isJson = isJsonString(e.data);
101
110
  if (isJson) {
102
- var _EventPayload = JSON.parse(e.data);
103
- if (_EventPayload.name !== MessageName.APP_TO_SDK) {
111
+ var eventPayload = JSON.parse(e.data);
112
+ if (eventPayload.name !== MessageName.APP_TO_SDK || eventPayload.instanceId !== this.instanceId) {
104
113
  return;
105
114
  }
106
- this._handleAppMessage(_EventPayload);
115
+ this._handleAppMessage(eventPayload);
107
116
  } else {
108
117
  console.error(ERRORMESSAGE.NOT_JSON_FORMAT);
109
118
  }
@@ -126,11 +135,13 @@ export var EventCenter = /*#__PURE__*/function () {
126
135
  * Listens to an event by adding a callback function.
127
136
  * @param name - The name of the event to listen for.
128
137
  * @param func - The callback function to execute when the event is emitted.
138
+ * @param isAppend - Append to event handlers as chain, default value is false
129
139
  */
130
140
  }, {
131
141
  key: "listen",
132
142
  value: function listen(name, func) {
133
- var eventList = this.events.get(name) || [];
143
+ var isAppend = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
144
+ var eventList = isAppend ? this.events.get(name) || [] : [];
134
145
  eventList.push({
135
146
  func: func
136
147
  });
package/esm/index.d.ts CHANGED
@@ -33,4 +33,5 @@ export declare class AMSEasyPay {
33
33
  private core;
34
34
  constructor(options: IoptionsParams);
35
35
  createComponent(params: IcreateComponent): void;
36
+ unmount(): void;
36
37
  }
package/esm/index.js CHANGED
@@ -181,6 +181,11 @@ export var AMSEasyPay = /*#__PURE__*/function () {
181
181
  isAppWebview: params.isAppWebview
182
182
  });
183
183
  }
184
+ }, {
185
+ key: "unmount",
186
+ value: function unmount() {
187
+ this.core.destroy();
188
+ }
184
189
  }]);
185
190
  return AMSEasyPay;
186
191
  }();
@@ -5,10 +5,10 @@
5
5
  * 1. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE; and
6
6
  * 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
7
7
  */
8
- import { ANIMATION_TIME, closeImg, COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CLOSE_MASK_ID, COMPONENT_CONTAINER_ID, COMPONENT_RETENTION_ID, COMPONENT_SECTION_ID, LOADING_ID, MOCKUP_ID } from "../../constant";
8
+ import { ANIMATION_TIME, closeImg, COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CLOSE_MASK_BLOCK_ID, COMPONENT_CONTAINER_ID, COMPONENT_RETENTION_ID, COMPONENT_SECTION_ID, LOADING_ID, MOCKUP_ID } from "../../constant";
9
9
  import { PlatformEnum } from "../../types";
10
10
  import { addSetFontSizeEvent, amsSetSize, getDesignFontSize } from "../../util";
11
- var componentCss = ".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n\n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translate(-50%, -50%) scale(0.4);\n opacity: 0\n }\n\n 100% {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.asm-component-close-block-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n\n.asm-component-close-block-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n\n.asm-component-mask-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n top: 10px;\n cursor: pointer;\n }\n \n.asm-component-mask-close-block-mobile {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n bottom: 0;\n cursor: pointer;\n z-index: 1012;\n}\n\n.asm-component-mask-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.asm-component-mask-close-block-btn {\n width: 24px;\n height: 24px;\n object-fit: fill;\n position: absolute;\n right: 8px;\n top: 8px;\n }\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n border-radius: 12px 12px 0 0;\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 159px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 144px;\n}\n.".concat(MOCKUP_ID, "-hidden{\nanimation: ").concat(MOCKUP_ID, "-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes ").concat(MOCKUP_ID, "-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n\n");
11
+ var componentCss = ".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n\n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translate(-50%, -50%) scale(0.4);\n opacity: 0\n }\n\n 100% {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.asm-component-close-block-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n\n.asm-component-close-block-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n\n.ams-component-mask-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n top: 10px;\n cursor: pointer;\n z-index: 1013;\n}\n \n.ams-component-mask-close-block-mobile {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n cursor: pointer;\n z-index: 1012;\n}\n\n.ams-component-mask-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.ams-component-mask-close-block-btn {\n width: 24px;\n height: 24px;\n object-fit: fill;\n position: absolute;\n right: 8px;\n top: 8px;\n}\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n border-radius: 12px 12px 0 0;\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 159px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 144px;\n}\n.".concat(MOCKUP_ID, "-hidden{\nanimation: ").concat(MOCKUP_ID, "-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes ").concat(MOCKUP_ID, "-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n\n");
12
12
  export var componentAddCSS = function componentAddCSS() {
13
13
  var style = document.createElement('style');
14
14
  style.type = 'text/css';
@@ -49,16 +49,15 @@ export var createCloseBtn = function createCloseBtn(platform, closeBtnFunc) {
49
49
  };
50
50
  export var createMaskCloseButton = function createMaskCloseButton(platform, closeBtnFunc) {
51
51
  var clickEventName = platform === PlatformEnum.mobile ? 'touchend' : 'click';
52
- var container = document.getElementById(MOCKUP_ID);
53
- var closeBtnHTML = "<div class='".concat(COMPONENT_CLOSE_MASK_ID, "-btn'>\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M19.5673 4.49829L19.424 4.36736L19.3027 4.27821L19.1702 4.19928C18.5417 3.86236 17.7834 3.96479 17.2841 4.46433L11.9986 9.7512L6.73275 4.4853L6.67045 4.42539C6.01464 3.85742 5.07067 3.85791 4.49751 4.42864L4.38538 4.54934L4.27757 4.69333L4.19868 4.8259C3.862 5.45451 3.96432 6.21286 4.46349 6.71225L9.75274 12.0006L4.42833 17.3276C3.85705 17.9874 3.85754 18.9315 4.42789 19.5048L4.54854 19.6169L4.6925 19.7248L4.82504 19.8038C5.45353 20.1407 6.21179 20.0383 6.71105 19.5388L11.9986 14.2489L17.321 19.574C17.9915 20.1551 18.9356 20.1352 19.5317 19.5388L19.6383 19.4206L19.7338 19.2891C20.1447 18.6603 20.0683 17.8276 19.5316 17.2907L14.2454 12.0016L19.5077 6.73713L19.605 6.63362C20.1455 6.00703 20.1297 5.06361 19.5673 4.49829Z\" fill=\"#EEEEEE\"/>\n</svg>\n </div>");
52
+ var closeBtnHTML = "<div class='".concat(COMPONENT_CLOSE_MASK_BLOCK_ID, "-btn'>\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M19.5673 4.49829L19.424 4.36736L19.3027 4.27821L19.1702 4.19928C18.5417 3.86236 17.7834 3.96479 17.2841 4.46433L11.9986 9.7512L6.73275 4.4853L6.67045 4.42539C6.01464 3.85742 5.07067 3.85791 4.49751 4.42864L4.38538 4.54934L4.27757 4.69333L4.19868 4.8259C3.862 5.45451 3.96432 6.21286 4.46349 6.71225L9.75274 12.0006L4.42833 17.3276C3.85705 17.9874 3.85754 18.9315 4.42789 19.5048L4.54854 19.6169L4.6925 19.7248L4.82504 19.8038C5.45353 20.1407 6.21179 20.0383 6.71105 19.5388L11.9986 14.2489L17.321 19.574C17.9915 20.1551 18.9356 20.1352 19.5317 19.5388L19.6383 19.4206L19.7338 19.2891C20.1447 18.6603 20.0683 17.8276 19.5316 17.2907L14.2454 12.0016L19.5077 6.73713L19.605 6.63362C20.1455 6.00703 20.1297 5.06361 19.5673 4.49829Z\" fill=\"#EEEEEE\"/>\n</svg>\n </div>");
54
53
  var closeBlock = document.createElement('div');
55
- closeBlock.classList.add("".concat(COMPONENT_CLOSE_MASK_ID, "-").concat(platform), "".concat(COMPONENT_CLOSE_MASK_ID, "-hidden"));
56
- closeBlock.id = COMPONENT_CLOSE_MASK_ID;
54
+ closeBlock.classList.add("".concat(COMPONENT_CLOSE_MASK_BLOCK_ID, "-").concat(platform), "".concat(COMPONENT_CLOSE_MASK_BLOCK_ID, "-hidden"));
55
+ closeBlock.id = COMPONENT_CLOSE_MASK_BLOCK_ID;
57
56
  closeBlock.innerHTML = closeBtnHTML;
58
57
  closeBlock.addEventListener(clickEventName, function () {
59
58
  closeBtnFunc();
60
59
  });
61
- if (container) container.appendChild(closeBlock);
60
+ document.body.appendChild(closeBlock);
62
61
  };
63
62
 
64
63
  /**
@@ -19,7 +19,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
19
19
  /* eslint-disable @typescript-eslint/no-explicit-any */
20
20
  import { v4 as uuid } from 'uuid';
21
21
  import { sdkVersion } from "../../config";
22
- import { COMPONENTPLUGINID, COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CLOSE_MASK_ID, COMPONENT_CONTAINER_ID, COMPONENT_RETENTION_ID, COMPONENT_SECTION_ID, ERRORMESSAGE, EVENT, LISTENER_PREFIX, LOADING_ID, LOADTIME_LIMIT, MOCKUP_ID, POPUP_LOADTIME_LOG_LIMIT, TIMEOUT_WEB_APP_HEART_BEAT, TIME_DELAY_SEND_HEART_BEAT } from "../../constant";
22
+ import { COMPONENTPLUGINID, COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CLOSE_MASK_BLOCK_ID, COMPONENT_CONTAINER_ID, COMPONENT_RETENTION_ID, COMPONENT_SECTION_ID, ERRORMESSAGE, EVENT, LISTENER_PREFIX, LOADING_ID, LOADTIME_LIMIT, MOCKUP_ID, POPUP_LOADTIME_LOG_LIMIT, TIMEOUT_WEB_APP_HEART_BEAT, TIME_DELAY_SEND_HEART_BEAT } from "../../constant";
23
23
  import { queryPaymentInfo, submitPayInfo } from "../../service";
24
24
  import { ComponentSignEnum, eventCodeEnum, MessageName, PlatformEnum, ProductSceneEnum, RedirectType, DisplayTypeEnum, TargetEnum } from "../../types";
25
25
  import { getType, isJsonString, isPC } from "../../util";
@@ -1374,12 +1374,17 @@ var ComponentApp = /*#__PURE__*/function () {
1374
1374
  }, {
1375
1375
  key: "updateMaskCloseBtn",
1376
1376
  value: function updateMaskCloseBtn(data) {
1377
- var _document$getElementB3;
1378
- var maskCloseBtn = document.getElementById(COMPONENT_CLOSE_MASK_ID);
1377
+ var maskCloseBtn = document.getElementById("".concat(COMPONENT_CLOSE_MASK_BLOCK_ID));
1379
1378
  if (maskCloseBtn) {
1380
- maskCloseBtn.style.bottom = "".concat(data.height + 2, "px");
1379
+ if (this.platform === 'desktop') {
1380
+ var windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
1381
+ var windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
1382
+ maskCloseBtn.style.top = "".concat((windowHeight - data.height) / 2 - 42, "px");
1383
+ maskCloseBtn.style.right = "".concat((windowWidth - data.width) / 2 + 18, "px");
1384
+ } else {
1385
+ maskCloseBtn.style.bottom = "".concat(data.height + 2, "px");
1386
+ }
1381
1387
  }
1382
- (_document$getElementB3 = document.getElementById(LOADING_ID)) === null || _document$getElementB3 === void 0 || _document$getElementB3.remove();
1383
1388
  }
1384
1389
  }, {
1385
1390
  key: "handleSizeChanged",
@@ -1425,11 +1430,12 @@ var ComponentApp = /*#__PURE__*/function () {
1425
1430
  }
1426
1431
  // 关闭loading,保留蒙层
1427
1432
  this.dismissLoadingFunc();
1433
+ // 更新弹窗关闭按钮位置
1434
+ this.updateMaskCloseBtn(data.context.data);
1428
1435
  }
1429
- this.updateMaskCloseBtn(data.context.data);
1430
1436
  if (this._renderDisplayType === DisplayTypeEnum.inline) {
1431
- var _document$getElementB4;
1432
- (_document$getElementB4 = document.getElementById(LOADING_ID)) === null || _document$getElementB4 === void 0 || _document$getElementB4.remove();
1437
+ var _document$getElementB3;
1438
+ (_document$getElementB3 = document.getElementById(LOADING_ID)) === null || _document$getElementB3 === void 0 || _document$getElementB3.remove();
1433
1439
  this.app.style.height = "".concat(data.context.data.height, "px");
1434
1440
  }
1435
1441
  }
@@ -1658,11 +1664,11 @@ var ComponentApp = /*#__PURE__*/function () {
1658
1664
  }, {
1659
1665
  key: "handleMaskCloseBtnShow",
1660
1666
  value: function handleMaskCloseBtnShow(data) {
1661
- var closeBlock = document.getElementById(COMPONENT_CLOSE_MASK_ID);
1662
- if ((data === null || data === void 0 ? void 0 : data.status) === "show") {
1663
- closeBlock === null || closeBlock === void 0 || closeBlock.classList.remove("".concat(COMPONENT_CLOSE_MASK_ID, "-hidden"));
1667
+ var closeBlock = document.getElementById(COMPONENT_CLOSE_MASK_BLOCK_ID);
1668
+ if ((data === null || data === void 0 ? void 0 : data.status) === 'show') {
1669
+ closeBlock === null || closeBlock === void 0 || closeBlock.classList.remove("".concat(COMPONENT_CLOSE_MASK_BLOCK_ID, "-hidden"));
1664
1670
  } else {
1665
- closeBlock === null || closeBlock === void 0 || closeBlock.classList.add("".concat(COMPONENT_CLOSE_MASK_ID, "-hidden"));
1671
+ closeBlock === null || closeBlock === void 0 || closeBlock.classList.add("".concat(COMPONENT_CLOSE_MASK_BLOCK_ID, "-hidden"));
1666
1672
  }
1667
1673
  }
1668
1674
 
@@ -1820,10 +1826,10 @@ var ComponentApp = /*#__PURE__*/function () {
1820
1826
  }, {
1821
1827
  key: "cleanContainer",
1822
1828
  value: function cleanContainer() {
1823
- var _document$getElementB5,
1829
+ var _document$getElementB4,
1824
1830
  _this10 = this;
1825
1831
  var immediately = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
1826
- (_document$getElementB5 = document.getElementById(LOADING_ID)) === null || _document$getElementB5 === void 0 || _document$getElementB5.remove();
1832
+ (_document$getElementB4 = document.getElementById(LOADING_ID)) === null || _document$getElementB4 === void 0 || _document$getElementB4.remove();
1827
1833
  this.hideComponentAnimation();
1828
1834
  var mockup = document.getElementById(MOCKUP_ID);
1829
1835
  mockup === null || mockup === void 0 || mockup.classList.add("".concat(MOCKUP_ID, "-hidden"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "0.0.1732691889-dev.1",
3
+ "version": "0.0.1732691889-dev.11",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",