@blaze-cms/react-page-builder 0.131.0-project-admin-customisations.0 → 0.131.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 (251) hide show
  1. package/CHANGELOG.md +2 -21
  2. package/lib/HOC/recreateOnNavigation.js +29 -0
  3. package/lib/HOC/recreateOnNavigation.js.map +1 -0
  4. package/lib/components/Button.js +1 -2
  5. package/lib/components/Button.js.map +1 -1
  6. package/lib/components/Card/CardsRender.js +6 -13
  7. package/lib/components/Card/CardsRender.js.map +1 -1
  8. package/lib/components/Card/helpers/index.js +0 -7
  9. package/lib/components/Card/helpers/index.js.map +1 -1
  10. package/lib/components/Code/Code.js +3 -7
  11. package/lib/components/Code/Code.js.map +1 -1
  12. package/lib/components/ContentGroupSection/ContentGroupSection.js +4 -1
  13. package/lib/components/ContentGroupSection/ContentGroupSection.js.map +1 -1
  14. package/lib/components/DataSummary/helpers/build-loop-props-content.js +1 -3
  15. package/lib/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
  16. package/lib/components/DataSummary/helpers/build-props-to-display-with-content.js +2 -3
  17. package/lib/components/DataSummary/helpers/build-props-to-display-with-content.js.map +1 -1
  18. package/lib/components/Layout/Layout.js +3 -2
  19. package/lib/components/Layout/Layout.js.map +1 -1
  20. package/lib/components/Layout/LayoutFactory.js +35 -0
  21. package/lib/components/Layout/LayoutFactory.js.map +1 -0
  22. package/lib/components/Layout/LayoutWithStickyTimer.js +66 -0
  23. package/lib/components/Layout/LayoutWithStickyTimer.js.map +1 -0
  24. package/lib/components/Layout/index.js +2 -2
  25. package/lib/components/Layout/index.js.map +1 -1
  26. package/lib/components/List/ListFactory.js +11 -16
  27. package/lib/components/List/ListFactory.js.map +1 -1
  28. package/lib/components/List/helpers/index.js +0 -14
  29. package/lib/components/List/helpers/index.js.map +1 -1
  30. package/lib/components/SearchContent/SearchContent.js +6 -8
  31. package/lib/components/SearchContent/SearchContent.js.map +1 -1
  32. package/lib/components/SearchFilter/SearchFilter/SearchFilter.js +11 -17
  33. package/lib/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
  34. package/lib/components/SearchFilter/SearchFilterContainer.js +85 -63
  35. package/lib/components/SearchFilter/SearchFilterContainer.js.map +1 -1
  36. package/lib/components/SearchFilter/helpers/build-filters-query.js +1 -3
  37. package/lib/components/SearchFilter/helpers/build-filters-query.js.map +1 -1
  38. package/lib/components/SearchFilter/helpers/build-new-query.js +15 -0
  39. package/lib/components/SearchFilter/helpers/build-new-query.js.map +1 -0
  40. package/lib/components/SearchFilter/helpers/build-query.js +37 -0
  41. package/lib/components/SearchFilter/helpers/build-query.js.map +1 -0
  42. package/lib/components/SearchFilter/helpers/get-initial-filter-values.js +43 -0
  43. package/lib/components/SearchFilter/helpers/get-initial-filter-values.js.map +1 -0
  44. package/lib/components/SearchFilter/helpers/index.js +11 -18
  45. package/lib/components/SearchFilter/helpers/index.js.map +1 -1
  46. package/lib/components/SearchFilter/index.js.map +1 -1
  47. package/lib/components/SearchFilterSort/SearchFilterSort.js +11 -31
  48. package/lib/components/SearchFilterSort/SearchFilterSort.js.map +1 -1
  49. package/lib/components/SearchFilterSort/helpers/handle-sort-update.js +5 -19
  50. package/lib/components/SearchFilterSort/helpers/handle-sort-update.js.map +1 -1
  51. package/lib/components/SearchFilterSort/helpers/update-sort.js +5 -9
  52. package/lib/components/SearchFilterSort/helpers/update-sort.js.map +1 -1
  53. package/lib/helpers/build-inherited-filters.js +0 -2
  54. package/lib/helpers/build-inherited-filters.js.map +1 -1
  55. package/lib/helpers/build-props-query.js +2 -5
  56. package/lib/helpers/build-props-query.js.map +1 -1
  57. package/lib/helpers/build-set-filters.js +1 -5
  58. package/lib/helpers/build-set-filters.js.map +1 -1
  59. package/lib/helpers/get-query-filters.js +8 -6
  60. package/lib/helpers/get-query-filters.js.map +1 -1
  61. package/lib/helpers/get-query-props.js +2 -13
  62. package/lib/helpers/get-query-props.js.map +1 -1
  63. package/lib/helpers/get-wrapped-value-with-link.js +3 -2
  64. package/lib/helpers/get-wrapped-value-with-link.js.map +1 -1
  65. package/lib/helpers/index.js +0 -14
  66. package/lib/helpers/index.js.map +1 -1
  67. package/lib/helpers/parse-props-to-display.js +8 -13
  68. package/lib/helpers/parse-props-to-display.js.map +1 -1
  69. package/lib/utils/get-class-modifiers.js +1 -1
  70. package/lib/utils/get-class-modifiers.js.map +1 -1
  71. package/lib-es/HOC/recreateOnNavigation.js +20 -0
  72. package/lib-es/HOC/recreateOnNavigation.js.map +1 -0
  73. package/lib-es/components/Button.js +1 -2
  74. package/lib-es/components/Button.js.map +1 -1
  75. package/lib-es/components/Card/CardsRender.js +7 -14
  76. package/lib-es/components/Card/CardsRender.js.map +1 -1
  77. package/lib-es/components/Card/helpers/index.js +0 -1
  78. package/lib-es/components/Card/helpers/index.js.map +1 -1
  79. package/lib-es/components/Code/Code.js +4 -8
  80. package/lib-es/components/Code/Code.js.map +1 -1
  81. package/lib-es/components/ContentGroupSection/ContentGroupSection.js +8 -4
  82. package/lib-es/components/ContentGroupSection/ContentGroupSection.js.map +1 -1
  83. package/lib-es/components/DataSummary/helpers/build-loop-props-content.js +1 -3
  84. package/lib-es/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
  85. package/lib-es/components/DataSummary/helpers/build-props-to-display-with-content.js +3 -4
  86. package/lib-es/components/DataSummary/helpers/build-props-to-display-with-content.js.map +1 -1
  87. package/lib-es/components/Layout/Layout.js +3 -2
  88. package/lib-es/components/Layout/Layout.js.map +1 -1
  89. package/lib-es/components/Layout/LayoutFactory.js +14 -0
  90. package/lib-es/components/Layout/LayoutFactory.js.map +1 -0
  91. package/lib-es/components/Layout/LayoutWithStickyTimer.js +42 -0
  92. package/lib-es/components/Layout/LayoutWithStickyTimer.js.map +1 -0
  93. package/lib-es/components/Layout/index.js +2 -2
  94. package/lib-es/components/Layout/index.js.map +1 -1
  95. package/lib-es/components/List/ListFactory.js +12 -16
  96. package/lib-es/components/List/ListFactory.js.map +1 -1
  97. package/lib-es/components/List/helpers/index.js +0 -2
  98. package/lib-es/components/List/helpers/index.js.map +1 -1
  99. package/lib-es/components/SearchContent/SearchContent.js +6 -8
  100. package/lib-es/components/SearchContent/SearchContent.js.map +1 -1
  101. package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js +11 -18
  102. package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
  103. package/lib-es/components/SearchFilter/SearchFilterContainer.js +72 -47
  104. package/lib-es/components/SearchFilter/SearchFilterContainer.js.map +1 -1
  105. package/lib-es/components/SearchFilter/helpers/build-filters-query.js +0 -2
  106. package/lib-es/components/SearchFilter/helpers/build-filters-query.js.map +1 -1
  107. package/lib-es/components/SearchFilter/helpers/build-new-query.js +6 -0
  108. package/lib-es/components/SearchFilter/helpers/build-new-query.js.map +1 -0
  109. package/lib-es/components/SearchFilter/helpers/build-query.js +23 -0
  110. package/lib-es/components/SearchFilter/helpers/build-query.js.map +1 -0
  111. package/lib-es/components/SearchFilter/helpers/get-initial-filter-values.js +26 -0
  112. package/lib-es/components/SearchFilter/helpers/get-initial-filter-values.js.map +1 -0
  113. package/lib-es/components/SearchFilter/helpers/index.js +4 -5
  114. package/lib-es/components/SearchFilter/helpers/index.js.map +1 -1
  115. package/lib-es/components/SearchFilter/index.js +2 -2
  116. package/lib-es/components/SearchFilter/index.js.map +1 -1
  117. package/lib-es/components/SearchFilterSort/SearchFilterSort.js +10 -26
  118. package/lib-es/components/SearchFilterSort/SearchFilterSort.js.map +1 -1
  119. package/lib-es/components/SearchFilterSort/helpers/handle-sort-update.js +4 -21
  120. package/lib-es/components/SearchFilterSort/helpers/handle-sort-update.js.map +1 -1
  121. package/lib-es/components/SearchFilterSort/helpers/update-sort.js +4 -8
  122. package/lib-es/components/SearchFilterSort/helpers/update-sort.js.map +1 -1
  123. package/lib-es/helpers/build-inherited-filters.js +0 -2
  124. package/lib-es/helpers/build-inherited-filters.js.map +1 -1
  125. package/lib-es/helpers/build-props-query.js +2 -4
  126. package/lib-es/helpers/build-props-query.js.map +1 -1
  127. package/lib-es/helpers/build-set-filters.js +1 -5
  128. package/lib-es/helpers/build-set-filters.js.map +1 -1
  129. package/lib-es/helpers/get-query-filters.js +8 -6
  130. package/lib-es/helpers/get-query-filters.js.map +1 -1
  131. package/lib-es/helpers/get-query-props.js +2 -10
  132. package/lib-es/helpers/get-query-props.js.map +1 -1
  133. package/lib-es/helpers/get-wrapped-value-with-link.js +2 -2
  134. package/lib-es/helpers/get-wrapped-value-with-link.js.map +1 -1
  135. package/lib-es/helpers/index.js +0 -2
  136. package/lib-es/helpers/index.js.map +1 -1
  137. package/lib-es/helpers/parse-props-to-display.js +9 -12
  138. package/lib-es/helpers/parse-props-to-display.js.map +1 -1
  139. package/lib-es/utils/get-class-modifiers.js +1 -1
  140. package/lib-es/utils/get-class-modifiers.js.map +1 -1
  141. package/package.json +10 -10
  142. package/src/HOC/recreateOnNavigation.js +21 -0
  143. package/src/components/Button.js +1 -2
  144. package/src/components/Card/CardsRender.js +7 -27
  145. package/src/components/Card/helpers/index.js +0 -1
  146. package/src/components/Code/Code.js +3 -7
  147. package/src/components/ContentGroupSection/ContentGroupSection.js +1 -1
  148. package/src/components/DataSummary/helpers/build-loop-props-content.js +1 -4
  149. package/src/components/DataSummary/helpers/build-props-to-display-with-content.js +3 -6
  150. package/src/components/Layout/Layout.js +29 -32
  151. package/src/components/Layout/LayoutFactory.js +17 -0
  152. package/src/components/Layout/LayoutWithStickyTimer.js +40 -0
  153. package/src/components/Layout/index.js +2 -2
  154. package/src/components/List/ListFactory.js +15 -25
  155. package/src/components/List/helpers/index.js +0 -2
  156. package/src/components/SearchContent/SearchContent.js +6 -8
  157. package/src/components/SearchFilter/SearchFilter/SearchFilter.js +12 -21
  158. package/src/components/SearchFilter/SearchFilterContainer.js +69 -57
  159. package/src/components/SearchFilter/helpers/build-filters-query.js +1 -9
  160. package/src/components/SearchFilter/helpers/build-new-query.js +6 -0
  161. package/src/components/SearchFilter/helpers/build-query.js +26 -0
  162. package/src/components/SearchFilter/helpers/get-initial-filter-values.js +30 -0
  163. package/src/components/SearchFilter/helpers/index.js +7 -9
  164. package/src/components/SearchFilter/index.js +2 -2
  165. package/src/components/SearchFilterSort/SearchFilterSort.js +8 -18
  166. package/src/components/SearchFilterSort/helpers/handle-sort-update.js +5 -14
  167. package/src/components/SearchFilterSort/helpers/update-sort.js +3 -7
  168. package/src/helpers/build-inherited-filters.js +1 -3
  169. package/src/helpers/build-props-query.js +2 -4
  170. package/src/helpers/build-set-filters.js +1 -2
  171. package/src/helpers/get-query-filters.js +4 -4
  172. package/src/helpers/get-query-props.js +4 -12
  173. package/src/helpers/get-wrapped-value-with-link.js +3 -6
  174. package/src/helpers/index.js +0 -2
  175. package/src/helpers/parse-props-to-display.js +21 -25
  176. package/src/utils/get-class-modifiers.js +1 -1
  177. package/tests/helpers/mocks.js +5 -3
  178. package/tests/unit/src/HOC/recreateOnNavigation.test.js +28 -0
  179. package/tests/unit/src/components/Code/Code.test.js +0 -5
  180. package/tests/unit/src/components/Code/__snapshots__/Code.test.js.snap +0 -8
  181. package/tests/unit/src/components/DataSummary/helpers/build-loop-props-content.test.js +0 -9
  182. package/tests/unit/src/components/Layout/Layout.test.js +1 -1
  183. package/tests/unit/src/components/Layout/LayoutFactory.test.js +53 -0
  184. package/tests/unit/src/components/SearchFilter/__snapshots__/SearchFilterContainer.test.js.snap +7 -1
  185. package/tests/unit/src/components/SearchFilter/helpers/build-new-query.test.js +10 -10
  186. package/tests/unit/src/components/SearchFilter/helpers/build-query.test.js +7 -24
  187. package/tests/unit/src/components/SearchFilter/helpers/get-initial-filter-values.test.js +10 -10
  188. package/tests/unit/src/components/SearchFilterSort/SearchFilterSort.test.js +1 -4
  189. package/tests/unit/src/components/SearchFilterSort/helpers/handle-sort-update.test.js +19 -26
  190. package/tests/unit/src/components/SearchFilterSort/helpers/update-sort.test.js +1 -10
  191. package/tests/unit/src/helpers/build-props-query.test.js +0 -25
  192. package/tests/unit/src/helpers/get-wrapped-value-with-link.test.js +2 -2
  193. package/tests/unit/src/helpers/parse-props-to-display.test.js +0 -4
  194. package/lib/components/Card/helpers/get-updated-items-to-display.js +0 -55
  195. package/lib/components/Card/helpers/get-updated-items-to-display.js.map +0 -1
  196. package/lib/components/List/helpers/get-list-query.js +0 -43
  197. package/lib/components/List/helpers/get-list-query.js.map +0 -1
  198. package/lib/components/List/helpers/get-list-specific-search-filter.js +0 -21
  199. package/lib/components/List/helpers/get-list-specific-search-filter.js.map +0 -1
  200. package/lib/components/List/helpers/strip-query-key.js +0 -14
  201. package/lib/components/List/helpers/strip-query-key.js.map +0 -1
  202. package/lib/components/SearchFilter/helpers/build-new-url.js +0 -17
  203. package/lib/components/SearchFilter/helpers/build-new-url.js.map +0 -1
  204. package/lib/components/SearchFilter/helpers/build-url-query.js +0 -48
  205. package/lib/components/SearchFilter/helpers/build-url-query.js.map +0 -1
  206. package/lib/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js +0 -32
  207. package/lib/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js.map +0 -1
  208. package/lib/components/SearchFilter/helpers/get-filter-values.js +0 -31
  209. package/lib/components/SearchFilter/helpers/get-filter-values.js.map +0 -1
  210. package/lib/components/SearchFilter/searchFilterReducer.js +0 -45
  211. package/lib/components/SearchFilter/searchFilterReducer.js.map +0 -1
  212. package/lib/helpers/build-query-key.js +0 -16
  213. package/lib/helpers/build-query-key.js.map +0 -1
  214. package/lib/helpers/process-data-summary-value.js +0 -56
  215. package/lib/helpers/process-data-summary-value.js.map +0 -1
  216. package/lib-es/components/Card/helpers/get-updated-items-to-display.js +0 -32
  217. package/lib-es/components/Card/helpers/get-updated-items-to-display.js.map +0 -1
  218. package/lib-es/components/List/helpers/get-list-query.js +0 -24
  219. package/lib-es/components/List/helpers/get-list-query.js.map +0 -1
  220. package/lib-es/components/List/helpers/get-list-specific-search-filter.js +0 -12
  221. package/lib-es/components/List/helpers/get-list-specific-search-filter.js.map +0 -1
  222. package/lib-es/components/List/helpers/strip-query-key.js +0 -6
  223. package/lib-es/components/List/helpers/strip-query-key.js.map +0 -1
  224. package/lib-es/components/SearchFilter/helpers/build-new-url.js +0 -8
  225. package/lib-es/components/SearchFilter/helpers/build-new-url.js.map +0 -1
  226. package/lib-es/components/SearchFilter/helpers/build-url-query.js +0 -30
  227. package/lib-es/components/SearchFilter/helpers/build-url-query.js.map +0 -1
  228. package/lib-es/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js +0 -18
  229. package/lib-es/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js.map +0 -1
  230. package/lib-es/components/SearchFilter/helpers/get-filter-values.js +0 -19
  231. package/lib-es/components/SearchFilter/helpers/get-filter-values.js.map +0 -1
  232. package/lib-es/components/SearchFilter/searchFilterReducer.js +0 -28
  233. package/lib-es/components/SearchFilter/searchFilterReducer.js.map +0 -1
  234. package/lib-es/helpers/build-query-key.js +0 -7
  235. package/lib-es/helpers/build-query-key.js.map +0 -1
  236. package/lib-es/helpers/process-data-summary-value.js +0 -36
  237. package/lib-es/helpers/process-data-summary-value.js.map +0 -1
  238. package/src/components/Card/helpers/get-updated-items-to-display.js +0 -32
  239. package/src/components/List/helpers/get-list-query.js +0 -28
  240. package/src/components/List/helpers/get-list-specific-search-filter.js +0 -10
  241. package/src/components/List/helpers/strip-query-key.js +0 -6
  242. package/src/components/SearchFilter/helpers/build-new-url.js +0 -8
  243. package/src/components/SearchFilter/helpers/build-url-query.js +0 -31
  244. package/src/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js +0 -17
  245. package/src/components/SearchFilter/helpers/get-filter-values.js +0 -21
  246. package/src/components/SearchFilter/searchFilterReducer.js +0 -15
  247. package/src/helpers/build-query-key.js +0 -7
  248. package/src/helpers/process-data-summary-value.js +0 -22
  249. package/tests/unit/src/components/Card/helpers/get-updated-items-to-display.test.js +0 -72
  250. package/tests/unit/src/helpers/__snapshots__/get-wrapped-value-with-link.test.js.snap +0 -18
  251. package/tests/unit/src/helpers/prcoess-data-summary-value.test.js +0 -52
