pb-sxp-ui 1.0.85 → 1.0.87

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 (61) hide show
  1. package/dist/index.cjs +218 -270
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +219 -271
  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 +218 -270
  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/Consent/index.js +3 -3
  14. package/es/core/components/DiyPortalPreview/VideoWidget.js +3 -3
  15. package/es/core/components/SxpPageRender/FingerSwipeTip/index.js +1 -1
  16. package/es/core/components/SxpPageRender/FormatImage.js +2 -2
  17. package/es/core/components/SxpPageRender/LikeButton/index.js +1 -1
  18. package/es/core/components/SxpPageRender/Navbar.js +1 -1
  19. package/es/core/components/SxpPageRender/Nudge/index.js +1 -1
  20. package/es/core/components/SxpPageRender/Tagbar.js +6 -7
  21. package/es/core/components/SxpPageRender/ToggleButton/index.js +2 -2
  22. package/es/core/components/SxpPageRender/VideoWidget/index.js +3 -3
  23. package/es/core/components/SxpPageRender/WaterFall/List.js +2 -2
  24. package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +18 -53
  25. package/es/core/components/SxpPageRender/WaterFall/index.js +2 -4
  26. package/es/core/components/SxpPageRender/index.js +56 -55
  27. package/es/core/context/SxpDataSourceProvider.d.ts +4 -0
  28. package/es/core/context/SxpDataSourceProvider.js +20 -17
  29. package/es/core/hooks/useEventReport.d.ts +1 -1
  30. package/es/core/hooks/useEventReport.js +13 -10
  31. package/es/materials/sxp/popup/AppointForm/index.js +1 -1
  32. package/es/materials/sxp/popup/CommodityDetail/index.js +3 -3
  33. package/es/materials/sxp/popup/CommodityDetailDiro/index.js +4 -4
  34. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +3 -3
  35. package/es/materials/sxp/popup/Prompt/index.js +2 -2
  36. package/es/materials/sxp/template/Appoint/index.js +1 -1
  37. package/lib/core/components/Consent/index.js +3 -3
  38. package/lib/core/components/DiyPortalPreview/VideoWidget.js +3 -3
  39. package/lib/core/components/SxpPageRender/FingerSwipeTip/index.js +1 -1
  40. package/lib/core/components/SxpPageRender/FormatImage.js +2 -2
  41. package/lib/core/components/SxpPageRender/LikeButton/index.js +1 -1
  42. package/lib/core/components/SxpPageRender/Navbar.js +1 -1
  43. package/lib/core/components/SxpPageRender/Nudge/index.js +1 -1
  44. package/lib/core/components/SxpPageRender/Tagbar.js +7 -8
  45. package/lib/core/components/SxpPageRender/ToggleButton/index.js +2 -2
  46. package/lib/core/components/SxpPageRender/VideoWidget/index.js +3 -3
  47. package/lib/core/components/SxpPageRender/WaterFall/List.js +2 -2
  48. package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +18 -53
  49. package/lib/core/components/SxpPageRender/WaterFall/index.js +2 -4
  50. package/lib/core/components/SxpPageRender/index.js +56 -55
  51. package/lib/core/context/SxpDataSourceProvider.d.ts +4 -0
  52. package/lib/core/context/SxpDataSourceProvider.js +21 -18
  53. package/lib/core/hooks/useEventReport.d.ts +1 -1
  54. package/lib/core/hooks/useEventReport.js +13 -10
  55. package/lib/materials/sxp/popup/AppointForm/index.js +1 -1
  56. package/lib/materials/sxp/popup/CommodityDetail/index.js +3 -3
  57. package/lib/materials/sxp/popup/CommodityDetailDiro/index.js +4 -4
  58. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +3 -3
  59. package/lib/materials/sxp/popup/Prompt/index.js +2 -2
  60. package/lib/materials/sxp/template/Appoint/index.js +1 -1
  61. package/package.json +1 -1
@@ -5,7 +5,6 @@ import { storeAndLoadFeSessionId } from '../utils/sessionStore';
5
5
  import { storeAndLoadFeUserId, AGREE_POLICY } from '../utils/localStore';
6
6
  import { useIconLink } from '../components/SxpPageRender/useIconLink';
7
7
  import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../utils/event';
8
- import Consent from '../components/Consent';
9
8
  export const SxpDataSourceContext = createContext({
10
9
  rtcList: [],
11
10
  tagList: []
@@ -15,8 +14,8 @@ var DataSourceType;
15
14
  DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
16
15
  })(DataSourceType || (DataSourceType = {}));
17
16
  const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
