pb-sxp-ui 1.3.1 → 1.3.2

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.
Files changed (59) hide show
  1. package/dist/index.cjs +190 -146
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +190 -146
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.cjs +3 -3
  6. package/dist/index.min.cjs.map +1 -1
  7. package/dist/index.min.js +3 -3
  8. package/dist/index.min.js.map +1 -1
  9. package/dist/pb-ui.js +190 -146
  10. package/dist/pb-ui.js.map +1 -1
  11. package/dist/pb-ui.min.js +3 -3
  12. package/dist/pb-ui.min.js.map +1 -1
  13. package/es/core/components/SxpPageRender/Modal/index.js +3 -3
  14. package/es/core/components/SxpPageRender/RenderCard.d.ts +3 -3
  15. package/es/core/components/SxpPageRender/RenderCard.js +17 -27
  16. package/es/core/components/SxpPageRender/WaterFall/List.js +20 -11
  17. package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +20 -11
  18. package/es/core/components/SxpPageRender/index.js +14 -10
  19. package/es/core/context/EditorDataProvider.d.ts +3 -0
  20. package/es/core/context/EditorDataProvider.js +2 -1
  21. package/es/core/context/SxpDataSourceProvider.d.ts +1 -0
  22. package/es/core/context/SxpDataSourceProvider.js +43 -31
  23. package/es/core/utils/tool.d.ts +3 -3
  24. package/es/core/utils/tool.js +6 -6
  25. package/es/materials/sxp/HashTag/index.d.ts +3 -1
  26. package/es/materials/sxp/HashTag/settingRender.d.ts +7 -0
  27. package/es/materials/sxp/HashTag/settingRender.js +6 -0
  28. package/es/materials/sxp/popup/CommodityDetail/index.js +13 -14
  29. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +13 -14
  30. package/es/materials/sxp/popup/CommodityList/index.d.ts +3 -1
  31. package/es/materials/sxp/popup/CommodityList/index.js +11 -7
  32. package/es/materials/sxp/popup/CommodityList/settingRender.d.ts +7 -0
  33. package/es/materials/sxp/popup/CommodityList/settingRender.js +6 -0
  34. package/es/materials/sxp/popup/Iframe/index.d.ts +1 -0
  35. package/es/materials/sxp/popup/Iframe/index.js +8 -7
  36. package/lib/core/components/SxpPageRender/Modal/index.js +3 -3
  37. package/lib/core/components/SxpPageRender/RenderCard.d.ts +3 -3
  38. package/lib/core/components/SxpPageRender/RenderCard.js +16 -26
  39. package/lib/core/components/SxpPageRender/WaterFall/List.js +20 -11
  40. package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +20 -11
  41. package/lib/core/components/SxpPageRender/index.js +14 -10
  42. package/lib/core/context/EditorDataProvider.d.ts +3 -0
  43. package/lib/core/context/EditorDataProvider.js +2 -1
  44. package/lib/core/context/SxpDataSourceProvider.d.ts +1 -0
  45. package/lib/core/context/SxpDataSourceProvider.js +43 -31
  46. package/lib/core/utils/tool.d.ts +3 -3
  47. package/lib/core/utils/tool.js +6 -6
  48. package/lib/materials/sxp/HashTag/index.d.ts +3 -1
  49. package/lib/materials/sxp/HashTag/settingRender.d.ts +7 -0
  50. package/lib/materials/sxp/HashTag/settingRender.js +6 -0
  51. package/lib/materials/sxp/popup/CommodityDetail/index.js +13 -14
  52. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +13 -14
  53. package/lib/materials/sxp/popup/CommodityList/index.d.ts +3 -1
  54. package/lib/materials/sxp/popup/CommodityList/index.js +11 -7
  55. package/lib/materials/sxp/popup/CommodityList/settingRender.d.ts +7 -0
  56. package/lib/materials/sxp/popup/CommodityList/settingRender.js +6 -0
  57. package/lib/materials/sxp/popup/Iframe/index.d.ts +1 -0
  58. package/lib/materials/sxp/popup/Iframe/index.js +8 -7
  59. package/package.json +1 -1
@@ -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, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
7
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
8
8
  const touchRef = useRef(null);
9
9
  const fTouchRef = useRef(null);
10
10
  const touchMoveRef = useRef(null);
@@ -126,8 +126,8 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
126
126
  React.createElement("div", { onClick: onClose, className: 'modal-icon-wrapper' },
127
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
128
  React.createElement("div", { ref: ref, style: {
129
- height: (isScrollFullScreen ? fullHeight : MODAL_DEF_CON_H) -
130
- ((_w = (_v = (_u = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _u === void 0 ? void 0 : _u.props) === null || _v === void 0 ? void 0 : _v.popupBg) === null || _w === void 0 ? void 0 : _w.bottomMargin),
129
+ height: (_x = (isScrollFullScreen ? fullHeight : MODAL_DEF_CON_H) -
130
+ ((_w = (_v = (_u = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _u === void 0 ? void 0 : _u.props) === null || _v === void 0 ? void 0 : _v.popupBg) === null || _w === void 0 ? void 0 : _w.bottomMargin)) !== null && _x !== void 0 ? _x : 0,
131
131
  overflow: (isScrollFullScreen && modalTrans <= 0) || !isScrollFullScreen ? 'auto' : 'hidden'
132
132
  } }, children)))))), modalEleRef.current);
