pb-sxp-ui 1.7.2 → 1.7.4
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 +147 -82
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +147 -82
- 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 +147 -82
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/PictureGroup/Picture.d.ts +1 -1
- package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +5 -2
- package/es/core/components/SxpPageRender/PictureGroup/index.js +26 -6
- package/es/core/components/SxpPageRender/RenderCard.js +6 -1
- package/es/core/components/SxpPageRender/VideoWidget/index.js +21 -15
- package/es/core/components/SxpPageRender/WaterFall/List.js +3 -2
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +3 -2
- package/es/core/components/SxpPageRender/index.d.ts +1 -0
- package/es/core/components/SxpPageRender/index.js +36 -28
- package/es/core/context/SxpDataSourceProvider.js +9 -6
- package/es/core/utils/materials.d.ts +7 -1
- package/es/core/utils/materials.js +5 -2
- package/es/core/utils/tool.d.ts +2 -1
- package/es/core/utils/tool.js +11 -1
- package/es/materials/sxp/cta/AniLink/settingRender.d.ts +11 -0
- package/es/materials/sxp/cta/AniLink/settingRender.js +6 -0
- package/es/materials/sxp/cta/AniLinkPopup/settingRender.d.ts +1 -1
- package/es/materials/sxp/cta/AniLinkPopup/settingRender.js +6 -0
- package/es/materials/sxp/popup/CommodityDetail/index.js +3 -2
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +3 -2
- package/es/materials/sxp/popup/CommodityList/index.js +5 -4
- package/es/materials/sxp/template/components/settingRender.d.ts +1 -1
- package/es/materials/sxp/template/components/settingRender.js +6 -0
- package/lib/core/components/SxpPageRender/PictureGroup/Picture.d.ts +1 -1
- package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +5 -2
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +25 -6
- package/lib/core/components/SxpPageRender/RenderCard.js +6 -1
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +20 -15
- package/lib/core/components/SxpPageRender/WaterFall/List.js +3 -2
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +3 -2
- package/lib/core/components/SxpPageRender/index.d.ts +1 -0
- package/lib/core/components/SxpPageRender/index.js +36 -28
- package/lib/core/context/SxpDataSourceProvider.js +9 -6
- package/lib/core/utils/materials.d.ts +7 -1
- package/lib/core/utils/materials.js +5 -2
- package/lib/core/utils/tool.d.ts +2 -1
- package/lib/core/utils/tool.js +12 -1
- package/lib/materials/sxp/cta/AniLink/settingRender.d.ts +11 -0
- package/lib/materials/sxp/cta/AniLink/settingRender.js +6 -0
- package/lib/materials/sxp/cta/AniLinkPopup/settingRender.d.ts +1 -1
- package/lib/materials/sxp/cta/AniLinkPopup/settingRender.js +6 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.js +3 -2
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +3 -2
- package/lib/materials/sxp/popup/CommodityList/index.js +5 -4
- package/lib/materials/sxp/template/components/settingRender.d.ts +1 -1
- package/lib/materials/sxp/template/components/settingRender.js +6 -0
- package/package.json +1 -1
package/lib/core/utils/tool.d.ts
CHANGED
@@ -11,4 +11,5 @@ declare function getBrowserInfo(): string | null;
|
|
11
11
|
declare function getSystem(): string | null;
|
12
12
|
declare function getDevice(): string | null;
|
13
13
|
declare function getCookie(val: string): string;
|
14
|
-
|
14
|
+
declare const getResFileSizeFromSrc: (imageSrc?: string) => "" | Promise<string>;
|
15
|
+
export { uuid, getIndexByblockType, getBrowserInfo, getDevice, getSystem, getCookie, getResFileSizeFromSrc };
|
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.getCookie = exports.getSystem = exports.getDevice = exports.getBrowserInfo = exports.getIndexByblockType = exports.uuid = exports.setFontForText = exports.getUid = exports.generateRandomString = void 0;
|
3
|
+
exports.getResFileSizeFromSrc = 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('');
|
@@ -168,3 +168,14 @@ function getCookie(val) {
|
|
168
168
|
return value !== null && value !== void 0 ? value : '';
|
169
169
|
}
|
170
170
|
exports.getCookie = getCookie;
|
171
|
+
const getResFileSizeFromSrc = (imageSrc) => {
|
172
|
+
if (!imageSrc)
|
173
|
+
return '';
|
174
|
+
return fetch(imageSrc)
|
175
|
+
.then((response) => response.blob())
|
176
|
+
.then((blob) => {
|
177
|
+
const fileSizeInMB = blob.size / (1024 * 1024);
|
178
|
+
return fileSizeInMB.toFixed(2) + '';
|
179
|
+
});
|
180
|
+
};
|
181
|
+
exports.getResFileSizeFromSrc = getResFileSizeFromSrc;
|
@@ -9,6 +9,7 @@ declare const _default: ({
|
|
9
9
|
addonAfter: string;
|
10
10
|
}[];
|
11
11
|
name?: undefined;
|
12
|
+
addonAfter?: undefined;
|
12
13
|
direction?: undefined;
|
13
14
|
} | {
|
14
15
|
type: string;
|
@@ -25,12 +26,21 @@ declare const _default: ({
|
|
25
26
|
max: number;
|
26
27
|
})[];
|
27
28
|
name?: undefined;
|
29
|
+
addonAfter?: undefined;
|
28
30
|
direction?: undefined;
|
29
31
|
} | {
|
30
32
|
type: string;
|
31
33
|
label: string;
|
32
34
|
name: string[];
|
33
35
|
child?: undefined;
|
36
|
+
addonAfter?: undefined;
|
37
|
+
direction?: undefined;
|
38
|
+
} | {
|
39
|
+
type: string;
|
40
|
+
label: string;
|
41
|
+
name: string[];
|
42
|
+
addonAfter: string;
|
43
|
+
child?: undefined;
|
34
44
|
direction?: undefined;
|
35
45
|
} | {
|
36
46
|
type: string;
|
@@ -38,6 +48,7 @@ declare const _default: ({
|
|
38
48
|
label: string;
|
39
49
|
direction: string;
|
40
50
|
child?: undefined;
|
51
|
+
addonAfter?: undefined;
|
41
52
|
})[];
|
42
53
|
} | {
|
43
54
|
title: string;
|
@@ -70,7 +70,8 @@ const CommodityDetail = (_a) => {
|
|
70
70
|
const priceText = (0, materials_1.getPriceText)({
|
71
71
|
product: product,
|
72
72
|
enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
|
73
|
-
globalConfig
|
73
|
+
globalConfig,
|
74
|
+
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
74
75
|
});
|
75
76
|
const width = (isPreview ? 375 : (_u = style === null || style === void 0 ? void 0 : style.width) !== null && _u !== void 0 ? _u : window.innerWidth) - ((_v = popupBg === null || popupBg === void 0 ? void 0 : popupBg.horizontalMargin) !== null && _v !== void 0 ? _v : 0) * 2;
|
76
77
|
const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
|
@@ -84,7 +85,7 @@ const CommodityDetail = (_a) => {
|
|
84
85
|
__html: (0, tool_1.setFontForText)((_b = product === null || product === void 0 ? void 0 : product.title) !== null && _b !== void 0 ? _b : 'Pendant in Yellow Gold with Diamonds, Medium', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
|
85
86
|
} }),
|
86
87
|
react_1.default.createElement("div", { className: 'pb-commondity-content-price', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price), hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price), dangerouslySetInnerHTML: {
|
87
|
-
__html:
|
88
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
88
89
|
} }),
|
89
90
|
react_1.default.createElement("div", { hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo), dangerouslySetInnerHTML: {
|
90
91
|
__html: (0, tool_1.setFontForText)((_c = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _c !== void 0 ? _c : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
|
@@ -76,7 +76,8 @@ const CommodityDetailDiroNew = (_a) => {
|
|
76
76
|
const priceText = (0, materials_1.getPriceText)({
|
77
77
|
product,
|
78
78
|
enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
|
79
|
-
globalConfig
|
79
|
+
globalConfig,
|
80
|
+
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
80
81
|
});
|
81
82
|
const width = (isPreview ? 375 : (_u = style === null || style === void 0 ? void 0 : style.width) !== null && _u !== void 0 ? _u : window.innerWidth) - ((_v = popupBg === null || popupBg === void 0 ? void 0 : popupBg.horizontalMargin) !== null && _v !== void 0 ? _v : 0) * 2;
|
82
83
|
const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
|
@@ -190,7 +191,7 @@ Made in Italy` })));
|
|
190
191
|
} })),
|
191
192
|
react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
|
192
193
|
react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price), dangerouslySetInnerHTML: {
|
193
|
-
__html:
|
194
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
194
195
|
} }),
|
195
196
|
react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo), dangerouslySetInnerHTML: {
|
196
197
|
__html: (0, tool_1.setFontForText)((_2 = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _2 !== void 0 ? _2 : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
|
@@ -24,7 +24,8 @@ const CommodityList = (_a) => {
|
|
24
24
|
return (0, materials_1.getPriceText)({
|
25
25
|
product,
|
26
26
|
enableFormattedPrice: (_a = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
27
|
-
globalConfig
|
27
|
+
globalConfig,
|
28
|
+
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
28
29
|
});
|
29
30
|
}, [(_d = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _d === void 0 ? void 0 : _d.enableFormattedPrice, globalConfig]);
|
30
31
|
const handleClick = (0, lodash_1.throttle)((item, multiCheckIndex) => {
|
@@ -49,7 +50,7 @@ const CommodityList = (_a) => {
|
|
49
50
|
});
|
50
51
|
}, []);
|
51
52
|
return (react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign(Object.assign({}, style), { display: 'flex', flexDirection: 'column', gap: '10px', padding: '0 20px', marginTop: '50px', boxSizing: 'border-box' })) }, product === null || product === void 0 ? void 0 : product.map((item, index) => {
|
52
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
53
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
53
54
|
return (react_1.default.createElement(react_1.default.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (react_1.default.createElement("div", Object.assign({ key: index }, props, { className: (0, css_1.css)({
|
54
55
|
display: 'flex'
|
55
56
|
}), onClick: () => handleClick(item, index) }),
|
@@ -76,10 +77,10 @@ const CommodityList = (_a) => {
|
|
76
77
|
}) },
|
77
78
|
react_1.default.createElement("div", null,
|
78
79
|
react_1.default.createElement("div", { style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.price), dangerouslySetInnerHTML: {
|
79
|
-
__html: (
|
80
|
+
__html: (_j = priceText(item)) !== null && _j !== void 0 ? _j : ''
|
80
81
|
} })),
|
81
82
|
react_1.default.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
|
82
|
-
__html: (0, tool_1.setFontForText)((
|
83
|
+
__html: (0, tool_1.setFontForText)((_l = (_k = item === null || item === void 0 ? void 0 : item.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now', buttonStyle)
|
83
84
|
} })))))));
|
84
85
|
})));
|
85
86
|
};
|