17
+ export const DEFAULT_TAG = 'FOR U';
18
18
  const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isShowTag = true, isOpenConsent = false, globalConfig, isEditor = false }) => {
19
- var _a, _b, _c;
20
19
  const [rtcList, setRtcList] = useState([]);
21
20
  const [tagList, setTagList] = useState([]);
22
21
  const [loading, setLoading] = useState(false);
@@ -33,6 +32,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
33
32
  const [videoRef, setVideoRef] = useState(null);
34
33
  const themeTag = useRef();
35
34
  const curTime = useRef();
35
+ const [selectTag, setSelectTag] = useState(DEFAULT_TAG);
36
36
  const isShowConsent = useMemo(() => {
37
37
  var _a, _b, _c, _d;
38
38
  return (((_d = (_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) === null || _d === void 0 ? void 0 : _d.privacy_necessity) && !isAgreePolicy && !isEditor) || isOpenConsent;
@@ -76,10 +76,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
76
76
  .catch((err) => Promise.reject(err));
77
77
  }, [bffDataSource]);
78
78
  const getRecommendVideos = useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
79
- var _d, _e, _f, _g, _h;
79
+ var _a, _b, _c, _d, _e;
80
80
  query = {
81
- maxSize: (_d = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _d !== void 0 ? _d : maxSize,
82
- defaultSize: (_e = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _e !== void 0 ? _e : defaultSize,
81
+ maxSize: (_a = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _a !== void 0 ? _a : maxSize,
82
+ defaultSize: (_b = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _b !== void 0 ? _b : defaultSize,
83
83
  'itemFilter.itemId': query === null || query === void 0 ? void 0 : query['itemFilter.itemId'],
84
84
  'itemFilter.itemType': query === null || query === void 0 ? void 0 : query['itemFilter.itemType'],
85
85
  hashTag: query === null || query === void 0 ? void 0 : query.hashTag,
@@ -87,10 +87,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
87
87
  themeTag: query === null || query === void 0 ? void 0 : query.themeTag
88
88
  };
89
89
  if (utmVal) {
90
- const val = (_h = (_g = (_f = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _f === void 0 ? void 0 : _f.filter((val) => {
90
+ const val = (_e = (_d = (_c = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _c === void 0 ? void 0 : _c.filter((val) => {
91
91
  const key = val.split('=')[0];
92
92
  return UTM_KEYS.includes(key);
93
- })) === null || _g === void 0 ? void 0 : _g.join('&')) !== null && _h !== void 0 ? _h : '';
93
+ })) === null || _d === void 0 ? void 0 : _d.join('&')) !== null && _e !== void 0 ? _e : '';
94
94
  query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
95
95
  }
96
96
  const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
@@ -102,7 +102,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
102
102
  return result === null || result === void 0 ? void 0 : result.data;
103
103
  }), [bffFetch, utmVal, maxSize, defaultSize]);
104
104
  const loadVideos = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
105
- var _j, _k;
105
+ var _f, _g;
106
106
  if (rtcList.length <= 0) {
107
107
  return;
108
108
  }
@@ -112,8 +112,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
112
112
  'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
113
113
  themeTag: themeTag.current
114
114
  });
115
- setRtcList(rtcList.concat((_j = data === null || data === void 0 ? void 0 : data.recList) !== null && _j !== void 0 ? _j : []));
116
- setCacheRtcList(cacheRtcList.concat((_k = data === null || data === void 0 ? void 0 : data.recList) !== null && _k !== void 0 ? _k : []));
115
+ setRtcList(rtcList.concat((_f = data === null || data === void 0 ? void 0 : data.recList) !== null && _f !== void 0 ? _f : []));
116
+ setCacheRtcList(cacheRtcList.concat((_g = data === null || data === void 0 ? void 0 : data.recList) !== null && _g !== void 0 ? _g : []));
117
117
  }), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
118
118
  const bffEventReport = useCallback(({ userInfo, eventInfo }) => {
119
119
  if (!enableReportEvent) {
@@ -171,16 +171,16 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
171
171
  return res === null || res === void 0 ? void 0 : res.success;
172
172
  }), [bffFetch]);
173
173
  const bffGetTagList = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
174
- var _l, _m, _o, _p, _q;
174
+ var _h, _j, _k, _l, _m;
175
175
  if (!utmVal || !isShowTag)
176
176
  return;
177
177
  try {
178
- const val = (_o = (_m = (_l = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _l === void 0 ? void 0 : _l.filter((val) => {
178
+ const val = (_k = (_j = (_h = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _h === void 0 ? void 0 : _h.filter((val) => {
179
179
  const key = val.split('=')[0];
180
180
  return UTM_KEYS.includes(key);
181
- })) === null || _m === void 0 ? void 0 : _m.join('&')) !== null && _o !== void 0 ? _o : '';
181
+ })) === null || _j === void 0 ? void 0 : _j.join('&')) !== null && _k !== void 0 ? _k : '';
182
182
  const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
183
- setTagList((_q = (_p = result === null || result === void 0 ? void 0 : result.data) === null || _p === void 0 ? void 0 : _p.tags) !== null && _q !== void 0 ? _q : []);
183
+ setTagList((_m = (_l = result === null || result === void 0 ? void 0 : result.data) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []);
184
184
  }
185
185
  catch (e) {
186
186
  console.log('e', e);
@@ -311,13 +311,16 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
311
311
  setIsAgreePolicy,
312
312
  curTime,
313
313
  h5EnterLink,
314
- themeTag
315
- } }, 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({
314
+ themeTag,
315
+ isShowConsent,
316
+ selectTag,
317
+ setSelectTag
318
+ } }, render({
316
319
  rtcList,
317
320
  mutateLike: bffMutateLike,
318
321
  mutateUnlike: bffMutateUnlike,
319
322
  submitForm: bffSubmitForm,
320
323
  tagList
321
- }))));
324
+ })));
322
325
  };
323
326
  export default memo(SxpDataSourceProvider);