133
133
  };
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { FC } from 'react';
2
2
  import './index.less';
3
3
  import { RecItemType } from './typing';
4
4
  interface IRenderCardProps {
@@ -9,5 +9,5 @@ interface IRenderCardProps {
9
9
  includesCtaType?: string[];
10
10
  isActive?: boolean;
11
11
  }
12
- declare const _default: React.NamedExoticComponent<IRenderCardProps>;
13
- export default _default;
12
+ declare const RenderCard: FC<IRenderCardProps>;
13
+ export default RenderCard;
@@ -1,4 +1,4 @@
1
- import React, { memo, useMemo } from 'react';
1
+ import React, { useCallback } from 'react';
2
2
  import './index.less';
3
3
  import withBindDataSource from '../../../core/hoc/withBindDataSource';
4
4
  import { useEditor } from '../../../core/hooks';
@@ -18,43 +18,33 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive }
18
18
  cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
19
19
  }
20
20
  const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
21
- const renderComp = useMemo(() => {
22
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8;
21
+ const renderComp = useCallback(() => {
22
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
23
23
  if (!(rec === null || rec === void 0 ? void 0 : rec.video))
24
24
  return null;
25
- let cta = null;
26
- if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) {
27
- cta = '多商品CTA';
28
- }
29
- else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
30
- cta = '商品CTA';
31
- }
32
- else {
33
- cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
34
- }
35
- if (includesCtaType && !(includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.includes((_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.type)))
25
+ if (includesCtaType && !(includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.includes((_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type)))
36
26
  return;
37
- if (!includesCtaType && ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.category) === 'cta')
27
+ if (!includesCtaType && ((_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.category) === 'cta')
38
28
  return;
39
- if ((((_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.type) === 'CommodityDiro' && !((_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.bindProduct)) ||
40
- (((_k = value === null || value === void 0 ? void 0 : value.item) === null || _k === void 0 ? void 0 : _k.type) === 'Commodity' && !((_l = rec === null || rec === void 0 ? void 0 : rec.video) === null || _l === void 0 ? void 0 : _l.bindProduct)) ||
41
- (((_m = value === null || value === void 0 ? void 0 : value.item) === null || _m === void 0 ? void 0 : _m.type) === 'CommodityDiroNew' && !((_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.bindProduct)) ||
42
- (((_p = value === null || value === void 0 ? void 0 : value.item) === null || _p === void 0 ? void 0 : _p.type) === 'MultiCommodity' && !((_r = (_q = rec === null || rec === void 0 ? void 0 : rec.video) === null || _q === void 0 ? void 0 : _q.bindProducts) === null || _r === void 0 ? void 0 : _r.length)) ||
43
- (((_s = value === null || value === void 0 ? void 0 : value.item) === null || _s === void 0 ? void 0 : _s.type) === 'MultiCommodityDiro' && !((_u = (_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.bindProducts) === null || _u === void 0 ? void 0 : _u.length)) ||
44
- (((_v = value === null || value === void 0 ? void 0 : value.item) === null || _v === void 0 ? void 0 : _v.type) === 'MultiCommodityDiroNew' && !((_x = (_w = rec === null || rec === void 0 ? void 0 : rec.video) === null || _w === void 0 ? void 0 : _w.bindProducts) === null || _x === void 0 ? void 0 : _x.length))) {
29
+ if ((((_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.type) === 'CommodityDiro' && !((_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindProduct)) ||
30
+ (((_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.type) === 'Commodity' && !((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct)) ||
31
+ (((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.type) === 'CommodityDiroNew' && !((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.bindProduct)) ||
32
+ (((_j = value === null || value === void 0 ? void 0 : value.item) === null || _j === void 0 ? void 0 : _j.type) === 'MultiCommodity' && !((_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.bindProducts) === null || _l === void 0 ? void 0 : _l.length)) ||
33
+ (((_m = value === null || value === void 0 ? void 0 : value.item) === null || _m === void 0 ? void 0 : _m.type) === 'MultiCommodityDiro' && !((_p = (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.bindProducts) === null || _p === void 0 ? void 0 : _p.length)) ||
34
+ (((_q = value === null || value === void 0 ? void 0 : value.item) === null || _q === void 0 ? void 0 : _q.type) === 'MultiCommodityDiroNew' && !((_s = (_r = rec === null || rec === void 0 ? void 0 : rec.video) === null || _r === void 0 ? void 0 : _r.bindProducts) === null || _s === void 0 ? void 0 : _s.length))) {
45
35
  return null;
46
36
  }
47
37
  if (value && resolver) {
48
- const t = resolver[(_y = value === null || value === void 0 ? void 0 : value.item) === null || _y === void 0 ? void 0 : _y.type];
38
+ const t = resolver[(_t = value === null || value === void 0 ? void 0 : value.item) === null || _t === void 0 ? void 0 : _t.type];
49
39
  const Component = withBindDataSource(t);
50
- const defaulSetting = (_z = t === null || t === void 0 ? void 0 : t.extend) === null || _z === void 0 ? void 0 : _z.defaulSetting;
51
- const isExternalLink = ((_2 = (_1 = (_0 = value === null || value === void 0 ? void 0 : value.item) === null || _0 === void 0 ? void 0 : _0.event) === null || _1 === void 0 ? void 0 : _1.onClick) === null || _2 === void 0 ? void 0 : _2.linkType) === 'externalLink';
52
- return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box', transform: 'translate3d(0px, 0px, 0px)' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_4 = value === null || value === void 0 ? void 0 : value.item) === null || _4 === void 0 ? void 0 : _4.textStyle), bindDatas: (_6 = (_5 = value === null || value === void 0 ? void 0 : value.item) === null || _5 === void 0 ? void 0 : _5.bindDatas) !== null && _6 !== void 0 ? _6 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_7 = value === null || value === void 0 ? void 0 : value.item) === null || _7 === void 0 ? void 0 : _7.props, { event: ((_8 = value === null || value === void 0 ? void 0 : value.item) === null || _8 === void 0 ? void 0 : _8.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec, isExternalLink: isExternalLink, index: index, isActive: isActive })));
40
+ const defaulSetting = (_u = t === null || t === void 0 ? void 0 : t.extend) === null || _u === void 0 ? void 0 : _u.defaulSetting;
41
+ const isExternalLink = ((_x = (_w = (_v = value === null || value === void 0 ? void 0 : value.item) === null || _v === void 0 ? void 0 : _v.event) === null || _w === void 0 ? void 0 : _w.onClick) === null || _x === void 0 ? void 0 : _x.linkType) === 'externalLink';
42
+ return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_y = value === null || value === void 0 ? void 0 : value.item) === null || _y === void 0 ? void 0 : _y.style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box', transform: 'translate3d(0px, 0px, 0px)' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_z = value === null || value === void 0 ? void 0 : value.item) === null || _z === void 0 ? void 0 : _z.textStyle), bindDatas: (_1 = (_0 = value === null || value === void 0 ? void 0 : value.item) === null || _0 === void 0 ? void 0 : _0.bindDatas) !== null && _1 !== void 0 ? _1 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_2 = value === null || value === void 0 ? void 0 : value.item) === null || _2 === void 0 ? void 0 : _2.props, { event: ((_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec, isExternalLink: isExternalLink, index: index, isActive: isActive })));
53
43
  }
54
44
  else {
55
45
  return null;
56
46
  }
57
47
  }, [rec, resolver, tempMap, schema, value === null || value === void 0 ? void 0 : value.id, isActive]);
58
- return React.createElement(React.Fragment, null, renderComp);
48
+ return React.createElement(React.Fragment, null, renderComp());
59
49
  };
60
- export default memo(RenderCard);
50
+ export default RenderCard;
@@ -8,6 +8,7 @@ import { css } from '@emotion/css';
8
8
  import { setFontForText } from '../../../../core/utils/tool';
9
9
  import { useEventReport } from '../../../../core/hooks/useEventReport';
10
10
  const WaterfallFlowItem = (props) => {
11
+ var _a;
11
12
  const { rec, index, list, reportTagsView, textStyles, space } = props;
12
13
  const { swiperRef, setRtcList, setOpenHashtag, sxpParameter } = useSxpDataSource();
13
14
  const [showVideo, setShowVideo] = useState(false);
@@ -36,16 +37,19 @@ const WaterfallFlowItem = (props) => {
36
37
  return ((_a = rec === null || rec === void 0 ? void 0 : rec.product) === null || _a === void 0 ? void 0 : _a.title) || ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.title) || null;
37
38
  }, [rec]);
38
39
  const priceText = useMemo(() => {
39
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
40
- if (((_a = rec === null || rec === void 0 ? void 0 : rec.product) === null || _a === void 0 ? void 0 : _a.currency) && ((_b = rec === null || rec === void 0 ? void 0 : rec.product) === null || _b === void 0 ? void 0 : _b.price)) {
41
- return `${(_f = (_e = (_d = (_c = rec === null || rec === void 0 ? void 0 : rec.product) === null || _c === void 0 ? void 0 : _c.currency) === null || _d === void 0 ? void 0 : _d.split('-')[1]) === null || _e === void 0 ? void 0 : _e.toUpperCase()) !== null && _f !== void 0 ? _f : ''}${(_j = (_h = (_g = rec === null || rec === void 0 ? void 0 : rec.product) === null || _g === void 0 ? void 0 : _g.price) === null || _h === void 0 ? void 0 : _h.toLocaleString('zh', {
42
- minimumFractionDigits: 0
43
- })) !== null && _j !== void 0 ? _j : ''}`;
40
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
41
+ const isToLocStr = ((_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice) === undefined || ((_b = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _b === void 0 ? void 0 : _b.enableFormattedPrice);
42
+ if (((_c = rec === null || rec === void 0 ? void 0 : rec.product) === null || _c === void 0 ? void 0 : _c.currency) && ((_d = rec === null || rec === void 0 ? void 0 : rec.product) === null || _d === void 0 ? void 0 : _d.price)) {
43
+ return `${(_h = (_g = (_f = (_e = rec === null || rec === void 0 ? void 0 : rec.product) === null || _e === void 0 ? void 0 : _e.currency) === null || _f === void 0 ? void 0 : _f.split('-')[1]) === null || _g === void 0 ? void 0 : _g.toUpperCase()) !== null && _h !== void 0 ? _h : ''}${isToLocStr
44
+ ? (_l = (_k = (_j = rec === null || rec === void 0 ? void 0 : rec.product) === null || _j === void 0 ? void 0 : _j.price) === null || _k === void 0 ? void 0 : _k.toLocaleString('zh', {
45
+ minimumFractionDigits: 0
46
+ })) !== null && _l !== void 0 ? _l : ''
47
+ : (_m = rec === null || rec === void 0 ? void 0 : rec.product) === null || _m === void 0 ? void 0 : _m.price}`;
44
48
  }
45
49
  else {
46
50
  return null;
47
51
  }
48
- }, [rec]);
52
+ }, [rec, (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice]);
49
53
  useEffect(() => {
50
54
  const observer = new IntersectionObserver((entries) => {
51
55
  entries.forEach((entry) => {
@@ -130,22 +134,27 @@ export default function WaterfallList(_a) {
130
134
  const containerRef = useRef(null);
131
135
  const [isLoadMore, setIsLoadMore] = useState(false);
132
136
  const loadMoreData = useCallback(() => {
133
- var _a, _b, _c, _d;
134
137
  if (isLoadMore)
135
138
  return;
136
139
  setIsLoadMore(true);
137
140
  waterFallData &&
138
- (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) => {
141
+ (getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
142
+ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag
143
+ }).then((res) => {
139
144
  var _a;
140
145
  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 : []));
141
146
  setIsLoadMore(false);
142
147
  }));
143
148
  }, [waterFallData, getRecommendVideos, list, isLoadMore]);
144
149
  useEffect(() => {
145
- var _a, _b, _c, _d, _e, _f;
150
+ var _a, _b;
146
151
  setIsLoadingData(true);
147
152
  waterFallData &&
148
- (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) => {
153
+ (getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
154
+ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
155
+ defaultSize: hashTagSize,
156
+ maxSize: hashTagSize
157
+ }).then((res) => {
149
158
  var _a, _b;
150
159
  setData(res);
151
160
  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 : []);
@@ -154,7 +163,7 @@ export default function WaterfallList(_a) {
154
163
  if (isOpenHashTag) {
155
164
  const res = previewData;
156
165
  setData(res);
157
- 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 : []);
166
+ 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 : []);
158
167
  setIsLoadingData(false);
159
168
  }
160
169
  }, [waterFallData, getRecommendVideos, hashTagSize, isOpenHashTag]);
@@ -8,6 +8,7 @@ import { css } from '@emotion/css';
8
8
  import { setFontForText } from '../../../../core/utils/tool';
9
9
  import { useEventReport } from '../../../../core/hooks/useEventReport';
10
10
  const WaterfallFlowItem = (props) => {
11
+ var _a;
11
12
  const { rec, style = {}, sizeChange = () => { }, unitWidth, index, showBorder, list, reportTagsView, textStyles, space } = props;
12
13
  const { swiperRef, setRtcList, setOpenHashtag, sxpParameter } = useSxpDataSource();
13
14
  const [showVideo, setShowVideo] = useState(false);
@@ -59,16 +60,19 @@ const WaterfallFlowItem = (props) => {
59
60
  }
60
61
  }, [top, showBorder]);
61
62
  const priceText = useMemo(() => {
62
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
63
- if (((_a = rec === null || rec === void 0 ? void 0 : rec.product) === null || _a === void 0 ? void 0 : _a.currency) && ((_b = rec === null || rec === void 0 ? void 0 : rec.product) === null || _b === void 0 ? void 0 : _b.price)) {
64
- return `${(_f = (_e = (_d = (_c = rec === null || rec === void 0 ? void 0 : rec.product) === null || _c === void 0 ? void 0 : _c.currency) === null || _d === void 0 ? void 0 : _d.split('-')[1]) === null || _e === void 0 ? void 0 : _e.toUpperCase()) !== null && _f !== void 0 ? _f : ''}${(_j = (_h = (_g = rec === null || rec === void 0 ? void 0 : rec.product) === null || _g === void 0 ? void 0 : _g.price) === null || _h === void 0 ? void 0 : _h.toLocaleString('zh', {
65
- minimumFractionDigits: 0
66
- })) !== null && _j !== void 0 ? _j : ''}`;
63
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
64
+ const isToLocStr = ((_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice) === undefined || ((_b = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _b === void 0 ? void 0 : _b.enableFormattedPrice);
65
+ if (((_c = rec === null || rec === void 0 ? void 0 : rec.product) === null || _c === void 0 ? void 0 : _c.currency) && ((_d = rec === null || rec === void 0 ? void 0 : rec.product) === null || _d === void 0 ? void 0 : _d.price)) {
66
+ return `${(_h = (_g = (_f = (_e = rec === null || rec === void 0 ? void 0 : rec.product) === null || _e === void 0 ? void 0 : _e.currency) === null || _f === void 0 ? void 0 : _f.split('-')[1]) === null || _g === void 0 ? void 0 : _g.toUpperCase()) !== null && _h !== void 0 ? _h : ''}${isToLocStr
67
+ ? (_l = (_k = (_j = rec === null || rec === void 0 ? void 0 : rec.product) === null || _j === void 0 ? void 0 : _j.price) === null || _k === void 0 ? void 0 : _k.toLocaleString('zh', {
68
+ minimumFractionDigits: 0
69
+ })) !== null && _l !== void 0 ? _l : ''
70
+ : (_m = rec === null || rec === void 0 ? void 0 : rec.product) === null || _m === void 0 ? void 0 : _m.price}`;
67
71
  }
68
72
  else {
69
73
  return null;
70
74
  }
71
- }, [rec]);
75
+ }, [rec, (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice]);
72
76
  useEffect(() => {
73
77
  if (imgDom.current === null || src === '') {
74
78
  return;
@@ -209,10 +213,14 @@ export default function WaterfallList(_a) {
209
213
  styleListRef.current = getStyleList();
210
214
  }, [unitWidth, rowsNum, list]);
211
215
  useEffect(() => {
212
- var _a, _b, _c, _d, _e, _f;
216
+ var _a, _b;
213
217
  setIsLoadingData(true);
214
218
  waterFallData &&
215
- (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) => {
219
+ (getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
220
+ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
221
+ defaultSize: hashTagSize,
222
+ maxSize: hashTagSize
223
+ }).then((res) => {
216
224
  var _a, _b;
217
225
  setData(res);
218
226
  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 : []);
@@ -221,7 +229,7 @@ export default function WaterfallList(_a) {
221
229
  if (isOpenHashTag) {
222
230
  const res = previewData;
223
231
  setData(res);
224
- 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 : []);
232
+ 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
233
  setIsLoadingData(false);
226
234
  }
227
235
  }, [waterFallData, getRecommendVideos, hashTagSize, isOpenHashTag]);
@@ -246,10 +254,11 @@ export default function WaterfallList(_a) {
246
254
  };
247
255
  }, [onResize]);
248
256
  const loadMoreData = useCallback(() => {
249
- var _a, _b, _c, _d;
250
257
  setIsLoadingData(true);
251
258
  waterFallData &&
252
- (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) => {
259
+ (getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
260
+ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag
261
+ }).then((res) => {
253
262
  var _a, _b;
254
263
  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 : []));
255
264
  setIsLoadingData(false);
@@ -34,7 +34,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
34
34
  const [isShowMore, setIsShowMore] = useState(false);
35
35
  const [isReload, setIsReload] = useState(new Date().getTime());
36
36
  const skipLinkRef = useRef(false);
37
- const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag, isPreview } = useSxpDataSource();
37
+ const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag, isPreview, isEditor } = useSxpDataSource();
38
38
  const { backMainFeed, productView, jumpToWeb } = useEventReport();
39
39
  const isShowFingerTip = useMemo(() => {
40
40
  return data.length > 0 && !loading && (getFeUserId() || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableSwiperTip));
@@ -64,6 +64,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
64
64
  }, [data.length, bffFbReport, h5EnterLink]);
65
65
  useEffect(() => {
66
66
  var _a;
67
+ if (!ctaType || (ctaType === null || ctaType === void 0 ? void 0 : ctaType.length) < 1)
68
+ return;
67
69
  const index = (data === null || data === void 0 ? void 0 : data.findIndex((item) => {
68
70
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
69
71
  const ctaType0 = ctaType === null || ctaType === void 0 ? void 0 : ctaType[0];
@@ -77,8 +79,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
77
79
  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));
78
80
  }
79
81
  })) || 0;
80
- (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
81
- }, [ctaType, swiperRef]);
82
+ if (index !== -1)
83
+ (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
84
+ }, [data, ctaType, swiperRef]);
82
85
  useEffect(() => {
83
86
  const item = data === null || data === void 0 ? void 0 : data[activeIndex];
84
87
  const visibleChange = () => {
@@ -177,7 +180,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
177
180
  }, [globalConfig, containerHeight, tagHeight]);
178
181
  const visList = useMemo(() => {
179
182
  var _a;
180
- const list = activeIndex === 0 && !waterFallData
183
+ const list = activeIndex === 0 && !waterFallData && !isEditor
181
184
  ? [(_a = data === null || data === void 0 ? void 0 : data[0]) !== null && _a !== void 0 ? _a : null]
182
185
  : data === null || data === void 0 ? void 0 : data.map((item, index) => {
183
186
  if (activeIndex === index || index - 1 === activeIndex || index + 1 === activeIndex) {
@@ -188,7 +191,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
188
191
  }
189
192
  });
190
193
  return !waterFallData ? list.concat([{ loading: true }]) : list;
191
- }, [data, activeIndex, waterFallData]);
194
+ }, [data, activeIndex, waterFallData, isEditor]);
192
195
  const renderLogo = useMemo(() => {
193
196
  var _a, _b, _c, _d;
194
197
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
@@ -433,6 +436,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
433
436
  position: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed) ? 'fixed' : 'absolute',
434
437
  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',
435
438
  zIndex: 999,
439
+ transform: 'translate3d(0px,0px,0px)',
436
440
  [(_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,
437
441
  [(_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
438
442
  }, 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 })));
@@ -451,10 +455,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
451
455
  alignItems: 'center'
452
456
  } },
453
457
  React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement(React.Fragment, null,
454
- renderContent(rec, index),
455
- renderBottom(rec, index),
456
458
  renderLikeButton(rec, index, !(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
457
- renderToggleButton(!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))))))));
459
+ renderToggleButton(!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed)),
460
+ renderBottom(rec, index),
461
+ renderContent(rec, index)))))));
458
462
  });
