pb-sxp-ui 1.0.46 → 1.0.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/pb-ui.js CHANGED
@@ -11690,7 +11690,7 @@ Made in Italy` })));
11690
11690
  React.createElement("div", { className: 'list-content-listItem-info-price', style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price, hidden: !priceText }, priceText))));
11691
11691
  };
11692
11692
  function WaterfallList(_a) {
11693
- var _b, _c, _d, _e, _f, _g, _h, _j, _k;
11693
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
11694
11694
  var { reportTagsView } = _a, props = __rest(_a, ["reportTagsView"]);
11695
11695
  const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = useSxpDataSource();
11696
11696
  const [list, setList] = React.useState();
@@ -11767,16 +11767,12 @@ Made in Italy` })));
11767
11767
  return (React.createElement(WaterfallFlowItem, Object.assign({ key: ind, index: ind, rec: item, list: list, reportTagsView: reportTagsView }, props)));
11768
11768
  })),
11769
11769
  React.createElement("div", { hidden: !isLoadMore, style: { textAlign: 'center' } }, "loading..."),
11770
- React.createElement("div", {
11771
- // hidden={!data?.tag?.link}
11772
- style: {
11773
- height: ((_g = data === null || data === void 0 ? void 0 : data.tag) === null || _g === void 0 ? void 0 : _g.link) ? ((_h = props === null || props === void 0 ? void 0 : props.buttonBgStyle) === null || _h === void 0 ? void 0 : _h.height) || ((_j = props === null || props === void 0 ? void 0 : props.buttonStyle) === null || _j === void 0 ? void 0 : _j.height) || '100px' : 0
11770
+ React.createElement("div", { hidden: !((_g = data === null || data === void 0 ? void 0 : data.tag) === null || _g === void 0 ? void 0 : _g.link), style: {
11771
+ height: ((_h = data === null || data === void 0 ? void 0 : data.tag) === null || _h === void 0 ? void 0 : _h.link) ? ((_j = props === null || props === void 0 ? void 0 : props.buttonBgStyle) === null || _j === void 0 ? void 0 : _j.height) || ((_k = props === null || props === void 0 ? void 0 : props.buttonStyle) === null || _k === void 0 ? void 0 : _k.height) || '100px' : 0
11774
11772
  } })),
11775
- React.createElement("div", { className: 'list-bottom', style: props === null || props === void 0 ? void 0 : props.buttonBgStyle }),
11776
- React.createElement("div", {
11777
- // hidden={!data?.tag?.link}
11778
- className: 'list-btn-wrap', style: Object.assign(Object.assign({}, props === null || props === void 0 ? void 0 : props.buttonBgStyle), { height: 'auto', backgroundColor: 'transparent' }) },
11779
- React.createElement("button", { className: 'list-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((_k = data === null || data === void 0 ? void 0 : data.tag) === null || _k === void 0 ? void 0 : _k.linkTitle) || 'Shop the collection'))))));
11773
+ React.createElement("div", { className: 'list-bottom', hidden: !((_l = data === null || data === void 0 ? void 0 : data.tag) === null || _l === void 0 ? void 0 : _l.link), style: props === null || props === void 0 ? void 0 : props.buttonBgStyle }),
11774
+ React.createElement("div", { hidden: !((_m = data === null || data === void 0 ? void 0 : data.tag) === null || _m === void 0 ? void 0 : _m.link), className: 'list-btn-wrap', style: Object.assign(Object.assign({}, props === null || props === void 0 ? void 0 : props.buttonBgStyle), { height: 'auto', backgroundColor: 'transparent' }) },
11775
+ React.createElement("button", { className: 'list-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((_o = data === null || data === void 0 ? void 0 : data.tag) === null || _o === void 0 ? void 0 : _o.linkTitle) || 'Shop the collection'))))));
11780
11776
  }
11781
11777
 
11782
11778
  var img$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAaZJREFUeF7t2jFKBEEQRuG3mSJeQTARURDMTL2EqXfwAnoKD6FHMDEzNVIw2tzQC2gFggyDrExX1V92T7wz9PumFnqbXdH5teq8nwEwJqBzgfEVKDYAW8Ae8NZq3ZUm4Aa4AnaBR+C8BUIVAIu/ngSfAs9LESoAWLgB/LzWwP7SeLtfHWAu3tZ9Adz/dwD3eOUJCIlXBQiLVwQIjVcDCI9XAkiJVwFIi1cASI3PBpjb3jbd5GyyUcraCUrEZ02ATHwGgFR8NIBcfCSAZHwUgGx8BIB0vDeAfLwnQIl4L4Ay8R4ApeJbA2wD78DOZA/e7ABzk739Xz/T8rfAIfA6WYCd3BqA7NUSwCKfgLNKCK0BjoC7rzP74yoIrQGsuxSCB0ApBC+AMgieACUQvAHkESIApBGiAGQRIgEkEaIB5BAyAKQQsgBkEDIBJBCyAdIRFABSEVQA0hCUAFIQ1ADCERQBQhFUAcIQlAFCENQBfkOwg9eXpeftFQDmEOzv8ifARy8A3wiXwAHwANwujbf7q0xAi9bZZwwAN9oiDx4TUORFuS2z+wn4BAiAaEHnKChjAAAAAElFTkSuQmCC";
@@ -12067,6 +12063,33 @@ Made in Italy` })));
12067
12063
  const [firstFrameSrc, setFirstFrameSrc] = React.useState('');
12068
12064
  const videoId = `pb-cache-video-${index}`;
12069
12065
  const videoEleRef = React.useRef(null);
12066
+ const blur = React.useMemo(() => {
12067
+ return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
12068
+ }, [videoPostConfig]);
12069
+ const translateY = React.useMemo(() => {
12070
+ var _a;
12071
+ return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
12072
+ ? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%) translate3d(0px, 0px, 0px)`
12073
+ : 'translateY(-50%)';
12074
+ }, [videoPostConfig]);
12075
+ const blurBgSrc = React.useMemo(() => {
12076
+ var _a;
12077
+ return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
12078
+ }, [firstFrameSrc, rec]);
12079
+ const blurStyle = React.useMemo(() => {
12080
+ return blur
12081
+ ? {
12082
+ filter: 'blur(10px)',
12083
+ transform: 'translate3d(0px, 0px, 0px) scale(1.2)'
12084
+ }
12085
+ : {};
12086
+ }, [blur]);
12087
+ const isBgColor = React.useMemo(() => {
12088
+ return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.bgWay) === '1';
12089
+ }, [videoPostConfig]);
12090
+ const bgStyle = React.useMemo(() => {
12091
+ return isBgColor && (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.bgColor) ? { backgroundColor: videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.bgColor } : {};
12092
+ }, [videoPostConfig, isBgColor]);
12070
12093
  React.useEffect(() => {
12071
12094
  if (!videoRef)
12072
12095
  return;
@@ -12107,15 +12130,39 @@ Made in Italy` })));
12107
12130
  setIsFirstPlay(false);
12108
12131
  }
12109
12132
  }, [bffEventReport, data, index, isFirstPlay, videoRef]);
12133
+ const handLoadeddata = React.useCallback(() => {
12134
+ var _a;
12135
+ if (!videoRef || isBgColor || firstFrameSrc)
12136
+ return;
12137
+ const videoDomRef = document.getElementById('player-container-id_html5_api');
12138
+ if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !videoDomRef || !canvasRef.current)
12139
+ return;
12140
+ const setFrameImg = () => {
12141
+ const video = videoDomRef;
12142
+ const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
12143
+ const ctx = canvas.getContext('2d');
12144
+ const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
12145
+ const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
12146
+ canvas.height = targetHeight;
12147
+ canvas.width = targetWidth;
12148
+ ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
12149
+ setFirstFrameSrc(canvas.toDataURL());
12150
+ };
12151
+ setFrameImg();
12152
+ setTimeout(() => {
12153
+ setFrameImg();
12154
+ }, 500);
12155
+ }, [videoRef, isBgColor, rec, firstFrameSrc]);
12110
12156
  const handleLoadedmetadata = React.useCallback(() => {
12111
12157
  if (!videoRef)
12112
12158
  return;
12113
- if (activeIndex !== index) {
12114
- videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
12115
- videoRef === null || videoRef === void 0 ? void 0 : videoRef.pause();
12116
- }
12159
+ handLoadeddata();
12160
+ // if (activeIndex !== index) {
12161
+ // videoRef?.play();
12162
+ // videoRef?.pause();
12163
+ // }
12117
12164
  setIsLoadFinish(true);
12118
- }, [activeIndex, index, videoRef]);
12165
+ }, [videoRef, handLoadeddata]);
12119
12166
  const handleCanplay = React.useCallback(() => {
12120
12167
  setIsLoadFinish(true);
12121
12168
  }, []);
@@ -12176,57 +12223,7 @@ Made in Italy` })));
12176
12223
  }
12177
12224
  });