@@ -2,5 +2,5 @@ import { RecItemType } from '../components/SxpPageRender/typing';
2
2
  export declare function useEventReport(): {
3
3
  jumpToWeb: (data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta'], position?: number) => void;
4
4
  productView: (data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta'], viewTime?: any, position?: number) => void;
5
- backMainFeed: (lastFeed?: 'theme' | 'branch' | 'external', themeTag?: string, hashTag?: string) => void;
5
+ backMainFeed: (lastFeed: 'theme' | 'branch' | 'external', selectTag?: string, themeTag?: string, hashTag?: string) => void;
6
6
  };
@@ -1,5 +1,6 @@
1
1
  import { useCallback } from 'react';
2
2
  import { useSxpDataSource } from './useSxpDataSource';
3
+ import { DEFAULT_TAG } from '../context/SxpDataSourceProvider';
3
4
  export function useEventReport() {
4
5
  const { bffEventReport, popupDetailData, waterFallData, isFromHashtag } = useSxpDataSource();
5
6
  const jumpToWeb = useCallback((data, product, cta, position) => {
@@ -66,16 +67,18 @@ export function useEventReport() {
66
67
  }
67
68
  });
68
69
  }, [bffEventReport, popupDetailData]);
69
- const backMainFeed = useCallback((lastFeed, themeTag, hashTag) => {
70
- bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
71
- eventInfo: {
72
- lastFeed,
73
- themeTags: themeTag ? `[${themeTag}]` : '',
74
- hashTags: hashTag ? `[${hashTag}]` : '',
75
- eventSubject: 'backMainFeed',
76
- eventDescription: 'back Main Feed'
77
- }
78
- });
70
+ const backMainFeed = useCallback((lastFeed, selectTag, themeTag, hashTag) => {
71
+ if (selectTag && selectTag === DEFAULT_TAG) {
72
+ bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
73
+ eventInfo: {
74
+ lastFeed,
75
+ themeTags: themeTag ? `['${themeTag}']` : '',
76
+ hashTags: hashTag ? `['${hashTag}']` : '',
77
+ eventSubject: 'backMainFeed',
78
+ eventDescription: 'back Main Feed'
79
+ }
80
+ });
81
+ }
79
82
  }, [bffEventReport]);
80
83
  return {
81
84
  jumpToWeb,
@@ -84,6 +84,6 @@ const AppointForm = (_a) => {
84
84
  React.createElement("div", { className: 'pb-appoint-form-container' },
85
85
  React.createElement(BetaSchemaForm, { columns: columnsData, submitter: false, layout: layoutType, autoFocusFirstInput: false, size: 'large', formRef: formRef, className: 'panel-reset' }))),
86
86
  React.createElement("div", { className: 'pb-appoint-form-btn-wrapper' },
87
- React.createElement("button", { onClick: handleSubmit, className: 'pb-appoint-form-btn', style: Object.assign({ color: submitColor, background: submitBgColor }, submitButtonStyle) }, loading ? React.createElement(React.Fragment, null, "loading...") : submitText))));
87
+ React.createElement("button", { "aria-label": submitText, onClick: handleSubmit, className: 'pb-appoint-form-btn', style: Object.assign({ color: submitColor, background: submitBgColor }, submitButtonStyle) }, loading ? React.createElement(React.Fragment, null, "loading...") : submitText))));
88
88
  };
89
89
  export default memo(AppointForm);