459
463
  }, [
460
464
  containerWidth,
@@ -489,9 +493,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
489
493
  if (openHashtag)
490
494
  return;
491
495
  handleScrollEvent(swiper);
492
- if (waterFallData)
496
+ if (waterFallData || isEditor)
493
497
  return;
494
- if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 2 >= (data === null || data === void 0 ? void 0 : data.length)) {
498
+ if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
495
499
  if (!isLoadMore) {
496
500
  setIsLoadMore(true);
497
501
  loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(Math.ceil(activeIndex / 10) + 1).then(() => {
@@ -21,6 +21,9 @@ interface IEditorDataContext {
21
21
  openConsent?: boolean;
22
22
  setOpenConsent?: React.Dispatch<React.SetStateAction<boolean>>;
23
23
  sxpFontLinks?: any[];
24
+ utmParameter?: {
25
+ channels: string[];
26
+ };
24
27
  }
25
28
  interface IEditorProviderProps {
26
29
  data?: any;
@@ -25,7 +25,8 @@ const EditorDataProvider = ({ children, data }) => {
25
25
  setOpenHashtag,
26
26
  openConsent,
27
27
  setOpenConsent,
28
- sxpFontLinks: data === null || data === void 0 ? void 0 : data.sxpFontLinks
28
+ sxpFontLinks: data === null || data === void 0 ? void 0 : data.sxpFontLinks,
29
+ utmParameter: data === null || data === void 0 ? void 0 : data.utm_parameter
29
30
  } }, children));
30
31
  };
31
32
  export function useEditorDataProvider() {
@@ -81,6 +81,7 @@ export interface ISxpDataSourceContext {
81
81
  globalConfig?: ISxpPageRenderProps['globalConfig'];
82
82
  popupCurTimeRef?: any;
83
83
  checkCommodityIndexRef?: any;
84
+ isEditor?: boolean;
84
85
  }
85
86
  export declare const SxpDataSourceContext: React.Context<ISxpDataSourceContext>;
86
87
  export interface SxpDataSourceProviderProps {
@@ -93,8 +93,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
93
93
  .catch((err) => Promise.reject(err));
94
94
  }, [bffDataSource]);
95
95
  const getRecommendVideos = useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
96
- var _d, _e, _f, _g, _h, _j, _k;
97
- query = Object.assign(Object.assign({ maxSize: (_d = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _d !== void 0 ? _d : maxSize, defaultSize: (_e = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _e !== void 0 ? _e : defaultSize, hashTag: query === null || query === void 0 ? void 0 : query.hashTag, traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo, themeTag: query === null || query === void 0 ? void 0 : query.themeTag }, ((query === null || query === void 0 ? void 0 : query.contentFilter) && { contentFilter: `[${query === null || query === void 0 ? void 0 : query.contentFilter}]` })), ((query === null || query === void 0 ? void 0 : query.productFilter) && { productFilter: `[${query === null || query === void 0 ? void 0 : query.productFilter}]` }));
96
+ var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
97
+ query = Object.assign(Object.assign(Object.assign({ maxSize: (_d = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _d !== void 0 ? _d : maxSize, defaultSize: (_e = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _e !== void 0 ? _e : defaultSize, hashTag: query === null || query === void 0 ? void 0 : query.hashTag, traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo, themeTag: query === null || query === void 0 ? void 0 : query.themeTag }, ((query === null || query === void 0 ? void 0 : query.contentFilter) && { contentFilter: `[${query === null || query === void 0 ? void 0 : query.contentFilter}]` })), ((query === null || query === void 0 ? void 0 : query.productFilter) && { productFilter: `[${query === null || query === void 0 ? void 0 : query.productFilter}]` })), { pageNum: query === null || query === void 0 ? void 0 : query.pageNum });
98
98
  if (utmVal) {
99
99
  const val = (_h = (_g = (_f = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _f === void 0 ? void 0 : _f.filter((val) => {
100
100
  var _a, _b;
@@ -103,30 +103,34 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
103
103
  })) === null || _g === void 0 ? void 0 : _g.join('&')) !== null && _h !== void 0 ? _h : '';
104
104
  query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
105
105
  }
106
- if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) || isEditor) {
107
- query = Object.assign(Object.assign(Object.assign({}, query), { directPage: true, level: 1 }), (!utmVal && channelQueryList && (channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList.length) > 0 && { channel: channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList[0] }));
108
- if (!(query === null || query === void 0 ? void 0 : query.channel))
106
+ if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) {
107
+ query = Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (_j = query === null || query === void 0 ? void 0 : query.pageNum) !== null && _j !== void 0 ? _j : 1 });
108
+ }
109
+ if (isEditor) {
110
+ let pageNum = 1;
111
+ query = Object.assign(Object.assign({}, query), (!utmVal && channelQueryList && (channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList.length) > 0 && { channel: channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList[0] }));
112
+ if (!(query === null || query === void 0 ? void 0 : query.channel) || isInit.current)
109
113
  return;
114
+ isInit.current = true;
110
115
  let list = [];
111
116
  let result = null;
112
- let pageNum = 1;
113
117
  const recurveRecList = (query) => __awaiter(void 0, void 0, void 0, function* () {
114
- var _l, _m, _o, _p;
118
+ var _r, _s, _t, _u, _v, _w;
115
119
  query.pageNum = pageNum;
116
120
  result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
117
121
  if (!(result === null || result === void 0 ? void 0 : result.success)) {
118
122
  return undefined;
119
123
  }
120
- const rec = (_m = (_l = result === null || result === void 0 ? void 0 : result.data) === null || _l === void 0 ? void 0 : _l.recList) === null || _m === void 0 ? void 0 : _m[0];
121
- list = list.concat((_p = (_o = result === null || result === void 0 ? void 0 : result.data) === null || _o === void 0 ? void 0 : _o.recList) !== null && _p !== void 0 ? _p : []);
122
- if ((rec === null || rec === void 0 ? void 0 : rec.product) || (rec === null || rec === void 0 ? void 0 : rec.video)) {
124
+ const isNotNullList = (_s = (_r = result === null || result === void 0 ? void 0 : result.data) === null || _r === void 0 ? void 0 : _r.recList) === null || _s === void 0 ? void 0 : _s.every((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
125
+ list = list.concat((_w = (_v = (_u = (_t = result === null || result === void 0 ? void 0 : result.data) === null || _t === void 0 ? void 0 : _t.recList) === null || _u === void 0 ? void 0 : _u.filter) === null || _v === void 0 ? void 0 : _v.call(_u, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _w !== void 0 ? _w : []);
126
+ if (isNotNullList) {
123
127
  pageNum = pageNum + 1;
124
128
  yield recurveRecList(query);
125
129
  }
126
130
  });
127
131
  yield recurveRecList(query);
128
132
  if (!(query === null || query === void 0 ? void 0 : query.hashTag) && result)
129
- setCurReqInfo({ rtc: (_j = result === null || result === void 0 ? void 0 : result.data) === null || _j === void 0 ? void 0 : _j.rtc, requestId: (_k = result === null || result === void 0 ? void 0 : result.data) === null || _k === void 0 ? void 0 : _k.requestId });
133
+ setCurReqInfo({ rtc: (_k = result === null || result === void 0 ? void 0 : result.data) === null || _k === void 0 ? void 0 : _k.rtc, requestId: (_l = result === null || result === void 0 ? void 0 : result.data) === null || _l === void 0 ? void 0 : _l.requestId });
130
134
  return Object.assign(Object.assign({}, result.data), { recList: list });
131
135
  }
132
136
  const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
@@ -135,15 +139,20 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
135
139
  }
136
140
  if (!(query === null || query === void 0 ? void 0 : query.hashTag))
137
141
  setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
142
+ if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor) {
143
+ let list = [];
144
+ list = list.concat((_q = (_p = (_o = (_m = result === null || result === void 0 ? void 0 : result.data) === null || _m === void 0 ? void 0 : _m.recList) === null || _o === void 0 ? void 0 : _o.filter) === null || _p === void 0 ? void 0 : _p.call(_o, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _q !== void 0 ? _q : []);
145
+ return Object.assign(Object.assign({}, result.data), { recList: list });
146
+ }
138
147
  return result === null || result === void 0 ? void 0 : result.data;
139
- }), [bffFetch, utmVal, maxSize, defaultSize, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview, channelQueryList, isEditor]);
140
- const loadVideos = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
141
- var _q, _r, _s, _t;
148
+ }), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList]);
149
+ const loadVideos = useCallback((pageNum) => __awaiter(void 0, void 0, void 0, function* () {
150
+ var _x, _y, _z, _0;
142
151
  if (rtcList.length <= 0) {
143
152
  return;
144
153
  }
145
154
  const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
146
- const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_q = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _q === void 0 ? void 0 : _q.itemId) && { productFilter: (_r = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _r === void 0 ? void 0 : _r.itemId })), (((_s = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _s === void 0 ? void 0 : _s.itemId) && { contentFilter: (_t = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _t === void 0 ? void 0 : _t.itemId })), { themeTag: themeTag.current }));
155
+ const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_x = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _x === void 0 ? void 0 : _x.itemId) && { productFilter: (_y = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _y === void 0 ? void 0 : _y.itemId })), (((_z = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _z === void 0 ? void 0 : _z.itemId) && { contentFilter: (_0 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _0 === void 0 ? void 0 : _0.itemId })), { themeTag: themeTag.current }), ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor && { pageNum })));
147
156
  setRtcList(rtcList.concat(getFilterRecList(data)));
