pb-sxp-ui 14.0.3 → 14.0.5

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 (78) hide show
  1. package/dist/index.cjs +470 -810
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +0 -89
  4. package/dist/index.js +470 -810
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.cjs +6 -6
  7. package/dist/index.min.cjs.map +1 -1
  8. package/dist/index.min.js +6 -6
  9. package/dist/index.min.js.map +1 -1
  10. package/dist/pb-ui.js +470 -810
  11. package/dist/pb-ui.js.map +1 -1
  12. package/dist/pb-ui.min.js +6 -6
  13. package/dist/pb-ui.min.js.map +1 -1
  14. package/es/core/components/Consent/index.js +8 -2
  15. package/es/core/components/SxpPageRender/ConsentPopup.js +8 -8
  16. package/es/core/components/SxpPageRender/Navbar.js +1 -1
  17. package/es/core/components/SxpPageRender/WaterFall/preview.json +272 -207
  18. package/es/core/components/SxpPageRender/index.js +2 -5
  19. package/es/core/context/SxpDataSourceProvider.js +33 -53
  20. package/es/core/utils/materials.js +3 -5
  21. package/es/core/utils/tool.d.ts +2 -1
  22. package/es/core/utils/tool.js +38 -14
  23. package/es/materials/sxp/consentPopup/Display/index.d.ts +2 -2
  24. package/es/materials/sxp/consentPopup/Display/index.js +5 -7
  25. package/es/materials/sxp/consentPopup/index.d.ts +0 -2
  26. package/es/materials/sxp/consentPopup/index.js +0 -2
  27. package/es/materials/sxp/cta/AniLink/index.js +1 -1
  28. package/es/materials/sxp/cta/AniLinkPopup/index.js +1 -1
  29. package/es/materials/sxp/popup/ConsentDetail/index.d.ts +1 -2
  30. package/es/materials/sxp/popup/ConsentDetail/index.js +2 -2
  31. package/es/materials/sxp/popup/Iframe/index.d.ts +4 -0
  32. package/es/materials/sxp/popup/Iframe/index.js +5 -4
  33. package/es/materials/sxp/popup/Iframe/settingRender.js +15 -0
  34. package/lib/core/components/Consent/index.js +8 -2
  35. package/lib/core/components/SxpPageRender/ConsentPopup.js +7 -7
  36. package/lib/core/components/SxpPageRender/Navbar.js +1 -1
  37. package/lib/core/components/SxpPageRender/WaterFall/preview.json +272 -207
  38. package/lib/core/components/SxpPageRender/index.js +2 -5
  39. package/lib/core/context/SxpDataSourceProvider.js +32 -52
  40. package/lib/core/utils/materials.js +3 -5
  41. package/lib/core/utils/tool.d.ts +2 -1
  42. package/lib/core/utils/tool.js +39 -14
  43. package/lib/materials/sxp/consentPopup/Display/index.d.ts +2 -2
  44. package/lib/materials/sxp/consentPopup/Display/index.js +5 -7
  45. package/lib/materials/sxp/consentPopup/index.d.ts +0 -2
  46. package/lib/materials/sxp/consentPopup/index.js +0 -2
  47. package/lib/materials/sxp/cta/AniLink/index.js +1 -1
  48. package/lib/materials/sxp/cta/AniLinkPopup/index.js +1 -1
  49. package/lib/materials/sxp/popup/ConsentDetail/index.d.ts +1 -2
  50. package/lib/materials/sxp/popup/ConsentDetail/index.js +2 -2
  51. package/lib/materials/sxp/popup/Iframe/index.d.ts +4 -0
  52. package/lib/materials/sxp/popup/Iframe/index.js +5 -4
  53. package/lib/materials/sxp/popup/Iframe/settingRender.js +15 -0
  54. package/package.json +1 -1
  55. package/es/materials/sxp/consentPopup/Click/index.d.ts +0 -19
  56. package/es/materials/sxp/consentPopup/Click/index.js +0 -19
  57. package/es/materials/sxp/consentPopup/Click/material.d.ts +0 -2
  58. package/es/materials/sxp/consentPopup/Click/material.js +0 -48
  59. package/es/materials/sxp/consentPopup/Click/settingRender.d.ts +0 -63
  60. package/es/materials/sxp/consentPopup/Click/settingRender.js +0 -210
  61. package/es/materials/sxp/consentPopup/Swipe/index.d.ts +0 -12
  62. package/es/materials/sxp/consentPopup/Swipe/index.js +0 -44
  63. package/es/materials/sxp/consentPopup/Swipe/material.d.ts +0 -2
  64. package/es/materials/sxp/consentPopup/Swipe/material.js +0 -24
  65. package/es/materials/sxp/consentPopup/Swipe/settingRender.d.ts +0 -29
  66. package/es/materials/sxp/consentPopup/Swipe/settingRender.js +0 -43
  67. package/lib/materials/sxp/consentPopup/Click/index.d.ts +0 -19
  68. package/lib/materials/sxp/consentPopup/Click/index.js +0 -21
  69. package/lib/materials/sxp/consentPopup/Click/material.d.ts +0 -2
  70. package/lib/materials/sxp/consentPopup/Click/material.js +0 -52
  71. package/lib/materials/sxp/consentPopup/Click/settingRender.d.ts +0 -63
  72. package/lib/materials/sxp/consentPopup/Click/settingRender.js +0 -212
  73. package/lib/materials/sxp/consentPopup/Swipe/index.d.ts +0 -12
  74. package/lib/materials/sxp/consentPopup/Swipe/index.js +0 -46
  75. package/lib/materials/sxp/consentPopup/Swipe/material.d.ts +0 -2
  76. package/lib/materials/sxp/consentPopup/Swipe/material.js +0 -28
  77. package/lib/materials/sxp/consentPopup/Swipe/settingRender.d.ts +0 -29
  78. package/lib/materials/sxp/consentPopup/Swipe/settingRender.js +0 -45