@@ -73,8 +73,8 @@ const CommodityDetail = (_a) => {
73
73
  18-karat gold, this necklace is embellished with hand-set diamonds.`, maxStr: 79, className: 'pb-commondity-content-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info }))));
74
74
  };
75
75
  const renderBtn = () => {
76
- var _a;
77
- return (React.createElement(React.Fragment, null, (isDefault || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { onClick: handleLink, className: 'pb-commondity-btn', style: buttonStyle }, (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website'))));
76
+ var _a, _b;
77
+ return (React.createElement(React.Fragment, null, (isDefault || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website', onClick: handleLink, className: 'pb-commondity-btn', style: buttonStyle }, (_b = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _b !== void 0 ? _b : 'Purchase on Website'))));
78
78
  };
79
79
  const getStyle = useCallback((style) => {
80
80
  if (style === null || style === void 0 ? void 0 : style.lineClamp) {
@@ -120,7 +120,7 @@ const CommodityDetail = (_a) => {
120
120
  top: 0,
121
121
  objectFit: 'cover',
122
122
  width: '100%'
123
- }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
123
+ }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: 'pdp image' }))),
124
124
  React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
125
125
  renderBtn(),
126
126
  React.createElement(Modal, { visible: showModal, onClose: () => setShowModal(false) },
@@ -9,7 +9,7 @@ import arrow from './arrow.png';
9
9
  import { useEventReport } from '../../../../core/hooks/useEventReport';
10
10
  import FormatImage from '../../../../core/components/SxpPageRender/FormatImage';
11
11
  const CommodityDetailDiro = (_a) => {
12
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
12
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
13
13
  var { style, isDefault, rec, viewTime, isPost, bottom_image, index } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "index"]);
14
14
  const [spread, setSpread] = useState(true);
15
15
  const { sxpParameter } = useSxpDataSource();
@@ -149,7 +149,7 @@ const CommodityDetailDiro = (_a) => {
149
149
  top: 0,
150
150
  objectFit: 'cover',
151
151
  width: '100%'
152
- }), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
152
+ }), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: 'pdp image' }))),
153
153
  React.createElement("div", { className: 'pb-commondityDiro-content' },
154
154
  React.createElement("div", { className: 'pb-commondityDiro-content-title' }, (_k = product === null || product === void 0 ? void 0 : product.title) !== null && _k !== void 0 ? _k : 'MEDIUM LADY D-LITE BAG'),
155
155
  React.createElement("div", { className: 'pb-commondityDiro-content-collection', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === '') }, (product === null || product === void 0 ? void 0 : product.collection) || 'Gold-Tone and White Butterfly Zodiac Embroidery'),
@@ -159,12 +159,12 @@ const CommodityDetailDiro = (_a) => {
159
159
  React.createElement("div", { className: 'pb-commondityDiro-desc', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
160
160
  React.createElement("div", { className: 'pb-commondityDiro-desc-collapse', onClick: handleClickCollapse },
161
161
  React.createElement("div", { className: 'pb-commondityDiro-desc-collapse-title' }, "DESCRIPTION"),
162
- React.createElement("img", { className: `pb-commondityDiro-desc-collapse-icon ${spread ? 'pb-commondityDiro-desc-collapse-iconActive' : ''}`, src: arrow, alt: '' })),
162
+ React.createElement("img", { className: `pb-commondityDiro-desc-collapse-icon ${spread ? 'pb-commondityDiro-desc-collapse-iconActive' : ''}`, src: arrow, alt: 'arrow image' })),
163
163
  React.createElement("div", { className: 'pb-commondityDiro-desc-info', hidden: !spread }, (product === null || product === void 0 ? void 0 : product.info) ||
164
164
  'The Lady D-Lite bag combines classic elegance with House modernity. The style is fully embroidered with a gold-tone and white Butterfly Zodiac motif by Pietro Ruffo, showcasing a constellation enhanced by astrological signs and adorned with butterflies. A Christian Dior Paris signature adorns the front, while D.I.O.R. charms in pale gold-finish metal further enhance and highlight the silhouette. Featuring a wide, removable embroidered shoulder strap, the medium Lady D-Lite bag can be carried by hand or worn crossbody.')),
165
165
  (!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement(React.Fragment, null,
166
166
  React.createElement("div", { className: 'pb-commondityDiro-h90' }),
167
167
  React.createElement("div", { className: 'pb-commondityDiro-bottom' },
168
- React.createElement("button", { onClick: handleLink, className: 'pb-commondityDiro-bottom-btn' }, (_l = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _l !== void 0 ? _l : 'SHOP NOW')))))));
168
+ React.createElement("button", { "aria-label": (_l = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _l !== void 0 ? _l : 'SHOP NOW', onClick: handleLink, className: 'pb-commondityDiro-bottom-btn' }, (_m = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _m !== void 0 ? _m : 'SHOP NOW')))))));
169
169
  };
170
170
  export default memo(CommodityDetailDiro);
@@ -10,7 +10,7 @@ import ExpandableText from '../../../../core/components/SxpPageRender/Expandable
10
10
  import { useEventReport } from '../../../../core/hooks/useEventReport';
11
11
  import FormatImage from '../../../../core/components/SxpPageRender/FormatImage';
12
12
  const CommodityDetailDiroNew = (_a) => {
13
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
13
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
14
14
  var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index"]);
15
15
  const [spread, setSpread] = useState(true);
16
16
  const { sxpParameter } = useSxpDataSource();
@@ -138,7 +138,7 @@ Made in Italy` })));
138
138
  top: 0,
139
139
  objectFit: 'cover',
140
140
  width: '100%'
