pb-sxp-ui 1.15.4 → 1.15.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.
Files changed (31) hide show
  1. package/dist/index.cjs +42 -39
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +42 -39
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.cjs +6 -6
  6. package/dist/index.min.cjs.map +1 -1
  7. package/dist/index.min.js +6 -6
  8. package/dist/index.min.js.map +1 -1
  9. package/dist/pb-ui.js +42 -39
  10. package/dist/pb-ui.js.map +1 -1
  11. package/dist/pb-ui.min.js +6 -6
  12. package/dist/pb-ui.min.js.map +1 -1
  13. package/es/core/components/SxpPageRender/index.js +3 -2
  14. package/es/core/context/SxpDataSourceProvider.js +1 -1
  15. package/es/materials/sxp/consentPopup/Click/index.d.ts +1 -0
  16. package/es/materials/sxp/consentPopup/Click/index.js +15 -11
  17. package/es/materials/sxp/consentPopup/Click/settingRender.js +5 -0
  18. package/es/materials/sxp/consentPopup/Swipe/index.d.ts +0 -1
  19. package/es/materials/sxp/consentPopup/Swipe/index.js +12 -13
  20. package/es/materials/sxp/consentPopup/Swipe/material.js +1 -2
  21. package/es/materials/sxp/consentPopup/Swipe/settingRender.js +0 -5
  22. package/lib/core/components/SxpPageRender/index.js +3 -2
  23. package/lib/core/context/SxpDataSourceProvider.js +1 -1
  24. package/lib/materials/sxp/consentPopup/Click/index.d.ts +1 -0
  25. package/lib/materials/sxp/consentPopup/Click/index.js +15 -11
  26. package/lib/materials/sxp/consentPopup/Click/settingRender.js +5 -0
  27. package/lib/materials/sxp/consentPopup/Swipe/index.d.ts +0 -1
  28. package/lib/materials/sxp/consentPopup/Swipe/index.js +12 -13
  29. package/lib/materials/sxp/consentPopup/Swipe/material.js +1 -2
  30. package/lib/materials/sxp/consentPopup/Swipe/settingRender.js +0 -5
  31. package/package.json +1 -1
@@ -554,7 +554,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
554
554
  isReload,
555
555
  renderToggleButton
556
556
  ]);
