pb-sxp-ui 1.10.4 → 1.10.5
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 +49 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +49 -25
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +4 -4
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +4 -4
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +49 -25
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +4 -4
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/FingerSwipeTip/index.js +2 -1
- package/es/core/components/SxpPageRender/FormatImage.js +9 -7
- package/es/core/components/SxpPageRender/LikeButton/index.js +2 -1
- package/es/core/components/SxpPageRender/Modal/index.js +2 -1
- package/es/core/components/SxpPageRender/NavBack.js +2 -1
- package/es/core/components/SxpPageRender/Nudge/index.js +2 -2
- package/es/core/components/SxpPageRender/ToggleButton/index.js +2 -1
- package/es/core/components/SxpPageRender/VideoWidget/index.js +3 -1
- package/es/core/components/SxpPageRender/index.js +5 -4
- package/es/core/context/EditorDataProvider.d.ts +2 -3
- package/es/core/utils/tool.d.ts +2 -1
- package/es/core/utils/tool.js +14 -1
- package/es/materials/sxp/MultiPosts/index.js +3 -1
- package/es/materials/sxp/cta/AniLinkPopup/index.js +2 -2
- package/lib/core/components/SxpPageRender/FingerSwipeTip/index.js +2 -1
- package/lib/core/components/SxpPageRender/FormatImage.js +9 -7
- package/lib/core/components/SxpPageRender/LikeButton/index.js +2 -1
- package/lib/core/components/SxpPageRender/Modal/index.js +2 -1
- package/lib/core/components/SxpPageRender/NavBack.js +2 -1
- package/lib/core/components/SxpPageRender/Nudge/index.js +1 -1
- package/lib/core/components/SxpPageRender/ToggleButton/index.js +2 -1
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +3 -1
- package/lib/core/components/SxpPageRender/index.js +5 -4
- package/lib/core/context/EditorDataProvider.d.ts +2 -3
- package/lib/core/utils/tool.d.ts +2 -1
- package/lib/core/utils/tool.js +15 -1
- package/lib/materials/sxp/MultiPosts/index.js +3 -1
- package/lib/materials/sxp/cta/AniLinkPopup/index.js +1 -1
- package/package.json +1 -1
@@ -1,6 +1,7 @@
|
|
1
1
|
import React, { useEffect, useMemo, useState } from 'react';
|
2
2
|
import { useIconLink } from '../useIconLink';
|
3
3
|
import { useEditor } from '../../../../core/hooks';
|
4
|
+
import { getSpliceQueryUrl } from '../../../../core/utils/tool';
|
4
5
|
const FingerSwipeTip = ({ imageUrl, style, duration = 2000 }) => {
|
5
6
|
const [show, setShow] = useState(true);
|
6
7
|
const { schema: { sxpPageConf } } = useEditor();
|
@@ -14,6 +15,6 @@ const FingerSwipeTip = ({ imageUrl, style, duration = 2000 }) => {
|
|
14
15
|
return show ? 'pb-fadeIn' : 'pb-fadeOut';
|
15
16
|
}, [show]);
|
16
17
|
return (React.createElement("div", { hidden: !show, className: `pb-finger-wrap ${animationCls}`, style: Object.assign(Object.assign({}, style), { animationDuration: `${duration / 1000}s` }) },
|
17
|
-
React.createElement("img", { src: imageUrl || FINGER_SWIPE_ICON, alt: 'finger swiper' })));
|
18
|
+
React.createElement("img", { src: getSpliceQueryUrl(imageUrl || FINGER_SWIPE_ICON), alt: 'finger swiper' })));
|
18
19
|
};
|
19
20
|
export default FingerSwipeTip;
|
@@ -1,20 +1,22 @@
|
|
1
1
|
import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../../../core/utils/event';
|
2
|
+
import { getSpliceQueryUrl } from '../../../core/utils/tool';
|
2
3
|
import React, { forwardRef, memo, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
3
4
|
const FormatImage = forwardRef((props, ref) => {
|
4
5
|
const { src, onLoad, style, className, loading, alt = 'image' } = props;
|
5
|
-
const
|
6
|
+
const querySrc = src ? getSpliceQueryUrl(src) : '';
|
7
|
+
const [imgSrc, setImgSrc] = useState(querySrc);
|
6
8
|
const imgRef = useRef(null);
|
7
9
|
const [visible, setVisible] = useState(false);
|
8
10
|
useImperativeHandle(ref, () => ({
|
9
11
|
setSrc: (v) => {
|
10
12
|
if (v)
|
11
|
-
setImgSrc(v);
|
13
|
+
setImgSrc(getSpliceQueryUrl(v));
|
12
14
|
}
|
13
15
|
}));
|
14
16
|
useEffect(() => {
|
15
|
-
if (
|
16
|
-
setImgSrc(
|
17
|
-
}, [
|
17
|
+
if (querySrc)
|
18
|
+
setImgSrc(querySrc);
|
19
|
+
}, [querySrc]);
|
18
20
|
useEffect(() => {
|
19
21
|
const onShow = () => {
|
20
22
|
if (src && !visible && imgRef.current) {
|
@@ -31,8 +33,8 @@ const FormatImage = forwardRef((props, ref) => {
|
|
31
33
|
!visible && !imgSrc && React.createElement("div", { style: { width: '100%', height: '100%', zIndex: 1, backgroundColor: '#fff' } }),
|
32
34
|
(imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc.includes('.avif')) ? (React.createElement("picture", null,
|
33
35
|
React.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
|
34
|
-
React.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}
|
35
|
-
React.createElement("source", { type: 'image/jpeg', srcSet: `${imgSrc}
|
36
|
+
React.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}&imageMogr2/format/webp` }),
|
37
|
+
React.createElement("source", { type: 'image/jpeg', srcSet: `${imgSrc}&imageMogr2/format/jpg` }),
|
36
38
|
React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign({}, style), loading: loading, onLoad: (e) => {
|
37
39
|
setVisible(true);
|
38
40
|
onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
|
@@ -3,6 +3,7 @@ import React, { memo, useState } from 'react';
|
|
3
3
|
import { debounce } from 'lodash';
|
4
4
|
import { useIconLink } from '../useIconLink';
|
5
5
|
import { useSxpDataSource } from '../../../../core/hooks';
|
6
|
+
import { getSpliceQueryUrl } from '../../../../core/utils/tool';
|
6
7
|
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
7
8
|
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
8
9
|
const LikeButton = (_a) => {
|
@@ -72,6 +73,6 @@ const LikeButton = (_a) => {
|
|
72
73
|
}
|
73
74
|
}), 200);
|
74
75
|
return (React.createElement("button", Object.assign({}, props, { "aria-label": 'like', onClick: handleClick }),
|
75
|
-
React.createElement("img", { style: { width: '100%', height: '100%', objectFit: 'contain' }, src: state ? activeIcon || likeIcon : unActicveIcon || unlikeIcon, alt: 'icon' })));
|
76
|
+
React.createElement("img", { style: { width: '100%', height: '100%', objectFit: 'contain' }, src: getSpliceQueryUrl(state ? activeIcon || likeIcon : unActicveIcon || unlikeIcon), alt: 'icon' })));
|
76
77
|
};
|
77
78
|
export default memo(LikeButton);
|
@@ -2,6 +2,7 @@ import { debounce } from 'lodash';
|
|
2
2
|
import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
3
3
|
import * as ReactDOM from 'react-dom';
|
4
4
|
import { useEditor, useSxpDataSource } from '../../../../core/hooks';
|
5
|
+
import { getSpliceQueryUrl } from '../../../../core/utils/tool';
|
5
6
|
const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
6
7
|
const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema, fullHeight = window.innerHeight, isFullScreen = false, openState }) => {
|
7
8
|
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;
|
@@ -176,6 +177,6 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
176
177
|
}
|
177
178
|
})), child()),
|
178
179
|
React.createElement("button", { className: 'modal-icon-wrapper', role: 'button', "aria-label": 'close button', onClick: onClose, style: { top: scrollTop } },
|
179
|
-
React.createElement("img", { src: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) || closeIcon, alt: 'close button', className: 'modal-icon' }))))))), modalEleRef.current);
|
180
|
+
React.createElement("img", { src: getSpliceQueryUrl((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) || closeIcon), alt: 'close button', className: 'modal-icon' }))))))), modalEleRef.current);
|
180
181
|
};
|
181
182
|
export default memo(Modal);
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import React, { memo } from 'react';
|
2
2
|
import left from './left.png';
|
3
|
+
import { getSpliceQueryUrl } from '../../../core/utils/tool';
|
3
4
|
const NavBack = ({ data, minusHeight, tagHeight, onClick }) => {
|
4
5
|
var _a, _b, _c, _d, _e;
|
5
6
|
return (React.createElement("button", { style: {
|
@@ -11,6 +12,6 @@ const NavBack = ({ data, minusHeight, tagHeight, onClick }) => {
|
|
11
12
|
padding: 0,
|
12
13
|
background: 'transparent'
|
13
14
|
}, role: 'button', "aria-label": 'back button', onClick: onClick },
|
14
|
-
React.createElement("img", { src: (data === null || data === void 0 ? void 0 : data.icon) || left, alt: 'back button', width: 100, style: { objectFit: 'cover' } })));
|
15
|
+
React.createElement("img", { src: getSpliceQueryUrl((data === null || data === void 0 ? void 0 : data.icon) || left), alt: 'back button', width: 100, style: { objectFit: 'cover' } })));
|
15
16
|
};
|
16
17
|
export default memo(NavBack);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { setFontForText } from '../../../../core/utils/tool';
|
1
|
+
import { getSpliceQueryUrl, setFontForText } from '../../../../core/utils/tool';
|
2
2
|
import React from 'react';
|
3
3
|
const Nudge = ({ nudge }) => {
|
4
4
|
var _a, _b, _c, _d, _e, _f;
|
@@ -9,7 +9,7 @@ const Nudge = ({ nudge }) => {
|
|
9
9
|
backgroundColor: nudge === null || nudge === void 0 ? void 0 : nudge.backgroundColor,
|
10
10
|
borderRadius: (_f = nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius) !== null && _f !== void 0 ? _f : 4
|
11
11
|
} },
|
12
|
-
(nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? (React.createElement("img", { src: nudge.icon, alt: 'nudge icon', style: { height: '100%', objectFit: 'cover', flexShrink: 0 } })) : null,
|
12
|
+
(nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? (React.createElement("img", { src: getSpliceQueryUrl(nudge.icon), alt: 'nudge icon', style: { height: '100%', objectFit: 'cover', flexShrink: 0 } })) : null,
|
13
13
|
React.createElement("p", { style: Object.assign(Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle), { textWrap: 'nowrap', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap', flex: 1, marginBottom: 0, marginTop: 0 }), dangerouslySetInnerHTML: {
|
14
14
|
__html: setFontForText(nudge === null || nudge === void 0 ? void 0 : nudge.content, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle)
|
15
15
|
} })))));
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { getSpliceQueryUrl } from '../../../../core/utils/tool';
|
1
2
|
import React, { memo, useEffect, useState } from 'react';
|
2
3
|
const ToggleButton = ({ defaultValue, activeIcon, unactiveIcon, onChange, style }) => {
|
3
4
|
const [isTrue, setIsTure] = useState(defaultValue);
|
@@ -11,6 +12,6 @@ const ToggleButton = ({ defaultValue, activeIcon, unactiveIcon, onChange, style
|
|
11
12
|
setIsTure(defaultValue);
|
12
13
|
}, [defaultValue]);
|
13
14
|
return (React.createElement("button", { style: style, "aria-label": 'toggle button', className: 'pb-toggle-button', onClick: handleClick },
|
14
|
-
React.createElement("img", { className: 'pb-toggle-button-icon', alt: 'toggle image', src: isTrue ? activeIcon : unactiveIcon })));
|
15
|
+
React.createElement("img", { className: 'pb-toggle-button-icon', alt: 'toggle image', src: getSpliceQueryUrl(isTrue ? activeIcon : unactiveIcon) })));
|
15
16
|
};
|
16
17
|
export default memo(ToggleButton);
|
@@ -7,6 +7,7 @@ import { useSxpDataSource } from '../../../../core/hooks';
|
|
7
7
|
import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../../../../core/utils/event';
|
8
8
|
import loading_gif from './loading.gif';
|
9
9
|
import { mountVideoPlayerAtNode } from './VideoPlayer';
|
10
|
+
import { getSpliceQueryUrl } from '../../../../core/utils/tool';
|
10
11
|
const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon }) => {
|
11
12
|
const [isPauseVideo, setIsPauseVideo] = useState(false);
|
12
13
|
const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport } = useSxpDataSource();
|
@@ -193,9 +194,10 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
193
194
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
194
195
|
if (!isActive)
|
195
196
|
return;
|
196
|
-
|
197
|
+
let videoSrc = rec === null || rec === void 0 ? void 0 : rec.video.url;
|
197
198
|
if (!videoSrc)
|
198
199
|
return;
|
200
|
+
videoSrc = getSpliceQueryUrl(videoSrc);
|
199
201
|
const videoPlayerWrapperNode = document.querySelector(`#${videoId}`);
|
200
202
|
if (!videoPlayerWrapperNode)
|
201
203
|
return;
|
@@ -26,6 +26,7 @@ import ConsentPopup from './ConsentPopup';
|
|
26
26
|
import MultiPosts from '../../../materials/sxp/MultiPosts';
|
27
27
|
import { useEditorDataProvider } from '../../../core/context/EditorDataProvider';
|
28
28
|
import NavBack from './NavBack';
|
29
|
+
import { getSpliceQueryUrl } from '../../../core/utils/tool';
|
29
30
|
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, hashTagRightMargin, tagList = [], licenseUrl }) => {
|
30
31
|
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;
|
31
32
|
const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
|
@@ -210,7 +211,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
210
211
|
new Function(link)();
|
211
212
|
}
|
212
213
|
})),
|
213
|
-
React.createElement("img", { src: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl, alt: 'logo' })));
|
214
|
+
React.createElement("img", { src: getSpliceQueryUrl(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl), alt: 'logo' })));
|
214
215
|
}
|
215
216
|
return null;
|
216
217
|
}, [globalConfig, activeIndex, visList]);
|
@@ -496,7 +497,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
496
497
|
const renderView = useMemo(() => {
|
497
498
|
if (loading) {
|
498
499
|
return (React.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
|
499
|
-
React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } })));
|
500
|
+
React.createElement("img", { width: 64, height: 64, src: getSpliceQueryUrl(loadingImage), alt: 'loading...', style: { objectFit: 'contain' } })));
|
500
501
|
}
|
501
502
|
return visList === null || visList === void 0 ? void 0 : visList.map((rec, index) => {
|
502
503
|
return (React.createElement(SwiperSlide, { key: index, virtualIndex: index, style: { overflow: 'hidden' } }, rec && (React.createElement(React.Fragment, null, (rec === null || rec === void 0 ? void 0 : rec.loading) ? (React.createElement("div", { style: {
|
@@ -506,7 +507,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
506
507
|
justifyContent: 'center',
|
507
508
|
alignItems: 'center'
|
508
509
|
} },
|
509
|
-
React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement(React.Fragment, null,
|
510
|
+
React.createElement("img", { width: 64, height: 64, src: getSpliceQueryUrl(loadingImage), alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement(React.Fragment, null,
|
510
511
|
renderBottom(rec, index),
|
511
512
|
renderLikeButton(rec, index, !(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
|
512
513
|
renderToggleButton(!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed)),
|
@@ -543,7 +544,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
543
544
|
eventInfo: {
|
544
545
|
eventSubject: 'backMultiPostClick',
|
545
546
|
eventDescription: 'backMultiPostClick',
|
546
|
-
traceInfo: (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data[
|
547
|
+
traceInfo: (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data[activeIndex]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.traceInfo) !== null && _c !== void 0 ? _c : ''
|
547
548
|
}
|
548
549
|
});
|
549
550
|
location === null || location === void 0 ? void 0 : location.reload();
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import React, { FC, PropsWithChildren } from 'react';
|
2
|
+
import { PageData } from '../Pagebuilder/type';
|
2
3
|
interface IEditorDataContext {
|
3
4
|
sxpPrameter?: {
|
4
5
|
bottomImage: string;
|
@@ -21,9 +22,7 @@ interface IEditorDataContext {
|
|
21
22
|
openConsent?: boolean;
|
22
23
|
setOpenConsent?: React.Dispatch<React.SetStateAction<boolean>>;
|
23
24
|
sxpFontLinks?: any[];
|
24
|
-
utmParameter?:
|
25
|
-
channels: string[];
|
26
|
-
};
|
25
|
+
utmParameter?: PageData['utm_parameter'];
|
27
26
|
consentPopupCate?: string;
|
28
27
|
setConsentPopupCate?: React.Dispatch<React.SetStateAction<string>>;
|
29
28
|
openMultiPosts?: boolean;
|
package/es/core/utils/tool.d.ts
CHANGED
@@ -12,4 +12,5 @@ declare function getSystem(): string | null;
|
|
12
12
|
declare function getDevice(): string | null;
|
13
13
|
declare function getCookie(val: string): string;
|
14
14
|
declare function getScreenReader(): boolean;
|
15
|
-
|
15
|
+
declare const getSpliceQueryUrl: (url?: string) => string;
|
16
|
+
export { uuid, getIndexByblockType, getBrowserInfo, getDevice, getSystem, getCookie, getScreenReader, getSpliceQueryUrl };
|
package/es/core/utils/tool.js
CHANGED
@@ -167,4 +167,17 @@ function getScreenReader() {
|
|
167
167
|
/JAWS/i.test(userAgent) ||
|
168
168
|
/ChromeVox/i.test(userAgent));
|
169
169
|
}
|
170
|
-
|
170
|
+
const getSpliceQueryUrl = (url) => {
|
171
|
+
if (!url)
|
172
|
+
return '';
|
173
|
+
if ((url === null || url === void 0 ? void 0 : url.indexOf('http')) === -1)
|
174
|
+
return url;
|
175
|
+
let query = 'x-im-piez=on';
|
176
|
+
if ((url === null || url === void 0 ? void 0 : url.indexOf('?')) !== -1) {
|
177
|
+
return url + (query ? '&' + query : '');
|
178
|
+
}
|
179
|
+
else {
|
180
|
+
return url + (query ? '?' + query : '');
|
181
|
+
}
|
182
|
+
};
|
183
|
+
export { uuid, getIndexByblockType, getBrowserInfo, getDevice, getSystem, getCookie, getScreenReader, getSpliceQueryUrl };
|
@@ -5,6 +5,7 @@ import './index.less';
|
|
5
5
|
import { useSxpDataSource } from '../../../core/hooks';
|
6
6
|
import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../../../core/utils/event';
|
7
7
|
import { useSwiperSlide } from 'swiper/react';
|
8
|
+
import { getSpliceQueryUrl } from '../../../core/utils/tool';
|
8
9
|
const MultiPosts = (_a) => {
|
9
10
|
var _b, _c;
|
10
11
|
var { bgImgUrl, style, recData } = _a, props = __rest(_a, ["bgImgUrl", "style", "recData"]);
|
@@ -50,6 +51,7 @@ const MultiPosts = (_a) => {
|
|
50
51
|
});
|
51
52
|
}, []);
|
52
53
|
const endMultiPost = useCallback((nextStep) => {
|
54
|
+
curTime.current = new Date();
|
53
55
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
54
56
|
eventInfo: {
|
55
57
|
eventSubject: 'endMultiPost',
|
@@ -85,7 +87,7 @@ const MultiPosts = (_a) => {
|
|
85
87
|
}, [isActive]);
|
86
88
|
return (React.createElement("div", { className: 'multiposts', style: Object.assign(Object.assign({}, style), getBgStyle(bgImgUrl)) }, Array.from({ length: 4 }, (_, index) => {
|
87
89
|
return (React.createElement("button", { hidden: !getPropsVal(index, 'Url'), className: 'multiposts-btn', role: 'button', "aria-label": `multiposts-${index + 1}`, onClick: () => handleClick(index) },
|
88
|
-
React.createElement("img", { className: 'multiposts-btn-img', src: getPropsVal(index, 'Url'), alt: `multiposts-img-${index + 1}` })));
|
90
|
+
React.createElement("img", { className: 'multiposts-btn-img', src: getSpliceQueryUrl(getPropsVal(index, 'Url')), alt: `multiposts-img-${index + 1}` })));
|
89
91
|
})));
|
90
92
|
};
|
91
93
|
export default memo(MultiPosts);
|
@@ -4,7 +4,7 @@ import React, { memo, useEffect, useMemo, useState } from 'react';
|
|
4
4
|
import { useSxpDataSource } from '../../../../core/hooks';
|
5
5
|
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
6
6
|
import Img from '../../template/components/Img';
|
7
|
-
import { setFontForText } from '../../../../core/utils/tool';
|
7
|
+
import { getSpliceQueryUrl, setFontForText } from '../../../../core/utils/tool';
|
8
8
|
import styles from './index.module.less';
|
9
9
|
const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
10
10
|
const AniLinkPopup = (_a) => {
|
@@ -65,7 +65,7 @@ const AniLinkPopup = (_a) => {
|
|
65
65
|
paddingLeft: '6px'
|
66
66
|
} }, "Cta Title")) : (React.createElement("div", Object.assign({}, props, { className: `${css(Object.assign(Object.assign({}, style), { '--transY': `translateY(calc(100% + ${(_r = style === null || style === void 0 ? void 0 : style.margin) !== null && _r !== void 0 ? _r : 0}px))` }))} ${styles['aniLinkPopup']} ${aniNamStyle} ${css(aniTimStyle)}`, onClick: handleTo }),
|
67
67
|
React.createElement("div", { onClick: onClose, className: styles['modal-icon-wrapper'], style: { padding: (_s = style === null || style === void 0 ? void 0 : style['padding']) !== null && _s !== void 0 ? _s : 0 } },
|
68
|
-
React.createElement("img", { src: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) || closeIcon, alt: 'close', className: styles['modal-icon-wrapper-img'] })),
|
68
|
+
React.createElement("img", { src: getSpliceQueryUrl((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) || closeIcon), alt: 'close', className: styles['modal-icon-wrapper-img'] })),
|
69
69
|
React.createElement(Img, { src: src, rec: recData, item: (_x = (_v = (_u = (_t = recData === null || recData === void 0 ? void 0 : recData.video) === null || _t === void 0 ? void 0 : _t.bindProducts) === null || _u === void 0 ? void 0 : _u[0]) !== null && _v !== void 0 ? _v : (_w = recData === null || recData === void 0 ? void 0 : recData.video) === null || _w === void 0 ? void 0 : _w.bindProduct) !== null && _x !== void 0 ? _x : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
|
70
70
|
(!recData || (product === null || product === void 0 ? void 0 : product.title)) && (React.createElement("div", { className: styles['one-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
|
71
71
|
__html: setFontForText((_y = product === null || product === void 0 ? void 0 : product.title) !== null && _y !== void 0 ? _y : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
|
@@ -4,6 +4,7 @@ const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
5
5
|
const useIconLink_1 = require("../useIconLink");
|
6
6
|
const hooks_1 = require("../../../../core/hooks");
|
7
|
+
const tool_1 = require("../../../../core/utils/tool");
|
7
8
|
const FingerSwipeTip = ({ imageUrl, style, duration = 2000 }) => {
|
8
9
|
const [show, setShow] = (0, react_1.useState)(true);
|
9
10
|
const { schema: { sxpPageConf } } = (0, hooks_1.useEditor)();
|
@@ -17,6 +18,6 @@ const FingerSwipeTip = ({ imageUrl, style, duration = 2000 }) => {
|
|
17
18
|
return show ? 'pb-fadeIn' : 'pb-fadeOut';
|
18
19
|
}, [show]);
|
19
20
|
return (react_1.default.createElement("div", { hidden: !show, className: `pb-finger-wrap ${animationCls}`, style: Object.assign(Object.assign({}, style), { animationDuration: `${duration / 1000}s` }) },
|
20
|
-
react_1.default.createElement("img", { src: imageUrl || FINGER_SWIPE_ICON, alt: 'finger swiper' })));
|
21
|
+
react_1.default.createElement("img", { src: (0, tool_1.getSpliceQueryUrl)(imageUrl || FINGER_SWIPE_ICON), alt: 'finger swiper' })));
|
21
22
|
};
|
22
23
|
exports.default = FingerSwipeTip;
|
@@ -2,22 +2,24 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const tslib_1 = require("tslib");
|
4
4
|
const event_1 = tslib_1.__importStar(require("../../../core/utils/event"));
|
5
|
+
const tool_1 = require("../../../core/utils/tool");
|
5
6
|
const react_1 = tslib_1.__importStar(require("react"));
|
6
7
|
const FormatImage = (0, react_1.forwardRef)((props, ref) => {
|
7
8
|
const { src, onLoad, style, className, loading, alt = 'image' } = props;
|
8
|
-
const
|
9
|
+
const querySrc = src ? (0, tool_1.getSpliceQueryUrl)(src) : '';
|
10
|
+
const [imgSrc, setImgSrc] = (0, react_1.useState)(querySrc);
|
9
11
|
const imgRef = (0, react_1.useRef)(null);
|
10
12
|
const [visible, setVisible] = (0, react_1.useState)(false);
|
11
13
|
(0, react_1.useImperativeHandle)(ref, () => ({
|
12
14
|
setSrc: (v) => {
|
13
15
|
if (v)
|
14
|
-
setImgSrc(v);
|
16
|
+
setImgSrc((0, tool_1.getSpliceQueryUrl)(v));
|
15
17
|
}
|
16
18
|
}));
|
17
19
|
(0, react_1.useEffect)(() => {
|
18
|
-
if (
|
19
|
-
setImgSrc(
|
20
|
-
}, [
|
20
|
+
if (querySrc)
|
21
|
+
setImgSrc(querySrc);
|
22
|
+
}, [querySrc]);
|
21
23
|
(0, react_1.useEffect)(() => {
|
22
24
|
const onShow = () => {
|
23
25
|
if (src && !visible && imgRef.current) {
|
@@ -34,8 +36,8 @@ const FormatImage = (0, react_1.forwardRef)((props, ref) => {
|
|
34
36
|
!visible && !imgSrc && react_1.default.createElement("div", { style: { width: '100%', height: '100%', zIndex: 1, backgroundColor: '#fff' } }),
|
35
37
|
(imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc.includes('.avif')) ? (react_1.default.createElement("picture", null,
|
36
38
|
react_1.default.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
|
37
|
-
react_1.default.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}
|
38
|
-
react_1.default.createElement("source", { type: 'image/jpeg', srcSet: `${imgSrc}
|
39
|
+
react_1.default.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}&imageMogr2/format/webp` }),
|
40
|
+
react_1.default.createElement("source", { type: 'image/jpeg', srcSet: `${imgSrc}&imageMogr2/format/jpg` }),
|
39
41
|
react_1.default.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign({}, style), loading: loading, onLoad: (e) => {
|
40
42
|
setVisible(true);
|
41
43
|
onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
|
@@ -5,6 +5,7 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
const lodash_1 = require("lodash");
|
6
6
|
const useIconLink_1 = require("../useIconLink");
|
7
7
|
const hooks_1 = require("../../../../core/hooks");
|
8
|
+
const tool_1 = require("../../../../core/utils/tool");
|
8
9
|
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
9
10
|
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
10
11
|
const LikeButton = (_a) => {
|
@@ -74,6 +75,6 @@ const LikeButton = (_a) => {
|
|
74
75
|
}
|
75
76
|
}), 200);
|
76
77
|
return (react_1.default.createElement("button", Object.assign({}, props, { "aria-label": 'like', onClick: handleClick }),
|
77
|
-
react_1.default.createElement("img", { style: { width: '100%', height: '100%', objectFit: 'contain' }, src: state ? activeIcon || likeIcon : unActicveIcon || unlikeIcon, alt: 'icon' })));
|
78
|
+
react_1.default.createElement("img", { style: { width: '100%', height: '100%', objectFit: 'contain' }, src: (0, tool_1.getSpliceQueryUrl)(state ? activeIcon || likeIcon : unActicveIcon || unlikeIcon), alt: 'icon' })));
|
78
79
|
};
|
79
80
|
exports.default = (0, react_1.memo)(LikeButton);
|
@@ -5,6 +5,7 @@ const lodash_1 = require("lodash");
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
6
6
|
const ReactDOM = tslib_1.__importStar(require("react-dom"));
|
7
7
|
const hooks_1 = require("../../../../core/hooks");
|
8
|
+
const tool_1 = require("../../../../core/utils/tool");
|
8
9
|
const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
9
10
|
const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema, fullHeight = window.innerHeight, isFullScreen = false, openState }) => {
|
10
11
|
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;
|
@@ -179,6 +180,6 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
179
180
|
}
|
180
181
|
})), child()),
|
181
182
|
react_1.default.createElement("button", { className: 'modal-icon-wrapper', role: 'button', "aria-label": 'close button', onClick: onClose, style: { top: scrollTop } },
|
182
|
-
react_1.default.createElement("img", { src: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) || closeIcon, alt: 'close button', className: 'modal-icon' }))))))), modalEleRef.current);
|
183
|
+
react_1.default.createElement("img", { src: (0, tool_1.getSpliceQueryUrl)((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) || closeIcon), alt: 'close button', className: 'modal-icon' }))))))), modalEleRef.current);
|
183
184
|
};
|
184
185
|
exports.default = (0, react_1.memo)(Modal);
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
5
5
|
const left_png_1 = tslib_1.__importDefault(require("./left.png"));
|
6
|
+
const tool_1 = require("../../../core/utils/tool");
|
6
7
|
const NavBack = ({ data, minusHeight, tagHeight, onClick }) => {
|
7
8
|
var _a, _b, _c, _d, _e;
|
8
9
|
return (react_1.default.createElement("button", { style: {
|
@@ -14,6 +15,6 @@ const NavBack = ({ data, minusHeight, tagHeight, onClick }) => {
|
|
14
15
|
padding: 0,
|
15
16
|
background: 'transparent'
|
16
17
|
}, role: 'button', "aria-label": 'back button', onClick: onClick },
|
17
|
-
react_1.default.createElement("img", { src: (data === null || data === void 0 ? void 0 : data.icon) || left_png_1.default, alt: 'back button', width: 100, style: { objectFit: 'cover' } })));
|
18
|
+
react_1.default.createElement("img", { src: (0, tool_1.getSpliceQueryUrl)((data === null || data === void 0 ? void 0 : data.icon) || left_png_1.default), alt: 'back button', width: 100, style: { objectFit: 'cover' } })));
|
18
19
|
};
|
19
20
|
exports.default = (0, react_1.memo)(NavBack);
|
@@ -12,7 +12,7 @@ const Nudge = ({ nudge }) => {
|
|
12
12
|
backgroundColor: nudge === null || nudge === void 0 ? void 0 : nudge.backgroundColor,
|
13
13
|
borderRadius: (_f = nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius) !== null && _f !== void 0 ? _f : 4
|
14
14
|
} },
|
15
|
-
(nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? (react_1.default.createElement("img", { src: nudge.icon, alt: 'nudge icon', style: { height: '100%', objectFit: 'cover', flexShrink: 0 } })) : null,
|
15
|
+
(nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? (react_1.default.createElement("img", { src: (0, tool_1.getSpliceQueryUrl)(nudge.icon), alt: 'nudge icon', style: { height: '100%', objectFit: 'cover', flexShrink: 0 } })) : null,
|
16
16
|
react_1.default.createElement("p", { style: Object.assign(Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle), { textWrap: 'nowrap', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap', flex: 1, marginBottom: 0, marginTop: 0 }), dangerouslySetInnerHTML: {
|
17
17
|
__html: (0, tool_1.setFontForText)(nudge === null || nudge === void 0 ? void 0 : nudge.content, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle)
|
18
18
|
} })))));
|
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const tslib_1 = require("tslib");
|
4
|
+
const tool_1 = require("../../../../core/utils/tool");
|
4
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
5
6
|
const ToggleButton = ({ defaultValue, activeIcon, unactiveIcon, onChange, style }) => {
|
6
7
|
const [isTrue, setIsTure] = (0, react_1.useState)(defaultValue);
|
@@ -14,6 +15,6 @@ const ToggleButton = ({ defaultValue, activeIcon, unactiveIcon, onChange, style
|
|
14
15
|
setIsTure(defaultValue);
|
15
16
|
}, [defaultValue]);
|
16
17
|
return (react_1.default.createElement("button", { style: style, "aria-label": 'toggle button', className: 'pb-toggle-button', onClick: handleClick },
|
17
|
-
react_1.default.createElement("img", { className: 'pb-toggle-button-icon', alt: 'toggle image', src: isTrue ? activeIcon : unactiveIcon })));
|
18
|
+
react_1.default.createElement("img", { className: 'pb-toggle-button-icon', alt: 'toggle image', src: (0, tool_1.getSpliceQueryUrl)(isTrue ? activeIcon : unactiveIcon) })));
|
18
19
|
};
|
19
20
|
exports.default = (0, react_1.memo)(ToggleButton);
|
@@ -9,6 +9,7 @@ const hooks_1 = require("../../../../core/hooks");
|
|
9
9
|
const event_1 = tslib_1.__importStar(require("../../../../core/utils/event"));
|
10
10
|
const loading_gif_1 = tslib_1.__importDefault(require("./loading.gif"));
|
11
11
|
const VideoPlayer_1 = require("./VideoPlayer");
|
12
|
+
const tool_1 = require("../../../../core/utils/tool");
|
12
13
|
const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon }) => {
|
13
14
|
const [isPauseVideo, setIsPauseVideo] = (0, react_1.useState)(false);
|
14
15
|
const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport } = (0, hooks_1.useSxpDataSource)();
|
@@ -195,9 +196,10 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
195
196
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
196
197
|
if (!isActive)
|
197
198
|
return;
|
198
|
-
|
199
|
+
let videoSrc = rec === null || rec === void 0 ? void 0 : rec.video.url;
|
199
200
|
if (!videoSrc)
|
200
201
|
return;
|
202
|
+
videoSrc = (0, tool_1.getSpliceQueryUrl)(videoSrc);
|
201
203
|
const videoPlayerWrapperNode = document.querySelector(`#${videoId}`);
|
202
204
|
if (!videoPlayerWrapperNode)
|
203
205
|
return;
|
@@ -29,6 +29,7 @@ const ConsentPopup_1 = tslib_1.__importDefault(require("./ConsentPopup"));
|
|
29
29
|
const MultiPosts_1 = tslib_1.__importDefault(require("../../../materials/sxp/MultiPosts"));
|
30
30
|
const EditorDataProvider_1 = require("../../../core/context/EditorDataProvider");
|
31
31
|
const NavBack_1 = tslib_1.__importDefault(require("./NavBack"));
|
32
|
+
const tool_1 = require("../../../core/utils/tool");
|
32
33
|
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, hashTagRightMargin, tagList = [], licenseUrl }) => {
|
33
34
|
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;
|
34
35
|
const mutedIcon = (0, useIconLink_1.useIconLink)('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
|
@@ -213,7 +214,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
213
214
|
new Function(link)();
|
214
215
|
}
|
215
216
|
})),
|
216
|
-
react_1.default.createElement("img", { src: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl, alt: 'logo' })));
|
217
|
+
react_1.default.createElement("img", { src: (0, tool_1.getSpliceQueryUrl)(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl), alt: 'logo' })));
|
217
218
|
}
|
218
219
|
return null;
|
219
220
|
}, [globalConfig, activeIndex, visList]);
|
@@ -499,7 +500,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
499
500
|
const renderView = (0, react_1.useMemo)(() => {
|
500
501
|
if (loading) {
|
501
502
|
return (react_1.default.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
|
502
|
-
react_1.default.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } })));
|
503
|
+
react_1.default.createElement("img", { width: 64, height: 64, src: (0, tool_1.getSpliceQueryUrl)(loadingImage), alt: 'loading...', style: { objectFit: 'contain' } })));
|
503
504
|
}
|
504
505
|
return visList === null || visList === void 0 ? void 0 : visList.map((rec, index) => {
|
505
506
|
return (react_1.default.createElement(react_2.SwiperSlide, { key: index, virtualIndex: index, style: { overflow: 'hidden' } }, rec && (react_1.default.createElement(react_1.default.Fragment, null, (rec === null || rec === void 0 ? void 0 : rec.loading) ? (react_1.default.createElement("div", { style: {
|
@@ -509,7 +510,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
509
510
|
justifyContent: 'center',
|
510
511
|
alignItems: 'center'
|
511
512
|
} },
|
512
|
-
react_1.default.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (react_1.default.createElement(react_1.default.Fragment, null,
|
513
|
+
react_1.default.createElement("img", { width: 64, height: 64, src: (0, tool_1.getSpliceQueryUrl)(loadingImage), alt: 'loading...', style: { objectFit: 'contain' } }))) : (react_1.default.createElement(react_1.default.Fragment, null,
|
513
514
|
renderBottom(rec, index),
|
514
515
|
renderLikeButton(rec, index, !(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
|
515
516
|
renderToggleButton(!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed)),
|
@@ -546,7 +547,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
546
547
|
eventInfo: {
|
547
548
|
eventSubject: 'backMultiPostClick',
|
548
549
|
eventDescription: 'backMultiPostClick',
|
549
|
-
traceInfo: (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data[
|
550
|
+
traceInfo: (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data[activeIndex]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.traceInfo) !== null && _c !== void 0 ? _c : ''
|
550
551
|
}
|
551
552
|
});
|
552
553
|
location === null || location === void 0 ? void 0 : location.reload();
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import React, { FC, PropsWithChildren } from 'react';
|
2
|
+
import { PageData } from '../Pagebuilder/type';
|
2
3
|
interface IEditorDataContext {
|
3
4
|
sxpPrameter?: {
|
4
5
|
bottomImage: string;
|
@@ -21,9 +22,7 @@ interface IEditorDataContext {
|
|
21
22
|
openConsent?: boolean;
|
22
23
|
setOpenConsent?: React.Dispatch<React.SetStateAction<boolean>>;
|
23
24
|
sxpFontLinks?: any[];
|
24
|
-
utmParameter?:
|
25
|
-
channels: string[];
|
26
|
-
};
|
25
|
+
utmParameter?: PageData['utm_parameter'];
|
27
26
|
consentPopupCate?: string;
|
28
27
|
setConsentPopupCate?: React.Dispatch<React.SetStateAction<string>>;
|
29
28
|
openMultiPosts?: boolean;
|
package/lib/core/utils/tool.d.ts
CHANGED
@@ -12,4 +12,5 @@ declare function getSystem(): string | null;
|
|
12
12
|
declare function getDevice(): string | null;
|
13
13
|
declare function getCookie(val: string): string;
|
14
14
|
declare function getScreenReader(): boolean;
|
15
|
-
|
15
|
+
declare const getSpliceQueryUrl: (url?: string) => string;
|
16
|
+
export { uuid, getIndexByblockType, getBrowserInfo, getDevice, getSystem, getCookie, getScreenReader, getSpliceQueryUrl };
|
package/lib/core/utils/tool.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.getScreenReader = exports.getCookie = exports.getSystem = exports.getDevice = exports.getBrowserInfo = exports.getIndexByblockType = exports.uuid = exports.setFontForText = exports.getUid = exports.generateRandomString = void 0;
|
3
|
+
exports.getSpliceQueryUrl = exports.getScreenReader = exports.getCookie = exports.getSystem = exports.getDevice = exports.getBrowserInfo = exports.getIndexByblockType = exports.uuid = exports.setFontForText = exports.getUid = exports.generateRandomString = void 0;
|
4
4
|
const uuid_1 = require("uuid");
|
5
5
|
function uuid(len, radix) {
|
6
6
|
const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
|
@@ -180,3 +180,17 @@ function getScreenReader() {
|
|
180
180
|
/ChromeVox/i.test(userAgent));
|
181
181
|
}
|
182
182
|
exports.getScreenReader = getScreenReader;
|
183
|
+
const getSpliceQueryUrl = (url) => {
|
184
|
+
if (!url)
|
185
|
+
return '';
|
186
|
+
if ((url === null || url === void 0 ? void 0 : url.indexOf('http')) === -1)
|
187
|
+
return url;
|
188
|
+
let query = 'x-im-piez=on';
|
189
|
+
if ((url === null || url === void 0 ? void 0 : url.indexOf('?')) !== -1) {
|
190
|
+
return url + (query ? '&' + query : '');
|
191
|
+
}
|
192
|
+
else {
|
193
|
+
return url + (query ? '?' + query : '');
|
194
|
+
}
|
195
|
+
};
|
196
|
+
exports.getSpliceQueryUrl = getSpliceQueryUrl;
|
@@ -7,6 +7,7 @@ require("./index.less");
|
|
7
7
|
const hooks_1 = require("../../../core/hooks");
|
8
8
|
const event_1 = tslib_1.__importStar(require("../../../core/utils/event"));
|
9
9
|
const react_2 = require("swiper/react");
|
10
|
+
const tool_1 = require("../../../core/utils/tool");
|
10
11
|
const MultiPosts = (_a) => {
|
11
12
|
var _b, _c;
|
12
13
|
var { bgImgUrl, style, recData } = _a, props = tslib_1.__rest(_a, ["bgImgUrl", "style", "recData"]);
|
@@ -52,6 +53,7 @@ const MultiPosts = (_a) => {
|
|
52
53
|
});
|
53
54
|
}, []);
|
54
55
|
const endMultiPost = (0, react_1.useCallback)((nextStep) => {
|
56
|
+
curTime.current = new Date();
|
55
57
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
56
58
|
eventInfo: {
|
57
59
|
eventSubject: 'endMultiPost',
|
@@ -87,7 +89,7 @@ const MultiPosts = (_a) => {
|
|
87
89
|
}, [isActive]);
|
88
90
|
return (react_1.default.createElement("div", { className: 'multiposts', style: Object.assign(Object.assign({}, style), (0, materials_1.getBgStyle)(bgImgUrl)) }, Array.from({ length: 4 }, (_, index) => {
|
89
91
|
return (react_1.default.createElement("button", { hidden: !getPropsVal(index, 'Url'), className: 'multiposts-btn', role: 'button', "aria-label": `multiposts-${index + 1}`, onClick: () => handleClick(index) },
|
90
|
-
react_1.default.createElement("img", { className: 'multiposts-btn-img', src: getPropsVal(index, 'Url'), alt: `multiposts-img-${index + 1}` })));
|
92
|
+
react_1.default.createElement("img", { className: 'multiposts-btn-img', src: (0, tool_1.getSpliceQueryUrl)(getPropsVal(index, 'Url')), alt: `multiposts-img-${index + 1}` })));
|
91
93
|
})));
|
92
94
|
};
|
93
95
|
exports.default = (0, react_1.memo)(MultiPosts);
|
@@ -67,7 +67,7 @@ const AniLinkPopup = (_a) => {
|
|
67
67
|
paddingLeft: '6px'
|
68
68
|
} }, "Cta Title")) : (react_1.default.createElement("div", Object.assign({}, props, { className: `${(0, css_1.css)(Object.assign(Object.assign({}, style), { '--transY': `translateY(calc(100% + ${(_r = style === null || style === void 0 ? void 0 : style.margin) !== null && _r !== void 0 ? _r : 0}px))` }))} ${index_module_less_1.default['aniLinkPopup']} ${aniNamStyle} ${(0, css_1.css)(aniTimStyle)}`, onClick: handleTo }),
|
69
69
|
react_1.default.createElement("div", { onClick: onClose, className: index_module_less_1.default['modal-icon-wrapper'], style: { padding: (_s = style === null || style === void 0 ? void 0 : style['padding']) !== null && _s !== void 0 ? _s : 0 } },
|
70
|
-
react_1.default.createElement("img", { src: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) || closeIcon, alt: 'close', className: index_module_less_1.default['modal-icon-wrapper-img'] })),
|
70
|
+
react_1.default.createElement("img", { src: (0, tool_1.getSpliceQueryUrl)((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) || closeIcon), alt: 'close', className: index_module_less_1.default['modal-icon-wrapper-img'] })),
|
71
71
|
react_1.default.createElement(Img_1.default, { src: src, rec: recData, item: (_x = (_v = (_u = (_t = recData === null || recData === void 0 ? void 0 : recData.video) === null || _t === void 0 ? void 0 : _t.bindProducts) === null || _u === void 0 ? void 0 : _u[0]) !== null && _v !== void 0 ? _v : (_w = recData === null || recData === void 0 ? void 0 : recData.video) === null || _w === void 0 ? void 0 : _w.bindProduct) !== null && _x !== void 0 ? _x : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
|
72
72
|
(!recData || (product === null || product === void 0 ? void 0 : product.title)) && (react_1.default.createElement("div", { className: index_module_less_1.default['one-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
|
73
73
|
__html: (0, tool_1.setFontForText)((_y = product === null || product === void 0 ? void 0 : product.title) !== null && _y !== void 0 ? _y : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
|