pb-sxp-ui 1.7.2 → 1.7.3
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 +107 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +107 -48
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +107 -48
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/PictureGroup/Picture.d.ts +1 -1
- package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +4 -1
- package/es/core/components/SxpPageRender/PictureGroup/index.js +24 -4
- package/es/core/components/SxpPageRender/RenderCard.js +6 -1
- package/es/core/components/SxpPageRender/VideoWidget/index.js +14 -7
- package/es/core/components/SxpPageRender/WaterFall/List.js +3 -2
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +3 -2
- package/es/core/components/SxpPageRender/index.d.ts +1 -0
- package/es/core/components/SxpPageRender/index.js +12 -10
- package/es/core/utils/materials.d.ts +7 -1
- package/es/core/utils/materials.js +5 -2
- package/es/core/utils/tool.d.ts +2 -1
- package/es/core/utils/tool.js +11 -1
- package/es/materials/sxp/cta/AniLink/settingRender.d.ts +11 -0
- package/es/materials/sxp/cta/AniLink/settingRender.js +6 -0
- package/es/materials/sxp/cta/AniLinkPopup/settingRender.d.ts +1 -1
- package/es/materials/sxp/cta/AniLinkPopup/settingRender.js +6 -0
- package/es/materials/sxp/popup/CommodityDetail/index.js +3 -2
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +3 -2
- package/es/materials/sxp/popup/CommodityList/index.js +5 -4
- package/es/materials/sxp/template/components/settingRender.d.ts +1 -1
- package/es/materials/sxp/template/components/settingRender.js +6 -0
- package/lib/core/components/SxpPageRender/PictureGroup/Picture.d.ts +1 -1
- package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +4 -1
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +23 -4
- package/lib/core/components/SxpPageRender/RenderCard.js +6 -1
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +13 -7
- package/lib/core/components/SxpPageRender/WaterFall/List.js +3 -2
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +3 -2
- package/lib/core/components/SxpPageRender/index.d.ts +1 -0
- package/lib/core/components/SxpPageRender/index.js +12 -10
- package/lib/core/utils/materials.d.ts +7 -1
- package/lib/core/utils/materials.js +5 -2
- package/lib/core/utils/tool.d.ts +2 -1
- package/lib/core/utils/tool.js +12 -1
- package/lib/materials/sxp/cta/AniLink/settingRender.d.ts +11 -0
- package/lib/materials/sxp/cta/AniLink/settingRender.js +6 -0
- package/lib/materials/sxp/cta/AniLinkPopup/settingRender.d.ts +1 -1
- package/lib/materials/sxp/cta/AniLinkPopup/settingRender.js +6 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.js +3 -2
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +3 -2
- package/lib/materials/sxp/popup/CommodityList/index.js +5 -4
- package/lib/materials/sxp/template/components/settingRender.d.ts +1 -1
- package/lib/materials/sxp/template/components/settingRender.js +6 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -298,6 +298,16 @@ function getCookie(val) {
|
|
298
298
|
});
|
299
299
|
return value !== null && value !== void 0 ? value : '';
|
300
300
|
}
|
301
|
+
const getResFileSizeFromSrc = (imageSrc) => {
|
302
|
+
if (!imageSrc)
|
303
|
+
return '';
|
304
|
+
return fetch(imageSrc)
|
305
|
+
.then((response) => response.blob())
|
306
|
+
.then((blob) => {
|
307
|
+
const fileSizeInMB = blob.size / (1024 * 1024); // 将文件大小转换为 MB
|
308
|
+
return fileSizeInMB.toFixed(2) + '';
|
309
|
+
});
|
310
|
+
};
|
301
311
|
|
302
312
|
function unzip(b64Data) {
|
303
313
|
const strData = atob(b64Data);
|
@@ -9268,7 +9278,7 @@ var CommodityGroup$1 = memo(CommodityGroup);
|
|
9268
9278
|
* @Author: binruan@chatlabs.com
|
9269
9279
|
* @Date: 2024-03-20 14:56:16
|
9270
9280
|
* @LastEditors: binruan@chatlabs.com
|
9271
|
-
* @LastEditTime: 2024-
|
9281
|
+
* @LastEditTime: 2024-10-24 17:51:19
|
9272
9282
|
* @FilePath: \pb-sxp-ui\src\core\utils\materials.ts
|
9273
9283
|
*
|
9274
9284
|
*/
|
@@ -9295,8 +9305,8 @@ const getMediaValueByMode = (obj) => {
|
|
9295
9305
|
return file && file.length > 0 ? (_a = file[0]) === null || _a === void 0 ? void 0 : _a.url : null;
|
9296
9306
|
}
|
9297
9307
|
};
|
9298
|
-
const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef }) => {
|
9299
|
-
var _a, _b, _c, _d, _e;
|
9308
|
+
const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef, style }) => {
|
9309
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
9300
9310
|
if ((!(product === null || product === void 0 ? void 0 : product.currency) || !(product === null || product === void 0 ? void 0 : product.price)) && isHiddenDef)
|
9301
9311
|
return null;
|
9302
9312
|
let price = (product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price) ? product === null || product === void 0 ? void 0 : product.price : 7000;
|
@@ -9344,6 +9354,8 @@ const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef
|
|
9344
9354
|
}
|
9345
9355
|
});
|
9346
9356
|
}
|
9357
|
+
currency = `<span style="font-family:${(_h = (_g = (_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.priceSymbol) === null || _f === void 0 ? void 0 : _f.fontFamily) !== null && _g !== void 0 ? _g : style === null || style === void 0 ? void 0 : style['fontFamily-en']) !== null && _h !== void 0 ? _h : 'inherit'}">${currency}</span>`;
|
9358
|
+
text = setFontForText(text, style);
|
9347
9359
|
if ((priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) && (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) !== 'none') {
|
9348
9360
|
text = (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) === 'left' ? currency + text : text + currency;
|
9349
9361
|
}
|
@@ -9409,7 +9421,8 @@ const CommodityDetail$1 = (_a) => {
|
|
9409
9421
|
const priceText = getPriceText({
|
9410
9422
|
product: product,
|
9411
9423
|
enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
|
9412
|
-
globalConfig
|
9424
|
+
globalConfig,
|
9425
|
+
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
9413
9426
|
});
|
9414
9427
|
const width = (isPreview ? 375 : (_u = style === null || style === void 0 ? void 0 : style.width) !== null && _u !== void 0 ? _u : window.innerWidth) - ((_v = popupBg === null || popupBg === void 0 ? void 0 : popupBg.horizontalMargin) !== null && _v !== void 0 ? _v : 0) * 2;
|
9415
9428
|
const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
|
@@ -9423,7 +9436,7 @@ const CommodityDetail$1 = (_a) => {
|
|
9423
9436
|
__html: setFontForText((_b = product === null || product === void 0 ? void 0 : product.title) !== null && _b !== void 0 ? _b : 'Pendant in Yellow Gold with Diamonds, Medium', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
|
9424
9437
|
} }),
|
9425
9438
|
React.createElement("div", { className: 'pb-commondity-content-price', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price), hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price), dangerouslySetInnerHTML: {
|
9426
|
-
__html:
|
9439
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
9427
9440
|
} }),
|
9428
9441
|
React.createElement("div", { hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo), dangerouslySetInnerHTML: {
|
9429
9442
|
__html: setFontForText((_c = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _c !== void 0 ? _c : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
|
@@ -10297,7 +10310,8 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
10297
10310
|
const priceText = getPriceText({
|
10298
10311
|
product,
|
10299
10312
|
enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
|
10300
|
-
globalConfig
|
10313
|
+
globalConfig,
|
10314
|
+
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
10301
10315
|
});
|
10302
10316
|
const width = (isPreview ? 375 : (_u = style === null || style === void 0 ? void 0 : style.width) !== null && _u !== void 0 ? _u : window.innerWidth) - ((_v = popupBg === null || popupBg === void 0 ? void 0 : popupBg.horizontalMargin) !== null && _v !== void 0 ? _v : 0) * 2;
|
10303
10317
|
const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
|
@@ -10458,7 +10472,7 @@ Made in Italy` })));
|
|
10458
10472
|
} })),
|
10459
10473
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
|
10460
10474
|
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), dangerouslySetInnerHTML: {
|
10461
|
-
__html:
|
10475
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
10462
10476
|
} }),
|
10463
10477
|
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), dangerouslySetInnerHTML: {
|
10464
10478
|
__html: setFontForText((_2 = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _2 !== void 0 ? _2 : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
|
@@ -10916,7 +10930,8 @@ const CommodityList$1 = (_a) => {
|
|
10916
10930
|
return getPriceText({
|
10917
10931
|
product,
|
10918
10932
|
enableFormattedPrice: (_a = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
10919
|
-
globalConfig
|
10933
|
+
globalConfig,
|
10934
|
+
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
10920
10935
|
});
|
10921
10936
|
}, [(_d = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _d === void 0 ? void 0 : _d.enableFormattedPrice, globalConfig]);
|
10922
10937
|
const handleClick = throttle((item, multiCheckIndex) => {
|
@@ -10941,7 +10956,7 @@ const CommodityList$1 = (_a) => {
|
|
10941
10956
|
});
|
10942
10957
|
}, []);
|
10943
10958
|
return (React.createElement("div", { className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexDirection: 'column', gap: '10px', padding: '0 20px', marginTop: '50px', boxSizing: 'border-box' })) }, product === null || product === void 0 ? void 0 : product.map((item, index) => {
|
10944
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
10959
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
10945
10960
|
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement("div", Object.assign({ key: index }, props, { className: css({
|
10946
10961
|
display: 'flex'
|
10947
10962
|
}), onClick: () => handleClick(item, index) }),
|
@@ -10968,10 +10983,10 @@ const CommodityList$1 = (_a) => {
|
|
10968
10983
|
}) },
|
10969
10984
|
React.createElement("div", null,
|
10970
10985
|
React.createElement("div", { style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.price), dangerouslySetInnerHTML: {
|
10971
|
-
__html:
|
10986
|
+
__html: (_j = priceText(item)) !== null && _j !== void 0 ? _j : ''
|
10972
10987
|
} })),
|
10973
10988
|
React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
|
10974
|
-
__html: setFontForText((
|
10989
|
+
__html: setFontForText((_l = (_k = item === null || item === void 0 ? void 0 : item.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now', buttonStyle)
|
10975
10990
|
} })))))));
|
10976
10991
|
})));
|
10977
10992
|
};
|
@@ -11119,7 +11134,7 @@ const Iframe = createMaterial(IframeComponent, {
|
|
11119
11134
|
* @Author: binruan@chatlabs.com
|
11120
11135
|
* @Date: 2024-03-26 16:50:25
|
11121
11136
|
* @LastEditors: binruan@chatlabs.com
|
11122
|
-
* @LastEditTime: 2024-
|
11137
|
+
* @LastEditTime: 2024-10-24 19:04:37
|
11123
11138
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\settingRender.tsx
|
11124
11139
|
*
|
11125
11140
|
*/
|
@@ -11165,6 +11180,12 @@ var settingRender$4 = [
|
|
11165
11180
|
label: '背景色',
|
11166
11181
|
name: ['style', 'backgroundColor']
|
11167
11182
|
},
|
11183
|
+
{
|
11184
|
+
type: 'Number',
|
11185
|
+
label: '背景色毛玻璃',
|
11186
|
+
name: ['style', 'backdropFilter'],
|
11187
|
+
addonAfter: 'px'
|
11188
|
+
},
|
11168
11189
|
{
|
11169
11190
|
label: '内边距',
|
11170
11191
|
type: 'Number',
|
@@ -13948,7 +13969,8 @@ const WaterfallFlowItem$1 = (props) => {
|
|
13948
13969
|
product: rec === null || rec === void 0 ? void 0 : rec.product,
|
13949
13970
|
enableFormattedPrice: (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
13950
13971
|
globalConfig,
|
13951
|
-
isHiddenDef: true
|
13972
|
+
isHiddenDef: true,
|
13973
|
+
style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price
|
13952
13974
|
});
|
13953
13975
|
useEffect(() => {
|
13954
13976
|
if (imgDom.current === null || src === '') {
|
@@ -13990,7 +14012,7 @@ const WaterfallFlowItem$1 = (props) => {
|
|
13990
14012
|
__html: setFontForText(title, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title)
|
13991
14013
|
} }),
|
13992
14014
|
React.createElement("div", { className: 'waterFallList-content-listItem-info-price', hidden: !priceText, style: textStyles.price, dangerouslySetInnerHTML: {
|
13993
|
-
__html:
|
14015
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
13994
14016
|
} }))));
|
13995
14017
|
};
|
13996
14018
|
function WaterfallList$1(_a) {
|
@@ -14265,7 +14287,8 @@ const WaterfallFlowItem = (props) => {
|
|
14265
14287
|
product: rec === null || rec === void 0 ? void 0 : rec.product,
|
14266
14288
|
enableFormattedPrice: (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
14267
14289
|
globalConfig,
|
14268
|
-
isHiddenDef: true
|
14290
|
+
isHiddenDef: true,
|
14291
|
+
style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price
|
14269
14292
|
});
|
14270
14293
|
// useEffect(() => {
|
14271
14294
|
// if (imgDom.current === null || src === '') {
|
@@ -14352,7 +14375,7 @@ const WaterfallFlowItem = (props) => {
|
|
14352
14375
|
__html: setFontForText(title, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title)
|
14353
14376
|
} }),
|
14354
14377
|
React.createElement("div", { className: 'list-content-listItem-info-price', style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price, hidden: !priceText, dangerouslySetInnerHTML: {
|
14355
|
-
__html:
|
14378
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
14356
14379
|
} }))));
|
14357
14380
|
};
|
14358
14381
|
function WaterfallList(_a) {
|
@@ -14730,7 +14753,7 @@ const Consent = createMaterial(ConsentComponent, {
|
|
14730
14753
|
* @Author: binruan@chatlabs.com
|
14731
14754
|
* @Date: 2024-07-02 14:51:32
|
14732
14755
|
* @LastEditors: binruan@chatlabs.com
|
14733
|
-
* @LastEditTime: 2024-
|
14756
|
+
* @LastEditTime: 2024-10-25 10:39:04
|
14734
14757
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLink\settingRender.tsx
|
14735
14758
|
*
|
14736
14759
|
*/
|
@@ -14776,6 +14799,12 @@ var settingRender$1 = [
|
|
14776
14799
|
label: '背景色',
|
14777
14800
|
name: ['style', 'backgroundColor']
|
14778
14801
|
},
|
14802
|
+
{
|
14803
|
+
type: 'Number',
|
14804
|
+
label: '背景色毛玻璃',
|
14805
|
+
name: ['style', 'backdropFilter'],
|
14806
|
+
addonAfter: 'px'
|
14807
|
+
},
|
14779
14808
|
{
|
14780
14809
|
type: 'TextMargin',
|
14781
14810
|
name: ['style'],
|
@@ -15075,6 +15104,12 @@ var settingRender = [
|
|
15075
15104
|
label: '背景色',
|
15076
15105
|
name: ['style', 'backgroundColor']
|
15077
15106
|
},
|
15107
|
+
{
|
15108
|
+
type: 'Number',
|
15109
|
+
label: '背景色毛玻璃',
|
15110
|
+
name: ['style', 'backdropFilter'],
|
15111
|
+
addonAfter: 'px'
|
15112
|
+
},
|
15078
15113
|
{
|
15079
15114
|
label: '外边距',
|
15080
15115
|
type: 'Number',
|
@@ -15625,6 +15660,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15625
15660
|
const videoId = `pb-cache-video-${index}`;
|
15626
15661
|
const videoEleRef = useRef(null);
|
15627
15662
|
const hlsRef = useRef(null);
|
15663
|
+
const initTimeRef = useRef();
|
15628
15664
|
const blur = useMemo(() => {
|
15629
15665
|
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
|
15630
15666
|
}, [videoPostConfig]);
|
@@ -15670,8 +15706,8 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15670
15706
|
setWaiting(false);
|
15671
15707
|
setIsLoadFinish(true);
|
15672
15708
|
}, []);
|
15673
|
-
const handleStartPlay = useCallback(() => {
|
15674
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
15709
|
+
const handleStartPlay = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
15710
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
15675
15711
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
15676
15712
|
return;
|
15677
15713
|
setIsPauseVideo(false);
|
@@ -15681,24 +15717,27 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15681
15717
|
const videoDuration = ((_d = (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
15682
15718
|
const videoCurrentTime = ((_f = (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
|
15683
15719
|
const playType = isFirstPlay ? '0' : '1';
|
15720
|
+
const contentSize = yield getResFileSizeFromSrc((_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.url);
|
15684
15721
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
15685
15722
|
eventInfo: {
|
15686
15723
|
eventSubject: 'playVideo',
|
15687
15724
|
eventDescription: 'User played the video',
|
15688
|
-
contentId: (
|
15689
|
-
contentName: (
|
15725
|
+
contentId: (_j = (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.itemId) !== null && _j !== void 0 ? _j : '',
|
15726
|
+
contentName: (_l = (_k = item === null || item === void 0 ? void 0 : item.video) === null || _k === void 0 ? void 0 : _k.title) !== null && _l !== void 0 ? _l : '',
|
15690
15727
|
playType,
|
15691
15728
|
startTime: videoCurrentTime,
|
15692
15729
|
videoDuration,
|
15693
|
-
contentTags: JSON.stringify((
|
15730
|
+
contentTags: JSON.stringify((_o = (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.tags) !== null && _o !== void 0 ? _o : []),
|
15694
15731
|
position: index + '',
|
15695
15732
|
contentFormat: 'video',
|
15696
|
-
traceInfo: (
|
15733
|
+
traceInfo: (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.traceInfo,
|
15734
|
+
contentSize,
|
15735
|
+
loadTime: (new Date() - (initTimeRef === null || initTimeRef === void 0 ? void 0 : initTimeRef.current)).toFixed(2) + ''
|
15697
15736
|
}
|
15698
15737
|
});
|
15699
15738
|
setIsFirstPlay(false);
|
15700
15739
|
}
|
15701
|
-
}, [bffEventReport, data, index, isFirstPlay, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
15740
|
+
}), [bffEventReport, data, index, isFirstPlay, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
15702
15741
|
const handLoadeddata = useCallback(() => {
|
15703
15742
|
var _a;
|
15704
15743
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
|
@@ -15802,6 +15841,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15802
15841
|
videoRef.current = mountVideoPlayerAtNode === null || mountVideoPlayerAtNode === void 0 ? void 0 : mountVideoPlayerAtNode(videoPlayerWrapperNode);
|
15803
15842
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
15804
15843
|
return;
|
15844
|
+
initTimeRef.current = new Date();
|
15805
15845
|
const Hls = window === null || window === void 0 ? void 0 : window.Hls;
|
15806
15846
|
let hls = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current;
|
15807
15847
|
if (videoSrc.includes('.m3u8') && Hls && Hls.isSupported()) {
|
@@ -16054,19 +16094,14 @@ const Picture = (props) => {
|
|
16054
16094
|
}, onLoad: onShowFirstImage }))));
|
16055
16095
|
};
|
16056
16096
|
|
16057
|
-
/*
|
16058
|
-
* @Author: lewinlu@chatlabs.com
|
16059
|
-
* @Date: 2024-01-03 14:39:09
|
16060
|
-
* @LastEditors: binruan@chatlabs.com
|
16061
|
-
* @LastEditTime: 2024-10-10 17:53:30
|
16062
|
-
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
|
16063
|
-
*/
|
16064
16097
|
const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
16065
16098
|
var _a, _b;
|
16066
16099
|
const ref = useRef();
|
16067
16100
|
const { isActive } = useSwiperSlide();
|
16068
16101
|
const { sxpParameter, openHashtag } = useSxpDataSource();
|
16069
16102
|
const [isLoad, setIsLoad] = useState(false);
|
16103
|
+
const [imgInfo, setImgInfo] = useState();
|
16104
|
+
const initTime = new Date();
|
16070
16105
|
useEffect(() => {
|
16071
16106
|
if (isLoad && isActive) {
|
16072
16107
|
(ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.start();
|
@@ -16074,21 +16109,36 @@ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageE
|
|
16074
16109
|
onReportViewImageEnd(rec);
|
16075
16110
|
}
|
16076
16111
|
else {
|
16077
|
-
onViewImageStartEvent(index);
|
16112
|
+
onViewImageStartEvent(index, imgInfo);
|
16078
16113
|
}
|
16079
16114
|
}
|
16080
16115
|
else {
|
16081
16116
|
(ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.stop();
|
16082
16117
|
}
|
16083
|
-
}, [rec, isActive, onReportViewImageEnd, openHashtag, index, onViewImageStartEvent, isLoad]);
|
16084
|
-
const showFirstImageFn = useCallback(() => {
|
16118
|
+
}, [rec, isActive, onReportViewImageEnd, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
|
16119
|
+
const showFirstImageFn = useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
|
16085
16120
|
if (!isLoad) {
|
16121
|
+
const contentSize = yield getResFileSizeFromSrc(e.src);
|
16122
|
+
setImgInfo({
|
16123
|
+
contentSize,
|
16124
|
+
loadTime: (new Date() - initTime).toFixed(2) + ''
|
16125
|
+
});
|
16086
16126
|
setIsLoad(true);
|
16087
16127
|
}
|
16088
|
-
}, [isLoad]);
|
16128
|
+
}), [isLoad]);
|
16089
16129
|
// if (!isActive) {
|
16090
16130
|
// return <img src={sxpParameter?.placeholder_image} style={{ width, height, objectFit: 'cover' }} />;
|
16091
16131
|
// }
|
16132
|
+
useEffect(() => {
|
16133
|
+
const onShow = () => onViewImageStartEvent(index, imgInfo);
|
16134
|
+
const onHide = () => onReportViewImageEnd(rec);
|
16135
|
+
SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
16136
|
+
SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
|
16137
|
+
return () => {
|
16138
|
+
SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
16139
|
+
SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
|
16140
|
+
};
|
16141
|
+
}, [imgInfo]);
|
16092
16142
|
return (React.createElement(Swiper, { ref: ref, defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: {
|
16093
16143
|
clickable: true,
|
16094
16144
|
bulletActiveClass: 'swipe-item-active-bullet',
|
@@ -16227,7 +16277,7 @@ function withBindDataSource(Component) {
|
|
16227
16277
|
* @Author: binruan@chatlabs.com
|
16228
16278
|
* @Date: 2023-12-26 16:11:34
|
16229
16279
|
* @LastEditors: binruan@chatlabs.com
|
16230
|
-
* @LastEditTime: 2024-10-
|
16280
|
+
* @LastEditTime: 2024-10-25 10:36:59
|
16231
16281
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
|
16232
16282
|
*
|
16233
16283
|
*/
|
@@ -16276,7 +16326,12 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive }
|
|
16276
16326
|
const Component = withBindDataSource(t);
|
16277
16327
|
const defaulSetting = (_z = t === null || t === void 0 ? void 0 : t.extend) === null || _z === void 0 ? void 0 : _z.defaulSetting;
|
16278
16328
|
const isExternalLink = ((_2 = (_1 = (_0 = value === null || value === void 0 ? void 0 : value.item) === null || _0 === void 0 ? void 0 : _0.event) === null || _1 === void 0 ? void 0 : _1.onClick) === null || _2 === void 0 ? void 0 : _2.linkType) === 'externalLink';
|
16279
|
-
|
16329
|
+
let style = (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.style;
|
16330
|
+
if (style.hasOwnProperty('backdropFilter')) {
|
16331
|
+
let sbf = style['backdropFilter'];
|
16332
|
+
style['backdropFilter'] = `blur(${sbf !== null && sbf !== void 0 ? sbf : 0}px)`;
|
16333
|
+
}
|
16334
|
+
return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box', transform: 'translate3d(0px, 0px, 0px)' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_4 = value === null || value === void 0 ? void 0 : value.item) === null || _4 === void 0 ? void 0 : _4.textStyle), bindDatas: (_6 = (_5 = value === null || value === void 0 ? void 0 : value.item) === null || _5 === void 0 ? void 0 : _5.bindDatas) !== null && _6 !== void 0 ? _6 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_7 = value === null || value === void 0 ? void 0 : value.item) === null || _7 === void 0 ? void 0 : _7.props, { event: ((_8 = value === null || value === void 0 ? void 0 : value.item) === null || _8 === void 0 ? void 0 : _8.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec, isExternalLink: isExternalLink, index: index, isActive: isActive })));
|
16280
16335
|
}
|
16281
16336
|
else {
|
16282
16337
|
return null;
|
@@ -16369,7 +16424,7 @@ var Tagbar$1 = memo(Tagbar);
|
|
16369
16424
|
* @Author: binruan@chatlabs.com
|
16370
16425
|
* @Date: 2024-01-15 19:03:09
|
16371
16426
|
* @LastEditors: binruan@chatlabs.com
|
16372
|
-
* @LastEditTime: 2024-10-
|
16427
|
+
* @LastEditTime: 2024-10-25 15:41:58
|
16373
16428
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
16374
16429
|
*
|
16375
16430
|
*/
|
@@ -16439,7 +16494,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16439
16494
|
// 移动端h5直接杀掉浏览器或宿主app时不会触发,pc端直接杀掉标签页时能触发
|
16440
16495
|
if (repCond) {
|
16441
16496
|
SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_HIDE, item);
|
16442
|
-
handleReportViewImageEnd(item);
|
16497
|
+
// handleReportViewImageEnd(item);
|
16443
16498
|
handleReportProductView(item);
|
16444
16499
|
}
|
16445
16500
|
let fromKName = '';
|
@@ -16484,7 +16539,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16484
16539
|
// 页面可见时触发,注意页面初始化时不会触发
|
16485
16540
|
handleH5EnterLink();
|
16486
16541
|
if (repCond) {
|
16487
|
-
handleViewImageStartEvent(activeIndex);
|
16542
|
+
// handleViewImageStartEvent(activeIndex);
|
16488
16543
|
SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_SHOW, item);
|
16489
16544
|
backMainFeed('external', selectTag);
|
16490
16545
|
}
|
@@ -16713,7 +16768,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16713
16768
|
}
|
16714
16769
|
};
|
16715
16770
|
const handleScrollEvent = (swiper) => {
|
16716
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
16771
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
16717
16772
|
const item = data[swiper.previousIndex];
|
16718
16773
|
if (!item)
|
16719
16774
|
return;
|
@@ -16733,7 +16788,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16733
16788
|
productId: (_g = (_f = item === null || item === void 0 ? void 0 : item.product) === null || _f === void 0 ? void 0 : _f.itemId) !== null && _g !== void 0 ? _g : '',
|
16734
16789
|
requestId: null,
|
16735
16790
|
traceInfo: (_j = (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.traceInfo) !== null && _j !== void 0 ? _j : '',
|
16736
|
-
contentFormat
|
16791
|
+
contentFormat,
|
16792
|
+
position: ((_k = swiper.previousIndex) !== null && _k !== void 0 ? _k : 0) + ''
|
16737
16793
|
}
|
16738
16794
|
});
|
16739
16795
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -16745,11 +16801,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16745
16801
|
eventInfo: {
|
16746
16802
|
eventSubject: 'scrollUp',
|
16747
16803
|
eventDescription: 'User scroll up',
|
16748
|
-
contentId: (
|
16749
|
-
productId: (
|
16804
|
+
contentId: (_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
|
16805
|
+
productId: (_p = (_o = item.product) === null || _o === void 0 ? void 0 : _o.itemId) !== null && _p !== void 0 ? _p : '',
|
16750
16806
|
requestId: null,
|
16751
|
-
traceInfo: (
|
16752
|
-
contentFormat
|
16807
|
+
traceInfo: (_r = (_q = item === null || item === void 0 ? void 0 : item.video) === null || _q === void 0 ? void 0 : _q.traceInfo) !== null && _r !== void 0 ? _r : '',
|
16808
|
+
contentFormat,
|
16809
|
+
position: ((_s = swiper.previousIndex) !== null && _s !== void 0 ? _s : 0) + ''
|
16753
16810
|
}
|
16754
16811
|
});
|
16755
16812
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -16774,7 +16831,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16774
16831
|
viewTime.current = new Date();
|
16775
16832
|
}
|
16776
16833
|
}, [openHashtag, data, activeIndex]);
|
16777
|
-
const handleViewImageStartEvent = (activeIndex) => {
|
16834
|
+
const handleViewImageStartEvent = (activeIndex, imgInfo) => {
|
16778
16835
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
16779
16836
|
const item = data[activeIndex];
|
16780
16837
|
// 如果是图片集则上报事件
|
@@ -16791,7 +16848,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16791
16848
|
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
16792
16849
|
position: activeIndex + '',
|
16793
16850
|
contentFormat: 'image',
|
16794
|
-
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
16851
|
+
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
16852
|
+
contentSize: imgInfo === null || imgInfo === void 0 ? void 0 : imgInfo.contentSize,
|
16853
|
+
loadTime: imgInfo === null || imgInfo === void 0 ? void 0 : imgInfo.loadTime
|
16795
16854
|
}
|
16796
16855
|
});
|
16797
16856
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|