557
- return (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(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` })) },
558
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: () => {
559
560
  const isEq = isEqual(rtcList, cacheRtcList);
560
561
  if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
@@ -613,6 +614,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
613
614
  renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))),
614
615
  React.createElement(WaterFall, Object.assign({}, (_u = (_t = (_s = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _s === void 0 ? void 0 : _s[0]) === null || _t === void 0 ? void 0 : _t.item) === null || _u === void 0 ? void 0 : _u.props)),
615
616
  React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig }),
616
- 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 } })))));
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 } })))))));
617
618
  };
618
619
  export default SxpPageRender;
@@ -21,7 +21,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
21
21
  var _a, _b, _c, _d, _e;
22
22
  const [rtcList, setRtcList] = useState([]);
23
23
  const [tagList, setTagList] = useState([]);
24
- const [loading, setLoading] = useState(false);
24
+ const [loading, setLoading] = useState(true);
25
25
  const [curReqInfo, setCurReqInfo] = useState({ rtc: '', requestId: '' });
26
26
  const swiperRef = useRef(null);
27
27
  const isInit = useRef(false);
@@ -14,6 +14,7 @@ export interface IClickProps {
14
14
  style?: CSSProperties;
15
15
  };
16
16
  consentPopupCate?: string;
17
+ showRejectButton?: boolean;
17
18
  }
18
19
  declare const _default: React.NamedExoticComponent<IClickProps>;
19
20
  export default _default;
@@ -6,32 +6,36 @@ import tel from './tel.png';
6
6
  import { setFontForText } from '../../../../core/utils/tool';
7
7
  import { useSxpDataSource } from '../../../../core/hooks';
8
8
  const Click = (_a) => {
9
- var { isTel, open, content, style, consentPopupCate, acceptButton, rejectButton } = _a, props = __rest(_a, ["isTel", "open", "content", "style", "consentPopupCate", "acceptButton", "rejectButton"]);
9
+ var { isTel, open, content, style, consentPopupCate, acceptButton, rejectButton, showRejectButton } = _a, props = __rest(_a, ["isTel", "open", "content", "style", "consentPopupCate", "acceptButton", "rejectButton", "showRejectButton"]);
10
10
  const { getAccount, accountSonsent } = useSxpDataSource();
11
- const [consentResult, setConsentResult] = useState(false);
11
+ const [consentResult, setConsentResult] = useState(true);
12
12
  const handleGetAccount = () => __awaiter(void 0, void 0, void 0, function* () {
13
13
  const res = yield (getAccount === null || getAccount === void 0 ? void 0 : getAccount());
14
14
  setConsentResult(res);
15
15
  });
16
- useEffect(() => {
17
- handleGetAccount();
18
- }, []);
19
16
  const visivle = useMemo(() => {
20
17
  return consentPopupCate || (open && style && !consentResult);
21
18
  }, [consentPopupCate, open, style, consentResult]);
22
- const handleClick = (v) => {
23
- accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(v);
24
- setConsentResult(true);
19
+ useEffect(() => {
20
+ !consentPopupCate && open && style && handleGetAccount();
21
+ }, []);
22
+ const handleClickAccept = () => __awaiter(void 0, void 0, void 0, function* () {
23
+ const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
24
+ if (res)
25
+ setConsentResult(true);
26
+ });
27
+ const handleClickReject = () => {
28
+ history === null || history === void 0 ? void 0 : history.back();
25
29
  };
26
30
  return (React.createElement(React.Fragment, null, isTel ? (React.createElement("img", { src: tel, style: { objectFit: 'cover', width: '100%', height: '100%' } })) : (React.createElement(React.Fragment, null, visivle && (React.createElement("div", { className: 'consentPopupClick' },
27
31
  React.createElement("div", { className: 'consentPopupClick-container', style: style },
28
32
  React.createElement("div", { className: 'consentPopupClick-container-content' },
29
33
  React.createElement(ConsentDetail, { content: content, style: { padding: 0 } })),
30
- React.createElement("button", { style: acceptButton === null || acceptButton === void 0 ? void 0 : acceptButton.style, onClick: () => handleClick(true), dangerouslySetInnerHTML: {
34
+ React.createElement("button", { style: acceptButton === null || acceptButton === void 0 ? void 0 : acceptButton.style, onClick: handleClickAccept, dangerouslySetInnerHTML: {
31
35
  __html: setFontForText(acceptButton === null || acceptButton === void 0 ? void 0 : acceptButton.text, acceptButton === null || acceptButton === void 0 ? void 0 : acceptButton.style)
32
36
  } }),
33
- React.createElement("button", { style: rejectButton === null || rejectButton === void 0 ? void 0 : rejectButton.style, onClick: () => handleClick(false), dangerouslySetInnerHTML: {
37
+ showRejectButton && (React.createElement("button", { style: rejectButton === null || rejectButton === void 0 ? void 0 : rejectButton.style, onClick: handleClickReject, dangerouslySetInnerHTML: {
34
38
  __html: setFontForText(rejectButton === null || rejectButton === void 0 ? void 0 : rejectButton.text, rejectButton === null || rejectButton === void 0 ? void 0 : rejectButton.style)
35
- } }))))))));
39
+ } })))))))));
36
40
  };
37
41
  export default memo(Click);
@@ -121,6 +121,11 @@ export default [
121
121
  {
122
122
  title: '拒绝按钮样式',
123
123
  child: [
124
+ {
125
+ type: 'Switch',
126
+ label: '开启',
127
+ name: ['props', 'showRejectButton']
128
+ },
124
129
  {
125
130
  type: 'Color',
126
131
  label: '背景色',
@@ -7,7 +7,6 @@ export interface ISwipeProps {
7
7
  isTel?: boolean;
8
8
  consentPopupCate?: string;
9
9
  swipeIcon?: string;
10
- closeIcon?: string;
11
10
  }
12
11
  declare const _default: React.NamedExoticComponent<ISwipeProps>;
13
12
  export default _default;
@@ -5,25 +5,26 @@ import ConsentDetail from '../../popup/ConsentDetail';
5
5
  import tel from './tel.png';
6
6
  import { useSxpDataSource } from '../../../../core/hooks';
7
7
  const Swipe = (_a) => {
8
- var { isTel, open, content, style, consentPopupCate, swipeIcon, closeIcon } = _a, props = __rest(_a, ["isTel", "open", "content", "style", "consentPopupCate", "swipeIcon", "closeIcon"]);
8
+ var { isTel, open, content, style, consentPopupCate, swipeIcon } = _a, props = __rest(_a, ["isTel", "open", "content", "style", "consentPopupCate", "swipeIcon"]);
9
9
  const touchInfo = useRef();
10
10
  const threshold = 50;
11
11
  const { getAccount, accountSonsent } = useSxpDataSource();
12
- const [consentResult, setConsentResult] = useState(false);
12
+ const [consentResult, setConsentResult] = useState(true);
13
13
  const handleGetAccount = () => __awaiter(void 0, void 0, void 0, function* () {
14
14
  const res = yield (getAccount === null || getAccount === void 0 ? void 0 : getAccount());
15
15
  setConsentResult(res);
16
16
  });
17
- useEffect(() => {
18
- handleGetAccount();
19
- }, []);
20
17
  const visivle = useMemo(() => {
21
18
  return consentPopupCate || (open && style && !consentResult);
22
19
  }, [consentPopupCate, open, style, consentResult]);
23
- const handleClick = (v) => {
24
- accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(v);
25
- setConsentResult(true);
26
- };
20
+ useEffect(() => {
21
+ !consentPopupCate && open && style && handleGetAccount();
22
+ }, []);
23
+ const handleClickAccept = () => __awaiter(void 0, void 0, void 0, function* () {
24
+ const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
25
+ if (res)
26
+ setConsentResult(true);
27
+ });
27
28
  const handleTouchStart = (event) => {
28
29
  const touch = event.touches[0];
29
30
  touchInfo.current = { y: touch.clientY, d: 0 };
@@ -42,7 +43,7 @@ const Swipe = (_a) => {
42
43
  return;
43
44
  const { d } = touchInfo.current || {};
44
45
  if (d > threshold) {
45
- handleClick(true);
46
+ handleClickAccept();
46
47
  }
47
48
  touchInfo.current = {};
48
49
  };
@@ -50,9 +51,7 @@ const Swipe = (_a) => {
50
51
  React.createElement("div", { className: 'consentPopupSwipe-container', style: style },
51
52
  React.createElement("div", { className: 'consentPopupSwipe-container-content' },
52
53
  React.createElement(ConsentDetail, { content: content, style: { padding: 0 } })),
53
- React.createElement("button", { "aria-label": 'close', className: 'consentPopupSwipe-container-close', onClick: () => handleClick(false) },
54
- React.createElement("img", { src: closeIcon, alt: 'close' })),
55
- swipeIcon && (React.createElement("div", { className: 'consentPopupSwipe-container-swipeIcon', onClick: () => handleClick(false) },
54
+ swipeIcon && (React.createElement("div", { className: 'consentPopupSwipe-container-swipeIcon' },
56
55
  React.createElement("img", { src: swipeIcon, alt: 'Swipe Icon' }))))))))));
57
56
  };
58
57
  export default memo(Swipe);
@@ -12,8 +12,7 @@ const Swipe = createMaterial(SwipeComponent, {
12
12
  },
13
13
  defaulSetting: {
14
14
  props: {
15
- content: '<p><span style="font- size: 14px"><strong><span style="line - height: 3">Your Cookie Preferences</span></strong></span></p><p><span style="line- height: 1"><span style="font- size: 12px">We use cookie, including third-party cookies, to</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">ensure the proper functioning and security of</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">this site, to analyse its use, and to show you</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">personalised content.</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">You can authorise the use of all cookies by</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">clicking on &#x27;Accept all cookies&#x27;. If you click on</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">&#x27;Reject all cookies&#x27;, we will only use cookies</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">necessary for the proper functioning and </span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">security of this site. To personalise or adjust</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">your preferences at any time, click on &#x27;Cookies</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">Settings&#x27; below or at the bottom of any</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">Fendi.com webpage.</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">For more information, <u>read our Cookie Policy</u>.</span></span></p>',
16
- closeIcon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII='
15
+ content: '<p><span style="font- size: 14px"><strong><span style="line - height: 3">Your Cookie Preferences</span></strong></span></p><p><span style="line- height: 1"><span style="font- size: 12px">We use cookie, including third-party cookies, to</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">ensure the proper functioning and security of</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">this site, to analyse its use, and to show you</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">personalised content.</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">You can authorise the use of all cookies by</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">clicking on &#x27;Accept all cookies&#x27;. If you click on</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">&#x27;Reject all cookies&#x27;, we will only use cookies</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">necessary for the proper functioning and </span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">security of this site. To personalise or adjust</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">your preferences at any time, click on &#x27;Cookies</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">Settings&#x27; below or at the bottom of any</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">Fendi.com webpage.</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">For more information, <u>read our Cookie Policy</u>.</span></span></p>'
17
16
  },
18
17
  style: {
19
18
  backgroundColor: '#fff',
@@ -17,11 +17,6 @@ export default [
17
17
  label: '内边距',
18
18
  name: ['style', 'padding'],
19
19
  addonAfter: 'px'
20
- },
21
- {
22
- label: '关闭按钮',
23
- type: 'Upload',
24
- name: ['props', 'closeIcon']
25
20
  }
26
21
  ]
27
22
  },
@@ -557,7 +557,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
557
557
  isReload,
558
558
  renderToggleButton
559
559
  ]);
560
- return (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(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` })) },
561
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: () => {
562
563
  const isEq = (0, lodash_1.isEqual)(rtcList, cacheRtcList);
563
564
  if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
@@ -616,6 +617,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
616
617
  renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))),