141
- }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
141
+ }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: 'pdp image' }))),
142
142
  React.createElement("div", { className: 'pb-commondityDiroNew-content' },
143
143
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
144
144
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
@@ -147,7 +147,7 @@ Made in Italy` })));
147
147
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
148
148
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) }, priceText),
149
149
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo) }, (_m = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _m !== void 0 ? _m : '税费'))),
150
- (!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle }, (_o = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _o !== void 0 ? _o : 'Shop now')),
150
+ (!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (_o = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _o !== void 0 ? _o : 'Shop now', onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle }, (_p = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _p !== void 0 ? _p : 'Shop now')),
151
151
  productInfoText({ isPost }))),
152
152
  React.createElement(Modal, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
153
153
  };
@@ -27,8 +27,8 @@ const Prompt = (_a) => {
27
27
  };
28
28
  return (React.createElement("div", Object.assign({ className: `pb-prompt ${css(Object.assign({}, style))}` }, props),
29
29
  React.createElement("div", { className: 'pb-prompt-icon' },
30
- React.createElement("img", { width: '100%', src: iconSrc !== null && iconSrc !== void 0 ? iconSrc : success })),
30
+ React.createElement("img", { width: '100%', src: iconSrc !== null && iconSrc !== void 0 ? iconSrc : success, alt: 'success image' })),
31
31
  React.createElement("div", { className: 'pb-prompt-content' }, content),
32
- React.createElement("button", { className: 'pb-prompt-btn', style: submitButtonStyle, onClick: handleOk }, btnText)));
32
+ React.createElement("button", { "aria-label": btnText, className: 'pb-prompt-btn', style: submitButtonStyle, onClick: handleOk }, btnText)));
33
33
  };
34
34
  export default memo(Prompt);
@@ -10,7 +10,7 @@ const Appoint = (_a) => {
10
10
  const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
11
11
  return (React.createElement(EventProvider, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props),
12
12
  React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
13
- React.createElement("img", { className: css({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }), src: (_d = (_c = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, alt: '' })),
13
+ React.createElement("img", { className: css({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }), src: (_d = (_c = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, alt: 'cta image' })),
14
14
  React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', textOverflow: 'ellipsis' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_e = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _e !== void 0 ? _e : 'Product Name')));
15
15
  };
16
16
  export default memo(Appoint);
@@ -41,7 +41,7 @@ const Consent = ({ width = window.innerWidth, height = window.innerHeight, priva
41
41
  eventSubject: 'userConsent',
42
42
  eventDescription: '用户授权【操作结果】',
43
43
  consentResult: '0',
44
- consentTags: '[]',
44
+ consentTags: '["系统运营"]',
45
45
  rtc: null,
46
46
  requestId: null,
47
47
  sessionID: null
@@ -56,7 +56,7 @@ const Consent = ({ width = window.innerWidth, height = window.innerHeight, priva
56
56
  react_1.default.createElement("div", { className: 'consent-title' }, privacy_title !== null && privacy_title !== void 0 ? privacy_title : 'Privacy Policy'),
57
57
  react_1.default.createElement("div", { className: 'consent-content' }, privacy_context !== null && privacy_context !== void 0 ? privacy_context : 'This site uses cookies to improve your online experience. By continuing to use the site please agree the policy first.')),
58
58
  react_1.default.createElement("div", { className: 'consent-col' },
59
- react_1.default.createElement("button", { className: 'consent-btn', onClick: handleAgree }, "Agree"),
60
- react_1.default.createElement("a", { className: 'consent-policy', target: '_blank', href: privacy_policy_url }, privacy_policy_title !== null && privacy_policy_title !== void 0 ? privacy_policy_title : 'More information')))));
59
+ react_1.default.createElement("button", { "aria-label": 'agree', className: 'consent-btn', onClick: handleAgree }, "Agree"),
60
+ react_1.default.createElement("a", { className: 'consent-policy', target: '_blank', href: privacy_policy_url ? `https://${privacy_policy_url}` : undefined }, privacy_policy_title !== null && privacy_policy_title !== void 0 ? privacy_policy_title : 'More information')))));
61
61
  };
62
62
  exports.default = (0, react_1.memo)(Consent);
@@ -175,7 +175,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
175
175
  if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
176
176
  return null;
177
177
  }
178
- return (react_1.default.createElement("img", { style: { position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', objectFit: 'cover' }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image }));
178
+ return (react_1.default.createElement("img", { style: { position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', objectFit: 'cover' }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, alt: 'video poster' }));
179
179
  }, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
180
180
  (0, react_1.useEffect)(() => {
181
181
  const handleBeforeUnload = () => {
@@ -224,7 +224,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
224
224
  height,
225
225
  objectFit: 'contain'
226
226
  } }),
227
- react_1.default.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
227
+ react_1.default.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON, alt: 'video pause image' }))),
228
228
  renderPoster)) : (react_1.default.createElement("div", { className: 'video-container', key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, onClick: handleClickVideo(), style: {
229
229
  position: 'relative',
230
230
  width,
@@ -233,6 +233,6 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
233
233
  } },
234
234
  react_1.default.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', style: { width: '100%' }, ref: videoRef, crossOrigin: 'anonymous', muted: true, autoPlay: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart }),
235
235
  renderPoster,
236
- react_1.default.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
236
+ react_1.default.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON, alt: 'video pause image' })))));
237
237
  };
238
238
  exports.default = (0, react_1.memo)(VideoWidget);
@@ -17,6 +17,6 @@ const FingerSwipeTip = ({ imageUrl, style }) => {
17
17
  return show ? 'pb-fadeIn' : 'pb-fadeOut';
18
18
  }, [show]);
19
19
  return (react_1.default.createElement("div", { hidden: !show, className: `pb-finger-wrap ${animationCls}`, style: style },
20
- react_1.default.createElement("img", { src: imageUrl || FINGER_SWIPE_ICON })));
20
+ react_1.default.createElement("img", { src: imageUrl || FINGER_SWIPE_ICON, alt: 'finger swiper' })));
21
21
  };
22
22
  exports.default = FingerSwipeTip;
@@ -25,8 +25,8 @@ const FormatImage = (0, react_1.forwardRef)((props, ref) => {
25
25
  react_1.default.createElement("source", { type: 'image/jpeg', srcSet: `${imgSrc}?imageMogr2/format/jpg` }),
26
26
  react_1.default.createElement("img", { className: className, src: imgSrc, style: style, loading: loading, onLoad: (e) => {
27
27
  onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
28
- } }))) : (react_1.default.createElement("img", { className: className, src: imgSrc, style: style, loading: loading, onLoad: (e) => {
28
+ }, alt: 'image' }))) : (react_1.default.createElement("img", { className: className, src: imgSrc, style: style, loading: loading, onLoad: (e) => {
29
29
  onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
30
- } }))));
30
+ }, alt: 'image' }))));
31
31
  });
32
32
  exports.default = (0, react_1.memo)(FormatImage);
@@ -54,7 +54,7 @@ const LikeButton = (_a) => {
54
54
  }
55
55
  }
56
56
  }), 200);
