pb-sxp-ui 1.15.5 → 1.15.7

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.
@@ -21,7 +21,7 @@ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, l
21
21
  React.createElement(SxpDataSourceProvider, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (_b = (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.personalized_recommend) !== null && _b !== void 0 ? _b : maxSize, defaultSize: (_d = (_c = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _c === void 0 ? void 0 : _c.default_recommend) !== null && _d !== void 0 ? _d : defaultSize, hashTagSize: (_f = (_e = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _e === void 0 ? void 0 : _e.hash_tag_size) !== null && _f !== void 0 ? _f : hashTagSize, loadingImage: loadingImage, appDomain: appDomain, enabledMetaConversionApi: enabledMetaConversionApi, utmParameter: data === null || data === void 0 ? void 0 : data.utm_parameter, data: data, dataList: dataList, onUpdateSchema: (d) => setSchema(d), onUpdateChannel: (d) => setChannel(d), render: ({ rtcList, tagList, pageData }) => {
22
22
  var _a;
23
23
  return (React.createElement(React.Fragment, null,
24
- React.createElement(SxpPageRender, Object.assign({ defaultData: data }, (_a = pageData === null || pageData === void 0 ? void 0 : pageData.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER, isAbTestPage: dataList && (dataList === null || dataList === void 0 ? void 0 : dataList.length) > 1 })),
24
+ React.createElement(SxpPageRender, Object.assign({ defaultData: data }, (_a = pageData === null || pageData === void 0 ? void 0 : pageData.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER })),
25
25
  React.createElement(Popup, null)));
26
26
  } })));
27
27
  };
@@ -1,4 +1,4 @@
1
- import { CSSProperties, FC } from 'react';
1
+ import React, { CSSProperties } from 'react';
2
2
  import { RecItemType } from './typing';
3
3
  import './index.less';
4
4
  export type postConfigType = {
@@ -111,7 +111,6 @@ export interface ISxpPageRenderProps {
111
111
  licenseUrl?: string;
112
112
  hashTagRightMargin: number;
113
113
  defaultData?: any;
114
- isAbTestPage?: boolean;
115
114
  }
116
- declare const SxpPageRender: FC<ISxpPageRenderProps>;
117
- export default SxpPageRender;
115
+ declare const _default: React.NamedExoticComponent<ISxpPageRenderProps>;
116
+ export default _default;
@@ -1,4 +1,4 @@
1
- import React, { useMemo, useEffect, useState, useRef, useCallback } from 'react';
1
+ import React, { useMemo, useEffect, useState, useRef, useCallback, memo } from 'react';
2
2
  import { Swiper, SwiperSlide } from 'swiper/react';
3
3
  import ExpandableText from './ExpandableText';
4
4
  import LikeButton from './LikeButton';
@@ -26,7 +26,7 @@ import ConsentPopup from './ConsentPopup';
26
26
  import MultiPosts from '../../../materials/sxp/MultiPosts';
27
27
  import { useEditorDataProvider } from '../../../core/context/EditorDataProvider';
28
28
  import NavBack from './NavBack';
29
- const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, hashTagRightMargin, tagList = [], defaultData, isAbTestPage }) => {
29
+ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, hashTagRightMargin, tagList = [], defaultData }) => {
30
30
  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;
31
31
  const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
32
32
  const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
@@ -554,8 +554,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
554
554
  isReload,
555
555
  renderToggleButton
556
556
  ]);
