pb-sxp-ui 14.0.6 → 14.0.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.
Files changed (66) hide show
  1. package/dist/index.cjs +801 -396
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +89 -0
  4. package/dist/index.js +801 -396
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.cjs +4 -4
  7. package/dist/index.min.cjs.map +1 -1
  8. package/dist/index.min.js +4 -4
  9. package/dist/index.min.js.map +1 -1
  10. package/dist/pb-ui.js +801 -396
  11. package/dist/pb-ui.js.map +1 -1
  12. package/dist/pb-ui.min.js +4 -4
  13. package/dist/pb-ui.min.js.map +1 -1
  14. package/es/core/components/SxpPageRender/ConsentPopup.js +8 -8
  15. package/es/core/components/SxpPageRender/Navbar.js +1 -1
  16. package/es/core/components/SxpPageRender/WaterFall/preview.json +207 -272
  17. package/es/core/components/SxpPageRender/index.js +5 -2
  18. package/es/core/context/SxpDataSourceProvider.js +54 -22
  19. package/es/core/utils/materials.js +5 -3
  20. package/es/materials/sxp/consentPopup/Click/index.d.ts +19 -0
  21. package/es/materials/sxp/consentPopup/Click/index.js +19 -0
  22. package/es/materials/sxp/consentPopup/Click/material.d.ts +2 -0
  23. package/es/materials/sxp/consentPopup/Click/material.js +48 -0
  24. package/es/materials/sxp/consentPopup/Click/settingRender.d.ts +63 -0
  25. package/es/materials/sxp/consentPopup/Click/settingRender.js +210 -0
  26. package/es/materials/sxp/consentPopup/Display/index.d.ts +2 -2
  27. package/es/materials/sxp/consentPopup/Display/index.js +7 -5
  28. package/es/materials/sxp/consentPopup/Swipe/index.d.ts +12 -0
  29. package/es/materials/sxp/consentPopup/Swipe/index.js +44 -0
  30. package/es/materials/sxp/consentPopup/Swipe/material.d.ts +2 -0
  31. package/es/materials/sxp/consentPopup/Swipe/material.js +24 -0
  32. package/es/materials/sxp/consentPopup/Swipe/settingRender.d.ts +29 -0
  33. package/es/materials/sxp/consentPopup/Swipe/settingRender.js +43 -0
  34. package/es/materials/sxp/consentPopup/index.d.ts +2 -0
  35. package/es/materials/sxp/consentPopup/index.js +2 -0
  36. package/es/materials/sxp/cta/AniLink/index.js +1 -1
  37. package/es/materials/sxp/cta/AniLinkPopup/index.js +1 -1
  38. package/es/materials/sxp/popup/ConsentDetail/index.d.ts +2 -1
  39. package/es/materials/sxp/popup/ConsentDetail/index.js +2 -2
  40. package/lib/core/components/SxpPageRender/ConsentPopup.js +7 -7
  41. package/lib/core/components/SxpPageRender/Navbar.js +1 -1
  42. package/lib/core/components/SxpPageRender/WaterFall/preview.json +207 -272
  43. package/lib/core/components/SxpPageRender/index.js +5 -2
  44. package/lib/core/context/SxpDataSourceProvider.js +54 -22
  45. package/lib/core/utils/materials.js +5 -3
  46. package/lib/materials/sxp/consentPopup/Click/index.d.ts +19 -0
  47. package/lib/materials/sxp/consentPopup/Click/index.js +21 -0
  48. package/lib/materials/sxp/consentPopup/Click/material.d.ts +2 -0
  49. package/lib/materials/sxp/consentPopup/Click/material.js +52 -0
  50. package/lib/materials/sxp/consentPopup/Click/settingRender.d.ts +63 -0
  51. package/lib/materials/sxp/consentPopup/Click/settingRender.js +212 -0
  52. package/lib/materials/sxp/consentPopup/Display/index.d.ts +2 -2
  53. package/lib/materials/sxp/consentPopup/Display/index.js +7 -5
  54. package/lib/materials/sxp/consentPopup/Swipe/index.d.ts +12 -0
  55. package/lib/materials/sxp/consentPopup/Swipe/index.js +46 -0
  56. package/lib/materials/sxp/consentPopup/Swipe/material.d.ts +2 -0
  57. package/lib/materials/sxp/consentPopup/Swipe/material.js +28 -0
  58. package/lib/materials/sxp/consentPopup/Swipe/settingRender.d.ts +29 -0
  59. package/lib/materials/sxp/consentPopup/Swipe/settingRender.js +45 -0
  60. package/lib/materials/sxp/consentPopup/index.d.ts +2 -0
  61. package/lib/materials/sxp/consentPopup/index.js +2 -0
  62. package/lib/materials/sxp/cta/AniLink/index.js +1 -1
  63. package/lib/materials/sxp/cta/AniLinkPopup/index.js +1 -1
  64. package/lib/materials/sxp/popup/ConsentDetail/index.d.ts +2 -1
  65. package/lib/materials/sxp/popup/ConsentDetail/index.js +2 -2
  66. package/package.json +1 -1
