@blaze-cms/react-page-builder 0.134.0-project-admin-customisations.0 → 0.134.0

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 (68) hide show
  1. package/CHANGELOG.md +4 -12
  2. package/lib/HOC/withTitle.js +12 -2
  3. package/lib/HOC/withTitle.js.map +1 -1
  4. package/lib/components/Banner/AdSlotRender.js +3 -12
  5. package/lib/components/Banner/AdSlotRender.js.map +1 -1
  6. package/lib/components/Banner/Banner.js +7 -4
  7. package/lib/components/Banner/Banner.js.map +1 -1
  8. package/lib/components/Banner/BannerRender.js +1 -5
  9. package/lib/components/Banner/BannerRender.js.map +1 -1
  10. package/lib/components/ContentGroupSection/ContentGroupSection.js +4 -1
  11. package/lib/components/ContentGroupSection/ContentGroupSection.js.map +1 -1
  12. package/lib/components/DataSummary/helpers/build-loop-props-content.js +2 -3
  13. package/lib/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
  14. package/lib/components/DataSummary/helpers/get-link-to-published-content.js +0 -2
  15. package/lib/components/DataSummary/helpers/get-link-to-published-content.js.map +1 -1
  16. package/lib/components/SearchFilter/components/Checkbox.js +3 -1
  17. package/lib/components/SearchFilter/components/Checkbox.js.map +1 -1
  18. package/lib-es/HOC/withTitle.js +11 -2
  19. package/lib-es/HOC/withTitle.js.map +1 -1
  20. package/lib-es/components/Banner/AdSlotRender.js +3 -12
  21. package/lib-es/components/Banner/AdSlotRender.js.map +1 -1
  22. package/lib-es/components/Banner/Banner.js +7 -4
  23. package/lib-es/components/Banner/Banner.js.map +1 -1
  24. package/lib-es/components/Banner/BannerRender.js +2 -6
  25. package/lib-es/components/Banner/BannerRender.js.map +1 -1
  26. package/lib-es/components/ContentGroupSection/ContentGroupSection.js +8 -4
  27. package/lib-es/components/ContentGroupSection/ContentGroupSection.js.map +1 -1
  28. package/lib-es/components/DataSummary/helpers/build-loop-props-content.js +2 -3
  29. package/lib-es/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
  30. package/lib-es/components/DataSummary/helpers/get-link-to-published-content.js +1 -2
  31. package/lib-es/components/DataSummary/helpers/get-link-to-published-content.js.map +1 -1
  32. package/lib-es/components/SearchFilter/components/Checkbox.js +3 -1
  33. package/lib-es/components/SearchFilter/components/Checkbox.js.map +1 -1
  34. package/package.json +11 -11
  35. package/src/HOC/withTitle.js +12 -2
  36. package/src/components/Banner/AdSlotRender.js +5 -9
  37. package/src/components/Banner/Banner.js +11 -9
  38. package/src/components/Banner/BannerRender.js +0 -4
  39. package/src/components/ContentGroupSection/ContentGroupSection.js +1 -1
  40. package/src/components/DataSummary/helpers/build-loop-props-content.js +2 -3
  41. package/src/components/DataSummary/helpers/get-link-to-published-content.js +1 -4
  42. package/src/components/SearchFilter/components/Checkbox.js +2 -0
  43. package/tests/unit/src/HOC/withTitle.test.js +4 -4
  44. package/tests/unit/src/components/Banner/AdSlotRender.test.js +11 -6
  45. package/tests/unit/src/components/Banner/BannerRender.test.js +4 -0
  46. package/tests/unit/src/components/Banner/__snapshots__/AdSlotRender.test.js.snap +25 -45
  47. package/tests/unit/src/components/Banner/__snapshots__/BannerRender.test.js.snap +3 -8
  48. package/tests/unit/src/components/Button.test.js +4 -0
  49. package/tests/unit/src/components/Card/CardContainer.test.js +4 -0
  50. package/tests/unit/src/components/Carousel/CarouselRender/CarouselRender.test.js +4 -0
  51. package/tests/unit/src/components/Code/Code.test.js +4 -0
  52. package/tests/unit/src/components/Code.test.js +4 -0
  53. package/tests/unit/src/components/DataSummary/DataSummaryTypes/ItemDetailsSummary.test.js +4 -0
  54. package/tests/unit/src/components/DataSummary/DataSummaryTypes/LargeSummary.test.js +4 -0
  55. package/tests/unit/src/components/DataSummary/DataSummaryTypes/ListSummary.test.js +4 -0
  56. package/tests/unit/src/components/DataSummary/DataSummaryTypes/TextSummary.test.js +4 -0
  57. package/tests/unit/src/components/DataSummary/helpers/build-loop-props-content.test.js +0 -41
  58. package/tests/unit/src/components/DataSummary/helpers/get-link-to-published-content.test.js +0 -21
  59. package/tests/unit/src/components/List/components/Cards/CardsRender.test.js +4 -0
  60. package/tests/unit/src/components/List/components/Cards/CardsRenderWrapper.test.js +4 -0
  61. package/tests/unit/src/components/SearchFilter/components/Checkbox.test.js +4 -0
  62. package/tests/unit/src/components/SearchFilter/components/Select.test.js +4 -0
  63. package/tests/unit/src/components/SearchFilter/components/TextSearch.test.js +4 -0
  64. package/tests/unit/src/components/SearchFilterSort/SearchFilterSort.test.js +4 -0
  65. package/tests/unit/src/components/SocialFollow/SocialFollow.test.js +4 -0
  66. package/tests/unit/src/components/TextBlock/TextBlock.test.js +4 -0
  67. package/tests/unit/src/components/PlaceholderIcon/__snapshots__/index.test.js.snap +0 -72
  68. package/tests/unit/src/components/PlaceholderIcon/index.test.js +0 -20