57
- return (react_1.default.createElement("button", Object.assign({}, props, { onClick: handleClick }),
57
+ return (react_1.default.createElement("button", Object.assign({}, props, { "aria-label": 'like', onClick: handleClick }),
58
58
  react_1.default.createElement("img", { style: { width: '100%', height: '100%', objectFit: 'contain' }, src: state ? activeIcon || likeIcon : unActicveIcon || unlikeIcon, alt: 'icon' })));
59
59
  };
60
60
  exports.default = (0, react_1.memo)(LikeButton);
@@ -7,7 +7,7 @@ const Navbar = ({ icon, styles, textStyle, onClose }) => {
7
7
  var _a;
8
8
  const { waterFallData, setOpenHashtag } = (0, hooks_1.useSxpDataSource)();
9
9
  return (react_1.default.createElement("div", { className: 'clc-sxp-nav', style: styles },
10
- react_1.default.createElement("img", { className: 'clc-sxp-nav-left', src: icon, alt: '', onClick: onClose }),
10
+ react_1.default.createElement("img", { className: 'clc-sxp-nav-left', src: icon, alt: 'back button', onClick: onClose }),
11
11
  react_1.default.createElement("div", { className: 'clc-sxp-nav-title', style: textStyle }, `#${(_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag) !== null && _a !== void 0 ? _a : '标题'}`)));
12
12
  };
13
13
  exports.default = (0, react_1.memo)(Navbar);
@@ -11,7 +11,7 @@ const Nudge = ({ nudge }) => {
11
11
  backgroundColor: nudge === null || nudge === void 0 ? void 0 : nudge.backgroundColor,
12
12
  borderRadius: (_f = nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius) !== null && _f !== void 0 ? _f : 4
13
13
  } },
14
- (nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? react_1.default.createElement("img", { src: nudge.icon, style: { height: '100%', objectFit: 'cover', flexShrink: 0 } }) : null,
14
+ (nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? (react_1.default.createElement("img", { src: nudge.icon, alt: 'nudge icon', style: { height: '100%', objectFit: 'cover', flexShrink: 0 } })) : null,
15
15
  react_1.default.createElement("p", { style: Object.assign(Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle), { textWrap: 'nowrap', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap', flex: 1, marginBottom: 0 }) }, (_g = nudge === null || nudge === void 0 ? void 0 : nudge.content) !== null && _g !== void 0 ? _g : '')))));
16
16
  };
17
17
  exports.default = Nudge;
@@ -5,13 +5,12 @@ const react_1 = tslib_1.__importStar(require("react"));
5
5
  const hooks_1 = require("../../../core/hooks");
6
6
  const event_1 = tslib_1.__importStar(require("../../../core/utils/event"));
7
7
  const useEventReport_1 = require("../../../core/hooks/useEventReport");
8
- const DEFAULT_TAG = 'FOR U';
8
+ const SxpDataSourceProvider_1 = require("../../../core/context/SxpDataSourceProvider");
9
9
  const Tagbar = ({ tagList = [], setActiveIndex }) => {
10
- const [selectTag, setSelectTag] = (0, react_1.useState)(DEFAULT_TAG);
11
- const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef, waterFallData, bffEventReport } = (0, hooks_1.useSxpDataSource)();
10
+ const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef, waterFallData, bffEventReport, selectTag, setSelectTag } = (0, hooks_1.useSxpDataSource)();
12
11
  const { backMainFeed } = (0, useEventReport_1.useEventReport)();
13
12
  const realTagList = (0, react_1.useMemo)(() => {
14
- return [DEFAULT_TAG, ...tagList];
13
+ return [SxpDataSourceProvider_1.DEFAULT_TAG, ...tagList];
15
14
  }, [tagList]);
16
15
  const handleSelectTag = (tag) => () => {
17
16
  if (tag === selectTag)
@@ -21,15 +20,15 @@ const Tagbar = ({ tagList = [], setActiveIndex }) => {
21
20
  eventInfo: {
22
21
  eventSubject: 'clickThemeTagsViewContents',
23
22
  eventDescription: 'click Theme Tags View Contents',
24
- themeTags: `[${tag}]`
23
+ themeTags: `['${tag}']`
25
24
  }
26
25
  });
27
26
  }
28
27
  else {
29
- backMainFeed('theme', selectTag);
28
+ backMainFeed('theme', tag, selectTag);
30
29
  }
31
30
  let themeTag;
32
- if (tag !== DEFAULT_TAG) {
31
+ if (tag !== SxpDataSourceProvider_1.DEFAULT_TAG) {
33
32
  themeTag = tag;
34
33
  }
35
34
  setLoading === null || setLoading === void 0 ? void 0 : setLoading(true);
@@ -44,7 +43,7 @@ const Tagbar = ({ tagList = [], setActiveIndex }) => {
44
43
  }).finally(() => {
45
44
  setLoading === null || setLoading === void 0 ? void 0 : setLoading(false);
46
45
  });
47
- setSelectTag(tag);
46
+ setSelectTag === null || setSelectTag === void 0 ? void 0 : setSelectTag(tag);
48
47
  };
49
48
  if (waterFallData || tagList.length <= 0)
50
49
  return null;
@@ -10,7 +10,7 @@ const ToggleButton = ({ defaultValue, activeIcon, unactiveIcon, onChange, style
10
10
  setIsTure(result);
11
11
  onChange === null || onChange === void 0 ? void 0 : onChange(result);
12
12
  };
13
- return (react_1.default.createElement("button", { style: style, className: 'pb-toggle-button', onClick: handleClick },
14
- react_1.default.createElement("img", { className: 'pb-toggle-button-icon', src: isTrue ? activeIcon : unactiveIcon })));
13
+ return (react_1.default.createElement("button", { style: style, "aria-label": 'toggle button', className: 'pb-toggle-button', onClick: handleClick },
14
+ react_1.default.createElement("img", { className: 'pb-toggle-button-icon', alt: 'toggle image', src: isTrue ? activeIcon : unactiveIcon })));
15
15
  };
16
16
  exports.default = (0, react_1.memo)(ToggleButton);
@@ -251,7 +251,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
251
251
  if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
252
252
  return null;
253
253
  }