@@ -0,0 +1,44 @@
1
+ import { __rest } from "tslib";
2
+ import React, { memo, useMemo, useRef } from 'react';
3
+ import './index.less';
4
+ import tel from './tel.png';
5
+ import ConsentDetail from '../../popup/ConsentDetail';
6
+ const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
7
+ const Swipe = (_a) => {
8
+ var { isTel, open, content, style, consentPopupCate, swipeIcon } = _a, props = __rest(_a, ["isTel", "open", "content", "style", "consentPopupCate", "swipeIcon"]);
9
+ const touchInfo = useRef();
10
+ const threshold = 50;
11
+ const handleTouchStart = (event) => {
12
+ const touch = event.touches[0];
13
+ touchInfo.current = { y: touch.clientY, d: 0 };
14
+ };
15
+ const handleTouchMove = (event) => {
16
+ var _a;
17
+ if (!touchInfo.current)
18
+ return;
19
+ const touch = event.touches[0];
20
+ const dy = touch.clientY - ((_a = touchInfo === null || touchInfo === void 0 ? void 0 : touchInfo.current) === null || _a === void 0 ? void 0 : _a.y);
21
+ const currentDistance = Math.abs(dy);
22
+ touchInfo.current = Object.assign(Object.assign({}, touchInfo.current), { d: currentDistance });
23
+ };
24
+ const handleTouchEnd = () => {
25
+ if (!touchInfo.current)
26
+ return;
27
+ const { d } = touchInfo.current || {};
28
+ if (d > threshold) {
29
+ }
30
+ touchInfo.current = {};
31
+ };
32
+ const handleClickReject = () => { };
33
+ const visivle = useMemo(() => {
34
+ return consentPopupCate || (open && style);
35
+ }, [consentPopupCate, open]);
36
+ 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: 'consentPopupSwipe', onTouchStart: handleTouchStart, onTouchMove: handleTouchMove, onTouchEnd: handleTouchEnd },
37
+ React.createElement("div", { className: 'consentPopupSwipe-container', style: style },
38
+ React.createElement(ConsentDetail, { content: content, style: { padding: 0 } }),
39
+ React.createElement("button", { "aria-label": 'close', className: 'consentPopupSwipe-container-close', onClick: handleClickReject },
40
+ React.createElement("img", { src: closeIcon, alt: 'close' })),
41
+ swipeIcon && (React.createElement("div", { className: 'consentPopupSwipe-container-swipeIcon', onClick: handleClickReject },
42
+ React.createElement("img", { src: swipeIcon, alt: 'Swipe Icon' }))))))))));
43
+ };
44
+ export default memo(Swipe);
@@ -0,0 +1,2 @@
1
+ declare const Swipe: import("../../../../core/create").MaterialComponet<import(".").ISwipeProps>;
2
+ export { Swipe };
@@ -0,0 +1,24 @@
1
+ import settingRender from './settingRender';
2
+ import SwipeComponent from '.';
3
+ import { createMaterial } from '../../../../core/create';
4
+ const Swipe = createMaterial(SwipeComponent, {
5
+ displayName: 'Swipe Consent',
6
+ icon: '',
7
+ category: 'consentPopup',
8
+ type: 'Swipe',
9
+ related: {
10
+ settingRender,
11
+ bindableProps: []
12
+ },
13
+ defaulSetting: {
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
+ },
17
+ style: {
18
+ backgroundColor: '#fff',
19
+ padding: 18
20
+ }
21
+ },
22
+ sort: 3
23
+ });
24
+ export { Swipe };
@@ -0,0 +1,29 @@
1
+ declare const _default: ({
2
+ title: string;
3
+ child: ({
4
+ type: string;
5
+ label: string;
6
+ name: string[];
7
+ addonAfter?: undefined;
8
+ } | {
9
+ type: string;
10
+ label: string;
11
+ name: string[];
12
+ addonAfter: string;
13
+ })[];
14
+ } | {
15
+ title: string;
16
+ child: {
17
+ type: string;
18
+ name: string[];
19
+ }[];
20
+ } | {
21
+ title: string;
22
+ child: {
23
+ type: string;
24
+ label: string;
25
+ name: string[];
26
+ text: string;
27
+ }[];
28
+ })[];
29
+ export default _default;
@@ -0,0 +1,43 @@
1
+ export default [
2
+ {
3
+ title: '全局设置',
4
+ child: [
5
+ {
6
+ type: 'Switch',
7
+ label: '弹窗开关',
8
+ name: ['props', 'open']
9
+ },
10
+ {
11
+ type: 'Color',
12
+ label: '背景色',
13
+ name: ['style', 'backgroundColor']
14
+ },
15
+ {
16
+ type: 'Number',
17
+ label: '内边距',
18
+ name: ['style', 'padding'],
19
+ addonAfter: 'px'
20
+ }
21
+ ]
22
+ },
23
+ {
24
+ title: '弹窗文本',
25
+ child: [
26
+ {
27
+ type: 'RichText',
28
+ name: ['props', 'content']
29
+ }
30
+ ]
31
+ },
32
+ {
33
+ title: '滑动图标',
34
+ child: [
35
+ {
36
+ type: 'Upload',
37
+ label: '滑动图标',
38
+ name: ['props', 'swipeIcon'],
39
+ text: '建议尺寸:252 * 185'
40
+ }
41
+ ]
42
+ }
43
+ ];
@@ -1 +1,3 @@
1
1
  export * from './Display/material';