12178
12225
  }
12179
- }, [data, index, bffEventReport, videoRef]);
12180
- const blur = React.useMemo(() => {
12181
- return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
12182
- }, [videoPostConfig]);
12183
- const translateY = React.useMemo(() => {
12184
- var _a;
12185
- return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
12186
- ? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%) translate3d(0px, 0px, 0px)`
12187
- : 'translateY(-50%)';
12188
- }, [videoPostConfig]);
12189
- const blurBgSrc = React.useMemo(() => {
12190
- var _a;
12191
- return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
12192
- }, [firstFrameSrc, rec]);
12193
- const blurStyle = React.useMemo(() => {
12194
- return blur
12195
- ? {
12196
- filter: 'blur(10px)',
12197
- transform: 'translate3d(0px, 0px, 0px) scale(1.2)'
12198
- }
12199
- : {};
12200
- }, [blur]);
12201
- const isBgColor = React.useMemo(() => {
12202
- return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.bgWay) === '1';
12203
- }, [videoPostConfig]);
12204
- const bgStyle = React.useMemo(() => {
12205
- return isBgColor && (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.bgColor) ? { backgroundColor: videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.bgColor } : {};
12206
- }, [videoPostConfig, isBgColor]);
12207
- const handLoadeddata = React.useCallback(() => {
12208
- var _a;
12209
- if (!videoRef || isBgColor)
12210
- return;
12211
- const videoDomRef = document.getElementById('player-container-id_html5_api');
12212
- if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !videoDomRef || !canvasRef.current)
12213
- return;
12214
- const setFrameImg = () => {
12215
- const video = videoDomRef;
12216
- const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
12217
- const ctx = canvas.getContext('2d');
12218
- const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
12219
- const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
12220
- canvas.height = targetHeight;
12221
- canvas.width = targetWidth;
12222
- ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
12223
- setFirstFrameSrc(canvas.toDataURL());
12224
- };
12225
- setFrameImg();
12226
- setTimeout(() => {
12227
- setFrameImg();
12228
- }, 500);
12229
- }, [videoRef, isBgColor, rec]);
12226
+ }, [data, index, bffEventReport, videoRef, activeIndex]);
12230
12227
  React.useEffect(() => {
12231
12228
  if (!isActive || !videoRef)
12232
12229
  return;
@@ -12240,6 +12237,7 @@ Made in Italy` })));
12240
12237
  if (!dom && !dom2)