254
- return (react_1.default.createElement("img", { style: { position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', objectFit: 'cover' }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image }));
254
+ return (react_1.default.createElement("img", { style: { position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', objectFit: 'cover' }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, alt: 'placeholder image' }));
255
255
  }, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
256
256
  (0, react_1.useEffect)(() => {
257
257
  if (!videoRef)
@@ -284,7 +284,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
284
284
  } },
285
285
  react_1.default.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' } },
286
286
  react_1.default.createElement("div", { className: 'n-full-screen', ref: videoEleRef, id: videoId, style: { width: '100%', height: '100%' } }),
287
- react_1.default.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
287
+ react_1.default.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', alt: 'pause', src: PAUSE_ICON }))),
288
288
  renderPoster)) : (react_1.default.createElement("div", { className: 'video-container', key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, style: {
289
289
  position: 'relative',
290
290
  width: '100%',
@@ -293,6 +293,6 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
293
293
  }, onClick: handleClickVideo() },
294
294
  react_1.default.createElement("div", { className: 'n-full-screen', ref: videoEleRef, id: videoId, style: { width: '100%', height: '100%' } }),
295
295
  renderPoster,
296
- react_1.default.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
296
+ react_1.default.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON, alt: 'pause' })))));
297
297
  };
298
298
  exports.default = (0, react_1.memo)(VideoWidget);
@@ -116,7 +116,7 @@ const WaterfallFlowItem = (props) => {
116
116
  react_1.default.createElement("div", { className: 'list-content-listItem-info-price', style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price, hidden: !priceText }, priceText))));
117
117
  };
118
118
  function WaterfallList(_a) {
119
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
119
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
120
120
  var { reportTagsView, showBanner } = _a, props = tslib_1.__rest(_a, ["reportTagsView", "showBanner"]);
121
121
  const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = (0, hooks_1.useSxpDataSource)();
122
122
  const [list, setList] = (0, react_1.useState)();
@@ -189,6 +189,6 @@ function WaterfallList(_a) {
189
189
  } })),
190
190
  react_1.default.createElement("div", { className: 'list-bottom', hidden: !((_o = data === null || data === void 0 ? void 0 : data.tag) === null || _o === void 0 ? void 0 : _o.link), style: props === null || props === void 0 ? void 0 : props.buttonBgStyle }),
