pb-sxp-ui 1.0.4 → 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 +93 -107
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +93 -107
- 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 +93 -107
- 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 +4 -5
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +4 -5
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +4 -5
- package/es/materials/sxp/template/components/EventProvider.js +4 -4
- 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 +4 -5
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +4 -5
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +4 -5
- package/lib/materials/sxp/template/components/EventProvider.js +4 -4
- 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(() => {
|
@@ -9183,17 +9172,17 @@ const EventProvider = (_a) => {
|
|
9183
9172
|
}, rec, item);
|
9184
9173
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(rec);
|
9185
9174
|
if (isExternalLink) {
|
9186
|
-
if ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.
|
9175
|
+
if ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.link) {
|
9187
9176
|
const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
|
9188
9177
|
const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
9189
9178
|
jumpToWeb(rec, product, cta);
|
9190
|
-
window.location.href = (_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.
|
9179
|
+
window.location.href = (_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.link;
|
9191
9180
|
}
|
9192
9181
|
}
|
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,26 +9650,25 @@ 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) => {
|
9668
|
-
var _a;
|
9669
9657
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9670
9658
|
eventSubject: 'clickCta',
|
9671
9659
|
eventDescription: 'User clicked the CTA'
|
9672
9660
|
}, recData, item);
|
9673
9661
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }) }));
|
9674
9662
|
if (isExternalLink) {
|
9675
|
-
if (
|
9663
|
+
if (item === null || item === void 0 ? void 0 : item.link) {
|
9676
9664
|
jumpToWeb(recData, item, item.bindCta);
|
9677
|
-
window.location.href = item.
|
9665
|
+
window.location.href = item.link;
|
9678
9666
|
}
|
9679
9667
|
}
|
9680
9668
|
else {
|
9681
9669
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9682
9670
|
}
|
9683
|
-
},
|
9671
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
9684
9672
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
9685
9673
|
var _a, _b, _c, _d, _e, _f;
|
9686
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) }),
|
@@ -9775,26 +9763,25 @@ const MultiCommodity$1 = (_a) => {
|
|
9775
9763
|
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
9776
9764
|
const { sxpParameter } = useSxpDataSource();
|
9777
9765
|
const { ctaEvent, setPopupDetailData } = useSxpDataSource();
|
9778
|
-
const {
|
9766
|
+
const { popup } = useEditor();
|
9779
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]);
|
9780
9768
|
const { jumpToWeb } = useEventReport();
|
9781
9769
|
const handleClick = throttle((item) => {
|
9782
|
-
var _a;
|
9783
9770
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9784
9771
|
eventSubject: 'clickCta',
|
9785
9772
|
eventDescription: 'User clicked the CTA'
|
9786
9773
|
}, recData, item);
|
9787
9774
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }) }));
|
9788
9775
|
if (isExternalLink) {
|
9789
|
-
if (
|
9776
|
+
if (item === null || item === void 0 ? void 0 : item.link) {
|
9790
9777
|
jumpToWeb(recData, item, item.bindCta);
|
9791
|
-
window.location.href = item.
|
9778
|
+
window.location.href = item.link;
|
9792
9779
|
}
|
9793
9780
|
}
|
9794
9781
|
else {
|
9795
9782
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9796
9783
|
}
|
9797
|
-
},
|
9784
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
9798
9785
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
9799
9786
|
var _a, _b, _c, _d, _e, _f;
|
9800
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) }),
|
@@ -9888,26 +9875,25 @@ const MultiCommodityDiroNew$1 = (_a) => {
|
|
9888
9875
|
var _b, _c;
|
9889
9876
|
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
9890
9877
|
const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
|
9891
|
-
const {
|
9878
|
+
const { popup } = useEditor();
|
9892
9879
|
const { jumpToWeb } = useEventReport();
|
9893
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]);
|
9894
9881
|
const handleClick = throttle((item) => {
|
9895
|
-
var _a;
|
9896
9882
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9897
9883
|
eventSubject: 'clickCta',
|
9898
9884
|
eventDescription: 'User clicked the CTA'
|
9899
9885
|
}, recData, item);
|
9900
9886
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }) }));
|
9901
9887
|
if (isExternalLink) {
|
9902
|
-
if (
|
9888
|
+
if (item === null || item === void 0 ? void 0 : item.link) {
|
9903
9889
|
jumpToWeb(recData, item, item.bindCta);
|
9904
|
-
window.location.href = item.
|
9890
|
+
window.location.href = item.link;
|
9905
9891
|
}
|
9906
9892
|
}
|
9907
9893
|
else {
|
9908
9894
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9909
9895
|
}
|
9910
|
-
},
|
9896
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
9911
9897
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
9912
9898
|
var _a, _b, _c, _d, _e, _f;
|
9913
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) }),
|
@@ -11663,7 +11649,7 @@ var img$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeA
|
|
11663
11649
|
* @Author: binruan@chatlabs.com
|
11664
11650
|
* @Date: 2024-01-10 10:58:24
|
11665
11651
|
* @LastEditors: binruan@chatlabs.com
|
11666
|
-
* @LastEditTime: 2024-04-
|
11652
|
+
* @LastEditTime: 2024-04-12 11:29:01
|
11667
11653
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
11668
11654
|
*
|
11669
11655
|
*/
|
@@ -11727,7 +11713,7 @@ const WaterFall = (props) => {
|
|
11727
11713
|
relatedContentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
11728
11714
|
position: rec === null || rec === void 0 ? void 0 : rec.position,
|
11729
11715
|
contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
|
11730
|
-
traceInfo:
|
11716
|
+
traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
|
11731
11717
|
hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
|
11732
11718
|
fromKName,
|
11733
11719
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
@@ -12831,15 +12817,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12831
12817
|
* @Author: binruan@chatlabs.com
|
12832
12818
|
* @Date: 2023-10-31 10:56:01
|
12833
12819
|
* @LastEditors: binruan@chatlabs.com
|
12834
|
-
* @LastEditTime: 2024-04-
|
12820
|
+
* @LastEditTime: 2024-04-12 09:50:58
|
12835
12821
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
|
12836
12822
|
*
|
12837
12823
|
*/
|
12838
12824
|
const Popup = () => {
|
12839
|
-
const { schema, resolver, popup
|
12825
|
+
const { schema, resolver, popup } = useEditor();
|
12840
12826
|
const { setPopupDetailData, popupDetailData, bffEventReport } = useSxpDataSource();
|
12841
12827
|
const { productView } = useEventReport();
|
12842
|
-
const [visible, setVisible] = useState(
|
12828
|
+
const [visible, setVisible] = useState();
|
12843
12829
|
const curTimeRef = useRef(null);
|
12844
12830
|
useEffect(() => {
|
12845
12831
|
const initTime = () => {
|
@@ -12852,33 +12838,33 @@ const Popup = () => {
|
|
12852
12838
|
};
|
12853
12839
|
}, []);
|
12854
12840
|
useEffect(() => {
|
12855
|
-
if (popup && popup !== '') {
|
12841
|
+
if (popup && (popup === null || popup === void 0 ? void 0 : popup.id) && (popup === null || popup === void 0 ? void 0 : popup.id) !== '') {
|
12856
12842
|
curTimeRef.current = new Date();
|
12857
|
-
setVisible(
|
12843
|
+
setVisible(popup);
|
12858
12844
|
}
|
12859
12845
|
}, [popup]);
|
12860
12846
|
const handleClose = () => {
|
12861
|
-
var _a, _b, _c;
|
12862
|
-
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)) {
|
12863
12849
|
return;
|
12864
12850
|
}
|
12865
|
-
setVisible(
|
12851
|
+
setVisible(Object.assign(Object.assign({}, popup), { id: '' }));
|
12866
12852
|
const data = popupDetailData;
|
12867
|
-
const product = (
|
12868
|
-
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;
|
12869
12855
|
if (product && cta) {
|
12870
12856
|
productView(data, product, cta, curTimeRef.current);
|
12871
12857
|
}
|
12872
12858
|
setTimeout(() => {
|
12873
12859
|
window === null || window === void 0 ? void 0 : window.sxpPopup('');
|
12874
12860
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(null);
|
12875
|
-
},
|
12861
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
12876
12862
|
};
|
12877
12863
|
const renderPopupDetail = useMemo(() => {
|
12878
12864
|
var _a, _b, _c;
|
12879
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) => {
|
12880
12866
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
12881
|
-
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)) {
|
12882
12868
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
12883
12869
|
const Component = withBindDataSource(t);
|
12884
12870
|
const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
|
@@ -12889,7 +12875,7 @@ const Popup = () => {
|
|
12889
12875
|
}
|
12890
12876
|
});
|
12891
12877
|
}, [schema, popup, resolver]);
|
12892
|
-
return (React.createElement(Modal$1, {
|
12878
|
+
return (React.createElement(Modal$1, { popup: visible, onClose: handleClose, padding: 0, modalStyle: { position: 'fixed' } }, renderPopupDetail));
|
12893
12879
|
};
|
12894
12880
|
|
12895
12881
|
/*
|