package/CHANGELOG.md CHANGED
@@ -3,31 +3,12 @@
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.0](https://github.com/thebyte9/blaze/compare/v0.130.1...v0.131.0-project-admin-customisations.0) (2023-07-13)
7
-
8
-
9
- ### Bug Fixes
10
-
11
- * add collapse property to searchContent ([#3964](https://github.com/thebyte9/blaze/issues/3964)) ([d133a19](https://github.com/thebyte9/blaze/commit/d133a1965fdb447824dfdb87566809d7597a24b2))
12
- * added logout handling for button ([#3983](https://github.com/thebyte9/blaze/issues/3983)) ([1940547](https://github.com/thebyte9/blaze/commit/19405477315238fe8b14c974645675ec285ee85a))
13
- * hash bits now persists through filter changes ([#3965](https://github.com/thebyte9/blaze/issues/3965)) ([04e4cb3](https://github.com/thebyte9/blaze/commit/04e4cb380520ea7c9b20860bf9cb4ea2facd27ad))
14
- * hlist component andle when no search filter ([#3982](https://github.com/thebyte9/blaze/issues/3982)) ([e9e1a6d](https://github.com/thebyte9/blaze/commit/e9e1a6da969d9afc5f9ddaffcb7bf2238c84d898))
6
+ # [0.131.0](https://github.com/thebyte9/blaze/compare/v0.130.1...v0.131.0) (2023-07-18)
15
7
 
16
8
 
17
9
  ### Features
18
10
 
19
- * 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))
20
- * 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))
21
- * 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))
22
- * 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))
23
-
24
-
25
-
26
- # [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)
27
-
28
-
29
-
30
- # [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)
11
+ * add sticky setting to column and row ([#3988](https://github.com/thebyte9/blaze/issues/3988)) ([735b3b0](https://github.com/thebyte9/blaze/commit/735b3b09e0af15ad262119472579a1120da00347))
31
12
 
32
13
 
33
14
 
@@ -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"}
@@ -84,8 +84,7 @@ var Button = function Button(props) {
84
84
  };
85
85
  var logout = function logout() {
86
86
  (0, _coreAuthUi.handleLogout)(client);
87
- if ((0, _helpers.hasChildren)(children)) return setShowChildren(true);
88
- return url ? router.reload(urlToUse) : router.reload();
87
+ url ? router.reload(urlToUse) : router.reload();
89
88
  };
90
89
  var handleClick = function handleClick() {
91
90
  if (isLogoutButton) logout();
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","names":["_react","_interopRequireWildcard","require","_reactCookie","_router","_classnames","_interopRequireDefault","_button","_coreAuthUi","_client","_propTypes","_utilsHandlebars","_ClickWrapper","_BlazeLink","_HOC","_utils","_constants","_helpers","_excluded","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","Button","props","type","text","url","icon","name","style","children","clickAction","childSeoVisibility","afterClickText","parent","otherProps","_objectWithoutProperties2","client","useApolloClient","router","useRouter","isLogoutButton","LOGOUT","_useCookies","useCookies","_useCookies2","_slicedToArray2","cookies","blazeCookie","blaze_auth","_useState","useState","_useState2","showChildren","setShowChildren","_useStringTemplate","useStringTemplate","_useStringTemplate$da","data","textToUse","afterClickTextToUse","urlToUse","useEffect","asPath","checkIfButtonShouldRender","hasChildren","logout","handleLogout","reload","handleClick","buttonType","modifiers","getClassModifiers","currentProps","href","title","DynamicButton","BlazeLink","BlazeButton","updateChildrensParent","itemId","itemEntity","renderedChildren","renderChildren","onClose","_getClickWrapperOptio","getClickWrapperOptions","shouldUseClickWrapper","wrapperProps","Wrapper","ClickWrapper","Fragment","contentClassName","classnames","createElement","className","_extends2","onClick","propTypes","PropTypes","string","size","bool","oneOfType","arrayOf","node","defaultProps","_default","withTitle","exports"],"sources":["../../src/components/Button.js"],"sourcesContent":["import React, { useState, Fragment, useEffect } from 'react';\nimport { useCookies } from 'react-cookie';\nimport { useRouter } from 'next/router';\nimport classnames from 'classnames';\nimport BlazeButton from '@blaze-react/button';\nimport { handleLogout } from '@blaze-cms/core-auth-ui';\nimport { useApolloClient } from '@apollo/client';\nimport PropTypes, { bool, string } from 'prop-types';\nimport { useStringTemplate } from '@blaze-cms/utils-handlebars';\nimport ClickWrapper from './ClickWrapper';\nimport BlazeLink from './BlazeLink';\nimport { withTitle } from '../HOC';\nimport { getClassModifiers } from '../utils';\nimport { LOGOUT } from '../constants';\nimport {\n renderChildren,\n updateChildrensParent,\n hasChildren,\n getClickWrapperOptions\n} from '../helpers';\n\nconst Button = props => {\n const {\n type,\n text,\n url,\n icon,\n name,\n style,\n children,\n clickAction,\n childSeoVisibility,\n afterClickText,\n parent,\n ...otherProps\n } = props;\n const client = useApolloClient();\n const router = useRouter();\n const isLogoutButton = clickAction === LOGOUT;\n const [cookies] = useCookies();\n const { blaze_auth: blazeCookie } = cookies;\n const [showChildren, setShowChildren] = useState(false);\n const {\n data: [textToUse, afterClickTextToUse, urlToUse]\n } = useStringTemplate(parent, [text, afterClickText, url]);\n\n useEffect(\n () => {\n setShowChildren(false);\n },\n [router.asPath]\n );\n\n const checkIfButtonShouldRender = () => {\n if (isLogoutButton) return !!blazeCookie;\n if (!text && !icon) return false;\n return !!(url || hasChildren(children));\n };\n\n const logout = () => {\n handleLogout(client);\n if (hasChildren(children)) return setShowChildren(true);\n return url ? router.reload(urlToUse) : router.reload();\n };\n\n const handleClick = () => {\n if (isLogoutButton) logout();\n if (!url && !isLogoutButton) setShowChildren(!showChildren);\n };\n\n if (!checkIfButtonShouldRender()) return null;\n\n const buttonType = !text && icon ? 'icon' : type;\n const modifiers = getClassModifiers(buttonType, { icon, style, ...otherProps });\n const currentProps = url ? { href: urlToUse, title: name } : { name };\n const DynamicButton = url && !isLogoutButton ? BlazeLink : BlazeButton;\n updateChildrensParent(children, parent.itemId, parent.itemEntity);\n\n const renderedChildren = renderChildren(children, { onClose: handleClick });\n const { shouldUseClickWrapper, wrapperProps } = getClickWrapperOptions(children, props);\n const Wrapper = shouldUseClickWrapper ? ClickWrapper : Fragment;\n\n const contentClassName = classnames('button__content', {\n 'button__content--show': showChildren\n });\n\n return (\n <Wrapper {...wrapperProps}>\n {childSeoVisibility && <div className={contentClassName}>{renderedChildren}</div>}\n {!childSeoVisibility && showChildren && renderedChildren}\n <DynamicButton className={modifiers} onClick={handleClick} {...currentProps}>\n {icon && <i className={icon} />}\n {showChildren ? afterClickTextToUse : textToUse}\n </DynamicButton>\n </Wrapper>\n );\n};\n\nButton.propTypes = {\n parent: PropTypes.object,\n clickAction: PropTypes.string,\n text: PropTypes.string,\n afterClickText: string,\n name: PropTypes.string,\n type: PropTypes.string,\n url: PropTypes.string,\n size: PropTypes.string,\n icon: PropTypes.string,\n style: PropTypes.string,\n childSeoVisibility: bool,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node])\n};\n\nButton.defaultProps = {\n parent: {},\n clickAction: '',\n text: '',\n afterClickText: '',\n name: '',\n type: '',\n url: null,\n size: '',\n icon: '',\n style: '',\n children: [],\n childSeoVisibility: false\n};\n\nexport default withTitle(Button);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAT,uBAAA,CAAAC,OAAA;AACA,IAAAS,gBAAA,GAAAT,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E,qBAAS,CAACC,MAAM;EACtBnE,cAAc,EAAEmE,iBAAM;EACtBxE,IAAI,EAAEuE,qBAAS,CAACC,MAAM;EACtB5E,IAAI,EAAE2E,qBAAS,CAACC,MAAM;EACtB1E,GAAG,EAAEyE,qBAAS,CAACC,MAAM;EACrBC,IAAI,EAAEF,qBAAS,CAACC,MAAM;EACtBzE,IAAI,EAAEwE,qBAAS,CAACC,MAAM;EACtBvE,KAAK,EAAEsE,qBAAS,CAACC,MAAM;EACvBpE,kBAAkB,EAAEsE,eAAI;EACxBxE,QAAQ,EAAEqE,qBAAS,CAACI,SAAS,CAAC,CAACJ,qBAAS,CAACK,OAAO,CAACL,qBAAS,CAACM,IAAI,CAAC,EAAEN,qBAAS,CAACM,IAAI,CAAC;AACnF,CAAC;AAEDnF,MAAM,CAACoF,YAAY,GAAG;EACpBxE,MAAM,EAAE,CAAC,CAAC;EACVH,WAAW,EAAE,EAAE;EACfN,IAAI,EAAE,EAAE;EACRQ,cAAc,EAAE,EAAE;EAClBL,IAAI,EAAE,EAAE;EACRJ,IAAI,EAAE,EAAE;EACRE,GAAG,EAAE,IAAI;EACT2E,IAAI,EAAE,EAAE;EACR1E,IAAI,EAAE,EAAE;EACRE,KAAK,EAAE,EAAE;EACTC,QAAQ,EAAE,EAAE;EACZE,kBAAkB,EAAE;AACtB,CAAC;AAAC,IAAA2E,QAAA,GAEa,IAAAC,cAAS,EAACtF,MAAM,CAAC;AAAAuF,OAAA,cAAAF,QAAA"}
1
+ {"version":3,"file":"Button.js","names":["_react","_interopRequireWildcard","require","_reactCookie","_router","_classnames","_interopRequireDefault","_button","_coreAuthUi","_client","_propTypes","_utilsHandlebars","_ClickWrapper","_BlazeLink","_HOC","_utils","_constants","_helpers","_excluded","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","Button","props","type","text","url","icon","name","style","children","clickAction","childSeoVisibility","afterClickText","parent","otherProps","_objectWithoutProperties2","client","useApolloClient","router","useRouter","isLogoutButton","LOGOUT","_useCookies","useCookies","_useCookies2","_slicedToArray2","cookies","blazeCookie","blaze_auth","_useState","useState","_useState2","showChildren","setShowChildren","_useStringTemplate","useStringTemplate","_useStringTemplate$da","data","textToUse","afterClickTextToUse","urlToUse","useEffect","asPath","checkIfButtonShouldRender","hasChildren","logout","handleLogout","reload","handleClick","buttonType","modifiers","getClassModifiers","currentProps","href","title","DynamicButton","BlazeLink","BlazeButton","updateChildrensParent","itemId","itemEntity","renderedChildren","renderChildren","onClose","_getClickWrapperOptio","getClickWrapperOptions","shouldUseClickWrapper","wrapperProps","Wrapper","ClickWrapper","Fragment","contentClassName","classnames","createElement","className","_extends2","onClick","propTypes","PropTypes","string","size","bool","oneOfType","arrayOf","node","defaultProps","_default","withTitle","exports"],"sources":["../../src/components/Button.js"],"sourcesContent":["import React, { useState, Fragment, useEffect } from 'react';\nimport { useCookies } from 'react-cookie';\nimport { useRouter } from 'next/router';\nimport classnames from 'classnames';\nimport BlazeButton from '@blaze-react/button';\nimport { handleLogout } from '@blaze-cms/core-auth-ui';\nimport { useApolloClient } from '@apollo/client';\nimport PropTypes, { bool, string } from 'prop-types';\nimport { useStringTemplate } from '@blaze-cms/utils-handlebars';\nimport ClickWrapper from './ClickWrapper';\nimport BlazeLink from './BlazeLink';\nimport { withTitle } from '../HOC';\nimport { getClassModifiers } from '../utils';\nimport { LOGOUT } from '../constants';\nimport {\n renderChildren,\n updateChildrensParent,\n hasChildren,\n getClickWrapperOptions\n} from '../helpers';\n\nconst Button = props => {\n const {\n type,\n text,\n url,\n icon,\n name,\n style,\n children,\n clickAction,\n childSeoVisibility,\n afterClickText,\n parent,\n ...otherProps\n } = props;\n const client = useApolloClient();\n const router = useRouter();\n const isLogoutButton = clickAction === LOGOUT;\n const [cookies] = useCookies();\n const { blaze_auth: blazeCookie } = cookies;\n const [showChildren, setShowChildren] = useState(false);\n const {\n data: [textToUse, afterClickTextToUse, urlToUse]\n } = useStringTemplate(parent, [text, afterClickText, url]);\n\n useEffect(\n () => {\n setShowChildren(false);\n },\n [router.asPath]\n );\n\n const checkIfButtonShouldRender = () => {\n if (isLogoutButton) return !!blazeCookie;\n if (!text && !icon) return false;\n return !!(url || hasChildren(children));\n };\n\n const logout = () => {\n handleLogout(client);\n url ? router.reload(urlToUse) : router.reload();\n };\n\n const handleClick = () => {\n if (isLogoutButton) logout();\n if (!url && !isLogoutButton) setShowChildren(!showChildren);\n };\n\n if (!checkIfButtonShouldRender()) return null;\n\n const buttonType = !text && icon ? 'icon' : type;\n const modifiers = getClassModifiers(buttonType, { icon, style, ...otherProps });\n const currentProps = url ? { href: urlToUse, title: name } : { name };\n const DynamicButton = url && !isLogoutButton ? BlazeLink : BlazeButton;\n updateChildrensParent(children, parent.itemId, parent.itemEntity);\n\n const renderedChildren = renderChildren(children, { onClose: handleClick });\n const { shouldUseClickWrapper, wrapperProps } = getClickWrapperOptions(children, props);\n const Wrapper = shouldUseClickWrapper ? ClickWrapper : Fragment;\n\n const contentClassName = classnames('button__content', {\n 'button__content--show': showChildren\n });\n\n return (\n <Wrapper {...wrapperProps}>\n {childSeoVisibility && <div className={contentClassName}>{renderedChildren}</div>}\n {!childSeoVisibility && showChildren && renderedChildren}\n <DynamicButton className={modifiers} onClick={handleClick} {...currentProps}>\n {icon && <i className={icon} />}\n {showChildren ? afterClickTextToUse : textToUse}\n </DynamicButton>\n </Wrapper>\n );\n};\n\nButton.propTypes = {\n parent: PropTypes.object,\n clickAction: PropTypes.string,\n text: PropTypes.string,\n afterClickText: string,\n name: PropTypes.string,\n type: PropTypes.string,\n url: PropTypes.string,\n size: PropTypes.string,\n icon: PropTypes.string,\n style: PropTypes.string,\n childSeoVisibility: bool,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node])\n};\n\nButton.defaultProps = {\n parent: {},\n clickAction: '',\n text: '',\n afterClickText: '',\n name: '',\n type: '',\n url: null,\n size: '',\n icon: '',\n style: '',\n children: [],\n childSeoVisibility: false\n};\n\nexport default withTitle(Button);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAT,uBAAA,CAAAC,OAAA;AACA,IAAAS,gBAAA,GAAAT,OAAA;AACA,IAAAU,aAAA,GAAAN,sBAAA,CAAAJ,OAAA;AACA,IAAAW,UAAA,GAAAP,sBAAA,CAAAJ,OAAA;AACA,IAAAY,IAAA,GAAAZ,OAAA;AACA,IAAAa,MAAA,GAAAb,OAAA;AACA,IAAAc,UAAA,GAAAd,OAAA;AACA,IAAAe,QAAA,GAAAf,OAAA;AAKoB,IAAAgB,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,SAAAnB,wBAAAuB,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAA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AE,EAAE;EACR1E,IAAI,EAAE,EAAE;EACRE,KAAK,EAAE,EAAE;EACTC,QAAQ,EAAE,EAAE;EACZE,kBAAkB,EAAE;AACtB,CAAC;AAAC,IAAA2E,QAAA,GAEa,IAAAC,cAAS,EAACtF,MAAM,CAAC;AAAAuF,OAAA,cAAAF,QAAA"}
@@ -146,12 +146,6 @@ var CardsRender = function CardsRender(_ref) {
146
146
  schemaLoading = _useGetEntitySchemasA3.loading,
147
147
  schemaError = _useGetEntitySchemasA3.error;
148
148
  var updatedFilterBy = (0, _helpers.getUpdatedFilterBy)(inheritedFilters, parentEntityData, parentSchema, filterEntitySchema, parentId, variableProps);
149
- var updatedItemsToDisplay = (0, _helpers2.getUpdatedItemsToDisplay)({
150
- itemsToDisplay: itemsToDisplay,
151
- inheritedFilters: inheritedFilters,
152
- parentSchema: parentSchema,
153
- parentEntityData: parentEntityData
154
- });
155
149
  var _filterQuerySetup = (0, _helpers2.filterQuerySetup)({
156
150
  getEntitySchemas: Object.values(requiredSchema),
157
151
  entity: primaryEntityToUse,
@@ -160,22 +154,21 @@ var CardsRender = function CardsRender(_ref) {
160
154
  docType: docTypes,
161
155
  filterOperator: filterOperator,
162
156
  filterEntityRelations: filterEntityRelations,
163
- itemsToDisplay: updatedItemsToDisplay,
157
+ itemsToDisplay: itemsToDisplay,
164
158
  entitySameAsCurrentItemEntity: entitySameAsCurrentItemEntity,
165
159
  useRandomSort: useRandomSort
166
160
  }),
167
161
  limit = _filterQuerySetup.limit,
168
162
  variables = _filterQuerySetup.variables;
169
- var hasNoFiltersOrItemsToDisplay = !updatedItemsToDisplay.length && !updatedFilterBy;
170
163
  var _useQuery2 = (0, _client.useQuery)(action, {
171
164
  variables: variables,
172
165
  fetchPolicy: useRandomSort ? 'cache-and-network' : 'cache-first',
173
- skip: (0, _helpers2.shouldReturn)(hasNoFiltersOrItemsToDisplay, _loading, _load, schemaLoading, _error, _err, schemaError)
166
+ skip: (0, _helpers2.shouldReturn)(!updatedFilterBy, _loading, _load, schemaLoading, _error, _err, schemaError)
174
167
  }),
175
168
  cardData = _useQuery2.data,
176
169
  cardsError = _useQuery2.error,
177
170
  cardsLoading = _useQuery2.loading;
178
- var imageIds = updatedItemsToDisplay.map(function (_ref4) {
171
+ var imageIds = itemsToDisplay.map(function (_ref4) {
179
172
  var imageId = _ref4.imageId;
180
173
  return imageId;
181
174
  }).filter(Boolean);
@@ -184,7 +177,7 @@ var CardsRender = function CardsRender(_ref) {
184
177
  imagesLoading = _useGetImages.loading;
185
178
  var isLoading = (0, _helpers2.shouldReturn)(_loading, _load, schemaLoading, cardsLoading, imagesLoading);
186
179
  var hasError = (0, _helpers2.shouldReturn)(_error, _err, schemaError);
187
- if (hasNoFiltersOrItemsToDisplay) return null;
180
+ if (!updatedFilterBy) return null;
188
181
  if (isLoading) return null;
189
182
  if (hasError) return null;
190
183
  if (cardsError) return cardsError.message;
@@ -192,13 +185,13 @@ var CardsRender = function CardsRender(_ref) {
192
185
  if (!cardDataResults || !cardDataResults.length) return null;
193
186
  cardDataResults = entitySameAsCurrentItemEntity ? (0, _helpers.removeExtraItems)(cardDataResults, limit, parentId) : cardDataResults;
194
187
  if (!cardDataResults.length) return null;
195
- var orderedData = useRandomSort ? cardDataResults : (0, _helpers.sortResponseData)(cardDataResults, updatedItemsToDisplay);
188
+ var orderedData = useRandomSort ? cardDataResults : (0, _helpers.sortResponseData)(cardDataResults, itemsToDisplay);
196
189
  var _splitChildren = (0, _helpers.splitChildren)(children, cardDataResults, graphqlEntityMap, {
197
190
  name: variableProps.name
198
191
  }),
199
192
  regularChildren = _splitChildren.regularChildren,
200
193
  gtmChildren = _splitChildren.gtmChildren;
201
- var updatedCards = (0, _helpers.appendImages)(imagesData, orderedData, updatedItemsToDisplay);
194
+ var updatedCards = (0, _helpers.appendImages)(imagesData, orderedData, itemsToDisplay);
202
195
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, gtmChildren && (0, _helpers.renderChildren)(gtmChildren), /*#__PURE__*/_react["default"].createElement(CardsContainer, (0, _extends2["default"])({
203
196
  cardData: updatedCards,
204
197
  entity: primaryEntityToUse,
@@ -1 +1 @@
1
- {"version":3,"file":"CardsRender.js","names":["_react","_interopRequireWildcard","require","_client","_dynamic","_interopRequireDefault","_propTypes","_nextjsComponents","_query","_constants","_hooks","_helpers","_helpers2","_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","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof2","cache","has","get","newObj","hasPropertyDescriptor","prototype","hasOwnProperty","call","desc","set","CardsContainer","dynamic","Promise","resolve","then","CardsRender","_ref","legacyEntity","entity","entities","entityFields","itemsToDisplay","children","otherProps","_objectWithoutProperties2","_useContext","useContext","MainContext","isPreview","_otherProps$parent","parent","parentId","itemId","parentEntity","itemEntity","_otherProps$filterBy","filterBy","_otherProps$filterByP","filterByProperty","sortby","sort","_otherProps$sortPrope","sortProperties","_otherProps$operator","operator","filterOperator","AND","useRandomSort","_getUpdatedSortProper","getUpdatedSortProperties","_getUpdatedSortProper2","_slicedToArray2","updatedSortProperties","sortbyFilters","variableProps","entitiesToUse","primaryEntityToUse","unpublishedParentEntityName","getUnpublishedEntityName","allEntityNames","concat","_toConsumableArray2","uniqueEntityNames","Set","_useGetEntitySchemasA","useGetEntitySchemasAsObj","_useGetEntitySchemasA2","data","mainSchemas","_loading","loading","_error","error","parentSchema","filterEntitySchema","entitiesTypes","map","ent","getEntityData","graphqlEntityMap","reduce","acc","entityType","docTypes","_ref2","type","docType","entityTypes","_ref3","eType","_filtersSetup","filtersSetup","currentSchema","itemEntityUpdated","getAction","queryProps","inheritedFilters","entitySameAsCurrentItemEntity","action","filterEntityRelations","_useQuery","useQuery","generateSingleItemQuery","variables","id","skip","shouldSkipSingleQuery","_useQuery$data","_useQuery$data2","_useQuery$data2$entit","entityData","parentEntityData","_err","_load","_useGetEntitySchemasA3","getRequiredSchemas","_useGetEntitySchemasA4","requiredSchema","schemaLoading","schemaError","updatedFilterBy","getUpdatedFilterBy","updatedItemsToDisplay","getUpdatedItemsToDisplay","_filterQuerySetup","filterQuerySetup","getEntitySchemas","values","limit","hasNoFiltersOrItemsToDisplay","_useQuery2","fetchPolicy","shouldReturn","cardData","cardsError","cardsLoading","imageIds","_ref4","imageId","Boolean","_useGetImages","useGetImages","imagesData","imagesLoading","isLoading","hasError","message","cardDataResults","SEARCH_PUBLISHED_CONTENT","results","removeExtraItems","orderedData","sortResponseData","_splitChildren","splitChildren","name","regularChildren","gtmChildren","updatedCards","appendImages","createElement","Fragment","renderChildren","_extends2","cardChildren","propTypes","PropTypes","oneOfType","arrayOf","node","string","isRequired","array","defaultProps","_default","exports"],"sources":["../../../src/components/Card/CardsRender.js"],"sourcesContent":["import React, { useContext } from 'react';\nimport { useQuery } from '@apollo/client';\nimport dynamic from 'next/dynamic';\nimport PropTypes from 'prop-types';\nimport { MainContext } from '@blaze-cms/nextjs-components';\nimport { generateSingleItemQuery } from '../../application/query';\nimport { SEARCH_PUBLISHED_CONTENT, AND } from '../../constants';\nimport { useGetEntitySchemasAsObj, useGetImages } from '../../hooks';\nimport {\n getUpdatedFilterBy,\n getEntityData,\n getRequiredSchemas,\n sortResponseData,\n getUnpublishedEntityName,\n renderChildren,\n splitChildren,\n removeExtraItems,\n appendImages\n} from '../../helpers';\nimport {\n filtersSetup,\n filterQuerySetup,\n shouldSkipSingleQuery,\n shouldReturn,\n getUpdatedSortProperties,\n getUpdatedItemsToDisplay\n} from './helpers';\n\nconst CardsContainer = dynamic(() => import('./CardsContainer'));\n\nconst CardsRender = ({\n entity: legacyEntity,\n entities,\n entityFields,\n itemsToDisplay,\n children,\n ...otherProps\n}) => {\n const { isPreview } = useContext(MainContext);\n const {\n parent: { itemId: parentId, itemEntity: parentEntity },\n filterBy = [],\n filterByProperty = [],\n sortby,\n sort,\n sortProperties = [],\n operator: filterOperator = AND,\n useRandomSort\n } = otherProps;\n const [updatedSortProperties, sortbyFilters] = getUpdatedSortProperties(\n sort,\n sortby,\n sortProperties\n );\n\n const variableProps = {\n ...otherProps,\n sortProperties: updatedSortProperties,\n sort: null,\n sortby: null\n };\n\n const entitiesToUse = entities || [legacyEntity];\n const primaryEntityToUse = entitiesToUse[0];\n const unpublishedParentEntityName = getUnpublishedEntityName(parentEntity);\n const allEntityNames = [...entitiesToUse, unpublishedParentEntityName];\n const uniqueEntityNames = [...new Set(allEntityNames)];\n const { data: mainSchemas = {}, loading: _loading, error: _error } = useGetEntitySchemasAsObj(\n uniqueEntityNames\n );\n const parentSchema = mainSchemas[unpublishedParentEntityName] || {};\n const filterEntitySchema = mainSchemas[primaryEntityToUse] || {};\n const entitiesTypes = entitiesToUse.map(ent => getEntityData(ent, mainSchemas[ent]));\n const graphqlEntityMap = entitiesTypes.reduce(\n (acc, entityType) => ({ ...acc, [entityType.entityType]: entityType.entity }),\n {}\n );\n const docTypes = entitiesTypes.map(({ docType: type }) => type);\n const entityTypes = entitiesTypes.map(({ entityType: eType }) => eType);\n\n const {\n getAction,\n queryProps,\n inheritedFilters,\n entitySameAsCurrentItemEntity,\n action,\n filterEntityRelations\n } = filtersSetup({\n entityFields,\n entityTypes,\n filterBy,\n filterByProperty,\n entities: entitiesToUse,\n currentSchema: parentSchema,\n filterEntitySchema,\n isPreview,\n itemEntityUpdated: unpublishedParentEntityName\n });\n\n const {\n data: { entityData: parentEntityData = {} } = {},\n error: _err,\n loading: _load\n } = useQuery(generateSingleItemQuery(getAction, queryProps), {\n variables: { id: parentId },\n skip: shouldSkipSingleQuery(_loading, getAction, queryProps)\n });\n\n const {\n data: requiredSchema = {},\n loading: schemaLoading,\n error: schemaError\n } = useGetEntitySchemasAsObj(\n getRequiredSchemas([...filterByProperty, ...sortbyFilters], filterEntitySchema),\n _loading\n );\n\n const updatedFilterBy = getUpdatedFilterBy(\n inheritedFilters,\n parentEntityData,\n parentSchema,\n filterEntitySchema,\n parentId,\n variableProps\n );\n\n const updatedItemsToDisplay = getUpdatedItemsToDisplay({\n itemsToDisplay,\n inheritedFilters,\n parentSchema,\n parentEntityData\n });\n\n const { limit, variables } = filterQuerySetup({\n getEntitySchemas: Object.values(requiredSchema),\n entity: primaryEntityToUse,\n updatedFilterBy,\n variableProps,\n docType: docTypes,\n filterOperator,\n filterEntityRelations,\n itemsToDisplay: updatedItemsToDisplay,\n entitySameAsCurrentItemEntity,\n useRandomSort\n });\n\n const hasNoFiltersOrItemsToDisplay = !updatedItemsToDisplay.length && !updatedFilterBy;\n\n const { data: cardData, error: cardsError, loading: cardsLoading } = useQuery(action, {\n variables,\n fetchPolicy: useRandomSort ? 'cache-and-network' : 'cache-first',\n skip: shouldReturn(\n hasNoFiltersOrItemsToDisplay,\n _loading,\n _load,\n schemaLoading,\n _error,\n _err,\n schemaError\n )\n });\n\n const imageIds = updatedItemsToDisplay.map(({ imageId }) => imageId).filter(Boolean);\n const { data: imagesData, loading: imagesLoading } = useGetImages(imageIds, true);\n const isLoading = shouldReturn(_loading, _load, schemaLoading, cardsLoading, imagesLoading);\n const hasError = shouldReturn(_error, _err, schemaError);\n\n if (hasNoFiltersOrItemsToDisplay) return null;\n if (isLoading) return null;\n if (hasError) return null;\n if (cardsError) return cardsError.message;\n let { results: cardDataResults } = cardData[SEARCH_PUBLISHED_CONTENT];\n\n if (!cardDataResults || !cardDataResults.length) return null;\n\n cardDataResults = entitySameAsCurrentItemEntity\n ? removeExtraItems(cardDataResults, limit, parentId)\n : cardDataResults;\n if (!cardDataResults.length) return null;\n\n const orderedData = useRandomSort\n ? cardDataResults\n : sortResponseData(cardDataResults, updatedItemsToDisplay);\n const { regularChildren, gtmChildren } = splitChildren(\n children,\n cardDataResults,\n graphqlEntityMap,\n {\n name: variableProps.name\n }\n );\n const updatedCards = appendImages(imagesData, orderedData, updatedItemsToDisplay);\n\n return (\n <>\n {gtmChildren && renderChildren(gtmChildren)}\n <CardsContainer\n cardData={updatedCards}\n entity={primaryEntityToUse}\n gtmChildren={gtmChildren}\n cardChildren={regularChildren}\n graphqlEntityMap={graphqlEntityMap}\n {...variableProps}\n />\n </>\n );\n};\n\nCardsRender.propTypes = {\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),\n entity: PropTypes.string.isRequired,\n entityFields: PropTypes.string.isRequired,\n itemsToDisplay: PropTypes.array,\n entities: PropTypes.array\n};\n\nCardsRender.defaultProps = {\n children: [],\n itemsToDisplay: [],\n entities: []\n};\n\nexport default CardsRender;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,UAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AAWA,IAAAU,SAAA,GAAAV,OAAA;AAOmB,IAAAW,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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cAAAD,QAAA"}
1
+ {"version":3,"file":"CardsRender.js","names":["_react","_interopRequireWildcard","require","_client","_dynamic","_interopRequireDefault","_propTypes","_nextjsComponents","_query","_constants","_hooks","_helpers","_helpers2","_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","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof2","cache","has","get","newObj","hasPropertyDescriptor","prototype","hasOwnProperty","call","desc","set","CardsContainer","dynamic","Promise","resolve","then","CardsRender","_ref","legacyEntity","entity","entities","entityFields","itemsToDisplay","children","otherProps","_objectWithoutProperties2","_useContext","useContext","MainContext","isPreview","_otherProps$parent","parent","parentId","itemId","parentEntity","itemEntity","_otherProps$filterBy","filterBy","_otherProps$filterByP","filterByProperty","sortby","sort","_otherProps$sortPrope","sortProperties","_otherProps$operator","operator","filterOperator","AND","useRandomSort","_getUpdatedSortProper","getUpdatedSortProperties","_getUpdatedSortProper2","_slicedToArray2","updatedSortProperties","sortbyFilters","variableProps","entitiesToUse","primaryEntityToUse","unpublishedParentEntityName","getUnpublishedEntityName","allEntityNames","concat","_toConsumableArray2","uniqueEntityNames","Set","_useGetEntitySchemasA","useGetEntitySchemasAsObj","_useGetEntitySchemasA2","data","mainSchemas","_loading","loading","_error","error","parentSchema","filterEntitySchema","entitiesTypes","map","ent","getEntityData","graphqlEntityMap","reduce","acc","entityType","docTypes","_ref2","type","docType","entityTypes","_ref3","eType","_filtersSetup","filtersSetup","currentSchema","itemEntityUpdated","getAction","queryProps","inheritedFilters","entitySameAsCurrentItemEntity","action","filterEntityRelations","_useQuery","useQuery","generateSingleItemQuery","variables","id","skip","shouldSkipSingleQuery","_useQuery$data","_useQuery$data2","_useQuery$data2$entit","entityData","parentEntityData","_err","_load","_useGetEntitySchemasA3","getRequiredSchemas","_useGetEntitySchemasA4","requiredSchema","schemaLoading","schemaError","updatedFilterBy","getUpdatedFilterBy","_filterQuerySetup","filterQuerySetup","getEntitySchemas","values","limit","_useQuery2","fetchPolicy","shouldReturn","cardData","cardsError","cardsLoading","imageIds","_ref4","imageId","Boolean","_useGetImages","useGetImages","imagesData","imagesLoading","isLoading","hasError","message","cardDataResults","SEARCH_PUBLISHED_CONTENT","results","removeExtraItems","orderedData","sortResponseData","_splitChildren","splitChildren","name","regularChildren","gtmChildren","updatedCards","appendImages","createElement","Fragment","renderChildren","_extends2","cardChildren","propTypes","PropTypes","oneOfType","arrayOf","node","string","isRequired","array","defaultProps","_default","exports"],"sources":["../../../src/components/Card/CardsRender.js"],"sourcesContent":["import React, { useContext } from 'react';\nimport { useQuery } from '@apollo/client';\nimport dynamic from 'next/dynamic';\nimport PropTypes from 'prop-types';\nimport { MainContext } from '@blaze-cms/nextjs-components';\nimport { generateSingleItemQuery } from '../../application/query';\nimport { SEARCH_PUBLISHED_CONTENT, AND } from '../../constants';\nimport { useGetEntitySchemasAsObj, useGetImages } from '../../hooks';\nimport {\n getUpdatedFilterBy,\n getEntityData,\n getRequiredSchemas,\n sortResponseData,\n getUnpublishedEntityName,\n renderChildren,\n splitChildren,\n removeExtraItems,\n appendImages\n} from '../../helpers';\nimport {\n filtersSetup,\n filterQuerySetup,\n shouldSkipSingleQuery,\n shouldReturn,\n getUpdatedSortProperties\n} from './helpers';\n\nconst CardsContainer = dynamic(() => import('./CardsContainer'));\n\nconst CardsRender = ({\n entity: legacyEntity,\n entities,\n entityFields,\n itemsToDisplay,\n children,\n ...otherProps\n}) => {\n const { isPreview } = useContext(MainContext);\n const {\n parent: { itemId: parentId, itemEntity: parentEntity },\n filterBy = [],\n filterByProperty = [],\n sortby,\n sort,\n sortProperties = [],\n operator: filterOperator = AND,\n useRandomSort\n } = otherProps;\n const [updatedSortProperties, sortbyFilters] = getUpdatedSortProperties(\n sort,\n sortby,\n sortProperties\n );\n\n const variableProps = {\n ...otherProps,\n sortProperties: updatedSortProperties,\n sort: null,\n sortby: null\n };\n\n const entitiesToUse = entities || [legacyEntity];\n const primaryEntityToUse = entitiesToUse[0];\n const unpublishedParentEntityName = getUnpublishedEntityName(parentEntity);\n const allEntityNames = [...entitiesToUse, unpublishedParentEntityName];\n const uniqueEntityNames = [...new Set(allEntityNames)];\n const { data: mainSchemas = {}, loading: _loading, error: _error } = useGetEntitySchemasAsObj(\n uniqueEntityNames\n );\n const parentSchema = mainSchemas[unpublishedParentEntityName] || {};\n const filterEntitySchema = mainSchemas[primaryEntityToUse] || {};\n const entitiesTypes = entitiesToUse.map(ent => getEntityData(ent, mainSchemas[ent]));\n const graphqlEntityMap = entitiesTypes.reduce(\n (acc, entityType) => ({ ...acc, [entityType.entityType]: entityType.entity }),\n {}\n );\n const docTypes = entitiesTypes.map(({ docType: type }) => type);\n const entityTypes = entitiesTypes.map(({ entityType: eType }) => eType);\n\n const {\n getAction,\n queryProps,\n inheritedFilters,\n entitySameAsCurrentItemEntity,\n action,\n filterEntityRelations\n } = filtersSetup({\n entityFields,\n entityTypes,\n filterBy,\n filterByProperty,\n entities: entitiesToUse,\n currentSchema: parentSchema,\n filterEntitySchema,\n isPreview,\n itemEntityUpdated: unpublishedParentEntityName\n });\n const {\n data: { entityData: parentEntityData = {} } = {},\n error: _err,\n loading: _load\n } = useQuery(generateSingleItemQuery(getAction, queryProps), {\n variables: { id: parentId },\n skip: shouldSkipSingleQuery(_loading, getAction, queryProps)\n });\n\n const {\n data: requiredSchema = {},\n loading: schemaLoading,\n error: schemaError\n } = useGetEntitySchemasAsObj(\n getRequiredSchemas([...filterByProperty, ...sortbyFilters], filterEntitySchema),\n _loading\n );\n\n const updatedFilterBy = getUpdatedFilterBy(\n inheritedFilters,\n parentEntityData,\n parentSchema,\n filterEntitySchema,\n parentId,\n variableProps\n );\n\n const { limit, variables } = filterQuerySetup({\n getEntitySchemas: Object.values(requiredSchema),\n entity: primaryEntityToUse,\n updatedFilterBy,\n variableProps,\n docType: docTypes,\n filterOperator,\n filterEntityRelations,\n itemsToDisplay,\n entitySameAsCurrentItemEntity,\n useRandomSort\n });\n const { data: cardData, error: cardsError, loading: cardsLoading } = useQuery(action, {\n variables,\n fetchPolicy: useRandomSort ? 'cache-and-network' : 'cache-first',\n skip: shouldReturn(!updatedFilterBy, _loading, _load, schemaLoading, _error, _err, schemaError)\n });\n\n const imageIds = itemsToDisplay.map(({ imageId }) => imageId).filter(Boolean);\n const { data: imagesData, loading: imagesLoading } = useGetImages(imageIds, true);\n const isLoading = shouldReturn(_loading, _load, schemaLoading, cardsLoading, imagesLoading);\n const hasError = shouldReturn(_error, _err, schemaError);\n\n if (!updatedFilterBy) return null;\n if (isLoading) return null;\n if (hasError) return null;\n if (cardsError) return cardsError.message;\n let { results: cardDataResults } = cardData[SEARCH_PUBLISHED_CONTENT];\n\n if (!cardDataResults || !cardDataResults.length) return null;\n\n cardDataResults = entitySameAsCurrentItemEntity\n ? removeExtraItems(cardDataResults, limit, parentId)\n : cardDataResults;\n if (!cardDataResults.length) return null;\n\n const orderedData = useRandomSort\n ? cardDataResults\n : sortResponseData(cardDataResults, itemsToDisplay);\n const { regularChildren, gtmChildren } = splitChildren(\n children,\n cardDataResults,\n graphqlEntityMap,\n {\n name: variableProps.name\n }\n );\n const updatedCards = appendImages(imagesData, orderedData, itemsToDisplay);\n\n return (\n <>\n {gtmChildren && renderChildren(gtmChildren)}\n <CardsContainer\n cardData={updatedCards}\n entity={primaryEntityToUse}\n gtmChildren={gtmChildren}\n cardChildren={regularChildren}\n graphqlEntityMap={graphqlEntityMap}\n {...variableProps}\n />\n </>\n );\n};\n\nCardsRender.propTypes = {\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),\n entity: PropTypes.string.isRequired,\n entityFields: PropTypes.string.isRequired,\n itemsToDisplay: PropTypes.array,\n entities: PropTypes.array\n};\n\nCardsRender.defaultProps = {\n children: [],\n itemsToDisplay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,GAC/BzB,aAAa,CAClB,CACD,CAAC;AAEP,CAAC;AAEDvC,WAAW,CAACmJ,SAAS,GAAG;EACtB5I,QAAQ,EAAE6I,qBAAS,CAACC,SAAS,CAAC,CAACD,qBAAS,CAACE,OAAO,CAACF,qBAAS,CAACG,IAAI,CAAC,EAAEH,qBAAS,CAACG,IAAI,CAAC,CAAC;EAClFpJ,MAAM,EAAEiJ,qBAAS,CAACI,MAAM,CAACC,UAAU;EACnCpJ,YAAY,EAAE+I,qBAAS,CAACI,MAAM,CAACC,UAAU;EACzCnJ,cAAc,EAAE8I,qBAAS,CAACM,KAAK;EAC/BtJ,QAAQ,EAAEgJ,qBAAS,CAACM;AACtB,CAAC;AAED1J,WAAW,CAAC2J,YAAY,GAAG;EACzBpJ,QAAQ,EAAE,EAAE;EACZD,cAAc,EAAE,EAAE;EAClBF,QAAQ,EAAE;AACZ,CAAC;AAAC,IAAAwJ,QAAA,GAEa5J,WAAW;AAAA6J,OAAA,cAAAD,QAAA"}
@@ -29,12 +29,6 @@ Object.defineProperty(exports, "getPublishedListingUrl", {
29
29
  return _getPublishedListingUrl["default"];
30
30
  }
31
31
  });
32
- Object.defineProperty(exports, "getUpdatedItemsToDisplay", {
33
- enumerable: true,
34
- get: function get() {
35
- return _getUpdatedItemsToDisplay["default"];
36
- }
37
- });
38
32
  Object.defineProperty(exports, "getUpdatedSortProperties", {
39
33
  enumerable: true,
40
34
  get: function get() {
@@ -67,5 +61,4 @@ var _filterQuerySetup = _interopRequireDefault(require("./filter-query-setup"));
67
61
  var _shouldReturn = _interopRequireDefault(require("./should-return"));
68
62
  var _shouldSkipSingleQuery = _interopRequireDefault(require("./should-skip-single-query"));
69
63
  var _getUpdatedSortProperties = _interopRequireDefault(require("./get-updated-sort-properties"));
70
- var _getUpdatedItemsToDisplay = _interopRequireDefault(require("./get-updated-items-to-display"));
71
64
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_getPublishedListingUrl","_interopRequireDefault","require","_useDynamicSizeKey","_getDynamicGridClasses","_filtersSetup","_filterQuerySetup","_shouldReturn","_shouldSkipSingleQuery","_getUpdatedSortProperties","_getUpdatedItemsToDisplay"],"sources":["../../../../src/components/Card/helpers/index.js"],"sourcesContent":["export { default as getPublishedListingUrl } from './get-published-listing-url';\nexport { default as useDynamicSizeKey } from './use-dynamic-size-key';\nexport { default as getDynamicGridClasses } from './get-dynamic-grid-classes';\nexport { default as filtersSetup } from './filters-setup';\nexport { default as filterQuerySetup } from './filter-query-setup';\nexport { default as shouldReturn } from './should-return';\nexport { default as shouldSkipSingleQuery } from './should-skip-single-query';\nexport { default as getUpdatedSortProperties } from './get-updated-sort-properties';\nexport { default as getUpdatedItemsToDisplay } from './get-updated-items-to-display';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,sBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,aAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,aAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,sBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,yBAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,yBAAA,GAAAT,sBAAA,CAAAC,OAAA"}
1
+ {"version":3,"file":"index.js","names":["_getPublishedListingUrl","_interopRequireDefault","require","_useDynamicSizeKey","_getDynamicGridClasses","_filtersSetup","_filterQuerySetup","_shouldReturn","_shouldSkipSingleQuery","_getUpdatedSortProperties"],"sources":["../../../../src/components/Card/helpers/index.js"],"sourcesContent":["export { default as getPublishedListingUrl } from './get-published-listing-url';\nexport { default as useDynamicSizeKey } from './use-dynamic-size-key';\nexport { default as getDynamicGridClasses } from './get-dynamic-grid-classes';\nexport { default as filtersSetup } from './filters-setup';\nexport { default as filterQuerySetup } from './filter-query-setup';\nexport { default as shouldReturn } from './should-return';\nexport { default as shouldSkipSingleQuery } from './should-skip-single-query';\nexport { default as getUpdatedSortProperties } from './get-updated-sort-properties';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,sBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,aAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,aAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,sBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,yBAAA,GAAAR,sBAAA,CAAAC,OAAA"}
@@ -30,7 +30,7 @@ var _HOC = require("../../HOC");
30
30
  var _utils = require("../../utils");
31
31
  var _constants = require("../../constants");
32
32
  var _helpers = require("./helpers");
33
- var _excluded = ["code", "parserOptions", "disableWrapper"];
33
+ var _excluded = ["code", "parserOptions"];
34
34
  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); }
35
35
  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; }
36
36
  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; }
@@ -38,13 +38,11 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
38
38
  var Code = /*#__PURE__*/(0, _react.memo)(function (_ref) {
39
39
  var embedCode = _ref.code,
40
40
  parserOptions = _ref.parserOptions,
41
- disableWrapper = _ref.disableWrapper,
42
41
  otherProps = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
43
42
  if (!embedCode) return null;
44
43
  var parsedCode = (0, _htmlReactParser["default"])(embedCode, parserOptions);
45
44
  var wrappedCode = (0, _helpers.wrapScriptTags)(parsedCode);
46
45
  var modifiers = (0, _utils.getClassModifiers)(_constants.CODE, _objectSpread({}, otherProps));
47
- if (disableWrapper) return wrappedCode;
48
46
  return /*#__PURE__*/_react["default"].createElement(_Wrapper["default"], {
49
47
  modifiers: modifiers
50
48
  }, wrappedCode);
@@ -52,14 +50,12 @@ var Code = /*#__PURE__*/(0, _react.memo)(function (_ref) {
52
50
  Code.propTypes = {
53
51
  code: _propTypes["default"].string,
54
52
  modifier: _propTypes["default"].string,
55
- parserOptions: _propTypes["default"].object,
56
- disableWrapper: _propTypes["default"].bool
53
+ parserOptions: _propTypes["default"].object
57
54
  };
58
55
  Code.defaultProps = {
59
56
  code: '',
60
57
  modifier: '',
61
- parserOptions: {},
62
- disableWrapper: false
58
+ parserOptions: {}
63
59
  };
64
60
  var _default = (0, _HOC.withTitle)(Code);
65
61
  exports["default"] = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"Code.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_htmlReactParser","_Wrapper","_HOC","_utils","_constants","_helpers","_excluded","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","Code","memo","_ref","embedCode","code","parserOptions","disableWrapper","otherProps","_objectWithoutProperties2","parsedCode","parseHTML","wrappedCode","wrapScriptTags","modifiers","getClassModifiers","CODE","createElement","propTypes","PropTypes","string","modifier","bool","defaultProps","_default","withTitle","exports"],"sources":["../../../src/components/Code/Code.js"],"sourcesContent":["import React, { memo } from 'react';\nimport PropTypes from 'prop-types';\nimport parseHTML from 'html-react-parser';\nimport Wrapper from '../Wrapper';\nimport { withTitle } from '../../HOC';\nimport { getClassModifiers } from '../../utils';\nimport { CODE } from '../../constants';\nimport { wrapScriptTags } from './helpers';\n\nconst Code = memo(({ code: embedCode, parserOptions, disableWrapper, ...otherProps }) => {\n if (!embedCode) return null;\n\n const parsedCode = parseHTML(embedCode, parserOptions);\n const wrappedCode = wrapScriptTags(parsedCode);\n const modifiers = getClassModifiers(CODE, { ...otherProps });\n\n if (disableWrapper) return wrappedCode;\n\n return <Wrapper modifiers={modifiers}>{wrappedCode}</Wrapper>;\n});\n\nCode.propTypes = {\n code: PropTypes.string,\n modifier: PropTypes.string,\n parserOptions: PropTypes.object,\n disableWrapper: PropTypes.bool\n};\n\nCode.defaultProps = {\n code: '',\n modifier: '',\n parserOptions: {},\n disableWrapper: false\n};\n\nexport default withTitle(Code);\n"],"mappings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,IAAMS,IAAI,gBAAG,IAAAC,WAAI,EAAC,UAAAC,IAAA,EAAuE;EAAA,IAA9DC,SAAS,GAAAD,IAAA,CAAfE,IAAI;IAAaC,aAAa,GAAAH,IAAA,CAAbG,aAAa;IAAEC,cAAc,GAAAJ,IAAA,CAAdI,cAAc;IAAKC,UAAU,OAAAC,yBAAA,aAAAN,IAAA,EAAA9C,SAAA;EAChF,IAAI,CAAC+C,SAAS,EAAE,OAAO,IAAI;EAE3B,IAAMM,UAAU,GAAG,IAAAC,2BAAS,EAACP,SAAS,EAAEE,aAAa,CAAC;EACtD,IAAMM,WAAW,GAAG,IAAAC,uBAAc,EAACH,UAAU,CAAC;EAC9C,IAAMI,SAAS,GAAG,IAAAC,wBAAiB,EAACC,eAAI,EAAAzB,aAAA,KAAOiB,UAAU,CAAE,CAAC;EAE5D,IAAID,cAAc,EAAE,OAAOK,WAAW;EAEtC,oBAAOlE,MAAA,YAAAuE,aAAA,CAACjE,QAAA,WAAO;IAAC8D,SAAS,EAAEA;EAAU,GAAEF,WAAqB,CAAC;AAC/D,CAAC,CAAC;AAEFX,IAAI,CAACiB,SAAS,GAAG;EACfb,IAAI,EAAEc,qBAAS,CAACC,MAAM;EACtBC,QAAQ,EAAEF,qBAAS,CAACC,MAAM;EAC1Bd,aAAa,EAAEa,qBAAS,CAACtC,MAAM;EAC/B0B,cAAc,EAAEY,qBAAS,CAACG;AAC5B,CAAC;AAEDrB,IAAI,CAACsB,YAAY,GAAG;EAClBlB,IAAI,EAAE,EAAE;EACRgB,QAAQ,EAAE,EAAE;EACZf,aAAa,EAAE,CAAC,CAAC;EACjBC,cAAc,EAAE;AAClB,CAAC;AAAC,IAAAiB,QAAA,GAEa,IAAAC,cAAS,EAACxB,IAAI,CAAC;AAAAyB,OAAA,cAAAF,QAAA"}
1
+ {"version":3,"file":"Code.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_htmlReactParser","_Wrapper","_HOC","_utils","_constants","_helpers","_excluded","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","Code","memo","_ref","embedCode","code","parserOptions","otherProps","_objectWithoutProperties2","parsedCode","parseHTML","wrappedCode","wrapScriptTags","modifiers","getClassModifiers","CODE","createElement","propTypes","PropTypes","string","modifier","defaultProps","_default","withTitle","exports"],"sources":["../../../src/components/Code/Code.js"],"sourcesContent":["import React, { memo } from 'react';\nimport PropTypes from 'prop-types';\nimport parseHTML from 'html-react-parser';\nimport Wrapper from '../Wrapper';\nimport { withTitle } from '../../HOC';\nimport { getClassModifiers } from '../../utils';\nimport { CODE } from '../../constants';\nimport { wrapScriptTags } from './helpers';\n\nconst Code = memo(({ code: embedCode, parserOptions, ...otherProps }) => {\n if (!embedCode) return null;\n\n const parsedCode = parseHTML(embedCode, parserOptions);\n const wrappedCode = wrapScriptTags(parsedCode);\n const modifiers = getClassModifiers(CODE, { ...otherProps });\n\n return <Wrapper modifiers={modifiers}>{wrappedCode}</Wrapper>;\n});\n\nCode.propTypes = {\n code: PropTypes.string,\n modifier: PropTypes.string,\n parserOptions: PropTypes.object\n};\n\nCode.defaultProps = {\n code: '',\n modifier: '',\n parserOptions: {}\n};\n\nexport default withTitle(Code);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,QAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,IAAA,GAAAL,OAAA;AACA,IA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,IAAMK,UAAU,GAAG,IAAAC,2BAAS,EAACN,SAAS,EAAEE,aAAa,CAAC;EACtD,IAAMK,WAAW,GAAG,IAAAC,uBAAc,EAACH,UAAU,CAAC;EAC9C,IAAMI,SAAS,GAAG,IAAAC,wBAAiB,EAACC,eAAI,EAAAxB,aAAA,KAAOgB,UAAU,CAAE,CAAC;EAE5D,oBAAO7D,MAAA,YAAAsE,aAAA,CAAChE,QAAA,WAAO;IAAC6D,SAAS,EAAEA;EAAU,GAAEF,WAAqB,CAAC;AAC/D,CAAC,CAAC;AAEFV,IAAI,CAACgB,SAAS,GAAG;EACfZ,IAAI,EAAEa,qBAAS,CAACC,MAAM;EACtBC,QAAQ,EAAEF,qBAAS,CAACC,MAAM;EAC1Bb,aAAa,EAAEY,qBAAS,CAACrC;AAC3B,CAAC;AAEDoB,IAAI,CAACoB,YAAY,GAAG;EAClBhB,IAAI,EAAE,EAAE;EACRe,QAAQ,EAAE,EAAE;EACZd,aAAa,EAAE,CAAC;AAClB,CAAC;AAAC,IAAAgB,QAAA,GAEa,IAAAC,cAAS,EAACtB,IAAI,CAAC;AAAAuB,OAAA,cAAAF,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"}
@@ -20,7 +20,6 @@ var _lodash2 = _interopRequireDefault(require("lodash.flatten"));
20
20
  var _getLinkToPublishedContent = _interopRequireDefault(require("./get-link-to-published-content"));
21
21
  var _getLoopPropsLimit = _interopRequireDefault(require("./get-loop-props-limit"));
22
22
  var _getPropValue = _interopRequireDefault(require("./get-prop-value"));
23
- var _helpers = require("../../../helpers");
24
23
  var getLoopValue = function getLoopValue(value) {
25
24
  var keyField = value.keyField;
26
25
  return value[keyField];
@@ -65,9 +64,8 @@ var buildLoopPropsContent = function buildLoopPropsContent() {
65
64
  var loopValue = loopValues[key];
66
65
  var propValue = loopValue ? getLoopValue(loopValue[i]) : regularValues[key];
67
66
  if (!propValue) return null;
68
- var processedValue = (0, _helpers.processDataSummaryValue)(propValue, options);
69
67
  var linkToPublishedContent = (0, _getLinkToPublishedContent["default"])(key, data);
70
- return [(0, _lodash["default"])(label), processedValue, linkToPublishedContent, modifier];
68
+ return [(0, _lodash["default"])(label), propValue, linkToPublishedContent, modifier];
71
69
  });
72
70
  })).filter(Boolean);
73
71
  loopPropsWithContent.push(propsArray);
@@ -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,IAAQC,mBAAmB,GAAKD,OAAO,CAA/BC,mBAAmB;IAC3BA,mBAAmB,CAACF,OAAO,CAAC,UAAAG,IAAI,EAAI;MAClC,IAAMX,KAAK,GAAG,IAAAY,wBAAY,EAACD,IAAI,EAAEN,IAAI,EAAEI,OAAO,CAAC;MAC/C,IAAMI,YAAY,GAAGC,KAAK,CAACC,OAAO,CAACf,KAAK,CAAC;MACzC,IAAI,CAACA,KAAK,EAAE;MACZ,IAAMgB,cAAc,GAAGZ,SAAS,CAACa,QAAQ,CAACN,IAAI,CAAC,IAAIE,YAAY;MAE/D,IAAIG,cAAc,EAAE;QAClBT,UAAU,CAACI,IAAI,CAAC,GAAGX,KAAK;MAC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AAAA,iBAAA;MAEjD,OAAOzB,mBAAmB,CAACuB,GAAG,CAAC,UAAAI,GAAG,EAAI;QACpC,IAAMC,SAAS,GAAG/B,UAAU,CAAC8B,GAAG,CAAC;QACjC,IAAME,SAAS,GAAGD,SAAS,GAAGvC,YAAY,CAACuC,SAAS,CAACR,CAAC,CAAC,CAAC,GAAGxB,aAAa,CAAC+B,GAAG,CAAC;QAC7E,IAAI,CAACE,SAAS,EAAE,OAAO,IAAI;QAE3B,IAAMC,cAAc,GAAG,IAAAC,gCAAuB,EAACF,SAAS,EAAE9B,OAAO,CAAC;QAClE,IAAMiC,sBAAsB,GAAG,IAAAC,qCAAyB,EAACN,GAAG,EAAEhC,IAAI,CAAC;QACnE,OAAO,CAAC,IAAAuC,kBAAU,EAACV,KAAK,CAAC,EAAEM,cAAc,EAAEE,sBAAsB,EAAEN,QAAQ,CAAC;MAC9E,CAAC,CAAC;IACJ,CAAC,CACH,CAAC,CAACS,MAAM,CAACC,OAAO,CAAC;IACjBvB,oBAAoB,CAACwB,IAAI,CAAChB,UAAU,CAAC;EACvC,CAAC;EAjBD,KAAK,IAAID,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,SAAS,EAAEG,CAAC,IAAI,CAAC;IAAAD,KAAA,CAAAC,CAAA;EAAA;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","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","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';\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 const linkToPublishedContent = getLinkToPublishedContent(key, data);\n return [upperFirst(label), propValue, 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,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G,CAAC;QAC7E,IAAI,CAACE,SAAS,EAAE,OAAO,IAAI;QAC3B,IAAMC,sBAAsB,GAAG,IAAAC,qCAAyB,EAACJ,GAAG,EAAEhC,IAAI,CAAC;QACnE,OAAO,CAAC,IAAAqC,kBAAU,EAACR,KAAK,CAAC,EAAEK,SAAS,EAAEC,sBAAsB,EAAEJ,QAAQ,CAAC;MACzE,CAAC,CAAC;IACJ,CAAC,CACH,CAAC,CAACO,MAAM,CAACC,OAAO,CAAC;IACjBrB,oBAAoB,CAACsB,IAAI,CAACd,UAAU,CAAC;EACvC,CAAC;EAfD,KAAK,IAAID,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,SAAS,EAAEG,CAAC,IAAI,CAAC;IAAAD,KAAA,CAAAC,CAAA;EAAA;EAiBrC,OAAO,IAAAE,mBAAO,EAACT,oBAAoB,CAAC;AACtC,CAAC;AAAC,IAAAuB,QAAA,GAEa5B,qBAAqB;AAAA6B,OAAA,cAAAD,QAAA"}
@@ -37,9 +37,8 @@ var buildPropsToDisplayWithContent = function buildPropsToDisplayWithContent(pro
37
37
  if (!key) return null;
38
38
  var objPropValue = (0, _getPropValue["default"])(key, props, options);
39
39
  if (!objPropValue) return null;
40
- var processedValue = (0, _helpers.processDataSummaryValue)(objPropValue, options);
41
- var link = getLink(enableLink, key, props, processedValue);
42
- return [(0, _lodash["default"])(label), processedValue, link, modifier];
40
+ var link = getLink(enableLink, key, props, objPropValue);
41
+ return [(0, _lodash["default"])(label), objPropValue, link, modifier];
43
42
  });
44
43
  })).filter(Boolean);
45
44
  };
@@ -1 +1 @@
1
- {"version":3,"file":"build-props-to-display-with-content.js","names":["_lodash","_interopRequireDefault","require","_lodash2","_helpers","_getLinkToPublishedContent","_getPropValue","_getLinkBasedOnValue","buildPropsToDisplayWithContent","props","propsToDisplay","arguments","length","undefined","isObject","map","key","propValue","getPropValue","propName","split","join","upperFirst","filter","Boolean","flatten","options","propertiesToDisplay","label","_options$modifier","modifier","enableLink","objPropValue","processedValue","processDataSummaryValue","link","getLink","_default","exports","getLinkToPublishedContent","getLinkBasedOnValue"],"sources":["../../../../src/components/DataSummary/helpers/build-props-to-display-with-content.js"],"sourcesContent":["import upperFirst from 'lodash.upperfirst';\nimport flatten from 'lodash.flatten';\nimport { isObject, processDataSummaryValue } from '../../../helpers';\nimport getLinkToPublishedContent from './get-link-to-published-content';\nimport getPropValue from './get-prop-value';\nimport getLinkBasedOnValue from './get-link-based-on-value';\n\nconst buildPropsToDisplayWithContent = (props, propsToDisplay = []) => {\n if (!isObject(propsToDisplay[0])) {\n return propsToDisplay\n .map(key => {\n if (!key) return null;\n const propValue = getPropValue(key, props);\n if (!propValue) return null;\n const propName = key.split('.').join(' ');\n return [upperFirst(propName), propValue, '', ''];\n })\n .filter(Boolean);\n }\n\n return flatten(\n propsToDisplay.map(options => {\n const { propertiesToDisplay, label, modifier = '', enableLink } = options;\n return propertiesToDisplay.map(key => {\n if (!key) return null;\n\n const objPropValue = getPropValue(key, props, options);\n if (!objPropValue) return null;\n\n const processedValue = processDataSummaryValue(objPropValue, options);\n\n const link = getLink(enableLink, key, props, processedValue);\n\n return [upperFirst(label), processedValue, link, modifier];\n });\n })\n ).filter(Boolean);\n};\n\nexport default buildPropsToDisplayWithContent;\n\nfunction getLink(enableLink, key, props, objPropValue) {\n let link = '';\n if (enableLink) {\n link = getLinkToPublishedContent(key, props);\n if (!link) {\n link = getLinkBasedOnValue(objPropValue);\n }\n }\n return link;\n}\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,0BAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,aAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,oBAAA,GAAAN,sBAAA,CAAAC,OAAA;AAEA,IAAMM,8BAA8B,GAAG,SAAjC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AG,IAAAC,gCAAuB,EAACF,YAAY,EAAEN,OAAO,CAAC;MAErE,IAAMS,IAAI,GAAGC,OAAO,CAACL,UAAU,EAAEf,GAAG,EAAEP,KAAK,EAAEwB,cAAc,CAAC;MAE5D,OAAO,CAAC,IAAAX,kBAAU,EAACM,KAAK,CAAC,EAAEK,cAAc,EAAEE,IAAI,EAAEL,QAAQ,CAAC;IAC5D,CAAC,CAAC;EACJ,CAAC,CACH,CAAC,CAACP,MAAM,CAACC,OAAO,CAAC;AACnB,CAAC;AAAC,IAAAa,QAAA,GAEa7B,8BAA8B;AAAA8B,OAAA,cAAAD,QAAA;AAE7C,SAASD,OAAOA,CAACL,UAAU,EAAEf,GAAG,EAAEP,KAAK,EAAEuB,YAAY,EAAE;EACrD,IAAIG,IAAI,GAAG,EAAE;EACb,IAAIJ,UAAU,EAAE;IACdI,IAAI,GAAG,IAAAI,qCAAyB,EAACvB,GAAG,EAAEP,KAAK,CAAC;IAC5C,IAAI,CAAC0B,IAAI,EAAE;MACTA,IAAI,GAAG,IAAAK,+BAAmB,EAACR,YAAY,CAAC;IAC1C;EACF;EACA,OAAOG,IAAI;AACb"}
1
+ {"version":3,"file":"build-props-to-display-with-content.js","names":["_lodash","_interopRequireDefault","require","_lodash2","_helpers","_getLinkToPublishedContent","_getPropValue","_getLinkBasedOnValue","buildPropsToDisplayWithContent","props","propsToDisplay","arguments","length","undefined","isObject","map","key","propValue","getPropValue","propName","split","join","upperFirst","filter","Boolean","flatten","options","propertiesToDisplay","label","_options$modifier","modifier","enableLink","objPropValue","link","getLink","_default","exports","getLinkToPublishedContent","getLinkBasedOnValue"],"sources":["../../../../src/components/DataSummary/helpers/build-props-to-display-with-content.js"],"sourcesContent":["import upperFirst from 'lodash.upperfirst';\nimport flatten from 'lodash.flatten';\nimport { isObject } from '../../../helpers';\nimport getLinkToPublishedContent from './get-link-to-published-content';\nimport getPropValue from './get-prop-value';\nimport getLinkBasedOnValue from './get-link-based-on-value';\n\nconst buildPropsToDisplayWithContent = (props, propsToDisplay = []) => {\n if (!isObject(propsToDisplay[0])) {\n return propsToDisplay\n .map(key => {\n if (!key) return null;\n const propValue = getPropValue(key, props);\n if (!propValue) return null;\n const propName = key.split('.').join(' ');\n return [upperFirst(propName), propValue, '', ''];\n })\n .filter(Boolean);\n }\n\n return flatten(\n propsToDisplay.map(options => {\n const { propertiesToDisplay, label, modifier = '', enableLink } = options;\n return propertiesToDisplay.map(key => {\n if (!key) return null;\n\n const objPropValue = getPropValue(key, props, options);\n if (!objPropValue) return null;\n\n const link = getLink(enableLink, key, props, objPropValue);\n\n return [upperFirst(label), objPropValue, link, modifier];\n });\n })\n ).filter(Boolean);\n};\n\nexport default buildPropsToDisplayWithContent;\nfunction getLink(enableLink, key, props, objPropValue) {\n let link = '';\n if (enableLink) {\n link = getLinkToPublishedContent(key, props);\n if (!link) {\n link = getLinkBasedOnValue(objPropValue);\n }\n }\n return link;\n}\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,0BAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,aAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,oBAAA,GAAAN,sBAAA,CAAAC,OAAA;AAEA,IAAMM,8BAA8B,GAAG,SAAjCA,8BAA8BA,CAAIC,KAAK,EAA0B;EAAA,IAAxBC,cAAc,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EAChE,IAAI,CAAC,IAAAG,iBAAQ,EAACJ,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE;IAChC,OAAOA,cAAc,CAClBK,GAAG,CAAC,UAAAC,GAAG,EAAI;MACV,IAAI,CAACA,GAAG,EAAE,OAAO,IAAI;MACrB,IAAMC,SAAS,GAAG,IAA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,CAACH,UAAU,EAAEf,GAAG,EAAEP,KAAK,EAAEuB,YAAY,EAAE;EACrD,IAAIC,IAAI,GAAG,EAAE;EACb,IAAIF,UAAU,EAAE;IACdE,IAAI,GAAG,IAAAI,qCAAyB,EAACrB,GAAG,EAAEP,KAAK,CAAC;IAC5C,IAAI,CAACwB,IAAI,EAAE;MACTA,IAAI,GAAG,IAAAK,+BAAmB,EAACN,YAAY,CAAC;IAC1C;EACF;EACA,OAAOC,IAAI;AACb"}
@@ -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({