2
+ export * from './Click/material';
3
+ export * from './Swipe/material';
@@ -1 +1,3 @@
1
1
  export * from './Display/material';
2
+ export * from './Click/material';
3
+ export * from './Swipe/material';
@@ -35,7 +35,7 @@ const AniLink = (_a) => {
35
35
  onClick === null || onClick === void 0 ? void 0 : onClick();
36
36
  }
37
37
  };
38
- const title = (cta === null || cta === void 0 ? void 0 : cta.enTitle) || '查看详情';
38
+ const title = (cta === null || cta === void 0 ? void 0 : cta.enTitle) || 'Show More';
39
39
  const aniTimStyle = useMemo(() => {
40
40
  var _a, _b;
41
41
  const ani = event === null || event === void 0 ? void 0 : event.animation;
@@ -35,7 +35,7 @@ const AniLinkPopup = (_a) => {
35
35
  onClick === null || onClick === void 0 ? void 0 : onClick();
36
36
  }
37
37
  };
38
- const title = (cta === null || cta === void 0 ? void 0 : cta.enTitle) || '查看详情';
38
+ const title = (cta === null || cta === void 0 ? void 0 : cta.enTitle) || 'Show More';
39
39
  const aniTimStyle = useMemo(() => {
40
40
  const ani = event === null || event === void 0 ? void 0 : event.animation;
41
41
  if (ani) {
@@ -1,8 +1,9 @@
1
- import React from 'react';
1
+ import React, { CSSProperties } from 'react';
2
2
  import './index.less';
3
3
  export interface IConsentDetailProps {
4
4
  content?: string;
5
5
  isTel?: boolean;
6
+ style?: CSSProperties;
6
7
  }
7
8
  declare const _default: React.NamedExoticComponent<IConsentDetailProps>;
8
9
  export default _default;
@@ -2,11 +2,11 @@ import { __rest } from "tslib";
2
2
  import React, { memo } from 'react';
3
3
  import './index.less';
4
4
  const ConsentDetail = (_a) => {
5
- var { content, isTel } = _a, props = __rest(_a, ["content", "isTel"]);
5
+ var { content, isTel, style } = _a, props = __rest(_a, ["content", "isTel", "style"]);
6
6
  return (React.createElement("article", { className: 'consentDetail-article', dangerouslySetInnerHTML: {
7
7
  __html: typeof content === 'string' ? content : ''
8
8
  }, onClick: (e) => {
9
9
  e.stopPropagation();
10
- } }));
10
+ }, style: style }));
11
11
  };