557
- return (React.createElement(React.Fragment, null, isAbTestPage && loading ? (React.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
558
- React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container', style: Object.assign({}, ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset) && { textUnderlineOffset: `${globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset}px` })) },
557
+ return (React.createElement("div", { id: 'sxp-render' }, (data === null || data === void 0 ? void 0 : data.length) < 1 && loading ? (React.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
558
+ React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement("div", { className: 'clc-sxp-container', style: Object.assign({}, ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset) && { textUnderlineOffset: `${globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset}px` })) },
559
559
  waterFallData && (React.createElement(Navbar, { icon: left, styles: { background: 'rgba(0,0,0,.3)', color: '#fff', top: `${minusHeight}px` }, textStyle: Object.assign(Object.assign({}, (_e = (_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === 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.textStyles) === null || _e === void 0 ? void 0 : _e.hashTagTitle), { color: '#fff' }), onClose: () => {
560
560
  const isEq = isEqual(rtcList, cacheRtcList);
561
561
  if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
@@ -616,4 +616,4 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
616
616
  React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig }),
617
617
  openMultiPosts && (React.createElement(MultiPosts, Object.assign({}, (_x = (_w = (_v = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _v === void 0 ? void 0 : _v[0]) === null || _w === void 0 ? void 0 : _w.item) === null || _x === void 0 ? void 0 : _x.props, (_0 = (_z = (_y = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.item) === null || _0 === void 0 ? void 0 : _0.event, { style: { position: 'fixed', top: 0, left: 0, right: 0 } })))))));
618
618
  };
619
- export default SxpPageRender;
619
+ export default memo(SxpPageRender);
@@ -1,8 +1,12 @@
1
1
  import React, { CSSProperties } from 'react';
2
2
  import './index.less';
3
+ interface richText {
4
+ html: any;
5
+ raw: any;
6
+ }
3
7
  export interface IClickProps {
4
8
  open?: boolean;
5
- content?: string;
9
+ content?: richText | any;
6
10
  style?: Record<string, any>;
7
11
  isTel?: boolean;
8
12
  acceptButton?: {
@@ -34,8 +34,8 @@ const Click = (_a) => {
34
34
  React.createElement("button", { style: acceptButton === null || acceptButton === void 0 ? void 0 : acceptButton.style, onClick: handleClickAccept, dangerouslySetInnerHTML: {
35
35
  __html: setFontForText(acceptButton === null || acceptButton === void 0 ? void 0 : acceptButton.text, acceptButton === null || acceptButton === void 0 ? void 0 : acceptButton.style)
36
36
  } }),
37
- React.createElement("button", { hidden: !showRejectButton, style: rejectButton === null || rejectButton === void 0 ? void 0 : rejectButton.style, onClick: handleClickReject, dangerouslySetInnerHTML: {
37
+ showRejectButton && (React.createElement("button", { style: rejectButton === null || rejectButton === void 0 ? void 0 : rejectButton.style, onClick: handleClickReject, dangerouslySetInnerHTML: {
38
38
  __html: setFontForText(rejectButton === null || rejectButton === void 0 ? void 0 : rejectButton.text, rejectButton === null || rejectButton === void 0 ? void 0 : rejectButton.style)
39
- } }))))))));
39
+ } })))))))));
40
40
  };
41
41
  export default memo(Click);
@@ -1,8 +1,12 @@
1
1
  import React from 'react';
2
2
  import './index.less';
