pb-sxp-ui 1.19.5 → 1.19.6
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 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -4
- 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 +10 -4
- 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/SxpPageRender/ExpandableText.js +2 -0
- package/es/core/components/SxpPageRender/RenderCard.js +3 -3
- package/es/core/components/SxpPageRender/index.js +1 -1
- package/es/core/context/SxpDataSourceProvider.js +4 -0
- package/lib/core/components/SxpPageRender/ExpandableText.js +2 -0
- package/lib/core/components/SxpPageRender/RenderCard.js +3 -3
- package/lib/core/components/SxpPageRender/index.js +1 -1
- package/lib/core/context/SxpDataSourceProvider.js +4 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -662,6 +662,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
662
662
|
const [chatlabsId, setChatlabsId] = useState();
|
|
663
663
|
const finalPageData = useMemo(() => pageData !== null && pageData !== void 0 ? pageData : data, [pageData, data]);
|
|
664
664
|
const pixelPvStatusRef = useRef(false);
|
|
665
|
+
useEffect(() => {
|
|
666
|
+
var _a, _b;
|
|
667
|
+
setGlobalConfig((_b = (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf) === null || _b === void 0 ? void 0 : _b.globalConfig);
|
|
668
|
+
}, [data]);
|
|
665
669
|
const isShowConsent = useMemo(() => {
|
|
666
670
|
var _a, _b, _c, _d;
|
|
667
671
|
return (((((_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.privacy_necessity) && !isAgreePolicy && !isEditor) || isOpenConsent) &&
|
|
@@ -10508,6 +10512,8 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
|
10508
10512
|
if (!realRef.current || !clampRef.current || !isPost || !text || isShowMore)
|
|
10509
10513
|
return;
|
|
10510
10514
|
requestAnimationFrame(() => {
|
|
10515
|
+
if (!realRef.current)
|
|
10516
|
+
return;
|
|
10511
10517
|
realRef.current.style.position = 'relative';
|
|
10512
10518
|
const realHeight = realRef.current.getBoundingClientRect().height;
|
|
10513
10519
|
const clampHeight = clampRef.current.getBoundingClientRect().height;
|
|
@@ -18805,7 +18811,7 @@ function withBindDataSource(Component) {
|
|
|
18805
18811
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
|
|
18806
18812
|
*
|
|
18807
18813
|
*/
|
|
18808
|
-
const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive, isNineProduct }) => {
|
|
18814
|
+
const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType = [], isActive, isNineProduct }) => {
|
|
18809
18815
|
var _a, _b, _c, _d, _e;
|
|
18810
18816
|
const { schema } = useEditor();
|
|
18811
18817
|
if (!(rec === null || rec === void 0 ? void 0 : rec.video))
|
|
@@ -18824,10 +18830,10 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive,
|
|
|
18824
18830
|
const renderComp = useMemo(() => {
|
|
18825
18831
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
|
|
18826
18832
|
// 如果includesCtaType有值,则只渲染includesCtaType包含的cta类型组件,用于在页面某处只显示某一组件
|
|
18827
|
-
if (includesCtaType && !(includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.includes((_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type)))
|
|
18833
|
+
if ((includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.length) > 0 && !(includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.includes((_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type)))
|
|
18828
18834
|
return;
|
|
18829
18835
|
// 默认不渲染category为cta类型的组件,该类型的组件只用于某一处
|
|
18830
|
-
if (!includesCtaType && ((_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.category) === 'cta')
|
|
18836
|
+
if ((!includesCtaType || (includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.length) === 0) && ((_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.category) === 'cta')
|
|
18831
18837
|
return;
|
|
18832
18838
|
if ((((_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.type) === 'CommodityDiro' && !((_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindProduct)) ||
|
|
18833
18839
|
(((_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.type) === 'Commodity' && !((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct)) ||
|
|
@@ -19278,7 +19284,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
|
19278
19284
|
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _j !== void 0 ? _j : 40}px` } },
|
|
19279
19285
|
React.createElement(Nudge, { nudge: nudge }),
|
|
19280
19286
|
((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) && !isNineProduct ? (React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
|
19281
|
-
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex }))) : null,
|
|
19287
|
+
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, includesCtaType: [] }))) : null,
|
|
19282
19288
|
React.createElement("div", { style: { display: 'flex', flexDirection: 'column' } },
|
|
19283
19289
|
React.createElement(ExpandableText$1, { 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: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.title) !== null && _l !== void 0 ? _l : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }), onChange: onExpandableChange }),
|
|
19284
19290
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex }),
|