pb-sxp-ui 1.15.3 → 1.15.4

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 (36) hide show
  1. package/dist/index.cjs +98 -54
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +13 -1
  4. package/dist/index.js +98 -54
  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 +98 -54
  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/Consent/index.js +0 -1
  15. package/es/core/components/SxpPageRender/ConsentPopup.js +2 -2
  16. package/es/core/components/SxpPageRender/index.js +7 -7
  17. package/es/core/context/SxpDataSourceProvider.d.ts +2 -0
  18. package/es/core/context/SxpDataSourceProvider.js +23 -16
  19. package/es/materials/sxp/consentPopup/Click/index.js +28 -10
  20. package/es/materials/sxp/consentPopup/Click/settingRender.js +1 -1
  21. package/es/materials/sxp/consentPopup/Swipe/index.d.ts +1 -0
  22. package/es/materials/sxp/consentPopup/Swipe/index.js +26 -12
  23. package/es/materials/sxp/consentPopup/Swipe/material.js +2 -1
  24. package/es/materials/sxp/consentPopup/Swipe/settingRender.js +5 -0
  25. package/lib/core/components/Consent/index.js +0 -1
  26. package/lib/core/components/SxpPageRender/ConsentPopup.js +2 -2
  27. package/lib/core/components/SxpPageRender/index.js +7 -7
  28. package/lib/core/context/SxpDataSourceProvider.d.ts +2 -0
  29. package/lib/core/context/SxpDataSourceProvider.js +23 -16
  30. package/lib/materials/sxp/consentPopup/Click/index.js +26 -8
  31. package/lib/materials/sxp/consentPopup/Click/settingRender.js +1 -1
  32. package/lib/materials/sxp/consentPopup/Swipe/index.d.ts +1 -0
  33. package/lib/materials/sxp/consentPopup/Swipe/index.js +24 -10
  34. package/lib/materials/sxp/consentPopup/Swipe/material.js +2 -1
  35. package/lib/materials/sxp/consentPopup/Swipe/settingRender.js +5 -0
  36. package/package.json +1 -1
@@ -3,13 +3,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const react_1 = tslib_1.__importStar(require("react"));
5
5
  require("./index.less");
6
- const tel_png_1 = tslib_1.__importDefault(require("./tel.png"));
7
6
  const ConsentDetail_1 = tslib_1.__importDefault(require("../../popup/ConsentDetail"));
8
- const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
7
+ const tel_png_1 = tslib_1.__importDefault(require("./tel.png"));
8
+ const hooks_1 = require("../../../../core/hooks");
9
9
  const Swipe = (_a) => {
10
- var { isTel, open, content, style, consentPopupCate, swipeIcon } = _a, props = tslib_1.__rest(_a, ["isTel", "open", "content", "style", "consentPopupCate", "swipeIcon"]);
10
+ var { isTel, open, content, style, consentPopupCate, swipeIcon, closeIcon } = _a, props = tslib_1.__rest(_a, ["isTel", "open", "content", "style", "consentPopupCate", "swipeIcon", "closeIcon"]);
11
11
  const touchInfo = (0, react_1.useRef)();
12
12
  const threshold = 50;
13
+ const { getAccount, accountSonsent } = (0, hooks_1.useSxpDataSource)();
14
+ const [consentResult, setConsentResult] = (0, react_1.useState)(false);
15
+ const handleGetAccount = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
16
+ const res = yield (getAccount === null || getAccount === void 0 ? void 0 : getAccount());
17
+ setConsentResult(res);
18
+ });
19
+ (0, react_1.useEffect)(() => {
20
+ handleGetAccount();
21
+ }, []);
22
+ const visivle = (0, react_1.useMemo)(() => {
23
+ return consentPopupCate || (open && style && !consentResult);
24
+ }, [consentPopupCate, open, style, consentResult]);
25
+ const handleClick = (v) => {
26
+ accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(v);
27
+ setConsentResult(true);
28
+ };
13
29
  const handleTouchStart = (event) => {
14
30
  const touch = event.touches[0];
15
31
  touchInfo.current = { y: touch.clientY, d: 0 };
@@ -28,19 +44,17 @@ const Swipe = (_a) => {
28
44
  return;
29
45
  const { d } = touchInfo.current || {};
30
46
  if (d > threshold) {
47
+ handleClick(true);
31
48
  }
32
49
  touchInfo.current = {};
33
50
  };
34
- const handleClickReject = () => { };
35
- const visivle = (0, react_1.useMemo)(() => {
36
- return consentPopupCate || (open && style);
37
- }, [consentPopupCate, open]);
38
51
  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: 'consentPopupSwipe', onTouchStart: handleTouchStart, onTouchMove: handleTouchMove, onTouchEnd: handleTouchEnd },
39
52
  react_1.default.createElement("div", { className: 'consentPopupSwipe-container', style: style },
40
- react_1.default.createElement(ConsentDetail_1.default, { content: content, style: { padding: 0 } }),
41
- react_1.default.createElement("button", { "aria-label": 'close', className: 'consentPopupSwipe-container-close', onClick: handleClickReject },
53
+ react_1.default.createElement("div", { className: 'consentPopupSwipe-container-content' },
54
+ 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) },
42
56
  react_1.default.createElement("img", { src: closeIcon, alt: 'close' })),
43
- swipeIcon && (react_1.default.createElement("div", { className: 'consentPopupSwipe-container-swipeIcon', onClick: handleClickReject },
57
+ swipeIcon && (react_1.default.createElement("div", { className: 'consentPopupSwipe-container-swipeIcon', onClick: () => handleClick(false) },
44
58
  react_1.default.createElement("img", { src: swipeIcon, alt: 'Swipe Icon' }))))))))));
45
59
  };
46
60
  exports.default = (0, react_1.memo)(Swipe);
@@ -16,7 +16,8 @@ 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>'
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='
20
21
  },
21
22
  style: {
22
23
  backgroundColor: '#fff',
@@ -19,6 +19,11 @@ 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']
22
27
  }
23
28
  ]
24
29
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.15.3",
3
+ "version": "1.15.4",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",