12241
12238
  return;
12242
12239
  videoPlayerWrapperNode === null || videoPlayerWrapperNode === void 0 ? void 0 : videoPlayerWrapperNode.appendChild(dom || dom2);
12240
+ videoRef.poster('https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240218/fsTan2fgYKJWrCpJtGZPogm0NnvdT1708239153661.jpeg');
12243
12241
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.src(videoSrc);
12244
12242
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('loadedmetadata', handleLoadedmetadata);
12245
12243
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('loadeddata', handLoadeddata);
@@ -12691,7 +12689,7 @@ Made in Italy` })));
12691
12689
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
12692
12690
  *
12693
12691
  */
12694
- const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [] }) => {
12692
+ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [], licenseUrl }) => {
12695
12693
  var _a, _b, _c, _d, _e, _f, _g;
12696
12694
  const { schema } = useEditor();
12697
12695
  const [activeIndex, setActiveIndex] = React.useState(0);
@@ -12747,7 +12745,7 @@ Made in Italy` })));
12747
12745
  if (!firstRef.current && !videoRef) {
12748
12746
  firstRef.current = true;
12749
12747
  const player = TCPlayer('player-container-id', {
12750
- licenseUrl: 'https://license.vod2.myqcloud.com/license/v2/1325816236_1/v_cube.license', // license 地址,参考准备工作部分,在视立方控制台申请 license 后可获得 licenseUrl
12748
+ licenseUrl, // license 地址,参考准备工作部分,在视立方控制台申请 license 后可获得 licenseUrl
12751
12749
  controls: false,
12752
12750
  autoplay: false,
12753
12751
  loop: false,
@@ -12760,7 +12758,7 @@ Made in Italy` })));
12760
12758
  setVideoRef(player);
12761
12759
  });
12762
12760
  }
12763
- }, [videoRef]);
12761
+ }, [videoRef, licenseUrl]);
12764
12762
  React.useEffect(() => {
12765
12763
  if (!isInit)
12766
12764
  handleH5EnterLink();
@@ -13493,15 +13491,16 @@ Made in Italy` })));
13493
13491
  renderBottom(rec, index),
