pb-sxp-ui 1.15.12-alpha.8 → 1.15.13-alpha.2
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 +666 -56
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +664 -55
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +6 -6
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +6 -6
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +666 -56
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +6 -6
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/DiyStoryPreview/PictureGroup.d.ts +16 -0
- package/es/core/components/DiyStoryPreview/PictureGroup.js +34 -0
- package/es/core/components/DiyStoryPreview/VideoWidget.d.ts +17 -0
- package/es/core/components/DiyStoryPreview/VideoWidget.js +196 -0
- package/es/core/components/DiyStoryPreview/index.d.ts +28 -0
- package/es/core/components/DiyStoryPreview/index.js +377 -0
- package/es/core/components/SxpPageRender/ExpandableText.js +10 -2
- package/es/core/components/SxpPageRender/RenderCard.js +4 -4
- package/es/core/context/SxpDataSourceProvider.js +5 -17
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/materials/sxp/template/MultiCommodity/index.js +1 -1
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +2 -1
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +2 -1
- package/es/materials/sxp/template/components/EventProvider.js +2 -2
- package/lib/core/components/DiyStoryPreview/PictureGroup.d.ts +16 -0
- package/lib/core/components/DiyStoryPreview/PictureGroup.js +37 -0
- package/lib/core/components/DiyStoryPreview/VideoWidget.d.ts +17 -0
- package/lib/core/components/DiyStoryPreview/VideoWidget.js +199 -0
- package/lib/core/components/DiyStoryPreview/index.d.ts +28 -0
- package/lib/core/components/DiyStoryPreview/index.js +380 -0
- package/lib/core/components/SxpPageRender/ExpandableText.js +10 -2
- package/lib/core/components/SxpPageRender/RenderCard.js +4 -4
- package/lib/core/context/SxpDataSourceProvider.js +5 -17
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -1
- package/lib/materials/sxp/template/MultiCommodity/index.js +1 -1
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +2 -1
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +2 -1
- package/lib/materials/sxp/template/components/EventProvider.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -22,7 +22,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
22
22
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
23
23
|
PERFORMANCE OF THIS SOFTWARE.
|
24
24
|
***************************************************************************** */
|
25
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
25
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
26
26
|
|
27
27
|
|
28
28
|
function __rest(s, e) {
|
@@ -725,12 +725,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
725
725
|
// Beacon API 用于发送异步和非阻塞请求到服务器。这类请求不需要响应。
|
726
726
|
if (options.type === 'beacon' && navigator.sendBeacon) {
|
727
727
|
return navigator.sendBeacon(`${url}/api/${path}`, new Blob([
|
728
|
-
JSON.stringify({
|
729
|
-
|
730
|
-
})
|
731
|
-
], {
|
732
|
-
type: 'application/json;charset=UTF-8'
|
733
|
-
}));
|
728
|
+
JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))
|
729
|
+
], { type: 'application/json;charset=UTF-8' }));
|
734
730
|
}
|
735
731
|
return window
|
736
732
|
.fetch(`${url}/api/${path}`, {
|
@@ -891,7 +887,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
891
887
|
console.log('userInfo:', userInfo);
|
892
888
|
console.log('eventInfo:', ef);
|
893
889
|
console.log('========= 结束 =========');
|
894
|
-
return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/
|
890
|
+
return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/event/report/CLD/${(_b = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _b === void 0 ? void 0 : _b['x-app-id']}/${eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.eventSubject}`, {
|
895
891
|
method: 'POST',
|
896
892
|
body: { userInfo: realUserInfo, eventInfo: realEventInfo },
|
897
893
|
type: 'beacon'
|
@@ -907,7 +903,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
907
903
|
bffDataSource
|
908
904
|
]);
|
909
905
|
const bffFbReport = useCallback(({ eventName, product }) => {
|
910
|
-
var _a, _b, _c, _d, _e, _f
|
906
|
+
var _a, _b, _c, _d, _e, _f;
|
911
907
|
if (!enableReportEvent ||
|
912
908
|
!enabledMetaConversionApi ||
|
913
909
|
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) ||
|
@@ -971,15 +967,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
971
967
|
}
|
972
968
|
};
|
973
969
|
getEventParams(jsonParams);
|
974
|
-
|
975
|
-
const queryString = location.search.slice(1);
|
976
|
-
(_f = splitUrlParams(queryString)) === null || _f === void 0 ? void 0 : _f.map((val) => {
|
977
|
-
const key = val.split('=')[0];
|
978
|
-
const value = val.split('=')[1];
|
979
|
-
params[key] = value;
|
980
|
-
});
|
981
|
-
const cl_source = params === null || params === void 0 ? void 0 : params.cl_source;
|
982
|
-
return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(_g = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _g === void 0 ? void 0 : _g['x-app-id']}/${eventName}${cl_source ? `/${decodeURIComponent(cl_source)}` : ''}`, {
|
970
|
+
return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/event/report/FB/${(_f = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _f === void 0 ? void 0 : _f['x-app-id']}/${eventName}`, {
|
983
971
|
method: 'POST',
|
984
972
|
body: jsonParams,
|
985
973
|
type: 'beacon'
|
@@ -1476,7 +1464,7 @@ const EditorCore = forwardRef(({ children, resolver, isSsr, schema, enableDataSo
|
|
1476
1464
|
React.createElement(DataSourceProvider$1, { isSsr: isSsr, enable: enableDataSource }, children)));
|
1477
1465
|
});
|
1478
1466
|
|
1479
|
-
var index$
|
1467
|
+
var index$3 = /*#__PURE__*/Object.freeze({
|
1480
1468
|
__proto__: null,
|
1481
1469
|
EditorCore: EditorCore
|
1482
1470
|
});
|
@@ -10096,7 +10084,15 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
10096
10084
|
wordBreak: 'break-word'
|
10097
10085
|
}, dangerouslySetInnerHTML: { __html: setFontForText(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), style) } }),
|
10098
10086
|
React.createElement("div", { ref: multiRowCopy, dangerouslySetInnerHTML: { __html: setFontForText(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), style) } }),
|
10099
|
-
text && isPost && isShow && (React.createElement("button", { "aria-label": isShowMore ? unfoldText || 'show less' : foldText || 'show more', style: {
|
10087
|
+
text && isPost && isShow && (React.createElement("button", { "aria-label": isShowMore ? unfoldText || 'show less' : foldText || 'show more', style: {
|
10088
|
+
textDecoration: 'underline',
|
10089
|
+
cursor: 'pointer',
|
10090
|
+
outline: 'none',
|
10091
|
+
border: 'none',
|
10092
|
+
boxSizing: 'content-box',
|
10093
|
+
padding: 0,
|
10094
|
+
background: 'transparent'
|
10095
|
+
}, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick, dangerouslySetInnerHTML: {
|
10100
10096
|
__html: setFontForText(isShowMore ? unfoldText || 'show less' : foldText || 'show more', style)
|
10101
10097
|
} }))));
|
10102
10098
|
};
|
@@ -12454,7 +12450,7 @@ const EventProvider = (_a) => {
|
|
12454
12450
|
const handleClick = throttle((e) => {
|
12455
12451
|
var _a, _b, _c, _d, _e, _f;
|
12456
12452
|
e.preventDefault();
|
12457
|
-
const item = multItem
|
12453
|
+
const item = multItem || ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video);
|
12458
12454
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
12459
12455
|
eventSubject: 'clickCta',
|
12460
12456
|
eventDescription: 'User clicked the CTA'
|
@@ -12481,7 +12477,7 @@ const EventProvider = (_a) => {
|
|
12481
12477
|
setElement(null);
|
12482
12478
|
}
|
12483
12479
|
}, [element, popup]);
|
12484
|
-
return (React.createElement("button", { ref: ref, className: className, style: Object.assign({ display: 'flex', alignItems: 'normal' }, style), onClick: handleClick, role: 'button', "aria-label": 'CTA', tabIndex: 0 }, children));
|
12480
|
+
return (React.createElement("button", { ref: ref, className: className, style: Object.assign({ outline: 'none', border: 'none', boxSizing: 'content-box', padding: 0, background: 'transparent', display: 'flex', alignItems: 'normal' }, style), onClick: handleClick, role: 'button', "aria-label": 'CTA', tabIndex: 0 }, children));
|
12485
12481
|
};
|
12486
12482
|
var EventProvider$1 = memo(EventProvider);
|
12487
12483
|
|
@@ -13077,6 +13073,7 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
13077
13073
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, translateY = 0, isActive, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "translateY", "isActive", "index"]);
|
13078
13074
|
const { sxpParameter } = useSxpDataSource();
|
13079
13075
|
const [products] = useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
|
13076
|
+
console.log(recData, '222');
|
13080
13077
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
|
13081
13078
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
13082
13079
|
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
|
@@ -13283,6 +13280,7 @@ const MultiCommodityDiroNew$1 = (_a) => {
|
|
13283
13280
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, translateY = 0, isActive, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "translateY", "isActive", "index"]);
|
13284
13281
|
const { sxpParameter } = useSxpDataSource();
|
13285
13282
|
const [products] = useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
|
13283
|
+
console.log(recData, '333');
|
13286
13284
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
|
13287
13285
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
13288
13286
|
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
|
@@ -17558,15 +17556,15 @@ var _materials_ = /*#__PURE__*/Object.freeze({
|
|
17558
17556
|
Swipe: Swipe
|
17559
17557
|
});
|
17560
17558
|
|
17561
|
-
const defaultUnLikeIconPath$
|
17562
|
-
const defaultLikeIconPath$
|
17559
|
+
const defaultUnLikeIconPath$2 = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
17560
|
+
const defaultLikeIconPath$2 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
17563
17561
|
const LikeButton = (_a) => {
|
17564
17562
|
var _b;
|
17565
17563
|
var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
|
17566
17564
|
const { mutateLike, mutateUnlike, bffEventReport, setCacheRtcList, cacheRtcList } = useSxpDataSource();
|
17567
17565
|
const [state, setState] = useState((_b = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList[position]) === null || _b === void 0 ? void 0 : _b.isCollected);
|
17568
|
-
const likeIcon = useIconLink(defaultLikeIconPath$
|
17569
|
-
const unlikeIcon = useIconLink(defaultUnLikeIconPath$
|
17566
|
+
const likeIcon = useIconLink(defaultLikeIconPath$2);
|
17567
|
+
const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
|
17570
17568
|
const handleClick = debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
17571
17569
|
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
17572
17570
|
if (state) {
|
@@ -17657,7 +17655,7 @@ const mountVideoPlayerAtNode = (() => {
|
|
17657
17655
|
};
|
17658
17656
|
})();
|
17659
17657
|
|
17660
|
-
const VideoWidget$
|
17658
|
+
const VideoWidget$4 = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon }) => {
|
17661
17659
|
const [isPauseVideo, setIsPauseVideo] = useState(false);
|
17662
17660
|
const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport } = useSxpDataSource();
|
17663
17661
|
const videoStartTime = useRef(0);
|
@@ -18002,7 +18000,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
18002
18000
|
renderLoading,
|
18003
18001
|
isPauseVideo && React.createElement(FormatImage$1, { className: 'clc-pb-video-pause', src: videoPlayIcon !== null && videoPlayIcon !== void 0 ? videoPlayIcon : PAUSE_ICON, alt: 'pause' })))));
|
18004
18002
|
};
|
18005
|
-
var VideoWidget$
|
18003
|
+
var VideoWidget$5 = memo(VideoWidget$4);
|
18006
18004
|
|
18007
18005
|
const ToggleButton = ({ defaultValue, activeIcon, unactiveIcon, onChange, style }) => {
|
18008
18006
|
const [isTrue, setIsTure] = useState(defaultValue);
|
@@ -18091,7 +18089,7 @@ const Picture = (props) => {
|
|
18091
18089
|
}, onLoad: onShowFirstImage }))));
|
18092
18090
|
};
|
18093
18091
|
|
18094
|
-
const PictureGroup$
|
18092
|
+
const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
18095
18093
|
var _a, _b;
|
18096
18094
|
const { isActive } = useSwiperSlide();
|
18097
18095
|
const { sxpParameter, openHashtag } = useSxpDataSource();
|
@@ -18185,7 +18183,7 @@ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
|
|
18185
18183
|
React.createElement(Picture, { src: !isLoad && srcKey > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
|
18186
18184
|
}))));
|
18187
18185
|
};
|
18188
|
-
var PictureGroup$
|
18186
|
+
var PictureGroup$5 = memo(PictureGroup$4);
|
18189
18187
|
|
18190
18188
|
/*
|
18191
18189
|
* @Author: binruan@chatlabs.com
|
@@ -18301,7 +18299,7 @@ function withBindDataSource(Component) {
|
|
18301
18299
|
* @Author: binruan@chatlabs.com
|
18302
18300
|
* @Date: 2023-12-26 16:11:34
|
18303
18301
|
* @LastEditors: binruan@chatlabs.com
|
18304
|
-
* @LastEditTime:
|
18302
|
+
* @LastEditTime: 2025-03-26 19:32:00
|
18305
18303
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
|
18306
18304
|
*
|
18307
18305
|
*/
|
@@ -18311,10 +18309,10 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive,
|
|
18311
18309
|
return null;
|
18312
18310
|
const renderComp = useMemo(() => {
|
18313
18311
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
|
18314
|
-
|
18312
|
+
// 如果includesCtaType有值,则只渲染includesCtaType包含的cta类型组件,用于在页面某处只显示某一组件
|
18315
18313
|
if (includesCtaType && !(includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.includes((_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type)))
|
18316
18314
|
return;
|
18317
|
-
|
18315
|
+
// 默认不渲染category为cta类型的组件,该类型的组件只用于某一处
|
18318
18316
|
if (!includesCtaType && ((_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.category) === 'cta')
|
18319
18317
|
return;
|
18320
18318
|
if ((((_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.type) === 'CommodityDiro' && !((_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindProduct)) ||
|
@@ -18331,10 +18329,10 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive,
|
|
18331
18329
|
const Component = withBindDataSource(t);
|
18332
18330
|
const defaulSetting = (_u = t === null || t === void 0 ? void 0 : t.extend) === null || _u === void 0 ? void 0 : _u.defaulSetting;
|
18333
18331
|
const isExternalLink = ((_x = (_w = (_v = value === null || value === void 0 ? void 0 : value.item) === null || _v === void 0 ? void 0 : _v.event) === null || _w === void 0 ? void 0 : _w.onClick) === null || _x === void 0 ? void 0 : _x.linkType) === 'externalLink';
|
18334
|
-
|
18332
|
+
const style = cloneDeep((_y = value === null || value === void 0 ? void 0 : value.item) === null || _y === void 0 ? void 0 : _y.style);
|
18335
18333
|
if (style.hasOwnProperty('backdropFilter')) {
|
18336
|
-
|
18337
|
-
style
|
18334
|
+
const sbf = style.backdropFilter;
|
18335
|
+
style.backdropFilter = `blur(${sbf !== null && sbf !== void 0 ? sbf : 0}px)`;
|
18338
18336
|
}
|
18339
18337
|
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), (_z = value === null || value === void 0 ? void 0 : value.item) === null || _z === void 0 ? void 0 : _z.textStyle), bindDatas: (_1 = (_0 = value === null || value === void 0 ? void 0 : value.item) === null || _0 === void 0 ? void 0 : _0.bindDatas) !== null && _1 !== void 0 ? _1 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_2 = value === null || value === void 0 ? void 0 : value.item) === null || _2 === void 0 ? void 0 : _2.props, { event: ((_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.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 })));
|
18340
18338
|
}
|
@@ -18695,10 +18693,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18695
18693
|
return (React.createElement(MultiPosts$2, Object.assign({ recData: data === null || data === void 0 ? void 0 : data[1] }, (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props, (_f = (_e = (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.item) === null || _f === void 0 ? void 0 : _f.event)));
|
18696
18694
|
}
|
18697
18695
|
if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.url) {
|
18698
|
-
return (React.createElement(VideoWidget$
|
18696
|
+
return (React.createElement(VideoWidget$5, { key: isReload, rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoPlayIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPlayIcon }));
|
18699
18697
|
}
|
18700
18698
|
if ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.imgUrls) {
|
18701
|
-
return (React.createElement(PictureGroup$
|
18699
|
+
return (React.createElement(PictureGroup$5, { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onViewImageEndEvent: handleViewImageStartEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
|
18702
18700
|
}
|
18703
18701
|
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _j === void 0 ? void 0 : _j.length) > 0) {
|
18704
18702
|
return (_k = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _k === void 0 ? void 0 : _k.map((value, idx) => {
|
@@ -19068,7 +19066,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19068
19066
|
};
|
19069
19067
|
var SxpPageRender$1 = memo(SxpPageRender);
|
19070
19068
|
|
19071
|
-
const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
|
19069
|
+
const PictureGroup$2 = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
|
19072
19070
|
return (React.createElement(Swiper, { defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: {
|
19073
19071
|
clickable: true,
|
19074
19072
|
bulletActiveClass: 'swipe-item-active-bullet',
|
@@ -19078,9 +19076,9 @@ const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index })
|
|
19078
19076
|
React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
|
19079
19077
|
})));
|
19080
19078
|
};
|
19081
|
-
var PictureGroup$
|
19079
|
+
var PictureGroup$3 = memo(PictureGroup$2);
|
19082
19080
|
|
19083
|
-
const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, width }) => {
|
19081
|
+
const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, width }) => {
|
19084
19082
|
const [isPauseVideo, setIsPauseVideo] = useState(false);
|
19085
19083
|
const videoRef = useRef(null);
|
19086
19084
|
const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
|
@@ -19310,14 +19308,14 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
19310
19308
|
renderPoster,
|
19311
19309
|
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON, alt: 'video pause image' })))));
|
19312
19310
|
};
|
19313
|
-
var VideoWidget$
|
19311
|
+
var VideoWidget$3 = memo(VideoWidget$2);
|
19314
19312
|
|
19315
|
-
const RESOLVER$
|
19313
|
+
const RESOLVER$2 = {};
|
19316
19314
|
Object.values(_materials_).forEach((v) => {
|
19317
|
-
RESOLVER$
|
19315
|
+
RESOLVER$2[v.extend.type] = v;
|
19318
19316
|
});
|
19319
|
-
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
19320
|
-
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
19317
|
+
const defaultUnLikeIconPath$1 = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
19318
|
+
const defaultLikeIconPath$1 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
19321
19319
|
const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain, tagList = [] }) => {
|
19322
19320
|
const height = useMemo(() => {
|
19323
19321
|
let minusHeight = 0;
|
@@ -19332,16 +19330,16 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
|
|
19332
19330
|
const renderContent = (rec, index) => {
|
19333
19331
|
var _a, _b, _c, _d;
|
19334
19332
|
if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
19335
|
-
return (React.createElement(VideoWidget$
|
19333
|
+
return (React.createElement(VideoWidget$3, { 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 }));
|
19336
19334
|
}
|
19337
19335
|
if ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
19338
|
-
return (React.createElement(PictureGroup$
|
19336
|
+
return (React.createElement(PictureGroup$3, { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
|
19339
19337
|
}
|
19340
19338
|
if (rec.product) {
|
19341
19339
|
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) {
|
19342
19340
|
return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
|
19343
19341
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
19344
|
-
const t = RESOLVER$
|
19342
|
+
const t = RESOLVER$2[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
19345
19343
|
const Component = withBindDataSource(t);
|
19346
19344
|
const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
|
19347
19345
|
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) || {},
|
@@ -19363,7 +19361,7 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
|
|
19363
19361
|
const CTA = (rec, index) => {
|
19364
19362
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) {
|
19365
19363
|
return (React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
19366
|
-
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$
|
19364
|
+
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$2 })));
|
19367
19365
|
}
|
19368
19366
|
return null;
|
19369
19367
|
};
|
@@ -19381,8 +19379,8 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
|
|
19381
19379
|
}
|
19382
19380
|
return null;
|
19383
19381
|
};
|
19384
|
-
const likeIcon = useIconLink(defaultLikeIconPath, appDomain);
|
19385
|
-
const unlikeIcon = useIconLink(defaultUnLikeIconPath, appDomain);
|
19382
|
+
const likeIcon = useIconLink(defaultLikeIconPath$1, appDomain);
|
19383
|
+
const unlikeIcon = useIconLink(defaultUnLikeIconPath$1, appDomain);
|
19386
19384
|
const renderLikeButton = (rec, index) => {
|
19387
19385
|
var _a, _b, _c, _d;
|
19388
19386
|
if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
|
@@ -19430,7 +19428,618 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
|
|
19430
19428
|
return renderView(rec, index);
|
19431
19429
|
})));
|
19432
19430
|
};
|
19433
|
-
var index$
|
19431
|
+
var index$2 = memo(DiyPortalPreview);
|
19432
|
+
|
19433
|
+
const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index, swiperRef, data = [], loopPlay }) => {
|
19434
|
+
const { isActive } = useSwiperSlide();
|
19435
|
+
const [isload, setIsLoad] = useState(false);
|
19436
|
+
useEffect(() => {
|
19437
|
+
if (isActive && isload && loopPlay) {
|
19438
|
+
setTimeout(() => {
|
19439
|
+
var _a, _b, _c, _d;
|
19440
|
+
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
19441
|
+
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(0);
|
19442
|
+
}
|
19443
|
+
else {
|
19444
|
+
const i = (_c = (_b = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _b === void 0 ? void 0 : _b.swiper) === null || _c === void 0 ? void 0 : _c.activeIndex;
|
19445
|
+
(_d = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _d === void 0 ? void 0 : _d.swiper.slideTo(i + 1);
|
19446
|
+
}
|
19447
|
+
}, 3000);
|
19448
|
+
}
|
19449
|
+
}, [isActive, isload, data, index, swiperRef, loopPlay]);
|
19450
|
+
const loadFinishImage = () => {
|
19451
|
+
setIsLoad(true);
|
19452
|
+
};
|
19453
|
+
return (React.createElement(Swiper, { defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: {
|
19454
|
+
clickable: true,
|
19455
|
+
bulletActiveClass: 'swipe-item-active-bullet',
|
19456
|
+
bulletElement: 'button'
|
19457
|
+
}, height: height, style: { width }, loop: true, autoplay: false }, imgUrls === null || imgUrls === void 0 ? void 0 : imgUrls.map((url) => {
|
19458
|
+
return (React.createElement(SwiperSlide, { key: url },
|
19459
|
+
React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: loadFinishImage })));
|
19460
|
+
})));
|
19461
|
+
};
|
19462
|
+
var PictureGroup$1 = memo(PictureGroup);
|
19463
|
+
|
19464
|
+
const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, width, swiperRef, loopPlay }) => {
|
19465
|
+
const { isActive } = useSwiperSlide();
|
19466
|
+
const [isPauseVideo, setIsPauseVideo] = useState(false);
|
19467
|
+
const videoRef = useRef(null);
|
19468
|
+
const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
|
19469
|
+
const videoStartTime = useRef(0);
|
19470
|
+
const [isLoadFinish, setIsLoadFinish] = useState(false);
|
19471
|
+
const [isFirstPlay, setIsFirstPlay] = useState(true);
|
19472
|
+
const canvasRef = useRef(null);
|
19473
|
+
const [firstFrameSrc, setFirstFrameSrc] = useState('');
|
19474
|
+
const videoId = `pb-cache-video-${index}`;
|
19475
|
+
const hlsRef = useRef(null);
|
19476
|
+
useEffect(() => {
|
19477
|
+
if (!videoRef.current)
|
19478
|
+
return;
|
19479
|
+
videoRef.current.muted = muted;
|
19480
|
+
}, [muted]);
|
19481
|
+
useCallback(() => {
|
19482
|
+
var _a;
|
19483
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
19484
|
+
}, []);
|
19485
|
+
useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
19486
|
+
const handlePlaying = useCallback(() => {
|
19487
|
+
var _a, _b, _c, _d, _e, _f;
|
19488
|
+
setIsPauseVideo(false);
|
19489
|
+
const item = data[index];
|
19490
|
+
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
19491
|
+
videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
|
19492
|
+
((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
19493
|
+
((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
|
19494
|
+
setIsFirstPlay(false);
|
19495
|
+
}
|
19496
|
+
}, [bffEventReport, data, index, isFirstPlay]);
|
19497
|
+
const handleLoadedMetadata = useCallback(() => {
|
19498
|
+
var _a;
|
19499
|
+
videoRef.current.currentTime = rec === null || rec === void 0 ? void 0 : rec.startTime;
|
19500
|
+
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
19501
|
+
setIsLoadFinish(true);
|
19502
|
+
}, []);
|
19503
|
+
useCallback((type) => () => {
|
19504
|
+
var _a, _b, _c, _d, _e;
|
19505
|
+
if (!isLoadFinish)
|
19506
|
+
return;
|
19507
|
+
const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
19508
|
+
switch (type) {
|
19509
|
+
case 'start':
|
19510
|
+
if (!isPause)
|
19511
|
+
return;
|
19512
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
|
19513
|
+
setIsPauseVideo(false);
|
19514
|
+
break;
|
19515
|
+
case 'pause':
|
19516
|
+
if (isPause)
|
19517
|
+
return;
|
19518
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
19519
|
+
setIsPauseVideo(true);
|
19520
|
+
break;
|
19521
|
+
default:
|
19522
|
+
if (isPause) {
|
19523
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
|
19524
|
+
}
|
19525
|
+
else {
|
19526
|
+
(_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
|
19527
|
+
}
|
19528
|
+
setIsPauseVideo(!isPause);
|
19529
|
+
break;
|
19530
|
+
}
|
19531
|
+
}, [isLoadFinish]);
|
19532
|
+
useCallback(() => {
|
19533
|
+
var _a, _b, _c, _d, _e, _f;
|
19534
|
+
data[index];
|
19535
|
+
((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
19536
|
+
((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
19537
|
+
if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
|
19538
|
+
(((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
|
19539
|
+
}
|
19540
|
+
}, [data, index, bffEventReport]);
|
19541
|
+
const blur = useMemo(() => {
|
19542
|
+
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
|
19543
|
+
}, [videoPostConfig]);
|
19544
|
+
useMemo(() => {
|
19545
|
+
var _a;
|
19546
|
+
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
|
19547
|
+
? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%) translate3d(0px, 0px, 0px)`
|
19548
|
+
: 'translateY(-50%)';
|
19549
|
+
}, [videoPostConfig]);
|
19550
|
+
const handLoadeddata = useCallback(() => {
|
19551
|
+
if (!canvasRef || !videoRef || !videoRef.current || !canvasRef.current)
|
19552
|
+
return;
|
19553
|
+
const video = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current;
|
19554
|
+
const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
|
19555
|
+
const ctx = canvas.getContext('2d');
|
19556
|
+
const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
|
19557
|
+
const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
|
19558
|
+
canvas.height = targetHeight;
|
19559
|
+
canvas.width = targetWidth;
|
19560
|
+
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
19561
|
+
setFirstFrameSrc(canvas.toDataURL());
|
19562
|
+
}, []);
|
19563
|
+
const handleTimeUpload = useCallback(() => {
|
19564
|
+
var _a, _b, _c;
|
19565
|
+
if (!videoRef.current)
|
19566
|
+
return;
|
19567
|
+
if (((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.currentTime) >= ((_b = rec === null || rec === void 0 ? void 0 : rec.endTime) !== null && _b !== void 0 ? _b : 0)) {
|
19568
|
+
(_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
19569
|
+
}
|
19570
|
+
}, []);
|
19571
|
+
const handlePause = () => {
|
19572
|
+
var _a, _b, _c, _d, _e, _f;
|
19573
|
+
if (!videoRef.current || !isActive)
|
19574
|
+
return;
|
19575
|
+
if (!loopPlay)
|
19576
|
+
return;
|
19577
|
+
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
19578
|
+
(_b = (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.slideTo(0);
|
19579
|
+
}
|
19580
|
+
else {
|
19581
|
+
const i = (_d = (_c = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _c === void 0 ? void 0 : _c.swiper) === null || _d === void 0 ? void 0 : _d.activeIndex;
|
19582
|
+
(_f = (_e = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _e === void 0 ? void 0 : _e.swiper) === null || _f === void 0 ? void 0 : _f.slideTo(i + 1);
|
19583
|
+
}
|
19584
|
+
};
|
19585
|
+
// useEffect(() => {
|
19586
|
+
// if (!videoRef.current) return;
|
19587
|
+
// if (!isActive) return;
|
19588
|
+
// if (!loopPlay) {
|
19589
|
+
// videoRef?.current?.pause();
|
19590
|
+
// } else {
|
19591
|
+
// videoRef?.current?.play();
|
19592
|
+
// }
|
19593
|
+
// }, [loopPlay, isActive]);
|
19594
|
+
useEffect(() => {
|
19595
|
+
var _a, _b, _c;
|
19596
|
+
if (!isActive)
|
19597
|
+
return;
|
19598
|
+
const videoSrc = rec === null || rec === void 0 ? void 0 : rec.mediaUrl;
|
19599
|
+
if (!videoSrc)
|
19600
|
+
return;
|
19601
|
+
setIsPauseVideo(false);
|
19602
|
+
const videoPlayerWrapperNode = document.querySelector(`#${videoId}`);
|
19603
|
+
if (!videoPlayerWrapperNode)
|
19604
|
+
return;
|
19605
|
+
videoRef.current = mountVideoPlayerAtNode === null || mountVideoPlayerAtNode === void 0 ? void 0 : mountVideoPlayerAtNode(videoPlayerWrapperNode);
|
19606
|
+
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
19607
|
+
return;
|
19608
|
+
const Hls = window === null || window === void 0 ? void 0 : window.Hls;
|
19609
|
+
let hls = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current;
|
19610
|
+
if (videoSrc.includes('.m3u8') && Hls && Hls.isSupported()) {
|
19611
|
+
hls = new Hls();
|
19612
|
+
hls === null || hls === void 0 ? void 0 : hls.loadSource(videoSrc);
|
19613
|
+
hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
|
19614
|
+
hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
19615
|
+
var _a;
|
19616
|
+
videoRef.current.currentTime = rec === null || rec === void 0 ? void 0 : rec.startTime;
|
19617
|
+
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
19618
|
+
});
|
19619
|
+
}
|
19620
|
+
else {
|
19621
|
+
videoRef.current.src = videoSrc;
|
19622
|
+
}
|
19623
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('loadedmetadata', handleLoadedMetadata);
|
19624
|
+
// videoRef.current?.addEventListener('playing', handlePlaying);
|
19625
|
+
// videoRef.current?.addEventListener('loadeddata', handLoadeddata);
|
19626
|
+
(_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('pause', handlePause);
|
19627
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('timeupdate', handleTimeUpload);
|
19628
|
+
return () => {
|
19629
|
+
var _a, _b, _c, _d;
|
19630
|
+
if (hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current)
|
19631
|
+
(_a = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
|
19632
|
+
setIsLoadFinish(false);
|
19633
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('loadedmetadata', handleLoadedMetadata);
|
19634
|
+
// videoRef.current?.removeEventListener('playing', handlePlaying);
|
19635
|
+
// videoRef.current?.removeEventListener('loadeddata', handLoadeddata);
|
19636
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('pause', handlePause);
|
19637
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('timeupdate', handleTimeUpload);
|
19638
|
+
};
|
19639
|
+
}, [handleLoadedMetadata, handlePlaying, rec, handLoadeddata, isActive, loopPlay]);
|
19640
|
+
useMemo(() => {
|
19641
|
+
if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
|
19642
|
+
return null;
|
19643
|
+
}
|
19644
|
+
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, alt: 'video poster' }));
|
19645
|
+
}, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
|
19646
|
+
useMemo(() => {
|
19647
|
+
return blur
|
19648
|
+
? {
|
19649
|
+
filter: 'blur(10px)',
|
19650
|
+
transform: 'translate3d(0px, 0px, 0px) scale(1.2)'
|
19651
|
+
}
|
19652
|
+
: {};
|
19653
|
+
}, [blur]);
|
19654
|
+
if (!(rec === null || rec === void 0 ? void 0 : rec.mediaUrl)) {
|
19655
|
+
return null;
|
19656
|
+
}
|
19657
|
+
return (React.createElement("div", { className: 'video-container', key: rec.itemId, style: {
|
19658
|
+
position: 'relative',
|
19659
|
+
width: '100%',
|
19660
|
+
height,
|
19661
|
+
overflow: 'hidden',
|
19662
|
+
pointerEvents: 'none'
|
19663
|
+
} },
|
19664
|
+
React.createElement("div", { className: 'n-full-screen', id: videoId, style: { width: '100%', height: '100%' } })));
|
19665
|
+
};
|
19666
|
+
var VideoWidget$1 = memo(VideoWidget);
|
19667
|
+
|
19668
|
+
/*
|
19669
|
+
* @Author: binruan@chatlabs.com
|
19670
|
+
* @Date: 2025-03-25 13:54:27
|
19671
|
+
* @LastEditors: binruan@chatlabs.com
|
19672
|
+
* @LastEditTime: 2025-03-26 22:40:52
|
19673
|
+
* @FilePath: \pb-sxp-ui\src\core\components\DiyStoryPreview\index.tsx
|
19674
|
+
*
|
19675
|
+
*/
|
19676
|
+
const RESOLVER$1 = {};
|
19677
|
+
Object.values(_materials_).forEach((v) => {
|
19678
|
+
RESOLVER$1[v.extend.type] = v;
|
19679
|
+
});
|
19680
|
+
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
19681
|
+
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
19682
|
+
const recData = {
|
19683
|
+
position: 0,
|
19684
|
+
isCollected: false,
|
19685
|
+
product: null,
|
19686
|
+
video: {
|
19687
|
+
appId: null,
|
19688
|
+
itemId: 'VIDEOSsRgI1695278974368',
|
19689
|
+
title: '8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片',
|
19690
|
+
enTitle: null,
|
19691
|
+
icon: null,
|
19692
|
+
cover: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20231017/fsJFWmW1dGyW7XmDspbJPTn5esL3U1697538777398.png',
|
19693
|
+
link: null,
|
19694
|
+
linkTitle: null,
|
19695
|
+
linkType: null,
|
19696
|
+
menuCategoryId: null,
|
19697
|
+
remark: null,
|
19698
|
+
tags: [
|
19699
|
+
'Gift-Giving',
|
19700
|
+
'Daily Wear',
|
19701
|
+
'Business Formal',
|
19702
|
+
'Sports/Casual',
|
19703
|
+
'Anniversary Gifts',
|
19704
|
+
'Wedding/Engagement',
|
19705
|
+
'Formal Dinner/Party'
|
19706
|
+
],
|
19707
|
+
traceInfo: ':VIDEO:VIDEOSsRgI1695278974368:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
|
19708
|
+
value: 385,
|
19709
|
+
weight: null,
|
19710
|
+
bindCta: null,
|
19711
|
+
bindProduct: null,
|
19712
|
+
bindProducts: [
|
19713
|
+
{
|
19714
|
+
appId: 'wx448578f8851f3dce',
|
19715
|
+
itemId: 'test02178888',
|
19716
|
+
title: 'christian dior小包包 新CDN',
|
19717
|
+
enTitle: null,
|
19718
|
+
icon: null,
|
19719
|
+
cover: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240913/fs2jqiurjftpoaba67iiwr9jt5sc31726213277754.avif',
|
19720
|
+
link: '/pages/details/index?spu_id=1702262707659534338',
|
19721
|
+
linkTitle: '',
|
19722
|
+
linkType: 'MP',
|
19723
|
+
menuCategoryId: null,
|
19724
|
+
remark: null,
|
19725
|
+
tags: [],
|
19726
|
+
traceInfo: ':PRODUCT:test02178888:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
|
19727
|
+
value: null,
|
19728
|
+
weight: null,
|
19729
|
+
bindCta: {
|
19730
|
+
appId: 'wx448578f8851f3dce',
|
19731
|
+
itemId: 'CTA3KofE1716186622249',
|
19732
|
+
title: 'SHOP NOW 立即购买',
|
19733
|
+
enTitle: 'BUY NOW立即购买,选择你所喜爱的;',
|
19734
|
+
icon: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240520/fssfxbmiwghixmgblz9uriwennd2r1716186615574.avif',
|
19735
|
+
cover: null,
|
19736
|
+
link: '/pages/details/index?spu_id=1702262707659534338',
|
19737
|
+
linkTitle: '',
|
19738
|
+
linkType: 'MP',
|
19739
|
+
menuCategoryId: '64b60b202caf0e1c1ce1e17d',
|
19740
|
+
remark: null,
|
19741
|
+
tags: [
|
19742
|
+
"Woman's Perfumes",
|
19743
|
+
'Plates & Bowls',
|
19744
|
+
'Glasses',
|
19745
|
+
'Multicolor',
|
19746
|
+
'Carafes',
|
19747
|
+
'Tea & Coffee',
|
19748
|
+
'Green',
|
19749
|
+
'Grey',
|
19750
|
+
'Cutlery'
|
19751
|
+
],
|
19752
|
+
traceInfo: ':CTA:CTA3KofE1716186622249:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
|
19753
|
+
value: null,
|
19754
|
+
weight: null
|
19755
|
+
},
|
19756
|
+
collection: 'Ricco',
|
19757
|
+
currency: 'INR-₹',
|
19758
|
+
homePage: [
|
19759
|
+
'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240913/fs2jqiurjftpoaba67iiwr9jt5sc31726213277754.avif',
|
19760
|
+
'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240913/fsr9ttuzuljs85smqi6lsidovnyoy1726213285994.avif',
|
19761
|
+
'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240913/fsknmfhx2lxukxews05guwwxr8rju1726213281108.avif',
|
19762
|
+
'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240913/fs0acnua4f1clamdpwdsrh0v5dgc61726213289247.avif'
|
19763
|
+
],
|
19764
|
+
info: 'test',
|
19765
|
+
price: 53200,
|
19766
|
+
shippingInfo: null,
|
19767
|
+
taxInfo: null
|
19768
|
+
},
|
19769
|
+
{
|
19770
|
+
appId: null,
|
19771
|
+
itemId: '113J631A0684_C520',
|
19772
|
+
title: 'Sweatshirt à capuche Dior Oblique, coupe relax',
|
19773
|
+
enTitle: null,
|
19774
|
+
icon: null,
|
19775
|
+
cover: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20241115/fsaf0xq8vx8gkkl30y1h1swpinmbt1731661943891.avif',
|
19776
|
+
link: 'https://www.dior.com/fr_fr/fashion/products/113J631A0684_C520',
|
19777
|
+
linkTitle: null,
|
19778
|
+
linkType: 'WEB',
|
19779
|
+
menuCategoryId: null,
|
19780
|
+
remark: null,
|
19781
|
+
tags: [],
|
19782
|
+
traceInfo: ':PRODUCT:113J631A0684_C520:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
|
19783
|
+
value: null,
|
19784
|
+
weight: null,
|
19785
|
+
bindCta: {
|
19786
|
+
appId: null,
|
19787
|
+
itemId: 'CTAAfaKf1730796437032',
|
19788
|
+
title: 'test',
|
19789
|
+
enTitle: 'test',
|
19790
|
+
icon: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20241105/fsjblxoud2tmehpiqqomh0oktwqrd1730796431496.avif',
|
19791
|
+
cover: null,
|
19792
|
+
link: null,
|
19793
|
+
linkTitle: null,
|
19794
|
+
linkType: null,
|
19795
|
+
menuCategoryId: '64b60b202caf0e1c1ce1e17d',
|
19796
|
+
remark: '',
|
19797
|
+
tags: [],
|
19798
|
+
traceInfo: ':CTA:CTAAfaKf1730796437032:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
|
19799
|
+
value: null,
|
19800
|
+
weight: null
|
19801
|
+
},
|
19802
|
+
collection: 'Jacquard de coton éponge bleu',
|
19803
|
+
currency: 'EUR-€',
|
19804
|
+
homePage: [
|
19805
|
+
'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20241115/fsaf0xq8vx8gkkl30y1h1swpinmbt1731661943891.avif',
|
19806
|
+
'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20241115/fszxkdcjfjql2oiy90ffbal5tsfd81731661964913.avif',
|
19807
|
+
'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20241115/fs1jhd9jwxvfqmrbjwy5abfzb0fde1731661994996.avif'
|
19808
|
+
],
|
19809
|
+
info: "Le sweatshirt à capuche bleu met à l'honneur l'emblématique motif dior oblique. Confectionné en jacquard de coton éponge bleu, il présente une coupe relax très confortable. Doté de poches latérales fendues, ce sweatshirt à capuche s'associera à tous vos jeans ou pantalons de survêtement pour un look décontracté.. Sweatshirt à capuche dior oblique, coupe relax Jacquard de coton éponge bleu",
|
19810
|
+
price: 1800,
|
19811
|
+
shippingInfo: null,
|
19812
|
+
taxInfo: null
|
19813
|
+
},
|
19814
|
+
{
|
19815
|
+
appId: null,
|
19816
|
+
itemId: 'S5573CRIW_M928',
|
19817
|
+
title: 'Mini Dior Book Tote',
|
19818
|
+
enTitle: null,
|
19819
|
+
icon: null,
|
19820
|
+
cover: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fsvewk9etrawxrzznmvvewgt1bctu1739415576729.avif',
|
19821
|
+
link: 'https://www.dior.com/en_gb/fashion/products/S5573CRIW_M928',
|
19822
|
+
linkTitle: null,
|
19823
|
+
linkType: 'WEB',
|
19824
|
+
menuCategoryId: null,
|
19825
|
+
remark: null,
|
19826
|
+
tags: ['ダイヤモンド'],
|
19827
|
+
traceInfo: ':PRODUCT:S5573CRIW_M928:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
|
19828
|
+
value: null,
|
19829
|
+
weight: null,
|
19830
|
+
bindCta: null,
|
19831
|
+
collection: null,
|
19832
|
+
currency: 'GBP-£',
|
19833
|
+
homePage: [
|
19834
|
+
'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fsvewk9etrawxrzznmvvewgt1bctu1739415576729.avif',
|
19835
|
+
'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fsngtlvhid7xwt5if0viw7vqanm831739415582147.avif',
|
19836
|
+
'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fs4hotdvyzjtnqb9vszlynuzplddc1739415586910.avif',
|
19837
|
+
'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fswffx9kwexf3z3vcnxisut1qxtez1739415591629.avif',
|
19838
|
+
'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fsbfsi7tttx1hnzldoiw7eoea7fvh1739415597388.avif'
|
19839
|
+
],
|
19840
|
+
info: "The Dior Book Tote is a House classic and original design by Maria Grazia Chiuri, Creative Director of Christian Dior. The style is fully embroidered with the House's hallmark blue Dior Oblique motif and showcases the Christian Dior Paris signature. Exemplifying House savoir-faire, the miniature style features an adjustable and removable strap that allows it to be carried by hand, worn over the shoulder or crossbody.",
|
19841
|
+
price: 1950,
|
19842
|
+
shippingInfo: null,
|
19843
|
+
taxInfo: null
|
19844
|
+
}
|
19845
|
+
],
|
19846
|
+
url: null,
|
19847
|
+
blockCta: 1,
|
19848
|
+
blockProduct: 1,
|
19849
|
+
hashTags: [
|
19850
|
+
'Sports/Casual',
|
19851
|
+
'Formal Dinner/Party',
|
19852
|
+
'Business Formal',
|
19853
|
+
'Wedding/Engagement',
|
19854
|
+
'Gift-Giving',
|
19855
|
+
'Daily Wear',
|
19856
|
+
'Anniversary Gifts'
|
19857
|
+
]
|
19858
|
+
}
|
19859
|
+
};
|
19860
|
+
const DiyStoryPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain, tagList = [], scenes, onActiveChange, activeIndex, loopPlay = false }) => {
|
19861
|
+
const swiperRef = useRef(null);
|
19862
|
+
useMemo(() => {
|
19863
|
+
let minusHeight = 0;
|
19864
|
+
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
19865
|
+
minusHeight += 45;
|
19866
|
+
}
|
19867
|
+
if (tagList.length > 0) {
|
19868
|
+
minusHeight += 45;
|
19869
|
+
}
|
19870
|
+
return containerHeight - minusHeight;
|
19871
|
+
}, [globalConfig, containerHeight, tagList]);
|
19872
|
+
// 判断是否是视频
|
19873
|
+
const isVideoUrl = (url) => {
|
19874
|
+
if (url && url !== '' && typeof url === 'string') {
|
19875
|
+
const imageExtensions = ['.mp4', '.m3u8'];
|
19876
|
+
const lowerCaseUrl = url === null || url === void 0 ? void 0 : url.toLowerCase();
|
19877
|
+
return imageExtensions.some((ext) => lowerCaseUrl === null || lowerCaseUrl === void 0 ? void 0 : lowerCaseUrl.endsWith(ext));
|
19878
|
+
}
|
19879
|
+
else {
|
19880
|
+
return false;
|
19881
|
+
}
|
19882
|
+
};
|
19883
|
+
const renderContent = (rec, index) => {
|
19884
|
+
const isVideo = isVideoUrl(rec === null || rec === void 0 ? void 0 : rec.mediaUrl);
|
19885
|
+
if (isVideo) {
|
19886
|
+
return (React.createElement(VideoWidget$1, { rec: rec, index: index, muted: true, width: containerWidth, data: scenes !== null && scenes !== void 0 ? scenes : [], height: containerHeight, activeIndex: index, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, swiperRef: swiperRef, loopPlay: loopPlay }));
|
19887
|
+
}
|
19888
|
+
else {
|
19889
|
+
return (React.createElement(PictureGroup$1, { key: rec.itemId, imgUrls: [rec === null || rec === void 0 ? void 0 : rec.mediaUrl], width: containerWidth, height: containerHeight, rec: rec, index: index, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost, data: scenes !== null && scenes !== void 0 ? scenes : [], swiperRef: swiperRef, loopPlay: loopPlay }));
|
19890
|
+
}
|
19891
|
+
};
|
19892
|
+
useMemo(() => {
|
19893
|
+
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
19894
|
+
return (React.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
|
19895
|
+
React.createElement("img", { src: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl, alt: 'logo' })));
|
19896
|
+
}
|
19897
|
+
return null;
|
19898
|
+
}, [globalConfig]);
|
19899
|
+
const renderBottom = (rec, index) => {
|
19900
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
19901
|
+
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
19902
|
+
let cta = null;
|
19903
|
+
if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) {
|
19904
|
+
cta = '多商品CTA';
|
19905
|
+
}
|
19906
|
+
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
19907
|
+
cta = '商品CTA';
|
19908
|
+
}
|
19909
|
+
else {
|
19910
|
+
cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
|
19911
|
+
}
|
19912
|
+
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
19913
|
+
return (React.createElement(React.Fragment, null,
|
19914
|
+
((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.title) && (React.createElement("div", { style: {
|
19915
|
+
background: 'repeating-linear-gradient(0deg, rgba(26, 26, 25, 0.7), hsla(0, 0%, 100%, 0))',
|
19916
|
+
height: '130px',
|
19917
|
+
position: 'absolute',
|
19918
|
+
bottom: 0,
|
19919
|
+
width: '100%',
|
19920
|
+
willChange: 'transform',
|
19921
|
+
zIndex: 2,
|
19922
|
+
pointerEvents: 'none'
|
19923
|
+
} })),
|
19924
|
+
React.createElement("div", { style: {
|
19925
|
+
marginBottom: `${(_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _g !== void 0 ? _g : 40}px`,
|
19926
|
+
zIndex: 999,
|
19927
|
+
position: 'absolute',
|
19928
|
+
bottom: 0,
|
19929
|
+
left: 0,
|
19930
|
+
right: 0,
|
19931
|
+
paddingTop: '20px'
|
19932
|
+
} },
|
19933
|
+
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) ? (React.createElement("div", { style: {} },
|
19934
|
+
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1, isActive: index === activeIndex, value: value }))) : null,
|
19935
|
+
React.createElement("div", null,
|
19936
|
+
React.createElement(ExpandableText$1
|
19937
|
+
// className='clc-sxp-bottom-text'
|
19938
|
+
, {
|
19939
|
+
// className='clc-sxp-bottom-text'
|
19940
|
+
isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_j = (_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.title) !== null && _j !== void 0 ? _j : '', 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', padding: '0 20px', fontSize: '12px' }) }),
|
19941
|
+
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }))),
|
19942
|
+
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
|
19943
|
+
}
|
19944
|
+
return null;
|
19945
|
+
};
|
19946
|
+
const likeIcon = useIconLink(defaultLikeIconPath, appDomain);
|
19947
|
+
const unlikeIcon = useIconLink(defaultUnLikeIconPath, appDomain);
|
19948
|
+
const renderLikeButton = (rec, index) => {
|
19949
|
+
var _a, _b, _c, _d;
|
19950
|
+
if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
|
19951
|
+
return;
|
19952
|
+
let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconY) !== null && _a !== void 0 ? _a : 400;
|
19953
|
+
if (top < 40) {
|
19954
|
+
top += 40;
|
19955
|
+
}
|
19956
|
+
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
19957
|
+
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,
|
19958
|
+
// className={style['clc-sxp-like-button']}
|
19959
|
+
style: {
|
19960
|
+
top,
|
19961
|
+
right: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconX) !== null && _d !== void 0 ? _d : 0,
|
19962
|
+
position: 'absolute',
|
19963
|
+
zIndex: 999,
|
19964
|
+
backgroundColor: 'transparent',
|
19965
|
+
width: '50px',
|
19966
|
+
height: '50px',
|
19967
|
+
outline: 'none',
|
19968
|
+
border: 'none',
|
19969
|
+
boxSizing: 'content-box',
|
19970
|
+
padding: 0,
|
19971
|
+
transform: 'translate3d(0px, 0px, 0px)'
|
19972
|
+
} }));
|
19973
|
+
}
|
19974
|
+
return null;
|
19975
|
+
};
|
19976
|
+
const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png', appDomain);
|
19977
|
+
const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png', appDomain);
|
19978
|
+
const renderToggleButton = (visible) => {
|
19979
|
+
var _a, _b, _c, _d;
|
19980
|
+
if (!visible)
|
19981
|
+
return;
|
19982
|
+
let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _a !== void 0 ? _a : 23;
|
19983
|
+
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) === 'top') {
|
19984
|
+
top += 45;
|
19985
|
+
}
|
19986
|
+
return (((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowMute) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowMute) === true) && (React.createElement(ToggleButton$1, { style: {
|
19987
|
+
position: 'absolute',
|
19988
|
+
visibility: 'visible',
|
19989
|
+
zIndex: 999,
|
19990
|
+
transform: 'translate3d(0px,0px,0px)',
|
19991
|
+
[(_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconXPosit) !== null && _b !== void 0 ? _b : 'right']: (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _c !== void 0 ? _c : 0,
|
19992
|
+
[(_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) !== null && _d !== void 0 ? _d : 'bottom']: top,
|
19993
|
+
backgroundColor: 'transparent',
|
19994
|
+
width: '50px',
|
19995
|
+
height: '50px',
|
19996
|
+
outline: 'none',
|
19997
|
+
border: 'none',
|
19998
|
+
boxSizing: 'content-box',
|
19999
|
+
padding: 0
|
20000
|
+
}, 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 })));
|
20001
|
+
};
|
20002
|
+
const renderView = (item, index) => {
|
20003
|
+
var _a, _b, _c, _d;
|
20004
|
+
const rec = cloneDeep(recData);
|
20005
|
+
rec.video.bindProducts = item === null || item === void 0 ? void 0 : item.bindProducts;
|
20006
|
+
return (React.createElement("div", { style: { position: 'relative' } },
|
20007
|
+
React.createElement(SwiperSlide, { key: index, virtualIndex: index, style: { overflow: 'hidden', position: 'relative' } },
|
20008
|
+
renderBottom(rec, index),
|
20009
|
+
renderLikeButton(rec, index),
|
20010
|
+
renderToggleButton(!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed)),
|
20011
|
+
React.createElement(ToggleButton$1, { style: {
|
20012
|
+
position: 'absolute',
|
20013
|
+
right: (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _a !== void 0 ? _a : 0,
|
20014
|
+
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',
|
20015
|
+
bottom: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _d !== void 0 ? _d : 23,
|
20016
|
+
zIndex: 999
|
20017
|
+
}, 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 }),
|
20018
|
+
renderContent(item, index))));
|
20019
|
+
};
|
20020
|
+
useEffect(() => {
|
20021
|
+
var _a, _b;
|
20022
|
+
if (!(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current))
|
20023
|
+
return;
|
20024
|
+
(_b = (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.slideTo(activeIndex);
|
20025
|
+
}, [activeIndex]);
|
20026
|
+
useEffect(() => {
|
20027
|
+
var _a, _b;
|
20028
|
+
if (!(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current))
|
20029
|
+
return;
|
20030
|
+
(_b = (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.slideTo(0);
|
20031
|
+
}, [loopPlay]);
|
20032
|
+
return (React.createElement("div", { id: 'sxp-render',
|
20033
|
+
// className={style['clc-sxp-container']}
|
20034
|
+
style: { height: containerHeight, position: 'relative', pointerEvents: 'none' } },
|
20035
|
+
React.createElement(Swiper, { ref: swiperRef, allowTouchMove: false, onActiveIndexChange: (swiper) => {
|
20036
|
+
// setActiveIndex(swiper.activeIndex);
|
20037
|
+
onActiveChange === null || onActiveChange === void 0 ? void 0 : onActiveChange(swiper.activeIndex);
|
20038
|
+
}, direction: 'vertical', style: { overflow: 'hidden', height: containerHeight }, height: containerHeight }, scenes === null || scenes === void 0 ? void 0 : scenes.map((rec, index) => {
|
20039
|
+
return renderView(rec, index);
|
20040
|
+
}))));
|
20041
|
+
};
|
20042
|
+
var index$1 = memo(DiyStoryPreview);
|
19434
20043
|
|
19435
20044
|
/*
|
19436
20045
|
* @Author: binruan@chatlabs.com
|
@@ -19569,9 +20178,9 @@ var index = memo(SxpPageCore);
|
|
19569
20178
|
* @Author : haocanweng@chatlabs.cn
|
19570
20179
|
* @Date : 2023-08-21 16:31:58
|
19571
20180
|
* @LastEditors: binruan@chatlabs.com
|
19572
|
-
* @LastEditTime:
|
20181
|
+
* @LastEditTime: 2025-03-25 14:31:53
|
19573
20182
|
* @FilePath: \pb-sxp-ui\src\index.ts
|
19574
20183
|
*/
|
19575
20184
|
|
19576
|
-
export { index$
|
20185
|
+
export { index$2 as DiyPortalPreview, index$1 as DiyStoryPreview, EditorDataProvider, Modal$1 as Modal, SxpDataSourceProvider$1 as SxpDataSourceProvider, index as SxpPageCore, SxpPageRender$1 as SxpPageRender, index$3 as core, Pagebuilder as default, _materials_ as materials, useEditorDataProvider };
|
19577
20186
|
//# sourceMappingURL=index.js.map
|