148
157
  setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
149
158
  }), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
@@ -155,7 +164,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
155
164
  userInfo = {};
156
165
  }
157
166
  const sessionID = storeAndLoadFeSessionId();
158
- const ef = Object.assign(Object.assign({ sessionID, rtc: curReqInfo.rtc, requestId: curReqInfo.requestId }, eventInfo), { sxpDevice: getDevice(), sxpSystem: getSystem(), sxpBrowser: getBrowserInfo() });
167
+ const ef = Object.assign(Object.assign(Object.assign(Object.assign({ sessionID, rtc: curReqInfo.rtc, requestId: curReqInfo.requestId }, eventInfo), (getDevice() && { sxpDevice: getDevice() })), (getSystem() && { sxpSystem: getSystem() })), (getBrowserInfo() && { sxpBrowser: getBrowserInfo() }));
159
168
  const realUserInfo = Object.entries(userInfo).map(([k, v]) => ({ name: k, value: v }));
160
169
  const realEventInfo = Object.entries(ef)
161
170
  .map(([k, v]) => v && { name: k, value: v })
@@ -171,24 +180,21 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
171
180
  });
172
181
  }, [bffFetch, curReqInfo, enableReportEvent, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
173
182
  const bffFbReport = useCallback((_a) => {
174
- var _b, _c;
183
+ var _b, _c, _d;
175
184
  var { eventName, actionSource = 'website', eventSourceUrl = (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href, externalId } = _a;
176
185
  if (!enableReportEvent || !enabledMetaConversionApi || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
177
186
  return;
178
187
  }
179
188
  const fakeUserId = storeAndLoadFeUserId();
189
+ const urlParams = new URLSearchParams(window.location.search);
190
+ const fbclid = urlParams.get('fbclid');
180
191
  return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/fb/events', {
181
192
  method: 'POST',
182
193
  body: {
183
194
  eventName,
184
195
  actionSource,
185
196
  eventSourceUrl,
186
- userData: {
187
- externalId: fakeUserId,
188
- fbc: `fb.2.${new Date().getTime()}.${getCookie('_fbc')}`,
189
- fbp: `fb.2.${new Date().getTime()}.${getCookie('_fbp')}`,
190
- client_user_agent: (_c = window === null || window === void 0 ? void 0 : window.navigator) === null || _c === void 0 ? void 0 : _c.userAgent
191
- }
197
+ userData: Object.assign(Object.assign(Object.assign({ externalId: fakeUserId }, (fbclid && { fbc: `fb.2.${new Date().getTime()}.${fbclid}` })), (getCookie('_fbp') && { fbp: `fb.2.${new Date().getTime()}.${getCookie('_fbp')}` })), { client_user_agent: (_d = (_c = window === null || window === void 0 ? void 0 : window.navigator) === null || _c === void 0 ? void 0 : _c.userAgent) !== null && _d !== void 0 ? _d : '' })
192
198
  },
193
199
  type: 'beacon'
194
200
  });
@@ -206,17 +212,17 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
206
212
  return res === null || res === void 0 ? void 0 : res.success;
207
213
  }), [bffFetch]);