617
618
  react_1.default.createElement(WaterFall_1.default, Object.assign({}, (_u = (_t = (_s = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _s === void 0 ? void 0 : _s[0]) === null || _t === void 0 ? void 0 : _t.item) === null || _u === void 0 ? void 0 : _u.props)),
618
619
  react_1.default.createElement(ConsentPopup_1.default, { resolver: resolver, globalConfig: globalConfig }),
619
- 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 } })))));
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 } })))))));
620
621
  };
621
622
  exports.default = SxpPageRender;
@@ -24,7 +24,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
24
24
  var _a, _b, _c, _d, _e;
25
25
  const [rtcList, setRtcList] = (0, react_1.useState)([]);
26
26
  const [tagList, setTagList] = (0, react_1.useState)([]);
27
- const [loading, setLoading] = (0, react_1.useState)(false);
27
+ const [loading, setLoading] = (0, react_1.useState)(true);
28
28
  const [curReqInfo, setCurReqInfo] = (0, react_1.useState)({ rtc: '', requestId: '' });
29
29
  const swiperRef = (0, react_1.useRef)(null);
30
30
  const isInit = (0, react_1.useRef)(false);
@@ -14,6 +14,7 @@ export interface IClickProps {
14
14
  style?: CSSProperties;
15
15
  };
