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.cjs
CHANGED
@@ -724,6 +724,11 @@ const item = {
|
|
724
724
|
pathArr: [0],
|
725
725
|
positionY: 0
|
726
726
|
};
|
727
|
+
const popupInit = {
|
728
|
+
id: '',
|
729
|
+
duration: 0,
|
730
|
+
name: 'none'
|
731
|
+
};
|
727
732
|
const EditorContext = React.createContext({
|
728
733
|
resolver: {},
|
729
734
|
currentNode: null,
|
@@ -743,12 +748,8 @@ const EditorContext = React.createContext({
|
|
743
748
|
prePiontData: [],
|
744
749
|
undoStack: [item],
|
745
750
|
redoStack: [],
|
746
|
-
popup:
|
747
|
-
setPopup: () => { }
|
748
|
-
popupAni: {
|
749
|
-
name: 'none',
|
750
|
-
duration: 0
|
751
|
-
}
|
751
|
+
popup: popupInit,
|
752
|
+
setPopup: () => { }
|
752
753
|
});
|
753
754
|
const EditorCore = React.forwardRef(({ children, resolver, isSsr, schema, enableDataSource = true, utmVal }, ref) => {
|
754
755
|
const [currentNode, setCurrentNode] = React.useState(null);
|
@@ -771,25 +772,10 @@ const EditorCore = React.forwardRef(({ children, resolver, isSsr, schema, enable
|
|
771
772
|
*/
|
772
773
|
const [undoStack, setUndoStack] = React.useState([[item]]);
|
773
774
|
const [redoStack, setRedoStack] = React.useState([]);
|
774
|
-
const [popup, setPopup] = React.useState(
|
775
|
-
const [popupAni, setPopupAni] = React.useState({
|
776
|
-
name: 'none',
|
777
|
-
duration: 0
|
778
|
-
});
|
775
|
+
const [popup, setPopup] = React.useState(popupInit);
|
779
776
|
typeof window !== 'undefined' &&
|
780
777
|
(window.sxpPopup = (type, aniType) => {
|
781
|
-
|
782
|
-
setPopupAni(Object.assign(Object.assign({}, popupAni), aniType));
|
783
|
-
}
|
784
|
-
else {
|
785
|
-
setPopupAni({
|
786
|
-
name: 'none',
|
787
|
-
duration: 0
|
788
|
-
});
|
789
|
-
}
|
790
|
-
setTimeout(() => {
|
791
|
-
setPopup(type);
|
792
|
-
});
|
778
|
+
setPopup(Object.assign(Object.assign(Object.assign({}, popupInit), { id: type }), aniType));
|
793
779
|
});
|
794
780
|
typeof window !== 'undefined' &&
|
795
781
|
(window.getJointUtmLink = (url) => {
|
@@ -865,8 +851,7 @@ const EditorCore = React.forwardRef(({ children, resolver, isSsr, schema, enable
|
|
865
851
|
setUndoStack,
|
866
852
|
getCurPageConf,
|
867
853
|
popup,
|
868
|
-
setPopup
|
869
|
-
popupAni
|
854
|
+
setPopup
|
870
855
|
} },
|
871
856
|
React.createElement(DataSourceProvider$1, { isSsr: isSsr, enable: enableDataSource }, children)));
|
872
857
|
});
|
@@ -1005,7 +990,6 @@ var settingRender$5 = [
|
|
1005
990
|
|
1006
991
|
const AppointForm$1 = (_a) => {
|
1007
992
|
var { columns, style, title, textStyle, submitBgColor, submitColor, submitText, layoutType, onClick } = _a, props = __rest(_a, ["columns", "style", "title", "textStyle", "submitBgColor", "submitColor", "submitText", "layoutType", "onClick"]);
|
1008
|
-
useEditor();
|
1009
993
|
const { submitForm } = useSxpDataSource();
|
1010
994
|
const formRef = React.useRef();
|
1011
995
|
const [loading, setLoading] = React.useState(false);
|
@@ -8102,7 +8086,7 @@ SwiperSlide.displayName = 'SwiperSlide';
|
|
8102
8086
|
* @Author: binruan@chatlabs.com
|
8103
8087
|
* @Date: 2024-03-12 10:59:06
|
8104
8088
|
* @LastEditors: binruan@chatlabs.com
|
8105
|
-
* @LastEditTime: 2024-
|
8089
|
+
* @LastEditTime: 2024-04-11 22:30:45
|
8106
8090
|
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
8107
8091
|
*
|
8108
8092
|
*/
|
@@ -8126,23 +8110,25 @@ function useEventReport() {
|
|
8126
8110
|
else if (data === null || data === void 0 ? void 0 : data.product) {
|
8127
8111
|
fromKName = 'productPage';
|
8128
8112
|
}
|
8129
|
-
|
8130
|
-
|
8131
|
-
|
8132
|
-
|
8133
|
-
|
8134
|
-
|
8135
|
-
|
8136
|
-
|
8137
|
-
|
8138
|
-
|
8139
|
-
|
8140
|
-
|
8141
|
-
|
8142
|
-
|
8143
|
-
|
8144
|
-
|
8145
|
-
|
8113
|
+
if (product === null || product === void 0 ? void 0 : product.price) {
|
8114
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
8115
|
+
eventInfo: {
|
8116
|
+
eventSubject: 'jumpToWeb',
|
8117
|
+
eventDescription: 'User jumped to website',
|
8118
|
+
productId: (_h = product === null || product === void 0 ? void 0 : product.itemId) !== null && _h !== void 0 ? _h : '',
|
8119
|
+
productName: (_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : '',
|
8120
|
+
price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0',
|
8121
|
+
productCollection: (_k = product === null || product === void 0 ? void 0 : product.collection) !== null && _k !== void 0 ? _k : '',
|
8122
|
+
fromKName,
|
8123
|
+
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
8124
|
+
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
8125
|
+
position: (data === null || data === void 0 ? void 0 : data.position) + '',
|
8126
|
+
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 : '',
|
8127
|
+
relatedCtatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
|
8128
|
+
traceInfo: (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : ''
|
8129
|
+
}
|
8130
|
+
});
|
8131
|
+
}
|
8146
8132
|
}, [bffEventReport, popupDetailData, isFromHashtag]);
|
8147
8133
|
const productView = React.useCallback((data, product, cta, viewTime) => {
|
8148
8134
|
var _a, _b, _c, _d;
|
@@ -8153,24 +8139,26 @@ function useEventReport() {
|
|
8153
8139
|
else if (data === null || data === void 0 ? void 0 : data.product) {
|
8154
8140
|
fromKName = 'productPage';
|
8155
8141
|
}
|
8156
|
-
|
8157
|
-
|
8158
|
-
|
8159
|
-
|
8160
|
-
|
8161
|
-
|
8162
|
-
|
8163
|
-
|
8164
|
-
|
8165
|
-
|
8166
|
-
|
8167
|
-
|
8168
|
-
|
8169
|
-
|
8170
|
-
|
8171
|
-
|
8172
|
-
|
8173
|
-
|
8142
|
+
if (product === null || product === void 0 ? void 0 : product.price) {
|
8143
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
8144
|
+
eventInfo: {
|
8145
|
+
productId: product === null || product === void 0 ? void 0 : product.itemId,
|
8146
|
+
productName: product === null || product === void 0 ? void 0 : product.title,
|
8147
|
+
price: (product === null || product === void 0 ? void 0 : product.price) + '',
|
8148
|
+
productCollection: product === null || product === void 0 ? void 0 : product.collection,
|
8149
|
+
fromKName,
|
8150
|
+
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
8151
|
+
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
8152
|
+
position: (data === null || data === void 0 ? void 0 : data.position) + '',
|
8153
|
+
relatedContentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
8154
|
+
relatedCtatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
8155
|
+
traceInfo: product === null || product === void 0 ? void 0 : product.traceInfo,
|
8156
|
+
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
8157
|
+
eventSubject: 'productView',
|
8158
|
+
eventDescription: 'User browsed the product'
|
8159
|
+
}
|
8160
|
+
});
|
8161
|
+
}
|
8174
8162
|
}, [bffEventReport, popupDetailData]);
|
8175
8163
|
return {
|
8176
8164
|
jumpToWeb,
|
@@ -8182,14 +8170,13 @@ function useEventReport() {
|
|
8182
8170
|
* @Author: binruan@chatlabs.com
|
8183
8171
|
* @Date: 2023-11-02 18:34:34
|
8184
8172
|
* @LastEditors: binruan@chatlabs.com
|
8185
|
-
* @LastEditTime: 2024-04-
|
8173
|
+
* @LastEditTime: 2024-04-12 11:23:00
|
8186
8174
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
|
8187
8175
|
*
|
8188
8176
|
*/
|
8189
8177
|
const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
8190
|
-
const Modal = ({ visible, onClose, children, modalStyle, padding,
|
8191
|
-
|
8192
|
-
const cssAni = popupAniData !== null && popupAniData !== void 0 ? popupAniData : popupAni;
|
8178
|
+
const Modal = ({ visible, onClose, children, modalStyle, padding, popup }) => {
|
8179
|
+
var _a;
|
8193
8180
|
const [isShow, setIsShow] = React.useState(false);
|
8194
8181
|
const modalEleRef = React.useRef(null);
|
8195
8182
|
React.useEffect(() => {
|
@@ -8204,29 +8191,32 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popupAniData }
|
|
8204
8191
|
parentNode === null || parentNode === void 0 ? void 0 : parentNode.appendChild(modalEleRef.current);
|
8205
8192
|
}
|
8206
8193
|
}, []);
|
8194
|
+
const isOpen = React.useMemo(() => {
|
8195
|
+
return ((popup === null || popup === void 0 ? void 0 : popup.id) && (popup === null || popup === void 0 ? void 0 : popup.id) !== '') || visible;
|
8196
|
+
}, [visible, popup]);
|
8207
8197
|
React.useEffect(() => {
|
8208
|
-
if (
|
8198
|
+
if (isOpen) {
|
8209
8199
|
setIsShow(true);
|
8210
8200
|
}
|
8211
8201
|
else {
|
8212
8202
|
setTimeout(() => {
|
8213
8203
|
setIsShow(false);
|
8214
|
-
},
|
8204
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
8215
8205
|
}
|
8216
|
-
}, [
|
8206
|
+
}, [isOpen, popup]);
|
8217
8207
|
if (!modalEleRef.current)
|
8218
8208
|
return null;
|
8219
8209
|
const handleClose = lodash.debounce(() => {
|
8220
8210
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
8221
8211
|
}, 300);
|
8222
|
-
return ReactDOM__namespace.createPortal(React.createElement("div", { className: 'modal-bg', style: Object.assign({ display:
|
8223
|
-
React.createElement("div", { className: `modal-container ${
|
8212
|
+
return ReactDOM__namespace.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 },
|
8213
|
+
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) => {
|
8224
8214
|
e.stopPropagation();
|
8225
8215
|
e.preventDefault();
|
8226
8216
|
} },
|
8227
8217
|
React.createElement("div", { onClick: onClose, className: 'modal-icon-wrapper' },
|
8228
8218
|
React.createElement("img", { src: closeIcon, alt: 'close', className: 'modal-icon' })),
|
8229
|
-
children)), modalEleRef.current);
|
8219
|
+
children)))), modalEleRef.current);
|
8230
8220
|
};
|
8231
8221
|
var Modal$1 = React.memo(Modal);
|
8232
8222
|
|
@@ -8532,7 +8522,6 @@ const getMediaValueByMode = (obj) => {
|
|
8532
8522
|
|
8533
8523
|
const Prompt$1 = (_a) => {
|
8534
8524
|
var { content, btnText, style, icon, onClick } = _a, props = __rest(_a, ["content", "btnText", "style", "icon", "onClick"]);
|
8535
|
-
useEditor();
|
8536
8525
|
const iconSrc = typeof icon === 'string' ? icon : getMediaValueByMode(icon);
|
8537
8526
|
const handleOk = () => {
|
8538
8527
|
window === null || window === void 0 ? void 0 : window.sxpPopup('');
|
@@ -9184,7 +9173,7 @@ const EventProvider = (_a) => {
|
|
9184
9173
|
var { rec, children, className, onClick, style, isExternalLink = false } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink"]);
|
9185
9174
|
const ref = React.useRef(null);
|
9186
9175
|
const isOnScreen = useOnScreen(ref);
|
9187
|
-
const {
|
9176
|
+
const { popup } = useEditor();
|
9188
9177
|
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
9189
9178
|
const { jumpToWeb } = useEventReport();
|
9190
9179
|
React.useEffect(() => {
|
@@ -9216,7 +9205,7 @@ const EventProvider = (_a) => {
|
|
9216
9205
|
else {
|
9217
9206
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9218
9207
|
}
|
9219
|
-
},
|
9208
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
9220
9209
|
return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
|
9221
9210
|
};
|
9222
9211
|
var EventProvider$1 = React.memo(EventProvider);
|
@@ -9684,7 +9673,7 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
9684
9673
|
var _b, _c;
|
9685
9674
|
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
9686
9675
|
const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
|
9687
|
-
const {
|
9676
|
+
const { popup } = useEditor();
|
9688
9677
|
const { jumpToWeb } = useEventReport();
|
9689
9678
|
const [products, setProducts] = React.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]);
|
9690
9679
|
const handleClick = lodash.throttle((item) => {
|
@@ -9702,7 +9691,7 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
9702
9691
|
else {
|
9703
9692
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9704
9693
|
}
|
9705
|
-
},
|
9694
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
9706
9695
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
9707
9696
|
var _a, _b, _c, _d, _e, _f;
|
9708
9697
|
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.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
@@ -9797,7 +9786,7 @@ const MultiCommodity$1 = (_a) => {
|
|
9797
9786
|
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
9798
9787
|
const { sxpParameter } = useSxpDataSource();
|
9799
9788
|
const { ctaEvent, setPopupDetailData } = useSxpDataSource();
|
9800
|
-
const {
|
9789
|
+
const { popup } = useEditor();
|
9801
9790
|
const [products, setProducts] = React.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]);
|
9802
9791
|
const { jumpToWeb } = useEventReport();
|
9803
9792
|
const handleClick = lodash.throttle((item) => {
|
@@ -9815,7 +9804,7 @@ const MultiCommodity$1 = (_a) => {
|
|
9815
9804
|
else {
|
9816
9805
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9817
9806
|
}
|
9818
|
-
},
|
9807
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
9819
9808
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
9820
9809
|
var _a, _b, _c, _d, _e, _f;
|
9821
9810
|
return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item.itemId, className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
@@ -9909,7 +9898,7 @@ const MultiCommodityDiroNew$1 = (_a) => {
|
|
9909
9898
|
var _b, _c;
|
9910
9899
|
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
9911
9900
|
const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
|
9912
|
-
const {
|
9901
|
+
const { popup } = useEditor();
|
9913
9902
|
const { jumpToWeb } = useEventReport();
|
9914
9903
|
const [products, setProducts] = React.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]);
|
9915
9904
|
const handleClick = lodash.throttle((item) => {
|
@@ -9927,7 +9916,7 @@ const MultiCommodityDiroNew$1 = (_a) => {
|
|
9927
9916
|
else {
|
9928
9917
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9929
9918
|
}
|
9930
|
-
},
|
9919
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
9931
9920
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
9932
9921
|
var _a, _b, _c, _d, _e, _f;
|
9933
9922
|
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.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
@@ -11683,7 +11672,7 @@ var img$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeA
|
|
11683
11672
|
* @Author: binruan@chatlabs.com
|
11684
11673
|
* @Date: 2024-01-10 10:58:24
|
11685
11674
|
* @LastEditors: binruan@chatlabs.com
|
11686
|
-
* @LastEditTime: 2024-04-
|
11675
|
+
* @LastEditTime: 2024-04-12 11:29:01
|
11687
11676
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
11688
11677
|
*
|
11689
11678
|
*/
|
@@ -11747,7 +11736,7 @@ const WaterFall = (props) => {
|
|
11747
11736
|
relatedContentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
11748
11737
|
position: rec === null || rec === void 0 ? void 0 : rec.position,
|
11749
11738
|
contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
|
11750
|
-
traceInfo:
|
11739
|
+
traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
|
11751
11740
|
hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
|
11752
11741
|
fromKName,
|
11753
11742
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
@@ -12851,15 +12840,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12851
12840
|
* @Author: binruan@chatlabs.com
|
12852
12841
|
* @Date: 2023-10-31 10:56:01
|
12853
12842
|
* @LastEditors: binruan@chatlabs.com
|
12854
|
-
* @LastEditTime: 2024-04-
|
12843
|
+
* @LastEditTime: 2024-04-12 09:50:58
|
12855
12844
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
|
12856
12845
|
*
|
12857
12846
|
*/
|
12858
12847
|
const Popup = () => {
|
12859
|
-
const { schema, resolver, popup
|
12848
|
+
const { schema, resolver, popup } = useEditor();
|
12860
12849
|
const { setPopupDetailData, popupDetailData, bffEventReport } = useSxpDataSource();
|
12861
12850
|
const { productView } = useEventReport();
|
12862
|
-
const [visible, setVisible] = React.useState(
|
12851
|
+
const [visible, setVisible] = React.useState();
|
12863
12852
|
const curTimeRef = React.useRef(null);
|
12864
12853
|
React.useEffect(() => {
|
12865
12854
|
const initTime = () => {
|
@@ -12872,33 +12861,33 @@ const Popup = () => {
|
|
12872
12861
|
};
|
12873
12862
|
}, []);
|
12874
12863
|
React.useEffect(() => {
|
12875
|
-
if (popup && popup !== '') {
|
12864
|
+
if (popup && (popup === null || popup === void 0 ? void 0 : popup.id) && (popup === null || popup === void 0 ? void 0 : popup.id) !== '') {
|
12876
12865
|
curTimeRef.current = new Date();
|
12877
|
-
setVisible(
|
12866
|
+
setVisible(popup);
|
12878
12867
|
}
|
12879
12868
|
}, [popup]);
|
12880
12869
|
const handleClose = () => {
|
12881
|
-
var _a, _b, _c;
|
12882
|
-
if (!popup || popup === '' || !visible || new Date() - curTimeRef.current < (
|
12870
|
+
var _a, _b, _c, _d;
|
12871
|
+
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)) {
|
12883
12872
|
return;
|
12884
12873
|
}
|
12885
|
-
setVisible(
|
12874
|
+
setVisible(Object.assign(Object.assign({}, popup), { id: '' }));
|
12886
12875
|
const data = popupDetailData;
|
12887
|
-
const product = (
|
12888
|
-
const cta = (
|
12876
|
+
const product = (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
12877
|
+
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;
|
12889
12878
|
if (product && cta) {
|
12890
12879
|
productView(data, product, cta, curTimeRef.current);
|
12891
12880
|
}
|
12892
12881
|
setTimeout(() => {
|
12893
12882
|
window === null || window === void 0 ? void 0 : window.sxpPopup('');
|
12894
12883
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(null);
|
12895
|
-
},
|
12884
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
12896
12885
|
};
|
12897
12886
|
const renderPopupDetail = React.useMemo(() => {
|
12898
12887
|
var _a, _b, _c;
|
12899
12888
|
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) => {
|
12900
12889
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
12901
|
-
if ((value === null || value === void 0 ? void 0 : value.id) === popup) {
|
12890
|
+
if ((value === null || value === void 0 ? void 0 : value.id) === (popup === null || popup === void 0 ? void 0 : popup.id)) {
|
12902
12891
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
12903
12892
|
const Component = withBindDataSource(t);
|
12904
12893
|
const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
|
@@ -12909,7 +12898,7 @@ const Popup = () => {
|
|
12909
12898
|
}
|
12910
12899
|
});
|
12911
12900
|
}, [schema, popup, resolver]);
|
12912
|
-
return (React.createElement(Modal$1, {
|
12901
|
+
return (React.createElement(Modal$1, { popup: visible, onClose: handleClose, padding: 0, modalStyle: { position: 'fixed' } }, renderPopupDetail));
|
12913
12902
|
};
|
12914
12903
|
|
12915
12904
|
/*
|