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/index.cjs CHANGED
@@ -11699,7 +11699,7 @@ const WaterfallFlowItem = (props) => {
11699
11699
  React.createElement("div", { className: 'list-content-listItem-info-price', style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price, hidden: !priceText }, priceText))));
11700
11700
  };
11701
11701
  function WaterfallList(_a) {
11702
- var _b, _c, _d, _e, _f, _g, _h, _j, _k;
11702
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
11703
11703
  var { reportTagsView } = _a, props = __rest(_a, ["reportTagsView"]);
11704
11704
  const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = useSxpDataSource();
11705
11705
  const [list, setList] = React.useState();
@@ -11776,16 +11776,12 @@ function WaterfallList(_a) {
11776
11776
  return (React.createElement(WaterfallFlowItem, Object.assign({ key: ind, index: ind, rec: item, list: list, reportTagsView: reportTagsView }, props)));
11777
11777
  })),
11778
11778
  React.createElement("div", { hidden: !isLoadMore, style: { textAlign: 'center' } }, "loading..."),
11779
- React.createElement("div", {
11780
- // hidden={!data?.tag?.link}
11781
- style: {
11782
- 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
11779
+ React.createElement("div", { hidden: !((_g = data === null || data === void 0 ? void 0 : data.tag) === null || _g === void 0 ? void 0 : _g.link), style: {
11780
+ 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
11783
11781
  } })),
11784
- React.createElement("div", { className: 'list-bottom', style: props === null || props === void 0 ? void 0 : props.buttonBgStyle }),
11785
- React.createElement("div", {
11786
- // hidden={!data?.tag?.link}
11787
- className: 'list-btn-wrap', style: Object.assign(Object.assign({}, props === null || props === void 0 ? void 0 : props.buttonBgStyle), { height: 'auto', backgroundColor: 'transparent' }) },
11788
- 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'))))));
11782
+ 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 }),
11783
+ 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' }) },
11784
+ 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'))))));
11789
11785
  }
11790
11786
 
11791
11787
  var img$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAaZJREFUeF7t2jFKBEEQRuG3mSJeQTARURDMTL2EqXfwAnoKD6FHMDEzNVIw2tzQC2gFggyDrExX1V92T7wz9PumFnqbXdH5teq8nwEwJqBzgfEVKDYAW8Ae8NZq3ZUm4Aa4AnaBR+C8BUIVAIu/ngSfAs9LESoAWLgB/LzWwP7SeLtfHWAu3tZ9Adz/dwD3eOUJCIlXBQiLVwQIjVcDCI9XAkiJVwFIi1cASI3PBpjb3jbd5GyyUcraCUrEZ02ATHwGgFR8NIBcfCSAZHwUgGx8BIB0vDeAfLwnQIl4L4Ay8R4ApeJbA2wD78DOZA/e7ABzk739Xz/T8rfAIfA6WYCd3BqA7NUSwCKfgLNKCK0BjoC7rzP74yoIrQGsuxSCB0ApBC+AMgieACUQvAHkESIApBGiAGQRIgEkEaIB5BAyAKQQsgBkEDIBJBCyAdIRFABSEVQA0hCUAFIQ1ADCERQBQhFUAcIQlAFCENQBfkOwg9eXpeftFQDmEOzv8ifARy8A3wiXwAHwANwujbf7q0xAi9bZZwwAN9oiDx4TUORFuS2z+wn4BAiAaEHnKChjAAAAAElFTkSuQmCC";
@@ -12076,6 +12072,33 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
12076
12072
  const [firstFrameSrc, setFirstFrameSrc] = React.useState('');
12077
12073
  const videoId = `pb-cache-video-${index}`;
12078
12074
  const videoEleRef = React.useRef(null);
