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.css CHANGED
@@ -62,6 +62,7 @@
62
62
 
63
63
  .pb-commondity {
64
64
  position: relative;
65
+ height: 100%;
65
66
  }
66
67
  .pb-commondity-content {
67
68
  padding: 21px 19px 80px;
@@ -659,6 +660,7 @@
659
660
  position: absolute;
660
661
  top: 0;
661
662
  width: 100%;
663
+ height: 100%;
662
664
  overflow: auto;
663
665
  }
664
666
  .list-info {
package/dist/index.js CHANGED
@@ -11676,7 +11676,7 @@ const WaterfallFlowItem = (props) => {
11676
11676
  React.createElement("div", { className: 'list-content-listItem-info-price', style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price, hidden: !priceText }, priceText))));
11677
11677
  };
11678
11678
  function WaterfallList(_a) {
11679
- var _b, _c, _d, _e, _f, _g, _h, _j, _k;
11679
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
11680
11680
  var { reportTagsView } = _a, props = __rest(_a, ["reportTagsView"]);
11681
11681
  const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = useSxpDataSource();
11682
11682
  const [list, setList] = useState();
@@ -11753,16 +11753,12 @@ function WaterfallList(_a) {
11753
11753
  return (React.createElement(WaterfallFlowItem, Object.assign({ key: ind, index: ind, rec: item, list: list, reportTagsView: reportTagsView }, props)));
11754
11754
  })),
11755
11755
  React.createElement("div", { hidden: !isLoadMore, style: { textAlign: 'center' } }, "loading..."),
11756
- React.createElement("div", {
11757
- // hidden={!data?.tag?.link}
11758
- style: {
11759
- 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
11756
+ React.createElement("div", { hidden: !((_g = data === null || data === void 0 ? void 0 : data.tag) === null || _g === void 0 ? void 0 : _g.link), style: {
11757
+ 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
11760
11758
  } })),
11761
- React.createElement("div", { className: 'list-bottom', style: props === null || props === void 0 ? void 0 : props.buttonBgStyle }),
11762
- React.createElement("div", {
11763
- // hidden={!data?.tag?.link}
11764
- className: 'list-btn-wrap', style: Object.assign(Object.assign({}, props === null || props === void 0 ? void 0 : props.buttonBgStyle), { height: 'auto', backgroundColor: 'transparent' }) },
11765
- 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'))))));
11759
+ 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 }),
11760
+ 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' }) },
11761
+ 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'))))));
11766
11762
  }
11767
11763
 
11768
11764
  var img$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAaZJREFUeF7t2jFKBEEQRuG3mSJeQTARURDMTL2EqXfwAnoKD6FHMDEzNVIw2tzQC2gFggyDrExX1V92T7wz9PumFnqbXdH5teq8nwEwJqBzgfEVKDYAW8Ae8NZq3ZUm4Aa4AnaBR+C8BUIVAIu/ngSfAs9LESoAWLgB/LzWwP7SeLtfHWAu3tZ9Adz/dwD3eOUJCIlXBQiLVwQIjVcDCI9XAkiJVwFIi1cASI3PBpjb3jbd5GyyUcraCUrEZ02ATHwGgFR8NIBcfCSAZHwUgGx8BIB0vDeAfLwnQIl4L4Ay8R4ApeJbA2wD78DOZA/e7ABzk739Xz/T8rfAIfA6WYCd3BqA7NUSwCKfgLNKCK0BjoC7rzP74yoIrQGsuxSCB0ApBC+AMgieACUQvAHkESIApBGiAGQRIgEkEaIB5BAyAKQQsgBkEDIBJBCyAdIRFABSEVQA0hCUAFIQ1ADCERQBQhFUAcIQlAFCENQBfkOwg9eXpeftFQDmEOzv8ifARy8A3wiXwAHwANwujbf7q0xAi9bZZwwAN9oiDx4TUORFuS2z+wn4BAiAaEHnKChjAAAAAElFTkSuQmCC";
@@ -12053,6 +12049,33 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
12053
12049
  const [firstFrameSrc, setFirstFrameSrc] = useState('');
12054
12050
  const videoId = `pb-cache-video-${index}`;
12055
12051
  const videoEleRef = useRef(null);