191
191
  react_1.default.createElement("div", { hidden: !((_p = data === null || data === void 0 ? void 0 : data.tag) === null || _p === void 0 ? void 0 : _p.link), className: 'list-btn-wrap', style: Object.assign(Object.assign({}, props === null || props === void 0 ? void 0 : props.buttonBgStyle), { height: 'auto', backgroundColor: 'transparent' }) },
192
- react_1.default.createElement("button", { className: 'list-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((_q = data === null || data === void 0 ? void 0 : data.tag) === null || _q === void 0 ? void 0 : _q.linkTitle) || 'Shop the collection'))))));
192
+ react_1.default.createElement("button", { "aria-label": ((_q = data === null || data === void 0 ? void 0 : data.tag) === null || _q === void 0 ? void 0 : _q.linkTitle) || 'Shop the collection', className: 'list-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((_r = data === null || data === void 0 ? void 0 : data.tag) === null || _r === void 0 ? void 0 : _r.linkTitle) || 'Shop the collection'))))));
193
193
  }
194
194
  exports.default = WaterfallList;
@@ -73,56 +73,24 @@ const WaterfallFlowItem = (props) => {
73
73
  if (imgDom.current === null || src === '') {
74
74
  return;
75
75
  }
76
- const img = new Image();
76
+ let imgSrc = null;
77
77
  if (showVideo && firstFrameSrc) {
78
- img.src = firstFrameSrc;
78
+ imgSrc = firstFrameSrc;
79
79
  }
80
80
  else {
81
- img.src = src;
81
+ imgSrc = src;
82
82
  }
83
- img.onload = () => {
84
- setImgInfo({
85
- height: img.height,
86
- width: img.width
87
- });
88
- setIsLoading(true);
89
- };
90
- imgDom.current.setSrc(img.src);
91
- }, [src, showVideo, firstFrameSrc, isImgShow]);
92
- (0, react_1.useEffect)(() => {
93
- const height = imgInfo.height * (unitWidth / imgInfo.width);
94
- if (isLoading) {
95
- sizeChange(height + 76 + space, index);
96
- }
97
- }, [imgInfo, index, unitWidth, isLoading, space]);
98
- const calculateHeightForWidth = (videoWidth, videoHeight, targetWidth) => {
99
- const aspectRatio = videoWidth / videoHeight;
100
- const targetHeight = targetWidth / aspectRatio;
101
- return targetHeight;
102
- };
103
- (0, react_1.useEffect)(() => {
104
- const video = videoDom === null || videoDom === void 0 ? void 0 : videoDom.current;
105
- if (video === null || src === '' || !showVideo) {
106
- return;
107
- }
108
- video.src = src;
109
- video.currentTime = 1;
110
- video.crossOrigin = 'anonymous';
111
- video.onloadeddata = () => {
112
- const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
113
- if (!canvas)
114
- return;
115
- const ctx = canvas.getContext('2d');
116
- const targetWidth = (window === null || window === void 0 ? void 0 : window.innerWidth) / 2;
117
- const targetHeight = calculateHeightForWidth(video.videoWidth, video.videoHeight, targetWidth);
118
- canvas.height = targetHeight;
119
- canvas.width = targetWidth;
120
- ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
121
- setFirstFrameSrc(canvas.toDataURL());
122
- video.remove();
123
- canvas.remove();
124
- };
125
- }, [src, showVideo]);
83
+ if (imgSrc)
84
+ imgDom.current.setSrc(imgSrc);
85
+ }, [src, showVideo, firstFrameSrc]);
86
+ const pictRef = (0, react_1.useRef)();
87
+ const imgLoad = (0, react_1.useCallback)((img) => {
88
+ setTimeout(() => {
89
+ var _a;
90
+ const height = (_a = pictRef === null || pictRef === void 0 ? void 0 : pictRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight;
91
+ sizeChange(height + 56 + space, index);
92
+ }, 0);
93
+ }, [space, sizeChange, index, unitWidth, pictRef]);
126
94
  const handleClickToDetail = () => {
127
95
  reportTagsView();
128
96
  setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(list);
@@ -133,17 +101,14 @@ const WaterfallFlowItem = (props) => {
133
101
  }, 0);
134
102
  };
135
103
  return (react_1.default.createElement("div", { ref: ref, style: Object.assign({}, style), className: 'waterFallList-content-listItem', key: index, onClick: handleClickToDetail },
136
- react_1.default.createElement("div", { className: 'waterFallList-content-listItem-picture' },
137
- showVideo && (react_1.default.createElement("div", { style: { display: 'none' } },
138
- react_1.default.createElement("video", { ref: videoDom, src: src, crossOrigin: 'anonymous', className: 'waterFallList-content-listItem-picture-img' }),
139
- react_1.default.createElement("canvas", { ref: canvasRef }))),
140
- react_1.default.createElement(FormatImage_1.default, { loading: 'lazy', className: 'waterFallList-content-listItem-picture-img', ref: imgDom })),
104
+ react_1.default.createElement("div", { className: 'waterFallList-content-listItem-picture', ref: pictRef },
105
+ react_1.default.createElement(FormatImage_1.default, { loading: 'lazy', className: 'waterFallList-content-listItem-picture-img', onLoad: imgLoad, ref: imgDom })),
141
106
  react_1.default.createElement("div", { className: 'waterFallList-content-listItem-info' },
142
107
  react_1.default.createElement("div", { className: `${'waterFallList-content-listItem-info-title'} ${priceText ? 'waterFallList-content-listItem-info-nowrap' : ''}`, style: Object.assign({}, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title) }, title && title),
143
108
  react_1.default.createElement("div", { className: 'waterFallList-content-listItem-info-price', hidden: !priceText, style: textStyles.price }, priceText))));
144
109
  };
145
110
  function WaterfallList(_a) {
146
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
111
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
147
112
  var { reportTagsView, showBanner } = _a, props = tslib_1.__rest(_a, ["reportTagsView", "showBanner"]);
148
113
  const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = (0, hooks_1.useSxpDataSource)();
149
114
  const scrollParent = (0, react_1.useRef)(null);
@@ -339,6 +304,6 @@ function WaterfallList(_a) {
339
304
  } }))),
340
305
  react_1.default.createElement("div", { className: 'waterFallList-bottom', hidden: !((_t = data === null || data === void 0 ? void 0 : data.tag) === null || _t === void 0 ? void 0 : _t.link), style: props === null || props === void 0 ? void 0 : props.buttonBgStyle }),
341
306
  react_1.default.createElement("div", { ref: buttonRef, hidden: !((_u = data === null || data === void 0 ? void 0 : data.tag) === null || _u === void 0 ? void 0 : _u.link), className: 'waterFallList-btn-wrap', style: Object.assign(Object.assign({}, props === null || props === void 0 ? void 0 : props.buttonBgStyle), { height: 'auto', backgroundColor: 'transparent' }) },
342
- react_1.default.createElement("button", { className: 'waterFallList-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((_v = data === null || data === void 0 ? void 0 : data.tag) === null || _v === void 0 ? void 0 : _v.linkTitle) || 'Shop the collection'))))));
307
+ react_1.default.createElement("button", { "aria-label": ((_v = data === null || data === void 0 ? void 0 : data.tag) === null || _v === void 0 ? void 0 : _v.linkTitle) || 'Shop the collection', className: 'waterFallList-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((_w = data === null || data === void 0 ? void 0 : data.tag) === null || _w === void 0 ? void 0 : _w.linkTitle) || 'Shop the collection'))))));
343
308
  }
344
309
  exports.default = WaterfallList;