pb-sxp-ui 1.14.1 → 1.15.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 +66 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +13 -0
- package/dist/index.js +66 -24
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +5 -5
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +5 -5
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +66 -24
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +5 -5
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/Consent/index.js +8 -2
- package/es/core/components/SxpPageRender/WaterFall/List.js +3 -3
- package/es/core/components/SxpPageRender/WaterFall/index.js +2 -2
- package/es/core/context/SxpDataSourceProvider.js +13 -8
- package/es/core/utils/tool.d.ts +2 -1
- package/es/core/utils/tool.js +38 -14
- package/es/materials/sxp/HashTag/index.d.ts +4 -1
- package/es/materials/sxp/HashTag/material.js +2 -1
- package/es/materials/sxp/HashTag/settingRender.d.ts +0 -2
- package/es/materials/sxp/HashTag/settingRender.js +2 -3
- package/lib/core/components/Consent/index.js +8 -2
- package/lib/core/components/SxpPageRender/WaterFall/List.js +3 -3
- package/lib/core/components/SxpPageRender/WaterFall/index.js +2 -2
- package/lib/core/context/SxpDataSourceProvider.js +12 -7
- package/lib/core/utils/tool.d.ts +2 -1
- package/lib/core/utils/tool.js +39 -14
- package/lib/materials/sxp/HashTag/index.d.ts +4 -1
- package/lib/materials/sxp/HashTag/material.js +2 -1
- package/lib/materials/sxp/HashTag/settingRender.d.ts +0 -2
- package/lib/materials/sxp/HashTag/settingRender.js +2 -3
- package/package.json +1 -1
package/dist/index.css
CHANGED
@@ -1179,6 +1179,19 @@ a:active {
|
|
1179
1179
|
-o-object-fit: cover;
|
1180
1180
|
object-fit: cover;
|
1181
1181
|
}
|
1182
|
+
.list-content-listItem-picture1609 {
|
1183
|
+
position: relative;
|
1184
|
+
width: 100%;
|
1185
|
+
overflow: hidden;
|
1186
|
+
aspect-ratio: 9 / 16;
|
1187
|
+
}
|
1188
|
+
.list-content-listItem-picture1609-img {
|
1189
|
+
position: absolute;
|
1190
|
+
width: 100%;
|
1191
|
+
height: 100%;
|
1192
|
+
-o-object-fit: cover;
|
1193
|
+
object-fit: cover;
|
1194
|
+
}
|
1182
1195
|
.list-content-listItem-info {
|
1183
1196
|
padding: 8px;
|
1184
1197
|
}
|
package/dist/index.js
CHANGED
@@ -135,6 +135,13 @@ const getSxpTokenInfo = (builder, dataId) => __awaiter(void 0, void 0, void 0, f
|
|
135
135
|
return tokenData;
|
136
136
|
});
|
137
137
|
|
138
|
+
/*
|
139
|
+
* @Author : haocanweng@chatlabs.cn
|
140
|
+
* @Date : 2023-08-21 16:58:40
|
141
|
+
* @LastEditors: binruan@chatlabs.com
|
142
|
+
* @LastEditTime: 2024-11-20 18:26:50
|
143
|
+
* @FilePath: \pb-sxp-ui\src\core\utils\tool.ts
|
144
|
+
*/
|
138
145
|
// 生成uuid
|
139
146
|
function uuid(len, radix) {
|
140
147
|
const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
|
@@ -189,8 +196,8 @@ const setFontForText = (textContent, style) => {
|
|
189
196
|
const cnStyle = `font-family:${cn !== null && cn !== void 0 ? cn : 'inherit'}`;
|
190
197
|
const enStyle = `font-family:${en !== null && en !== void 0 ? en : 'inherit'}`;
|
191
198
|
const fn = (str) => {
|
192
|
-
|
193
|
-
|
199
|
+
const chineseStartIndex = str.search(chineseRegex);
|
200
|
+
const englishStartIndex = str.search(englishRegex);
|
194
201
|
if (chineseStartIndex !== -1 && englishStartIndex !== -1 && chineseStartIndex < englishStartIndex) {
|
195
202
|
content += `<span style="${cnStyle}">${str.substring(chineseStartIndex, englishStartIndex)}</span>`;
|
196
203
|
text = str.substring(englishStartIndex, str === null || str === void 0 ? void 0 : str.length);
|
@@ -235,7 +242,7 @@ function getCookie(val) {
|
|
235
242
|
return value !== null && value !== void 0 ? value : '';
|
236
243
|
}
|
237
244
|
function getScreenReader() {
|
238
|
-
|
245
|
+
const userAgent = self.navigator.userAgent;
|
239
246
|
if (!userAgent)
|
240
247
|
return false;
|
241
248
|
return (/TalkBack/i.test(userAgent) ||
|
@@ -245,6 +252,30 @@ function getScreenReader() {
|
|
245
252
|
/JAWS/i.test(userAgent) ||
|
246
253
|
/ChromeVox/i.test(userAgent));
|
247
254
|
}
|
255
|
+
function splitUrlParams(urlParams) {
|
256
|
+
if (!urlParams)
|
257
|
+
return;
|
258
|
+
const indList = [];
|
259
|
+
for (let i = 0; i < urlParams.length; i++) {
|
260
|
+
const item = urlParams[i];
|
261
|
+
const curStr = urlParams.substring(i + 1, urlParams.length);
|
262
|
+
if (item === '&' &&
|
263
|
+
(curStr === null || curStr === void 0 ? void 0 : curStr.indexOf('=')) !== -1 &&
|
264
|
+
((curStr === null || curStr === void 0 ? void 0 : curStr.indexOf('=')) < (curStr === null || curStr === void 0 ? void 0 : curStr.indexOf('&')) || (curStr === null || curStr === void 0 ? void 0 : curStr.indexOf('&')) === -1)) {
|
265
|
+
indList.push(i);
|
266
|
+
}
|
267
|
+
}
|
268
|
+
const splitList = indList.length > 0 ? [] : [urlParams];
|
269
|
+
let lastIndex = 0;
|
270
|
+
indList === null || indList === void 0 ? void 0 : indList.map((i) => {
|
271
|
+
splitList === null || splitList === void 0 ? void 0 : splitList.push(urlParams.substring(lastIndex, i));
|
272
|
+
lastIndex = i + 1;
|
273
|
+
if (i === indList[indList.length - 1] && i < urlParams.length) {
|
274
|
+
splitList === null || splitList === void 0 ? void 0 : splitList.push(urlParams.substring(lastIndex, urlParams.length));
|
275
|
+
}
|
276
|
+
});
|
277
|
+
return splitList !== null && splitList !== void 0 ? splitList : [];
|
278
|
+
}
|
248
279
|
|
249
280
|
function unzip(b64Data) {
|
250
281
|
const strData = atob(b64Data);
|
@@ -498,15 +529,21 @@ var SXP_EVENT_TYPE;
|
|
498
529
|
* @Author: binruan@chatlabs.com
|
499
530
|
* @Date: 2024-06-13 15:16:53
|
500
531
|
* @LastEditors: binruan@chatlabs.com
|
501
|
-
* @LastEditTime:
|
532
|
+
* @LastEditTime: 2025-01-24 14:56:51
|
502
533
|
* @FilePath: \pb-sxp-ui\src\core\components\Consent\index.tsx
|
503
534
|
*
|
504
535
|
*/
|
505
536
|
const Consent$3 = ({ width = window.innerWidth, height = window.innerHeight, privacy_title, privacy_context, privacy_policy_url, privacy_policy_title }) => {
|
506
537
|
const { setIsAgreePolicy, bffEventReport } = useSxpDataSource();
|
507
538
|
const channelObj = useMemo(() => {
|
539
|
+
var _a;
|
508
540
|
const queryString = location.search.slice(1);
|
509
|
-
const params =
|
541
|
+
const params = {};
|
542
|
+
(_a = splitUrlParams(queryString.replace(/\+/g, '%2B'))) === null || _a === void 0 ? void 0 : _a.map((val) => {
|
543
|
+
const key = val.split('=')[0];
|
544
|
+
const value = val.split('=')[1];
|
545
|
+
params[key] = value;
|
546
|
+
});
|
510
547
|
for (const key in params) {
|
511
548
|
params[key] = params[key].replace(/%2B/g, '+');
|
512
549
|
}
|
@@ -698,7 +735,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
698
735
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(channel) });
|
699
736
|
}
|
700
737
|
else if (utmVal) {
|
701
|
-
const val = (_k = (_j = (_h = utmVal
|
738
|
+
const val = (_k = (_j = (_h = splitUrlParams(utmVal)) === null || _h === void 0 ? void 0 : _h.filter((val) => {
|
702
739
|
var _a, _b;
|
703
740
|
const key = val.split('=')[0];
|
704
741
|
return (_b = ((_a = utmParameter === null || utmParameter === void 0 ? void 0 : utmParameter.channels) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.includes(key);
|
@@ -825,7 +862,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
825
862
|
!((_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _a === void 0 ? void 0 : _a[eventName])) {
|
826
863
|
return;
|
827
864
|
}
|
828
|
-
|
865
|
+
const jsonParams = cloneDeep((_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _b === void 0 ? void 0 : _b[eventName]);
|
829
866
|
const urlParams = new URLSearchParams(window.location.search);
|
830
867
|
const fbclid = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('fbclid');
|
831
868
|
const fix_par = {
|
@@ -907,7 +944,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
907
944
|
if (!utmVal || !isShowTag)
|
908
945
|
return;
|
909
946
|
try {
|
910
|
-
const val = (_10 = (_9 = (_8 = utmVal
|
947
|
+
const val = (_10 = (_9 = (_8 = splitUrlParams(utmVal)) === null || _8 === void 0 ? void 0 : _8.filter((val) => {
|
911
948
|
var _a, _b;
|
912
949
|
const key = val.split('=')[0];
|
913
950
|
return (_b = ((_a = utmParameter === null || utmParameter === void 0 ? void 0 : utmParameter.channels) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.includes(key);
|
@@ -942,9 +979,14 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
942
979
|
});
|
943
980
|
}, [bffEventReport, isFromHashtag]);
|
944
981
|
const h5EnterLink = useCallback(() => {
|
945
|
-
var _a, _b;
|
982
|
+
var _a, _b, _c;
|
946
983
|
const queryString = location.search.slice(1);
|
947
|
-
const params =
|
984
|
+
const params = {};
|
985
|
+
(_a = splitUrlParams(queryString.replace(/\+/g, '%2B'))) === null || _a === void 0 ? void 0 : _a.map((val) => {
|
986
|
+
const key = val.split('=')[0];
|
987
|
+
const value = val.split('=')[1];
|
988
|
+
params[key] = value;
|
989
|
+
});
|
948
990
|
for (const key in params) {
|
949
991
|
params[key] = params[key].replace(/%2B/g, '+');
|
950
992
|
}
|
@@ -962,7 +1004,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
962
1004
|
utmContent: getVal('utm_content'),
|
963
1005
|
enterTime: Math.floor(time / 1000) + '',
|
964
1006
|
requestId: null,
|
965
|
-
enterUrl: (
|
1007
|
+
enterUrl: (_c = (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href) !== null && _c !== void 0 ? _c : '',
|
966
1008
|
clSource: getVal('cl_source')
|
967
1009
|
},
|
968
1010
|
reportLayId: false
|
@@ -13255,7 +13297,7 @@ const MultiCommodityDiroNew = createMaterial(MultiCommodityDiroNewComponent, {
|
|
13255
13297
|
* @Author: binruan@chatlabs.com
|
13256
13298
|
* @Date: 2024-04-07 14:07:12
|
13257
13299
|
* @LastEditors: binruan@chatlabs.com
|
13258
|
-
* @LastEditTime:
|
13300
|
+
* @LastEditTime: 2025-02-17 17:16:56
|
13259
13301
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\HashTag\settingRender.tsx
|
13260
13302
|
*
|
13261
13303
|
*/
|
@@ -13280,10 +13322,9 @@ var settingRender$5 = [
|
|
13280
13322
|
addonAfter: 'px'
|
13281
13323
|
},
|
13282
13324
|
{
|
13283
|
-
type: '
|
13325
|
+
type: 'HashTagFixedSize',
|
13284
13326
|
label: '固定宽高',
|
13285
|
-
name: ['props', 'openFixedSize']
|
13286
|
-
initialValue: true
|
13327
|
+
name: ['props', 'openFixedSize']
|
13287
13328
|
}
|
13288
13329
|
]
|
13289
13330
|
},
|
@@ -15091,7 +15132,7 @@ var img$4 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeA
|
|
15091
15132
|
|
15092
15133
|
const WaterfallFlowItem = (props) => {
|
15093
15134
|
var _a;
|
15094
|
-
const { rec, index, list, reportTagsView, textStyles, space } = props;
|
15135
|
+
const { rec, index, list, reportTagsView, textStyles, space, openFixedSize } = props;
|
15095
15136
|
const { swiperRef, setRtcList, setOpenHashtag, sxpParameter, globalConfig } = useSxpDataSource();
|
15096
15137
|
const [showVideo, setShowVideo] = useState(false);
|
15097
15138
|
const imgDom = useRef(null);
|
@@ -15200,11 +15241,11 @@ const WaterfallFlowItem = (props) => {
|
|
15200
15241
|
}, 0);
|
15201
15242
|
};
|
15202
15243
|
return (React.createElement("div", { ref: ref, className: 'list-content-listItem', key: index, onClick: handleClickToDetail, style: { marginBottom: space } },
|
15203
|
-
React.createElement("div", { className: 'list-content-listItem-picture' },
|
15244
|
+
React.createElement("div", { className: (openFixedSize === null || openFixedSize === void 0 ? void 0 : openFixedSize.ratio) === '1' ? 'list-content-listItem-picture' : 'list-content-listItem-picture1609' },
|
15204
15245
|
showVideo && (React.createElement("div", { style: { display: 'none' } },
|
15205
15246
|
React.createElement("video", { ref: videoDom, crossOrigin: 'anonymous', className: 'list-content-listItem-picture-img' }),
|
15206
15247
|
React.createElement("canvas", { ref: canvasRef }))),
|
15207
|
-
React.createElement(FormatImage$1, { loading: 'lazy', className: 'list-content-listItem-picture-img', ref: imgDom })),
|
15248
|
+
React.createElement(FormatImage$1, { loading: 'lazy', className: (openFixedSize === null || openFixedSize === void 0 ? void 0 : openFixedSize.ratio) === '1' ? 'list-content-listItem-picture-img' : 'list-content-listItem-picture1609-img', ref: imgDom })),
|
15208
15249
|
React.createElement("div", { className: 'list-content-listItem-info' },
|
15209
15250
|
React.createElement("div", { className: `${'list-content-listItem-info-title'} ${priceText ? 'list-content-listItem-info-nowrap' : ''}`, style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.title, dangerouslySetInnerHTML: {
|
15210
15251
|
__html: setFontForText(title, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title)
|
@@ -15315,12 +15356,12 @@ function WaterfallList(_a) {
|
|
15315
15356
|
* @Author: binruan@chatlabs.com
|
15316
15357
|
* @Date: 2024-01-10 10:58:24
|
15317
15358
|
* @LastEditors: binruan@chatlabs.com
|
15318
|
-
* @LastEditTime:
|
15359
|
+
* @LastEditTime: 2025-02-17 16:25:30
|
15319
15360
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
15320
15361
|
*
|
15321
15362
|
*/
|
15322
15363
|
const WaterFall = (props) => {
|
15323
|
-
var _a;
|
15364
|
+
var _a, _b;
|
15324
15365
|
const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport, themeTag, selectTag, bffFbReport } = useSxpDataSource();
|
15325
15366
|
const { backMainFeed } = useEventReport();
|
15326
15367
|
const modalEleRef = useRef(null);
|
@@ -15409,7 +15450,7 @@ const WaterFall = (props) => {
|
|
15409
15450
|
display: openHashtag ? 'block' : 'none'
|
15410
15451
|
} },
|
15411
15452
|
React.createElement(Navbar$1, { icon: img$4, styles: { top: '32px' }, textStyle: (_a = props === null || props === void 0 ? void 0 : props.textStyles) === null || _a === void 0 ? void 0 : _a.hashTagTitle, onClose: handleClose }),
|
15412
|
-
(props === null || props === void 0 ? void 0 : props.openFixedSize) === true || (props === null || props === void 0 ? void 0 : props.openFixedSize) === undefined ? (React.createElement(WaterfallList, Object.assign({ key: waterFallData, reportTagsView: reportTagsView }, props))) : (React.createElement(WaterfallList$1, Object.assign({ key: waterFallData, reportTagsView: reportTagsView }, props)))), modalEleRef.current);
|
15453
|
+
((_b = props === null || props === void 0 ? void 0 : props.openFixedSize) === null || _b === void 0 ? void 0 : _b.open) === true || (props === null || props === void 0 ? void 0 : props.openFixedSize) === undefined ? (React.createElement(WaterfallList, Object.assign({ key: waterFallData, reportTagsView: reportTagsView }, props))) : (React.createElement(WaterfallList$1, Object.assign({ key: waterFallData, reportTagsView: reportTagsView }, props)))), modalEleRef.current);
|
15413
15454
|
};
|
15414
15455
|
var WaterFall$1 = memo(WaterFall);
|
15415
15456
|
|
@@ -15417,7 +15458,7 @@ var WaterFall$1 = memo(WaterFall);
|
|
15417
15458
|
* @Author: binruan@chatlabs.com
|
15418
15459
|
* @Date: 2024-01-15 19:03:09
|
15419
15460
|
* @LastEditors: binruan@chatlabs.com
|
15420
|
-
* @LastEditTime:
|
15461
|
+
* @LastEditTime: 2025-02-17 16:24:14
|
15421
15462
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\HashTag\index.tsx
|
15422
15463
|
*
|
15423
15464
|
*/
|
@@ -15430,7 +15471,7 @@ var HashTagComponent = memo(HashTag$1);
|
|
15430
15471
|
* @Author: binruan@chatlabs.com
|
15431
15472
|
* @Date: 2023-07-28 18:29:57
|
15432
15473
|
* @LastEditors: binruan@chatlabs.com
|
15433
|
-
* @LastEditTime:
|
15474
|
+
* @LastEditTime: 2025-02-17 17:45:40
|
15434
15475
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\HashTag\material.tsx
|
15435
15476
|
*
|
15436
15477
|
*/
|
@@ -15489,7 +15530,8 @@ const HashTag = createMaterial(HashTagComponent, {
|
|
15489
15530
|
paddingLeft: 20,
|
15490
15531
|
paddingRight: 20,
|
15491
15532
|
paddingBottom: 20
|
15492
|
-
}
|
15533
|
+
},
|
15534
|
+
openFixedSize: { open: true, ratio: '1' }
|
15493
15535
|
}
|
15494
15536
|
},
|
15495
15537
|
w: 100,
|