12052
+ const blur = useMemo(() => {
12053
+ return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
12054
+ }, [videoPostConfig]);
12055
+ const translateY = useMemo(() => {
12056
+ var _a;
12057
+ return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
12058
+ ? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%) translate3d(0px, 0px, 0px)`
12059
+ : 'translateY(-50%)';
12060
+ }, [videoPostConfig]);
12061
+ const blurBgSrc = useMemo(() => {
12062
+ var _a;
12063
+ return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
12064
+ }, [firstFrameSrc, rec]);
12065
+ const blurStyle = useMemo(() => {
12066
+ return blur
12067
+ ? {
12068
+ filter: 'blur(10px)',
12069
+ transform: 'translate3d(0px, 0px, 0px) scale(1.2)'
12070
+ }
12071
+ : {};
12072
+ }, [blur]);
12073
+ const isBgColor = useMemo(() => {
12074
+ return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.bgWay) === '1';
12075
+ }, [videoPostConfig]);
12076
+ const bgStyle = useMemo(() => {
12077
+ return isBgColor && (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.bgColor) ? { backgroundColor: videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.bgColor } : {};
12078
+ }, [videoPostConfig, isBgColor]);
12056
12079
  useEffect(() => {
12057
12080
  if (!videoRef)
12058
12081
  return;
@@ -12093,15 +12116,39 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
12093
12116
  setIsFirstPlay(false);
12094
12117
  }
12095
12118
  }, [bffEventReport, data, index, isFirstPlay, videoRef]);
12119
+ const handLoadeddata = useCallback(() => {
12120
+ var _a;
12121
+ if (!videoRef || isBgColor || firstFrameSrc)
12122
+ return;
12123
+ const videoDomRef = document.getElementById('player-container-id_html5_api');
12124
+ if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !videoDomRef || !canvasRef.current)
12125
+ return;
12126
+ const setFrameImg = () => {
12127
+ const video = videoDomRef;
12128
+ const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
12129
+ const ctx = canvas.getContext('2d');
12130
+ const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
12131
+ const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
12132
+ canvas.height = targetHeight;
12133
+ canvas.width = targetWidth;
12134
+ ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
12135
+ setFirstFrameSrc(canvas.toDataURL());
12136
+ };
12137
+ setFrameImg();
12138
+ setTimeout(() => {
12139
+ setFrameImg();
12140
+ }, 500);
12141
+ }, [videoRef, isBgColor, rec, firstFrameSrc]);
12096
12142
  const handleLoadedmetadata = useCallback(() => {
12097
12143
  if (!videoRef)
12098
12144
  return;
12099
- if (activeIndex !== index) {
12100
- videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
12101
- videoRef === null || videoRef === void 0 ? void 0 : videoRef.pause();
12102
- }
12145
+ handLoadeddata();
12146
+ // if (activeIndex !== index) {
12147
+ // videoRef?.play();
12148
+ // videoRef?.pause();
12149
+ // }
12103
12150
  setIsLoadFinish(true);
12104
- }, [activeIndex, index, videoRef]);
12151
+ }, [videoRef, handLoadeddata]);
12105
12152
  const handleCanplay = useCallback(() => {
12106
12153
  setIsLoadFinish(true);
12107
12154
  }, []);
@@ -12162,57 +12209,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
12162
12209
  }
12163
12210
  });
12164
12211
  }
12165
- }, [data, index, bffEventReport, videoRef]);
12166
- const blur = useMemo(() => {
12167
- return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
12168
- }, [videoPostConfig]);
12169
- const translateY = useMemo(() => {
12170
- var _a;
12171
- return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
12172
- ? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%) translate3d(0px, 0px, 0px)`
12173
- : 'translateY(-50%)';
12174
- }, [videoPostConfig]);
12175
- const blurBgSrc = useMemo(() => {
12176
- var _a;
12177
- return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
12178
- }, [firstFrameSrc, rec]);
12179
- const blurStyle = useMemo(() => {
12180
- return blur
12181
- ? {
12182
- filter: 'blur(10px)',
12183
- transform: 'translate3d(0px, 0px, 0px) scale(1.2)'
12184
- }
12185
- : {};
12186
- }, [blur]);
12187
- const isBgColor = useMemo(() => {
12188
- return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.bgWay) === '1';
12189
- }, [videoPostConfig]);
12190
- const bgStyle = useMemo(() => {
12191
- return isBgColor && (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.bgColor) ? { backgroundColor: videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.bgColor } : {};
12192
- }, [videoPostConfig, isBgColor]);
12193
- const handLoadeddata = useCallback(() => {
12194
- var _a;
12195
- if (!videoRef || isBgColor)
12196
- return;
12197
- const videoDomRef = document.getElementById('player-container-id_html5_api');
12198
- if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !videoDomRef || !canvasRef.current)
12199
- return;
12200
- const setFrameImg = () => {
12201
- const video = videoDomRef;
12202
- const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
12203
- const ctx = canvas.getContext('2d');
12204
- const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
12205
- const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
12206
- canvas.height = targetHeight;
12207
- canvas.width = targetWidth;
12208
- ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
12209
- setFirstFrameSrc(canvas.toDataURL());
12210
- };
12211
- setFrameImg();
12212
- setTimeout(() => {
12213
- setFrameImg();
12214
- }, 500);
12215
- }, [videoRef, isBgColor, rec]);
12212
+ }, [data, index, bffEventReport, videoRef, activeIndex]);
12216
12213
  useEffect(() => {
12217
12214
  if (!isActive || !videoRef)
12218
12215
  return;
@@ -12226,6 +12223,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
12226
12223
  if (!dom && !dom2)
12227
12224
  return;
12228
12225
  videoPlayerWrapperNode === null || videoPlayerWrapperNode === void 0 ? void 0 : videoPlayerWrapperNode.appendChild(dom || dom2);
12226
+ videoRef.poster('https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240218/fsTan2fgYKJWrCpJtGZPogm0NnvdT1708239153661.jpeg');
12229
12227
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.src(videoSrc);
12230
12228
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('loadedmetadata', handleLoadedmetadata);
12231
12229
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('loadeddata', handLoadeddata);
@@ -12677,7 +12675,7 @@ var Tagbar$1 = memo(Tagbar);
12677
12675
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
12678
12676
  *
12679
12677
  */
12680
- const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [] }) => {
12678
+ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [], licenseUrl }) => {
12681
12679
  var _a, _b, _c, _d, _e, _f, _g;
12682
12680
  const { schema } = useEditor();
12683
12681
  const [activeIndex, setActiveIndex] = useState(0);
@@ -12733,7 +12731,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12733
12731
  if (!firstRef.current && !videoRef) {
12734
12732
  firstRef.current = true;
12735
12733
  const player = TCPlayer('player-container-id', {
12736
- licenseUrl: 'https://license.vod2.myqcloud.com/license/v2/1325816236_1/v_cube.license', // license 地址,参考准备工作部分,在视立方控制台申请 license 后可获得 licenseUrl
12734
+ licenseUrl, // license 地址,参考准备工作部分,在视立方控制台申请 license 后可获得 licenseUrl
12737
12735
  controls: false,
12738
12736
  autoplay: false,
12739
12737
  loop: false,
@@ -12746,7 +12744,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12746
12744
  setVideoRef(player);
12747
12745
  });
12748
12746
  }
12749
- }, [videoRef]);
12747
+ }, [videoRef, licenseUrl]);
12750
12748
  useEffect(() => {
12751
12749
  if (!isInit)
12752
12750
  handleH5EnterLink();
@@ -13479,15 +13477,16 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
13479
13477
  renderBottom(rec, index),
13480
13478
  renderLikeButton(rec, index)));
