pb-sxp-ui 1.2.9 → 1.3.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.
- package/dist/index.cjs +611 -260
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +62 -2
- package/dist/index.js +611 -260
- 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 +611 -260
- 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/FormatImage.js +19 -17
- package/es/core/components/SxpPageRender/Modal/index.js +33 -20
- package/es/core/components/SxpPageRender/Popup/index.js +2 -2
- package/es/core/components/SxpPageRender/ToggleButton/index.js +4 -1
- package/es/core/components/SxpPageRender/WaterFall/List.js +5 -14
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +5 -14
- package/es/core/components/SxpPageRender/index.d.ts +6 -1
- package/es/core/components/SxpPageRender/index.js +46 -23
- package/es/core/components/SxpPageRender/typing.d.ts +2 -0
- package/es/core/context/SxpDataSourceProvider.d.ts +3 -2
- package/es/core/context/SxpDataSourceProvider.js +27 -30
- package/es/core/hooks/useEventReport.js +9 -8
- package/es/core/utils/tool.d.ts +5 -1
- package/es/core/utils/tool.js +69 -1
- package/es/materials/sxp/popup/AppointForm/settingRender.js +15 -0
- package/es/materials/sxp/popup/CommodityDetail/index.d.ts +10 -1
- package/es/materials/sxp/popup/CommodityDetail/index.js +46 -28
- package/es/materials/sxp/popup/CommodityDetail/material.js +4 -0
- package/es/materials/sxp/popup/CommodityDetail/settingRender.d.ts +21 -2
- package/es/materials/sxp/popup/CommodityDetail/settingRender.js +46 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +10 -1
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +72 -46
- package/es/materials/sxp/popup/CommodityDetailDiroNew/material.js +4 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +21 -2
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +46 -0
- package/es/materials/sxp/popup/CommodityList/settingRender.js +15 -0
- package/es/materials/sxp/popup/Iframe/index.d.ts +16 -0
- package/es/materials/sxp/popup/Iframe/index.js +18 -0
- package/es/materials/sxp/popup/Iframe/material.d.ts +2 -0
- package/es/materials/sxp/popup/Iframe/material.js +21 -0
- package/es/materials/sxp/popup/Iframe/settingRender.d.ts +9 -0
- package/es/materials/sxp/popup/Iframe/settingRender.js +12 -0
- package/es/materials/sxp/popup/Prompt/settingRender.js +16 -1
- package/es/materials/sxp/popup/index.d.ts +1 -0
- package/es/materials/sxp/popup/index.js +1 -0
- package/es/materials/sxp/template/Link/index.js +5 -11
- package/es/materials/sxp/template/Link/interactionRender.d.ts +8 -0
- package/es/materials/sxp/template/Link/interactionRender.js +11 -0
- package/es/materials/sxp/template/Link/material.js +3 -1
- package/es/materials/sxp/template/components/EventProvider.d.ts +3 -2
- package/es/materials/sxp/template/components/EventProvider.js +3 -3
- package/lib/core/components/SxpPageRender/FormatImage.js +19 -17
- package/lib/core/components/SxpPageRender/Modal/index.js +33 -20
- package/lib/core/components/SxpPageRender/Popup/index.js +2 -2
- package/lib/core/components/SxpPageRender/ToggleButton/index.js +3 -0
- package/lib/core/components/SxpPageRender/WaterFall/List.js +5 -14
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +5 -14
- package/lib/core/components/SxpPageRender/index.d.ts +6 -1
- package/lib/core/components/SxpPageRender/index.js +46 -23
- package/lib/core/components/SxpPageRender/typing.d.ts +2 -0
- package/lib/core/context/SxpDataSourceProvider.d.ts +3 -2
- package/lib/core/context/SxpDataSourceProvider.js +27 -30
- package/lib/core/hooks/useEventReport.js +9 -8
- package/lib/core/utils/tool.d.ts +5 -1
- package/lib/core/utils/tool.js +73 -1
- package/lib/materials/sxp/popup/AppointForm/settingRender.js +15 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +10 -1
- package/lib/materials/sxp/popup/CommodityDetail/index.js +46 -28
- package/lib/materials/sxp/popup/CommodityDetail/material.js +4 -0
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.d.ts +21 -2
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +46 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +10 -1
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +72 -46
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.js +4 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +21 -2
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +46 -0
- package/lib/materials/sxp/popup/CommodityList/settingRender.js +15 -0
- package/lib/materials/sxp/popup/Iframe/index.d.ts +16 -0
- package/lib/materials/sxp/popup/Iframe/index.js +20 -0
- package/lib/materials/sxp/popup/Iframe/material.d.ts +2 -0
- package/lib/materials/sxp/popup/Iframe/material.js +25 -0
- package/lib/materials/sxp/popup/Iframe/settingRender.d.ts +9 -0
- package/lib/materials/sxp/popup/Iframe/settingRender.js +14 -0
- package/lib/materials/sxp/popup/Prompt/settingRender.js +16 -1
- package/lib/materials/sxp/popup/index.d.ts +1 -0
- package/lib/materials/sxp/popup/index.js +1 -0
- package/lib/materials/sxp/template/Link/index.js +5 -11
- package/lib/materials/sxp/template/Link/interactionRender.d.ts +8 -0
- package/lib/materials/sxp/template/Link/interactionRender.js +13 -0
- package/lib/materials/sxp/template/Link/material.js +3 -1
- package/lib/materials/sxp/template/components/EventProvider.d.ts +3 -2
- package/lib/materials/sxp/template/components/EventProvider.js +3 -3
- package/package.json +1 -1
@@ -4,18 +4,20 @@ const FormatImage = forwardRef((props, ref) => {
|
|
4
4
|
const { src, onLoad, style, className, loading, alt = 'image' } = props;
|
5
5
|
const [imgSrc, setImgSrc] = useState();
|
6
6
|
const imgRef = useRef(null);
|
7
|
+
const [visible, setVisible] = useState(false);
|
7
8
|
useImperativeHandle(ref, () => ({
|
8
9
|
setSrc: (v) => {
|
9
|
-
|
10
|
+
if (v)
|
11
|
+
setImgSrc(v);
|
10
12
|
}
|
11
13
|
}));
|
12
14
|
useEffect(() => {
|
13
|
-
|
15
|
+
if (src)
|
16
|
+
setImgSrc(src);
|
14
17
|
}, [src]);
|
15
18
|
useEffect(() => {
|
16
19
|
const onShow = () => {
|
17
|
-
|
18
|
-
if (src && ((_b = (_a = imgRef === null || imgRef === void 0 ? void 0 : imgRef.current) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.display) === 'none') {
|
20
|
+
if (src && !visible && imgRef.current) {
|
19
21
|
imgRef.current.src = '';
|
20
22
|
imgRef.current.src = src;
|
21
23
|
}
|
@@ -24,19 +26,19 @@ const FormatImage = forwardRef((props, ref) => {
|
|
24
26
|
return () => {
|
25
27
|
SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
26
28
|
};
|
27
|
-
}, [src]);
|
28
|
-
return (React.createElement(React.Fragment, null,
|
29
|
-
React.createElement("
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
29
|
+
}, [src, visible]);
|
30
|
+
return (React.createElement(React.Fragment, null,
|
31
|
+
!visible && React.createElement("div", { style: { width: '100%', height: '100%', zIndex: 1, backgroundColor: '#fff' } }),
|
32
|
+
(imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc.includes('.avif')) ? (React.createElement("picture", null,
|
33
|
+
React.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
|
34
|
+
React.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}?imageMogr2/format/webp` }),
|
35
|
+
React.createElement("source", { type: 'image/jpeg', srcSet: `${imgSrc}?imageMogr2/format/jpg` }),
|
36
|
+
React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign({}, style), loading: loading, onLoad: (e) => {
|
37
|
+
setVisible(true);
|
38
|
+
onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
|
39
|
+
}, alt: alt }))) : (React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign({}, style), loading: loading, onLoad: (e) => {
|
40
|
+
setVisible(true);
|
35
41
|
onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
|
36
|
-
}, alt: alt })))
|
37
|
-
if (imgRef.current)
|
38
|
-
imgRef.current.style.display = 'block';
|
39
|
-
onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
|
40
|
-
}, alt: alt }))));
|
42
|
+
}, alt: alt }))));
|
41
43
|
});
|
42
44
|
export default memo(FormatImage);
|
@@ -4,7 +4,7 @@ import * as ReactDOM from 'react-dom';
|
|
4
4
|
import { useEditor, useSxpDataSource } from '../../../../core/hooks';
|
5
5
|
const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
6
6
|
const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema, fullHeight = window.innerHeight, isFullScreen = false }) => {
|
7
|
-
var _a, _b;
|
7
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
8
8
|
const touchRef = useRef(null);
|
9
9
|
const fTouchRef = useRef(null);
|
10
10
|
const touchMoveRef = useRef(null);
|
@@ -31,12 +31,16 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
31
31
|
const isOpen = useMemo(() => {
|
32
32
|
return ((popup === null || popup === void 0 ? void 0 : popup.id) && (popup === null || popup === void 0 ? void 0 : popup.id) !== '') || visible;
|
33
33
|
}, [visible, popup]);
|
34
|
-
const
|
35
|
-
var _a, _b, _c
|
34
|
+
const getPopupById = useMemo(() => {
|
35
|
+
var _a, _b, _c;
|
36
36
|
const schemaData = schema !== null && schema !== void 0 ? schema : _schema;
|
37
37
|
const value = (_c = (_b = (_a = schemaData === null || schemaData === void 0 ? void 0 : schemaData.sxpPageConf) === null || _a === void 0 ? void 0 : _a.globalConfig) === null || _b === void 0 ? void 0 : _b.popupList) === null || _c === void 0 ? void 0 : _c.find((value) => (value === null || value === void 0 ? void 0 : value.id) === (popup === null || popup === void 0 ? void 0 : popup.id));
|
38
|
-
return
|
38
|
+
return value;
|
39
39
|
}, [popup, schema, _schema]);
|
40
|
+
const isScrollFullScreen = useMemo(() => {
|
41
|
+
var _a, _b;
|
42
|
+
return ((_b = (_a = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _a === void 0 ? void 0 : _a.event) === null || _b === void 0 ? void 0 : _b.isScrollFullScreen) || false;
|
43
|
+
}, [getPopupById]);
|
40
44
|
useEffect(() => {
|
41
45
|
if (isOpen) {
|
42
46
|
setIsShow(true);
|
@@ -100,21 +104,30 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
100
104
|
touchMoveRef.current = false;
|
101
105
|
};
|
102
106
|
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 },
|
103
|
-
React.createElement("div",
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
107
|
+
React.createElement("div", { style: {
|
108
|
+
position: 'relative',
|
109
|
+
left: `${(_d = (_c = (_b = (_a = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.popupBg) === null || _c === void 0 ? void 0 : _c.horizontalMargin) !== null && _d !== void 0 ? _d : 0}px`,
|
110
|
+
right: `${(_h = (_g = (_f = (_e = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _e === void 0 ? void 0 : _e.props) === null || _f === void 0 ? void 0 : _f.popupBg) === null || _g === void 0 ? void 0 : _g.horizontalMargin) !== null && _h !== void 0 ? _h : 0}px`,
|
111
|
+
bottom: `${(_m = (_l = (_k = (_j = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _j === void 0 ? void 0 : _j.props) === null || _k === void 0 ? void 0 : _k.popupBg) === null || _l === void 0 ? void 0 : _l.bottomMargin) !== null && _m !== void 0 ? _m : 0}px`,
|
112
|
+
overflow: 'hidden',
|
113
|
+
width: `calc(100% - ${((_r = (_q = (_p = (_o = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _o === void 0 ? void 0 : _o.props) === null || _p === void 0 ? void 0 : _p.popupBg) === null || _q === void 0 ? void 0 : _q.horizontalMargin) !== null && _r !== void 0 ? _r : 0) * 2}px)`,
|
114
|
+
height: '100%'
|
115
|
+
} },
|
116
|
+
React.createElement("div", Object.assign({ className: `modal-container ${isOpen ? 'modal-popIn' : 'modal-popOut'}`, style: Object.assign({ padding, animationDuration: ((_s = popup === null || popup === void 0 ? void 0 : popup.duration) !== null && _s !== void 0 ? _s : 0) / 1000 + 's' }, (isScrollFullScreen && {
|
117
|
+
transform: `translateY(${modalTrans}px)`
|
118
|
+
})), onClick: (e) => {
|
119
|
+
e.stopPropagation();
|
120
|
+
e.preventDefault();
|
121
|
+
} }, (isScrollFullScreen && {
|
122
|
+
onTouchMove: handleTouchMove,
|
123
|
+
onTouchStart: handleTouchStart,
|
124
|
+
onTouchEnd: handleTouchEnd
|
125
|
+
})),
|
126
|
+
React.createElement("div", { onClick: onClose, className: 'modal-icon-wrapper' },
|
127
|
+
React.createElement("img", { src: (_t = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) !== null && _t !== void 0 ? _t : closeIcon, alt: 'close', className: 'modal-icon' })),
|
128
|
+
React.createElement("div", { ref: ref, style: {
|
129
|
+
height: isScrollFullScreen ? fullHeight : MODAL_DEF_CON_H,
|
130
|
+
overflow: (isScrollFullScreen && modalTrans <= 0) || !isScrollFullScreen ? 'auto' : 'hidden'
|
131
|
+
} }, children)))))), modalEleRef.current);
|
119
132
|
};
|
120
133
|
export default memo(Modal);
|
@@ -58,14 +58,14 @@ const Popup = () => {
|
|
58
58
|
const renderPopupDetail = useMemo(() => {
|
59
59
|
var _a, _b, _c;
|
60
60
|
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) => {
|
61
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p
|
61
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
62
62
|
if ((value === null || value === void 0 ? void 0 : value.id) === (popup === null || popup === void 0 ? void 0 : popup.id)) {
|
63
63
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
64
64
|
const Component = withBindDataSource(t);
|
65
65
|
const isExternalLink = ((_d = (_c = (_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.event) === null || _c === void 0 ? void 0 : _c.onClick) === null || _d === void 0 ? void 0 : _d.linkType) === 'externalLink';
|
66
66
|
const isPopup = ((_g = (_f = (_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.event) === null || _f === void 0 ? void 0 : _f.onClick) === null || _g === void 0 ? void 0 : _g.linkType) === 'popup';
|
67
67
|
const defaulSetting = (_h = t === null || t === void 0 ? void 0 : t.extend) === null || _h === void 0 ? void 0 : _h.defaulSetting;
|
68
|
-
return (React.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_j = value === null || value === void 0 ? void 0 : value.item) === null || _j === void 0 ? void 0 : _j.style), {
|
68
|
+
return (React.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_j = value === null || value === void 0 ? void 0 : value.item) === null || _j === void 0 ? void 0 : _j.style), { height: '100%' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_k = value === null || value === void 0 ? void 0 : value.item) === null || _k === void 0 ? void 0 : _k.textStyle), bindDatas: (_m = (_l = value === null || value === void 0 ? void 0 : value.item) === null || _l === void 0 ? void 0 : _l.bindDatas) !== null && _m !== void 0 ? _m : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_o = value === null || value === void 0 ? void 0 : value.item) === null || _o === void 0 ? void 0 : _o.props, { event: ((_p = value === null || value === void 0 ? void 0 : value.item) === null || _p === void 0 ? void 0 : _p.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, isExternalLink: isExternalLink, isPopup: isPopup, onClose: handleClose })));
|
69
69
|
}
|
70
70
|
else {
|
71
71
|
return React.createElement(React.Fragment, null);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, { memo, useState } from 'react';
|
1
|
+
import React, { memo, useEffect, useState } from 'react';
|
2
2
|
const ToggleButton = ({ defaultValue, activeIcon, unactiveIcon, onChange, style }) => {
|
3
3
|
const [isTrue, setIsTure] = useState(defaultValue);
|
4
4
|
const handleClick = (e) => {
|
@@ -7,6 +7,9 @@ const ToggleButton = ({ defaultValue, activeIcon, unactiveIcon, onChange, style
|
|
7
7
|
setIsTure(result);
|
8
8
|
onChange === null || onChange === void 0 ? void 0 : onChange(result);
|
9
9
|
};
|
10
|
+
useEffect(() => {
|
11
|
+
setIsTure(defaultValue);
|
12
|
+
}, [defaultValue]);
|
10
13
|
return (React.createElement("button", { style: style, "aria-label": 'toggle button', className: 'pb-toggle-button', onClick: handleClick },
|
11
14
|
React.createElement("img", { className: 'pb-toggle-button-icon', alt: 'toggle image', src: isTrue ? activeIcon : unactiveIcon })));
|
12
15
|
};
|
@@ -128,31 +128,22 @@ export default function WaterfallList(_a) {
|
|
128
128
|
const containerRef = useRef(null);
|
129
129
|
const [isLoadMore, setIsLoadMore] = useState(false);
|
130
130
|
const loadMoreData = useCallback(() => {
|
131
|
+
var _a, _b, _c, _d;
|
131
132
|
if (isLoadMore)
|
132
133
|
return;
|
133
134
|
setIsLoadMore(true);
|
134
135
|
waterFallData &&
|
135
|
-
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
|
136
|
-
hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
|
137
|
-
'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
|
138
|
-
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType
|
139
|
-
}).then((res) => {
|
136
|
+
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_b = (_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec) === null || _a === void 0 ? void 0 : _a.product) === null || _b === void 0 ? void 0 : _b.itemId) && { productFilter: (_d = (_c = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec) === null || _c === void 0 ? void 0 : _c.product) === null || _d === void 0 ? void 0 : _d.itemId })), ((waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId) && { contentFilter: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId }))).then((res) => {
|
140
137
|
var _a;
|
141
138
|
setList(list === null || list === void 0 ? void 0 : list.concat((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []));
|
142
139
|
setIsLoadMore(false);
|
143
140
|
}));
|
144
141
|
}, [waterFallData, getRecommendVideos, list, isLoadMore]);
|
145
142
|
useEffect(() => {
|
146
|
-
var _a, _b;
|
143
|
+
var _a, _b, _c, _d, _e, _f;
|
147
144
|
setIsLoadingData(true);
|
148
145
|
waterFallData &&
|
149
|
-
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
|
150
|
-
hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
|
151
|
-
'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
|
152
|
-
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
|
153
|
-
defaultSize: hashTagSize,
|
154
|
-
maxSize: hashTagSize
|
155
|
-
}).then((res) => {
|
146
|
+
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_b = (_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec) === null || _a === void 0 ? void 0 : _a.product) === null || _b === void 0 ? void 0 : _b.itemId) && { productFilter: (_d = (_c = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec) === null || _c === void 0 ? void 0 : _c.product) === null || _d === void 0 ? void 0 : _d.itemId })), ((waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId) && { contentFilter: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId })), { defaultSize: hashTagSize, maxSize: hashTagSize })).then((res) => {
|
156
147
|
var _a, _b;
|
157
148
|
setData(res);
|
158
149
|
setList((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : []);
|
@@ -161,7 +152,7 @@ export default function WaterfallList(_a) {
|
|
161
152
|
if (isOpenHashTag) {
|
162
153
|
const res = previewData;
|
163
154
|
setData(res);
|
164
|
-
setList((
|
155
|
+
setList((_f = (_e = res === null || res === void 0 ? void 0 : res.recList) === null || _e === void 0 ? void 0 : _e.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _f !== void 0 ? _f : []);
|
165
156
|
setIsLoadingData(false);
|
166
157
|
}
|
167
158
|
}, [waterFallData, getRecommendVideos, hashTagSize, isOpenHashTag]);
|
@@ -207,16 +207,10 @@ export default function WaterfallList(_a) {
|
|
207
207
|
styleListRef.current = getStyleList();
|
208
208
|
}, [unitWidth, rowsNum, list]);
|
209
209
|
useEffect(() => {
|
210
|
-
var _a, _b;
|
210
|
+
var _a, _b, _c, _d, _e, _f;
|
211
211
|
setIsLoadingData(true);
|
212
212
|
waterFallData &&
|
213
|
-
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
|
214
|
-
hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
|
215
|
-
'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
|
216
|
-
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
|
217
|
-
defaultSize: hashTagSize,
|
218
|
-
maxSize: hashTagSize
|
219
|
-
}).then((res) => {
|
213
|
+
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag, defaultSize: hashTagSize, maxSize: hashTagSize }, (((_b = (_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec) === null || _a === void 0 ? void 0 : _a.product) === null || _b === void 0 ? void 0 : _b.itemId) && { productFilter: (_d = (_c = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec) === null || _c === void 0 ? void 0 : _c.product) === null || _d === void 0 ? void 0 : _d.itemId })), ((waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId) && { contentFilter: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId }))).then((res) => {
|
220
214
|
var _a, _b;
|
221
215
|
setData(res);
|
222
216
|
setList((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : []);
|
@@ -225,7 +219,7 @@ export default function WaterfallList(_a) {
|
|
225
219
|
if (isOpenHashTag) {
|
226
220
|
const res = previewData;
|
227
221
|
setData(res);
|
228
|
-
setList((
|
222
|
+
setList((_f = (_e = res === null || res === void 0 ? void 0 : res.recList) === null || _e === void 0 ? void 0 : _e.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _f !== void 0 ? _f : []);
|
229
223
|
setIsLoadingData(false);
|
230
224
|
}
|
231
225
|
}, [waterFallData, getRecommendVideos, hashTagSize, isOpenHashTag]);
|
@@ -250,13 +244,10 @@ export default function WaterfallList(_a) {
|
|
250
244
|
};
|
251
245
|
}, [onResize]);
|
252
246
|
const loadMoreData = useCallback(() => {
|
247
|
+
var _a, _b, _c, _d;
|
253
248
|
setIsLoadingData(true);
|
254
249
|
waterFallData &&
|
255
|
-
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
|
256
|
-
hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
|
257
|
-
'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
|
258
|
-
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType
|
259
|
-
}).then((res) => {
|
250
|
+
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_b = (_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec) === null || _a === void 0 ? void 0 : _a.product) === null || _b === void 0 ? void 0 : _b.itemId) && { productFilter: (_d = (_c = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec) === null || _c === void 0 ? void 0 : _c.product) === null || _d === void 0 ? void 0 : _d.itemId })), ((waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId) && { contentFilter: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId }))).then((res) => {
|
260
251
|
var _a, _b;
|
261
252
|
setList(list === null || list === void 0 ? void 0 : list.concat((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => !(item === null || item === void 0 ? void 0 : item.video))) !== null && _b !== void 0 ? _b : []));
|
262
253
|
setIsLoadingData(false);
|
@@ -43,6 +43,11 @@ export interface ISxpPageRenderProps {
|
|
43
43
|
popupCloseIcon?: string;
|
44
44
|
openSlideSkip?: boolean;
|
45
45
|
slideSkipStartTime?: number;
|
46
|
+
muteIconFixed?: boolean;
|
47
|
+
likeIconFixed?: boolean;
|
48
|
+
enablePreview?: boolean;
|
49
|
+
enableSwiperTip?: boolean;
|
50
|
+
logoBar?: any;
|
46
51
|
};
|
47
52
|
descStyle?: CSSProperties;
|
48
53
|
tipText?: {
|
@@ -74,7 +79,7 @@ export interface ISxpPageRenderProps {
|
|
74
79
|
data?: RecItemType[];
|
75
80
|
tagList?: string[];
|
76
81
|
resolver: any;
|
77
|
-
ctaType?: string
|
82
|
+
ctaType?: Array<string>;
|
78
83
|
_schema?: any;
|
79
84
|
hashTagStyle?: CSSProperties;
|
80
85
|
licenseUrl?: string;
|
@@ -22,7 +22,9 @@ import withBindDataSource from '../../../core/hoc/withBindDataSource';
|
|
22
22
|
import Tagbar from './Tagbar';
|
23
23
|
import { getFeUserId, getSlideSkipState, setSlideSkipState } from '../../../core/utils/localStore';
|
24
24
|
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [], licenseUrl }) => {
|
25
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
25
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
26
|
+
const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
|
27
|
+
const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
|
26
28
|
const { schema } = useEditor();
|
27
29
|
const [activeIndex, setActiveIndex] = useState(0);
|
28
30
|
const viewImageStartTime = useRef(0);
|
@@ -36,8 +38,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
36
38
|
const { backMainFeed } = useEventReport();
|
37
39
|
const { productView } = useEventReport();
|
38
40
|
const isShowFingerTip = useMemo(() => {
|
39
|
-
return data.length > 0 && !loading && getFeUserId();
|
40
|
-
}, [data, loading]);
|
41
|
+
return data.length > 0 && !loading && (getFeUserId() || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableSwiperTip));
|
42
|
+
}, [data, loading, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableSwiperTip]);
|
41
43
|
useEffect(() => {
|
42
44
|
refreshFeSessionId();
|
43
45
|
}, []);
|
@@ -65,14 +67,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
65
67
|
var _a;
|
66
68
|
const index = (data === null || data === void 0 ? void 0 : data.findIndex((item) => {
|
67
69
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
68
|
-
|
70
|
+
const ctaType0 = ctaType === null || ctaType === void 0 ? void 0 : ctaType[0];
|
71
|
+
if (ctaType0 === '多商品CTA') {
|
69
72
|
return ((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.bindProducts) && ((_c = (_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.bindProducts) === null || _c === void 0 ? void 0 : _c.length) > 0;
|
70
73
|
}
|
71
|
-
else if (
|
74
|
+
else if (ctaType0 === '商品CTA') {
|
72
75
|
return (_d = item === null || item === void 0 ? void 0 : item.video) === null || _d === void 0 ? void 0 : _d.bindProduct;
|
73
76
|
}
|
74
77
|
else {
|
75
|
-
return ((_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.bindCta) === null || _f === void 0 ? void 0 : _f.itemId) ===
|
78
|
+
return ((_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.bindCta) === null || _f === void 0 ? void 0 : _f.itemId) === ctaType0 && (((_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.url) || ((_j = (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.imgUrls) === null || _j === void 0 ? void 0 : _j.length));
|
76
79
|
}
|
77
80
|
})) || 0;
|
78
81
|
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
@@ -174,8 +177,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
174
177
|
return containerHeight - minusHeight - tagHeight;
|
175
178
|
}, [globalConfig, containerHeight, tagHeight]);
|
176
179
|
const renderLogo = useMemo(() => {
|
180
|
+
var _a, _b;
|
177
181
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
178
|
-
|
182
|
+
const link = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoBar) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.value;
|
183
|
+
return (React.createElement("div", Object.assign({ className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } }, (link && { onClick: () => new Function(link)() })),
|
179
184
|
React.createElement("img", { src: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl, alt: 'logo' })));
|
180
185
|
}
|
181
186
|
return null;
|
@@ -255,9 +260,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
255
260
|
isShowMore,
|
256
261
|
lineGradStyle
|
257
262
|
]);
|
258
|
-
const renderLikeButton = useCallback((rec, index) => {
|
263
|
+
const renderLikeButton = useCallback((rec, index, visible) => {
|
259
264
|
var _a, _b, _c, _d;
|
260
|
-
if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
|
265
|
+
if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike) || !visible)
|
261
266
|
return;
|
262
267
|
let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconY) !== null && _a !== void 0 ? _a : 400;
|
263
268
|
if (waterFallData && top < 40) {
|
@@ -265,6 +270,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
265
270
|
}
|
266
271
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
267
272
|
return (React.createElement(LikeButton, { key: rec.position, activeIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIcon, unActicveIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unlikeIcon, active: rec.isCollected, recData: rec, className: 'clc-sxp-like-button', style: {
|
273
|
+
position: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed) ? 'fixed' : 'absolute',
|
268
274
|
[(_b = globalConfig.likeIconXPosit) !== null && _b !== void 0 ? _b : 'right']: (_c = globalConfig.likeIconX) !== null && _c !== void 0 ? _c : 0,
|
269
275
|
[(_d = globalConfig.likeIconYPosit) !== null && _d !== void 0 ? _d : 'bottom']: top
|
270
276
|
}, position: index }));
|
@@ -411,6 +417,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
411
417
|
});
|
412
418
|
return !waterFallData ? list.concat([{ loading: true }]) : list;
|
413
419
|
}, [data, activeIndex, waterFallData]);
|
420
|
+
const renderToggleButton = useCallback((visible) => {
|
421
|
+
var _a, _b, _c, _d, _e, _f;
|
422
|
+
if (!visible)
|
423
|
+
return;
|
424
|
+
return (((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowMute) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowMute) === true) && (React.createElement(ToggleButton, { style: {
|
425
|
+
position: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed) ? 'fixed' : 'absolute',
|
426
|
+
visibility: ((_b = (_a = visList === null || visList === void 0 ? void 0 : visList[activeIndex]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.url) ? 'visible' : 'hidden',
|
427
|
+
zIndex: 999,
|
428
|
+
[(_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconXPosit) !== null && _c !== void 0 ? _c : 'right']: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _d !== void 0 ? _d : 0,
|
429
|
+
[(_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) !== null && _e !== void 0 ? _e : 'bottom']: (_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _f !== void 0 ? _f : 23
|
430
|
+
}, defaultValue: isMuted, activeIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon : mutedIcon, unactiveIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon : unmutedIcon, onChange: setIsMuted })));
|
431
|
+
}, [globalConfig, visList, activeIndex, isMuted]);
|
414
432
|
const renderView = useMemo(() => {
|
415
433
|
if (loading) {
|
416
434
|
return (React.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
|
@@ -427,20 +445,30 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
427
445
|
React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement(React.Fragment, null,
|
428
446
|
renderContent(rec, index),
|
429
447
|
renderBottom(rec, index),
|
430
|
-
renderLikeButton(rec, index))
|
448
|
+
renderLikeButton(rec, index, !(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
|
449
|
+
renderToggleButton(!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))))))));
|
431
450
|
});
|
432
|
-
}, [
|
433
|
-
|
434
|
-
|
451
|
+
}, [
|
452
|
+
containerWidth,
|
453
|
+
data,
|
454
|
+
height,
|
455
|
+
loading,
|
456
|
+
renderBottom,
|
457
|
+
renderContent,
|
458
|
+
visList,
|
459
|
+
loadingImage,
|
460
|
+
isReload,
|
461
|
+
renderToggleButton
|
462
|
+
]);
|
435
463
|
return (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container' },
|
436
|
-
waterFallData && (React.createElement(Navbar, { icon: left, styles: { background: 'rgba(0,0,0,.3)', color: '#fff' }, onClose: () => {
|
464
|
+
waterFallData && (React.createElement(Navbar, { icon: left, styles: { background: 'rgba(0,0,0,.3)', color: '#fff' }, textStyle: Object.assign(Object.assign({}, (_e = (_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.textStyles) === null || _e === void 0 ? void 0 : _e.hashTagTitle), { color: '#fff' }), onClose: () => {
|
437
465
|
setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
|
438
466
|
} })),
|
439
467
|
renderLogo,
|
440
468
|
React.createElement(Tagbar, { tagList: tagList, setActiveIndex: setActiveIndex, style: {
|
441
469
|
top: minusHeight
|
442
470
|
} }),
|
443
|
-
isShowFingerTip ? (React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 - ((
|
471
|
+
isShowFingerTip ? (React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 - ((_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipOffset) !== null && _f !== void 0 ? _f : 0)}%` }, duration: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swiperTipAniDur })) : null,
|
444
472
|
React.createElement(Swiper, { style: {
|
445
473
|
marginTop: tagHeight
|
446
474
|
}, ref: swiperRef, onSlideChange: () => {
|
@@ -464,14 +492,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
464
492
|
}
|
465
493
|
}
|
466
494
|
}, direction: 'vertical', height: height },
|
467
|
-
(
|
468
|
-
|
469
|
-
visibility: ((_c = (_b = data === null || data === void 0 ? void 0 : data[activeIndex]) === null || _b === void 0 ? void 0 : _b.video) === null || _c === void 0 ? void 0 : _c.url) ? 'visible' : 'hidden',
|
470
|
-
zIndex: 999,
|
471
|
-
[(_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconXPosit) !== null && _d !== void 0 ? _d : 'right']: (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _e !== void 0 ? _e : 0,
|
472
|
-
[(_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) !== null && _f !== void 0 ? _f : 'bottom']: (_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _g !== void 0 ? _g : 23
|
473
|
-
}, defaultValue: isMuted, activeIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon : mutedIcon, unactiveIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon : unmutedIcon, onChange: setIsMuted })),
|
495
|
+
renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
|
496
|
+
renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed)),
|
474
497
|
renderView),
|
475
|
-
React.createElement(WaterFall, Object.assign({}, (
|
498
|
+
React.createElement(WaterFall, Object.assign({}, (_j = (_h = (_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.item) === null || _j === void 0 ? void 0 : _j.props))));
|
476
499
|
};
|
477
500
|
export default SxpPageRender;
|
@@ -27,6 +27,7 @@ export type CTAInfoType = {
|
|
27
27
|
weight: number | null;
|
28
28
|
enTitle: string;
|
29
29
|
link: string | null;
|
30
|
+
remark?: string;
|
30
31
|
};
|
31
32
|
export type ProductInfoType = {
|
32
33
|
traceInfo?: string | null;
|
@@ -44,6 +45,7 @@ export type ProductInfoType = {
|
|
44
45
|
bindCta?: CTAInfoType;
|
45
46
|
taxInfo?: string;
|
46
47
|
cover?: string;
|
48
|
+
remark?: string;
|
47
49
|
};
|
48
50
|
export type VideoInfoType = {
|
49
51
|
bindCtaId: string;
|
@@ -31,10 +31,10 @@ export interface ISxpDataSourceContext {
|
|
31
31
|
defaultSize?: number;
|
32
32
|
channel?: string;
|
33
33
|
hashTag?: string;
|
34
|
-
'itemFilter.itemId'?: string;
|
35
|
-
'itemFilter.itemType'?: 'VIDEO' | 'PRODUCT' | null | undefined;
|
36
34
|
traceInfo?: string;
|
37
35
|
themeTag?: string;
|
36
|
+
contentFilter?: string;
|
37
|
+
productFilter?: string;
|
38
38
|
}) => Promise<RecommendVideoResultType | undefined>;
|
39
39
|
utmVal?: string;
|
40
40
|
bffEventReport?: (body: {
|
@@ -119,6 +119,7 @@ export interface SxpDataSourceProviderProps {
|
|
119
119
|
globalConfig?: ISxpPageRenderProps['globalConfig'];
|
120
120
|
isEditor?: boolean;
|
121
121
|
utmParameter?: PageData['utm_parameter'];
|
122
|
+
channelQueryList?: any[];
|
122
123
|
}
|
123
124
|
export declare const DEFAULT_TAG = "FOR U";
|
124
125
|
declare const _default: React.NamedExoticComponent<SxpDataSourceProviderProps>;
|