16
16
  consentPopupCate?: string;
17
+ showRejectButton?: boolean;
17
18
  }
18
19
  declare const _default: React.NamedExoticComponent<IClickProps>;
19
20
  export default _default;
@@ -8,32 +8,36 @@ const tel_png_1 = tslib_1.__importDefault(require("./tel.png"));
8
8
  const tool_1 = require("../../../../core/utils/tool");
9
9
  const hooks_1 = require("../../../../core/hooks");
10
10
  const Click = (_a) => {
11
- var { isTel, open, content, style, consentPopupCate, acceptButton, rejectButton } = _a, props = tslib_1.__rest(_a, ["isTel", "open", "content", "style", "consentPopupCate", "acceptButton", "rejectButton"]);
11
+ var { isTel, open, content, style, consentPopupCate, acceptButton, rejectButton, showRejectButton } = _a, props = tslib_1.__rest(_a, ["isTel", "open", "content", "style", "consentPopupCate", "acceptButton", "rejectButton", "showRejectButton"]);
12
12
  const { getAccount, accountSonsent } = (0, hooks_1.useSxpDataSource)();
13
- const [consentResult, setConsentResult] = (0, react_1.useState)(false);
13
+ const [consentResult, setConsentResult] = (0, react_1.useState)(true);
14
14
  const handleGetAccount = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
15
15
  const res = yield (getAccount === null || getAccount === void 0 ? void 0 : getAccount());
16
16
  setConsentResult(res);
17
17
  });
18
- (0, react_1.useEffect)(() => {
19
- handleGetAccount();
20
- }, []);
21
18
  const visivle = (0, react_1.useMemo)(() => {
22
19
  return consentPopupCate || (open && style && !consentResult);
23
20
  }, [consentPopupCate, open, style, consentResult]);
24
- const handleClick = (v) => {
25
- accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(v);
26
- setConsentResult(true);
21
+ (0, react_1.useEffect)(() => {
22
+ !consentPopupCate && open && style && handleGetAccount();
23
+ }, []);
24
+ const handleClickAccept = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
25
+ const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
26
+ if (res)
27
+ setConsentResult(true);
28
+ });
29
+ const handleClickReject = () => {
30
+ history === null || history === void 0 ? void 0 : history.back();
27
31
  };