@@ -1 +1 @@
1
- {"version":3,"file":"withTitle.js","names":["React","Fragment","PropTypes","withTitle","Component","InnerComponent","props","elementTitle","isHeroImg","shouldDisplayTitle","createElement","className","WrappedComponent","displayName","name","propTypes","string","bool","defaultProps"],"sources":["../../src/HOC/withTitle.js"],"sourcesContent":["import React, { Fragment } from 'react';\nimport PropTypes from 'prop-types';\n\nconst withTitle = Component => {\n const InnerComponent = props => {\n const { elementTitle, isHeroImg } = props;\n const shouldDisplayTitle = elementTitle && !isHeroImg;\n\n return (\n <Fragment>\n {shouldDisplayTitle && <h2 className=\"heading heading--section\">{elementTitle}</h2>}\n <Component {...props} />\n </Fragment>\n );\n };\n\n InnerComponent.WrappedComponent = Component;\n\n InnerComponent.displayName = `WithTitle(${Component.displayName ||\n Component.name ||\n 'Component'})`;\n\n InnerComponent.propTypes = {\n elementTitle: PropTypes.string,\n isHeroImg: PropTypes.bool\n };\n InnerComponent.defaultProps = {\n elementTitle: '',\n isHeroImg: false\n };\n\n return InnerComponent;\n};\n\nexport default withTitle;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,OAAOC,SAAS,MAAM,YAAY;AAElC,MAAMC,SAAS,GAAGC,SAAS,IAAI;EAC7B,MAAMC,cAAc,GAAGC,KAAK,IAAI;IAC9B,MAAM;MAAEC,YAAY;MAAEC;IAAU,CAAC,GAAGF,KAAK;IACzC,MAAMG,kBAAkB,GAAGF,YAAY,IAAI,CAACC,SAAS;IAErD,oBACER,KAAA,CAAAU,aAAA,CAACT,QAAQ,QACNQ,kBAAkB,iBAAIT,KAAA,CAAAU,aAAA;MAAIC,SAAS,EAAC;IAA0B,GAAEJ,YAAiB,CAAC,eACnFP,KAAA,CAAAU,aAAA,CAACN,SAAS,EAAKE,KAAQ,CACf,CAAC;EAEf,CAAC;EAEDD,cAAc,CAACO,gBAAgB,GAAGR,SAAS;EAE3CC,cAAc,CAACQ,WAAW,GAAI,aAAYT,SAAS,CAACS,WAAW,IAC7DT,SAAS,CAACU,IAAI,IACd,WAAY,GAAE;EAEhBT,cAAc,CAACU,SAAS,GAAG;IACzBR,YAAY,EAAEL,SAAS,CAACc,MAAM;IAC9BR,SAAS,EAAEN,SAAS,CAACe;EACvB,CAAC;EACDZ,cAAc,CAACa,YAAY,GAAG;IAC5BX,YAAY,EAAE,EAAE;IAChBC,SAAS,EAAE;EACb,CAAC;EAED,OAAOH,cAAc;AACvB,CAAC;AAED,eAAeF,SAAS"}
1
+ {"version":3,"file":"withTitle.js","names":["React","Fragment","PropTypes","useStringTemplate","withTitle","Component","InnerComponent","props","elementTitle","isHeroImg","parent","shouldDisplayTitle","loading","data","elementTitleToUse","createElement","className","WrappedComponent","displayName","name","propTypes","object","string","bool","defaultProps"],"sources":["../../src/HOC/withTitle.js"],"sourcesContent":["import React, { Fragment } from 'react';\nimport PropTypes from 'prop-types';\nimport { useStringTemplate } from '@blaze-cms/utils-handlebars';\n\nconst withTitle = Component => {\n const InnerComponent = props => {\n const { elementTitle, isHeroImg, parent } = props;\n\n const shouldDisplayTitle = elementTitle && !isHeroImg;\n const {\n loading,\n data: [elementTitleToUse]\n } = useStringTemplate(parent, [elementTitle]);\n\n if (loading) return '';\n\n return (\n <Fragment>\n {shouldDisplayTitle && <h2 className=\"heading heading--section\">{elementTitleToUse}</h2>}\n <Component {...props} />\n </Fragment>\n );\n };\n\n InnerComponent.WrappedComponent = Component;\n\n InnerComponent.displayName = `WithTitle(${Component.displayName ||\n Component.name ||\n 'Component'})`;\n\n InnerComponent.propTypes = {\n parent: PropTypes.object,\n elementTitle: PropTypes.string,\n isHeroImg: PropTypes.bool\n };\n InnerComponent.defaultProps = {\n parent: {},\n elementTitle: '',\n isHeroImg: false\n };\n\n return InnerComponent;\n};\n\nexport default withTitle;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,iBAAiB,QAAQ,6BAA6B;AAE/D,MAAMC,SAAS,GAAGC,SAAS,IAAI;EAC7B,MAAMC,cAAc,GAAGC,KAAK,IAAI;IAC9B,MAAM;MAAEC,YAAY;MAAEC,SAAS;MAAEC;IAAO,CAAC,GAAGH,KAAK;IAEjD,MAAMI,kBAAkB,GAAGH,YAAY,IAAI,CAACC,SAAS;IACrD,MAAM;MACJG,OAAO;MACPC,IAAI,EAAE,CAACC,iBAAiB;IAC1B,CAAC,GAAGX,iBAAiB,CAACO,MAAM,EAAE,CAACF,YAAY,CAAC,CAAC;IAE7C,IAAII,OAAO,EAAE,OAAO,EAAE;IAEtB,oBACEZ,KAAA,CAAAe,aAAA,CAACd,QAAQ,QACNU,kBAAkB,iBAAIX,KAAA,CAAAe,aAAA;MAAIC,SAAS,EAAC;IAA0B,GAAEF,iBAAsB,CAAC,eACxFd,KAAA,CAAAe,aAAA,CAACV,SAAS,EAAKE,KAAQ,CACf,CAAC;EAEf,CAAC;EAEDD,cAAc,CAACW,gBAAgB,GAAGZ,SAAS;EAE3CC,cAAc,CAACY,WAAW,GAAI,aAAYb,SAAS,CAACa,WAAW,IAC7Db,SAAS,CAACc,IAAI,IACd,WAAY,GAAE;EAEhBb,cAAc,CAACc,SAAS,GAAG;IACzBV,MAAM,EAAER,SAAS,CAACmB,MAAM;IACxBb,YAAY,EAAEN,SAAS,CAACoB,MAAM;IAC9Bb,SAAS,EAAEP,SAAS,CAACqB;EACvB,CAAC;EACDjB,cAAc,CAACkB,YAAY,GAAG;IAC5Bd,MAAM,EAAE,CAAC,CAAC;IACVF,YAAY,EAAE,EAAE;IAChBC,SAAS,EAAE;EACb,CAAC;EAED,OAAOH,cAAc;AACvB,CAAC;AAED,eAAeF,SAAS"}
@@ -2,14 +2,12 @@ import React, { useState } from 'react';
2
2
  import { AdSlot } from 'react-dfp';
3
3
  import PropTypes from 'prop-types';
4
4
  import { BANNER_LOADING, BANNER_EMPTY, BANNER_LOADED } from '../../constants';
5
- import Wrapper from '../Wrapper';
6
5
  const AdSlotRender = ({
7
6
  shouldShowBanner,
8
7
  sizeMapping,
9
8
  sizeId,
10
9
  parsedAdunit,
11
10
  parsedSizes,
12
- modifiers,
13
11
  targetingArguments
14
12
  }) => {
15
13
  const [{
@@ -25,16 +23,11 @@ const AdSlotRender = ({
25
23
  return `@media(min-width:${minWidth}px){.${bannerClass}{min-height:${minimumHeight}px;}`;
26
24
  }).sort();
27
25
  const className = `ad-slot ad-slot-${loadingStatus} ${bannerClass}`;
28
- const newModifers = `${modifiers} banner-${loadingStatus}`;
29
- return /*#__PURE__*/React.createElement(Wrapper, {
30
- className: "banner",
31
- modifiers: newModifers
32
- }, styles && /*#__PURE__*/React.createElement("style", null, styles.join('\n')), /*#__PURE__*/React.createElement("div", {
26
+ return /*#__PURE__*/React.createElement(React.Fragment, null, styles && /*#__PURE__*/React.createElement("style", null, styles.join('\n')), /*#__PURE__*/React.createElement("div", {
33
27
  className: className,
34
28
  style: {
35
29
  minHeight
36
- },
37
- "data-testid": "ad-slot"
30
+ }
38
31
  }, shouldShowBanner && /*#__PURE__*/React.createElement(AdSlot, {
39
32
  adUnit: parsedAdunit,
40
33
  sizes: parsedSizes,
@@ -62,12 +55,10 @@ AdSlotRender.propTypes = {
62
55
  sizeId: PropTypes.string.isRequired,
63
56
  parsedAdunit: PropTypes.string.isRequired,
64
57
  parsedSizes: PropTypes.array,
65
- modifiers: PropTypes.string,
66
58
  targetingArguments: PropTypes.object.isRequired
67
59
  };
68
60
  AdSlotRender.defaultProps = {
69
- parsedSizes: null,
70
- modifiers: ''
61
+ parsedSizes: null
71
62
  };
72
63
  export default AdSlotRender;
73
64
  //# sourceMappingURL=AdSlotRender.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AdSlotRender.js","names":["React","useState","AdSlot","PropTypes","BANNER_LOADING","BANNER_EMPTY","BANNER_LOADED","Wrapper","AdSlotRender","shouldShowBanner","sizeMapping","sizeId","parsedAdunit","parsedSizes","modifiers","targetingArguments","loadingStatus","minHeight","setLoadingStatus","bannerClass","styles","map","sizes","styleSizes","viewport","minWidth","minimumHeight","Math","min","height","sort","className","newModifers","createElement","join","style","adUnit","onSlotRender","slotData","event","isEmpty","size","slotHeight","length","undefined","newLoadingStatus","propTypes","bool","isRequired","array","string","object","defaultProps"],"sources":["../../../src/components/Banner/AdSlotRender.js"],"sourcesContent":["import React, { useState } from 'react';\nimport { AdSlot } from 'react-dfp';\nimport PropTypes from 'prop-types';\nimport { BANNER_LOADING, BANNER_EMPTY, BANNER_LOADED } from '../../constants';\nimport Wrapper from '../Wrapper';\n\nconst AdSlotRender = ({\n shouldShowBanner,\n sizeMapping,\n sizeId,\n parsedAdunit,\n parsedSizes,\n modifiers,\n targetingArguments\n}) => {\n const [{ loadingStatus = BANNER_LOADING, minHeight }, setLoadingStatus] = useState({});\n\n const bannerClass = `banner-${sizeId}`;\n\n const styles =\n loadingStatus === BANNER_LOADING &&\n sizeMapping\n .map(({ sizes: styleSizes, viewport: [minWidth] }) => {\n const minimumHeight = Math.min(...styleSizes.map(([, height]) => height));\n return `@media(min-width:${minWidth}px){.${bannerClass}{min-height:${minimumHeight}px;}`;\n })\n .sort();\n const className = `ad-slot ad-slot-${loadingStatus} ${bannerClass}`;\n const newModifers = `${modifiers} banner-${loadingStatus}`;\n return (\n <Wrapper className=\"banner\" modifiers={newModifers}>\n {styles && <style>{styles.join('\\n')}</style>}\n <div className={className} style={{ minHeight }} data-testid=\"ad-slot\">\n {shouldShowBanner && (\n <AdSlot\n adUnit={parsedAdunit}\n sizes={parsedSizes}\n targetingArguments={targetingArguments}\n sizeMapping={sizeMapping}\n onSlotRender={slotData => {\n const {\n event: { isEmpty, size }\n } = slotData;\n const slotHeight = size && size.length ? size[1] : undefined;\n const newLoadingStatus = isEmpty ? BANNER_EMPTY : BANNER_LOADED;\n setLoadingStatus({ loadingStatus: newLoadingStatus, minHeight: slotHeight });\n }}\n />\n )}\n </div>\n </Wrapper>\n );\n};\n\nAdSlotRender.propTypes = {\n shouldShowBanner: PropTypes.bool.isRequired,\n sizeMapping: PropTypes.array.isRequired,\n sizeId: PropTypes.string.isRequired,\n parsedAdunit: PropTypes.string.isRequired,\n parsedSizes: PropTypes.array,\n modifiers: PropTypes.string,\n targetingArguments: PropTypes.object.isRequired\n};\n\nAdSlotRender.defaultProps = {\n parsedSizes: null,\n modifiers: ''\n};\n\nexport default AdSlotRender;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,MAAM,QAAQ,WAAW;AAClC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,cAAc,EAAEC,YAAY,EAAEC,aAAa,QAAQ,iBAAiB;AAC7E,OAAOC,OAAO,MAAM,YAAY;AAEhC,MAAMC,YAAY,GAAGA,CAAC;EACpBC,gBAAgB;EAChBC,WAAW;EACXC,MAAM;EACNC,YAAY;EACZC,WAAW;EACXC,SAAS;EACTC;AACF,CAAC,KAAK;EACJ,MAAM,CAAC;IAAEC,aAAa,GAAGZ,cAAc;IAAEa;EAAU,CAAC,EAAEC,gBAAgB,CAAC,GAAGjB,QAAQ,CAAC,CAAC,CAAC,CAAC;EAEtF,MAAMkB,WAAW,GAAI,UAASR,MAAO,EAAC;EA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AgB,GAAGL,OAAO,GAAGnC,YAAY,GAAGC,aAAa;MAC/DY,gBAAgB,CAAC;QAAEF,aAAa,EAAE6B,gBAAgB;QAAE5B,SAAS,EAAEyB;MAAW,CAAC,CAAC;IAC9E;EAAE,CACH,CAEA,CACE,CAAC;AAEd,CAAC;AAEDlC,YAAY,CAACsC,SAAS,GAAG;EACvBrC,gBAAgB,EAAEN,SAAS,CAAC4C,IAAI,CAACC,UAAU;EAC3CtC,WAAW,EAAEP,SAAS,CAAC8C,KAAK,CAACD,UAAU;EACvCrC,MAAM,EAAER,SAAS,CAAC+C,MAAM,CAACF,UAAU;EACnCpC,YAAY,EAAET,SAAS,CAAC+C,MAAM,CAACF,UAAU;EACzCnC,WAAW,EAAEV,SAAS,CAAC8C,KAAK;EAC5BnC,SAAS,EAAEX,SAAS,CAAC+C,MAAM;EAC3BnC,kBAAkB,EAAEZ,SAAS,CAACgD,MAAM,CAACH;AACvC,CAAC;AAEDxC,YAAY,CAAC4C,YAAY,GAAG;EAC1BvC,WAAW,EAAE,IAAI;EACjBC,SAAS,EAAE;AACb,CAAC;AAED,eAAeN,YAAY"}
1
+ {"version":3,"file":"AdSlotRender.js","names":["React","useState","AdSlot","PropTypes","BANNER_LOADING","BANNER_EMPTY","BANNER_LOADED","AdSlotRender","shouldShowBanner","sizeMapping","sizeId","parsedAdunit","parsedSizes","targetingArguments","loadingStatus","minHeight","setLoadingStatus","bannerClass","styles","map","sizes","styleSizes","viewport","minWidth","minimumHeight","Math","min","height","sort","className","createElement","Fragment","join","style","adUnit","onSlotRender","slotData","event","isEmpty","size","slotHeight","length","undefined","newLoadingStatus","propTypes","bool","isRequired","array","string","object","defaultProps"],"sources":["../../../src/components/Banner/AdSlotRender.js"],"sourcesContent":["import React, { useState } from 'react';\nimport { AdSlot } from 'react-dfp';\nimport PropTypes from 'prop-types';\nimport { BANNER_LOADING, BANNER_EMPTY, BANNER_LOADED } from '../../constants';\n\nconst AdSlotRender = ({\n shouldShowBanner,\n sizeMapping,\n sizeId,\n parsedAdunit,\n parsedSizes,\n targetingArguments\n}) => {\n const [{ loadingStatus = BANNER_LOADING, minHeight }, setLoadingStatus] = useState({});\n\n const bannerClass = `banner-${sizeId}`;\n\n const styles =\n loadingStatus === BANNER_LOADING &&\n sizeMapping\n .map(({ sizes: styleSizes, viewport: [minWidth] }) => {\n const minimumHeight = Math.min(...styleSizes.map(([, height]) => height));\n return `@media(min-width:${minWidth}px){.${bannerClass}{min-height:${minimumHeight}px;}`;\n })\n .sort();\n const className = `ad-slot ad-slot-${loadingStatus} ${bannerClass}`;\n\n return (\n <>\n {styles && <style>{styles.join('\\n')}</style>}\n <div className={className} style={{ minHeight }}>\n {shouldShowBanner && (\n <AdSlot\n adUnit={parsedAdunit}\n sizes={parsedSizes}\n targetingArguments={targetingArguments}\n sizeMapping={sizeMapping}\n onSlotRender={slotData => {\n const {\n event: { isEmpty, size }\n } = slotData;\n const slotHeight = size && size.length ? size[1] : undefined;\n const newLoadingStatus = isEmpty ? BANNER_EMPTY : BANNER_LOADED;\n setLoadingStatus({ loadingStatus: newLoadingStatus, minHeight: slotHeight });\n }}\n />\n )}\n </div>\n </>\n );\n};\n\nAdSlotRender.propTypes = {\n shouldShowBanner: PropTypes.bool.isRequired,\n sizeMapping: PropTypes.array.isRequired,\n sizeId: PropTypes.string.isRequired,\n parsedAdunit: PropTypes.string.isRequired,\n parsedSizes: PropTypes.array,\n targetingArguments: PropTypes.object.isRequired\n};\n\nAdSlotRender.defaultProps = {\n parsedSizes: null\n};\n\nexport default AdSlotRender;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,MAAM,QAAQ,WAAW;AAClC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,cAAc,EAAEC,YAAY,EAAEC,aAAa,QAAQ,iBAAiB;AAE7E,MAAMC,YAAY,GAAGA,CAAC;EACpBC,gBAAgB;EAChBC,WAAW;EACXC,MAAM;EACNC,YAAY;EACZC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I,IAAIA,IAAI,CAACE,MAAM,GAAGF,IAAI,CAAC,CAAC,CAAC,GAAGG,SAAS;MAC5D,MAAMC,gBAAgB,GAAGL,OAAO,GAAGjC,YAAY,GAAGC,aAAa;MAC/DU,gBAAgB,CAAC;QAAEF,aAAa,EAAE6B,gBAAgB;QAAE5B,SAAS,EAAEyB;MAAW,CAAC,CAAC;IAC9E;EAAE,CACH,CAEA,CACL,CAAC;AAEP,CAAC;AAEDjC,YAAY,CAACqC,SAAS,GAAG;EACvBpC,gBAAgB,EAAEL,SAAS,CAAC0C,IAAI,CAACC,UAAU;EAC3CrC,WAAW,EAAEN,SAAS,CAAC4C,KAAK,CAACD,UAAU;EACvCpC,MAAM,EAAEP,SAAS,CAAC6C,MAAM,CAACF,UAAU;EACnCnC,YAAY,EAAER,SAAS,CAAC6C,MAAM,CAACF,UAAU;EACzClC,WAAW,EAAET,SAAS,CAAC4C,KAAK;EAC5BlC,kBAAkB,EAAEV,SAAS,CAAC8C,MAAM,CAACH;AACvC,CAAC;AAEDvC,YAAY,CAAC2C,YAAY,GAAG;EAC1BtC,WAAW,EAAE;AACf,CAAC;AAED,eAAeL,YAAY"}
@@ -10,6 +10,7 @@ import { useQuery } from '@apollo/client';
10
10
  import { useRouter } from 'next/router';
11
11
  import { buildUserQuery, buildPropsData } from './helpers';
12
12
  import { getSingleEntitySchema, getUser } from '../../application/query';
13
+ import Wrapper from '../Wrapper';
13
14
  import BannerRender from './BannerRender';
14
15
  import buildPropsQuery from '../../helpers/build-props-query';
15
16
  import { getClassModifiers } from '../../utils';
@@ -74,15 +75,17 @@ const Banner = _ref => {
74
75
  action
75
76
  } = getEntityRenderProps(queryProps, data, isPreview);
76
77
  const bannerKey = `${sizeId}${asPath}`;
77
- return /*#__PURE__*/React.createElement(BannerRender, _extends({
78
+ return /*#__PURE__*/React.createElement(Wrapper, {
79
+ className: type,
80
+ modifiers: modifiers
81
+ }, /*#__PURE__*/React.createElement(BannerRender, _extends({
78
82
  key: bannerKey
79
83
  }, otherProps, {
80
84
  action: action,
81
85
  actionKey: actionKey,
82
86
  asPath: asPath,
83
- userPropsData: userPropsData,
84
- modifiers: modifiers
85
- }));
87
+ userPropsData: userPropsData
88
+ })));
86
89
  };
87
90
  Banner.propTypes = {
88
91
  type: PropTypes.string
@@ -1 +1 @@
1
- {"version":3,"file":"Banner.js","names":["React","useContext","MainContext","checkIfLoggedIn","PropTypes","flatten","useQuery","useRouter","buildUserQuery","buildPropsData","getSingleEntitySchema","getUser","BannerRender","buildPropsQuery","getClassModifiers","getEntityRenderProps","Banner","_ref","type","otherProps","_objectWithoutProperties","_excluded","router","isPreview","id","userId","asPath","parent","entity","sizeId","propsToDisplay","userPropsToDisplay","userQuery","itemEntity","data","error","loading","variables","userData","userLoading","skip","length","message","modifiers","queryProps","map","propertiesToDisplay","userPropsData","actionKey","action","bannerKey","createElement","_extends","key","propTypes","string","defaultProps"],"sources":["../../../src/components/Banner/Banner.js"],"sourcesContent":["import React, { useContext } from 'react';\nimport { MainContext } from '@blaze-cms/nextjs-components';\nimport { checkIfLoggedIn } from '@blaze-cms/core-auth-ui';\nimport PropTypes from 'prop-types';\nimport flatten from 'lodash.flatten';\nimport { useQuery } from '@apollo/client';\nimport { useRouter } from 'next/router';\nimport { buildUserQuery, buildPropsData } from './helpers';\nimport { getSingleEntitySchema, getUser } from '../../application/query';\nimport BannerRender from './BannerRender';\nimport buildPropsQuery from '../../helpers/build-props-query';\nimport { getClassModifiers } from '../../utils';\nimport getEntityRenderProps from '../../helpers/get-entity-render-props';\n\nconst Banner = ({ type, ...otherProps }) => {\n const router = useRouter();\n const { isPreview } = useContext(MainContext);\n const { id: userId } = checkIfLoggedIn();\n const { asPath } = router;\n const { parent, entity, sizeId, propsToDisplay = [], userPropsToDisplay = [] } = otherProps;\n const userQuery = buildUserQuery(userPropsToDisplay);\n const { itemEntity } = parent;\n const { data, error, loading } = useQuery(getSingleEntitySchema, {\n variables: { id: entity || itemEntity }\n });\n const { data: { getUser: userData } = {}, loading: userLoading } = useQuery(getUser(userQuery), {\n variables: { id: userId },\n skip: !userPropsToDisplay.length || !userId\n });\n\n if (loading || userLoading) return '';\n if (error) return error.message;\n if (!data) return null;\n if (!sizeId) return null;\n\n const modifiers = getClassModifiers('banner', otherProps);\n const queryProps = buildPropsQuery(\n data,\n propsToDisplay.length\n ? flatten(propsToDisplay.map(({ propertiesToDisplay }) => propertiesToDisplay))\n : []\n );\n\n const userPropsData = buildPropsData(userData, userPropsToDisplay);\n const { actionKey, action } = getEntityRenderProps(queryProps, data, isPreview);\n const bannerKey = `${sizeId}${asPath}`;\n\n return (\n <BannerRender\n key={bannerKey}\n {...otherProps}\n action={action}\n actionKey={actionKey}\n asPath={asPath}\n userPropsData={userPropsData}\n modifiers={modifiers}\n />\n );\n};\n\nBanner.propTypes = {\n type: PropTypes.string\n};\n\nBanner.defaultProps = {\n type: 'banner'\n};\n\nexport default Banner;\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,WAAW,QAAQ,8BAA8B;AAC1D,SAASC,eAAe,QAAQ,yBAAyB;AACzD,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,OAAO,MAAM,gBAAgB;AACpC,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,cAAc,EAAEC,cAAc,QAAQ,WAAW;AAC1D,SAASC,qBAAqB,EAAEC,OAAO,QAAQ,yBAAyB;AACxE,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,eAAe,MAAM,iCAAiC;AAC7D,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,OAAOC,oBAAoB,MAAM,uCAAuC;AAExE,MAAMC,MAAM,GAAGC,IAAA,IAA6B;EAAA,IAA5B;MAAEC;IAAoB,CAAC,GAAAD,IAAA;IAAZE,UAAU,GAAAC,wBAAA,CAAAH,IAAA,EAAAI,SAAA;EACnC,MAAMC,MAAM,GAAGf,SAAS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ACjBpC,OAAO,CAACyB,cAAc,CAACe,GAAG,CAAC,CAAC;IAAEC;EAAoB,CAAC,KAAKA,mBAAmB,CAAC,CAAC,GAC7E,EACN,CAAC;EAED,MAAMC,aAAa,GAAGtC,cAAc,CAAC6B,QAAQ,EAAEP,kBAAkB,CAAC;EAClE,MAAM;IAAEiB,SAAS;IAAEC;EAAO,CAAC,GAAGlC,oBAAoB,CAAC6B,UAAU,EAAEV,IAAI,EAAEX,SAAS,CAAC;EAC/E,MAAM2B,SAAS,GAAI,GAAErB,MAAO,GAAEH,MAAO,EAAC;EAEtC,oBACE1B,KAAA,CAAAmD,aAAA,CAACvC,YAAY,EAAAwC,QAAA;IACXC,GAAG,EAAEH;EAAU,GACX/B,UAAU;IACd8B,MAAM,EAAEA,MAAO;IACfD,SAAS,EAAEA,SAAU;IACrBtB,MAAM,EAAEA,MAAO;IACfqB,aAAa,EAAEA,aAAc;IAC7BJ,SAAS,EAAEA;EAAU,EACtB,CAAC;AAEN,CAAC;AAED3B,MAAM,CAACsC,SAAS,GAAG;EACjBpC,IAAI,EAAEd,SAAS,CAACmD;AAClB,CAAC;AAEDvC,MAAM,CAACwC,YAAY,GAAG;EACpBtC,IAAI,EAAE;AACR,CAAC;AAED,eAAeF,MAAM"}
1
+ {"version":3,"file":"Banner.js","names":["React","useContext","MainContext","checkIfLoggedIn","PropTypes","flatten","useQuery","useRouter","buildUserQuery","buildPropsData","getSingleEntitySchema","getUser","Wrapper","BannerRender","buildPropsQuery","getClassModifiers","getEntityRenderProps","Banner","_ref","type","otherProps","_objectWithoutProperties","_excluded","router","isPreview","id","userId","asPath","parent","entity","sizeId","propsToDisplay","userPropsToDisplay","userQuery","itemEntity","data","error","loading","variables","userData","userLoading","skip","length","message","modifiers","queryProps","map","propertiesToDisplay","userPropsData","actionKey","action","bannerKey","createElement","className","_extends","key","propTypes","string","defaultProps"],"sources":["../../../src/components/Banner/Banner.js"],"sourcesContent":["import React, { useContext } from 'react';\nimport { MainContext } from '@blaze-cms/nextjs-components';\nimport { checkIfLoggedIn } from '@blaze-cms/core-auth-ui';\nimport PropTypes from 'prop-types';\nimport flatten from 'lodash.flatten';\nimport { useQuery } from '@apollo/client';\nimport { useRouter } from 'next/router';\nimport { buildUserQuery, buildPropsData } from './helpers';\nimport { getSingleEntitySchema, getUser } from '../../application/query';\nimport Wrapper from '../Wrapper';\nimport BannerRender from './BannerRender';\nimport buildPropsQuery from '../../helpers/build-props-query';\nimport { getClassModifiers } from '../../utils';\nimport getEntityRenderProps from '../../helpers/get-entity-render-props';\n\nconst Banner = ({ type, ...otherProps }) => {\n const router = useRouter();\n const { isPreview } = useContext(MainContext);\n const { id: userId } = checkIfLoggedIn();\n const { asPath } = router;\n const { parent, entity, sizeId, propsToDisplay = [], userPropsToDisplay = [] } = otherProps;\n const userQuery = buildUserQuery(userPropsToDisplay);\n const { itemEntity } = parent;\n const { data, error, loading } = useQuery(getSingleEntitySchema, {\n variables: { id: entity || itemEntity }\n });\n const { data: { getUser: userData } = {}, loading: userLoading } = useQuery(getUser(userQuery), {\n variables: { id: userId },\n skip: !userPropsToDisplay.length || !userId\n });\n\n if (loading || userLoading) return '';\n if (error) return error.message;\n if (!data) return null;\n if (!sizeId) return null;\n\n const modifiers = getClassModifiers('banner', otherProps);\n const queryProps = buildPropsQuery(\n data,\n propsToDisplay.length\n ? flatten(propsToDisplay.map(({ propertiesToDisplay }) => propertiesToDisplay))\n : []\n );\n\n const userPropsData = buildPropsData(userData, userPropsToDisplay);\n const { actionKey, action } = getEntityRenderProps(queryProps, data, isPreview);\n const bannerKey = `${sizeId}${asPath}`;\n\n return (\n <Wrapper className={type} modifiers={modifiers}>\n <BannerRender\n key={bannerKey}\n {...otherProps}\n action={action}\n actionKey={actionKey}\n asPath={asPath}\n userPropsData={userPropsData}\n />\n </Wrapper>\n );\n};\n\nBanner.propTypes = {\n type: PropTypes.string\n};\n\nBanner.defaultProps = {\n type: 'banner'\n};\n\nexport default Banner;\n"],"mappings":";;;AAAA,OA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;IACd8B,MAAM,EAAEA,MAAO;IACfD,SAAS,EAAEA,SAAU;IACrBtB,MAAM,EAAEA,MAAO;IACfqB,aAAa,EAAEA;EAAc,EAC9B,CACM,CAAC;AAEd,CAAC;AAED/B,MAAM,CAACuC,SAAS,GAAG;EACjBrC,IAAI,EAAEf,SAAS,CAACqD;AAClB,CAAC;AAEDxC,MAAM,CAACyC,YAAY,GAAG;EACpBvC,IAAI,EAAE;AACR,CAAC;AAED,eAAeF,MAAM"}
@@ -1,6 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- const _excluded = ["baseAdunit", "adunit", "sizeId", "sizes", "propsToDisplay", "entity", "targetings", "parent", "asPath", "action", "actionKey", "renderCounter", "userPropsData", "modifiers"];
3
+ const _excluded = ["baseAdunit", "adunit", "sizeId", "sizes", "propsToDisplay", "entity", "targetings", "parent", "asPath", "action", "actionKey", "renderCounter", "userPropsData"];
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
6
  import React from 'react';
@@ -25,8 +25,7 @@ const BannerRender = _ref => {
25
25
  action,
26
26
  actionKey,
27
27
  renderCounter,
28
- userPropsData,
29
- modifiers
28
+ userPropsData
30
29
  } = _ref,
31
30
  otherProps = _objectWithoutProperties(_ref, _excluded);
32
31
  const {
@@ -89,7 +88,6 @@ const BannerRender = _ref => {
89
88
  sizeId: sizeId,
90
89
  parsedAdunit: parsedAdunit,
91
90
  parsedSizes: parsedSizes,
92
- modifiers: modifiers,
93
91
  targetingArguments: targetingArguments
94
92
  });
95
93
  };
@@ -106,7 +104,6 @@ BannerRender.propTypes = {
106
104
  targetings: PropTypes.string,
107
105
  sizes: PropTypes.string,
108
106
  renderCounter: PropTypes.number,
109
- modifiers: PropTypes.string,
110
107
  userPropsData: PropTypes.object
111
108
  };
112
109
  BannerRender.defaultProps = {
@@ -118,7 +115,6 @@ BannerRender.defaultProps = {
118
115
  targetings: '',
119
116
  sizes: '',
120
117
  renderCounter: null,
121
- modifiers: '',
122
118
  userPropsData: {}
123
119
  };
124
120
  export default withTitle(BannerRender);
@@ -1 +1 @@
1
- {"version":3,"file":"BannerRender.js","names":["React","PropTypes","useQuery","generateSingleItemQuery","getCount","buildBannerSizes","buildContextualTargeting","buildParsedAdunit","buildSizeMapping","setCustomTargetings","BANNER_QUERY_PROPS","COUNT_CONTENT_HIERARCHIES","GET_BANNER","PUBLISHED","withTitle","AdSlotRender","BannerRender","_ref","baseAdunit","adunit","sizeId","sizes","propsToDisplay","entity","targetings","parent","asPath","action","actionKey","renderCounter","userPropsData","modifiers","otherProps","_objectWithoutProperties","_excluded","id","itemId","data","entityRecordData","variables","where","skip","bannerData","parentId","childEntity","_ilike","parsedTargetings","entityData","bannerSizes","sizeMapping","parsedSizes","countContentHierarchies","parsedAdunit","isContextualTargetingSet","length","Object","keys","isContextualTargetingReady","shouldShowBanner","customTargetings","targetingArguments","_objectSpread","createElement","propTypes","object","isRequired","string","array","number","defaultProps"],"sources":["../../../src/components/Banner/BannerRender.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { useQuery } from '@apollo/client';\n\nimport { generateSingleItemQuery, getCount } from '../../application/query';\nimport {\n buildBannerSizes,\n buildContextualTargeting,\n buildParsedAdunit,\n buildSizeMapping,\n setCustomTargetings\n} from './helpers';\nimport {\n BANNER_QUERY_PROPS,\n COUNT_CONTENT_HIERARCHIES,\n GET_BANNER,\n PUBLISHED\n} from '../../constants';\nimport { withTitle } from '../../HOC';\nimport AdSlotRender from './AdSlotRender';\n\nconst BannerRender = ({\n baseAdunit,\n adunit,\n sizeId,\n sizes,\n propsToDisplay,\n entity,\n targetings,\n parent,\n asPath,\n action,\n actionKey,\n renderCounter,\n userPropsData,\n modifiers,\n ...otherProps\n}) => {\n const { id } = otherProps;\n const { itemId } = parent;\n\n const { data: entityRecordData = {} } = useQuery(action, {\n variables: { where: { id: id || itemId } },\n skip: id && id !== itemId\n });\n\n const { data: bannerData = {} } = useQuery(\n generateSingleItemQuery(GET_BANNER, BANNER_QUERY_PROPS),\n {\n variables: { id: sizeId },\n skip: !sizeId\n }\n );\n\n const { data = {} } = useQuery(getCount(COUNT_CONTENT_HIERARCHIES), {\n variables: {\n where: {\n parentId: id || itemId,\n childEntity: {\n _ilike: `${PUBLISHED}_%`\n }\n }\n }\n });\n\n const parsedTargetings = buildContextualTargeting(actionKey, entityRecordData, propsToDisplay);\n const { entityData } = bannerData;\n const { sizes: bannerSizes } = entityData || {};\n\n const sizeMapping = buildSizeMapping(sizeId, bannerSizes);\n const parsedSizes = buildBannerSizes(sizeId, bannerSizes, sizes);\n\n const { countContentHierarchies } = data;\n\n const parsedAdunit = buildParsedAdunit(asPath, countContentHierarchies, baseAdunit, adunit);\n const isContextualTargetingSet =\n propsToDisplay.length && parsedTargetings && Object.keys(parsedTargetings).length;\n const isContextualTargetingReady = isContextualTargetingSet || !propsToDisplay.length;\n const shouldShowBanner =\n parsedAdunit && parsedSizes && !!parsedSizes.length && isContextualTargetingReady;\n\n const customTargetings = setCustomTargetings(targetings, renderCounter);\n\n const targetingArguments = { ...parsedTargetings, ...customTargetings, ...userPropsData };\n\n return (\n <AdSlotRender\n shouldShowBanner={!!shouldShowBanner}\n sizeMapping={sizeMapping}\n sizeId={sizeId}\n parsedAdunit={parsedAdunit}\n parsedSizes={parsedSizes}\n modifiers={modifiers}\n targetingArguments={targetingArguments}\n />\n );\n};\n\nBannerRender.propTypes = {\n parent: PropTypes.object.isRequired,\n asPath: PropTypes.string.isRequired,\n action: PropTypes.object.isRequired,\n actionKey: PropTypes.string.isRequired,\n adunit: PropTypes.string,\n baseAdunit: PropTypes.string,\n sizeId: PropTypes.string,\n propsToDisplay: PropTypes.array,\n entity: PropTypes.string,\n targetings: PropTypes.string,\n sizes: PropTypes.string,\n renderCounter: PropTypes.number,\n modifiers: PropTypes.string,\n userPropsData: PropTypes.object\n};\n\nBannerRender.defaultProps = {\n adunit: '',\n baseAdunit: '',\n sizeId: '',\n propsToDisplay: [],\n entity: '',\n targetings: '',\n sizes: '',\n renderCounter: null,\n modifiers: '',\n userPropsData: {}\n};\n\nexport default withTitle(BannerRender);\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAElC,SAASC,QAAQ,QAAQ,gBAAgB;AAEzC,SAASC,uBAAuB,EAAEC,QAAQ,QAAQ,yBAAyB;AAC3E,SACEC,gBAAgB,EAChBC,wBAAwB,EACxBC,iBAAiB,EACjBC,gBAAgB,EAChBC,mBAAmB,QACd,WAAW;AAClB,SACEC,kBAAkB,EAClBC,yBAAyB,EACzBC,UAAU,EACVC,SAAS,QACJ,iBAAiB;AACxB,SAASC,SAAS,QAAQ,WAAW;AACrC,OAAOC,YAAY,MAAM,gBAAgB;AAEzC,MAAMC,YAAY,GAAGC,IAAA,IAgBf;EAAA,IAhBgB;MACpBC,UAAU;MACVC,MAAM;MACNC,MAAM;MACNC,KAAK;MACLC,cAAc;MACdC,MAAM;MACNC,UAAU;MACVC,MAAM;MACNC,MAAM;MACNC,MAAM;MACNC,SAAS;MACTC,aAAa;MACbC,aAAa;MACbC;IAEF,CAAC,GAAAd,IAAA;IADIe,UAAU,GAAAC,wBAAA,CAAAhB,IAAA,EAAAiB,SAAA;EAEb,MAAM;IAAEC;EA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S,CAACiE,MAAM;EACxB5C,cAAc,EAAErB,SAAS,CAACkE,KAAK;EAC/B5C,MAAM,EAAEtB,SAAS,CAACiE,MAAM;EACxB1C,UAAU,EAAEvB,SAAS,CAACiE,MAAM;EAC5B7C,KAAK,EAAEpB,SAAS,CAACiE,MAAM;EACvBrC,aAAa,EAAE5B,SAAS,CAACmE,MAAM;EAC/BrC,SAAS,EAAE9B,SAAS,CAACiE,MAAM;EAC3BpC,aAAa,EAAE7B,SAAS,CAAC+D;AAC3B,CAAC;AAEDhD,YAAY,CAACqD,YAAY,GAAG;EAC1BlD,MAAM,EAAE,EAAE;EACVD,UAAU,EAAE,EAAE;EACdE,MAAM,EAAE,EAAE;EACVE,cAAc,EAAE,EAAE;EAClBC,MAAM,EAAE,EAAE;EACVC,UAAU,EAAE,EAAE;EACdH,KAAK,EAAE,EAAE;EACTQ,aAAa,EAAE,IAAI;EACnBE,SAAS,EAAE,EAAE;EACbD,aAAa,EAAE,CAAC;AAClB,CAAC;AAED,eAAehB,SAAS,CAACE,YAAY,CAAC"}
1
+ {"version":3,"file":"BannerRender.js","names":["React","PropTypes","useQuery","generateSingleItemQuery","getCount","buildBannerSizes","buildContextualTargeting","buildParsedAdunit","buildSizeMapping","setCustomTargetings","BANNER_QUERY_PROPS","COUNT_CONTENT_HIERARCHIES","GET_BANNER","PUBLISHED","withTitle","AdSlotRender","BannerRender","_ref","baseAdunit","adunit","sizeId","sizes","propsToDisplay","entity","targetings","parent","asPath","action","actionKey","renderCounter","userPropsData","otherProps","_objectWithoutProperties","_excluded","id","itemId","data","entityRecordData","variables","where","skip","bannerData","parentId","childEntity","_ilike","parsedTargetings","entityData","bannerSizes","sizeMapping","parsedSizes","countContentHierarchies","parsedAdunit","isContextualTargetingSet","length","Object","keys","isContextualTargetingReady","shouldShowBanner","customTargetings","targetingArguments","_objectSpread","createElement","propTypes","object","isRequired","string","array","number","defaultProps"],"sources":["../../../src/components/Banner/BannerRender.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { useQuery } from '@apollo/client';\n\nimport { generateSingleItemQuery, getCount } from '../../application/query';\nimport {\n buildBannerSizes,\n buildContextualTargeting,\n buildParsedAdunit,\n buildSizeMapping,\n setCustomTargetings\n} from './helpers';\nimport {\n BANNER_QUERY_PROPS,\n COUNT_CONTENT_HIERARCHIES,\n GET_BANNER,\n PUBLISHED\n} from '../../constants';\nimport { withTitle } from '../../HOC';\nimport AdSlotRender from './AdSlotRender';\n\nconst BannerRender = ({\n baseAdunit,\n adunit,\n sizeId,\n sizes,\n propsToDisplay,\n entity,\n targetings,\n parent,\n asPath,\n action,\n actionKey,\n renderCounter,\n userPropsData,\n ...otherProps\n}) => {\n const { id } = otherProps;\n const { itemId } = parent;\n\n const { data: entityRecordData = {} } = useQuery(action, {\n variables: { where: { id: id || itemId } },\n skip: id && id !== itemId\n });\n\n const { data: bannerData = {} } = useQuery(\n generateSingleItemQuery(GET_BANNER, BANNER_QUERY_PROPS),\n {\n variables: { id: sizeId },\n skip: !sizeId\n }\n );\n\n const { data = {} } = useQuery(getCount(COUNT_CONTENT_HIERARCHIES), {\n variables: {\n where: {\n parentId: id || itemId,\n childEntity: {\n _ilike: `${PUBLISHED}_%`\n }\n }\n }\n });\n\n const parsedTargetings = buildContextualTargeting(actionKey, entityRecordData, propsToDisplay);\n const { entityData } = bannerData;\n const { sizes: bannerSizes } = entityData || {};\n\n const sizeMapping = buildSizeMapping(sizeId, bannerSizes);\n const parsedSizes = buildBannerSizes(sizeId, bannerSizes, sizes);\n\n const { countContentHierarchies } = data;\n\n const parsedAdunit = buildParsedAdunit(asPath, countContentHierarchies, baseAdunit, adunit);\n const isContextualTargetingSet =\n propsToDisplay.length && parsedTargetings && Object.keys(parsedTargetings).length;\n const isContextualTargetingReady = isContextualTargetingSet || !propsToDisplay.length;\n const shouldShowBanner =\n parsedAdunit && parsedSizes && !!parsedSizes.length && isContextualTargetingReady;\n\n const customTargetings = setCustomTargetings(targetings, renderCounter);\n\n const targetingArguments = { ...parsedTargetings, ...customTargetings, ...userPropsData };\n\n return (\n <AdSlotRender\n shouldShowBanner={!!shouldShowBanner}\n sizeMapping={sizeMapping}\n sizeId={sizeId}\n parsedAdunit={parsedAdunit}\n parsedSizes={parsedSizes}\n targetingArguments={targetingArguments}\n />\n );\n};\n\nBannerRender.propTypes = {\n parent: PropTypes.object.isRequired,\n asPath: PropTypes.string.isRequired,\n action: PropTypes.object.isRequired,\n actionKey: PropTypes.string.isRequired,\n adunit: PropTypes.string,\n baseAdunit: PropTypes.string,\n sizeId: PropTypes.string,\n propsToDisplay: PropTypes.array,\n entity: PropTypes.string,\n targetings: PropTypes.string,\n sizes: PropTypes.string,\n renderCounter: PropTypes.number,\n userPropsData: PropTypes.object\n};\n\nBannerRender.defaultProps = {\n adunit: '',\n baseAdunit: '',\n sizeId: '',\n propsToDisplay: [],\n entity: '',\n targetings: '',\n sizes: '',\n renderCounter: null,\n userPropsData: {}\n};\n\nexport default withTitle(BannerRender);\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAElC,SAASC,QAAQ,QAAQ,gBAAgB;AAEzC,SAASC,uBAAuB,EAAEC,QAAQ,QAAQ,yBAAyB;AAC3E,SACEC,gBAAgB,EAChBC,wBAAwB,EACxBC,iBAAiB,EACjBC,gBAAgB,EAChBC,mBAAmB,QACd,WAAW;AAClB,SACEC,kBAAkB,EAClBC,yBAAyB,EACzBC,UAAU,EACVC,SAAS,QACJ,iBAAiB;AACxB,SAASC,SAAS,QAAQ,WAAW;AACrC,OAAOC,YAAY,MAAM,gBAAgB;AAEzC,MAAMC,YAAY,GAAGC,IAAA,IAef;EAAA,IAfgB;MACpBC,UAAU;MACVC,MAAM;MACNC,MAAM;MACNC,KAAK;MACLC,cAAc;MACdC,MAAM;MACNC,UAAU;MACVC,MAAM;MACNC,MAAM;MACNC,MAAM;MACNC,SAAS;MACTC,aAAa;MACbC;IAEF,CAAC,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UAAU,EAAEjB,SAAS,CAACgE,MAAM;EAC5B7C,MAAM,EAAEnB,SAAS,CAACgE,MAAM;EACxB3C,cAAc,EAAErB,SAAS,CAACiE,KAAK;EAC/B3C,MAAM,EAAEtB,SAAS,CAACgE,MAAM;EACxBzC,UAAU,EAAEvB,SAAS,CAACgE,MAAM;EAC5B5C,KAAK,EAAEpB,SAAS,CAACgE,MAAM;EACvBpC,aAAa,EAAE5B,SAAS,CAACkE,MAAM;EAC/BrC,aAAa,EAAE7B,SAAS,CAAC8D;AAC3B,CAAC;AAED/C,YAAY,CAACoD,YAAY,GAAG;EAC1BjD,MAAM,EAAE,EAAE;EACVD,UAAU,EAAE,EAAE;EACdE,MAAM,EAAE,EAAE;EACVE,cAAc,EAAE,EAAE;EAClBC,MAAM,EAAE,EAAE;EACVC,UAAU,EAAE,EAAE;EACdH,KAAK,EAAE,EAAE;EACTQ,aAAa,EAAE,IAAI;EACnBC,aAAa,EAAE,CAAC;AAClB,CAAC;AAED,eAAehB,SAAS,CAACE,YAAY,CAAC"}
@@ -1,10 +1,14 @@
1
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
+ const _excluded = ["children", "name"];
1
3
  import React from 'react';
2
4
  import PropTypes from 'prop-types';
3
5
  import { hasChildren } from '../../helpers';
4
- const ContentGroupSection = ({
5
- children,
6
- name
7
- }) => {
6
+ const ContentGroupSection = _ref => {
7
+ let {
8
+ children,
9
+ name
10
+ } = _ref,
11
+ props = _objectWithoutProperties(_ref, _excluded);
8
12
  if (!hasChildren(children)) return null;
9
13
  return /*#__PURE__*/React.createElement("div", {
10
14
  key: name,
@@ -1 +1 @@
1
- {"version":3,"file":"ContentGroupSection.js","names":["React","PropTypes","hasChildren","ContentGroupSection","children","name","createElement","key","className","propTypes","oneOfType","arrayOf","node","string","defaultProps"],"sources":["../../../src/components/ContentGroupSection/ContentGroupSection.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { hasChildren } from '../../helpers';\n\nconst ContentGroupSection = ({ children, name }) => {\n if (!hasChildren(children)) return null;\n\n return (\n <div key={name} className=\"content-group-section\">\n {children}\n </div>\n );\n};\n\nContentGroupSection.propTypes = {\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),\n name: PropTypes.string\n};\n\nContentGroupSection.defaultProps = { children: null, name: '' };\n\nexport default ContentGroupSection;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,WAAW,QAAQ,eAAe;AAE3C,MAAMC,mBAAmB,GAAGA,CAAC;EAAEC,QAAQ;EAAEC;AAAK,CAAC,KAAK;EAClD,IAAI,CAACH,WAAW,CAACE,QAAQ,CAAC,EAAE,OAAO,IAAI;EAEvC,oBACEJ,KAAA,CAAAM,aAAA;IAAKC,GAAG,EAAEF,IAAK;IAACG,SAAS,EAAC;EAAuB,GAC9CJ,QACE,CAAC;AAEV,CAAC;AAEDD,mBAAmB,CAACM,SAAS,GAAG;EAC9BL,QAAQ,EAAEH,SAAS,CAACS,SAAS,CAAC,CAACT,SAAS,CAACU,OAAO,CAACV,SAAS,CAACW,IAAI,CAAC,EAAEX,SAAS,CAACW,IAAI,CAAC,CAAC;EAClFP,IAAI,EAAEJ,SAAS,CAACY;AAClB,CAAC;AAEDV,mBAAmB,CAACW,YAAY,GAAG;EAAEV,QAAQ,EAAE,IAAI;EAAEC,IAAI,EAAE;AAAG,CAAC;AAE/D,eAAeF,mBAAmB"}
1
+ {"version":3,"file":"ContentGroupSection.js","names":["React","PropTypes","hasChildren","ContentGroupSection","_ref","children","name","props","_objectWithoutProperties","_excluded","createElement","key","className","propTypes","oneOfType","arrayOf","node","string","defaultProps"],"sources":["../../../src/components/ContentGroupSection/ContentGroupSection.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { hasChildren } from '../../helpers';\n\nconst ContentGroupSection = ({ children, name, ...props }) => {\n if (!hasChildren(children)) return null;\n\n return (\n <div key={name} className=\"content-group-section\">\n {children}\n </div>\n );\n};\n\nContentGroupSection.propTypes = {\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),\n name: PropTypes.string\n};\n\nContentGroupSection.defaultProps = { children: null, name: '' };\n\nexport default ContentGroupSection;\n"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,WAAW,QAAQ,eAAe;AAE3C,MAAMC,mBAAmB,GAAGC,IAAA,IAAkC;EAAA,IAAjC;MAAEC,QAAQ;MAAEC;IAAe,CAAC,GAAAF,IAAA;IAAPG,KAAK,GAAAC,wBAAA,CAAAJ,IAAA,EAAAK,SAAA;EACrD,IAAI,CAACP,WAAW,CAACG,QAAQ,CAAC,EAAE,OAAO,IAAI;EAEvC,oBACEL,KAAA,CAAAU,aAAA;IAAKC,GAAG,EAAEL,IAAK;IAACM,SAAS,EAAC;EAAuB,GAC9CP,QACE,CAAC;AAEV,CAAC;AAEDF,mBAAmB,CAACU,SAAS,GAAG;EAC9BR,QAAQ,EAAEJ,SAAS,CAACa,SAAS,CAAC,CAACb,SAAS,CAACc,OAAO,CAACd,SAAS,CAACe,IAAI,CAAC,EAAEf,SAAS,CAACe,IAAI,CAAC,CAAC;EAClFV,IAAI,EAAEL,SAAS,CAACgB;AAClB,CAAC;AAEDd,mBAAmB,CAACe,YAAY,GAAG;EAAEb,QAAQ,EAAE,IAAI;EAAEC,IAAI,EAAE;AAAG,CAAC;AAE/D,eAAeH,mBAAmB"}
@@ -44,11 +44,10 @@ const buildLoopPropsContent = (loopProps = [], propsToDisplay = [], limit = 0, d
44
44
  } = options;
45
45
  return propertiesToDisplay.map(key => {
46
46
  const loopValue = loopValues[key];
47
- const loopValueItem = loopValue && loopValue[i];
48
- const propValue = loopValueItem ? getLoopValue(loopValueItem) : regularValues[key];
47
+ const propValue = loopValue ? getLoopValue(loopValue[i]) : regularValues[key];
49
48
  if (!propValue) return null;
50
49
  const processedValue = processDataSummaryValue(propValue, options);
51
- const linkToPublishedContent = getLinkToPublishedContent(key, data, loopValueItem);
50
+ const linkToPublishedContent = getLinkToPublishedContent(key, data);
52
51
  return [upperFirst(label), processedValue, linkToPublishedContent, modifier];
53
52
  });
54
53
  })).filter(Boolean);
@@ -1 +1 @@
1
- {"version":3,"file":"build-loop-props-content.js","names":["upperFirst","flatten","getLinkToPublishedContent","getLoopPropsLimit","getPropValue","processDataSummaryValue","getLoopValue","value","keyField","separateValues","propsToDisplay","loopProps","data","regularValues","loopValues","forEach","options","propertiesToDisplay","prop","isArrayValue","Array","isArray","isLoopableProp","includes","buildLoopPropsContent","limit","loopPropsWithContent","loopLimit","i","propsArray","map","label","modifier","key","loopValue","loopValueItem","propValue","processedValue","linkToPublishedContent","filter","Boolean","push"],"sources":["../../../../src/components/DataSummary/helpers/build-loop-props-content.js"],"sourcesContent":["import upperFirst from 'lodash.upperfirst';\nimport flatten from 'lodash.flatten';\nimport getLinkToPublishedContent from './get-link-to-published-content';\nimport getLoopPropsLimit from './get-loop-props-limit';\nimport getPropValue from './get-prop-value';\nimport { processDataSummaryValue } from '../../../helpers';\n\nconst getLoopValue = value => {\n const { keyField } = value;\n return value[keyField];\n};\n\nconst separateValues = (propsToDisplay, loopProps, data) => {\n const regularValues = {};\n const loopValues = {};\n\n propsToDisplay.forEach(options => {\n const { propertiesToDisplay } = options;\n propertiesToDisplay.forEach(prop => {\n const value = getPropValue(prop, data, options);\n const isArrayValue = Array.isArray(value);\n if (!value) return;\n const isLoopableProp = loopProps.includes(prop) && isArrayValue;\n\n if (isLoopableProp) {\n loopValues[prop] = value;\n } else {\n regularValues[prop] = value;\n }\n });\n });\n return [regularValues, loopValues];\n};\n\nconst buildLoopPropsContent = (loopProps = [], propsToDisplay = [], limit = 0, data = {}) => {\n const loopPropsWithContent = [];\n const [regularValues, loopValues] = separateValues(propsToDisplay, loopProps, data);\n\n const loopLimit = getLoopPropsLimit(loopValues, limit);\n\n for (let i = 0; i < loopLimit; i += 1) {\n const propsArray = flatten(\n propsToDisplay.map(options => {\n const { propertiesToDisplay, label, modifier = '' } = options;\n\n return propertiesToDisplay.map(key => {\n const loopValue = loopValues[key];\n const loopValueItem = loopValue && loopValue[i];\n const propValue = loopValueItem ? getLoopValue(loopValueItem) : regularValues[key];\n if (!propValue) return null;\n\n const processedValue = processDataSummaryValue(propValue, options);\n const linkToPublishedContent = getLinkToPublishedContent(key, data, loopValueItem);\n return [upperFirst(label), processedValue, linkToPublishedContent, modifier];\n });\n })\n ).filter(Boolean);\n loopPropsWithContent.push(propsArray);\n }\n\n return flatten(loopPropsWithContent);\n};\n\nexport default buildLoopPropsContent;\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,mBAAmB;AAC1C,OAAOC,OAAO,MAAM,gBAAgB;AACpC,OAAOC,yBAAyB,MAAM,iCAAiC;AACvE,OAAOC,iBAAiB,MAAM,wBAAwB;AACtD,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,SAASC,uBAAuB,QAAQ,kBAAkB;AAE1D,MAAMC,YAAY,GAAGC,KAAK,IAAI;EAC5B,MAAM;IAAEC;EAAS,CAAC,GAAGD,KAAK;EAC1B,OAAOA,KAAK,CAACC,QAAQ,CAAC;AACxB,CAAC;AAED,MAAMC,cAAc,GAAGA,CAACC,cAAc,EAAEC,SAAS,EAAEC,IAAI,KAAK;EAC1D,MAAMC,aAAa,GAAG,CAAC,CAAC;EACxB,MAAMC,UAAU,GAAG,CAAC,CAAC;EAErBJ,cAAc,CAACK,OAAO,CAACC,OAAO,IAAI;IAChC,MAAM;MAAEC;IAAoB,CAAC,GAAGD,OAAO;IACvCC,mBAAmB,CAACF,OAAO,CAACG,IAAI,IAAI;MAClC,MAAMX,KAAK,GAAGH,YAAY,CAACc,IAAI,EAAEN,IAAI,EAAEI,OAAO,CAAC;MAC/C,MAAMG,YAAY,GAAGC,KAAK,CAACC,OAAO,CAACd,KAAK,CAAC;MACzC,IAAI,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E,OAAO,IAAI;QAE3B,MAAMC,cAAc,GAAGhC,uBAAuB,CAAC+B,SAAS,EAAEpB,OAAO,CAAC;QAClE,MAAMsB,sBAAsB,GAAGpC,yBAAyB,CAAC+B,GAAG,EAAErB,IAAI,EAAEuB,aAAa,CAAC;QAClF,OAAO,CAACnC,UAAU,CAAC+B,KAAK,CAAC,EAAEM,cAAc,EAAEC,sBAAsB,EAAEN,QAAQ,CAAC;MAC9E,CAAC,CAAC;IACJ,CAAC,CACH,CAAC,CAACO,MAAM,CAACC,OAAO,CAAC;IACjBd,oBAAoB,CAACe,IAAI,CAACZ,UAAU,CAAC;EACvC;EAEA,OAAO5B,OAAO,CAACyB,oBAAoB,CAAC;AACtC,CAAC;AAED,eAAeF,qBAAqB"}
1
+ {"version":3,"file":"build-loop-props-content.js","names":["upperFirst","flatten","getLinkToPublishedContent","getLoopPropsLimit","getPropValue","processDataSummaryValue","getLoopValue","value","keyField","separateValues","propsToDisplay","loopProps","data","regularValues","loopValues","forEach","options","propertiesToDisplay","prop","isArrayValue","Array","isArray","isLoopableProp","includes","buildLoopPropsContent","limit","loopPropsWithContent","loopLimit","i","propsArray","map","label","modifier","key","loopValue","propValue","processedValue","linkToPublishedContent","filter","Boolean","push"],"sources":["../../../../src/components/DataSummary/helpers/build-loop-props-content.js"],"sourcesContent":["import upperFirst from 'lodash.upperfirst';\nimport flatten from 'lodash.flatten';\nimport getLinkToPublishedContent from './get-link-to-published-content';\nimport getLoopPropsLimit from './get-loop-props-limit';\nimport getPropValue from './get-prop-value';\nimport { processDataSummaryValue } from '../../../helpers';\n\nconst getLoopValue = value => {\n const { keyField } = value;\n return value[keyField];\n};\n\nconst separateValues = (propsToDisplay, loopProps, data) => {\n const regularValues = {};\n const loopValues = {};\n\n propsToDisplay.forEach(options => {\n const { propertiesToDisplay } = options;\n propertiesToDisplay.forEach(prop => {\n const value = getPropValue(prop, data, options);\n const isArrayValue = Array.isArray(value);\n if (!value) return;\n const isLoopableProp = loopProps.includes(prop) && isArrayValue;\n\n if (isLoopableProp) {\n loopValues[prop] = value;\n } else {\n regularValues[prop] = value;\n }\n });\n });\n return [regularValues, loopValues];\n};\n\nconst buildLoopPropsContent = (loopProps = [], propsToDisplay = [], limit = 0, data = {}) => {\n const loopPropsWithContent = [];\n const [regularValues, loopValues] = separateValues(propsToDisplay, loopProps, data);\n\n const loopLimit = getLoopPropsLimit(loopValues, limit);\n\n for (let i = 0; i < loopLimit; i += 1) {\n const propsArray = flatten(\n propsToDisplay.map(options => {\n const { propertiesToDisplay, label, modifier = '' } = options;\n\n return propertiesToDisplay.map(key => {\n const loopValue = loopValues[key];\n const propValue = loopValue ? getLoopValue(loopValue[i]) : regularValues[key];\n if (!propValue) return null;\n\n const processedValue = processDataSummaryValue(propValue, options);\n const linkToPublishedContent = getLinkToPublishedContent(key, data);\n return [upperFirst(label), processedValue, linkToPublishedContent, modifier];\n });\n })\n ).filter(Boolean);\n loopPropsWithContent.push(propsArray);\n }\n\n return flatten(loopPropsWithContent);\n};\n\nexport default buildLoopPropsContent;\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,mBAAmB;AAC1C,OAAOC,OAAO,MAAM,gBAAgB;AACpC,OAAOC,yBAAyB,MAAM,iCAAiC;AACvE,OAAOC,iBAAiB,MAAM,wBAAwB;AACtD,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,SAASC,uBAAuB,QAAQ,kBAAkB;AAE1D,MAAMC,YAAY,GAAGC,KAAK,IAAI;EAC5B,MAAM;IAAEC;EAAS,CAAC,GAAGD,KAAK;EAC1B,OAAOA,KAAK,CAACC,QAAQ,CAAC;AACxB,CAAC;AAED,MAAMC,cAAc,GAAGA,CAACC,cAAc,EAAEC,SAAS,EAAEC,IAAI,KAAK;EAC1D,MAAMC,aAAa,GAAG,CAAC,CAAC;EACxB,MAAMC,UAAU,GAAG,CAAC,CAAC;EAErBJ,cAAc,CAACK,OAAO,CAACC,OAAO,IAAI;IAChC,MAAM;MAAEC;IAAoB,CAAC,G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ACmB,GAAG,CAAC;QACjC,MAAME,SAAS,GAAGD,SAAS,GAAG5B,YAAY,CAAC4B,SAAS,CAACN,CAAC,CAAC,CAAC,GAAGf,aAAa,CAACoB,GAAG,CAAC;QAC7E,IAAI,CAACE,SAAS,EAAE,OAAO,IAAI;QAE3B,MAAMC,cAAc,GAAG/B,uBAAuB,CAAC8B,SAAS,EAAEnB,OAAO,CAAC;QAClE,MAAMqB,sBAAsB,GAAGnC,yBAAyB,CAAC+B,GAAG,EAAErB,IAAI,CAAC;QACnE,OAAO,CAACZ,UAAU,CAAC+B,KAAK,CAAC,EAAEK,cAAc,EAAEC,sBAAsB,EAAEL,QAAQ,CAAC;MAC9E,CAAC,CAAC;IACJ,CAAC,CACH,CAAC,CAACM,MAAM,CAACC,OAAO,CAAC;IACjBb,oBAAoB,CAACc,IAAI,CAACX,UAAU,CAAC;EACvC;EAEA,OAAO5B,OAAO,CAACyB,oBAAoB,CAAC;AACtC,CAAC;AAED,eAAeF,qBAAqB"}
@@ -1,7 +1,6 @@
1
- const getLinkToPublishedContent = (key = '', props = {}, currentValue = null) => {
1
+ const getLinkToPublishedContent = (key = '', props = {}) => {
2
2
  const [baseKey] = key.split('.');
3
3
  if (!props[baseKey]) return '';
4
- if (currentValue && typeof currentValue.url !== 'undefined') return currentValue.url;
5
4
  const content = Array.isArray(props[baseKey]) ? props[baseKey][0] : props[baseKey];
6
5
  return content && content.url ? content.url : '';
7
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"get-link-to-published-content.js","names":["getLinkToPublishedContent","key","props","currentValue","baseKey","split","url","content","Array","isArray"],"sources":["../../../../src/components/DataSummary/helpers/get-link-to-published-content.js"],"sourcesContent":["const getLinkToPublishedContent = (key = '', props = {}, currentValue = null) => {\n const [baseKey] = key.split('.');\n if (!props[baseKey]) return '';\n\n if (currentValue && typeof currentValue.url !== 'undefined') return currentValue.url;\n\n const content = Array.isArray(props[baseKey]) ? props[baseKey][0] : props[baseKey];\n return content && content.url ? content.url : '';\n};\n\nexport default getLinkToPublishedContent;\n"],"mappings":"AAAA,MAAMA,yBAAyB,GAAGA,CAACC,GAAG,GAAG,EAAE,EAAEC,KAAK,GAAG,CAAC,CAAC,EAAEC,YAAY,GAAG,IAAI,KAAK;EAC/E,MAAM,CAACC,OAAO,CAAC,GAAGH,GAAG,CAACI,KAAK,CAAC,GAAG,CAAC;EAChC,IAAI,CAACH,KAAK,CAACE,OAAO,CAAC,EAAE,OAAO,EAAE;EAE9B,IAAID,YAAY,IAAI,OAAOA,YAAY,CAACG,GAAG,KAAK,WAAW,EAAE,OAAOH,YAAY,CAACG,GAAG;EAEpF,MAAMC,OAAO,GAAGC,KAAK,CAACC,OAAO,CAACP,KAAK,CAACE,OAAO,CAAC,CAAC,GAAGF,KAAK,CAACE,OAAO,CAAC,CAAC,CAAC,CAAC,GAAGF,KAAK,CAACE,OAAO,CAAC;EAClF,OAAOG,OAAO,IAAIA,OAAO,CAACD,GAAG,GAAGC,OAAO,CAACD,GAAG,GAAG,EAAE;AAClD,CAAC;AAED,eAAeN,yBAAyB"}
1
+ {"version":3,"file":"get-link-to-published-content.js","names":["getLinkToPublishedContent","key","props","baseKey","split","content","Array","isArray","url"],"sources":["../../../../src/components/DataSummary/helpers/get-link-to-published-content.js"],"sourcesContent":["const getLinkToPublishedContent = (key = '', props = {}) => {\n const [baseKey] = key.split('.');\n if (!props[baseKey]) return '';\n const content = Array.isArray(props[baseKey]) ? props[baseKey][0] : props[baseKey];\n return content && content.url ? content.url : '';\n};\n\nexport default getLinkToPublishedContent;\n"],"mappings":"AAAA,MAAMA,yBAAyB,GAAGA,CAACC,GAAG,GAAG,EAAE,EAAEC,KAAK,GAAG,CAAC,CAAC,KAAK;EAC1D,MAAM,CAACC,OAAO,CAAC,GAAGF,GAAG,CAACG,KAAK,CAAC,GAAG,CAAC;EAChC,IAAI,CAACF,KAAK,CAACC,OAAO,CAAC,EAAE,OAAO,EAAE;EAC9B,MAAME,OAAO,GAAGC,KAAK,CAACC,OAAO,CAACL,KAAK,CAACC,OAAO,CAAC,CAAC,GAAGD,KAAK,CAACC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAGD,KAAK,CAACC,OAAO,CAAC;EAClF,OAAOE,OAAO,IAAIA,OAAO,CAACG,GAAG,GAAGH,OAAO,CAACG,GAAG,GAAG,EAAE;AAClD,CAAC;AAED,eAAeR,yBAAyB"}
@@ -56,7 +56,9 @@ const Checkbox = ({
56
56
  disabled: value[2]
57
57
  }));
58
58
  const shouldDisplayMore = !checkboxLimit || checkboxLimit[prop] === LIMIT_MIN;
59
- return /*#__PURE__*/React.createElement(React.Fragment, null, label ? /*#__PURE__*/React.createElement("p", null, label) : '', /*#__PURE__*/React.createElement(Checkboxes, {
59
+ return /*#__PURE__*/React.createElement(React.Fragment, null, elementTitle && /*#__PURE__*/React.createElement("div", {
60
+ className: "heading heading--section"
61
+ }, elementTitle), label ? /*#__PURE__*/React.createElement("p", null, label) : '', /*#__PURE__*/React.createElement(Checkboxes, {
60
62
  className: "form-checkbox",
61
63
  options: multiple,
62
64
  onChange: ({
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","names":["React","useState","PropTypes","upperFirst","Checkboxes","FaChevronDown","FaChevronUp","withTitle","decodeValue","LIMIT_MIN","LIMIT_MAX","MORE","LESS","Checkbox","data","prop","updateFilterValues","filterValues","label","elementTitle","shouldSearch","displayFilterCount","checkboxLimit","setCheckboxLimit","handleCheckboxOptions","checkboxQueryParams","map","val","multiple","sortedValues","buckets","key","doc_count","count","optionLabel","filter","Boolean","sort","forEach","value","i","push","name","checked","includes","id","disabled","shouldDisplayMore","createElement","Fragment","className","options","onChange","eData","newCheckboxValues","length","role","onClick","propTypes","object","isRequired","string","func","bool","defaultProps"],"sources":["../../../../src/components/SearchFilter/components/Checkbox.js"],"sourcesContent":["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport upperFirst from 'lodash.upperfirst';\nimport { Checkboxes } from '@blaze-react/checkboxes';\nimport { FaChevronDown, FaChevronUp } from 'react-icons/fa';\nimport { withTitle } from '../../../HOC';\nimport { decodeValue } from '../helpers';\nimport { LIMIT_MIN, LIMIT_MAX, MORE, LESS } from '../constants';\n\nconst Checkbox = ({\n data,\n prop,\n updateFilterValues,\n filterValues,\n label,\n elementTitle,\n shouldSearch,\n displayFilterCount\n}) => {\n const [checkboxLimit, setCheckboxLimit] = useState(null);\n if (!data[prop]) return null;\n\n const handleCheckboxOptions = () => {\n if (checkboxLimit[prop] === LIMIT_MIN) {\n setCheckboxLimit({ [prop]: LIMIT_MAX });\n } else {\n setCheckboxLimit({ [prop]: LIMIT_MIN });\n }\n };\n\n if (!checkboxLimit) {\n setCheckboxLimit({ [prop]: LIMIT_MIN });\n }\n\n if (!checkboxLimit) return null;\n\n let checkboxQueryParams = [];\n\n if (filterValues && filterValues[prop]) {\n checkboxQueryParams =\n typeof filterValues[prop] === 'string'\n ? [decodeValue(filterValues[prop])]\n : filterValues[prop].map(val => decodeValue(val));\n }\n const multiple = [];\n\n const sortedValues = data[prop].buckets\n .map(({ key, doc_count: count }) => {\n const optionLabel = displayFilterCount ? `${key} (${count})` : key;\n return [key, optionLabel, !count];\n })\n .filter(Boolean)\n .sort();\n\n sortedValues.forEach(\n (value, i) =>\n i < checkboxLimit[prop] &&\n multiple.push({\n label: upperFirst(value[1]),\n value: value[0],\n name: prop,\n checked: checkboxQueryParams.includes(value[0]),\n id: value[0],\n disabled: value[2]\n })\n );\n\n const shouldDisplayMore = !checkboxLimit || checkboxLimit[prop] === LIMIT_MIN;\n return (\n <>\n {label ? <p>{label}</p> : ''}\n <Checkboxes\n className=\"form-checkbox\"\n options={multiple}\n onChange={({ data: eData }) => {\n const newCheckboxValues = eData\n .filter(({ checked }) => checked)\n .map(({ value }) => value);\n updateFilterValues({ [prop]: newCheckboxValues }, shouldSearch);\n }}\n />\n {data[prop].buckets.length > LIMIT_MIN && (\n <div role=\"button\" className=\"see-more\" onClick={handleCheckboxOptions}>\n {shouldDisplayMore ? (\n <>\n <i>\n <FaChevronDown className=\"inline-icon\" />\n </i>\n {` See ${MORE}`}\n </>\n ) : (\n <>\n <i>\n <FaChevronUp className=\"inline-icon\" />\n </i>\n {` See ${LESS}`}\n </>\n )}\n </div>\n )}\n </>\n );\n};\n\nCheckbox.propTypes = {\n data: PropTypes.object.isRequired,\n prop: PropTypes.string.isRequired,\n filterValues: PropTypes.object.isRequired,\n updateFilterValues: PropTypes.func.isRequired,\n shouldSearch: PropTypes.bool,\n label: PropTypes.string,\n elementTitle: PropTypes.string,\n displayFilterCount: PropTypes.bool\n};\n\nCheckbox.defaultProps = {\n shouldSearch: false,\n label: '',\n elementTitle: '',\n displayFilterCount: false\n};\n\nexport default withTitle(Checkbox);\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,mBAAmB;AAC1C,SAASC,UAAU,QAAQ,yBAAyB;AACpD,SAASC,aAAa,EAAEC,WAAW,QAAQ,gBAAgB;AAC3D,SAASC,SAAS,QAAQ,cAAc;AACxC,SAASC,WAAW,QAAQ,YAAY;AACxC,SAASC,SAAS,EAAEC,SAAS,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAE/D,MAAMC,QAAQ,GAAGA,CAAC;EAChBC,IAAI;EACJC,IAAI;EACJC,kBAAkB;EAClBC,YAAY;EACZC,KAAK;EACLC,YAAY;EACZC,YAAY;EACZC;AACF,CAAC,KAAK;EACJ,MAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,GAAGtB,QAAQ,CAAC,IAAI,CAAC;EACxD,IAAI,CAACa,IAAI,CAACC,IAAI,CAAC,EAAE,OAAO,IAAI;EAE5B,MAAMS,qBAAqB,GAAGA,CAAA,KAAM;IAClC,IAAIF,aAAa,CAACP,IAAI,CAAC,KAAKN,SAAS,EAAE;MACrCc,gBAAgB,CAAC;QAAE,CAACR,IAAI,GAAGL;MAAU,CAAC,CAA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K,EACd,CAAC,gBAEHX,KAAA,CAAAgD,aAAA,CAAAhD,KAAA,CAAAiD,QAAA,qBACEjD,KAAA,CAAAgD,aAAA,yBACEhD,KAAA,CAAAgD,aAAA,CAAC1C,WAAW;IAAC4C,SAAS,EAAC;EAAa,CAAE,CACrC,CAAC,EACF,QAAOtC,IAAK,EACd,CAED,CAEP,CAAC;AAEP,CAAC;AAEDC,QAAQ,CAAC6C,SAAS,GAAG;EACnB5C,IAAI,EAAEZ,SAAS,CAACyD,MAAM,CAACC,UAAU;EACjC7C,IAAI,EAAEb,SAAS,CAAC2D,MAAM,CAACD,UAAU;EACjC3C,YAAY,EAAEf,SAAS,CAACyD,MAAM,CAACC,UAAU;EACzC5C,kBAAkB,EAAEd,SAAS,CAAC4D,IAAI,CAACF,UAAU;EAC7CxC,YAAY,EAAElB,SAAS,CAAC6D,IAAI;EAC5B7C,KAAK,EAAEhB,SAAS,CAAC2D,MAAM;EACvB1C,YAAY,EAAEjB,SAAS,CAAC2D,MAAM;EAC9BxC,kBAAkB,EAAEnB,SAAS,CAAC6D;AAChC,CAAC;AAEDlD,QAAQ,CAACmD,YAAY,GAAG;EACtB5C,YAAY,EAAE,KAAK;EACnBF,KAAK,EAAE,EAAE;EACTC,YAAY,EAAE,EAAE;EAChBE,kBAAkB,EAAE;AACtB,CAAC;AAED,eAAed,SAAS,CAACM,QAAQ,CAAC"}
1
+ {"version":3,"file":"Checkbox.js","names":["React","useState","PropTypes","upperFirst","Checkboxes","FaChevronDown","FaChevronUp","withTitle","decodeValue","LIMIT_MIN","LIMIT_MAX","MORE","LESS","Checkbox","data","prop","updateFilterValues","filterValues","label","elementTitle","shouldSearch","displayFilterCount","checkboxLimit","setCheckboxLimit","handleCheckboxOptions","checkboxQueryParams","map","val","multiple","sortedValues","buckets","key","doc_count","count","optionLabel","filter","Boolean","sort","forEach","value","i","push","name","checked","includes","id","disabled","shouldDisplayMore","createElement","Fragment","className","options","onChange","eData","newCheckboxValues","length","role","onClick","propTypes","object","isRequired","string","func","bool","defaultProps"],"sources":["../../../../src/components/SearchFilter/components/Checkbox.js"],"sourcesContent":["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport upperFirst from 'lodash.upperfirst';\nimport { Checkboxes } from '@blaze-react/checkboxes';\nimport { FaChevronDown, FaChevronUp } from 'react-icons/fa';\nimport { withTitle } from '../../../HOC';\nimport { decodeValue } from '../helpers';\nimport { LIMIT_MIN, LIMIT_MAX, MORE, LESS } from '../constants';\n\nconst Checkbox = ({\n data,\n prop,\n updateFilterValues,\n filterValues,\n label,\n elementTitle,\n shouldSearch,\n displayFilterCount\n}) => {\n const [checkboxLimit, setCheckboxLimit] = useState(null);\n if (!data[prop]) return null;\n\n const handleCheckboxOptions = () => {\n if (checkboxLimit[prop] === LIMIT_MIN) {\n setCheckboxLimit({ [prop]: LIMIT_MAX });\n } else {\n setCheckboxLimit({ [prop]: LIMIT_MIN });\n }\n };\n\n if (!checkboxLimit) {\n setCheckboxLimit({ [prop]: LIMIT_MIN });\n }\n\n if (!checkboxLimit) return null;\n\n let checkboxQueryParams = [];\n\n if (filterValues && filterValues[prop]) {\n checkboxQueryParams =\n typeof filterValues[prop] === 'string'\n ? [decodeValue(filterValues[prop])]\n : filterValues[prop].map(val => decodeValue(val));\n }\n const multiple = [];\n\n const sortedValues = data[prop].buckets\n .map(({ key, doc_count: count }) => {\n const optionLabel = displayFilterCount ? `${key} (${count})` : key;\n return [key, optionLabel, !count];\n })\n .filter(Boolean)\n .sort();\n\n sortedValues.forEach(\n (value, i) =>\n i < checkboxLimit[prop] &&\n multiple.push({\n label: upperFirst(value[1]),\n value: value[0],\n name: prop,\n checked: checkboxQueryParams.includes(value[0]),\n id: value[0],\n disabled: value[2]\n })\n );\n\n const shouldDisplayMore = !checkboxLimit || checkboxLimit[prop] === LIMIT_MIN;\n\n return (\n <>\n {elementTitle && <div className=\"heading heading--section\">{elementTitle}</div>}\n {label ? <p>{label}</p> : ''}\n <Checkboxes\n className=\"form-checkbox\"\n options={multiple}\n onChange={({ data: eData }) => {\n const newCheckboxValues = eData\n .filter(({ checked }) => checked)\n .map(({ value }) => value);\n updateFilterValues({ [prop]: newCheckboxValues }, shouldSearch);\n }}\n />\n {data[prop].buckets.length > LIMIT_MIN && (\n <div role=\"button\" className=\"see-more\" onClick={handleCheckboxOptions}>\n {shouldDisplayMore ? (\n <>\n <i>\n <FaChevronDown className=\"inline-icon\" />\n </i>\n {` See ${MORE}`}\n </>\n ) : (\n <>\n <i>\n <FaChevronUp className=\"inline-icon\" />\n </i>\n {` See ${LESS}`}\n </>\n )}\n </div>\n )}\n </>\n );\n};\n\nCheckbox.propTypes = {\n data: PropTypes.object.isRequired,\n prop: PropTypes.string.isRequired,\n filterValues: PropTypes.object.isRequired,\n updateFilterValues: PropTypes.func.isRequired,\n shouldSearch: PropTypes.bool,\n label: PropTypes.string,\n elementTitle: PropTypes.string,\n displayFilterCount: PropTypes.bool\n};\n\nCheckbox.defaultProps = {\n shouldSearch: false,\n label: '',\n elementTitle: '',\n displayFilterCount: false\n};\n\nexport default withTitle(Checkbox);\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,mBAAmB;AAC1C,SAASC,UAAU,QAAQ,yBAAyB;AACpD,SAASC,aAAa,EAAEC,WAAW,QAAQ,gBAAgB;AAC3D,SAASC,SAAS,QAAQ,cAAc;AACxC,SAASC,WAAW,QAAQ,YAAY;AACxC,SAASC,SAAS,EAAEC,SAAS,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAE/D,MAAMC,QAAQ,GAAGA,CAAC;EAChBC,IAAI;EACJC,IAAI;EACJC,kBAAkB;EAClBC,YAAY;EACZC,KAAK;EACLC,YAAY;EACZC,YAAY;EACZC;AACF,CAAC,KAAK;EACJ,MAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,GAAGtB,QAAQ,CAAC,IAAI,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blaze-cms/react-page-builder",
3
- "version": "0.134.0-project-admin-customisations.0",
3
+ "version": "0.134.0",
4
4
  "description": "Blaze react page builder",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-es/index.js",
@@ -27,15 +27,15 @@
27
27
  },
28
28
  "license": "GPL-3.0",
29
29
  "dependencies": {
30
- "@blaze-cms/core-auth-ui": "0.134.0-project-admin-customisations.0",
31
- "@blaze-cms/core-errors": "0.134.0-project-admin-customisations.0",
32
- "@blaze-cms/core-errors-ui": "0.134.0-project-admin-customisations.0",
33
- "@blaze-cms/image-cdn-react": "0.3.0-alpha.5",
34
- "@blaze-cms/nextjs-components": "0.134.0-project-admin-customisations.0",
35
- "@blaze-cms/plugin-search-ui": "0.134.0-project-admin-customisations.0",
36
- "@blaze-cms/setup-ui": "0.134.0-project-admin-customisations.0",
37
- "@blaze-cms/utils": "0.134.0-project-admin-customisations.0",
38
- "@blaze-cms/utils-handlebars": "0.134.0-project-admin-customisations.0",
30
+ "@blaze-cms/core-auth-ui": "^0.131.0",
31
+ "@blaze-cms/core-errors": "^0.131.0",
32
+ "@blaze-cms/core-errors-ui": "^0.131.0",
33
+ "@blaze-cms/image-cdn-react": "0.3.0-alpha.6",
34
+ "@blaze-cms/nextjs-components": "^0.134.0",
35
+ "@blaze-cms/plugin-search-ui": "^0.134.0",
36
+ "@blaze-cms/setup-ui": "^0.131.0",
37
+ "@blaze-cms/utils": "^0.131.0",
38
+ "@blaze-cms/utils-handlebars": "^0.134.0",
39
39
  "@blaze-react/breadcrumb": "0.8.0-alpha.60",
40
40
  "@blaze-react/button": "0.5.19",
41
41
  "@blaze-react/checkboxes": "0.5.31",
@@ -89,5 +89,5 @@
89
89
  "lib/*",
90
90
  "lib-es/*"
91
91
  ],
92
- "gitHead": "ed7ba9d56aee2c4913b8204b0181fdc8c5975d94"
92
+ "gitHead": "0ee132aebf4417d5259a42bef9f790df2a2bb453"
93
93
  }
@@ -1,14 +1,22 @@
1
1
  import React, { Fragment } from 'react';
2
2
  import PropTypes from 'prop-types';
3
+ import { useStringTemplate } from '@blaze-cms/utils-handlebars';
3
4
 
4
5
  const withTitle = Component => {
5
6
  const InnerComponent = props => {
6
- const { elementTitle, isHeroImg } = props;
7
+ const { elementTitle, isHeroImg, parent } = props;
8
+
7
9
  const shouldDisplayTitle = elementTitle && !isHeroImg;
10
+ const {
11
+ loading,
12
+ data: [elementTitleToUse]
13
+ } = useStringTemplate(parent, [elementTitle]);
14
+
15
+ if (loading) return '';
8
16
 
9
17
  return (
10
18
  <Fragment>
11
- {shouldDisplayTitle && <h2 className="heading heading--section">{elementTitle}</h2>}
19
+ {shouldDisplayTitle && <h2 className="heading heading--section">{elementTitleToUse}</h2>}
12
20
  <Component {...props} />
13
21
  </Fragment>
14
22
  );
@@ -21,10 +29,12 @@ const withTitle = Component => {
21
29
  'Component'})`;
22
30
 
23
31
  InnerComponent.propTypes = {
32
+ parent: PropTypes.object,
24
33
  elementTitle: PropTypes.string,
25
34
  isHeroImg: PropTypes.bool
26
35
  };
27
36
  InnerComponent.defaultProps = {
37
+ parent: {},
28
38
  elementTitle: '',
29
39
  isHeroImg: false
30
40
  };
@@ -2,7 +2,6 @@ import React, { useState } from 'react';
2
2
  import { AdSlot } from 'react-dfp';
3
3
  import PropTypes from 'prop-types';
4
4
  import { BANNER_LOADING, BANNER_EMPTY, BANNER_LOADED } from '../../constants';
5
- import Wrapper from '../Wrapper';
6
5
 
7
6
  const AdSlotRender = ({
8
7
  shouldShowBanner,
@@ -10,7 +9,6 @@ const AdSlotRender = ({
10
9
  sizeId,
11
10
  parsedAdunit,
12
11
  parsedSizes,
13
- modifiers,
14
12
  targetingArguments
15
13
  }) => {
16
14
  const [{ loadingStatus = BANNER_LOADING, minHeight }, setLoadingStatus] = useState({});
@@ -26,11 +24,11 @@ const AdSlotRender = ({
26
24
  })
27
25
  .sort();
28
26
  const className = `ad-slot ad-slot-${loadingStatus} ${bannerClass}`;
29
- const newModifers = `${modifiers} banner-${loadingStatus}`;
27
+
30
28
  return (
31
- <Wrapper className="banner" modifiers={newModifers}>
29
+ <>
32
30
  {styles && <style>{styles.join('\n')}</style>}
33
- <div className={className} style={{ minHeight }} data-testid="ad-slot">
31
+ <div className={className} style={{ minHeight }}>
34
32
  {shouldShowBanner && (
35
33
  <AdSlot
36
34
  adUnit={parsedAdunit}
@@ -48,7 +46,7 @@ const AdSlotRender = ({
48
46
  />
49
47
  )}
50
48
  </div>
51
- </Wrapper>
49
+ </>
52
50
  );
53
51
  };
54
52
 
@@ -58,13 +56,11 @@ AdSlotRender.propTypes = {
58
56
  sizeId: PropTypes.string.isRequired,
59
57
  parsedAdunit: PropTypes.string.isRequired,
60
58
  parsedSizes: PropTypes.array,
61
- modifiers: PropTypes.string,
62
59
  targetingArguments: PropTypes.object.isRequired
63
60
  };
64
61
 
65
62
  AdSlotRender.defaultProps = {
66
- parsedSizes: null,
67
- modifiers: ''
63
+ parsedSizes: null
68
64
  };
69
65
 
70
66
  export default AdSlotRender;
@@ -7,6 +7,7 @@ import { useQuery } from '@apollo/client';
7
7
  import { useRouter } from 'next/router';
8
8
  import { buildUserQuery, buildPropsData } from './helpers';
9
9
  import { getSingleEntitySchema, getUser } from '../../application/query';
10
+ import Wrapper from '../Wrapper';
10
11
  import BannerRender from './BannerRender';
11
12
  import buildPropsQuery from '../../helpers/build-props-query';
12
13
  import { getClassModifiers } from '../../utils';
@@ -46,15 +47,16 @@ const Banner = ({ type, ...otherProps }) => {
46
47
  const bannerKey = `${sizeId}${asPath}`;
47
48
 
48
49
  return (
49
- <BannerRender
50
- key={bannerKey}
51
- {...otherProps}
52
- action={action}
53
- actionKey={actionKey}
54
- asPath={asPath}
55
- userPropsData={userPropsData}
56
- modifiers={modifiers}
57
- />
50
+ <Wrapper className={type} modifiers={modifiers}>
51
+ <BannerRender
52
+ key={bannerKey}
53
+ {...otherProps}
54
+ action={action}
55
+ actionKey={actionKey}
56
+ asPath={asPath}
57
+ userPropsData={userPropsData}
58
+ />
59
+ </Wrapper>
58
60
  );
59
61
  };
60
62
 
@@ -34,7 +34,6 @@ const BannerRender = ({
34
34
  actionKey,
35
35
  renderCounter,
36
36
  userPropsData,
37
- modifiers,
38
37
  ...otherProps
39
38
  }) => {
40
39
  const { id } = otherProps;
@@ -91,7 +90,6 @@ const BannerRender = ({
91
90
  sizeId={sizeId}
92
91
  parsedAdunit={parsedAdunit}
93
92
  parsedSizes={parsedSizes}
94
- modifiers={modifiers}
95
93
  targetingArguments={targetingArguments}
96
94
  />
97
95
  );
@@ -110,7 +108,6 @@ BannerRender.propTypes = {
110
108
  targetings: PropTypes.string,
111
109
  sizes: PropTypes.string,
112
110
  renderCounter: PropTypes.number,
113
- modifiers: PropTypes.string,
114
111
  userPropsData: PropTypes.object
115
112
  };
116
113
 
@@ -123,7 +120,6 @@ BannerRender.defaultProps = {
123
120
  targetings: '',
124
121
  sizes: '',
125
122
  renderCounter: null,
126
- modifiers: '',
127
123
  userPropsData: {}
128
124
  };
129
125
 
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { hasChildren } from '../../helpers';
4
4
 
5
- const ContentGroupSection = ({ children, name }) => {
5
+ const ContentGroupSection = ({ children, name, ...props }) => {
6
6
  if (!hasChildren(children)) return null;
7
7
 
8
8
  return (