@@ -1,12 +1,18 @@
1
1
  import React, { memo, useEffect, useMemo } from 'react';
2
- import qs from 'qs';
3
2
  import { useSxpDataSource } from '../../../core/hooks';
4
3
  import { AGREE_POLICY } from '../../../core/utils/localStore';
4
+ import { splitUrlParams } from '../../../core/utils/tool';
5
5
  const Consent = ({ width = window.innerWidth, height = window.innerHeight, privacy_title, privacy_context, privacy_policy_url, privacy_policy_title }) => {
6
6
  const { setIsAgreePolicy, bffEventReport } = useSxpDataSource();
7
7
  const channelObj = useMemo(() => {
8
+ var _a;
8
9
  const queryString = location.search.slice(1);
9
- const params = qs.parse(queryString.replace(/\+/g, '%2B'));
10
+ const params = {};
11
+ (_a = splitUrlParams(queryString.replace(/\+/g, '%2B'))) === null || _a === void 0 ? void 0 : _a.map((val) => {
12
+ const key = val.split('=')[0];
13
+ const value = val.split('=')[1];
14
+ params[key] = value;
15
+ });
10
16
  for (const key in params) {
11
17
  params[key] = params[key].replace(/%2B/g, '+');
12
18
  }
@@ -1,15 +1,15 @@
1
- import React, { memo } from 'react';
1
+ import React, { memo, useMemo } from 'react';
2
2
  import './index.less';
3
3
  import withBindDataSource from '../../../core/hoc/withBindDataSource';
4
- import { useEditorDataProvider } from '../../../core/context/EditorDataProvider';
4
+ import { getContsentState } from '../../../core/utils/localStore';
5
5
  const Consent = ({ resolver, globalConfig }) => {
6
6
  var _a, _b;
7
- const { consentPopupCate } = useEditorDataProvider();
8
- 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;
9
- if (!value)
10
- return null;
11
- const t = resolver === null || resolver === void 0 ? void 0 : resolver[value === null || value === void 0 ? void 0 : value.type];
7
+ const contsentState = useMemo(() => {
8
+ return getContsentState();
9
+ }, []);
10
+ const t = resolver === null || resolver === void 0 ? void 0 : resolver['Display'];
12
11
  const Component = withBindDataSource(t);
13
- return (React.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 })));
12
+ 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;
13
+ return React.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 }));
14
14
  };
15
15
  export default memo(Consent);
@@ -8,7 +8,7 @@ const Navbar = ({ icon, styles, textStyle, onClose }) => {
8
8
  React.createElement("button", { className: 'clc-sxp-nav-left', role: 'button', "aria-label": 'back button', onClick: onClose },
9
9
  React.createElement("img", { src: icon, alt: 'back button' })),
10
10
  React.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: {
11
- __html: setFontForText(`#${(_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag) !== null && _a !== void 0 ? _a : 'title'}`, textStyle)
11
+ __html: setFontForText(`#${(_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag) !== null && _a !== void 0 ? _a : '标题'}`, textStyle)
12
12
  } })));
13
13
  };
14
14
  export default memo(Navbar);