28
32
  return (react_1.default.createElement(react_1.default.Fragment, null, isTel ? (react_1.default.createElement("img", { src: tel_png_1.default, style: { objectFit: 'cover', width: '100%', height: '100%' } })) : (react_1.default.createElement(react_1.default.Fragment, null, visivle && (react_1.default.createElement("div", { className: 'consentPopupClick' },
29
33
  react_1.default.createElement("div", { className: 'consentPopupClick-container', style: style },
30
34
  react_1.default.createElement("div", { className: 'consentPopupClick-container-content' },
31
35
  react_1.default.createElement(ConsentDetail_1.default, { content: content, style: { padding: 0 } })),
32
- react_1.default.createElement("button", { style: acceptButton === null || acceptButton === void 0 ? void 0 : acceptButton.style, onClick: () => handleClick(true), dangerouslySetInnerHTML: {
36
+ react_1.default.createElement("button", { style: acceptButton === null || acceptButton === void 0 ? void 0 : acceptButton.style, onClick: handleClickAccept, dangerouslySetInnerHTML: {
33
37
  __html: (0, tool_1.setFontForText)(acceptButton === null || acceptButton === void 0 ? void 0 : acceptButton.text, acceptButton === null || acceptButton === void 0 ? void 0 : acceptButton.style)
34
38
  } }),
35
- react_1.default.createElement("button", { style: rejectButton === null || rejectButton === void 0 ? void 0 : rejectButton.style, onClick: () => handleClick(false), dangerouslySetInnerHTML: {
39
+ showRejectButton && (react_1.default.createElement("button", { style: rejectButton === null || rejectButton === void 0 ? void 0 : rejectButton.style, onClick: handleClickReject, dangerouslySetInnerHTML: {
36
40
  __html: (0, tool_1.setFontForText)(rejectButton === null || rejectButton === void 0 ? void 0 : rejectButton.text, rejectButton === null || rejectButton === void 0 ? void 0 : rejectButton.style)
37
- } }))))))));
41
+ } })))))))));
38
42
  };
39
43
  exports.default = (0, react_1.memo)(Click);
@@ -123,6 +123,11 @@ exports.default = [
123
123
  {
124
124
  title: '拒绝按钮样式',
125
125
  child: [
126
+ {
127
+ type: 'Switch',
128
+ label: '开启',
129
+ name: ['props', 'showRejectButton']
130
+ },
126
131
  {
127
132
  type: 'Color',
128
133
  label: '背景色',
@@ -7,7 +7,6 @@ export interface ISwipeProps {
7
7
  isTel?: boolean;
8
8
  consentPopupCate?: string;
9
9
  swipeIcon?: string;
10
- closeIcon?: string;
11
10
  }
12
11
  declare const _default: React.NamedExoticComponent<ISwipeProps>;
13
12
  export default _default;
@@ -7,25 +7,26 @@ const ConsentDetail_1 = tslib_1.__importDefault(require("../../popup/ConsentDeta
7
7
  const tel_png_1 = tslib_1.__importDefault(require("./tel.png"));
8
8
  const hooks_1 = require("../../../../core/hooks");
9
9
  const Swipe = (_a) => {
10
- var { isTel, open, content, style, consentPopupCate, swipeIcon, closeIcon } = _a, props = tslib_1.__rest(_a, ["isTel", "open", "content", "style", "consentPopupCate", "swipeIcon", "closeIcon"]);
10
+ var { isTel, open, content, style, consentPopupCate, swipeIcon } = _a, props = tslib_1.__rest(_a, ["isTel", "open", "content", "style", "consentPopupCate", "swipeIcon"]);
11
11
  const touchInfo = (0, react_1.useRef)();
12
12
  const threshold = 50;
13
13
  const { getAccount, accountSonsent } = (0, hooks_1.useSxpDataSource)();
14
- const [consentResult, setConsentResult] = (0, react_1.useState)(false);
14
+ const [consentResult, setConsentResult] = (0, react_1.useState)(true);
15
15
  const handleGetAccount = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
16
16
  const res = yield (getAccount === null || getAccount === void 0 ? void 0 : getAccount());
17
17
  setConsentResult(res);
18
18
  });
19
- (0, react_1.useEffect)(() => {
20
- handleGetAccount();
21
- }, []);
22
19
  const visivle = (0, react_1.useMemo)(() => {
23
20
  return consentPopupCate || (open && style && !consentResult);
24
21
  }, [consentPopupCate, open, style, consentResult]);
25
- const handleClick = (v) => {
26
- accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(v);
27
- setConsentResult(true);
28
- };
22
+ (0, react_1.useEffect)(() => {
23
+ !consentPopupCate && open && style && handleGetAccount();
24
+ }, []);
25
+ const handleClickAccept = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
26
+ const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
27
+ if (res)
28
+ setConsentResult(true);
29
+ });
29
30
  const handleTouchStart = (event) => {
30
31
  const touch = event.touches[0];
31
32
  touchInfo.current = { y: touch.clientY, d: 0 };
@@ -44,7 +45,7 @@ const Swipe = (_a) => {
44
45
  return;
45
46
  const { d } = touchInfo.current || {};
46
47
  if (d > threshold) {
47
- handleClick(true);
48
+ handleClickAccept();
48
49
  }
49
50
  touchInfo.current = {};
50
51
  };
@@ -52,9 +53,7 @@ const Swipe = (_a) => {
52
53
  react_1.default.createElement("div", { className: 'consentPopupSwipe-container', style: style },
53
54
  react_1.default.createElement("div", { className: 'consentPopupSwipe-container-content' },
54
55
  react_1.default.createElement(ConsentDetail_1.default, { content: content, style: { padding: 0 } })),
55
- react_1.default.createElement("button", { "aria-label": 'close', className: 'consentPopupSwipe-container-close', onClick: () => handleClick(false) },
56
- react_1.default.createElement("img", { src: closeIcon, alt: 'close' })),
57
- swipeIcon && (react_1.default.createElement("div", { className: 'consentPopupSwipe-container-swipeIcon', onClick: () => handleClick(false) },
56
+ swipeIcon && (react_1.default.createElement("div", { className: 'consentPopupSwipe-container-swipeIcon' },
58
57
  react_1.default.createElement("img", { src: swipeIcon, alt: 'Swipe Icon' }))))))))));
59
58
  };
