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/pb-ui.js
CHANGED
@@ -546,7 +546,6 @@
|
|
546
546
|
(function (DataSourceType) {
|
547
547
|
DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
|
548
548
|
})(DataSourceType || (DataSourceType = {}));
|
549
|
-
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
|
550
549
|
const DEFAULT_TAG = 'FOR U';
|
551
550
|
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 }) => {
|
552
551
|
var _a, _b, _c;
|
@@ -630,7 +629,7 @@
|
|
630
629
|
const val = (_h = (_g = (_f = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _f === void 0 ? void 0 : _f.filter((val) => {
|
631
630
|
var _a, _b;
|
632
631
|
const key = val.split('=')[0];
|
633
|
-
return (_b = ((_a = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.channels) !== null && _a !== void 0 ? _a :
|
632
|
+
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);
|
634
633
|
})) === null || _g === void 0 ? void 0 : _g.join('&')) !== null && _h !== void 0 ? _h : '';
|
635
634
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
636
635
|
}
|
@@ -725,7 +724,7 @@
|
|
725
724
|
const val = (_o = (_m = (_l = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _l === void 0 ? void 0 : _l.filter((val) => {
|
726
725
|
var _a, _b;
|
727
726
|
const key = val.split('=')[0];
|
728
|
-
return (_b = ((_a = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.channels) !== null && _a !== void 0 ? _a :
|
727
|
+
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);
|
729
728
|
})) === null || _m === void 0 ? void 0 : _m.join('&')) !== null && _o !== void 0 ? _o : '';
|
730
729
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
731
730
|
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 : []);
|
@@ -10156,7 +10155,6 @@ Made in Italy` })));
|
|
10156
10155
|
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"]);
|
10157
10156
|
const { sxpParameter } = useSxpDataSource();
|
10158
10157
|
const { popupDetailData, bffEventReport, isPreview, swiperRef, bffFbReport } = useSxpDataSource();
|
10159
|
-
React.useRef(null);
|
10160
10158
|
const recData = isPost ? rec : popupDetailData;
|
10161
10159
|
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];
|
10162
10160
|
const priceText = React.useCallback((product) => {
|
@@ -10176,13 +10174,14 @@ Made in Italy` })));
|
|
10176
10174
|
display: 'flex'
|
10177
10175
|
}) }),
|
10178
10176
|
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 }),
|
10179
|
-
React.createElement("div",
|
10180
|
-
React.createElement("div",
|
10181
|
-
|
10182
|
-
|
10183
|
-
|
10184
|
-
|
10185
|
-
|
10177
|
+
React.createElement("div", { style: { flex: 1, display: 'flex', flexDirection: 'column', justifyContent: 'space-between' } },
|
10178
|
+
React.createElement("div", null,
|
10179
|
+
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: {
|
10180
|
+
__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)
|
10181
|
+
} }),
|
10182
|
+
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: {
|
10183
|
+
__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)
|
10184
|
+
} })),
|
10186
10185
|
React.createElement("div", { className: css.css({
|
10187
10186
|
display: 'flex',
|
10188
10187
|
alignItems: 'flex-end',
|
@@ -10193,7 +10192,7 @@ Made in Italy` })));
|
|
10193
10192
|
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: {
|
10194
10193
|
__html: setFontForText(priceText(item), commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
|
10195
10194
|
} }),
|
10196
|
-
React.createElement("div", { style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
|
10195
|
+
React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px', maxWidth: '100px' }), dangerouslySetInnerHTML: {
|
10197
10196
|
__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)
|
10198
10197
|
} })))));
|
10199
10198
|
})));
|
@@ -13926,7 +13925,7 @@ Made in Italy` })));
|
|
13926
13925
|
const AniLink$1 = (_a) => {
|
13927
13926
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
13928
13927
|
var { style, recData, ctaTempStyles, index, event, onClick, isExternalLink = false } = _a, props = __rest(_a, ["style", "recData", "ctaTempStyles", "index", "event", "onClick", "isExternalLink"]);
|
13929
|
-
const { ctaEvent } = useSxpDataSource();
|
13928
|
+
const { ctaEvent, setPopupDetailData } = useSxpDataSource();
|
13930
13929
|
const { jumpToWeb } = useEventReport();
|
13931
13930
|
const ref = React.useRef(null);
|
13932
13931
|
const isOnScreen = useOnScreen(ref);
|
@@ -13939,6 +13938,7 @@ Made in Italy` })));
|
|
13939
13938
|
eventSubject: 'clickCta',
|
13940
13939
|
eventDescription: 'User clicked the CTA'
|
13941
13940
|
}, recData, item, index);
|
13941
|
+
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { index }));
|
13942
13942
|
if (isExternalLink) {
|
13943
13943
|
jumpToWeb(recData, product, cta, index);
|
13944
13944
|
}
|
@@ -14339,7 +14339,7 @@ Made in Italy` })));
|
|
14339
14339
|
const AniLinkPopup$1 = (_a) => {
|
14340
14340
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
14341
14341
|
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"]);
|
14342
|
-
const { sxpParameter, globalConfig, ctaEvent } = useSxpDataSource();
|
14342
|
+
const { sxpParameter, globalConfig, ctaEvent, setPopupDetailData } = useSxpDataSource();
|
14343
14343
|
const { jumpToWeb } = useEventReport();
|
14344
14344
|
const [visible, setVisible] = React.useState(true);
|
14345
14345
|
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);
|
@@ -14351,6 +14351,7 @@ Made in Italy` })));
|
|
14351
14351
|
eventSubject: 'clickCta',
|
14352
14352
|
eventDescription: 'User clicked the CTA'
|
14353
14353
|
}, recData, item, index);
|
14354
|
+
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { index }));
|
14354
14355
|
if (isExternalLink) {
|
14355
14356
|
jumpToWeb(recData, product, cta, index);
|
14356
14357
|
}
|
@@ -14380,7 +14381,7 @@ Made in Italy` })));
|
|
14380
14381
|
height: '40px',
|
14381
14382
|
lineHeight: '40px',
|
14382
14383
|
paddingLeft: '6px'
|
14383
|
-
} }, "Cta Title")) : (React.createElement("div", Object.assign({ style: Object.assign(Object.assign({}, style), { position: '
|
14384
|
+
} }, "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.css(aniStyle)}`, onClick: handleTo }),
|
14384
14385
|
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 } },
|
14385
14386
|
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'] })),
|
14386
14387
|
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 }),
|