pb-sxp-ui 1.2.0 → 1.2.1
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 +16 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +16 -15
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +16 -15
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/context/SxpDataSourceProvider.js +2 -3
- package/es/materials/sxp/cta/AniLink/index.js +2 -1
- package/es/materials/sxp/cta/AniLinkPopup/index.js +3 -2
- package/es/materials/sxp/popup/CommodityList/index.js +10 -10
- package/lib/core/context/SxpDataSourceProvider.js +2 -3
- package/lib/materials/sxp/cta/AniLink/index.js +2 -1
- package/lib/materials/sxp/cta/AniLinkPopup/index.js +3 -2
- package/lib/materials/sxp/popup/CommodityList/index.js +9 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -531,7 +531,6 @@ var DataSourceType;
|
|
531
531
|
(function (DataSourceType) {
|
532
532
|
DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
|
533
533
|
})(DataSourceType || (DataSourceType = {}));
|
534
|
-
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
|
535
534
|
const DEFAULT_TAG = 'FOR U';
|
536
535
|
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isShowTag = true, isOpenConsent = false, globalConfig, isEditor = false }) => {
|
537
536
|
var _a, _b, _c;
|
@@ -615,7 +614,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
615
614
|
const val = (_h = (_g = (_f = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _f === void 0 ? void 0 : _f.filter((val) => {
|
616
615
|
var _a, _b;
|
617
616
|
const key = val.split('=')[0];
|
618
|
-
return (_b = ((_a = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.channels) !== null && _a !== void 0 ? _a :
|
617
|
+
return (_b = ((_a = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.channels) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.includes(key);
|
619
618
|
})) === null || _g === void 0 ? void 0 : _g.join('&')) !== null && _h !== void 0 ? _h : '';
|
620
619
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
621
620
|
}
|
@@ -710,7 +709,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
710
709
|
const val = (_o = (_m = (_l = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _l === void 0 ? void 0 : _l.filter((val) => {
|
711
710
|
var _a, _b;
|
712
711
|
const key = val.split('=')[0];
|
713
|
-
return (_b = ((_a = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.channels) !== null && _a !== void 0 ? _a :
|
712
|
+
return (_b = ((_a = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.channels) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.includes(key);
|
714
713
|
})) === null || _m === void 0 ? void 0 : _m.join('&')) !== null && _o !== void 0 ? _o : '';
|
715
714
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
716
715
|
setTagList((_q = (_p = result === null || result === void 0 ? void 0 : result.data) === null || _p === void 0 ? void 0 : _p.tags) !== null && _q !== void 0 ? _q : []);
|
@@ -10141,7 +10140,6 @@ const CommodityList$1 = (_a) => {
|
|
10141
10140
|
var { style, isDefault, rec, viewTime, isPost, bottom_image, commodityStyles, buttonStyle, index, translateY = 0, commodityPicture, isExternalLink } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "commodityStyles", "buttonStyle", "index", "translateY", "commodityPicture", "isExternalLink"]);
|
10142
10141
|
const { sxpParameter } = useSxpDataSource();
|
10143
10142
|
const { popupDetailData, bffEventReport, isPreview, swiperRef, bffFbReport } = useSxpDataSource();
|
10144
|
-
useRef(null);
|
10145
10143
|
const recData = isPost ? rec : popupDetailData;
|
10146
10144
|
const product = (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [null, null, null, null];
|
10147
10145
|
const priceText = useCallback((product) => {
|
@@ -10161,13 +10159,14 @@ const CommodityList$1 = (_a) => {
|
|
10161
10159
|
display: 'flex'
|
10162
10160
|
}) }),
|
10163
10161
|
React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: commodityPicture }),
|
10164
|
-
React.createElement("div",
|
10165
|
-
React.createElement("div",
|
10166
|
-
|
10167
|
-
|
10168
|
-
|
10169
|
-
|
10170
|
-
|
10162
|
+
React.createElement("div", { style: { flex: 1, display: 'flex', flexDirection: 'column', justifyContent: 'space-between' } },
|
10163
|
+
React.createElement("div", null,
|
10164
|
+
React.createElement("div", { style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.title), dangerouslySetInnerHTML: {
|
10165
|
+
__html: setFontForText((_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Pendant in Yellow Gold with Diamonds, Medium', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
|
10166
|
+
} }),
|
10167
|
+
React.createElement("div", { style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection, hidden: !!item && (!(item === null || item === void 0 ? void 0 : item.collection) || (item === null || item === void 0 ? void 0 : item.collection) === ''), dangerouslySetInnerHTML: {
|
10168
|
+
__html: setFontForText((_f = item === null || item === void 0 ? void 0 : item.collection) !== null && _f !== void 0 ? _f : 'Tiffany Lock', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
|
10169
|
+
} })),
|
10171
10170
|
React.createElement("div", { className: css({
|
10172
10171
|
display: 'flex',
|
10173
10172
|
alignItems: 'flex-end',
|
@@ -10178,7 +10177,7 @@ const CommodityList$1 = (_a) => {
|
|
10178
10177
|
React.createElement("div", { style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.price), dangerouslySetInnerHTML: {
|
10179
10178
|
__html: setFontForText(priceText(item), commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
|
10180
10179
|
} }),
|
10181
|
-
React.createElement("div", { style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
|
10180
|
+
React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px', maxWidth: '100px' }), dangerouslySetInnerHTML: {
|
10182
10181
|
__html: setFontForText((_h = (_g = item === null || item === void 0 ? void 0 : item.bindCta) === null || _g === void 0 ? void 0 : _g.enTitle) !== null && _h !== void 0 ? _h : 'Shop Now', buttonStyle)
|
10183
10182
|
} })))));
|
10184
10183
|
})));
|
@@ -13911,7 +13910,7 @@ var styles$1 = {"animated-button":"index-module_animated-button__lqTbg","gradien
|
|
13911
13910
|
const AniLink$1 = (_a) => {
|
13912
13911
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
13913
13912
|
var { style, recData, ctaTempStyles, index, event, onClick, isExternalLink = false } = _a, props = __rest(_a, ["style", "recData", "ctaTempStyles", "index", "event", "onClick", "isExternalLink"]);
|
13914
|
-
const { ctaEvent } = useSxpDataSource();
|
13913
|
+
const { ctaEvent, setPopupDetailData } = useSxpDataSource();
|
13915
13914
|
const { jumpToWeb } = useEventReport();
|
13916
13915
|
const ref = useRef(null);
|
13917
13916
|
const isOnScreen = useOnScreen(ref);
|
@@ -13924,6 +13923,7 @@ const AniLink$1 = (_a) => {
|
|
13924
13923
|
eventSubject: 'clickCta',
|
13925
13924
|
eventDescription: 'User clicked the CTA'
|
13926
13925
|
}, recData, item, index);
|
13926
|
+
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { index }));
|
13927
13927
|
if (isExternalLink) {
|
13928
13928
|
jumpToWeb(recData, product, cta, index);
|
13929
13929
|
}
|
@@ -14324,7 +14324,7 @@ const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAAB
|
|
14324
14324
|
const AniLinkPopup$1 = (_a) => {
|
14325
14325
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
14326
14326
|
var { style, recData, ctaTempStyles, index, event, bottom_image, translateY, isTel, onClick, isExternalLink = false } = _a, props = __rest(_a, ["style", "recData", "ctaTempStyles", "index", "event", "bottom_image", "translateY", "isTel", "onClick", "isExternalLink"]);
|
14327
|
-
const { sxpParameter, globalConfig, ctaEvent } = useSxpDataSource();
|
14327
|
+
const { sxpParameter, globalConfig, ctaEvent, setPopupDetailData } = useSxpDataSource();
|
14328
14328
|
const { jumpToWeb } = useEventReport();
|
14329
14329
|
const [visible, setVisible] = useState(true);
|
14330
14330
|
const cta = ((_d = (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.bindCta) || ((_f = (_e = recData === null || recData === void 0 ? void 0 : recData.video) === null || _e === void 0 ? void 0 : _e.bindProduct) === null || _f === void 0 ? void 0 : _f.bindCta) || ((_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindCta);
|
@@ -14336,6 +14336,7 @@ const AniLinkPopup$1 = (_a) => {
|
|
14336
14336
|
eventSubject: 'clickCta',
|
14337
14337
|
eventDescription: 'User clicked the CTA'
|
14338
14338
|
}, recData, item, index);
|
14339
|
+
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { index }));
|
14339
14340
|
if (isExternalLink) {
|
14340
14341
|
jumpToWeb(recData, product, cta, index);
|
14341
14342
|
}
|
@@ -14365,7 +14366,7 @@ const AniLinkPopup$1 = (_a) => {
|
|
14365
14366
|
height: '40px',
|
14366
14367
|
lineHeight: '40px',
|
14367
14368
|
paddingLeft: '6px'
|
14368
|
-
} }, "Cta Title")) : (React.createElement("div", Object.assign({ style: Object.assign(Object.assign({}, style), { position: '
|
14369
|
+
} }, "Cta Title")) : (React.createElement("div", Object.assign({ style: Object.assign(Object.assign({}, style), { position: 'absolute', right: 0, bottom: 0, zIndex: 1000, display: visible ? 'block' : 'none' }) }, props, { className: `${styles['animated-button']} ${css(aniStyle)}`, onClick: handleTo }),
|
14369
14370
|
React.createElement("div", { onClick: onClose, className: styles['modal-icon-wrapper'], style: { padding: (_r = style === null || style === void 0 ? void 0 : style['padding']) !== null && _r !== void 0 ? _r : 0 } },
|
14370
14371
|
React.createElement("img", { src: (_s = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) !== null && _s !== void 0 ? _s : closeIcon, alt: 'close', className: styles['modal-icon-wrapper-img'] })),
|
14371
14372
|
React.createElement(Img$1, { 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 }),
|