pb-sxp-ui 1.0.15 → 1.0.16
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 +10 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -0
- package/dist/index.js +10 -8
- 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 +10 -8
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +2 -2
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/ExpandableText.js +1 -2
- package/es/core/components/SxpPageRender/PictureGroup/Picture.js +2 -1
- package/es/core/components/SxpPageRender/index.js +2 -2
- package/lib/core/components/SxpPageRender/ExpandableText.js +1 -2
- package/lib/core/components/SxpPageRender/PictureGroup/Picture.js +2 -1
- package/lib/core/components/SxpPageRender/index.js +2 -2
- package/package.json +1 -1
@@ -22,7 +22,6 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
22
22
|
const multiRow = useRef(null);
|
23
23
|
const handleClick = useCallback(() => {
|
24
24
|
setIsShowMore(!isShowMore);
|
25
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(!isShowMore);
|
26
25
|
}, [isShowMore, onChange]);
|
27
26
|
const renderText = useMemo(() => {
|
28
27
|
return !isShowMore && text.length > maxStr ? limitTextLastWholeWord(text, maxStr) + '...' : text;
|
@@ -32,7 +31,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
32
31
|
return (React.createElement("div", { className: className, style: Object.assign({}, style), hidden: !text || text === '' },
|
33
32
|
React.createElement("div", { ref: multiRow, style: {
|
34
33
|
overflow: 'hidden',
|
35
|
-
WebkitLineClamp: isShowMore ? '' : lineClamp,
|
34
|
+
WebkitLineClamp: !isPost || isShowMore ? '' : lineClamp,
|
36
35
|
textOverflow: 'ellipsis',
|
37
36
|
display: '-webkit-box',
|
38
37
|
WebkitBoxOrient: 'vertical',
|
@@ -6,7 +6,8 @@ const Picture = (props) => {
|
|
6
6
|
const imgDom = useRef(null);
|
7
7
|
const { sxpParameter } = useSxpDataSource();
|
8
8
|
const getAvifToPng = useCallback((src) => {
|
9
|
-
return src
|
9
|
+
return src;
|
10
|
+
return src.indexOf('avif') !== -1 ? `${src}?imageMogr2/format/webm` : src;
|
10
11
|
}, []);
|
11
12
|
useEffect(() => {
|
12
13
|
if (imgDom.current === null || src === '') {
|
@@ -192,8 +192,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
192
192
|
React.createElement(Nudge, { nudge: nudge }),
|
193
193
|
React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
194
194
|
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
|
195
|
-
React.createElement("div",
|
196
|
-
React.createElement(ExpandableText, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: Object.assign(
|
195
|
+
React.createElement("div", null,
|
196
|
+
React.createElement(ExpandableText, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: Object.assign({}, descStyle), onChange: onExpandableChange }),
|
197
197
|
React.createElement(Hashtag, { index: activeIndex, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec.video) === null || _g === void 0 ? void 0 : _g.url) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle })))));
|
198
198
|
}
|
199
199
|
return null;
|
@@ -25,7 +25,6 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
25
25
|
const multiRow = (0, react_1.useRef)(null);
|
26
26
|
const handleClick = (0, react_1.useCallback)(() => {
|
27
27
|
setIsShowMore(!isShowMore);
|
28
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(!isShowMore);
|
29
28
|
}, [isShowMore, onChange]);
|
30
29
|
const renderText = (0, react_1.useMemo)(() => {
|
31
30
|
return !isShowMore && text.length > maxStr ? limitTextLastWholeWord(text, maxStr) + '...' : text;
|
@@ -35,7 +34,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
35
34
|
return (react_1.default.createElement("div", { className: className, style: Object.assign({}, style), hidden: !text || text === '' },
|
36
35
|
react_1.default.createElement("div", { ref: multiRow, style: {
|
37
36
|
overflow: 'hidden',
|
38
|
-
WebkitLineClamp: isShowMore ? '' : lineClamp,
|
37
|
+
WebkitLineClamp: !isPost || isShowMore ? '' : lineClamp,
|
39
38
|
textOverflow: 'ellipsis',
|
40
39
|
display: '-webkit-box',
|
41
40
|
WebkitBoxOrient: 'vertical',
|
@@ -9,7 +9,8 @@ const Picture = (props) => {
|
|
9
9
|
const imgDom = (0, react_1.useRef)(null);
|
10
10
|
const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
11
11
|
const getAvifToPng = (0, react_1.useCallback)((src) => {
|
12
|
-
return src
|
12
|
+
return src;
|
13
|
+
return src.indexOf('avif') !== -1 ? `${src}?imageMogr2/format/webm` : src;
|
13
14
|
}, []);
|
14
15
|
(0, react_1.useEffect)(() => {
|
15
16
|
if (imgDom.current === null || src === '') {
|
@@ -195,8 +195,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
195
195
|
react_1.default.createElement(Nudge_1.default, { nudge: nudge }),
|
196
196
|
react_1.default.createElement("div", { className: 'clc-sxp-bottom-card' },
|
197
197
|
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
|
198
|
-
react_1.default.createElement("div",
|
199
|
-
react_1.default.createElement(ExpandableText_1.default, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: Object.assign(
|
198
|
+
react_1.default.createElement("div", null,
|
199
|
+
react_1.default.createElement(ExpandableText_1.default, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: Object.assign({}, descStyle), onChange: onExpandableChange }),
|
200
200
|
react_1.default.createElement(Hashtag_1.default, { index: activeIndex, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec.video) === null || _g === void 0 ? void 0 : _g.url) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle })))));
|
201
201
|
}
|
202
202
|
return null;
|