13481
13479
  };
13482
- return (React.createElement("div", { style: {
13480
+ return (React.createElement("div", { className: css({
13483
13481
  width: '100%',
13484
13482
  height: containerHeight,
13485
13483
  display: 'flex',
13486
13484
  boxSizing: 'border-box',
13487
13485
  gap: 16,
13488
13486
  pointerEvents: 'none',
13489
- userSelect: 'none'
13490
- } }, data === null || data === void 0 ? void 0 : data.map((rec, index) => {
13487
+ userSelect: 'none',
13488
+ transform: 'scale(0.7) translateX(-22%) translateY(-140px)'
13489
+ }) }, data === null || data === void 0 ? void 0 : data.map((rec, index) => {
13491
13490
  return renderView(rec, index);
13492
13491
  })));
13493
13492
  };
@@ -13562,7 +13561,7 @@ const Popup = () => {
13562
13561
  * @Author: binruan@chatlabs.com
13563
13562
  * @Date: 2024-01-15 19:03:09
13564
13563
  * @LastEditors: binruan@chatlabs.com
13565
- * @LastEditTime: 2024-03-25 17:24:59
13564
+ * @LastEditTime: 2024-04-30 11:06:08
13566
13565
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageCore\index.tsx
13567
13566
  *
13568
13567
  */
@@ -13578,7 +13577,7 @@ const RESOLVER = {};
13578
13577
  Object.values(_materials_).forEach((v) => {
13579
13578
  RESOLVER[v.extend.type] = v;
13580
13579
  });
13581
- const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain }) => {
13580
+ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, licenseUrl }) => {
13582
13581
  var _a, _b, _c, _d, _e, _f;
13583
13582
  const utmVal = useMemo(() => {
13584
13583
  var _a;
@@ -13589,7 +13588,7 @@ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, l
13589
13588
  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 }) => {
13590
13589
  var _a;
13591
13590
  return (React.createElement(React.Fragment, null,
13592
- 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 })),
13591
+ 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 })),
13593
13592
  React.createElement(Popup, null)));
13594
13593
  } })));
13595
13594
  };