12
12
  export default memo(ConsentDetail);
@@ -4,15 +4,15 @@ const tslib_1 = require("tslib");
4
4
  const react_1 = tslib_1.__importStar(require("react"));
5
5
  require("./index.less");
6
6
  const withBindDataSource_1 = tslib_1.__importDefault(require("../../../core/hoc/withBindDataSource"));
7
- const localStore_1 = require("../../../core/utils/localStore");
7
+ const EditorDataProvider_1 = require("../../../core/context/EditorDataProvider");
8
8
  const Consent = ({ resolver, globalConfig }) => {
9
9
  var _a, _b;
10
- const contsentState = (0, react_1.useMemo)(() => {
11
- return (0, localStore_1.getContsentState)();
12
- }, []);
13
- const t = resolver === null || resolver === void 0 ? void 0 : resolver['Display'];
14
- const Component = (0, withBindDataSource_1.default)(t);
10
+ const { consentPopupCate } = (0, EditorDataProvider_1.useEditorDataProvider)();
15
11
  const value = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consentPopup) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item;
16
- return react_1.default.createElement(Component, Object.assign({}, value === null || value === void 0 ? void 0 : value.props, { style: value === null || value === void 0 ? void 0 : value.style, event: (value === null || value === void 0 ? void 0 : value.event) || {}, contsentState: contsentState }));
12
+ if (!value)
13
+ return null;
14
+ const t = resolver === null || resolver === void 0 ? void 0 : resolver[value === null || value === void 0 ? void 0 : value.type];
15
+ const Component = (0, withBindDataSource_1.default)(t);
16
+ return (react_1.default.createElement(Component, Object.assign({}, value === null || value === void 0 ? void 0 : value.props, { style: value === null || value === void 0 ? void 0 : value.style, event: (value === null || value === void 0 ? void 0 : value.event) || {}, consentPopupCate: consentPopupCate })));
17
17
  };
18
18
  exports.default = (0, react_1.memo)(Consent);
@@ -11,7 +11,7 @@ const Navbar = ({ icon, styles, textStyle, onClose }) => {
11
11
  react_1.default.createElement("button", { className: 'clc-sxp-nav-left', role: 'button', "aria-label": 'back button', onClick: onClose },
12
12
  react_1.default.createElement("img", { src: icon, alt: 'back button' })),
13
13
  react_1.default.createElement("div", { className: 'clc-sxp-nav-title', style: Object.assign(Object.assign({}, textStyle), { paddingLeft: (textStyle === null || textStyle === void 0 ? void 0 : textStyle.textAlign) === 'left' ? '35px' : 0 }), dangerouslySetInnerHTML: {
14
- __html: (0, tool_1.setFontForText)(`#${(_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag) !== null && _a !== void 0 ? _a : '标题'}`, textStyle)
14
+ __html: (0, tool_1.setFontForText)(`#${(_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag) !== null && _a !== void 0 ? _a : 'title'}`, textStyle)
15
15
  } })));
16
16
  };
17
17
  exports.default = (0, react_1.memo)(Navbar);