@blaze-cms/react-page-builder 0.131.0-project-admin-customisations.2 → 0.132.0-admin-updates.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 (87) hide show
  1. package/CHANGELOG.md +22 -11
  2. package/lib/HOC/recreateOnNavigation.js +29 -0
  3. package/lib/HOC/recreateOnNavigation.js.map +1 -0
  4. package/lib/components/CarouselWrapper/SmoothScrollCarousel.js +2 -2
  5. package/lib/components/CarouselWrapper/SmoothScrollCarousel.js.map +1 -1
  6. package/lib/components/ContentGroupSection/ContentGroupSection.js +4 -1
  7. package/lib/components/ContentGroupSection/ContentGroupSection.js.map +1 -1
  8. package/lib/components/DataSummary/helpers/build-loop-props-content.js +3 -2
  9. package/lib/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
  10. package/lib/components/DataSummary/helpers/get-link-to-published-content.js +2 -0
  11. package/lib/components/DataSummary/helpers/get-link-to-published-content.js.map +1 -1
  12. package/lib/components/Layout/Layout.js +3 -2
  13. package/lib/components/Layout/Layout.js.map +1 -1
  14. package/lib/components/Layout/LayoutFactory.js +35 -0
  15. package/lib/components/Layout/LayoutFactory.js.map +1 -0
  16. package/lib/components/Layout/LayoutWithStickyTimer.js +66 -0
  17. package/lib/components/Layout/LayoutWithStickyTimer.js.map +1 -0
  18. package/lib/components/Layout/index.js +2 -2
  19. package/lib/components/Layout/index.js.map +1 -1
  20. package/lib/components/SearchContent/SearchContent.js +0 -2
  21. package/lib/components/SearchContent/SearchContent.js.map +1 -1
  22. package/lib/components/SearchFilter/SearchFilter/SearchFilter.js +1 -3
  23. package/lib/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
  24. package/lib/components/SearchFilter/SearchFilterContainer.js +5 -2
  25. package/lib/components/SearchFilter/SearchFilterContainer.js.map +1 -1
  26. package/lib/components/SearchFilter/helpers/build-url-query.js +1 -0
  27. package/lib/components/SearchFilter/helpers/build-url-query.js.map +1 -1
  28. package/lib/components/SearchFilter/searchFilterReducer.js +1 -3
  29. package/lib/components/SearchFilter/searchFilterReducer.js.map +1 -1
  30. package/lib/helpers/get-entities-with-banner.js +8 -2
  31. package/lib/helpers/get-entities-with-banner.js.map +1 -1
  32. package/lib/utils/get-class-modifiers.js +1 -1
  33. package/lib/utils/get-class-modifiers.js.map +1 -1
  34. package/lib-es/HOC/recreateOnNavigation.js +20 -0
  35. package/lib-es/HOC/recreateOnNavigation.js.map +1 -0
  36. package/lib-es/components/CarouselWrapper/SmoothScrollCarousel.js +2 -2
  37. package/lib-es/components/CarouselWrapper/SmoothScrollCarousel.js.map +1 -1
  38. package/lib-es/components/ContentGroupSection/ContentGroupSection.js +8 -4
  39. package/lib-es/components/ContentGroupSection/ContentGroupSection.js.map +1 -1
  40. package/lib-es/components/DataSummary/helpers/build-loop-props-content.js +3 -2
  41. package/lib-es/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
  42. package/lib-es/components/DataSummary/helpers/get-link-to-published-content.js +2 -1
  43. package/lib-es/components/DataSummary/helpers/get-link-to-published-content.js.map +1 -1
  44. package/lib-es/components/Layout/Layout.js +3 -2
  45. package/lib-es/components/Layout/Layout.js.map +1 -1
  46. package/lib-es/components/Layout/LayoutFactory.js +14 -0
  47. package/lib-es/components/Layout/LayoutFactory.js.map +1 -0
  48. package/lib-es/components/Layout/LayoutWithStickyTimer.js +42 -0
  49. package/lib-es/components/Layout/LayoutWithStickyTimer.js.map +1 -0
  50. package/lib-es/components/Layout/index.js +2 -2
  51. package/lib-es/components/Layout/index.js.map +1 -1
  52. package/lib-es/components/SearchContent/SearchContent.js +0 -2
  53. package/lib-es/components/SearchContent/SearchContent.js.map +1 -1
  54. package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js +2 -4
  55. package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
  56. package/lib-es/components/SearchFilter/SearchFilterContainer.js +5 -2
  57. package/lib-es/components/SearchFilter/SearchFilterContainer.js.map +1 -1
  58. package/lib-es/components/SearchFilter/helpers/build-url-query.js +1 -0
  59. package/lib-es/components/SearchFilter/helpers/build-url-query.js.map +1 -1
  60. package/lib-es/components/SearchFilter/searchFilterReducer.js +1 -3
  61. package/lib-es/components/SearchFilter/searchFilterReducer.js.map +1 -1
  62. package/lib-es/helpers/get-entities-with-banner.js +9 -2
  63. package/lib-es/helpers/get-entities-with-banner.js.map +1 -1
  64. package/lib-es/utils/get-class-modifiers.js +1 -1
  65. package/lib-es/utils/get-class-modifiers.js.map +1 -1
  66. package/package.json +10 -10
  67. package/src/HOC/recreateOnNavigation.js +21 -0
  68. package/src/components/CarouselWrapper/SmoothScrollCarousel.js +2 -2
  69. package/src/components/ContentGroupSection/ContentGroupSection.js +1 -1
  70. package/src/components/DataSummary/helpers/build-loop-props-content.js +3 -2
  71. package/src/components/DataSummary/helpers/get-link-to-published-content.js +4 -1
  72. package/src/components/Layout/Layout.js +29 -32
  73. package/src/components/Layout/LayoutFactory.js +17 -0
  74. package/src/components/Layout/LayoutWithStickyTimer.js +40 -0
  75. package/src/components/Layout/index.js +2 -2
  76. package/src/components/SearchContent/SearchContent.js +0 -2
  77. package/src/components/SearchFilter/SearchFilter/SearchFilter.js +3 -9
  78. package/src/components/SearchFilter/SearchFilterContainer.js +6 -2
  79. package/src/components/SearchFilter/helpers/build-url-query.js +2 -0
  80. package/src/components/SearchFilter/searchFilterReducer.js +1 -1
  81. package/src/helpers/get-entities-with-banner.js +3 -2
  82. package/src/utils/get-class-modifiers.js +1 -1
  83. package/tests/unit/src/HOC/recreateOnNavigation.test.js +28 -0
  84. package/tests/unit/src/components/DataSummary/helpers/build-loop-props-content.test.js +41 -0
  85. package/tests/unit/src/components/DataSummary/helpers/get-link-to-published-content.test.js +21 -0
  86. package/tests/unit/src/components/Layout/Layout.test.js +1 -1
  87. package/tests/unit/src/components/Layout/LayoutFactory.test.js +53 -0
package/CHANGELOG.md CHANGED
@@ -3,39 +3,50 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- # [0.131.0-project-admin-customisations.2](https://github.com/thebyte9/blaze/compare/v0.131.0-project-admin-customisations.1...v0.131.0-project-admin-customisations.2) (2023-07-20)
7
-
8
- **Note:** Version bump only for package @blaze-cms/react-page-builder
9
-
10
-
11
-
12
-
13
-
14
- # [0.131.0-project-admin-customisations.0](https://github.com/thebyte9/blaze/compare/v0.130.1...v0.131.0-project-admin-customisations.0) (2023-07-13)
6
+ # [0.132.0-admin-updates.0](https://github.com/thebyte9/blaze/compare/v0.131.0...v0.132.0-admin-updates.0) (2023-07-27)
15
7
 
16
8
 
17
9
  ### Bug Fixes
18
10
 