208
214
  const bffGetTagList = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
209
- var _u, _v, _w, _x, _y;
215
+ var _1, _2, _3, _4, _5;
210
216
  if (!utmVal || !isShowTag)
211
217
  return;
212
218
  try {
213
- const val = (_w = (_v = (_u = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _u === void 0 ? void 0 : _u.filter((val) => {
219
+ const val = (_3 = (_2 = (_1 = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _1 === void 0 ? void 0 : _1.filter((val) => {
214
220
  var _a, _b;
215
221
  const key = val.split('=')[0];
216
222
  return (_b = ((_a = utmParameter === null || utmParameter === void 0 ? void 0 : utmParameter.channels) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.includes(key);
217
- })) === null || _v === void 0 ? void 0 : _v.join('&')) !== null && _w !== void 0 ? _w : '';
223
+ })) === null || _2 === void 0 ? void 0 : _2.join('&')) !== null && _3 !== void 0 ? _3 : '';
218
224
  const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
219
- setTagList((_y = (_x = result === null || result === void 0 ? void 0 : result.data) === null || _x === void 0 ? void 0 : _x.tags) !== null && _y !== void 0 ? _y : []);
225
+ setTagList((_5 = (_4 = result === null || result === void 0 ? void 0 : result.data) === null || _4 === void 0 ? void 0 : _4.tags) !== null && _5 !== void 0 ? _5 : []);
220
226
  }
221
227
  catch (e) {
222
228
  console.log('e', e);
@@ -289,11 +295,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
289
295
  }
290
296
  });
291
297
  setLoading(false);
292
- isInit.current = true;
293
298
  });
