pb-sxp-ui 1.15.6 → 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.
@@ -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 = {
@@ -112,5 +112,5 @@ export interface ISxpPageRenderProps {
112
112
  hashTagRightMargin: number;
113
113
  defaultData?: any;
114
114
  }
115
- declare const SxpPageRender: FC<ISxpPageRenderProps>;
116
- 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';
@@ -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, (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", { 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?: {
@@ -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 }));
@@ -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 = {
@@ -112,5 +112,5 @@ export interface ISxpPageRenderProps {
112
112
  hashTagRightMargin: number;
113
113
  defaultData?: any;
114
114
  }
115
- declare const SxpPageRender: FC<ISxpPageRenderProps>;
116
- export default SxpPageRender;
115
+ declare const _default: React.NamedExoticComponent<ISxpPageRenderProps>;
116
+ export default _default;
@@ -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, (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", { 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?: {
@@ -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.6",
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",