@alipay/ams-checkout 0.0.1756987734-dev.1 → 0.0.1757298389-dev.0

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,5 +1,4 @@
1
1
  import { PlatformEnum } from '../types';
2
- export declare const 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.ams-component-mockup-hidden{\nanimation: ams-component-mockup-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes ams-component-mockup-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n";
3
2
  export declare const componentAddCSS: () => void;
4
3
  export declare const createBaseElement: (platform: PlatformEnum, closeBtnFunc: () => void) => HTMLDivElement;
5
4
  export declare const createCloseBtn: (platform: PlatformEnum, closeBtnFunc: () => void) => void;
@@ -8,7 +8,7 @@
8
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
- export 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");
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';
@@ -1,14 +1,23 @@
1
+ type CreateModalProps = {
2
+ device: any;
3
+ url: string;
4
+ widthPadding?: number;
5
+ loadingConfig?: {
6
+ theme?: string;
7
+ backgroundPrimary?: string;
8
+ };
9
+ showCloseOnLoading: boolean;
10
+ onCloseOnLoading: () => void;
11
+ textDirection: 'ltr' | 'rtl';
12
+ };
1
13
  export declare const createCustomSheet: (curTheme?: 'dark' | 'light') => void;
2
14
  export declare const renderPopupLoading: (container: HTMLDivElement, curTheme: 'dark' | 'light') => void;
3
15
  export declare const removePopupLoading: (isShowMockup?: boolean) => void;
4
16
  export declare const insertStyleSheet: () => void;
5
- export declare function createCloseIcon(onClose: () => void): HTMLDivElement;
6
- export declare const createModal: ({ device, url, widthPadding, loadingConfig, showCloseOnLoading, onCloseOnLoading }: {
7
- device: any;
8
- url: any;
9
- widthPadding: any;
10
- loadingConfig: any;
11
- showCloseOnLoading: any;
12
- onCloseOnLoading: any;
13
- }) => Promise<HTMLIFrameElement>;
17
+ export declare function createCloseIcon({ onClose, textDirection, }: {
18
+ onClose: () => void;
19
+ textDirection: 'ltr' | 'rtl';
20
+ }): HTMLDivElement;
21
+ export declare const createModal: ({ device, url, loadingConfig, showCloseOnLoading, onCloseOnLoading, textDirection, }: CreateModalProps) => Promise<HTMLIFrameElement>;
14
22
  export declare const destroyModal: () => void;
23
+ export {};
@@ -1,6 +1,5 @@
1
1
  import { AMSPOPUP_PREFIX, ANIMATION_TIME, MOCKUP_ID, POPUPLOADING_ID } from "../constant";
2
2
  import { getDesignFontSize } from "../util";
3
-
4
3
  // CSS样式字符串
5
4
  var modalStyles = "\n .".concat(AMSPOPUP_PREFIX, "modal {\n /* \u6DFB\u52A0\u5F39\u7A97\u6837\u5F0F */\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999; /* \u8BBE\u7F6E\u5F39\u7A97\u7684\u5C42\u7EA7\u4E3A 9999 */\n overflow: hidden;\n }\n .").concat(AMSPOPUP_PREFIX, "modal-mobile{\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n bottom: 0;\n left: 0%;\n z-index: 9999; /* \u8BBE\u7F6E\u5F39\u7A97\u7684\u5C42\u7EA7\u4E3A 9999 */\n overflow: hidden;\n }\n\n .").concat(AMSPOPUP_PREFIX, "overlay {\n /* \u6DFB\u52A0\u8499\u5C42\u6837\u5F0F */\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.4);\n z-index: 999;\n }\n\n .").concat(AMSPOPUP_PREFIX, "fadeIn {\n /* \u6DFB\u52A0\u6DE1\u5165\u52A8\u753B */\n animation: fadeIn ").concat(ANIMATION_TIME, "ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(AMSPOPUP_PREFIX, "fadeOut {\n /* \u6DFB\u52A0\u6DE1\u51FA\u52A8\u753B */\n animation: fadeOut ").concat(ANIMATION_TIME, "ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(AMSPOPUP_PREFIX, "-drawer-enter {\n animation: slideIn ").concat(ANIMATION_TIME, "ms forwards;\n }\n\n @keyframes slideIn {\n from {\n transform: translateY(100%); /* \u6ED1\u5165\u65F6\u5728\u89C6\u53E3\u5E95\u90E8\u5916 */\n opacity: 0; /* \u521D\u59CB\u900F\u660E\u5EA6\u4E3A 0 */\n }\n to {\n transform: translateY(0); /* \u6ED1\u5165\u7ED3\u675F\u65F6\u5728\u539F\u4F4D\u7F6E */\n opacity: 1; /* \u7ED3\u675F\u65F6\u900F\u660E\u5EA6\u4E3A 1 */\n }\n }\n\n /* \u62BD\u5C49\u4ECE\u5E95\u90E8\u6ED1\u51FA */\n .").concat(AMSPOPUP_PREFIX, "-drawer-exit {\n animation: slideOut ").concat(ANIMATION_TIME, "ms forwards;\n }\n\n @keyframes slideOut {\n from {\n transform: translateY(0); /* \u6ED1\u51FA\u65F6\u4ECE\u5F53\u524D\u4F4D\u7F6E\u5F00\u59CB */\n opacity: 1; /* \u521D\u59CB\u900F\u660E\u5EA6\u4E3A 1 */\n }\n to {\n transform: translateY(100%); /* \u6ED1\u51FA\u7ED3\u675F\u65F6\u5728\u89C6\u53E3\u5E95\u90E8\u5916 */\n opacity: 0; /* \u7ED3\u675F\u65F6\u900F\u660E\u5EA6\u4E3A 0 */\n }\n }\n\n /* \u5B9A\u4E49\u6DE1\u5165\u52A8\u753B */\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-webkit-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-moz-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n /* \u5B9A\u4E49\u6DE1\u51FA\u52A8\u753B */\n @keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-webkit-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-moz-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n\n.ams-component-popup-loading {\n width: 0.8em;\n height:0.8em;\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-popup-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-popup-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-popup-loading .line div:before,\n.ams-component-popup-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: black;\n border-radius: 5.3px;\n}\n.ams-component-popup-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-popup-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-popup-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-popup-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-popup-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");
6
5
  var getCurrentTheme = function getCurrentTheme() {
@@ -47,10 +46,16 @@ export var insertStyleSheet = function insertStyleSheet() {
47
46
  style.innerHTML = modalStyles;
48
47
  document.head.appendChild(style);
49
48
  };
50
- export function createCloseIcon(onClose) {
49
+ export function createCloseIcon(_ref) {
50
+ var onClose = _ref.onClose,
51
+ textDirection = _ref.textDirection;
51
52
  var closeIcon = document.createElement('div');
52
53
  closeIcon.style.position = 'absolute';
53
- closeIcon.style.right = '16px';
54
+ if (textDirection === 'rtl') {
55
+ closeIcon.style.left = '16px';
56
+ } else {
57
+ closeIcon.style.right = '16px';
58
+ }
54
59
  closeIcon.style.top = '23px';
55
60
  closeIcon.style.cursor = 'pointer';
56
61
  var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
@@ -71,13 +76,14 @@ export function createCloseIcon(onClose) {
71
76
  var modalDevice = 'desktop';
72
77
  // 插入弹窗
73
78
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
74
- export var createModal = function createModal(_ref) {
75
- var device = _ref.device,
76
- url = _ref.url,
77
- widthPadding = _ref.widthPadding,
78
- loadingConfig = _ref.loadingConfig,
79
- showCloseOnLoading = _ref.showCloseOnLoading,
80
- onCloseOnLoading = _ref.onCloseOnLoading;
79
+ export var createModal = function createModal(_ref2) {
80
+ var device = _ref2.device,
81
+ url = _ref2.url,
82
+ loadingConfig = _ref2.loadingConfig,
83
+ showCloseOnLoading = _ref2.showCloseOnLoading,
84
+ onCloseOnLoading = _ref2.onCloseOnLoading,
85
+ _ref2$textDirection = _ref2.textDirection,
86
+ textDirection = _ref2$textDirection === void 0 ? 'ltr' : _ref2$textDirection;
81
87
  return new Promise(function (resolve, reject) {
82
88
  try {
83
89
  modalDevice = device;
@@ -95,6 +101,7 @@ export var createModal = function createModal(_ref) {
95
101
  modal.style.height = '80vh';
96
102
  modal.style.borderRadius = '12px 12px 0 0';
97
103
  }
104
+ modal.setAttribute('dir', textDirection);
98
105
  var iframe = document.createElement('iframe');
99
106
  iframe.src = url; // 替换为实际的 URL 地址
100
107
  iframe.style.border = 'none';
@@ -113,7 +120,10 @@ export var createModal = function createModal(_ref) {
113
120
 
114
121
  // 弹窗渲染loading时关闭按钮逻辑
115
122
  if (showCloseOnLoading) {
116
- var closeIcon = createCloseIcon(onCloseOnLoading);
123
+ var closeIcon = createCloseIcon({
124
+ onClose: onCloseOnLoading,
125
+ textDirection: textDirection
126
+ });
117
127
  modal.appendChild(closeIcon);
118
128
  iframe.addEventListener('load', function () {
119
129
  modal.removeChild(closeIcon);
@@ -6,10 +6,10 @@ export declare const sdkVersion: string;
6
6
  * @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
7
7
  * TODO 这里考虑直接换成packagejson.version
8
8
  */
9
- export declare const AMSCheckoutAppVersion = "1.43.0";
10
- export declare const AMSAutoDebitAppVersion = "1.43.0";
11
- export declare const AMSEasyPayAppVersion = "1.43.0";
12
- export declare const AMSCashierPaymentAppVersion = "1.43.0";
13
- export declare const AMSVaultingAppVersion = "1.43.0";
14
- export declare const AMSPaymentElementAppVersion = "1.43.0";
15
- export declare const ADDRESSElementAppVersion = "1.43.0";
9
+ export declare const AMSCheckoutAppVersion = "1.42.1";
10
+ export declare const AMSAutoDebitAppVersion = "1.42.1";
11
+ export declare const AMSEasyPayAppVersion = "1.42.1";
12
+ export declare const AMSCashierPaymentAppVersion = "1.42.1";
13
+ export declare const AMSVaultingAppVersion = "1.42.1";
14
+ export declare const AMSPaymentElementAppVersion = "1.42.1";
15
+ export declare const ADDRESSElementAppVersion = "1.42.1";
@@ -36,10 +36,10 @@ export var sdkVersion = json.version;
36
36
  * @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
37
37
  * TODO 这里考虑直接换成packagejson.version
38
38
  */
39
- export var AMSCheckoutAppVersion = '1.43.0'; // 兜底版本号
40
- export var AMSAutoDebitAppVersion = '1.43.0'; // 代扣
41
- export var AMSEasyPayAppVersion = '1.43.0'; // easypay
42
- export var AMSCashierPaymentAppVersion = '1.43.0'; // 收银台(卡、apm)
43
- export var AMSVaultingAppVersion = '1.43.0'; // 绑卡
44
- export var AMSPaymentElementAppVersion = '1.43.0'; // payment element
45
- export var ADDRESSElementAppVersion = '1.43.0'; // address element
39
+ export var AMSCheckoutAppVersion = '1.42.1'; // 兜底版本号
40
+ export var AMSAutoDebitAppVersion = '1.42.1'; // 代扣
41
+ export var AMSEasyPayAppVersion = '1.42.1'; // easypay
42
+ export var AMSCashierPaymentAppVersion = '1.42.1'; // 收银台(卡、apm)
43
+ export var AMSVaultingAppVersion = '1.42.1'; // 绑卡
44
+ export var AMSPaymentElementAppVersion = '1.42.1'; // payment element
45
+ export var ADDRESSElementAppVersion = '1.42.1'; // address element
@@ -249,15 +249,6 @@ export declare const EVENT: {
249
249
  messageForward: {
250
250
  name: string;
251
251
  };
252
- validateFieldsResult: {
253
- name: string;
254
- uniqueKey: string;
255
- };
256
- };
257
- export declare const SENDEVENT: {
258
- validateFields: {
259
- name: string;
260
- };
261
252
  };
262
253
  export declare const COMPONENT_CONTAINER_ID = "ams-component-container";
263
254
  export declare const COMPONENT_SECTION_ID = "ams-component-section";
@@ -250,17 +250,6 @@ export var EVENT = {
250
250
  */
251
251
  messageForward: {
252
252
  name: 'onMessageForward'
253
- },
254
- validateFieldsResult: {
255
- name: 'validateFieldsResult',
256
- uniqueKey: 'uservalidateFieldsResult'
257
- }
258
- };
259
-
260
- // 2025.09新增,非全量SDK发送事件码
261
- export var SENDEVENT = {
262
- validateFields: {
263
- name: 'validateFields'
264
253
  }
265
254
  };
266
255
  export var COMPONENT_CONTAINER_ID = 'ams-component-container';
@@ -1,5 +1,5 @@
1
1
  import ComponentApp from '../../plugin/component';
2
- import { ComponentSignEnum, EventPayloadContext, IappendIframeNodesParams, IcreateComponent, IoptionsParams, IPaymentSessionMetaData, Iselector, Isubmit, PaymentMethodTypeEnum, SubPaymentMethodTypeEnum, ValidationResult } from '../../types';
2
+ import { ComponentSignEnum, IappendIframeNodesParams, IcreateComponent, IoptionsParams, IPaymentSessionMetaData, Iselector, Isubmit, PaymentMethodTypeEnum, SubPaymentMethodTypeEnum } from '../../types';
3
3
  import CoreInstance from '../instance/index';
4
4
  export declare const getComponentSign: (params: IPaymentSessionMetaData) => ComponentSignEnum;
5
5
  export declare const parseSessionData: (sessionData: string) => [IPaymentSessionMetaData, string];
@@ -52,6 +52,4 @@ export declare class AMSComponent extends CoreInstance {
52
52
  * @param data - Transfer information in the submission interface according to your requirements (optional)
53
53
  */
54
54
  submit(data?: Isubmit): Promise<unknown>;
55
- protected _validateFields(): Promise<ValidationResult>;
56
- protected _sendMessageToAPP(eventContext: EventPayloadContext): void;
57
55
  }
@@ -35,7 +35,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
35
35
  * 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.
36
36
  */
37
37
  import { v4 as uuid } from 'uuid';
38
- import { COMPONENTPLUGINID, ERRORMESSAGE, EVENT, SENDEVENT } from "../../constant";
38
+ import { COMPONENTPLUGINID, ERRORMESSAGE, EVENT } from "../../constant";
39
39
  import { ApplePayBusSubscriber } from "../../plugin/applepay";
40
40
  import ComponentApp from "../../plugin/component";
41
41
  import { ExtendPlugin } from "../../plugin/const";
@@ -526,88 +526,6 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
526
526
  }
527
527
  });
528
528
  }
529
-
530
- // 预留给AMSVaulting复用
531
- }, {
532
- key: "_validateFields",
533
- value: function _validateFields() {
534
- var _this9 = this;
535
- return new Promise(function (resolve) {
536
- // 收银台应用渲染表单后,才允许发送校验消息,三端约定一致
537
- if (!_this9._componentApp.shouldValidateFields()) {
538
- resolve({
539
- isValid: false
540
- });
541
- _this9.logger.logInfo({
542
- title: 'sdk_event_validateFields'
543
- }, {
544
- processResult: 'notRenderComponent'
545
- });
546
- return;
547
- }
548
- var timeoutId;
549
- var validationPromise = new Promise(function (validationResolve) {
550
- // 发送validateFields消息
551
- _this9._sendMessageToAPP({
552
- event: SENDEVENT.validateFields.name,
553
- data: {}
554
- });
555
- // 接收收银台应用的返回validateFieldsResult消息
556
- _this9._overrideSubscription(EVENT.validateFieldsResult.name, /*#__PURE__*/function () {
557
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(payload) {
558
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
559
- while (1) switch (_context2.prev = _context2.next) {
560
- case 0:
561
- _this9.logger.logInfo({
562
- title: 'sdk_event_validateFields'
563
- }, {
564
- processResult: payload.isValid ? 'true' : 'false'
565
- });
566
- // 收银台应用保证数据格式,三端SDK负责透传
567
- validationResolve(payload);
568
- case 2:
569
- case "end":
570
- return _context2.stop();
571
- }
572
- }, _callee2);
573
- }));
574
- return function (_x2) {
575
- return _ref5.apply(this, arguments);
576
- };
577
- }(), EVENT.validateFieldsResult.uniqueKey);
578
- });
579
-
580
- // 兜底场景,三端约定超时时间15秒,兼容cpf网络校验超时场景
581
- var timeoutPromise = new Promise(function (timeoutResolve) {
582
- timeoutId = setTimeout(function () {
583
- _this9.logger.logInfo({
584
- title: 'sdk_event_validateFields'
585
- }, {
586
- processResult: 'timeout'
587
- });
588
- timeoutResolve({
589
- isValid: false
590
- });
591
- }, 15000);
592
- });
593
- Promise.race([validationPromise, timeoutPromise]).then(function (result) {
594
- clearTimeout(timeoutId);
595
- resolve(result);
596
- }).catch(function () {
597
- clearTimeout(timeoutId);
598
- resolve({
599
- isValid: false
600
- });
601
- });
602
- });
603
- }
604
- }, {
605
- key: "_sendMessageToAPP",
606
- value: function _sendMessageToAPP(eventContext) {
607
- this._componentApp.dispatchToApp({
608
- context: eventContext
609
- });
610
- }
611
529
  }]);
612
530
  return AMSComponent;
613
531
  }(CoreInstance);
@@ -6,6 +6,11 @@ export type IPopUpParams = {
6
6
  platform: PlatformEnum;
7
7
  showCloseOnLoading: boolean;
8
8
  onCloseOnLoading: () => void;
9
+ textDirection?: 'ltr' | 'rtl';
10
+ loadingConfig?: {
11
+ theme?: string;
12
+ backgroundPrimary?: string;
13
+ };
9
14
  };
10
15
  /**
11
16
  * @author 谦彧 <zhangmian.zm@alipay.com>
@@ -15,6 +20,12 @@ export declare class PopupManager {
15
20
  private popupUrlQuery;
16
21
  popupApp: HTMLIFrameElement;
17
22
  setPopupUrlQuery(queryParams: string): void;
23
+ /**
24
+ * 合并URL参数, 优先加载弹窗参数作为基准, 用baseUrl参数覆盖弹窗参数
25
+ * @param baseUrl 基础URL
26
+ * @returns 合并后的URL
27
+ */
28
+ private mergeUrlParams;
18
29
  popup(data: IPopUpParams): Promise<void>;
19
30
  pop(): void;
20
31
  }
@@ -25,6 +25,26 @@ export var PopupManager = /*#__PURE__*/function () {
25
25
  value: function setPopupUrlQuery(queryParams) {
26
26
  this.popupUrlQuery = queryParams;
27
27
  }
28
+ /**
29
+ * 合并URL参数, 优先加载弹窗参数作为基准, 用baseUrl参数覆盖弹窗参数
30
+ * @param baseUrl 基础URL
31
+ * @returns 合并后的URL
32
+ */
33
+ }, {
34
+ key: "mergeUrlParams",
35
+ value: function mergeUrlParams(baseUrl) {
36
+ var urlObj = new URL(baseUrl);
37
+ // 优先加载弹窗参数作为基准
38
+ var mergedParams = new URLSearchParams(this.popupUrlQuery.replace(/^(?:\?|%3F)/i, ''));
39
+ // 用baseUrl参数覆盖弹窗参数(set方法自动覆盖)
40
+ urlObj.searchParams.forEach(function (value, key) {
41
+ mergedParams.set(key, value);
42
+ });
43
+ // 将合并后的参数设置到URL对象中
44
+ urlObj.search = mergedParams.toString();
45
+ // 返回合并后的URL
46
+ return urlObj.toString();
47
+ }
28
48
  }, {
29
49
  key: "popup",
30
50
  value: function () {
@@ -45,7 +65,7 @@ export var PopupManager = /*#__PURE__*/function () {
45
65
  pageUrl = data.url;
46
66
  _context.prev = 6;
47
67
  if (this.popupUrlQuery) {
48
- pageUrl = data.url.includes('?') ? "".concat(data.url, "&").concat(this.popupUrlQuery) : "".concat(data.url, "?").concat(this.popupUrlQuery);
68
+ pageUrl = this.mergeUrlParams(data.url);
49
69
  }
50
70
  isLoad = false;
51
71
  _context.next = 11;
@@ -55,7 +75,8 @@ export var PopupManager = /*#__PURE__*/function () {
55
75
  url: pageUrl,
56
76
  loadingConfig: undefined,
57
77
  showCloseOnLoading: data.showCloseOnLoading,
58
- onCloseOnLoading: data.onCloseOnLoading
78
+ onCloseOnLoading: data.onCloseOnLoading,
79
+ textDirection: data === null || data === void 0 ? void 0 : data.textDirection
59
80
  });
60
81
  case 11:
61
82
  this.popupApp = _context.sent;
package/esm/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { AddressComponent } from './core/component/address';
2
2
  import { ElementComponent } from './core/component/element';
3
3
  import { AMSComponent } from './core/component/index';
4
- import { ComponentSignEnum, IcreateComponent, IElementOptions, IoptionsAddressParams, IoptionsParams, IPreloadOptions, ValidationResult } from './types';
4
+ import { ComponentSignEnum, IcreateComponent, IElementOptions, IoptionsAddressParams, IoptionsParams, IPreloadOptions } from './types';
5
5
  export { AMSCheckoutPage } from './core/component/ckp';
6
6
  export * from './types';
7
7
  export declare class AMSCheckout extends AMSComponent {
@@ -14,15 +14,6 @@ export declare class AMSAutoDebitPay extends AMSCheckout {
14
14
  export declare class AMSCashierPayment extends AMSCheckout {
15
15
  constructor(options: IoptionsParams);
16
16
  static preload(options?: IPreloadOptions): void;
17
- /**
18
- * Form validation function
19
- * If the form is currently displayed:
20
- * - Successful validation: isValid is true
21
- * - Failed validation: isValid is false, and error messages are displayed on the form page
22
- * If not on the form display page, isValid returns false
23
- * @returns {Promise<ValidationResult>} Returns a Promise containing the validation result
24
- */
25
- validateFields(): Promise<ValidationResult>;
26
17
  }
27
18
  export declare class AMSVaulting extends AMSCheckout {
28
19
  constructor(options: IoptionsParams);
package/esm/index.js CHANGED
@@ -111,21 +111,7 @@ export var AMSCashierPayment = /*#__PURE__*/function (_AMSCheckout2) {
111
111
  }
112
112
  return _super3.call(this, _options, currentChannelType);
113
113
  }
114
- _createClass(AMSCashierPayment, [{
115
- key: "validateFields",
116
- value:
117
- /**
118
- * Form validation function
119
- * If the form is currently displayed:
120
- * - Successful validation: isValid is true
121
- * - Failed validation: isValid is false, and error messages are displayed on the form page
122
- * If not on the form display page, isValid returns false
123
- * @returns {Promise<ValidationResult>} Returns a Promise containing the validation result
124
- */
125
- function validateFields() {
126
- return this._validateFields();
127
- }
128
- }], [{
114
+ _createClass(AMSCashierPayment, null, [{
129
115
  key: "preload",
130
116
  value: function preload() {
131
117
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
@@ -28,7 +28,6 @@ export default class ComponentApp {
28
28
  private _isAppWebview;
29
29
  _merchantAppointParam: IMerchantAppointParam;
30
30
  private _webAppHeartBeatTimeoutFn;
31
- private _hasRenderComponent;
32
31
  constructor(componentOption?: {
33
32
  appVersion?: string;
34
33
  });
@@ -127,6 +126,5 @@ export default class ComponentApp {
127
126
  private showRetentionPopup;
128
127
  private hideRetentionPopupFunc;
129
128
  private submitForm;
130
- shouldValidateFields(): boolean;
131
129
  }
132
130
  export {};
@@ -62,7 +62,6 @@ var ComponentApp = /*#__PURE__*/function () {
62
62
  _defineProperty(this, "_isAppWebview", void 0);
63
63
  _defineProperty(this, "_merchantAppointParam", void 0);
64
64
  _defineProperty(this, "_webAppHeartBeatTimeoutFn", void 0);
65
- _defineProperty(this, "_hasRenderComponent", false);
66
65
  this._appVersion = componentOption.appVersion;
67
66
  this._isInitComponent = false;
68
67
  this._selector = "#".concat(COMPONENT_SECTION_ID);
@@ -1843,7 +1842,6 @@ var ComponentApp = /*#__PURE__*/function () {
1843
1842
  return this._actionSubmitPromise;
1844
1843
  case 9:
1845
1844
  submitRes = _context8.sent;
1846
- this._hasRenderComponent = true;
1847
1845
  this._performanceData.push({
1848
1846
  key: 'sdk_render_component',
1849
1847
  value: Date.now()
@@ -1899,16 +1897,16 @@ var ComponentApp = /*#__PURE__*/function () {
1899
1897
  }
1900
1898
  });
1901
1899
  // eslint-disable-next-line no-empty
1902
- _context8.next = 19;
1900
+ _context8.next = 18;
1903
1901
  break;
1904
- case 17:
1905
- _context8.prev = 17;
1902
+ case 16:
1903
+ _context8.prev = 16;
1906
1904
  _context8.t0 = _context8["catch"](0);
1907
- case 19:
1905
+ case 18:
1908
1906
  case "end":
1909
1907
  return _context8.stop();
1910
1908
  }
1911
- }, _callee8, this, [[0, 17]]);
1909
+ }, _callee8, this, [[0, 16]]);
1912
1910
  }));
1913
1911
  function sendRenderEvent() {
1914
1912
  return _sendRenderEvent.apply(this, arguments);
@@ -1935,7 +1933,6 @@ var ComponentApp = /*#__PURE__*/function () {
1935
1933
  this._performanceData = [];
1936
1934
  this._isInitComponent = false;
1937
1935
  this.app = null;
1938
- this._hasRenderComponent = false;
1939
1936
  if (immediately) this.cleanElement();else {
1940
1937
  setTimeout(function () {
1941
1938
  _this10.cleanElement();
@@ -2022,11 +2019,6 @@ var ComponentApp = /*#__PURE__*/function () {
2022
2019
  form.submit();
2023
2020
  }, 0);
2024
2021
  }
2025
- }, {
2026
- key: "shouldValidateFields",
2027
- value: function shouldValidateFields() {
2028
- return this._hasRenderComponent;
2029
- }
2030
2022
  }]);
2031
2023
  return ComponentApp;
2032
2024
  }();
@@ -82,7 +82,7 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
82
82
  }
83
83
  return Promise.resolve(paypalPluginProps);
84
84
  });
85
- // 加载paypal资源 TODO
85
+ // 加载paypal资源
86
86
  _defineProperty(_assertThisInitialized(_this), "loadPaypalResource", function (paypalPluginProps) {
87
87
  return new Promise(function (resolve, reject) {
88
88
  var _paypalPluginProps$ap;
@@ -265,7 +265,6 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
265
265
  return _ref6.apply(this, arguments);
266
266
  };
267
267
  }());
268
- // TODO
269
268
  _defineProperty(_assertThisInitialized(_this), "destroyComponent", /*#__PURE__*/function () {
270
269
  var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(context, message) {
271
270
  var data;
@@ -374,9 +373,7 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
374
373
  }
375
374
  }, {
376
375
  key: "onMessage",
377
- value:
378
- // TODO
379
- function onMessage(context, message) {
376
+ value: function onMessage(context, message) {
380
377
  switch (message.getAction()) {
381
378
  case PaypalActionEnum.mountComponent:
382
379
  this.renderPaypalButton(context, message);
@@ -40,9 +40,6 @@ export interface IoptionsParams {
40
40
  mode?: string;
41
41
  securityRegion?: 'US' | 'SG' | 'DE';
42
42
  }
43
- export interface ValidationResult {
44
- isValid: boolean;
45
- }
46
43
  export interface IPreloadOptions {
47
44
  environment?: string;
48
45
  securityRegion?: 'US' | 'SG' | 'DE';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "0.0.1756987734-dev.1",
3
+ "version": "0.0.1757298389-dev.0",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",
@@ -21,7 +21,7 @@
21
21
  "dev": "father dev",
22
22
  "format": "prettier --write --no-error-on-unmatched-pattern \"**/*.{js,jsx,ts,tsx,md,json,css,less}\"",
23
23
  "lint": "eslint ./src",
24
- "test": "jest --coverage --silent",
24
+ "test": "jest --silent",
25
25
  "tsc": "tsc --noEmit"
26
26
  },
27
27
  "commitlint": {