3
+ interface richText {
4
+ html: any;
5
+ raw: any;
6
+ }
3
7
  export interface ISwipeProps {
4
8
  open?: boolean;
5
- content?: string;
9
+ content?: richText | any;
6
10
  style?: Record<string, any>;
7
11
  isTel?: boolean;
8
12
  consentPopupCate?: string;
@@ -1,7 +1,11 @@
1
1
  import React, { CSSProperties } from 'react';
2
2
  import './index.less';
3
+ interface richText {
4
+ html: any;
5
+ raw: any;
6
+ }
3
7
  export interface IConsentDetailProps {
4
- content?: string;
8
+ content?: richText | any;
5
9
  isTel?: boolean;
6
10
  style?: CSSProperties;
7
11
  }
@@ -2,9 +2,10 @@ import { __rest } from "tslib";
2
2
  import React, { memo } from 'react';
3
3
  import './index.less';
4
4
  const ConsentDetail = (_a) => {
5
+ var _b;
5
6
  var { content, isTel, style } = _a, props = __rest(_a, ["content", "isTel", "style"]);
6
7
  return (React.createElement("article", { className: 'consentDetail-article', dangerouslySetInnerHTML: {
7
- __html: typeof content === 'string' ? content : ''
8
+ __html: (_b = content === null || content === void 0 ? void 0 : content.html) !== null && _b !== void 0 ? _b : content
8
9
  }, onClick: (e) => {
9
10
  e.stopPropagation();
10
11
  }, style: style }));
@@ -24,7 +24,7 @@ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, l
24
24
  react_1.default.createElement(SxpDataSourceProvider_1.default, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (_b = (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.personalized_recommend) !== null && _b !== void 0 ? _b : maxSize, defaultSize: (_d = (_c = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _c === void 0 ? void 0 : _c.default_recommend) !== null && _d !== void 0 ? _d : defaultSize, hashTagSize: (_f = (_e = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _e === void 0 ? void 0 : _e.hash_tag_size) !== null && _f !== void 0 ? _f : hashTagSize, loadingImage: loadingImage, appDomain: appDomain, enabledMetaConversionApi: enabledMetaConversionApi, utmParameter: data === null || data === void 0 ? void 0 : data.utm_parameter, data: data, dataList: dataList, onUpdateSchema: (d) => setSchema(d), onUpdateChannel: (d) => setChannel(d), render: ({ rtcList, tagList, pageData }) => {
25
25
  var _a;
26
26
  return (react_1.default.createElement(react_1.default.Fragment, null,
27
- react_1.default.createElement(SxpPageRender_1.default, Object.assign({ defaultData: data }, (_a = pageData === null || pageData === void 0 ? void 0 : pageData.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER, isAbTestPage: dataList && (dataList === null || dataList === void 0 ? void 0 : dataList.length) > 1 })),
27
+ react_1.default.createElement(SxpPageRender_1.default, Object.assign({ defaultData: data }, (_a = pageData === null || pageData === void 0 ? void 0 : pageData.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER })),
28
28
  react_1.default.createElement(Popup_1.default, null)));
29
29
  } })));
30
30
  };
@@ -1,4 +1,4 @@
1
- import { CSSProperties, FC } from 'react';
1
+ import React, { CSSProperties } from 'react';
2
2
  import { RecItemType } from './typing';
3
3
  import './index.less';
4
4
  export type postConfigType = {
@@ -111,7 +111,6 @@ export interface ISxpPageRenderProps {
111
111
  licenseUrl?: string;
112
112
  hashTagRightMargin: number;
113
113
  defaultData?: any;
114
- isAbTestPage?: boolean;
115
114
  }
116
- declare const SxpPageRender: FC<ISxpPageRenderProps>;
117
- export default SxpPageRender;
115
+ declare const _default: React.NamedExoticComponent<ISxpPageRenderProps>;
116
+ export default _default;
@@ -29,7 +29,7 @@ const ConsentPopup_1 = tslib_1.__importDefault(require("./ConsentPopup"));
29
29
  const MultiPosts_1 = tslib_1.__importDefault(require("../../../materials/sxp/MultiPosts"));
30
30
  const EditorDataProvider_1 = require("../../../core/context/EditorDataProvider");
31
31
  const NavBack_1 = tslib_1.__importDefault(require("./NavBack"));
32
- const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, hashTagRightMargin, tagList = [], defaultData, isAbTestPage }) => {
32
+ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, hashTagRightMargin, tagList = [], defaultData }) => {
33
33
  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;
34
34
  const mutedIcon = (0, useIconLink_1.useIconLink)('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
35
35
  const unmutedIcon = (0, useIconLink_1.useIconLink)('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
@@ -557,8 +557,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
557
557
  isReload,
558
558
  renderToggleButton
559
559
  ]);
560
- return (react_1.default.createElement(react_1.default.Fragment, null, isAbTestPage && loading ? (react_1.default.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
561
- react_1.default.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (react_1.default.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container', style: Object.assign({}, ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset) && { textUnderlineOffset: `${globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset}px` })) },
560
+ return (react_1.default.createElement("div", { id: 'sxp-render' }, (data === null || data === void 0 ? void 0 : data.length) < 1 && loading ? (react_1.default.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
561
+ react_1.default.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (react_1.default.createElement("div", { className: 'clc-sxp-container', style: Object.assign({}, ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset) && { textUnderlineOffset: `${globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset}px` })) },
562
562
  waterFallData && (react_1.default.createElement(Navbar_1.default, { icon: left_png_1.default, styles: { background: 'rgba(0,0,0,.3)', color: '#fff', top: `${minusHeight}px` }, textStyle: Object.assign(Object.assign({}, (_e = (_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === 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.textStyles) === null || _e === void 0 ? void 0 : _e.hashTagTitle), { color: '#fff' }), onClose: () => {
563
563
  const isEq = (0, lodash_1.isEqual)(rtcList, cacheRtcList);
564
564
  if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
@@ -619,4 +619,4 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
619
619
  react_1.default.createElement(ConsentPopup_1.default, { resolver: resolver, globalConfig: globalConfig }),
620
620
  openMultiPosts && (react_1.default.createElement(MultiPosts_1.default, Object.assign({}, (_x = (_w = (_v = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _v === void 0 ? void 0 : _v[0]) === null || _w === void 0 ? void 0 : _w.item) === null || _x === void 0 ? void 0 : _x.props, (_0 = (_z = (_y = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.item) === null || _0 === void 0 ? void 0 : _0.event, { style: { position: 'fixed', top: 0, left: 0, right: 0 } })))))));
621
621
  };
622
- exports.default = SxpPageRender;
622
+ exports.default = (0, react_1.memo)(SxpPageRender);
@@ -1,8 +1,12 @@
1
1
  import React, { CSSProperties } from 'react';
2
2
  import './index.less';
3
+ interface richText {
4
+ html: any;
5
+ raw: any;
6
+ }
3
7
  export interface IClickProps {
4
8
  open?: boolean;
5
- content?: string;
9
+ content?: richText | any;
6
10
  style?: Record<string, any>;
7
11
  isTel?: boolean;
8
12
  acceptButton?: {
@@ -36,8 +36,8 @@ const Click = (_a) => {
36
36
  react_1.default.createElement("button", { style: acceptButton === null || acceptButton === void 0 ? void 0 : acceptButton.style, onClick: handleClickAccept, dangerouslySetInnerHTML: {
37
37
  __html: (0, tool_1.setFontForText)(acceptButton === null || acceptButton === void 0 ? void 0 : acceptButton.text, acceptButton === null || acceptButton === void 0 ? void 0 : acceptButton.style)
38
38
  } }),
39
- react_1.default.createElement("button", { hidden: !showRejectButton, style: rejectButton === null || rejectButton === void 0 ? void 0 : rejectButton.style, onClick: handleClickReject, dangerouslySetInnerHTML: {
39
+ showRejectButton && (react_1.default.createElement("button", { style: rejectButton === null || rejectButton === void 0 ? void 0 : rejectButton.style, onClick: handleClickReject, dangerouslySetInnerHTML: {
40
40
  __html: (0, tool_1.setFontForText)(rejectButton === null || rejectButton === void 0 ? void 0 : rejectButton.text, rejectButton === null || rejectButton === void 0 ? void 0 : rejectButton.style)
41
- } }))))))));
41
+ } })))))))));
42
42
  };