12075
+ const blur = React.useMemo(() => {
12076
+ return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
12077
+ }, [videoPostConfig]);
12078
+ const translateY = React.useMemo(() => {
12079
+ var _a;
12080
+ return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
12081
+ ? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%) translate3d(0px, 0px, 0px)`
12082
+ : 'translateY(-50%)';
12083
+ }, [videoPostConfig]);
12084
+ const blurBgSrc = React.useMemo(() => {
12085
+ var _a;
12086
+ return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
12087
+ }, [firstFrameSrc, rec]);
12088
+ const blurStyle = React.useMemo(() => {
12089
+ return blur
12090
+ ? {
12091
+ filter: 'blur(10px)',
12092
+ transform: 'translate3d(0px, 0px, 0px) scale(1.2)'
12093
+ }
12094
+ : {};
12095
+ }, [blur]);
12096
+ const isBgColor = React.useMemo(() => {
12097
+ return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.bgWay) === '1';
12098
+ }, [videoPostConfig]);
12099
+ const bgStyle = React.useMemo(() => {
12100
+ return isBgColor && (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.bgColor) ? { backgroundColor: videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.bgColor } : {};
12101
+ }, [videoPostConfig, isBgColor]);
12079
12102
  React.useEffect(() => {
12080
12103
  if (!videoRef)
12081
12104
  return;
@@ -12116,15 +12139,39 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
12116
12139
  setIsFirstPlay(false);
12117
12140
  }
12118
12141
  }, [bffEventReport, data, index, isFirstPlay, videoRef]);
12142
+ const handLoadeddata = React.useCallback(() => {
12143
+ var _a;
12144
+ if (!videoRef || isBgColor || firstFrameSrc)
12145
+ return;
12146
+ const videoDomRef = document.getElementById('player-container-id_html5_api');
12147
+ if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !videoDomRef || !canvasRef.current)
12148
+ return;
12149
+ const setFrameImg = () => {
12150
+ const video = videoDomRef;
12151
+ const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
12152
+ const ctx = canvas.getContext('2d');
12153
+ const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
12154
+ const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
12155
+ canvas.height = targetHeight;
12156
+ canvas.width = targetWidth;
12157
+ ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
12158
+ setFirstFrameSrc(canvas.toDataURL());
12159
+ };
12160
+ setFrameImg();
12161
+ setTimeout(() => {
12162
+ setFrameImg();
12163
+ }, 500);
12164
+ }, [videoRef, isBgColor, rec, firstFrameSrc]);
12119
12165
  const handleLoadedmetadata = React.useCallback(() => {
12120
12166
  if (!videoRef)
12121
12167
  return;
12122
- if (activeIndex !== index) {
12123
- videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
12124
- videoRef === null || videoRef === void 0 ? void 0 : videoRef.pause();
12125
- }
12168
+ handLoadeddata();
12169
+ // if (activeIndex !== index) {
12170
+ // videoRef?.play();
12171
+ // videoRef?.pause();
12172
+ // }
12126
12173
  setIsLoadFinish(true);
12127
- }, [activeIndex, index, videoRef]);
12174
+ }, [videoRef, handLoadeddata]);
12128
12175
  const handleCanplay = React.useCallback(() => {
12129
12176
  setIsLoadFinish(true);
12130
12177
  }, []);
@@ -12185,57 +12232,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
12185
12232
  }
12186
12233
  });
12187
12234
  }
12188
- }, [data, index, bffEventReport, videoRef]);
12189
- const blur = React.useMemo(() => {
12190
- return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
12191
- }, [videoPostConfig]);
12192
- const translateY = React.useMemo(() => {
12193
- var _a;
12194
- return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
12195
- ? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%) translate3d(0px, 0px, 0px)`
12196
- : 'translateY(-50%)';
12197
- }, [videoPostConfig]);
12198
- const blurBgSrc = React.useMemo(() => {
12199
- var _a;
12200
- return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
12201
- }, [firstFrameSrc, rec]);
12202
- const blurStyle = React.useMemo(() => {
12203
- return blur
12204
- ? {
12205
- filter: 'blur(10px)',
12206
- transform: 'translate3d(0px, 0px, 0px) scale(1.2)'
12207
- }
12208
- : {};
12209
- }, [blur]);
12210
- const isBgColor = React.useMemo(() => {
12211
- return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.bgWay) === '1';
12212
- }, [videoPostConfig]);
12213
- const bgStyle = React.useMemo(() => {
12214
- return isBgColor && (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.bgColor) ? { backgroundColor: videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.bgColor } : {};
12215
- }, [videoPostConfig, isBgColor]);
12216
- const handLoadeddata = React.useCallback(() => {
12217
- var _a;
12218
- if (!videoRef || isBgColor)
12219
- return;
12220
- const videoDomRef = document.getElementById('player-container-id_html5_api');
12221
- if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !videoDomRef || !canvasRef.current)
12222
- return;
12223
- const setFrameImg = () => {
12224
- const video = videoDomRef;
12225
- const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
12226
- const ctx = canvas.getContext('2d');
12227
- const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
12228
- const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
12229
- canvas.height = targetHeight;
12230
- canvas.width = targetWidth;
12231
- ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
12232
- setFirstFrameSrc(canvas.toDataURL());
12233
- };
12234
- setFrameImg();
12235
- setTimeout(() => {
12236
- setFrameImg();
12237
- }, 500);
12238
- }, [videoRef, isBgColor, rec]);
12235
+ }, [data, index, bffEventReport, videoRef, activeIndex]);
12239
12236
  React.useEffect(() => {
12240
12237
  if (!isActive || !videoRef)
12241
12238
  return;
@@ -12249,6 +12246,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
12249
12246
  if (!dom && !dom2)
12250
12247
  return;
12251
12248
  videoPlayerWrapperNode === null || videoPlayerWrapperNode === void 0 ? void 0 : videoPlayerWrapperNode.appendChild(dom || dom2);
12249
+ videoRef.poster('https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240218/fsTan2fgYKJWrCpJtGZPogm0NnvdT1708239153661.jpeg');
12252
12250
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.src(videoSrc);
12253
12251
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('loadedmetadata', handleLoadedmetadata);
12254
12252
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('loadeddata', handLoadeddata);
@@ -12700,7 +12698,7 @@ var Tagbar$1 = React.memo(Tagbar);
12700
12698
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
12701
12699
  *
12702
12700
  */
12703
- const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [] }) => {
12701
+ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [], licenseUrl }) => {
12704
12702
  var _a, _b, _c, _d, _e, _f, _g;
12705
12703
  const { schema } = useEditor();
12706
12704
  const [activeIndex, setActiveIndex] = React.useState(0);
@@ -12756,7 +12754,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12756
12754
  if (!firstRef.current && !videoRef) {
12757
12755
  firstRef.current = true;
12758
12756
  const player = TCPlayer('player-container-id', {
12759
- licenseUrl: 'https://license.vod2.myqcloud.com/license/v2/1325816236_1/v_cube.license', // license 地址,参考准备工作部分,在视立方控制台申请 license 后可获得 licenseUrl
12757
+ licenseUrl, // license 地址,参考准备工作部分,在视立方控制台申请 license 后可获得 licenseUrl
12760
12758
  controls: false,
12761
12759
  autoplay: false,
12762
12760
  loop: false,
@@ -12769,7 +12767,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12769
12767
  setVideoRef(player);
12770
12768
  });
12771
12769
  }
12772
- }, [videoRef]);
12770
+ }, [videoRef, licenseUrl]);
12773
12771
  React.useEffect(() => {
12774
12772
  if (!isInit)
12775
12773
  handleH5EnterLink();
@@ -13502,15 +13500,16 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
13502
13500
  renderBottom(rec, index),
13503
13501
  renderLikeButton(rec, index)));