13494
13492
  renderLikeButton(rec, index)));
13495
13493
  };
13496
- return (React.createElement("div", { style: {
13494
+ return (React.createElement("div", { className: css.css({
13497
13495
  width: '100%',
13498
13496
  height: containerHeight,
13499
13497
  display: 'flex',
13500
13498
  boxSizing: 'border-box',
13501
13499
  gap: 16,
13502
13500
  pointerEvents: 'none',
13503
- userSelect: 'none'
13504
- } }, data === null || data === void 0 ? void 0 : data.map((rec, index) => {
13501
+ userSelect: 'none',
13502
+ transform: 'scale(0.7) translateX(-22%) translateY(-140px)'
13503
+ }) }, data === null || data === void 0 ? void 0 : data.map((rec, index) => {
13505
13504
  return renderView(rec, index);
13506
13505
  })));
13507
13506
  };
@@ -13576,7 +13575,7 @@ Made in Italy` })));
13576
13575
  * @Author: binruan@chatlabs.com
13577
13576
  * @Date: 2024-01-15 19:03:09
13578
13577
  * @LastEditors: binruan@chatlabs.com
13579
- * @LastEditTime: 2024-03-25 17:24:59
13578
+ * @LastEditTime: 2024-04-30 11:06:08
13580
13579
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageCore\index.tsx
13581
13580
  *
13582
13581
  */
@@ -13592,7 +13591,7 @@ Made in Italy` })));
13592
13591
  Object.values(_materials_).forEach((v) => {
13593
13592
  RESOLVER[v.extend.type] = v;
13594
13593
  });
13595
- const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain }) => {
13594
+ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, licenseUrl }) => {
13596
13595
  var _a, _b, _c, _d, _e, _f;
13597
13596
  const utmVal = React.useMemo(() => {
13598
13597
  var _a;
@@ -13603,7 +13602,7 @@ Made in Italy` })));
13603
13602
  React.createElement(SxpDataSourceProvider$1, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (_b = (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.personalized_recommend) !== null && _b !== void 0 ? _b : maxSize, defaultSize: (_d = (_c = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _c === void 0 ? void 0 : _c.default_recommend) !== null && _d !== void 0 ? _d : defaultSize, hashTagSize: (_f = (_e = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _e === void 0 ? void 0 : _e.hash_tag_size) !== null && _f !== void 0 ? _f : hashTagSize, loadingImage: loadingImage, appDomain: appDomain, render: ({ rtcList, tagList }) => {
13604
13603
  var _a;
13605
13604
  return (React.createElement(React.Fragment, null,
13606
- React.createElement(SxpPageRender, Object.assign({}, (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER })),
13605
+ React.createElement(SxpPageRender, Object.assign({}, (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER, licenseUrl: licenseUrl })),
13607
13606
  React.createElement(Popup, null)));
13608
13607
  } })));
13609
13608
  };