43
43
  exports.default = (0, react_1.memo)(Click);
@@ -1,8 +1,12 @@
1
1
  import React from 'react';
2
2
  import './index.less';
3
+ interface richText {
4
+ html: any;
5
+ raw: any;
6
+ }
3
7
  export interface ISwipeProps {
4
8
  open?: boolean;
5
- content?: string;
9
+ content?: richText | any;
6
10
  style?: Record<string, any>;
7
11
  isTel?: boolean;
8
12
  consentPopupCate?: string;
@@ -1,7 +1,11 @@
1
1
  import React, { CSSProperties } from 'react';
2
2
  import './index.less';
3
+ interface richText {
4
+ html: any;
5
+ raw: any;
6
+ }
3
7
  export interface IConsentDetailProps {
4
- content?: string;
8
+ content?: richText | any;
5
9
  isTel?: boolean;
6
10
  style?: CSSProperties;
7
11
  }
@@ -4,9 +4,10 @@ const tslib_1 = require("tslib");
4
4
  const react_1 = tslib_1.__importStar(require("react"));
5
5
  require("./index.less");
6
6
  const ConsentDetail = (_a) => {
7
+ var _b;
7
8
  var { content, isTel, style } = _a, props = tslib_1.__rest(_a, ["content", "isTel", "style"]);
8
9
  return (react_1.default.createElement("article", { className: 'consentDetail-article', dangerouslySetInnerHTML: {
9
- __html: typeof content === 'string' ? content : ''
10
+ __html: (_b = content === null || content === void 0 ? void 0 : content.html) !== null && _b !== void 0 ? _b : content
10
11
  }, onClick: (e) => {
11
12
  e.stopPropagation();
12
13
  }, style: style }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.15.5",
3
+ "version": "1.15.7",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",