13504
13502
  };
13505
- return (React.createElement("div", { style: {
13503
+ return (React.createElement("div", { className: css.css({
13506
13504
  width: '100%',
13507
13505
  height: containerHeight,
13508
13506
  display: 'flex',
13509
13507
  boxSizing: 'border-box',
13510
13508
  gap: 16,
13511
13509
  pointerEvents: 'none',
13512
- userSelect: 'none'
13513
- } }, data === null || data === void 0 ? void 0 : data.map((rec, index) => {
13510
+ userSelect: 'none',
13511
+ transform: 'scale(0.7) translateX(-22%) translateY(-140px)'
13512
+ }) }, data === null || data === void 0 ? void 0 : data.map((rec, index) => {
13514
13513
  return renderView(rec, index);
13515
13514
  })));
13516
13515
  };
@@ -13585,7 +13584,7 @@ const Popup = () => {
13585
13584
  * @Author: binruan@chatlabs.com
13586
13585
  * @Date: 2024-01-15 19:03:09
13587
13586
  * @LastEditors: binruan@chatlabs.com
13588
- * @LastEditTime: 2024-03-25 17:24:59
13587
+ * @LastEditTime: 2024-04-30 11:06:08
13589
13588
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageCore\index.tsx
13590
13589
  *
13591
13590
  */
@@ -13601,7 +13600,7 @@ const RESOLVER = {};
13601
13600
  Object.values(_materials_).forEach((v) => {
13602
13601
  RESOLVER[v.extend.type] = v;
13603
13602
  });
13604
- const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain }) => {
13603
+ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, licenseUrl }) => {
13605
13604
  var _a, _b, _c, _d, _e, _f;
13606
13605
  const utmVal = React.useMemo(() => {
13607
13606
  var _a;
@@ -13612,7 +13611,7 @@ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, l
13612
13611
  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 }) => {
13613
13612
  var _a;
13614
13613
  return (React.createElement(React.Fragment, null,
13615
- 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 })),
13614
+ 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 })),
13616
13615
  React.createElement(Popup, null)));
13617
13616
  } })));
13618
13617
  };