pb-sxp-ui 1.0.33 → 1.0.35
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/LICENSE +21 -21
- package/README.md +111 -111
- package/dist/index.cjs +449 -104
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +6 -1
- package/dist/index.js +448 -104
- 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 +452 -108
- 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/DiyPortalPreview/PictureGroup.d.ts +13 -0
- package/es/core/components/DiyPortalPreview/PictureGroup.js +11 -0
- package/es/core/components/DiyPortalPreview/VideoWidget.d.ts +15 -0
- package/es/core/components/DiyPortalPreview/VideoWidget.js +236 -0
- package/es/core/components/DiyPortalPreview/index.d.ts +6 -0
- package/es/core/components/DiyPortalPreview/index.js +112 -0
- package/es/core/components/SxpPageRender/VideoWidget/index.js +55 -56
- package/es/core/components/SxpPageRender/WaterFall/index.js +1 -1
- package/es/core/components/SxpPageRender/index.js +7 -7
- package/es/core/context/SxpDataSourceProvider.js +1 -1
- package/es/core/hooks/useEventReport.js +4 -4
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/materials/sxp/popup/CommodityDetail/index.js +10 -10
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +10 -10
- package/lib/core/components/DiyPortalPreview/PictureGroup.d.ts +13 -0
- package/lib/core/components/DiyPortalPreview/PictureGroup.js +14 -0
- package/lib/core/components/DiyPortalPreview/VideoWidget.d.ts +15 -0
- package/lib/core/components/DiyPortalPreview/VideoWidget.js +239 -0
- package/lib/core/components/DiyPortalPreview/index.d.ts +6 -0
- package/lib/core/components/DiyPortalPreview/index.js +115 -0
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +55 -56
- package/lib/core/components/SxpPageRender/WaterFall/index.js +1 -1
- package/lib/core/components/SxpPageRender/index.js +7 -7
- package/lib/core/context/SxpDataSourceProvider.js +1 -1
- package/lib/core/hooks/useEventReport.js +4 -4
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -1
- package/lib/materials/sxp/popup/CommodityDetail/index.js +10 -10
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +10 -10
- package/package.json +115 -114
package/dist/index.js
CHANGED
@@ -6,6 +6,7 @@ import qs from 'qs';
|
|
6
6
|
import { css } from '@emotion/css';
|
7
7
|
import { BetaSchemaForm } from '@ant-design/pro-components';
|
8
8
|
import * as ReactDOM from 'react-dom';
|
9
|
+
import Hls from 'hls.js';
|
9
10
|
import EventEmitter from 'eventemitter3';
|
10
11
|
|
11
12
|
/******************************************************************************
|
@@ -554,7 +555,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
554
555
|
fromKName = 'imagePage';
|
555
556
|
}
|
556
557
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
557
|
-
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '',
|
558
|
+
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '', contentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_m = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _m !== void 0 ? _m : '', fromKName })
|
558
559
|
});
|
559
560
|
}, [bffEventReport, isFromHashtag]);
|
560
561
|
useEffect(() => {
|
@@ -841,7 +842,7 @@ const EditorCore = forwardRef(({ children, resolver, isSsr, schema, enableDataSo
|
|
841
842
|
React.createElement(DataSourceProvider$1, { isSsr: isSsr, enable: enableDataSource }, children)));
|
842
843
|
});
|
843
844
|
|
844
|
-
var index$
|
845
|
+
var index$2 = /*#__PURE__*/Object.freeze({
|
845
846
|
__proto__: null,
|
846
847
|
EditorCore: EditorCore
|
847
848
|
});
|
@@ -8127,8 +8128,8 @@ function useEventReport() {
|
|
8127
8128
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
8128
8129
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
8129
8130
|
position: position + '',
|
8130
|
-
|
8131
|
-
|
8131
|
+
contentId: (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
|
8132
|
+
ctatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
|
8132
8133
|
traceInfo: (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : ''
|
8133
8134
|
}
|
8134
8135
|
});
|
@@ -8152,8 +8153,8 @@ function useEventReport() {
|
|
8152
8153
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
8153
8154
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
8154
8155
|
position: position + '',
|
8155
|
-
|
8156
|
-
|
8156
|
+
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
8157
|
+
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
8157
8158
|
traceInfo: product === null || product === void 0 ? void 0 : product.traceInfo,
|
8158
8159
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
8159
8160
|
eventSubject: 'productView',
|
@@ -8316,7 +8317,7 @@ const FormatImage = forwardRef((props, ref) => {
|
|
8316
8317
|
var FormatImage$1 = memo(FormatImage);
|
8317
8318
|
|
8318
8319
|
const CommodityDetail$1 = (_a) => {
|
8319
|
-
var _b, _c, _d, _e, _f, _g, _h, _j;
|
8320
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
8320
8321
|
var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index"]);
|
8321
8322
|
const { sxpParameter } = useSxpDataSource();
|
8322
8323
|
const { popupDetailData, bffEventReport, isPreview, waterFallData } = useSxpDataSource();
|
@@ -8357,7 +8358,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8357
8358
|
return '$7,000';
|
8358
8359
|
}
|
8359
8360
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
8360
|
-
const width = isPreview ? 375 : window.innerWidth;
|
8361
|
+
const width = isPreview ? 375 : (_f = style === null || style === void 0 ? void 0 : style.width) !== null && _f !== void 0 ? _f : window.innerWidth;
|
8361
8362
|
const renderContent = ({ isPost }) => {
|
8362
8363
|
var _a, _b, _c;
|
8363
8364
|
return (React.createElement("div", null,
|
@@ -8365,10 +8366,10 @@ const CommodityDetail$1 = (_a) => {
|
|
8365
8366
|
React.createElement("div", { className: 'pb-commondity-content-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title, hidden: !!product && !(product === null || product === void 0 ? void 0 : product.title) }, (_b = product === null || product === void 0 ? void 0 : product.title) !== null && _b !== void 0 ? _b : 'Pendant in Yellow Gold with Diamonds, Medium'),
|
8366
8367
|
React.createElement("div", { className: 'pb-commondity-content-price', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price, hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price) }, priceText),
|
8367
8368
|
React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
8368
|
-
React.createElement(ExpandableText$1, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_c = product === null || product === void 0 ? void 0 : product.info) !== null && _c !== void 0 ? _c : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
|
8369
|
-
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
8370
|
-
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
8371
|
-
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
8369
|
+
React.createElement(ExpandableText$1, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_c = product === null || product === void 0 ? void 0 : product.info) !== null && _c !== void 0 ? _c : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
|
8370
|
+
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
8371
|
+
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
8372
|
+
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
8372
8373
|
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 }))));
|
8373
8374
|
};
|
8374
8375
|
const renderBtn = () => {
|
@@ -8377,7 +8378,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8377
8378
|
};
|
8378
8379
|
return (React.createElement("div", { className: 'pb-commondity' },
|
8379
8380
|
React.createElement("div", Object.assign({ className: css(Object.assign({}, style)) }, props),
|
8380
|
-
product && ((
|
8381
|
+
product && ((_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.length) > 0 && (React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
|
8381
8382
|
clickable: true,
|
8382
8383
|
bulletActiveClass: 'swipe-item-active-bullet',
|
8383
8384
|
clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
|
@@ -8385,7 +8386,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8385
8386
|
: 'commondityDetail-swiper-clickable-center'
|
8386
8387
|
}, loop: true, autoplay: {
|
8387
8388
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
8388
|
-
} }, (
|
8389
|
+
} }, (_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.map((src) => {
|
8389
8390
|
return (React.createElement(SwiperSlide, { key: src },
|
8390
8391
|
React.createElement("div", { style: {
|
8391
8392
|
overflow: 'hidden',
|
@@ -8394,7 +8395,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8394
8395
|
} },
|
8395
8396
|
React.createElement(FormatImage$1, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
|
8396
8397
|
}))),
|
8397
|
-
!((
|
8398
|
+
!((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css({
|
8398
8399
|
position: 'relative',
|
8399
8400
|
height: 0,
|
8400
8401
|
width: '100%',
|
@@ -8407,7 +8408,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8407
8408
|
top: 0,
|
8408
8409
|
objectFit: 'cover',
|
8409
8410
|
width: '100%'
|
8410
|
-
}), src: (
|
8411
|
+
}), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
|
8411
8412
|
React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
|
8412
8413
|
renderBtn(),
|
8413
8414
|
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) },
|
@@ -8767,7 +8768,7 @@ var settingRender$2 = [
|
|
8767
8768
|
];
|
8768
8769
|
|
8769
8770
|
const CommodityDetailDiroNew$1 = (_a) => {
|
8770
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
8771
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
8771
8772
|
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"]);
|
8772
8773
|
useState(true);
|
8773
8774
|
const { sxpParameter } = useSxpDataSource();
|
@@ -8815,16 +8816,16 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
8815
8816
|
return '£102,300.00';
|
8816
8817
|
}
|
8817
8818
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
8818
|
-
const width = isPreview ? 375 : window.innerWidth;
|
8819
|
+
const width = isPreview ? 375 : (_f = style === null || style === void 0 ? void 0 : style.width) !== null && _f !== void 0 ? _f : window.innerWidth;
|
8819
8820
|
const productInfoText = ({ isPost }) => {
|
8820
8821
|
return (React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
8821
8822
|
React.createElement(ExpandableText$1, { isPost: isPost, onClick: () => setShowModal(true), className: 'pb-commondityDiroNew-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (product === null || product === void 0 ? void 0 : product.info) ||
|
8822
|
-
`Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
|
8823
|
+
`Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
|
8823
8824
|
Made in Italy` })));
|
8824
8825
|
};
|
8825
8826
|
return (React.createElement("div", { className: 'pb-commondityDiroNew' },
|
8826
8827
|
React.createElement("div", Object.assign({ ref: scrollRef, className: css(Object.assign({}, style)) }, props),
|
8827
|
-
product && ((
|
8828
|
+
product && ((_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.length) > 0 && (React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
|
8828
8829
|
clickable: true,
|
8829
8830
|
bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
|
8830
8831
|
clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
|
@@ -8832,7 +8833,7 @@ Made in Italy` })));
|
|
8832
8833
|
: 'commondityDiroNew-swiper-clickable-center'
|
8833
8834
|
}, loop: true, autoplay: {
|
8834
8835
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
8835
|
-
} }, (
|
8836
|
+
} }, (_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.map((src) => {
|
8836
8837
|
return (React.createElement(SwiperSlide, { key: src },
|
8837
8838
|
React.createElement("div", { style: {
|
8838
8839
|
overflow: 'hidden',
|
@@ -8841,7 +8842,7 @@ Made in Italy` })));
|
|
8841
8842
|
} },
|
8842
8843
|
React.createElement(FormatImage$1, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
|
8843
8844
|
}))),
|
8844
|
-
!((
|
8845
|
+
!((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css({
|
8845
8846
|
position: 'relative',
|
8846
8847
|
height: 0,
|
8847
8848
|
width: '100%',
|
@@ -8854,16 +8855,16 @@ Made in Italy` })));
|
|
8854
8855
|
top: 0,
|
8855
8856
|
objectFit: 'cover',
|
8856
8857
|
width: '100%'
|
8857
|
-
}), src: (
|
8858
|
+
}), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
|
8858
8859
|
React.createElement("div", { className: 'pb-commondityDiroNew-content' },
|
8859
8860
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
|
8860
8861
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
|
8861
|
-
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title }, (
|
8862
|
+
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title }, (_l = product === null || product === void 0 ? void 0 : product.title) !== null && _l !== void 0 ? _l : 'Large Dior Toujours Bag'),
|
8862
8863
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-collection', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === ''), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection }, (product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage Calfskin')),
|
8863
8864
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
|
8864
8865
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price }, priceText),
|
8865
|
-
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo }, (
|
8866
|
-
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle }, (
|
8866
|
+
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo }, (_m = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _m !== void 0 ? _m : '税费'))),
|
8867
|
+
(!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')),
|
8867
8868
|
productInfoText({ isPost }))),
|
8868
8869
|
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
|
8869
8870
|
};
|
@@ -11771,7 +11772,7 @@ const WaterFall = (props) => {
|
|
11771
11772
|
}
|
11772
11773
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
11773
11774
|
eventInfo: {
|
11774
|
-
|
11775
|
+
contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
11775
11776
|
position: cacheActiveIndex + '',
|
11776
11777
|
contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
|
11777
11778
|
traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
|
@@ -11904,14 +11905,14 @@ var _materials_ = /*#__PURE__*/Object.freeze({
|
|
11904
11905
|
Prompt: Prompt
|
11905
11906
|
});
|
11906
11907
|
|
11907
|
-
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
11908
|
-
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
11908
|
+
const defaultUnLikeIconPath$1 = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
11909
|
+
const defaultLikeIconPath$1 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
11909
11910
|
const LikeButton = (_a) => {
|
11910
11911
|
var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
|
11911
11912
|
const { mutateLike, mutateUnlike, bffEventReport } = useSxpDataSource();
|
11912
11913
|
const [state, setState] = useState(active);
|
11913
|
-
const likeIcon = useIconLink(defaultLikeIconPath);
|
11914
|
-
const unlikeIcon = useIconLink(defaultUnLikeIconPath);
|
11914
|
+
const likeIcon = useIconLink(defaultLikeIconPath$1);
|
11915
|
+
const unlikeIcon = useIconLink(defaultUnLikeIconPath$1);
|
11915
11916
|
const handleClick = debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
11916
11917
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
11917
11918
|
if (state) {
|
@@ -11967,7 +11968,7 @@ var SXP_EVENT_TYPE;
|
|
11967
11968
|
SXP_EVENT_TYPE["PAGE_DID_HIDE"] = "pageDidHide";
|
11968
11969
|
})(SXP_EVENT_TYPE || (SXP_EVENT_TYPE = {}));
|
11969
11970
|
|
11970
|
-
const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig }) => {
|
11971
|
+
const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPostConfig }) => {
|
11971
11972
|
const [isPauseVideo, setIsPauseVideo] = useState(false);
|
11972
11973
|
const videoRef = useRef(null);
|
11973
11974
|
const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
|
@@ -11977,13 +11978,12 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
11977
11978
|
const { isActive } = useSwiperSlide();
|
11978
11979
|
const canvasRef = useRef(null);
|
11979
11980
|
const [firstFrameSrc, setFirstFrameSrc] = useState('');
|
11980
|
-
const videoId = `pb-video-${index}`;
|
11981
11981
|
useEffect(() => {
|
11982
11982
|
if (!videoRef.current)
|
11983
11983
|
return;
|
11984
|
-
videoRef.current.muted
|
11984
|
+
videoRef.current.muted = muted;
|
11985
11985
|
}, [muted]);
|
11986
|
-
const
|
11986
|
+
const handleVideoStart = useCallback(() => {
|
11987
11987
|
var _a;
|
11988
11988
|
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
11989
11989
|
}, []);
|
@@ -11992,10 +11992,10 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
11992
11992
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
11993
11993
|
setIsPauseVideo(false);
|
11994
11994
|
const item = data[index];
|
11995
|
-
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration
|
11996
|
-
videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime
|
11997
|
-
const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration
|
11998
|
-
const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime
|
11995
|
+
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
11996
|
+
videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
|
11997
|
+
const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
11998
|
+
const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
|
11999
11999
|
const playType = isFirstPlay ? '0' : '1';
|
12000
12000
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
12001
12001
|
eventInfo: {
|
@@ -12015,14 +12015,14 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
12015
12015
|
setIsFirstPlay(false);
|
12016
12016
|
}
|
12017
12017
|
}, [bffEventReport, data, index, isFirstPlay]);
|
12018
|
-
const
|
12018
|
+
const handleLoadedMetadata = useCallback(() => {
|
12019
12019
|
setIsLoadFinish(true);
|
12020
12020
|
}, []);
|
12021
12021
|
const handleClickVideo = useCallback((type) => () => {
|
12022
12022
|
var _a, _b, _c, _d, _e;
|
12023
12023
|
if (!isLoadFinish)
|
12024
12024
|
return;
|
12025
|
-
const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused
|
12025
|
+
const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
12026
12026
|
switch (type) {
|
12027
12027
|
case 'start':
|
12028
12028
|
if (!isPause)
|
@@ -12047,13 +12047,13 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
12047
12047
|
break;
|
12048
12048
|
}
|
12049
12049
|
}, [isLoadFinish]);
|
12050
|
-
const
|
12050
|
+
const onPause = useCallback(() => {
|
12051
12051
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
12052
12052
|
const item = data[index];
|
12053
|
-
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration
|
12054
|
-
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime
|
12055
|
-
if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration
|
12056
|
-
const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime
|
12053
|
+
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
12054
|
+
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
12055
|
+
if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
|
12056
|
+
const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
|
12057
12057
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
12058
12058
|
eventInfo: {
|
12059
12059
|
eventSubject: 'playOverVideo',
|
@@ -12085,10 +12085,9 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
12085
12085
|
return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
|
12086
12086
|
}, [firstFrameSrc, rec]);
|
12087
12087
|
const handLoadeddata = useCallback(() => {
|
12088
|
-
|
12089
|
-
if (!canvasRef || !videoDomRef || !canvasRef.current)
|
12088
|
+
if (!canvasRef || !videoRef || !videoRef.current || !canvasRef.current)
|
12090
12089
|
return;
|
12091
|
-
const video =
|
12090
|
+
const video = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current;
|
12092
12091
|
const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
|
12093
12092
|
const ctx = canvas.getContext('2d');
|
12094
12093
|
const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
|
@@ -12099,35 +12098,43 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
12099
12098
|
setFirstFrameSrc(canvas.toDataURL());
|
12100
12099
|
}, []);
|
12101
12100
|
useEffect(() => {
|
12102
|
-
var _a, _b, _c, _d
|
12103
|
-
if (videoRef.current)
|
12101
|
+
var _a, _b, _c, _d;
|
12102
|
+
if (!videoRef.current)
|
12104
12103
|
return;
|
12105
12104
|
setIsPauseVideo(false);
|
12106
|
-
|
12107
|
-
|
12108
|
-
|
12109
|
-
|
12110
|
-
|
12111
|
-
|
12112
|
-
|
12113
|
-
|
12114
|
-
|
12115
|
-
|
12116
|
-
|
12117
|
-
|
12118
|
-
|
12119
|
-
|
12120
|
-
|
12121
|
-
|
12122
|
-
|
12105
|
+
if (!videoRef.current.src) {
|
12106
|
+
const videoSrc = rec.video.url;
|
12107
|
+
if (videoSrc.includes('.m3u8')) {
|
12108
|
+
if (Hls.isSupported()) {
|
12109
|
+
const hls = new Hls();
|
12110
|
+
hls.loadSource(videoSrc);
|
12111
|
+
hls.attachMedia(videoRef.current);
|
12112
|
+
}
|
12113
|
+
else if (videoRef.current.canPlayType('application/vnd.apple.mpegurl')) {
|
12114
|
+
videoRef.current.src = videoSrc;
|
12115
|
+
}
|
12116
|
+
else {
|
12117
|
+
videoRef.current.src = videoSrc;
|
12118
|
+
}
|
12119
|
+
}
|
12120
|
+
else {
|
12121
|
+
videoRef.current.src = videoSrc;
|
12122
|
+
}
|
12123
|
+
videoRef.current.setAttribute('x5-playsinline', 'true');
|
12124
|
+
videoRef.current.setAttribute('webkit-playsinline', 'true');
|
12123
12125
|
}
|
12124
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.
|
12125
|
-
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.
|
12126
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.
|
12127
|
-
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.
|
12128
|
-
(
|
12129
|
-
|
12130
|
-
|
12126
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('loadedmetadata', handleLoadedMetadata);
|
12127
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('canplay', handleLoadedMetadata);
|
12128
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('playing', handlePlaying);
|
12129
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('loadeddata', handLoadeddata);
|
12130
|
+
return () => {
|
12131
|
+
var _a, _b, _c, _d;
|
12132
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('loadedmetadata', handleLoadedMetadata);
|
12133
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('canplay', handleLoadedMetadata);
|
12134
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('playing', handlePlaying);
|
12135
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
|
12136
|
+
};
|
12137
|
+
}, [handleLoadedMetadata, handlePlaying, rec.video, handLoadeddata]);
|
12131
12138
|
useEffect(() => {
|
12132
12139
|
var _a;
|
12133
12140
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
|
@@ -12213,31 +12220,23 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
12213
12220
|
right: 0
|
12214
12221
|
} },
|
12215
12222
|
React.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' } },
|
12216
|
-
React.createElement("video", { id: `pb-video-${index}`,
|
12223
|
+
React.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, crossOrigin: 'anonymous', muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart, style: {
|
12217
12224
|
width: '100%',
|
12218
12225
|
height: '100%',
|
12219
|
-
objectFit: 'contain'
|
12220
|
-
backgroundColor: 'transparent',
|
12221
|
-
pointerEvents: 'none'
|
12226
|
+
objectFit: 'contain'
|
12222
12227
|
} }),
|
12223
12228
|
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
|
12224
|
-
renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, style: {
|
12229
|
+
renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
|
12225
12230
|
position: 'relative',
|
12226
12231
|
width: '100%',
|
12227
12232
|
height,
|
12228
12233
|
overflow: 'hidden'
|
12229
|
-
}
|
12230
|
-
React.createElement("video", { id: `pb-video-${index}`,
|
12231
|
-
backgroundColor: 'transparent',
|
12232
|
-
width: '100%',
|
12233
|
-
height: '100%',
|
12234
|
-
objectFit: 'cover',
|
12235
|
-
pointerEvents: 'none'
|
12236
|
-
} }),
|
12234
|
+
} },
|
12235
|
+
React.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, crossOrigin: 'anonymous', muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart }),
|
12237
12236
|
renderPoster,
|
12238
12237
|
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
|
12239
12238
|
};
|
12240
|
-
var VideoWidget$
|
12239
|
+
var VideoWidget$3 = memo(VideoWidget$2);
|
12241
12240
|
|
12242
12241
|
/*
|
12243
12242
|
* @Author: binruan@chatlabs.com
|
@@ -12336,7 +12335,7 @@ const Picture = (props) => {
|
|
12336
12335
|
* @LastEditTime: 2024-04-18 19:56:22
|
12337
12336
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
|
12338
12337
|
*/
|
12339
|
-
const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
12338
|
+
const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
12340
12339
|
var _a;
|
12341
12340
|
const ref = useRef();
|
12342
12341
|
const { isActive } = useSwiperSlide();
|
@@ -12365,7 +12364,7 @@ const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd
|
|
12365
12364
|
React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
|
12366
12365
|
})));
|
12367
12366
|
};
|
12368
|
-
var PictureGroup$
|
12367
|
+
var PictureGroup$3 = memo(PictureGroup$2);
|
12369
12368
|
|
12370
12369
|
/*
|
12371
12370
|
* @Author: binruan@chatlabs.com
|
@@ -12544,7 +12543,7 @@ const Nudge = ({ nudge }) => {
|
|
12544
12543
|
* @Author: binruan@chatlabs.com
|
12545
12544
|
* @Date: 2024-01-15 19:03:09
|
12546
12545
|
* @LastEditors: binruan@chatlabs.com
|
12547
|
-
* @LastEditTime: 2024-04-
|
12546
|
+
* @LastEditTime: 2024-04-23 15:48:32
|
12548
12547
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
12549
12548
|
*
|
12550
12549
|
*/
|
@@ -12626,8 +12625,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12626
12625
|
// sessionDuration: Math.floor(((new Date() as any) - curTime) / 1000) + '',
|
12627
12626
|
// eventSubject: 'sessionCompleted',
|
12628
12627
|
// eventDescription: 'Session completed',
|
12629
|
-
//
|
12630
|
-
//
|
12628
|
+
// contentId: item?.video?.itemId,
|
12629
|
+
// productId: item?.product?.itemId,
|
12631
12630
|
// position: item?.position
|
12632
12631
|
// }
|
12633
12632
|
// });
|
@@ -12671,12 +12670,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12671
12670
|
sessionDuration: Math.floor((new Date() - curTime.current) / 1000) + '',
|
12672
12671
|
eventSubject: 'sessionCompleted',
|
12673
12672
|
eventDescription: 'Session completed',
|
12674
|
-
|
12675
|
-
|
12673
|
+
contentId: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId,
|
12674
|
+
productId: (_m = item === null || item === void 0 ? void 0 : item.product) === null || _m === void 0 ? void 0 : _m.itemId,
|
12676
12675
|
position: activeIndex + '',
|
12677
12676
|
fromKName,
|
12678
12677
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
12679
|
-
|
12678
|
+
ctatId: (_q = (_p = (_o = item.video) === null || _o === void 0 ? void 0 : _o.bindCta) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : ''
|
12680
12679
|
}
|
12681
12680
|
});
|
12682
12681
|
}
|
@@ -12705,10 +12704,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12705
12704
|
const renderContent = useCallback((rec, index) => {
|
12706
12705
|
var _a, _b, _c, _d;
|
12707
12706
|
if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
12708
|
-
return (React.createElement(VideoWidget$
|
12707
|
+
return (React.createElement(VideoWidget$3, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost }));
|
12709
12708
|
}
|
12710
12709
|
if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
12711
|
-
return (React.createElement(PictureGroup$
|
12710
|
+
return (React.createElement(PictureGroup$3, { key: rec.video.itemId, imgUrls: rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onReportViewImageEnd: handleReportViewImageEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
|
12712
12711
|
}
|
12713
12712
|
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
12714
12713
|
return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
|
@@ -12810,8 +12809,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12810
12809
|
eventInfo: {
|
12811
12810
|
eventSubject: 'scrollDown',
|
12812
12811
|
eventDescription: 'User scroll down',
|
12813
|
-
|
12814
|
-
|
12812
|
+
contentId: (_b = (_a = item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
|
12813
|
+
productId: (_d = (_c = item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
12815
12814
|
requestId: null
|
12816
12815
|
}
|
12817
12816
|
});
|
@@ -12823,8 +12822,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12823
12822
|
eventInfo: {
|
12824
12823
|
eventSubject: 'scrollUp',
|
12825
12824
|
eventDescription: 'User scroll up',
|
12826
|
-
|
12827
|
-
|
12825
|
+
contentId: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
|
12826
|
+
productId: (_h = (_g = item.product) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
12828
12827
|
requestId: null
|
12829
12828
|
}
|
12830
12829
|
});
|
@@ -12947,6 +12946,351 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12947
12946
|
React.createElement(WaterFall$1, Object.assign({}, (_g = (_f = (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.item) === null || _g === void 0 ? void 0 : _g.props))));
|
12948
12947
|
};
|
12949
12948
|
|
12949
|
+
const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
|
12950
|
+
return (React.createElement(Swiper, { defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: { clickable: true, bulletActiveClass: 'swipe-item-active-bullet' }, height: height, style: { width }, loop: true, autoplay: false }, imgUrls === null || imgUrls === void 0 ? void 0 : imgUrls.map((url) => {
|
12951
|
+
return (React.createElement(SwiperSlide, { key: url },
|
12952
|
+
React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
|
12953
|
+
})));
|
12954
|
+
};
|
12955
|
+
var PictureGroup$1 = memo(PictureGroup);
|
12956
|
+
|
12957
|
+
const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, width }) => {
|
12958
|
+
const [isPauseVideo, setIsPauseVideo] = useState(false);
|
12959
|
+
const videoRef = useRef(null);
|
12960
|
+
const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
|
12961
|
+
const videoStartTime = useRef(0);
|
12962
|
+
const [isLoadFinish, setIsLoadFinish] = useState(false);
|
12963
|
+
const [isFirstPlay, setIsFirstPlay] = useState(true);
|
12964
|
+
const canvasRef = useRef(null);
|
12965
|
+
const [firstFrameSrc, setFirstFrameSrc] = useState('');
|
12966
|
+
useEffect(() => {
|
12967
|
+
if (!videoRef.current)
|
12968
|
+
return;
|
12969
|
+
videoRef.current.muted = muted;
|
12970
|
+
}, [muted]);
|
12971
|
+
const handleVideoStart = useCallback(() => {
|
12972
|
+
var _a;
|
12973
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
12974
|
+
}, []);
|
12975
|
+
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
12976
|
+
const handlePlaying = useCallback(() => {
|
12977
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
12978
|
+
setIsPauseVideo(false);
|
12979
|
+
const item = data[index];
|
12980
|
+
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
12981
|
+
videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
|
12982
|
+
const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
12983
|
+
const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
|
12984
|
+
const playType = isFirstPlay ? '0' : '1';
|
12985
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
12986
|
+
eventInfo: {
|
12987
|
+
eventSubject: 'playVideo',
|
12988
|
+
eventDescription: 'User played the video',
|
12989
|
+
contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
12990
|
+
contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
12991
|
+
playType,
|
12992
|
+
startTime: videoCurrentTime,
|
12993
|
+
videoDuration,
|
12994
|
+
contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
12995
|
+
position: index + '',
|
12996
|
+
contentFormat: 'video',
|
12997
|
+
traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
12998
|
+
}
|
12999
|
+
});
|
13000
|
+
setIsFirstPlay(false);
|
13001
|
+
}
|
13002
|
+
}, [bffEventReport, data, index, isFirstPlay]);
|
13003
|
+
const handleLoadedMetadata = useCallback(() => {
|
13004
|
+
setIsLoadFinish(true);
|
13005
|
+
}, []);
|
13006
|
+
const handleClickVideo = useCallback((type) => () => {
|
13007
|
+
var _a, _b, _c, _d, _e;
|
13008
|
+
if (!isLoadFinish)
|
13009
|
+
return;
|
13010
|
+
const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
13011
|
+
switch (type) {
|
13012
|
+
case 'start':
|
13013
|
+
if (!isPause)
|
13014
|
+
return;
|
13015
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
|
13016
|
+
setIsPauseVideo(false);
|
13017
|
+
break;
|
13018
|
+
case 'pause':
|
13019
|
+
if (isPause)
|
13020
|
+
return;
|
13021
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
13022
|
+
setIsPauseVideo(true);
|
13023
|
+
break;
|
13024
|
+
default:
|
13025
|
+
if (isPause) {
|
13026
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
|
13027
|
+
}
|
13028
|
+
else {
|
13029
|
+
(_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
|
13030
|
+
}
|
13031
|
+
setIsPauseVideo(!isPause);
|
13032
|
+
break;
|
13033
|
+
}
|
13034
|
+
}, [isLoadFinish]);
|
13035
|
+
const onPause = useCallback(() => {
|
13036
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
13037
|
+
const item = data[index];
|
13038
|
+
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
13039
|
+
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
13040
|
+
if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
|
13041
|
+
const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
|
13042
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
13043
|
+
eventInfo: {
|
13044
|
+
eventSubject: 'playOverVideo',
|
13045
|
+
eventDescription: 'User finished playing the video',
|
13046
|
+
contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
13047
|
+
contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
13048
|
+
endTime: videoCurrentTime,
|
13049
|
+
videoDuration,
|
13050
|
+
playDuration,
|
13051
|
+
contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
13052
|
+
position: index + '',
|
13053
|
+
contentFormat: 'video',
|
13054
|
+
traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
13055
|
+
}
|
13056
|
+
});
|
13057
|
+
}
|
13058
|
+
}, [data, index, bffEventReport]);
|
13059
|
+
const blur = useMemo(() => {
|
13060
|
+
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
|
13061
|
+
}, [videoPostConfig]);
|
13062
|
+
const translateY = useMemo(() => {
|
13063
|
+
var _a;
|
13064
|
+
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
|
13065
|
+
? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%) translate3d(0px, 0px, 0px)`
|
13066
|
+
: 'translateY(-50%)';
|
13067
|
+
}, [videoPostConfig]);
|
13068
|
+
const blurBgSrc = useMemo(() => {
|
13069
|
+
var _a;
|
13070
|
+
return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
|
13071
|
+
}, [firstFrameSrc, rec]);
|
13072
|
+
const handLoadeddata = useCallback(() => {
|
13073
|
+
if (!canvasRef || !videoRef || !videoRef.current || !canvasRef.current)
|
13074
|
+
return;
|
13075
|
+
const video = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current;
|
13076
|
+
const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
|
13077
|
+
const ctx = canvas.getContext('2d');
|
13078
|
+
const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
|
13079
|
+
const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
|
13080
|
+
canvas.height = targetHeight;
|
13081
|
+
canvas.width = targetWidth;
|
13082
|
+
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
13083
|
+
setFirstFrameSrc(canvas.toDataURL());
|
13084
|
+
}, []);
|
13085
|
+
useEffect(() => {
|
13086
|
+
var _a, _b, _c, _d;
|
13087
|
+
if (!videoRef.current)
|
13088
|
+
return;
|
13089
|
+
setIsPauseVideo(false);
|
13090
|
+
if (!videoRef.current.src) {
|
13091
|
+
const videoSrc = rec.video.url;
|
13092
|
+
if (videoSrc.includes('.m3u8')) {
|
13093
|
+
if (Hls.isSupported()) {
|
13094
|
+
const hls = new Hls();
|
13095
|
+
hls.loadSource(videoSrc);
|
13096
|
+
hls.attachMedia(videoRef.current);
|
13097
|
+
}
|
13098
|
+
else if (videoRef.current.canPlayType('application/vnd.apple.mpegurl')) {
|
13099
|
+
videoRef.current.src = videoSrc;
|
13100
|
+
}
|
13101
|
+
else {
|
13102
|
+
videoRef.current.src = videoSrc;
|
13103
|
+
}
|
13104
|
+
}
|
13105
|
+
else {
|
13106
|
+
videoRef.current.src = videoSrc;
|
13107
|
+
}
|
13108
|
+
videoRef.current.setAttribute('x5-playsinline', 'true');
|
13109
|
+
videoRef.current.setAttribute('webkit-playsinline', 'true');
|
13110
|
+
}
|
13111
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('loadedmetadata', handleLoadedMetadata);
|
13112
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('canplay', handleLoadedMetadata);
|
13113
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('playing', handlePlaying);
|
13114
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('loadeddata', handLoadeddata);
|
13115
|
+
return () => {
|
13116
|
+
var _a, _b, _c, _d;
|
13117
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('loadedmetadata', handleLoadedMetadata);
|
13118
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('canplay', handleLoadedMetadata);
|
13119
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('playing', handlePlaying);
|
13120
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
|
13121
|
+
};
|
13122
|
+
}, [handleLoadedMetadata, handlePlaying, rec.video, handLoadeddata]);
|
13123
|
+
const renderPoster = useMemo(() => {
|
13124
|
+
if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
|
13125
|
+
return null;
|
13126
|
+
}
|
13127
|
+
return (React.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 }));
|
13128
|
+
}, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
|
13129
|
+
useEffect(() => {
|
13130
|
+
const handleBeforeUnload = () => {
|
13131
|
+
var _a, _b;
|
13132
|
+
if (activeIndex === index && ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) && ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.src) && !isPauseVideo) {
|
13133
|
+
handleClickVideo('pause')();
|
13134
|
+
}
|
13135
|
+
};
|
13136
|
+
window.addEventListener('beforeunload', handleBeforeUnload);
|
13137
|
+
return () => {
|
13138
|
+
window.removeEventListener('beforeunload', handleBeforeUnload);
|
13139
|
+
};
|
13140
|
+
}, [activeIndex, index, rec, videoRef, handleClickVideo, isPauseVideo]);
|
13141
|
+
const blurStyle = useMemo(() => {
|
13142
|
+
return blur
|
13143
|
+
? {
|
13144
|
+
filter: 'blur(10px)',
|
13145
|
+
transform: 'translate3d(0px, 0px, 0px) scale(1.2)'
|
13146
|
+
}
|
13147
|
+
: {};
|
13148
|
+
}, [blur]);
|
13149
|
+
if (!rec.video) {
|
13150
|
+
return null;
|
13151
|
+
}
|
13152
|
+
return (React.createElement(React.Fragment, null, blur ? (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
|
13153
|
+
position: 'relative',
|
13154
|
+
width,
|
13155
|
+
height,
|
13156
|
+
overflow: 'hidden'
|
13157
|
+
} },
|
13158
|
+
React.createElement(FormatImage$1, { src: blurBgSrc, style: Object.assign({ height,
|
13159
|
+
width, objectFit: 'cover' }, blurStyle) }),
|
13160
|
+
React.createElement("canvas", { ref: canvasRef, style: { display: 'none' } }),
|
13161
|
+
React.createElement("div", { style: {
|
13162
|
+
position: 'absolute',
|
13163
|
+
width,
|
13164
|
+
height,
|
13165
|
+
top: '50%',
|
13166
|
+
transform: translateY,
|
13167
|
+
left: 0,
|
13168
|
+
right: 0
|
13169
|
+
} },
|
13170
|
+
React.createElement("div", { style: { position: 'relative', width, height: '100%' } },
|
13171
|
+
React.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, crossOrigin: 'anonymous', muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart, style: {
|
13172
|
+
width: '100%',
|
13173
|
+
height,
|
13174
|
+
objectFit: 'contain'
|
13175
|
+
} }),
|
13176
|
+
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
|
13177
|
+
renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
|
13178
|
+
position: 'relative',
|
13179
|
+
width,
|
13180
|
+
height,
|
13181
|
+
overflow: 'hidden'
|
13182
|
+
} },
|
13183
|
+
React.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, crossOrigin: 'anonymous', muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart }),
|
13184
|
+
renderPoster,
|
13185
|
+
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
|
13186
|
+
};
|
13187
|
+
var VideoWidget$1 = memo(VideoWidget);
|
13188
|
+
|
13189
|
+
const RESOLVER$1 = {};
|
13190
|
+
Object.values(_materials_).forEach((v) => {
|
13191
|
+
RESOLVER$1[v.extend.type] = v;
|
13192
|
+
});
|
13193
|
+
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
13194
|
+
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
13195
|
+
const DiyPortalPreview = ({ data, globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain }) => {
|
13196
|
+
const height = useMemo(() => {
|
13197
|
+
return (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo) ? containerHeight - 45 : containerHeight;
|
13198
|
+
}, [globalConfig, containerHeight]);
|
13199
|
+
const renderContent = (rec, index) => {
|
13200
|
+
var _a, _b, _c, _d;
|
13201
|
+
if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
13202
|
+
return (React.createElement(VideoWidget$1, { rec: rec, index: index, muted: true, width: containerWidth, data: data !== null && data !== void 0 ? data : [], height: height, activeIndex: index, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost }));
|
13203
|
+
}
|
13204
|
+
if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
13205
|
+
return (React.createElement(PictureGroup$1, { key: rec.video.itemId, imgUrls: rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
|
13206
|
+
}
|
13207
|
+
if (rec.product) {
|
13208
|
+
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
13209
|
+
return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
|
13210
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
13211
|
+
const t = RESOLVER$1[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
13212
|
+
const Component = withBindDataSource(t);
|
13213
|
+
const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
|
13214
|
+
return (React.createElement(Component, Object.assign({ key: `${index}${idx}`, textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.textStyle), bindDatas: (_e = (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.bindDatas) !== null && _e !== void 0 ? _e : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.props, { event: ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.event) || {},
|
13215
|
+
// schema={schema}
|
13216
|
+
id: value === null || value === void 0 ? void 0 : value.id,
|
13217
|
+
// viewTime={viewTime.current}
|
13218
|
+
rec: rec, isPost: true, tipText: tipText, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.style), { width: containerWidth, height, overflow: 'auto' }), index: index })));
|
13219
|
+
});
|
13220
|
+
}
|
13221
|
+
}
|
13222
|
+
};
|
13223
|
+
const renderLogo = useMemo(() => {
|
13224
|
+
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
13225
|
+
return (React.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
|
13226
|
+
React.createElement("img", { src: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl, alt: 'logo' })));
|
13227
|
+
}
|
13228
|
+
return null;
|
13229
|
+
}, [globalConfig]);
|
13230
|
+
const renderBottom = (rec, index) => {
|
13231
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
13232
|
+
if (rec.video) {
|
13233
|
+
return (React.createElement(React.Fragment, null,
|
13234
|
+
((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
13235
|
+
React.createElement("div", { className: 'clc-sxp-bottom' },
|
13236
|
+
React.createElement(Nudge, { nudge: nudge }),
|
13237
|
+
React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
13238
|
+
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1 })),
|
13239
|
+
React.createElement("div", null,
|
13240
|
+
React.createElement(ExpandableText$1, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }) })),
|
13241
|
+
React.createElement(Hashtag$1, { index: index, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec.video) === null || _g === void 0 ? void 0 : _g.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle }))));
|
13242
|
+
}
|
13243
|
+
return null;
|
13244
|
+
};
|
13245
|
+
const likeIcon = useIconLink(defaultLikeIconPath, appDomain);
|
13246
|
+
const unlikeIcon = useIconLink(defaultUnLikeIconPath, appDomain);
|
13247
|
+
const renderLikeButton = (rec, index) => {
|
13248
|
+
var _a, _b, _c, _d;
|
13249
|
+
if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
|
13250
|
+
return;
|
13251
|
+
let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconY) !== null && _a !== void 0 ? _a : 400;
|
13252
|
+
if (top < 40) {
|
13253
|
+
top += 40;
|
13254
|
+
}
|
13255
|
+
if (rec.video) {
|
13256
|
+
return (React.createElement(LikeButton$1, { key: rec.position, activeIcon: (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIcon) !== null && _b !== void 0 ? _b : likeIcon, unActicveIcon: (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unlikeIcon) !== null && _c !== void 0 ? _c : unlikeIcon, position: index, active: rec.isCollected, recData: rec, className: 'clc-sxp-like-button', style: {
|
13257
|
+
top,
|
13258
|
+
right: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconX) !== null && _d !== void 0 ? _d : 0
|
13259
|
+
} }));
|
13260
|
+
}
|
13261
|
+
return null;
|
13262
|
+
};
|
13263
|
+
const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png', appDomain);
|
13264
|
+
const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png', appDomain);
|
13265
|
+
const renderView = (rec, index) => {
|
13266
|
+
var _a, _b, _c, _d;
|
13267
|
+
return (React.createElement("div", { style: { position: 'relative' } },
|
13268
|
+
renderLogo,
|
13269
|
+
React.createElement(ToggleButton$1, { style: {
|
13270
|
+
position: 'absolute',
|
13271
|
+
right: (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _a !== void 0 ? _a : 0,
|
13272
|
+
visibility: ((_c = (_b = data === null || data === void 0 ? void 0 : data[index]) === null || _b === void 0 ? void 0 : _b.video) === null || _c === void 0 ? void 0 : _c.url) ? 'visible' : 'hidden',
|
13273
|
+
bottom: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _d !== void 0 ? _d : 23,
|
13274
|
+
zIndex: 999
|
13275
|
+
}, defaultValue: true, activeIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon : mutedIcon, unactiveIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon : unmutedIcon }),
|
13276
|
+
renderContent(rec, index),
|
13277
|
+
renderBottom(rec, index),
|
13278
|
+
renderLikeButton(rec, index)));
|
13279
|
+
};
|
13280
|
+
return (React.createElement("div", { style: {
|
13281
|
+
width: '100%',
|
13282
|
+
height: containerHeight,
|
13283
|
+
display: 'flex',
|
13284
|
+
boxSizing: 'border-box',
|
13285
|
+
gap: 16,
|
13286
|
+
pointerEvents: 'none',
|
13287
|
+
userSelect: 'none'
|
13288
|
+
} }, data === null || data === void 0 ? void 0 : data.map((rec, index) => {
|
13289
|
+
return renderView(rec, index);
|
13290
|
+
})));
|
13291
|
+
};
|
13292
|
+
var index$1 = memo(DiyPortalPreview);
|
13293
|
+
|
12950
13294
|
/*
|
12951
13295
|
* @Author: binruan@chatlabs.com
|
12952
13296
|
* @Date: 2023-10-31 10:56:01
|
@@ -13087,5 +13431,5 @@ function useEditorDataProvider() {
|
|
13087
13431
|
* @FilePath: \pb-sxp-ui\src\index.ts
|
13088
13432
|
*/
|
13089
13433
|
|
13090
|
-
export { EditorDataProvider, Modal$1 as Modal, SxpDataSourceProvider$1 as SxpDataSourceProvider, index as SxpPageCore, SxpPageRender, index$
|
13434
|
+
export { index$1 as DiyPortalPreview, EditorDataProvider, Modal$1 as Modal, SxpDataSourceProvider$1 as SxpDataSourceProvider, index as SxpPageCore, SxpPageRender, index$2 as core, Pagebuilder as default, defaultSetting, _materials_ as materials, useEditorDataProvider };
|
13091
13435
|
//# sourceMappingURL=index.js.map
|