294
299
  }, [isShowConsent]);
295
300
  useEffect(() => {
296
- if (!isInit.current && !isEditor)
301
+ if (!isPreview)
297
302
  return;
298
303
  setLoading(true);
299
304
  bffGetTagList();
@@ -303,9 +308,15 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
303
308
  setCacheRtcList(getFilterRecList(data));
304
309
  })
305
310
  .finally(() => {
311
+ bffEventReport({
312
+ eventInfo: {
313
+ eventSubject: 'apiRequest',
314
+ eventDescription: 'api request succeed'
315
+ }
316
+ });
306
317
  setLoading(false);
307
318
  });
308
- }, [bffGetTagList, isEditor, getRecommendVideos]);
319
+ }, [getRecommendVideos, bffGetTagList]);
309
320
  const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
310
321
  return (React.createElement(SxpDataSourceContext.Provider, { value: {
311
322
  rtcList,
@@ -353,7 +364,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
353
364
  setSelectTag,
354
365
  globalConfig,
355
366
  popupCurTimeRef,
356
- checkCommodityIndexRef
367
+ checkCommodityIndexRef,
368
+ isEditor
357
369
  } }, isShowConsent ? (React.createElement(Consent, Object.assign({}, (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props))) : (render({
358
370
  rtcList,
359
371
  mutateLike: bffMutateLike,
@@ -7,8 +7,8 @@ interface IfontType {
7
7
  'fontFamily-en': string;
8
8
  }
9
9
  export declare const setFontForText: (textContent?: string | null, style?: IfontType | any) => string;
10
- declare function getBrowserInfo(): string;
11
- declare function getSystem(): string;
12
- declare function getDevice(): string;
10
+ declare function getBrowserInfo(): string | null;
11
+ declare function getSystem(): string | null;
12
+ declare function getDevice(): string | null;
13
13
  declare function getCookie(val: string): string;
14
14
  export { uuid, getIndexByblockType, getBrowserInfo, getDevice, getSystem, getCookie };