60
59
  exports.default = (0, react_1.memo)(Swipe);
@@ -16,8 +16,7 @@ const Swipe = (0, create_1.createMaterial)(_1.default, {
16
16
  },
17
17
  defaulSetting: {
18
18
  props: {
19
- content: '<p><span style="font- size: 14px"><strong><span style="line - height: 3">Your Cookie Preferences</span></strong></span></p><p><span style="line- height: 1"><span style="font- size: 12px">We use cookie, including third-party cookies, to</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">ensure the proper functioning and security of</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">this site, to analyse its use, and to show you</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">personalised content.</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">You can authorise the use of all cookies by</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">clicking on &#x27;Accept all cookies&#x27;. If you click on</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">&#x27;Reject all cookies&#x27;, we will only use cookies</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">necessary for the proper functioning and </span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">security of this site. To personalise or adjust</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">your preferences at any time, click on &#x27;Cookies</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">Settings&#x27; below or at the bottom of any</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">Fendi.com webpage.</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">For more information, <u>read our Cookie Policy</u>.</span></span></p>',
20
- closeIcon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII='
19
+ content: '<p><span style="font- size: 14px"><strong><span style="line - height: 3">Your Cookie Preferences</span></strong></span></p><p><span style="line- height: 1"><span style="font- size: 12px">We use cookie, including third-party cookies, to</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">ensure the proper functioning and security of</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">this site, to analyse its use, and to show you</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">personalised content.</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">You can authorise the use of all cookies by</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">clicking on &#x27;Accept all cookies&#x27;. If you click on</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">&#x27;Reject all cookies&#x27;, we will only use cookies</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">necessary for the proper functioning and </span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">security of this site. To personalise or adjust</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">your preferences at any time, click on &#x27;Cookies</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">Settings&#x27; below or at the bottom of any</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">Fendi.com webpage.</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">For more information, <u>read our Cookie Policy</u>.</span></span></p>'
21
20
  },
22
21
  style: {
23
22
  backgroundColor: '#fff',
@@ -19,11 +19,6 @@ exports.default = [
19
19
  label: '内边距',
20
20
  name: ['style', 'padding'],
21
21
  addonAfter: 'px'
22
- },
23
- {
24
- label: '关闭按钮',
25
- type: 'Upload',
26
- name: ['props', 'closeIcon']
27
22
  }
28
23
  ]
29
24
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.15.4",
3
+ "version": "1.15.6",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",