pb-sxp-ui 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +85 -96
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +85 -96
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +85 -96
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/Modal/index.d.ts +2 -2
- package/es/core/components/SxpPageRender/Modal/index.js +12 -11
- package/es/core/components/SxpPageRender/Popup/index.js +12 -12
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +3 -4
- package/es/core/components/SxpPageRender/WaterFall/index.js +1 -1
- package/es/core/context/EditorContext.d.ts +7 -5
- package/es/core/context/EditorContext.js +10 -25
- package/es/core/hooks/useEventReport.js +39 -35
- package/es/materials/sxp/popup/AppointForm/index.js +1 -2
- package/es/materials/sxp/popup/Prompt/index.js +0 -2
- package/es/materials/sxp/template/MultiCommodity/index.js +2 -2
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +2 -2
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +2 -2
- package/es/materials/sxp/template/components/EventProvider.js +2 -2
- package/lib/core/components/SxpPageRender/Modal/index.d.ts +2 -2
- package/lib/core/components/SxpPageRender/Modal/index.js +11 -10
- package/lib/core/components/SxpPageRender/Popup/index.js +12 -12
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +2 -3
- package/lib/core/components/SxpPageRender/WaterFall/index.js +1 -1
- package/lib/core/context/EditorContext.d.ts +7 -5
- package/lib/core/context/EditorContext.js +10 -25
- package/lib/core/hooks/useEventReport.js +39 -35
- package/lib/materials/sxp/popup/AppointForm/index.js +0 -1
- package/lib/materials/sxp/popup/Prompt/index.js +0 -2
- package/lib/materials/sxp/template/MultiCommodity/index.js +2 -2
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +2 -2
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +2 -2
- package/lib/materials/sxp/template/components/EventProvider.js +2 -2
- package/package.json +1 -1
- package/es/core/components/SxpPageRender/ProductInfo/index.d.ts +0 -14
- package/es/core/components/SxpPageRender/ProductInfo/index.js +0 -55
- package/lib/core/components/SxpPageRender/ProductInfo/index.d.ts +0 -14
- package/lib/core/components/SxpPageRender/ProductInfo/index.js +0 -58
package/dist/index.js
CHANGED
@@ -701,6 +701,11 @@ const item = {
|
|
701
701
|
pathArr: [0],
|
702
702
|
positionY: 0
|
703
703
|
};
|
704
|
+
const popupInit = {
|
705
|
+
id: '',
|
706
|
+
duration: 0,
|
707
|
+
name: 'none'
|
708
|
+
};
|
704
709
|
const EditorContext = React.createContext({
|
705
710
|
resolver: {},
|
706
711
|
currentNode: null,
|
@@ -720,12 +725,8 @@ const EditorContext = React.createContext({
|
|
720
725
|
prePiontData: [],
|
721
726
|
undoStack: [item],
|
722
727
|
redoStack: [],
|
723
|
-
popup:
|
724
|
-
setPopup: () => { }
|
725
|
-
popupAni: {
|
726
|
-
name: 'none',
|
727
|
-
duration: 0
|
728
|
-
}
|
728
|
+
popup: popupInit,
|
729
|
+
setPopup: () => { }
|
729
730
|
});
|
730
731
|
const EditorCore = forwardRef(({ children, resolver, isSsr, schema, enableDataSource = true, utmVal }, ref) => {
|
731
732
|
const [currentNode, setCurrentNode] = useState(null);
|
@@ -748,25 +749,10 @@ const EditorCore = forwardRef(({ children, resolver, isSsr, schema, enableDataSo
|
|
748
749
|
*/
|
749
750
|
const [undoStack, setUndoStack] = useState([[item]]);
|
750
751
|
const [redoStack, setRedoStack] = useState([]);
|
751
|
-
const [popup, setPopup] = useState(
|
752
|
-
const [popupAni, setPopupAni] = useState({
|
753
|
-
name: 'none',
|
754
|
-
duration: 0
|
755
|
-
});
|
752
|
+
const [popup, setPopup] = useState(popupInit);
|
756
753
|
typeof window !== 'undefined' &&
|
757
754
|
(window.sxpPopup = (type, aniType) => {
|
758
|
-
|
759
|
-
setPopupAni(Object.assign(Object.assign({}, popupAni), aniType));
|
760
|
-
}
|
761
|
-
else {
|
762
|
-
setPopupAni({
|
763
|
-
name: 'none',
|
764
|
-
duration: 0
|
765
|
-
});
|
766
|
-
}
|
767
|
-
setTimeout(() => {
|
768
|
-
setPopup(type);
|
769
|
-
});
|
755
|
+
setPopup(Object.assign(Object.assign(Object.assign({}, popupInit), { id: type }), aniType));
|
770
756
|
});
|
771
757
|
typeof window !== 'undefined' &&
|
772
758
|
(window.getJointUtmLink = (url) => {
|
@@ -842,8 +828,7 @@ const EditorCore = forwardRef(({ children, resolver, isSsr, schema, enableDataSo
|
|
842
828
|
setUndoStack,
|
843
829
|
getCurPageConf,
|
844
830
|
popup,
|
845
|
-
setPopup
|
846
|
-
popupAni
|
831
|
+
setPopup
|
847
832
|
} },
|
848
833
|
React.createElement(DataSourceProvider$1, { isSsr: isSsr, enable: enableDataSource }, children)));
|
849
834
|
});
|
@@ -982,7 +967,6 @@ var settingRender$5 = [
|
|
982
967
|
|
983
968
|
const AppointForm$1 = (_a) => {
|
984
969
|
var { columns, style, title, textStyle, submitBgColor, submitColor, submitText, layoutType, onClick } = _a, props = __rest(_a, ["columns", "style", "title", "textStyle", "submitBgColor", "submitColor", "submitText", "layoutType", "onClick"]);
|
985
|
-
useEditor();
|
986
970
|
const { submitForm } = useSxpDataSource();
|
987
971
|
const formRef = useRef();
|
988
972
|
const [loading, setLoading] = useState(false);
|
@@ -8079,7 +8063,7 @@ SwiperSlide.displayName = 'SwiperSlide';
|
|
8079
8063
|
* @Author: binruan@chatlabs.com
|
8080
8064
|
* @Date: 2024-03-12 10:59:06
|
8081
8065
|
* @LastEditors: binruan@chatlabs.com
|
8082
|
-
* @LastEditTime: 2024-
|
8066
|
+
* @LastEditTime: 2024-04-11 22:30:45
|
8083
8067
|
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
8084
8068
|
*
|
8085
8069
|
*/
|
@@ -8103,23 +8087,25 @@ function useEventReport() {
|
|
8103
8087
|
else if (data === null || data === void 0 ? void 0 : data.product) {
|
8104
8088
|
fromKName = 'productPage';
|
8105
8089
|
}
|
8106
|
-
|
8107
|
-
|
8108
|
-
|
8109
|
-
|
8110
|
-
|
8111
|
-
|
8112
|
-
|
8113
|
-
|
8114
|
-
|
8115
|
-
|
8116
|
-
|
8117
|
-
|
8118
|
-
|
8119
|
-
|
8120
|
-
|
8121
|
-
|
8122
|
-
|
8090
|
+
if (product === null || product === void 0 ? void 0 : product.price) {
|
8091
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
8092
|
+
eventInfo: {
|
8093
|
+
eventSubject: 'jumpToWeb',
|
8094
|
+
eventDescription: 'User jumped to website',
|
8095
|
+
productId: (_h = product === null || product === void 0 ? void 0 : product.itemId) !== null && _h !== void 0 ? _h : '',
|
8096
|
+
productName: (_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : '',
|
8097
|
+
price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0',
|
8098
|
+
productCollection: (_k = product === null || product === void 0 ? void 0 : product.collection) !== null && _k !== void 0 ? _k : '',
|
8099
|
+
fromKName,
|
8100
|
+
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
8101
|
+
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
8102
|
+
position: (data === null || data === void 0 ? void 0 : data.position) + '',
|
8103
|
+
relatedContentId: (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
|
8104
|
+
relatedCtatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
|
8105
|
+
traceInfo: (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : ''
|
8106
|
+
}
|
8107
|
+
});
|
8108
|
+
}
|
8123
8109
|
}, [bffEventReport, popupDetailData, isFromHashtag]);
|
8124
8110
|
const productView = useCallback((data, product, cta, viewTime) => {
|
8125
8111
|
var _a, _b, _c, _d;
|
@@ -8130,24 +8116,26 @@ function useEventReport() {
|
|
8130
8116
|
else if (data === null || data === void 0 ? void 0 : data.product) {
|
8131
8117
|
fromKName = 'productPage';
|
8132
8118
|
}
|
8133
|
-
|
8134
|
-
|
8135
|
-
|
8136
|
-
|
8137
|
-
|
8138
|
-
|
8139
|
-
|
8140
|
-
|
8141
|
-
|
8142
|
-
|
8143
|
-
|
8144
|
-
|
8145
|
-
|
8146
|
-
|
8147
|
-
|
8148
|
-
|
8149
|
-
|
8150
|
-
|
8119
|
+
if (product === null || product === void 0 ? void 0 : product.price) {
|
8120
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
8121
|
+
eventInfo: {
|
8122
|
+
productId: product === null || product === void 0 ? void 0 : product.itemId,
|
8123
|
+
productName: product === null || product === void 0 ? void 0 : product.title,
|
8124
|
+
price: (product === null || product === void 0 ? void 0 : product.price) + '',
|
8125
|
+
productCollection: product === null || product === void 0 ? void 0 : product.collection,
|
8126
|
+
fromKName,
|
8127
|
+
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
8128
|
+
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
8129
|
+
position: (data === null || data === void 0 ? void 0 : data.position) + '',
|
8130
|
+
relatedContentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
8131
|
+
relatedCtatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
8132
|
+
traceInfo: product === null || product === void 0 ? void 0 : product.traceInfo,
|
8133
|
+
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
8134
|
+
eventSubject: 'productView',
|
8135
|
+
eventDescription: 'User browsed the product'
|
8136
|
+
}
|
8137
|
+
});
|
8138
|
+
}
|
8151
8139
|
}, [bffEventReport, popupDetailData]);
|
8152
8140
|
return {
|
8153
8141
|
jumpToWeb,
|
@@ -8159,14 +8147,13 @@ function useEventReport() {
|
|
8159
8147
|
* @Author: binruan@chatlabs.com
|
8160
8148
|
* @Date: 2023-11-02 18:34:34
|
8161
8149
|
* @LastEditors: binruan@chatlabs.com
|
8162
|
-
* @LastEditTime: 2024-04-
|
8150
|
+
* @LastEditTime: 2024-04-12 11:23:00
|
8163
8151
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
|
8164
8152
|
*
|
8165
8153
|
*/
|
8166
8154
|
const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
8167
|
-
const Modal = ({ visible, onClose, children, modalStyle, padding,
|
8168
|
-
|
8169
|
-
const cssAni = popupAniData !== null && popupAniData !== void 0 ? popupAniData : popupAni;
|
8155
|
+
const Modal = ({ visible, onClose, children, modalStyle, padding, popup }) => {
|
8156
|
+
var _a;
|
8170
8157
|
const [isShow, setIsShow] = useState(false);
|
8171
8158
|
const modalEleRef = useRef(null);
|
8172
8159
|
useEffect(() => {
|
@@ -8181,29 +8168,32 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popupAniData }
|
|
8181
8168
|
parentNode === null || parentNode === void 0 ? void 0 : parentNode.appendChild(modalEleRef.current);
|
8182
8169
|
}
|
8183
8170
|
}, []);
|
8171
|
+
const isOpen = useMemo(() => {
|
8172
|
+
return ((popup === null || popup === void 0 ? void 0 : popup.id) && (popup === null || popup === void 0 ? void 0 : popup.id) !== '') || visible;
|
8173
|
+
}, [visible, popup]);
|
8184
8174
|
useEffect(() => {
|
8185
|
-
if (
|
8175
|
+
if (isOpen) {
|
8186
8176
|
setIsShow(true);
|
8187
8177
|
}
|
8188
8178
|
else {
|
8189
8179
|
setTimeout(() => {
|
8190
8180
|
setIsShow(false);
|
8191
|
-
},
|
8181
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
8192
8182
|
}
|
8193
|
-
}, [
|
8183
|
+
}, [isOpen, popup]);
|
8194
8184
|
if (!modalEleRef.current)
|
8195
8185
|
return null;
|
8196
8186
|
const handleClose = debounce(() => {
|
8197
8187
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
8198
8188
|
}, 300);
|
8199
|
-
return ReactDOM.createPortal(React.createElement("div", { className: 'modal-bg', style: Object.assign({ display:
|
8200
|
-
React.createElement("div", { className: `modal-container ${
|
8189
|
+
return ReactDOM.createPortal(React.createElement(React.Fragment, null, isShow && (React.createElement("div", { className: 'modal-bg', style: Object.assign({ display: 'flex', backgroundColor: isOpen ? 'rgba(0, 0, 0, 0.7)' : 'rgba(0, 0, 0, 0)' }, modalStyle), onClick: handleClose },
|
8190
|
+
React.createElement("div", { className: `modal-container ${isOpen ? 'modal-popIn' : 'modal-popOut'}`, style: { padding, animationDuration: ((_a = popup === null || popup === void 0 ? void 0 : popup.duration) !== null && _a !== void 0 ? _a : 0) / 1000 + 's' }, onClick: (e) => {
|
8201
8191
|
e.stopPropagation();
|
8202
8192
|
e.preventDefault();
|
8203
8193
|
} },
|
8204
8194
|
React.createElement("div", { onClick: onClose, className: 'modal-icon-wrapper' },
|
8205
8195
|
React.createElement("img", { src: closeIcon, alt: 'close', className: 'modal-icon' })),
|
8206
|
-
children)), modalEleRef.current);
|
8196
|
+
children)))), modalEleRef.current);
|
8207
8197
|
};
|
8208
8198
|
var Modal$1 = memo(Modal);
|
8209
8199
|
|
@@ -8509,7 +8499,6 @@ const getMediaValueByMode = (obj) => {
|
|
8509
8499
|
|
8510
8500
|
const Prompt$1 = (_a) => {
|
8511
8501
|
var { content, btnText, style, icon, onClick } = _a, props = __rest(_a, ["content", "btnText", "style", "icon", "onClick"]);
|
8512
|
-
useEditor();
|
8513
8502
|
const iconSrc = typeof icon === 'string' ? icon : getMediaValueByMode(icon);
|
8514
8503
|
const handleOk = () => {
|
8515
8504
|
window === null || window === void 0 ? void 0 : window.sxpPopup('');
|
@@ -9161,7 +9150,7 @@ const EventProvider = (_a) => {
|
|
9161
9150
|
var { rec, children, className, onClick, style, isExternalLink = false } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink"]);
|
9162
9151
|
const ref = useRef(null);
|
9163
9152
|
const isOnScreen = useOnScreen(ref);
|
9164
|
-
const {
|
9153
|
+
const { popup } = useEditor();
|
9165
9154
|
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
9166
9155
|
const { jumpToWeb } = useEventReport();
|
9167
9156
|
useEffect(() => {
|
@@ -9193,7 +9182,7 @@ const EventProvider = (_a) => {
|
|
9193
9182
|
else {
|
9194
9183
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9195
9184
|
}
|
9196
|
-
},
|
9185
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
9197
9186
|
return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
|
9198
9187
|
};
|
9199
9188
|
var EventProvider$1 = memo(EventProvider);
|
@@ -9661,7 +9650,7 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
9661
9650
|
var _b, _c;
|
9662
9651
|
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
9663
9652
|
const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
|
9664
|
-
const {
|
9653
|
+
const { popup } = useEditor();
|
9665
9654
|
const { jumpToWeb } = useEventReport();
|
9666
9655
|
const [products, setProducts] = useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
|
9667
9656
|
const handleClick = throttle((item) => {
|
@@ -9679,7 +9668,7 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
9679
9668
|
else {
|
9680
9669
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9681
9670
|
}
|
9682
|
-
},
|
9671
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
9683
9672
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
9684
9673
|
var _a, _b, _c, _d, _e, _f;
|
9685
9674
|
return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item === null || item === void 0 ? void 0 : item.itemId, className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
@@ -9774,7 +9763,7 @@ const MultiCommodity$1 = (_a) => {
|
|
9774
9763
|
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
9775
9764
|
const { sxpParameter } = useSxpDataSource();
|
9776
9765
|
const { ctaEvent, setPopupDetailData } = useSxpDataSource();
|
9777
|
-
const {
|
9766
|
+
const { popup } = useEditor();
|
9778
9767
|
const [products, setProducts] = useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
|
9779
9768
|
const { jumpToWeb } = useEventReport();
|
9780
9769
|
const handleClick = throttle((item) => {
|
@@ -9792,7 +9781,7 @@ const MultiCommodity$1 = (_a) => {
|
|
9792
9781
|
else {
|
9793
9782
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9794
9783
|
}
|
9795
|
-
},
|
9784
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
9796
9785
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
9797
9786
|
var _a, _b, _c, _d, _e, _f;
|
9798
9787
|
return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item.itemId, className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
@@ -9886,7 +9875,7 @@ const MultiCommodityDiroNew$1 = (_a) => {
|
|
9886
9875
|
var _b, _c;
|
9887
9876
|
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
9888
9877
|
const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
|
9889
|
-
const {
|
9878
|
+
const { popup } = useEditor();
|
9890
9879
|
const { jumpToWeb } = useEventReport();
|
9891
9880
|
const [products, setProducts] = useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
|
9892
9881
|
const handleClick = throttle((item) => {
|
@@ -9904,7 +9893,7 @@ const MultiCommodityDiroNew$1 = (_a) => {
|
|
9904
9893
|
else {
|
9905
9894
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9906
9895
|
}
|
9907
|
-
},
|
9896
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
9908
9897
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
9909
9898
|
var _a, _b, _c, _d, _e, _f;
|
9910
9899
|
return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item === null || item === void 0 ? void 0 : item.itemId, className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
@@ -11660,7 +11649,7 @@ var img$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeA
|
|
11660
11649
|
* @Author: binruan@chatlabs.com
|
11661
11650
|
* @Date: 2024-01-10 10:58:24
|
11662
11651
|
* @LastEditors: binruan@chatlabs.com
|
11663
|
-
* @LastEditTime: 2024-04-
|
11652
|
+
* @LastEditTime: 2024-04-12 11:29:01
|
11664
11653
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
11665
11654
|
*
|
11666
11655
|
*/
|
@@ -11724,7 +11713,7 @@ const WaterFall = (props) => {
|
|
11724
11713
|
relatedContentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
11725
11714
|
position: rec === null || rec === void 0 ? void 0 : rec.position,
|
11726
11715
|
contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
|
11727
|
-
traceInfo:
|
11716
|
+
traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
|
11728
11717
|
hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
|
11729
11718
|
fromKName,
|
11730
11719
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
@@ -12828,15 +12817,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12828
12817
|
* @Author: binruan@chatlabs.com
|
12829
12818
|
* @Date: 2023-10-31 10:56:01
|
12830
12819
|
* @LastEditors: binruan@chatlabs.com
|
12831
|
-
* @LastEditTime: 2024-04-
|
12820
|
+
* @LastEditTime: 2024-04-12 09:50:58
|
12832
12821
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
|
12833
12822
|
*
|
12834
12823
|
*/
|
12835
12824
|
const Popup = () => {
|
12836
|
-
const { schema, resolver, popup
|
12825
|
+
const { schema, resolver, popup } = useEditor();
|
12837
12826
|
const { setPopupDetailData, popupDetailData, bffEventReport } = useSxpDataSource();
|
12838
12827
|
const { productView } = useEventReport();
|
12839
|
-
const [visible, setVisible] = useState(
|
12828
|
+
const [visible, setVisible] = useState();
|
12840
12829
|
const curTimeRef = useRef(null);
|
12841
12830
|
useEffect(() => {
|
12842
12831
|
const initTime = () => {
|
@@ -12849,33 +12838,33 @@ const Popup = () => {
|
|
12849
12838
|
};
|
12850
12839
|
}, []);
|
12851
12840
|
useEffect(() => {
|
12852
|
-
if (popup && popup !== '') {
|
12841
|
+
if (popup && (popup === null || popup === void 0 ? void 0 : popup.id) && (popup === null || popup === void 0 ? void 0 : popup.id) !== '') {
|
12853
12842
|
curTimeRef.current = new Date();
|
12854
|
-
setVisible(
|
12843
|
+
setVisible(popup);
|
12855
12844
|
}
|
12856
12845
|
}, [popup]);
|
12857
12846
|
const handleClose = () => {
|
12858
|
-
var _a, _b, _c;
|
12859
|
-
if (!popup || popup === '' || !visible || new Date() - curTimeRef.current < (
|
12847
|
+
var _a, _b, _c, _d;
|
12848
|
+
if (!popup || (popup === null || popup === void 0 ? void 0 : popup.id) === '' || !visible || new Date() - curTimeRef.current < ((_a = popup === null || popup === void 0 ? void 0 : popup.duration) !== null && _a !== void 0 ? _a : 0)) {
|
12860
12849
|
return;
|
12861
12850
|
}
|
12862
|
-
setVisible(
|
12851
|
+
setVisible(Object.assign(Object.assign({}, popup), { id: '' }));
|
12863
12852
|
const data = popupDetailData;
|
12864
|
-
const product = (
|
12865
|
-
const cta = (
|
12853
|
+
const product = (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
12854
|
+
const cta = (_d = (_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.bindCta;
|
12866
12855
|
if (product && cta) {
|
12867
12856
|
productView(data, product, cta, curTimeRef.current);
|
12868
12857
|
}
|
12869
12858
|
setTimeout(() => {
|
12870
12859
|
window === null || window === void 0 ? void 0 : window.sxpPopup('');
|
12871
12860
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(null);
|
12872
|
-
},
|
12861
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
12873
12862
|
};
|
12874
12863
|
const renderPopupDetail = useMemo(() => {
|
12875
12864
|
var _a, _b, _c;
|
12876
12865
|
return (_c = (_b = (_a = schema === null || schema === void 0 ? void 0 : schema.sxpPageConf) === null || _a === void 0 ? void 0 : _a.globalConfig) === null || _b === void 0 ? void 0 : _b.popupList) === null || _c === void 0 ? void 0 : _c.map((value, index) => {
|
12877
12866
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
12878
|
-
if ((value === null || value === void 0 ? void 0 : value.id) === popup) {
|
12867
|
+
if ((value === null || value === void 0 ? void 0 : value.id) === (popup === null || popup === void 0 ? void 0 : popup.id)) {
|
12879
12868
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
12880
12869
|
const Component = withBindDataSource(t);
|
12881
12870
|
const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
|
@@ -12886,7 +12875,7 @@ const Popup = () => {
|
|
12886
12875
|
}
|
12887
12876
|
});
|
12888
12877
|
}, [schema, popup, resolver]);
|
12889
|
-
return (React.createElement(Modal$1, {
|
12878
|
+
return (React.createElement(Modal$1, { popup: visible, onClose: handleClose, padding: 0, modalStyle: { position: 'fixed' } }, renderPopupDetail));
|
12890
12879
|
};
|
12891
12880
|
|
12892
12881
|
/*
|