11
+ * add collapse property to searchContent ([#3964](https://github.com/thebyte9/blaze/issues/3964)) ([3703a29](https://github.com/thebyte9/blaze/commit/3703a29d9a838f857863430d9223025900f29880))
19
12
  * add collapse property to searchContent ([#3964](https://github.com/thebyte9/blaze/issues/3964)) ([d133a19](https://github.com/thebyte9/blaze/commit/d133a1965fdb447824dfdb87566809d7597a24b2))
13
+ * add second render ([488b2b6](https://github.com/thebyte9/blaze/commit/488b2b65b437db9beff90eaf38f6a8d2dc30f3a9))
14
+ * added logout handling for button ([#3983](https://github.com/thebyte9/blaze/issues/3983)) ([f634575](https://github.com/thebyte9/blaze/commit/f634575cd6865dbc23391634c177efe4826d44c6))
20
15
  * added logout handling for button ([#3983](https://github.com/thebyte9/blaze/issues/3983)) ([1940547](https://github.com/thebyte9/blaze/commit/19405477315238fe8b14c974645675ec285ee85a))
16
+ * carousel - set min width to the content ([7313a94](https://github.com/thebyte9/blaze/commit/7313a947d816716c607afaed6eaa61c3f26b0e89))
17
+ * handle data summary urls in loops correctly ([#3993](https://github.com/thebyte9/blaze/issues/3993)) ([008e1a1](https://github.com/thebyte9/blaze/commit/008e1a1f24f065b4060302c2c32d1aa32dd8a007))
18
+ * hash bits now persists through filter changes ([#3965](https://github.com/thebyte9/blaze/issues/3965)) ([e0c37fc](https://github.com/thebyte9/blaze/commit/e0c37fcff2479f531f2f337b4e98b4edf57b4795))
21
19
  * hash bits now persists through filter changes ([#3965](https://github.com/thebyte9/blaze/issues/3965)) ([04e4cb3](https://github.com/thebyte9/blaze/commit/04e4cb380520ea7c9b20860bf9cb4ea2facd27ad))
20
+ * hlist component andle when no search filter ([#3982](https://github.com/thebyte9/blaze/issues/3982)) ([268eddc](https://github.com/thebyte9/blaze/commit/268eddcc71d42b3d63770554684bf79a5f163b7e))
22
21
  * hlist component andle when no search filter ([#3982](https://github.com/thebyte9/blaze/issues/3982)) ([e9e1a6d](https://github.com/thebyte9/blaze/commit/e9e1a6da969d9afc5f9ddaffcb7bf2238c84d898))
22
+ * improve animation ([b9111b5](https://github.com/thebyte9/blaze/commit/b9111b59f9f297f5b4701bf5c42b0acd718d9985))
23
+ * remove log ([9eac18f](https://github.com/thebyte9/blaze/commit/9eac18fa06744a11d8e57d5b4a1d58f488ada931))
24
+ * reset search filters and handle single text property ([#3996](https://github.com/thebyte9/blaze/issues/3996)) ([0160414](https://github.com/thebyte9/blaze/commit/016041454d30cc4cfc0a4c8e2d484fcedc2a631c))
25
+ * set width to carousel container ([d8f3ffb](https://github.com/thebyte9/blaze/commit/d8f3ffbdd22df47dcac88446828c2af5ac0f3318))
23
26
 
24
27
 
25
28
  ### Features
26
29
 
30
+ * add isHtml option to data summary component to render string as html ([#3969](https://github.com/thebyte9/blaze/issues/3969)) ([6005cdf](https://github.com/thebyte9/blaze/commit/6005cdf0e18f2eea51cc7bc143cf34423743fe5e))
27
31
  * add isHtml option to data summary component to render string as html ([#3969](https://github.com/thebyte9/blaze/issues/3969)) ([78b6ed2](https://github.com/thebyte9/blaze/commit/78b6ed2735e94e078d4b174777ba3a99fc1a6b4c))
32
+ * add sticky setting to column and row ([#3988](https://github.com/thebyte9/blaze/issues/3988)) ([1d1a219](https://github.com/thebyte9/blaze/commit/1d1a21901b23fe184e1eadf2bbb49551dd5f9b33))
33
+ * enableLink in data summary now works with neste objects ([#3974](https://github.com/thebyte9/blaze/issues/3974)) ([67b3c7f](https://github.com/thebyte9/blaze/commit/67b3c7fee9ffd60526dae525fea4d87097742453))
28
34
  * enableLink in data summary now works with neste objects ([#3974](https://github.com/thebyte9/blaze/issues/3974)) ([5411725](https://github.com/thebyte9/blaze/commit/54117258b20ecb95b6359a8a412c8317b38b4fb3))
35
+ * Filters and sorts now target generic or specific lists ([#3973](https://github.com/thebyte9/blaze/issues/3973)) ([013fead](https://github.com/thebyte9/blaze/commit/013fead2b1fa467c084535d36404d3b80b9db02f))
29
36
  * Filters and sorts now target generic or specific lists ([#3973](https://github.com/thebyte9/blaze/issues/3973)) ([3041c71](https://github.com/thebyte9/blaze/commit/3041c71418996a874138fa9ea9b509040264bf43))
37
+ * filteryBy on cards allow for id prop which fetches related data on parent to render ([#3975](https://github.com/thebyte9/blaze/issues/3975)) ([2eed0ed](https://github.com/thebyte9/blaze/commit/2eed0ed09cedda3a9424d3b88cb16bb437eada50))
30
38
  * filteryBy on cards allow for id prop which fetches related data on parent to render ([#3975](https://github.com/thebyte9/blaze/issues/3975)) ([b18c177](https://github.com/thebyte9/blaze/commit/b18c177b9ad0c137fe98a979bfa6ca4baa5e214b))
31
39
 
32
40
 
33
41
 
34
- # [0.129.0-project-admin-customisations.1](https://github.com/thebyte9/blaze/compare/v0.129.0-project-admin-customisations.0...v0.129.0-project-admin-customisations.1) (2023-05-05)
35
42
 
36
43
 
44
+ # [0.131.0](https://github.com/thebyte9/blaze/compare/v0.130.1...v0.131.0) (2023-07-18)
45
+
46
+
47
+ ### Features
37
48
 
38
- # [0.129.0-project-admin-customisations.0](https://github.com/thebyte9/blaze/compare/v0.128.2...v0.129.0-project-admin-customisations.0) (2023-05-03)
49
+ * add sticky setting to column and row ([#3988](https://github.com/thebyte9/blaze/issues/3988)) ([735b3b0](https://github.com/thebyte9/blaze/commit/735b3b09e0af15ad262119472579a1120da00347))
39
50
 
40
51
 
41
52
 
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.define-property.js");
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ require("core-js/modules/es.function.name.js");
11
+ require("core-js/modules/es.array.concat.js");
12
+ var _react = _interopRequireDefault(require("react"));
13
+ var _router = require("next/router");
14
+ var recreateOnNavigation = function recreateOnNavigation(Component) {
15
+ var InnerComponent = function InnerComponent(props) {
16
+ var name = props.name;
17
+ var router = (0, _router.useRouter)();
18
+ var key = "".concat(router.asPath, ":").concat(name);
19
+ return /*#__PURE__*/_react["default"].createElement(Component, (0, _extends2["default"])({}, props, {
20
+ key: key
21
+ }));
22
+ };
23
+ InnerComponent.WrappedComponent = Component;
24
+ InnerComponent.displayName = "recreateOnNavigation(".concat(Component.displayName || Component.name || 'Component', ")");
25
+ return InnerComponent;
26
+ };
27
+ var _default = recreateOnNavigation;
28
+ exports["default"] = _default;
29
+ //# sourceMappingURL=recreateOnNavigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recreateOnNavigation.js","names":["_react","_interopRequireDefault","require","_router","recreateOnNavigation","Component","InnerComponent","props","name","router","useRouter","key","concat","asPath","createElement","_extends2","WrappedComponent","displayName","_default","exports"],"sources":["../../src/HOC/recreateOnNavigation.js"],"sourcesContent":["import React from 'react';\nimport { useRouter } from 'next/router';\n\nconst recreateOnNavigation = Component => {\n const InnerComponent = props => {\n const { name } = props;\n const router = useRouter();\n const key = `${router.asPath}:${name}`;\n return <Component {...props} key={key} />;\n };\n\n InnerComponent.WrappedComponent = Component;\n\n InnerComponent.displayName = `recreateOnNavigation(${Component.displayName ||\n Component.name ||\n 'Component'})`;\n\n return InnerComponent;\n};\n\nexport default recreateOnNavigation;\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAME,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAGC,SAAS,EAAI;EACxC,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CAAGC,KAAK,EAAI;IAC9B,IAAQC,IAAI,GAAKD,KAAK,CAAdC,IAAI;IACZ,IAAMC,MAAM,GAAG,IAAAC,iBAAS,EAAC,CAAC;IAC1B,IAAMC,GAAG,MAAAC,MAAA,CAAMH,MAAM,CAACI,MAAM,OAAAD,MAAA,CAAIJ,IAAI,CAAE;IACtC,oBAAOR,MAAA,YAAAc,aAAA,CAACT,SAAS,MAAAU,SAAA,iBAAKR,KAAK;MAAEI,GAAG,EAAEA;IAAI,EAAE,CAAC;EAC3C,CAAC;EAEDL,cAAc,CAACU,gBAAgB,GAAGX,SAAS;EAE3CC,cAAc,CAACW,WAAW,2BAAAL,MAAA,CAA2BP,SAAS,CAACY,WAAW,IACxEZ,SAAS,CAACG,IAAI,IACd,WAAW,MAAG;EAEhB,OAAOF,cAAc;AACvB,CAAC;AAAC,IAAAY,QAAA,GAEad,oBAAoB;AAAAe,OAAA,cAAAD,QAAA"}
@@ -16,8 +16,8 @@ var SmoothScrollCarousel = function SmoothScrollCarousel(_ref) {
16
16
  numberOfCards = _ref.numberOfCards;
17
17
  var wrapperClassName = "cards-carousel-smooth".concat(bannerModifier);
18
18
  var contentClassName = "cards-carousel--content smooth-scroll items-per-row-".concat(itemsPerRow);
19
- var aimationTime = autoScrollTimer * numberOfCards / 1000;
20
- var animationDuration = "".concat(aimationTime < 1 ? 1 : aimationTime, "s");
19
+ var animationTime = autoScrollTimer * numberOfCards / 1000;
20
+ var animationDuration = "".concat(animationTime < 1 ? 1 : animationTime, "s");
21
21
  return /*#__PURE__*/_react["default"].createElement("div", {
22
22
  className: wrapperClassName
23
23
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -1 +1 @@
1
- {"version":3,"file":"SmoothScrollCarousel.js","names":["_react","_interopRequireDefault","require","_propTypes","SmoothScrollCarousel","_ref","children","bannerModifier","itemsPerRow","autoScrollTimer","numberOfCards","wrapperClassName","concat","contentClassName","aimationTime","animationDuration","createElement","className","style","propTypes","PropTypes","string","number","oneOfType","arrayOf","node","defaultProps","_default","exports"],"sources":["../../../src/components/CarouselWrapper/SmoothScrollCarousel.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst SmoothScrollCarousel = ({\n children,\n bannerModifier,\n itemsPerRow,\n autoScrollTimer,\n numberOfCards\n}) => {\n const wrapperClassName = `cards-carousel-smooth${bannerModifier}`;\n const contentClassName = `cards-carousel--content smooth-scroll items-per-row-${itemsPerRow}`;\n const aimationTime = (autoScrollTimer * numberOfCards) / 1000;\n const animationDuration = `${aimationTime < 1 ? 1 : aimationTime}s`;\n\n return (\n <div className={wrapperClassName}>\n <div className={contentClassName} style={{ animationDuration }}>\n {children}\n </div>\n <div className={contentClassName} style={{ animationDuration }}>\n {children}\n </div>\n </div>\n );\n};\n\nSmoothScrollCarousel.propTypes = {\n bannerModifier: PropTypes.string,\n itemsPerRow: PropTypes.number,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),\n autoScrollTimer: PropTypes.number,\n numberOfCards: PropTypes.number\n};\n\nSmoothScrollCarousel.defaultProps = {\n itemsPerRow: 0,\n bannerModifier: '',\n children: [],\n autoScrollTimer: 0,\n numberOfCards: 1\n};\n\nexport default SmoothScrollCarousel;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAME,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAAC,IAAA,EAMpB;EAAA,IALJC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,cAAc,GAAAF,IAAA,CAAdE,cAAc;IACdC,WAAW,GAAAH,IAAA,CAAXG,WAAW;IACXC,eAAe,GAAAJ,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AA,cAAAD,QAAA"}
1
+ {"version":3,"file":"SmoothScrollCarousel.js","names":["_react","_interopRequireDefault","require","_propTypes","SmoothScrollCarousel","_ref","children","bannerModifier","itemsPerRow","autoScrollTimer","numberOfCards","wrapperClassName","concat","contentClassName","animationTime","animationDuration","createElement","className","style","propTypes","PropTypes","string","number","oneOfType","arrayOf","node","defaultProps","_default","exports"],"sources":["../../../src/components/CarouselWrapper/SmoothScrollCarousel.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst SmoothScrollCarousel = ({\n children,\n bannerModifier,\n itemsPerRow,\n autoScrollTimer,\n numberOfCards\n}) => {\n const wrapperClassName = `cards-carousel-smooth${bannerModifier}`;\n const contentClassName = `cards-carousel--content smooth-scroll items-per-row-${itemsPerRow}`;\n const animationTime = (autoScrollTimer * numberOfCards) / 1000;\n const animationDuration = `${animationTime < 1 ? 1 : animationTime}s`;\n\n return (\n <div className={wrapperClassName}>\n <div className={contentClassName} style={{ animationDuration }}>\n {children}\n </div>\n <div className={contentClassName} style={{ animationDuration }}>\n {children}\n </div>\n </div>\n );\n};\n\nSmoothScrollCarousel.propTypes = {\n bannerModifier: PropTypes.string,\n itemsPerRow: PropTypes.number,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),\n autoScrollTimer: PropTypes.number,\n numberOfCards: PropTypes.number\n};\n\nSmoothScrollCarousel.defaultProps = {\n itemsPerRow: 0,\n bannerModifier: '',\n children: [],\n autoScrollTimer: 0,\n numberOfCards: 1\n};\n\nexport default SmoothScrollCarousel;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAME,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAAC,IAAA,EAMpB;EAAA,IALJC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,cAAc,GAAAF,IAAA,CAAdE,cA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E;AACjB,CAAC;AAAC,IAAAiB,QAAA,GAEavB,oBAAoB;AAAAwB,OAAA,cAAAD,QAAA"}
@@ -7,12 +7,15 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports["default"] = void 0;
9
9
  require("core-js/modules/es.function.name.js");
10
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
11
  var _react = _interopRequireDefault(require("react"));
11
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
12
13
  var _helpers = require("../../helpers");
14
+ var _excluded = ["children", "name"];
13
15
  var ContentGroupSection = function ContentGroupSection(_ref) {
14
16
  var children = _ref.children,
15
- name = _ref.name;
17
+ name = _ref.name,
18
+ props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
16
19
  if (!(0, _helpers.hasChildren)(children)) return null;
17
20
  return /*#__PURE__*/_react["default"].createElement("div", {
18
21
  key: name,
@@ -1 +1 @@
1
- {"version":3,"file":"ContentGroupSection.js","names":["_react","_interopRequireDefault","require","_propTypes","_helpers","ContentGroupSection","_ref","children","name","hasChildren","createElement","key","className","propTypes","PropTypes","oneOfType","arrayOf","node","string","defaultProps","_default","exports"],"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,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAEA,IAAMG,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAAC,IAAA,EAA2B;EAAA,IAArBC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,IAAI,GAAAF,IAAA,CAAJE,IAAI;EAC3C,IAAI,CAAC,IAAAC,oBAAW,EAACF,QAAQ,CAAC,EAAE,OAAO,IAAI;EAEvC,oBACEP,MAAA,YAAAU,aAAA;IAAKC,GAAG,EAAEH,IAAK;IAACI,SAAS,EAAC;EAAuB,GAC9CL,QACE,CAAC;AAEV,CAAC;AAEDF,mBAAmB,CAACQ,SAAS,GAAG;EAC9BN,QAAQ,EAAEO,qBAAS,CAACC,SAAS,CAAC,CAACD,qBAAS,CAACE,OAAO,CAACF,qBAAS,CAACG,IAAI,CAAC,EAAEH,qBAAS,CAACG,IAAI,CAAC,CAAC;EAClFT,IAAI,EAAEM,qBAAS,CAACI;AAClB,CAAC;AAEDb,mBAAmB,CAACc,YAAY,GAAG;EAAEZ,QAAQ,EAAE,IAAI;EAAEC,IAAI,EAAE;AAAG,CAAC;AAAC,IAAAY,QAAA,GAEjDf,mBAAmB;AAAAgB,OAAA,cAAAD,QAAA"}
1
+ {"version":3,"file":"ContentGroupSection.js","names":["_react","_interopRequireDefault","require","_propTypes","_helpers","_excluded","ContentGroupSection","_ref","children","name","props","_objectWithoutProperties2","hasChildren","createElement","key","className","propTypes","PropTypes","oneOfType","arrayOf","node","string","defaultProps","_default","exports"],"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,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAA4C,IAAAG,SAAA;AAE5C,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAAC,IAAA,EAAqC;EAAA,IAA/BC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IAAKC,KAAK,OAAAC,yBAAA,aAAAJ,IAAA,EAAAF,SAAA;EACrD,IAAI,CAAC,IAAAO,oBAAW,EAACJ,QAAQ,CAAC,EAAE,OAAO,IAAI;EAEvC,oBACER,MAAA,YAAAa,aAAA;IAAKC,GAAG,EAAEL,IAAK;IAACM,SAAS,EAAC;EAAuB,GAC9CP,QACE,CAAC;AAEV,CAAC;AAEDF,mBAAmB,CAACU,SAAS,GAAG;EAC9BR,QAAQ,EAAES,qBAAS,CAACC,SAAS,CAAC,CAACD,qBAAS,CAACE,OAAO,CAACF,qBAAS,CAACG,IAAI,CAAC,EAAEH,qBAAS,CAACG,IAAI,CAAC,CAAC;EAClFX,IAAI,EAAEQ,qBAAS,CAACI;AAClB,CAAC;AAEDf,mBAAmB,CAACgB,YAAY,GAAG;EAAEd,QAAQ,EAAE,IAAI;EAAEC,IAAI,EAAE;AAAG,CAAC;AAAC,IAAAc,QAAA,GAEjDjB,mBAAmB;AAAAkB,OAAA,cAAAD,QAAA"}
@@ -63,10 +63,11 @@ var buildLoopPropsContent = function buildLoopPropsContent() {
63
63
  modifier = _options$modifier === void 0 ? '' : _options$modifier;
64
64
  return propertiesToDisplay.map(function (key) {
65
65
  var loopValue = loopValues[key];
66
- var propValue = loopValue ? getLoopValue(loopValue[i]) : regularValues[key];
66
+ var loopValueItem = loopValue && loopValue[i];
67
+ var propValue = loopValueItem ? getLoopValue(loopValueItem) : regularValues[key];
67
68
  if (!propValue) return null;
68
69
  var processedValue = (0, _helpers.processDataSummaryValue)(propValue, options);
69
- var linkToPublishedContent = (0, _getLinkToPublishedContent["default"])(key, data);
70
+ var linkToPublishedContent = (0, _getLinkToPublishedContent["default"])(key, data, loopValueItem);
70
71
  return [(0, _lodash["default"])(label), processedValue, linkToPublishedContent, modifier];
71
72
  });
72
73
  })).filter(Boolean);
@@ -1 +1 @@
1
- {"version":3,"file":"build-loop-props-content.js","names":["_lodash","_interopRequireDefault","require","_lodash2","_getLinkToPublishedContent","_getLoopPropsLimit","_getPropValue","_helpers","getLoopValue","value","keyField","separateValues","propsToDisplay","loopProps","data","regularValues","loopValues","forEach","options","propertiesToDisplay","prop","getPropValue","isArrayValue","Array","isArray","isLoopableProp","includes","buildLoopPropsContent","arguments","length","undefined","limit","loopPropsWithContent","_separateValues","_separateValues2","_slicedToArray2","loopLimit","getLoopPropsLimit","_loop","i","propsArray","flatten","map","label","_options$modifier","modifier","key","loopValue","propValue","processedValue","processDataSummaryValue","linkToPublishedContent","getLinkToPublishedContent","upperFirst","filter","Boolean","push","_default","exports"],"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,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,0BAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,kBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,aAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAEA,IAAMM,YAAY,GAAG,SAAfA,YAAYA,CAAGC,KAAK,EAAI;EAC5B,IAAQC,QAAQ,GAAKD,KAAK,CAAlBC,QAAQ;EAChB,OAAOD,KAAK,CAACC,QAAQ,CAAC;AACxB,CAAC;AAED,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,cAAc,EAAEC,SAAS,EAAEC,IAAI,EAAK;EAC1D,IAAMC,aAAa,GAAG,CAAC,CAAC;EACxB,IAAMC,UAAU,GAAG,CAAC,CAAC;EAErBJ,cAAc,CAACK,OAAO,CAAC,UAAAC,OAAO,EAAI;IAChC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EAmBrC,OAAO,IAAAE,mBAAO,EAACT,oBAAoB,CAAC;AACtC,CAAC;AAAC,IAAAyB,QAAA,GAEa9B,qBAAqB;AAAA+B,OAAA,cAAAD,QAAA"}
1
+ {"version":3,"file":"build-loop-props-content.js","names":["_lodash","_interopRequireDefault","require","_lodash2","_getLinkToPublishedContent","_getLoopPropsLimit","_getPropValue","_helpers","getLoopValue","value","keyField","separateValues","propsToDisplay","loopProps","data","regularValues","loopValues","forEach","options","propertiesToDisplay","prop","getPropValue","isArrayValue","Array","isArray","isLoopableProp","includes","buildLoopPropsContent","arguments","length","undefined","limit","loopPropsWithContent","_separateValues","_separateValues2","_slicedToArray2","loopLimit","getLoopPropsLimit","_loop","i","propsArray","flatten","map","label","_options$modifier","modifier","key","loopValue","loopValueItem","propValue","processedValue","processDataSummaryValue","linkToPublishedContent","getLinkToPublishedContent","upperFirst","filter","Boolean","push","_default","exports"],"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,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,0BAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,kBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,aAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAEA,IAAMM,YAAY,GAAG,SAAfA,YAAYA,CAAGC,KAAK,EAAI;EAC5B,IAAQC,QAAQ,GAAKD,KAAK,CAAlBC,QAAQ;EAChB,OAAOD,KAAK,CAACC,QAAQ,CAAC;AACxB,CAAC;AAED,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,cAAc,EAAEC,SAAS,EAAEC,IAAI,EAAK;EAC1D,IAAMC,aAAa,GAAG,CAAC,CAAC;EACxB,IAAMC,UAAU,GAAG,CAAC,CAAC;EAErBJ,cAAc,CAACK,OAAO,CAAC,UAAAC,OAAO,EAAI;IAChC,IAAQC,mBAAmB,GAAKD,OAAO,CAA/BC,mBAAmB;IAC3BA,mBAAmB,CAACF,OAAO,CA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E,mBAAO,EAACT,oBAAoB,CAAC;AACtC,CAAC;AAAC,IAAA0B,QAAA,GAEa/B,qBAAqB;AAAAgC,OAAA,cAAAD,QAAA"}
@@ -11,10 +11,12 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
11
11
  var getLinkToPublishedContent = function getLinkToPublishedContent() {
12
12
  var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
13
13
  var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
14
+ var currentValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
14
15
  var _key$split = key.split('.'),
15
16
  _key$split2 = (0, _slicedToArray2["default"])(_key$split, 1),
16
17
  baseKey = _key$split2[0];
17
18
  if (!props[baseKey]) return '';
19
+ if (currentValue && typeof currentValue.url !== 'undefined') return currentValue.url;
18
20
  var content = Array.isArray(props[baseKey]) ? props[baseKey][0] : props[baseKey];
19
21
  return content && content.url ? content.url : '';
20
22
  };
@@ -1 +1 @@
1
- {"version":3,"file":"get-link-to-published-content.js","names":["getLinkToPublishedContent","key","arguments","length","undefined","props","_key$split","split","_key$split2","_slicedToArray2","baseKey","content","Array","isArray","url","_default","exports"],"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,IAAMA,yBAAyB,GAAG,SAA5BA,yBAAyBA,CAAA,EAA6B;EAAA,IAAzBC,GAAG,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EAAA,IAAEG,KAAK,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EACrD,IAAAI,UAAA,GAAkBL,GAAG,CAACM,KAAK,CAAC,GAAG,CAAC;IAAAC,WAAA,OAAAC,eAAA,aAAAH,UAAA;IAAzBI,OAAO,GAAAF,WAAA;EACd,IAAI,CAACH,KAAK,CAACK,OAAO,CAAC,EAAE,OAAO,EAAE;EAC9B,IAAMC,OAAO,GAAGC,KAAK,CAACC,OAAO,CAACR,KAAK,CAACK,OAAO,CAAC,CAAC,GAAGL,KAAK,CAACK,OAAO,CAAC,CAAC,CAAC,CAAC,GAAGL,KAAK,CAACK,OAAO,CAAC;EAClF,OAAOC,OAAO,IAAIA,OAAO,CAACG,GAAG,GAAGH,OAAO,CAACG,GAAG,GAAG,EAAE;AAClD,CAAC;AAAC,IAAAC,QAAA,GAEaf,yBAAyB;AAAAgB,OAAA,cAAAD,QAAA"}
1
+ {"version":3,"file":"get-link-to-published-content.js","names":["getLinkToPublishedContent","key","arguments","length","undefined","props","currentValue","_key$split","split","_key$split2","_slicedToArray2","baseKey","url","content","Array","isArray","_default","exports"],"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,IAAMA,yBAAyB,GAAG,SAA5BA,yBAAyBA,CAAA,EAAkD;EAAA,IAA9CC,GAAG,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EAAA,IAAEG,KAAK,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAAA,IAAEI,YAAY,GAAAJ,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;EAC1E,IAAAK,UAAA,GAAkBN,GAAG,CAACO,KAAK,CAAC,GAAG,CAAC;IAAAC,WAAA,OAAAC,eAAA,aAAAH,UAAA;IAAzBI,OAAO,GAAAF,WAAA;EACd,IAAI,CAACJ,KAAK,CAACM,OAAO,CAAC,EAAE,OAAO,EAAE;EAE9B,IAAIL,YAAY,IAAI,OAAOA,YAAY,CAACM,GAAG,KAAK,WAAW,EAAE,OAAON,YAAY,CAACM,GAAG;EAEpF,IAAMC,OAAO,GAAGC,KAAK,CAACC,OAAO,CAACV,KAAK,CAACM,OAAO,CAAC,CAAC,GAAGN,KAAK,CAACM,OAAO,CAAC,CAAC,CAAC,CAAC,GAAGN,KAAK,CAACM,OAAO,CAAC;EAClF,OAAOE,OAAO,IAAIA,OAAO,CAACD,GAAG,GAAGC,OAAO,CAACD,GAAG,GAAG,EAAE;AAClD,CAAC;AAAC,IAAAI,QAAA,GAEahB,yBAAyB;AAAAiB,OAAA,cAAAD,QAAA"}
@@ -30,7 +30,7 @@ var _constants = require("../../constants");
30
30
  var _excluded = ["type", "children", "settings", "modifier", "backgroundImage", "tagType", "dataNoSnippet"];
31
31
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
32
32
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
33
- var Layout = function Layout(_ref) {
33
+ var Layout = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
34
34
  var type = _ref.type,
35
35
  children = _ref.children,
36
36
  settings = _ref.settings,
@@ -56,6 +56,7 @@ var Layout = function Layout(_ref) {
56
56
  var otherWrapperProps = {};
57
57
  if (dataNoSnippet) otherWrapperProps['data-nosnippet'] = true;
58
58
  return /*#__PURE__*/_react["default"].createElement(_Wrapper["default"], (0, _extends2["default"])({
59
+ ref: ref,
59
60
  tagType: tagType,
60
61
  className: type,
61
62
  modifiers: "".concat(classModifiers).concat(additionalRowModifier),
@@ -63,7 +64,7 @@ var Layout = function Layout(_ref) {
63
64
  }, otherWrapperProps), title && /*#__PURE__*/_react["default"].createElement("h2", {
64
65
  className: "heading heading--section"
65
66
  }, title), (0, _helpers2.renderChildren)(children, otherProps));
66
- };
67
+ });
67
68
  Layout.propTypes = {
68
69
  type: _propTypes["default"].string.isRequired,
69
70
  settings: _propTypes["default"].shape({
@@ -1 +1 @@
1
- {"version":3,"file":"Layout.js","names":["_react","_interopRequireDefault","require","_propTypes","_Wrapper","_utils","_hooks","_helpers","_helpers2","_constants","_excluded","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","Layout","_ref","type","children","settings","modifier","backgroundImage","tagType","dataNoSnippet","otherProps","_objectWithoutProperties2","_useGetImages","useGetImages","_useGetImages$data$ge","data","getFile","_useGetImages$data$ge2","_useGetImages$data$ge3","url","style","getStylesToUpdate","title","classModifiers","getClassModifiers","additionalRowModifier","checkIfRowHasColumns","COLUMN","hasChildren","otherWrapperProps","createElement","_extends2","className","modifiers","concat","renderChildren","propTypes","PropTypes","string","isRequired","shape","bool","oneOfType","arrayOf","node","defaultProps","_default","exports"],"sources":["../../../src/components/Layout/Layout.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Wrapper from '../Wrapper';\nimport { getClassModifiers } from '../../utils';\nimport { useGetImages } from '../../hooks';\nimport { getStylesToUpdate, checkIfRowHasColumns } from './helpers';\nimport { renderChildren, hasChildren } from '../../helpers';\nimport { COLUMN } from '../../constants';\n\nconst Layout = ({\n type,\n children,\n settings,\n modifier,\n backgroundImage,\n tagType,\n dataNoSnippet,\n ...otherProps\n}) => {\n const {\n data: { getFile: { url = null } = {} }\n } = useGetImages(backgroundImage);\n\n const style = getStylesToUpdate({ backgroundImage: url });\n const { title } = settings;\n\n const classModifiers = getClassModifiers(type, { modifier, ...otherProps });\n const additionalRowModifier = checkIfRowHasColumns(type, children) ? ' display-row' : '';\n\n if (type === COLUMN && !hasChildren(children)) return null;\n\n const otherWrapperProps = {};\n if (dataNoSnippet) otherWrapperProps['data-nosnippet'] = true;\n\n return (\n <Wrapper\n tagType={tagType}\n className={type}\n modifiers={`${classModifiers}${additionalRowModifier}`}\n style={style}\n {...otherWrapperProps}>\n {title && <h2 className=\"heading heading--section\">{title}</h2>}\n {renderChildren(children, otherProps)}\n </Wrapper>\n );\n};\n\nLayout.propTypes = {\n type: PropTypes.string.isRequired,\n settings: PropTypes.shape({\n title: PropTypes.string\n }),\n modifier: PropTypes.string,\n backgroundImage: PropTypes.string,\n tagType: PropTypes.string,\n dataNoSnippet: PropTypes.bool,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired\n};\n\nLayout.defaultProps = {\n settings: {\n title: ''\n },\n backgroundImage: '',\n modifier: '',\n tagType: '',\n dataNoSnippet: false\n};\n\nexport default Layout;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAA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AO,EAAEA,OAAQ;IACjBwB,SAAS,EAAE7B,IAAK;IAChB8B,SAAS,KAAAC,MAAA,CAAKX,cAAc,EAAAW,MAAA,CAAGT,qBAAqB,CAAG;IACvDL,KAAK,EAAEA;EAAM,GACTS,iBAAiB,GACpBP,KAAK,iBAAIzD,MAAA,YAAAiE,aAAA;IAAIE,SAAS,EAAC;EAA0B,GAAEV,KAAU,CAAC,EAC9D,IAAAa,wBAAc,EAAC/B,QAAQ,EAAEM,UAAU,CAC7B,CAAC;AAEd,CAAC;AAEDT,MAAM,CAACmC,SAAS,GAAG;EACjBjC,IAAI,EAAEkC,qBAAS,CAACC,MAAM,CAACC,UAAU;EACjClC,QAAQ,EAAEgC,qBAAS,CAACG,KAAK,CAAC;IACxBlB,KAAK,EAAEe,qBAAS,CAACC;EACnB,CAAC,CAAC;EACFhC,QAAQ,EAAE+B,qBAAS,CAACC,MAAM;EAC1B/B,eAAe,EAAE8B,qBAAS,CAACC,MAAM;EACjC9B,OAAO,EAAE6B,qBAAS,CAACC,MAAM;EACzB7B,aAAa,EAAE4B,qBAAS,CAACI,IAAI;EAC7BrC,QAAQ,EAAEiC,qBAAS,CAACK,SAAS,CAAC,CAACL,qBAAS,CAACM,OAAO,CAACN,qBAAS,CAACO,IAAI,CAAC,EAAEP,qBAAS,CAACO,IAAI,CAAC,CAAC,CAACL;AACrF,CAAC;AAEDtC,MAAM,CAAC4C,YAAY,GAAG;EACpBxC,QAAQ,EAAE;IACRiB,KAAK,EAAE;EACT,CAAC;EACDf,eAAe,EAAE,EAAE;EACnBD,QAAQ,EAAE,EAAE;EACZE,OAAO,EAAE,EAAE;EACXC,aAAa,EAAE;AACjB,CAAC;AAAC,IAAAqC,QAAA,GAEa7C,MAAM;AAAA8C,OAAA,cAAAD,QAAA"}
1
+ {"version":3,"file":"Layout.js","names":["_react","_interopRequireDefault","require","_propTypes","_Wrapper","_utils","_hooks","_helpers","_helpers2","_constants","_excluded","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","Layout","React","forwardRef","_ref","ref","type","children","settings","modifier","backgroundImage","tagType","dataNoSnippet","otherProps","_objectWithoutProperties2","_useGetImages","useGetImages","_useGetImages$data$ge","data","getFile","_useGetImages$data$ge2","_useGetImages$data$ge3","url","style","getStylesToUpdate","title","classModifiers","getClassModifiers","additionalRowModifier","checkIfRowHasColumns","COLUMN","hasChildren","otherWrapperProps","createElement","_extends2","className","modifiers","concat","renderChildren","propTypes","PropTypes","string","isRequired","shape","bool","oneOfType","arrayOf","node","defaultProps","_default","exports"],"sources":["../../../src/components/Layout/Layout.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Wrapper from '../Wrapper';\nimport { getClassModifiers } from '../../utils';\nimport { useGetImages } from '../../hooks';\nimport { getStylesToUpdate, checkIfRowHasColumns } from './helpers';\nimport { renderChildren, hasChildren } from '../../helpers';\nimport { COLUMN } from '../../constants';\n\nconst Layout = React.forwardRef(\n (\n { type, children, settings, modifier, backgroundImage, tagType, dataNoSnippet, ...otherProps },\n ref\n ) => {\n const {\n data: { getFile: { url = null } = {} }\n } = useGetImages(backgroundImage);\n\n const style = getStylesToUpdate({ backgroundImage: url });\n const { title } = settings;\n\n const classModifiers = getClassModifiers(type, { modifier, ...otherProps });\n const additionalRowModifier = checkIfRowHasColumns(type, children) ? ' display-row' : '';\n\n if (type === COLUMN && !hasChildren(children)) return null;\n\n const otherWrapperProps = {};\n if (dataNoSnippet) otherWrapperProps['data-nosnippet'] = true;\n\n return (\n <Wrapper\n ref={ref}\n tagType={tagType}\n className={type}\n modifiers={`${classModifiers}${additionalRowModifier}`}\n style={style}\n {...otherWrapperProps}>\n {title && <h2 className=\"heading heading--section\">{title}</h2>}\n {renderChildren(children, otherProps)}\n </Wrapper>\n );\n }\n);\n\nLayout.propTypes = {\n type: PropTypes.string.isRequired,\n settings: PropTypes.shape({\n title: PropTypes.string\n }),\n modifier: PropTypes.string,\n backgroundImage: PropTypes.string,\n tagType: PropTypes.string,\n dataNoSnippet: PropTypes.bool,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired\n};\n\nLayout.defaultProps = {\n settings: {\n title: ''\n },\n backgroundImage: '',\n modifier: '',\n tagType: '',\n dataNoSnippet: false\n};\n\nexport default Layout;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AAAyC,IAAAQ,SAAA;AAAA,SAAAC,QAAAC,MAAA,EAAAC,cAAA,QAAAC,IAAA,GAAAC,MAAA,CAAAD,IAAA,CAAAF,MAAA,OAAAG,MAAA,CAAAC,qBAAA,QAAAC,OAAA,GAAAF,MAAA,CAAAC,qBAAA,CAAAJ,MAAA,GAAAC,cAAA,KAAAI,OAAA,GAAAA,OAAA,CAAAC,MAAA,WAAAC,GAAA,WAAAJ,MAAA,CAAAK,wBAAA,CAAAR,MAAA,EAAAO,GAAA,EAAAE,UAAA,OAAAP,IAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,IAAA,EAAAG,OAAA,YAAAH,IAAA;AAAA,SAAAU,cAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,WAAAF,SAAA,CAAAD,CAAA,IAAAC,SAAA,CAAAD,CAAA,QAAAA,CAAA,OAAAf,OAAA,CAAAI,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,aAAa,EAAE4B,qBAAS,CAACI,IAAI;EAC7BrC,QAAQ,EAAEiC,qBAAS,CAACK,SAAS,CAAC,CAACL,qBAAS,CAACM,OAAO,CAACN,qBAAS,CAACO,IAAI,CAAC,EAAEP,qBAAS,CAACO,IAAI,CAAC,CAAC,CAACL;AACrF,CAAC;AAEDzC,MAAM,CAAC+C,YAAY,GAAG;EACpBxC,QAAQ,EAAE;IACRiB,KAAK,EAAE;EACT,CAAC;EACDf,eAAe,EAAE,EAAE;EACnBD,QAAQ,EAAE,EAAE;EACZE,OAAO,EAAE,EAAE;EACXC,aAAa,EAAE;AACjB,CAAC;AAAC,IAAAqC,QAAA,GAEahD,MAAM;AAAAiD,OAAA,cAAAD,QAAA"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
9
+ require("core-js/modules/es.object.to-string.js");
10
+ require("core-js/modules/es.promise.js");
11
+ require("core-js/modules/es.array.iterator.js");
12
+ require("core-js/modules/es.string.iterator.js");
13
+ require("core-js/modules/es.weak-map.js");
14
+ require("core-js/modules/web.dom-collections.iterator.js");
15
+ require("core-js/modules/es.object.define-property.js");
16
+ require("core-js/modules/es.object.get-own-property-descriptor.js");
17
+ var _react = _interopRequireDefault(require("react"));
18
+ var _dynamic = _interopRequireDefault(require("next/dynamic"));
19
+ var _Layout = _interopRequireDefault(require("./Layout"));
20
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || (0, _typeof2["default"])(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
22
+ var LayoutWithStickyTimer = (0, _dynamic["default"])(function () {
23
+ return Promise.resolve().then(function () {
24
+ return _interopRequireWildcard(require( /* webpackChunkName: "blazePbLayoutWithStickyTimer" */'./LayoutWithStickyTimer'));
25
+ });
26
+ });
27
+ var LayoutFactory = function LayoutFactory(props) {
28
+ var sticky = props.sticky,
29
+ stickyTimer = props.stickyTimer;
30
+ if (sticky && stickyTimer) return /*#__PURE__*/_react["default"].createElement(LayoutWithStickyTimer, props);
31
+ return /*#__PURE__*/_react["default"].createElement(_Layout["default"], props);
32
+ };
33
+ var _default = LayoutFactory;
34
+ exports["default"] = _default;
35
+ //# sourceMappingURL=LayoutFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayoutFactory.js","names":["_react","_interopRequireDefault","require","_dynamic","_Layout","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","obj","__esModule","_typeof2","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","LayoutWithStickyTimer","dynamic","Promise","resolve","then","LayoutFactory","props","sticky","stickyTimer","createElement","_default","exports"],"sources":["../../../src/components/Layout/LayoutFactory.js"],"sourcesContent":["import React from 'react';\nimport dynamic from 'next/dynamic';\nimport Layout from './Layout';\n\nconst LayoutWithStickyTimer = dynamic(() =>\n import(/* webpackChunkName: \"blazePbLayoutWithStickyTimer\" */ './LayoutWithStickyTimer')\n);\n\nconst LayoutFactory = props => {\n const { sticky, stickyTimer } = props;\n\n if (sticky && stickyTimer) return <LayoutWithStickyTimer {...props} />;\n\n return <Layout {...props} />;\n};\n\nexport default LayoutFactory;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAH,sBAAA,CAAAC,OAAA;AAA8B,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAI,wBAAAC,GAAA,EAAAL,WAAA,SAAAA,WAAA,IAAAK,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,iBAAAE,QAAA,aAAAF,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAG,KAAA,GAAAT,wBAAA,CAAAC,WAAA,OAAAQ,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,cAAAN,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AAE9B,IAAMW,qBAAqB,GAAG,IAAAC,mBAAO,EAAC;EAAA,OAAAC,OAAA,CAAAC,OAAA,GAAAC,IAAA;IAAA,OAAAtB,uBAAA,CAAAR,OAAA,EAC7B,sDAAuD,yBAAyB;EAAA;AAAA,CACzF,CAAC;AAED,IAAM+B,aAAa,GAAG,SAAhBA,aAAaA,CAAGC,KAAK,EAAI;EAC7B,IAAQC,MAAM,GAAkBD,KAAK,CAA7BC,MAAM;IAAEC,WAAW,GAAKF,KAAK,CAArBE,WAAW;EAE3B,IAAID,MAAM,IAAIC,WAAW,EAAE,oBAAOpC,MAAA,YAAAqC,aAAA,CAACT,qBAAqB,EAAKM,KAAQ,CAAC;EAEtE,oBAAOlC,MAAA,YAAAqC,aAAA,CAACjC,OAAA,WAAM,EAAK8B,KAAQ,CAAC;AAC9B,CAAC;AAAC,IAAAI,QAAA,GAEaL,aAAa;AAAAM,OAAA,cAAAD,QAAA"}
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.array.iterator.js");
4
+ require("core-js/modules/es.object.to-string.js");
5
+ require("core-js/modules/es.string.iterator.js");
6
+ require("core-js/modules/es.weak-map.js");
7
+ require("core-js/modules/web.dom-collections.iterator.js");
8
+ require("core-js/modules/es.object.define-property.js");
9
+ require("core-js/modules/es.object.get-own-property-descriptor.js");
10
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
11
+ var _typeof = require("@babel/runtime/helpers/typeof");
12
+ Object.defineProperty(exports, "__esModule", {
13
+ value: true
14
+ });
15
+ exports["default"] = void 0;
16
+ require("core-js/modules/web.timers.js");
17
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
18
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
19
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
20
+ var _react = _interopRequireWildcard(require("react"));
21
+ var _propTypes = _interopRequireDefault(require("prop-types"));
22
+ var _customHooks = require("@blaze-react/utils/lib/customHooks");
23
+ var _recreateOnNavigation = _interopRequireDefault(require("../../HOC/recreateOnNavigation"));
24
+ var _Layout = _interopRequireDefault(require("./Layout"));
25
+ var _excluded = ["sticky", "stickyTimer"];
26
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
28
+ var LayoutWithStickyTimer = function LayoutWithStickyTimer(_ref) {
29
+ var sticky = _ref.sticky,
30
+ stickyTimer = _ref.stickyTimer,
31
+ otherProps = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
32
+ var _useInView = (0, _customHooks.useInView)({}),
33
+ _useInView2 = (0, _slicedToArray2["default"])(_useInView, 2),
34
+ isIntersecting = _useInView2[0],
35
+ outerRef = _useInView2[1];
36
+ var _useState = (0, _react.useState)(sticky),
37
+ _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
38
+ isSticky = _useState2[0],
39
+ setIsSticky = _useState2[1];
40
+ (0, _react.useEffect)(function () {
41
+ if (isIntersecting && sticky && !!stickyTimer) {
42
+ setIsSticky(true);
43
+ var timer = setTimeout(function () {
44
+ setIsSticky(false);
45
+ }, stickyTimer);
46
+ return function () {
47
+ clearTimeout(timer);
48
+ };
49
+ }
50
+ }, [isIntersecting, stickyTimer, sticky]);
51
+ return /*#__PURE__*/_react["default"].createElement(_Layout["default"], (0, _extends2["default"])({}, otherProps, {
52
+ sticky: isSticky,
53
+ ref: sticky ? outerRef : null
54
+ }));
55
+ };
56
+ LayoutWithStickyTimer.propTypes = {
57
+ sticky: _propTypes["default"].bool,
58
+ stickyTimer: _propTypes["default"].number
59
+ };
60
+ LayoutWithStickyTimer.defaultProps = {
61
+ sticky: false,
62
+ stickyTimer: 0
63
+ };
64
+ var _default = (0, _recreateOnNavigation["default"])(LayoutWithStickyTimer);
65
+ exports["default"] = _default;
66
+ //# sourceMappingURL=LayoutWithStickyTimer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayoutWithStickyTimer.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_customHooks","_recreateOnNavigation","_Layout","_excluded","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","LayoutWithStickyTimer","_ref","sticky","stickyTimer","otherProps","_objectWithoutProperties2","_useInView","useInView","_useInView2","_slicedToArray2","isIntersecting","outerRef","_useState","useState","_useState2","isSticky","setIsSticky","useEffect","timer","setTimeout","clearTimeout","createElement","_extends2","ref","propTypes","PropTypes","bool","number","defaultProps","_default","recreateOnNavigation","exports"],"sources":["../../../src/components/Layout/LayoutWithStickyTimer.js"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { useInView } from '@blaze-react/utils/lib/customHooks';\nimport recreateOnNavigation from '../../HOC/recreateOnNavigation';\nimport Layout from './Layout';\n\nconst LayoutWithStickyTimer = ({ sticky, stickyTimer, ...otherProps }) => {\n const [isIntersecting, outerRef] = useInView({});\n const [isSticky, setIsSticky] = useState(sticky);\n\n useEffect(\n () => {\n if (isIntersecting && sticky && !!stickyTimer) {\n setIsSticky(true);\n const timer = setTimeout(() => {\n setIsSticky(false);\n }, stickyTimer);\n\n return () => {\n clearTimeout(timer);\n };\n }\n },\n [isIntersecting, stickyTimer, sticky]\n );\n\n return <Layout {...otherProps} sticky={isSticky} ref={sticky ? outerRef : null} />;\n};\n\nLayoutWithStickyTimer.propTypes = {\n sticky: PropTypes.bool,\n stickyTimer: PropTypes.number\n};\n\nLayoutWithStickyTimer.defaultProps = {\n sticky: false,\n stickyTimer: 0\n};\n\nexport default recreateOnNavigation(LayoutWithStickyTimer);\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,qBAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,OAAA,GAAAH,sBAAA,CAAAF,OAAA;AAA8B,IAAAM,SAAA;AAAA,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAT,wBAAAa,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA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CAAC;IAAAY,UAAA,OAAAL,eAAA,aAAAG,SAAA;IAAzCG,QAAQ,GAAAD,UAAA;IAAEE,WAAW,GAAAF,UAAA;EAE5B,IAAAG,gBAAS,EACP,YAAM;IACJ,IAAIP,cAAc,IAAIR,MAAM,IAAI,CAAC,CAACC,WAAW,EAAE;MAC7Ca,WAAW,CAAC,IAAI,CAAC;MACjB,IAAME,KAAK,GAAGC,UAAU,CAAC,YAAM;QAC7BH,WAAW,CAAC,KAAK,CAAC;MACpB,CAAC,EAAEb,WAAW,CAAC;MAEf,OAAO,YAAM;QACXiB,YAAY,CAACF,KAAK,CAAC;MACrB,CAAC;IACH;EACF,CAAC,EACD,CAACR,cAAc,EAAEP,WAAW,EAAED,MAAM,CACtC,CAAC;EAED,oBAAOjC,MAAA,YAAAoD,aAAA,CAAC7C,OAAA,WAAM,MAAA8C,SAAA,iBAAKlB,UAAU;IAAEF,MAAM,EAAEa,QAAS;IAACQ,GAAG,EAAErB,MAAM,GAAGS,QAAQ,GAAG;EAAK,EAAE,CAAC;AACpF,CAAC;AAEDX,qBAAqB,CAACwB,SAAS,GAAG;EAChCtB,MAAM,EAAEuB,qBAAS,CAACC,IAAI;EACtBvB,WAAW,EAAEsB,qBAAS,CAACE;AACzB,CAAC;AAED3B,qBAAqB,CAAC4B,YAAY,GAAG;EACnC1B,MAAM,EAAE,KAAK;EACbC,WAAW,EAAE;AACf,CAAC;AAAC,IAAA0B,QAAA,GAEa,IAAAC,gCAAoB,EAAC9B,qBAAqB,CAAC;AAAA+B,OAAA,cAAAF,QAAA"}
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports["default"] = void 0;
9
- var _Layout = _interopRequireDefault(require("./Layout"));
10
- var _default = _Layout["default"];
9
+ var _LayoutFactory = _interopRequireDefault(require("./LayoutFactory"));
10
+ var _default = _LayoutFactory["default"];
11
11
  exports["default"] = _default;
12
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_Layout","_interopRequireDefault","require","_default","Layout","exports"],"sources":["../../../src/components/Layout/index.js"],"sourcesContent":["import Layout from './Layout';\n\nexport default Layout;\n"],"mappings":";;;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8B,IAAAC,QAAA,GAEfC,kBAAM;AAAAC,OAAA,cAAAF,QAAA"}
1
+ {"version":3,"file":"index.js","names":["_LayoutFactory","_interopRequireDefault","require","_default","LayoutFactory","exports"],"sources":["../../../src/components/Layout/index.js"],"sourcesContent":["import LayoutFactory from './LayoutFactory';\n\nexport default LayoutFactory;\n"],"mappings":";;;;;;;;AAAA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA4C,IAAAC,QAAA,GAE7BC,yBAAa;AAAAC,OAAA,cAAAF,QAAA"}
@@ -133,7 +133,6 @@ SearchContent.propTypes = {
133
133
  searchInputWrapperDesktop: _propTypes["default"].string,
134
134
  placeholder: _propTypes["default"].string,
135
135
  isMobile: _propTypes["default"].bool,
136
- collapsible: _propTypes["default"].bool,
137
136
  entities: _propTypes["default"].array.isRequired,
138
137
  modifier: _propTypes["default"].string,
139
138
  collapsedSearch: _propTypes["default"].bool
@@ -144,7 +143,6 @@ SearchContent.defaultProps = {
144
143
  searchInputWrapperDesktop: '',
145
144
  placeholder: '',
146
145
  isMobile: false,
147
- collapsible: false,
148
146
  modifier: '',
149
147
  collapsedSearch: false
150
148
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SearchContent.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_router","_pluginSearchUi","_SearchContentResults","_SearchContentToggleIcon","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","SearchContent","_ref","entities","searchInputAlignment","searchInputWrapperMobile","searchInputWrapperDesktop","isMobile","placeholder","modifier","collapsedSearch","_useState","useState","_useState2","_slicedToArray2","collapsed","setCollapsed","router","useRouter","_useDebounceSearch","useDebounceSearch","initialSearchTerm","resultKeys","results","searchTerm","setSearchTerm","debouncedSearchTerm","useEffect","handleRouteChange","events","on","off","responsiveClasses","handleClick","e","url","preventDefault","push","handleKeyPress","target","value","concat","handleOnBlur","handleClearSearchResults","className","filter","Boolean","join","createElement","viewBox","fillRule","d","clipRule","onFocus","onChange","type","name","Fragment","onClear","onKeyPress","onBlur","propTypes","PropTypes","string","bool","collapsible","array","isRequired","defaultProps","_default","exports"],"sources":["../../../src/components/SearchContent/SearchContent.js"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { useRouter } from 'next/router';\nimport { useDebounceSearch } from '@blaze-cms/plugin-search-ui';\nimport SearchContentResults from './SearchContentResults';\nimport SearchContentToggleIcon from './SearchContentToggleIcon';\n\nconst SearchContent = ({\n entities,\n searchInputAlignment,\n searchInputWrapperMobile,\n searchInputWrapperDesktop,\n isMobile,\n placeholder,\n modifier,\n collapsedSearch\n}) => {\n const [collapsed, setCollapsed] = useState(collapsedSearch);\n const router = useRouter();\n\n const { results, searchTerm, setSearchTerm, debouncedSearchTerm } = useDebounceSearch({\n entities,\n initialSearchTerm: '',\n resultKeys: 'id, name, image { url }, url'\n });\n\n useEffect(\n () => {\n const handleRouteChange = () => setSearchTerm('');\n router.events.on('routeChangeStart', handleRouteChange);\n\n return () => {\n router.events.off('routeChangeStart', handleRouteChange);\n };\n },\n [router.events, setSearchTerm]\n );\n\n const responsiveClasses = isMobile ? searchInputWrapperMobile : searchInputWrapperDesktop;\n\n const handleClick = (e, url) => {\n e.preventDefault();\n router.push(url);\n };\n\n const handleKeyPress = e => {\n if (e.key === 'Enter' && e.target.value !== '') {\n router.push(`/search?search_term=${e.target.value}`);\n }\n };\n\n const handleOnBlur = () => {\n if (!collapsedSearch) return;\n if (!debouncedSearchTerm || debouncedSearchTerm === '') setCollapsed(true);\n };\n\n const handleClearSearchResults = () => {\n setSearchTerm('');\n };\n\n const className = ['search-content', modifier, responsiveClasses].filter(Boolean).join(' ');\n return collapsed ? (\n <div className={className}>\n <div className=\"search-content--collapse__wrapper\">\n <label className=\"search-content--collapse__label\">\n <span className=\"search-content--collapse__icon_wrapper\">\n <svg className=\"search-content--collapse__icon\" viewBox=\"0 0 20 20\">\n <path\n fillRule=\"evenodd\"\n d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\"\n clipRule=\"evenodd\"\n />\n </svg>\n </span>\n <input\n onFocus={() => setCollapsed(false)}\n onChange={e => setSearchTerm(e.target.value)}\n type=\"text\"\n name=\"search\"\n className=\"search-content--collapse__input\"\n />\n </label>\n </div>\n </div>\n ) : (\n <>\n <div className={className}>\n <div className=\"search-content--expanded__wrapper\">\n <label className=\"search-content--expanded__label\">\n <span className=\"search-content--expanded__icon_wrapper\">\n <SearchContentToggleIcon results={results} onClear={handleClearSearchResults} />\n </span>\n <input\n type=\"text\"\n name=\"search\"\n onChange={e => setSearchTerm(e.target.value)}\n onKeyPress={handleKeyPress}\n className=\"search-content--expanded__input\"\n placeholder={placeholder}\n value={searchTerm}\n onBlur={handleOnBlur}\n />\n </label>\n </div>\n <SearchContentResults\n results={results}\n debouncedSearchTerm={debouncedSearchTerm}\n handleClick={handleClick}\n />\n </div>\n </>\n );\n};\n\nSearchContent.propTypes = {\n searchInputAlignment: PropTypes.string,\n searchInputWrapperMobile: PropTypes.string,\n searchInputWrapperDesktop: PropTypes.string,\n placeholder: PropTypes.string,\n isMobile: PropTypes.bool,\n collapsible: PropTypes.bool,\n entities: PropTypes.array.isRequired,\n modifier: PropTypes.string,\n collapsedSearch: PropTypes.bool\n};\n\nSearchContent.defaultProps = {\n searchInputAlignment: '',\n searchInputWrapperMobile: '',\n searchInputWrapperDesktop: '',\n plac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
+ {"version":3,"file":"SearchContent.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_router","_pluginSearchUi","_SearchContentResults","_SearchContentToggleIcon","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","SearchContent","_ref","entities","searchInputAlignment","searchInputWrapperMobile","searchInputWrapperDesktop","isMobile","placeholder","modifier","collapsedSearch","_useState","useState","_useState2","_slicedToArray2","collapsed","setCollapsed","router","useRouter","_useDebounceSearch","useDebounceSearch","initialSearchTerm","resultKeys","results","searchTerm","setSearchTerm","debouncedSearchTerm","useEffect","handleRouteChange","events","on","off","responsiveClasses","handleClick","e","url","preventDefault","push","handleKeyPress","target","value","concat","handleOnBlur","handleClearSearchResults","className","filter","Boolean","join","createElement","viewBox","fillRule","d","clipRule","onFocus","onChange","type","name","Fragment","onClear","onKeyPress","onBlur","propTypes","PropTypes","string","bool","array","isRequired","defaultProps","_default","exports"],"sources":["../../../src/components/SearchContent/SearchContent.js"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { useRouter } from 'next/router';\nimport { useDebounceSearch } from '@blaze-cms/plugin-search-ui';\nimport SearchContentResults from './SearchContentResults';\nimport SearchContentToggleIcon from './SearchContentToggleIcon';\n\nconst SearchContent = ({\n entities,\n searchInputAlignment,\n searchInputWrapperMobile,\n searchInputWrapperDesktop,\n isMobile,\n placeholder,\n modifier,\n collapsedSearch\n}) => {\n const [collapsed, setCollapsed] = useState(collapsedSearch);\n const router = useRouter();\n\n const { results, searchTerm, setSearchTerm, debouncedSearchTerm } = useDebounceSearch({\n entities,\n initialSearchTerm: '',\n resultKeys: 'id, name, image { url }, url'\n });\n\n useEffect(\n () => {\n const handleRouteChange = () => setSearchTerm('');\n router.events.on('routeChangeStart', handleRouteChange);\n\n return () => {\n router.events.off('routeChangeStart', handleRouteChange);\n };\n },\n [router.events, setSearchTerm]\n );\n\n const responsiveClasses = isMobile ? searchInputWrapperMobile : searchInputWrapperDesktop;\n\n const handleClick = (e, url) => {\n e.preventDefault();\n router.push(url);\n };\n\n const handleKeyPress = e => {\n if (e.key === 'Enter' && e.target.value !== '') {\n router.push(`/search?search_term=${e.target.value}`);\n }\n };\n\n const handleOnBlur = () => {\n if (!collapsedSearch) return;\n if (!debouncedSearchTerm || debouncedSearchTerm === '') setCollapsed(true);\n };\n\n const handleClearSearchResults = () => {\n setSearchTerm('');\n };\n\n const className = ['search-content', modifier, responsiveClasses].filter(Boolean).join(' ');\n return collapsed ? (\n <div className={className}>\n <div className=\"search-content--collapse__wrapper\">\n <label className=\"search-content--collapse__label\">\n <span className=\"search-content--collapse__icon_wrapper\">\n <svg className=\"search-content--collapse__icon\" viewBox=\"0 0 20 20\">\n <path\n fillRule=\"evenodd\"\n d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\"\n clipRule=\"evenodd\"\n />\n </svg>\n </span>\n <input\n onFocus={() => setCollapsed(false)}\n onChange={e => setSearchTerm(e.target.value)}\n type=\"text\"\n name=\"search\"\n className=\"search-content--collapse__input\"\n />\n </label>\n </div>\n </div>\n ) : (\n <>\n <div className={className}>\n <div className=\"search-content--expanded__wrapper\">\n <label className=\"search-content--expanded__label\">\n <span className=\"search-content--expanded__icon_wrapper\">\n <SearchContentToggleIcon results={results} onClear={handleClearSearchResults} />\n </span>\n <input\n type=\"text\"\n name=\"search\"\n onChange={e => setSearchTerm(e.target.value)}\n onKeyPress={handleKeyPress}\n className=\"search-content--expanded__input\"\n placeholder={placeholder}\n value={searchTerm}\n onBlur={handleOnBlur}\n />\n </label>\n </div>\n <SearchContentResults\n results={results}\n debouncedSearchTerm={debouncedSearchTerm}\n handleClick={handleClick}\n />\n </div>\n </>\n );\n};\n\nSearchContent.propTypes = {\n searchInputAlignment: PropTypes.string,\n searchInputWrapperMobile: PropTypes.string,\n searchInputWrapperDesktop: PropTypes.string,\n placeholder: PropTypes.string,\n isMobile: PropTypes.bool,\n entities: PropTypes.array.isRequired,\n modifier: PropTypes.string,\n collapsedSearch: PropTypes.bool\n};\n\nSearchContent.defaultProps = {\n searchInputAlignment: '',\n searchInputWrapperMobile: '',\n searchInputWrapperDesktop: '',\n placeholder: '',\n isMobile: false,\n modifier: '',\n collapsedSearch: false\n};\n\nexport default SearchContent;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,qBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,wBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AAAgE,SAAAO,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAT,wBAAAa,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAA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EAC5BC,yBAAyB,EAAE,EAAE;EAC7BE,WAAW,EAAE,EAAE;EACfD,QAAQ,EAAE,KAAK;EACfE,QAAQ,EAAE,EAAE;EACZC,eAAe,EAAE;AACnB,CAAC;AAAC,IAAA0D,QAAA,GAEanE,aAAa;AAAAoE,OAAA,cAAAD,QAAA"}
@@ -81,12 +81,10 @@ var SearchFilter = function SearchFilter(_ref) {
81
81
  moreFiltersDesktopTogglerClass = _getResponsiveFilterC.moreFiltersDesktopTogglerClass;
82
82
  var formId = "filter-".concat(name, "-form");
83
83
  var handleReset = function handleReset() {
84
- var newValues = (0, _helpers.getFilterValues)(null, filters, {});
85
84
  setAppliedFilters({
86
- newValues: newValues,
87
85
  type: 'reset'
88
86
  });
89
- doSubmit(newValues);
87
+ doSubmit();
90
88
  };
91
89
  var updateFilterValues = function updateFilterValues(newValues, shouldSubmit) {
92
90
  setAppliedFilters({