@blaze-cms/react-page-builder 0.132.0-admin-updates.1 → 0.132.0-alpha.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 (21) hide show
  1. package/CHANGELOG.md +7 -58
  2. package/lib/components/DataSummary/helpers/build-loop-props-content.js +2 -3
  3. package/lib/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
  4. package/lib/components/DataSummary/helpers/get-link-to-published-content.js +0 -2
  5. package/lib/components/DataSummary/helpers/get-link-to-published-content.js.map +1 -1
  6. package/lib/components/Layout/Layout.js +7 -3
  7. package/lib/components/Layout/Layout.js.map +1 -1
  8. package/lib-es/components/DataSummary/helpers/build-loop-props-content.js +2 -3
  9. package/lib-es/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
  10. package/lib-es/components/DataSummary/helpers/get-link-to-published-content.js +1 -2
  11. package/lib-es/components/DataSummary/helpers/get-link-to-published-content.js.map +1 -1
  12. package/lib-es/components/Layout/Layout.js +8 -4
  13. package/lib-es/components/Layout/Layout.js.map +1 -1
  14. package/package.json +10 -10
  15. package/src/components/DataSummary/helpers/build-loop-props-content.js +2 -3
  16. package/src/components/DataSummary/helpers/get-link-to-published-content.js +1 -4
  17. package/src/components/Layout/Layout.js +15 -3
  18. package/tests/unit/src/components/DataSummary/helpers/build-loop-props-content.test.js +0 -41
  19. package/tests/unit/src/components/DataSummary/helpers/get-link-to-published-content.test.js +0 -21
  20. package/tests/unit/src/components/PlaceholderIcon/__snapshots__/index.test.js.snap +0 -72
  21. package/tests/unit/src/components/PlaceholderIcon/index.test.js +0 -20
package/CHANGELOG.md CHANGED
@@ -3,7 +3,7 @@
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.132.0-admin-updates.1](https://github.com/thebyte9/blaze/compare/v0.131.1...v0.132.0-admin-updates.1) (2023-08-04)
6
+ # [0.132.0-alpha.0](https://github.com/thebyte9/blaze/compare/v0.131.2...v0.132.0-alpha.0) (2023-08-17)
7
7
 
8
8
 
9
9
  ### Bug Fixes
@@ -14,6 +14,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
14
14
  * added logout handling for button ([#3983](https://github.com/thebyte9/blaze/issues/3983)) ([54ecb64](https://github.com/thebyte9/blaze/commit/54ecb64eb2e36ffe7e8dacb39a20a6a06487ba5e))
15
15
  * carousel - set min width to the content ([6d0dd8f](https://github.com/thebyte9/blaze/commit/6d0dd8fdd0381fa69c5b7a7084cc2960927d38a1))
16
16
  * carousel - set min width to the content ([e8b9267](https://github.com/thebyte9/blaze/commit/e8b9267201cac2de4f8bdf7cb778ed26b4b5ca84))
17
+ * deconstruct sticky from children ([e2ad5f2](https://github.com/thebyte9/blaze/commit/e2ad5f245a300e8a38fd6256daa01dcff4c3e29c))
17
18
  * hash bits now persists through filter changes ([#3965](https://github.com/thebyte9/blaze/issues/3965)) ([30595ef](https://github.com/thebyte9/blaze/commit/30595ef155783e78adc4f153230dccb33556e2f8))
18
19
  * hash bits now persists through filter changes ([#3965](https://github.com/thebyte9/blaze/issues/3965)) ([a8700c6](https://github.com/thebyte9/blaze/commit/a8700c63715f864a1178630d810216c274484b97))
19
20
  * hlist component andle when no search filter ([#3982](https://github.com/thebyte9/blaze/issues/3982)) ([e3a502c](https://github.com/thebyte9/blaze/commit/e3a502ca5b6b4f9028072e0b2fe19630a240b840))
@@ -37,77 +38,25 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
37
38
 
38
39
 
39
40
 
40
- # [0.132.0-admin-updates.0](https://github.com/thebyte9/blaze/compare/v0.131.0...v0.132.0-admin-updates.0) (2023-07-27)
41
41
 
42
42
 
43
- ### Bug Fixes
44
-
45
- * add collapse property to searchContent ([#3964](https://github.com/thebyte9/blaze/issues/3964)) ([3703a29](https://github.com/thebyte9/blaze/commit/3703a29d9a838f857863430d9223025900f29880))
46
- * add collapse property to searchContent ([#3964](https://github.com/thebyte9/blaze/issues/3964)) ([d133a19](https://github.com/thebyte9/blaze/commit/d133a1965fdb447824dfdb87566809d7597a24b2))
47
- * add second render ([488b2b6](https://github.com/thebyte9/blaze/commit/488b2b65b437db9beff90eaf38f6a8d2dc30f3a9))
48
- * added logout handling for button ([#3983](https://github.com/thebyte9/blaze/issues/3983)) ([f634575](https://github.com/thebyte9/blaze/commit/f634575cd6865dbc23391634c177efe4826d44c6))
49
- * added logout handling for button ([#3983](https://github.com/thebyte9/blaze/issues/3983)) ([1940547](https://github.com/thebyte9/blaze/commit/19405477315238fe8b14c974645675ec285ee85a))
50
- * carousel - set min width to the content ([7313a94](https://github.com/thebyte9/blaze/commit/7313a947d816716c607afaed6eaa61c3f26b0e89))
51
- * handle data summary urls in loops correctly ([#3993](https://github.com/thebyte9/blaze/issues/3993)) ([008e1a1](https://github.com/thebyte9/blaze/commit/008e1a1f24f065b4060302c2c32d1aa32dd8a007))
52
- * hash bits now persists through filter changes ([#3965](https://github.com/thebyte9/blaze/issues/3965)) ([e0c37fc](https://github.com/thebyte9/blaze/commit/e0c37fcff2479f531f2f337b4e98b4edf57b4795))
53
- * hash bits now persists through filter changes ([#3965](https://github.com/thebyte9/blaze/issues/3965)) ([04e4cb3](https://github.com/thebyte9/blaze/commit/04e4cb380520ea7c9b20860bf9cb4ea2facd27ad))
54
- * hlist component andle when no search filter ([#3982](https://github.com/thebyte9/blaze/issues/3982)) ([268eddc](https://github.com/thebyte9/blaze/commit/268eddcc71d42b3d63770554684bf79a5f163b7e))
55
- * hlist component andle when no search filter ([#3982](https://github.com/thebyte9/blaze/issues/3982)) ([e9e1a6d](https://github.com/thebyte9/blaze/commit/e9e1a6da969d9afc5f9ddaffcb7bf2238c84d898))
56
- * improve animation ([b9111b5](https://github.com/thebyte9/blaze/commit/b9111b59f9f297f5b4701bf5c42b0acd718d9985))
57
- * remove log ([9eac18f](https://github.com/thebyte9/blaze/commit/9eac18fa06744a11d8e57d5b4a1d58f488ada931))
58
- * reset search filters and handle single text property ([#3996](https://github.com/thebyte9/blaze/issues/3996)) ([0160414](https://github.com/thebyte9/blaze/commit/016041454d30cc4cfc0a4c8e2d484fcedc2a631c))
59
- * set width to carousel container ([d8f3ffb](https://github.com/thebyte9/blaze/commit/d8f3ffbdd22df47dcac88446828c2af5ac0f3318))
43
+ ## [0.131.2](https://github.com/thebyte9/blaze/compare/v0.131.1...v0.131.2) (2023-08-04)
60
44
 
61
45
 
62
- ### Features
46
+ ### Bug Fixes
63
47
 
64
- * add isHtml option to data summary component to render string as html ([#3969](https://github.com/thebyte9/blaze/issues/3969)) ([6005cdf](https://github.com/thebyte9/blaze/commit/6005cdf0e18f2eea51cc7bc143cf34423743fe5e))
65
- * 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))
66
- * add sticky setting to column and row ([#3988](https://github.com/thebyte9/blaze/issues/3988)) ([1d1a219](https://github.com/thebyte9/blaze/commit/1d1a21901b23fe184e1eadf2bbb49551dd5f9b33))
67
- * enableLink in data summary now works with neste objects ([#3974](https://github.com/thebyte9/blaze/issues/3974)) ([67b3c7f](https://github.com/thebyte9/blaze/commit/67b3c7fee9ffd60526dae525fea4d87097742453))
68
- * 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))
69
- * Filters and sorts now target generic or specific lists ([#3973](https://github.com/thebyte9/blaze/issues/3973)) ([013fead](https://github.com/thebyte9/blaze/commit/013fead2b1fa467c084535d36404d3b80b9db02f))
70
- * 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))
71
- * filteryBy on cards allow for id prop which fetches related data on parent to render ([#3975](https://github.com/thebyte9/blaze/issues/3975)) ([2eed0ed](https://github.com/thebyte9/blaze/commit/2eed0ed09cedda3a9424d3b88cb16bb437eada50))
72
- * 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))
48
+ * deconstruct sticky from children ([#4007](https://github.com/thebyte9/blaze/issues/4007)) ([1d3ad89](https://github.com/thebyte9/blaze/commit/1d3ad89c6a600ffb08964002ca9eda86c68e61f2))
73
49
 
74
50
 
75
51
 
76
52
 
77
53
 
78
- # [0.132.0-admin-updates.0](https://github.com/thebyte9/blaze/compare/v0.131.0...v0.132.0-admin-updates.0) (2023-07-27)
54
+ ## [0.131.1](https://github.com/thebyte9/blaze/compare/v0.131.0...v0.131.1) (2023-07-28)
79
55
 
80
56
 
81
57
  ### Bug Fixes
82
58
 
83
- * add collapse property to searchContent ([#3964](https://github.com/thebyte9/blaze/issues/3964)) ([3703a29](https://github.com/thebyte9/blaze/commit/3703a29d9a838f857863430d9223025900f29880))
84
- * add collapse property to searchContent ([#3964](https://github.com/thebyte9/blaze/issues/3964)) ([d133a19](https://github.com/thebyte9/blaze/commit/d133a1965fdb447824dfdb87566809d7597a24b2))
85
- * add second render ([488b2b6](https://github.com/thebyte9/blaze/commit/488b2b65b437db9beff90eaf38f6a8d2dc30f3a9))
86
- * added logout handling for button ([#3983](https://github.com/thebyte9/blaze/issues/3983)) ([f634575](https://github.com/thebyte9/blaze/commit/f634575cd6865dbc23391634c177efe4826d44c6))
87
- * added logout handling for button ([#3983](https://github.com/thebyte9/blaze/issues/3983)) ([1940547](https://github.com/thebyte9/blaze/commit/19405477315238fe8b14c974645675ec285ee85a))
88
- * carousel - set min width to the content ([7313a94](https://github.com/thebyte9/blaze/commit/7313a947d816716c607afaed6eaa61c3f26b0e89))
89
- * handle data summary urls in loops correctly ([#3993](https://github.com/thebyte9/blaze/issues/3993)) ([008e1a1](https://github.com/thebyte9/blaze/commit/008e1a1f24f065b4060302c2c32d1aa32dd8a007))
90
- * hash bits now persists through filter changes ([#3965](https://github.com/thebyte9/blaze/issues/3965)) ([e0c37fc](https://github.com/thebyte9/blaze/commit/e0c37fcff2479f531f2f337b4e98b4edf57b4795))
91
- * hash bits now persists through filter changes ([#3965](https://github.com/thebyte9/blaze/issues/3965)) ([04e4cb3](https://github.com/thebyte9/blaze/commit/04e4cb380520ea7c9b20860bf9cb4ea2facd27ad))
92
- * hlist component andle when no search filter ([#3982](https://github.com/thebyte9/blaze/issues/3982)) ([268eddc](https://github.com/thebyte9/blaze/commit/268eddcc71d42b3d63770554684bf79a5f163b7e))
93
- * hlist component andle when no search filter ([#3982](https://github.com/thebyte9/blaze/issues/3982)) ([e9e1a6d](https://github.com/thebyte9/blaze/commit/e9e1a6da969d9afc5f9ddaffcb7bf2238c84d898))
94
- * improve animation ([b9111b5](https://github.com/thebyte9/blaze/commit/b9111b59f9f297f5b4701bf5c42b0acd718d9985))
95
- * remove log ([9eac18f](https://github.com/thebyte9/blaze/commit/9eac18fa06744a11d8e57d5b4a1d58f488ada931))
96
- * reset search filters and handle single text property ([#3996](https://github.com/thebyte9/blaze/issues/3996)) ([0160414](https://github.com/thebyte9/blaze/commit/016041454d30cc4cfc0a4c8e2d484fcedc2a631c))
97
- * set width to carousel container ([d8f3ffb](https://github.com/thebyte9/blaze/commit/d8f3ffbdd22df47dcac88446828c2af5ac0f3318))
98
-
99
-
100
- ### Features
101
-
102
- * add isHtml option to data summary component to render string as html ([#3969](https://github.com/thebyte9/blaze/issues/3969)) ([6005cdf](https://github.com/thebyte9/blaze/commit/6005cdf0e18f2eea51cc7bc143cf34423743fe5e))
103
- * 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))
104
- * add sticky setting to column and row ([#3988](https://github.com/thebyte9/blaze/issues/3988)) ([1d1a219](https://github.com/thebyte9/blaze/commit/1d1a21901b23fe184e1eadf2bbb49551dd5f9b33))
105
- * enableLink in data summary now works with neste objects ([#3974](https://github.com/thebyte9/blaze/issues/3974)) ([67b3c7f](https://github.com/thebyte9/blaze/commit/67b3c7fee9ffd60526dae525fea4d87097742453))
106
- * 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))
107
- * Filters and sorts now target generic or specific lists ([#3973](https://github.com/thebyte9/blaze/issues/3973)) ([013fead](https://github.com/thebyte9/blaze/commit/013fead2b1fa467c084535d36404d3b80b9db02f))
108
- * 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))
109
- * filteryBy on cards allow for id prop which fetches related data on parent to render ([#3975](https://github.com/thebyte9/blaze/issues/3975)) ([2eed0ed](https://github.com/thebyte9/blaze/commit/2eed0ed09cedda3a9424d3b88cb16bb437eada50))
110
- * 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))
59
+ * do not override properties in card banners ([#4001](https://github.com/thebyte9/blaze/issues/4001)) ([44353b1](https://github.com/thebyte9/blaze/commit/44353b159f2da9d447833a12751fde6ebd4a734f))
111
60
 
112
61
 
113
62
 
@@ -63,11 +63,10 @@ var buildLoopPropsContent = function buildLoopPropsContent() {
63
63
  modifier = _options$modifier === void 0 ? '' : _options$modifier;
64
64
  return propertiesToDisplay.map(function (key) {
65
65
  var loopValue = loopValues[key];
66
- var loopValueItem = loopValue && loopValue[i];
67
- var propValue = loopValueItem ? getLoopValue(loopValueItem) : regularValues[key];
66
+ var propValue = loopValue ? getLoopValue(loopValue[i]) : regularValues[key];
68
67
  if (!propValue) return null;
69
68
  var processedValue = (0, _helpers.processDataSummaryValue)(propValue, options);
70
- var linkToPublishedContent = (0, _getLinkToPublishedContent["default"])(key, data, loopValueItem);
69
+ var linkToPublishedContent = (0, _getLinkToPublishedContent["default"])(key, data);
71
70
  return [(0, _lodash["default"])(label), processedValue, linkToPublishedContent, modifier];
72
71
  });
73
72
  })).filter(Boolean);
@@ -1 +1 @@
1
- {"version":3,"file":"build-loop-props-content.js","names":["_lodash","_interopRequireDefault","require","_lodash2","_getLinkToPublishedContent","_getLoopPropsLimit","_getPropValue","_helpers","getLoopValue","value","keyField","separateValues","propsToDisplay","loopProps","data","regularValues","loopValues","forEach","options","propertiesToDisplay","prop","getPropValue","isArrayValue","Array","isArray","isLoopableProp","includes","buildLoopPropsContent","arguments","length","undefined","limit","loopPropsWithContent","_separateValues","_separateValues2","_slicedToArray2","loopLimit","getLoopPropsLimit","_loop","i","propsArray","flatten","map","label","_options$modifier","modifier","key","loopValue","loopValueItem","propValue","processedValue","processDataSummaryValue","linkToPublishedContent","getLinkToPublishedContent","upperFirst","filter","Boolean","push","_default","exports"],"sources":["../../../../src/components/DataSummary/helpers/build-loop-props-content.js"],"sourcesContent":["import upperFirst from 'lodash.upperfirst';\nimport flatten from 'lodash.flatten';\nimport getLinkToPublishedContent from './get-link-to-published-content';\nimport getLoopPropsLimit from './get-loop-props-limit';\nimport getPropValue from './get-prop-value';\nimport { processDataSummaryValue } from '../../../helpers';\n\nconst getLoopValue = value => {\n const { keyField } = value;\n return value[keyField];\n};\n\nconst separateValues = (propsToDisplay, loopProps, data) => {\n const regularValues = {};\n const loopValues = {};\n\n propsToDisplay.forEach(options => {\n const { propertiesToDisplay } = options;\n propertiesToDisplay.forEach(prop => {\n const value = getPropValue(prop, data, options);\n const isArrayValue = Array.isArray(value);\n if (!value) return;\n const isLoopableProp = loopProps.includes(prop) && isArrayValue;\n\n if (isLoopableProp) {\n loopValues[prop] = value;\n } else {\n regularValues[prop] = value;\n }\n });\n });\n return [regularValues, loopValues];\n};\n\nconst buildLoopPropsContent = (loopProps = [], propsToDisplay = [], limit = 0, data = {}) => {\n const loopPropsWithContent = [];\n const [regularValues, loopValues] = separateValues(propsToDisplay, loopProps, data);\n\n const loopLimit = getLoopPropsLimit(loopValues, limit);\n\n for (let i = 0; i < loopLimit; i += 1) {\n const propsArray = flatten(\n propsToDisplay.map(options => {\n const { propertiesToDisplay, label, modifier = '' } = options;\n\n return propertiesToDisplay.map(key => {\n const loopValue = loopValues[key];\n const loopValueItem = loopValue && loopValue[i];\n const propValue = loopValueItem ? getLoopValue(loopValueItem) : regularValues[key];\n if (!propValue) return null;\n\n const processedValue = processDataSummaryValue(propValue, options);\n const linkToPublishedContent = getLinkToPublishedContent(key, data, loopValueItem);\n return [upperFirst(label), processedValue, linkToPublishedContent, modifier];\n });\n })\n ).filter(Boolean);\n loopPropsWithContent.push(propsArray);\n }\n\n return flatten(loopPropsWithContent);\n};\n\nexport default buildLoopPropsContent;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,0BAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,kBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,aAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAEA,IAAMM,YAAY,GAAG,SAAfA,YAAYA,CAAGC,KAAK,EAAI;EAC5B,IAAQC,QAAQ,GAAKD,KAAK,CAAlBC,QAAQ;EAChB,OAAOD,KAAK,CAACC,QAAQ,CAAC;AACxB,CAAC;AAED,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,cAAc,EAAEC,SAAS,EAAEC,IAAI,EAAK;EAC1D,IAAMC,aAAa,GAAG,CAAC,CAAC;EACxB,IAAMC,UAAU,GAAG,CAAC,CAAC;EAErBJ,cAAc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CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,SAAS,EAAEG,CAAC,IAAI,CAAC;IAAAD,KAAA,CAAAC,CAAA;EAAA;EAoBrC,OAAO,IAAAE,mBAAO,EAACT,oBAAoB,CAAC;AACtC,CAAC;AAAC,IAAA0B,QAAA,GAEa/B,qBAAqB;AAAAgC,OAAA,cAAAD,QAAA"}
1
+ {"version":3,"file":"build-loop-props-content.js","names":["_lodash","_interopRequireDefault","require","_lodash2","_getLinkToPublishedContent","_getLoopPropsLimit","_getPropValue","_helpers","getLoopValue","value","keyField","separateValues","propsToDisplay","loopProps","data","regularValues","loopValues","forEach","options","propertiesToDisplay","prop","getPropValue","isArrayValue","Array","isArray","isLoopableProp","includes","buildLoopPropsContent","arguments","length","undefined","limit","loopPropsWithContent","_separateValues","_separateValues2","_slicedToArray2","loopLimit","getLoopPropsLimit","_loop","i","propsArray","flatten","map","label","_options$modifier","modifier","key","loopValue","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,GAA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,mBAAO,EAACT,oBAAoB,CAAC;AACtC,CAAC;AAAC,IAAAyB,QAAA,GAEa9B,qBAAqB;AAAA+B,OAAA,cAAAD,QAAA"}
@@ -11,12 +11,10 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
11
11
  var getLinkToPublishedContent = function getLinkToPublishedContent() {
12
12
  var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
13
13
  var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
14
- var currentValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
15
14
  var _key$split = key.split('.'),
16
15
  _key$split2 = (0, _slicedToArray2["default"])(_key$split, 1),
17
16
  baseKey = _key$split2[0];
18
17
  if (!props[baseKey]) return '';
19
- if (currentValue && typeof currentValue.url !== 'undefined') return currentValue.url;
20
18
  var content = Array.isArray(props[baseKey]) ? props[baseKey][0] : props[baseKey];
21
19
  return content && content.url ? content.url : '';
22
20
  };
@@ -1 +1 @@
1
- {"version":3,"file":"get-link-to-published-content.js","names":["getLinkToPublishedContent","key","arguments","length","undefined","props","currentValue","_key$split","split","_key$split2","_slicedToArray2","baseKey","url","content","Array","isArray","_default","exports"],"sources":["../../../../src/components/DataSummary/helpers/get-link-to-published-content.js"],"sourcesContent":["const getLinkToPublishedContent = (key = '', props = {}, currentValue = null) => {\n const [baseKey] = key.split('.');\n if (!props[baseKey]) return '';\n\n if (currentValue && typeof currentValue.url !== 'undefined') return currentValue.url;\n\n const content = Array.isArray(props[baseKey]) ? props[baseKey][0] : props[baseKey];\n return content && content.url ? content.url : '';\n};\n\nexport default getLinkToPublishedContent;\n"],"mappings":";;;;;;;;;;AAAA,IAAMA,yBAAyB,GAAG,SAA5BA,yBAAyBA,CAAA,EAAkD;EAAA,IAA9CC,GAAG,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EAAA,IAAEG,KAAK,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAAA,IAAEI,YAAY,GAAAJ,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;EAC1E,IAAAK,UAAA,GAAkBN,GAAG,CAACO,KAAK,CAAC,GAAG,CAAC;IAAAC,WAAA,OAAAC,eAAA,aAAAH,UAAA;IAAzBI,OAAO,GAAAF,WAAA;EACd,IAAI,CAACJ,KAAK,CAACM,OAAO,CAAC,EAAE,OAAO,EAAE;EAE9B,IAAIL,YAAY,IAAI,OAAOA,YAAY,CAACM,GAAG,KAAK,WAAW,EAAE,OAAON,YAAY,CAACM,GAAG;EAEpF,IAAMC,OAAO,GAAGC,KAAK,CAACC,OAAO,CAACV,KAAK,CAACM,OAAO,CAAC,CAAC,GAAGN,KAAK,CAACM,OAAO,CAAC,CAAC,CAAC,CAAC,GAAGN,KAAK,CAACM,OAAO,CAAC;EAClF,OAAOE,OAAO,IAAIA,OAAO,CAACD,GAAG,GAAGC,OAAO,CAACD,GAAG,GAAG,EAAE;AAClD,CAAC;AAAC,IAAAI,QAAA,GAEahB,yBAAyB;AAAAiB,OAAA,cAAAD,QAAA"}
1
+ {"version":3,"file":"get-link-to-published-content.js","names":["getLinkToPublishedContent","key","arguments","length","undefined","props","_key$split","split","_key$split2","_slicedToArray2","baseKey","content","Array","isArray","url","_default","exports"],"sources":["../../../../src/components/DataSummary/helpers/get-link-to-published-content.js"],"sourcesContent":["const getLinkToPublishedContent = (key = '', props = {}) => {\n const [baseKey] = key.split('.');\n if (!props[baseKey]) return '';\n const content = Array.isArray(props[baseKey]) ? props[baseKey][0] : props[baseKey];\n return content && content.url ? content.url : '';\n};\n\nexport default getLinkToPublishedContent;\n"],"mappings":";;;;;;;;;;AAAA,IAAMA,yBAAyB,GAAG,SAA5BA,yBAAyBA,CAAA,EAA6B;EAAA,IAAzBC,GAAG,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EAAA,IAAEG,KAAK,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EACrD,IAAAI,UAAA,GAAkBL,GAAG,CAACM,KAAK,CAAC,GAAG,CAAC;IAAAC,WAAA,OAAAC,eAAA,aAAAH,UAAA;IAAzBI,OAAO,GAAAF,WAAA;EACd,IAAI,CAACH,KAAK,CAACK,OAAO,CAAC,EAAE,OAAO,EAAE;EAC9B,IAAMC,OAAO,GAAGC,KAAK,CAACC,OAAO,CAACR,KAAK,CAACK,OAAO,CAAC,CAAC,GAAGL,KAAK,CAACK,OAAO,CAAC,CAAC,CAAC,CAAC,GAAGL,KAAK,CAACK,OAAO,CAAC;EAClF,OAAOC,OAAO,IAAIA,OAAO,CAACG,GAAG,GAAGH,OAAO,CAACG,GAAG,GAAG,EAAE;AAClD,CAAC;AAAC,IAAAC,QAAA,GAEaf,yBAAyB;AAAAgB,OAAA,cAAAD,QAAA"}
@@ -27,7 +27,7 @@ var _hooks = require("../../hooks");
27
27
  var _helpers = require("./helpers");
28
28
  var _helpers2 = require("../../helpers");
29
29
  var _constants = require("../../constants");
30
- var _excluded = ["type", "children", "settings", "modifier", "backgroundImage", "tagType", "dataNoSnippet"];
30
+ var _excluded = ["type", "children", "settings", "modifier", "backgroundImage", "tagType", "dataNoSnippet", "sticky"];
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
33
  var Layout = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
@@ -38,6 +38,7 @@ var Layout = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
38
38
  backgroundImage = _ref.backgroundImage,
39
39
  tagType = _ref.tagType,
40
40
  dataNoSnippet = _ref.dataNoSnippet,
41
+ sticky = _ref.sticky,
41
42
  otherProps = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
42
43
  var _useGetImages = (0, _hooks.useGetImages)(backgroundImage),
43
44
  _useGetImages$data$ge = _useGetImages.data.getFile,
@@ -49,7 +50,8 @@ var Layout = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
49
50
  });
50
51
  var title = settings.title;
51
52
  var classModifiers = (0, _utils.getClassModifiers)(type, _objectSpread({
52
- modifier: modifier
53
+ modifier: modifier,
54
+ sticky: sticky
53
55
  }, otherProps));
54
56
  var additionalRowModifier = (0, _helpers.checkIfRowHasColumns)(type, children) ? ' display-row' : '';
55
57
  if (type === _constants.COLUMN && !(0, _helpers2.hasChildren)(children)) return null;
@@ -67,6 +69,7 @@ var Layout = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
67
69
  });
68
70
  Layout.propTypes = {
69
71
  type: _propTypes["default"].string.isRequired,
72
+ sticky: _propTypes["default"].bool,
70
73
  settings: _propTypes["default"].shape({
71
74
  title: _propTypes["default"].string
72
75
  }),
@@ -83,7 +86,8 @@ Layout.defaultProps = {
83
86
  backgroundImage: '',
84
87
  modifier: '',
85
88
  tagType: '',
86
- dataNoSnippet: false
89
+ dataNoSnippet: false,
90
+ sticky: false
87
91
  };
88
92
  var _default = Layout;
89
93
  exports["default"] = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"Layout.js","names":["_react","_interopRequireDefault","require","_propTypes","_Wrapper","_utils","_hooks","_helpers","_helpers2","_constants","_excluded","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","Layout","React","forwardRef","_ref","ref","type","children","settings","modifier","backgroundImage","tagType","dataNoSnippet","otherProps","_objectWithoutProperties2","_useGetImages","useGetImages","_useGetImages$data$ge","data","getFile","_useGetImages$data$ge2","_useGetImages$data$ge3","url","style","getStylesToUpdate","title","classModifiers","getClassModifiers","additionalRowModifier","checkIfRowHasColumns","COLUMN","hasChildren","otherWrapperProps","createElement","_extends2","className","modifiers","concat","renderChildren","propTypes","PropTypes","string","isRequired","shape","bool","oneOfType","arrayOf","node","defaultProps","_default","exports"],"sources":["../../../src/components/Layout/Layout.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Wrapper from '../Wrapper';\nimport { getClassModifiers } from '../../utils';\nimport { useGetImages } from '../../hooks';\nimport { getStylesToUpdate, checkIfRowHasColumns } from './helpers';\nimport { renderChildren, hasChildren } from '../../helpers';\nimport { COLUMN } from '../../constants';\n\nconst Layout = React.forwardRef(\n (\n { type, children, settings, modifier, backgroundImage, tagType, dataNoSnippet, ...otherProps },\n ref\n ) => {\n const {\n data: { getFile: { url = null } = {} }\n } = useGetImages(backgroundImage);\n\n const style = getStylesToUpdate({ backgroundImage: url });\n const { title } = settings;\n\n const classModifiers = getClassModifiers(type, { modifier, ...otherProps });\n const additionalRowModifier = checkIfRowHasColumns(type, children) ? ' display-row' : '';\n\n if (type === COLUMN && !hasChildren(children)) return null;\n\n const otherWrapperProps = {};\n if (dataNoSnippet) otherWrapperProps['data-nosnippet'] = true;\n\n return (\n <Wrapper\n ref={ref}\n tagType={tagType}\n className={type}\n modifiers={`${classModifiers}${additionalRowModifier}`}\n style={style}\n {...otherWrapperProps}>\n {title && <h2 className=\"heading heading--section\">{title}</h2>}\n {renderChildren(children, otherProps)}\n </Wrapper>\n );\n }\n);\n\nLayout.propTypes = {\n type: PropTypes.string.isRequired,\n settings: PropTypes.shape({\n title: PropTypes.string\n }),\n modifier: PropTypes.string,\n backgroundImage: PropTypes.string,\n tagType: PropTypes.string,\n dataNoSnippet: PropTypes.bool,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired\n};\n\nLayout.defaultProps = {\n settings: {\n title: ''\n },\n backgroundImage: '',\n modifier: '',\n tagType: '',\n dataNoSnippet: false\n};\n\nexport default Layout;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AAAyC,IAAAQ,SAAA;AAAA,SAAAC,QAAAC,MAAA,EAAAC,cAAA,QAAAC,IAAA,GAAAC,MAAA,CAAAD,IAAA,CAAAF,MAAA,OAAAG,MAAA,CAAAC,qBAAA,QAAAC,OAAA,GAAAF,MAAA,CAAAC,qBAAA,CAAAJ,MAAA,GAAAC,cAAA,KAAAI,OAAA,GAAAA,OAAA,CAAAC,MAAA,WAAAC,GAAA,WAAAJ,MAAA,CAAAK,wBAAA,CAAAR,MAAA,EAAAO,GAAA,EAAAE,UAAA,OAAAP,IAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,IAAA,EAAAG,OAAA,YAAAH,IAAA;AAAA,SAAAU,cAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,WAAAF,SA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EAAE8B,qBAAS,CAACC,MAAM;EACjC9B,OAAO,EAAE6B,qBAAS,CAACC,MAAM;EACzB7B,aAAa,EAAE4B,qBAAS,CAACI,IAAI;EAC7BrC,QAAQ,EAAEiC,qBAAS,CAACK,SAAS,CAAC,CAACL,qBAAS,CAACM,OAAO,CAACN,qBAAS,CAACO,IAAI,CAAC,EAAEP,qBAAS,CAACO,IAAI,CAAC,CAAC,CAACL;AACrF,CAAC;AAEDzC,MAAM,CAAC+C,YAAY,GAAG;EACpBxC,QAAQ,EAAE;IACRiB,KAAK,EAAE;EACT,CAAC;EACDf,eAAe,EAAE,EAAE;EACnBD,QAAQ,EAAE,EAAE;EACZE,OAAO,EAAE,EAAE;EACXC,aAAa,EAAE;AACjB,CAAC;AAAC,IAAAqC,QAAA,GAEahD,MAAM;AAAAiD,OAAA,cAAAD,QAAA"}
1
+ {"version":3,"file":"Layout.js","names":["_react","_interopRequireDefault","require","_propTypes","_Wrapper","_utils","_hooks","_helpers","_helpers2","_constants","_excluded","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","Layout","React","forwardRef","_ref","ref","type","children","settings","modifier","backgroundImage","tagType","dataNoSnippet","sticky","otherProps","_objectWithoutProperties2","_useGetImages","useGetImages","_useGetImages$data$ge","data","getFile","_useGetImages$data$ge2","_useGetImages$data$ge3","url","style","getStylesToUpdate","title","classModifiers","getClassModifiers","additionalRowModifier","checkIfRowHasColumns","COLUMN","hasChildren","otherWrapperProps","createElement","_extends2","className","modifiers","concat","renderChildren","propTypes","PropTypes","string","isRequired","bool","shape","oneOfType","arrayOf","node","defaultProps","_default","exports"],"sources":["../../../src/components/Layout/Layout.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Wrapper from '../Wrapper';\nimport { getClassModifiers } from '../../utils';\nimport { useGetImages } from '../../hooks';\nimport { getStylesToUpdate, checkIfRowHasColumns } from './helpers';\nimport { renderChildren, hasChildren } from '../../helpers';\nimport { COLUMN } from '../../constants';\n\nconst Layout = React.forwardRef(\n (\n {\n type,\n children,\n settings,\n modifier,\n backgroundImage,\n tagType,\n dataNoSnippet,\n sticky,\n ...otherProps\n },\n ref\n ) => {\n const {\n data: { getFile: { url = null } = {} }\n } = useGetImages(backgroundImage);\n\n const style = getStylesToUpdate({ backgroundImage: url });\n const { title } = settings;\n\n const classModifiers = getClassModifiers(type, { modifier, sticky, ...otherProps });\n const additionalRowModifier = checkIfRowHasColumns(type, children) ? ' display-row' : '';\n\n if (type === COLUMN && !hasChildren(children)) return null;\n\n const otherWrapperProps = {};\n if (dataNoSnippet) otherWrapperProps['data-nosnippet'] = true;\n\n return (\n <Wrapper\n ref={ref}\n tagType={tagType}\n className={type}\n modifiers={`${classModifiers}${additionalRowModifier}`}\n style={style}\n {...otherWrapperProps}>\n {title && <h2 className=\"heading heading--section\">{title}</h2>}\n {renderChildren(children, otherProps)}\n </Wrapper>\n );\n }\n);\n\nLayout.propTypes = {\n type: PropTypes.string.isRequired,\n sticky: PropTypes.bool,\n settings: PropTypes.shape({\n title: PropTypes.string\n }),\n modifier: PropTypes.string,\n backgroundImage: PropTypes.string,\n tagType: PropTypes.string,\n dataNoSnippet: PropTypes.bool,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired\n};\n\nLayout.defaultProps = {\n settings: {\n title: ''\n },\n backgroundImage: '',\n modifier: '',\n tagType: '',\n dataNoSnippet: false,\n sticky: false\n};\n\nexport default Layout;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAA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C,IAAAqC,QAAA,GAEajD,MAAM;AAAAkD,OAAA,cAAAD,QAAA"}
@@ -44,11 +44,10 @@ const buildLoopPropsContent = (loopProps = [], propsToDisplay = [], limit = 0, d
44
44
  } = options;
45
45
  return propertiesToDisplay.map(key => {
46
46
  const loopValue = loopValues[key];
47
- const loopValueItem = loopValue && loopValue[i];
48
- const propValue = loopValueItem ? getLoopValue(loopValueItem) : regularValues[key];
47
+ const propValue = loopValue ? getLoopValue(loopValue[i]) : regularValues[key];
49
48
  if (!propValue) return null;
50
49
  const processedValue = processDataSummaryValue(propValue, options);
51
- const linkToPublishedContent = getLinkToPublishedContent(key, data, loopValueItem);
50
+ const linkToPublishedContent = getLinkToPublishedContent(key, data);
52
51
  return [upperFirst(label), processedValue, linkToPublishedContent, modifier];
53
52
  });
54
53
  })).filter(Boolean);
@@ -1 +1 @@
1
- {"version":3,"file":"build-loop-props-content.js","names":["upperFirst","flatten","getLinkToPublishedContent","getLoopPropsLimit","getPropValue","processDataSummaryValue","getLoopValue","value","keyField","separateValues","propsToDisplay","loopProps","data","regularValues","loopValues","forEach","options","propertiesToDisplay","prop","isArrayValue","Array","isArray","isLoopableProp","includes","buildLoopPropsContent","limit","loopPropsWithContent","loopLimit","i","propsArray","map","label","modifier","key","loopValue","loopValueItem","propValue","processedValue","linkToPublishedContent","filter","Boolean","push"],"sources":["../../../../src/components/DataSummary/helpers/build-loop-props-content.js"],"sourcesContent":["import upperFirst from 'lodash.upperfirst';\nimport flatten from 'lodash.flatten';\nimport getLinkToPublishedContent from './get-link-to-published-content';\nimport getLoopPropsLimit from './get-loop-props-limit';\nimport getPropValue from './get-prop-value';\nimport { processDataSummaryValue } from '../../../helpers';\n\nconst getLoopValue = value => {\n const { keyField } = value;\n return value[keyField];\n};\n\nconst separateValues = (propsToDisplay, loopProps, data) => {\n const regularValues = {};\n const loopValues = {};\n\n propsToDisplay.forEach(options => {\n const { propertiesToDisplay } = options;\n propertiesToDisplay.forEach(prop => {\n const value = getPropValue(prop, data, options);\n const isArrayValue = Array.isArray(value);\n if (!value) return;\n const isLoopableProp = loopProps.includes(prop) && isArrayValue;\n\n if (isLoopableProp) {\n loopValues[prop] = value;\n } else {\n regularValues[prop] = value;\n }\n });\n });\n return [regularValues, loopValues];\n};\n\nconst buildLoopPropsContent = (loopProps = [], propsToDisplay = [], limit = 0, data = {}) => {\n const loopPropsWithContent = [];\n const [regularValues, loopValues] = separateValues(propsToDisplay, loopProps, data);\n\n const loopLimit = getLoopPropsLimit(loopValues, limit);\n\n for (let i = 0; i < loopLimit; i += 1) {\n const propsArray = flatten(\n propsToDisplay.map(options => {\n const { propertiesToDisplay, label, modifier = '' } = options;\n\n return propertiesToDisplay.map(key => {\n const loopValue = loopValues[key];\n const loopValueItem = loopValue && loopValue[i];\n const propValue = loopValueItem ? getLoopValue(loopValueItem) : regularValues[key];\n if (!propValue) return null;\n\n const processedValue = processDataSummaryValue(propValue, options);\n const linkToPublishedContent = getLinkToPublishedContent(key, data, loopValueItem);\n return [upperFirst(label), processedValue, linkToPublishedContent, modifier];\n });\n })\n ).filter(Boolean);\n loopPropsWithContent.push(propsArray);\n }\n\n return flatten(loopPropsWithContent);\n};\n\nexport default buildLoopPropsContent;\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,mBAAmB;AAC1C,OAAOC,OAAO,MAAM,gBAAgB;AACpC,OAAOC,yBAAyB,MAAM,iCAAiC;AACvE,OAAOC,iBAAiB,MAAM,wBAAwB;AACtD,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,SAASC,uBAAuB,QAAQ,kBAAkB;AAE1D,MAAMC,YAAY,GAAGC,KAAK,IAAI;EAC5B,MAAM;IAAEC;EAAS,CAAC,GAAGD,KAAK;EAC1B,OAAOA,KAAK,CAACC,QAAQ,CAAC;AACxB,CAAC;AAED,MAAMC,cAAc,GAAGA,CAACC,cAAc,EAAEC,SAAS,EAAEC,IAAI,KAAK;EAC1D,MAAMC,aAAa,GAAG,CAAC,CAAC;EACxB,MAAMC,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AAGhB,OAAO;MAE7D,OAAOC,mBAAmB,CAACa,GAAG,CAACG,GAAG,IAAI;QACpC,MAAMC,SAAS,GAAGpB,UAAU,CAACmB,GAAG,CAAC;QACjC,MAAME,aAAa,GAAGD,SAAS,IAAIA,SAAS,CAACN,CAAC,CAAC;QAC/C,MAAMQ,SAAS,GAAGD,aAAa,GAAG7B,YAAY,CAAC6B,aAAa,CAAC,GAAGtB,aAAa,CAACoB,GAAG,CAAC;QAClF,IAAI,CAACG,SAAS,EAAE,OAAO,IAAI;QAE3B,MAAMC,cAAc,GAAGhC,uBAAuB,CAAC+B,SAAS,EAAEpB,OAAO,CAAC;QAClE,MAAMsB,sBAAsB,GAAGpC,yBAAyB,CAAC+B,GAAG,EAAErB,IAAI,EAAEuB,aAAa,CAAC;QAClF,OAAO,CAACnC,UAAU,CAAC+B,KAAK,CAAC,EAAEM,cAAc,EAAEC,sBAAsB,EAAEN,QAAQ,CAAC;MAC9E,CAAC,CAAC;IACJ,CAAC,CACH,CAAC,CAACO,MAAM,CAACC,OAAO,CAAC;IACjBd,oBAAoB,CAACe,IAAI,CAACZ,UAAU,CAAC;EACvC;EAEA,OAAO5B,OAAO,CAACyB,oBAAoB,CAAC;AACtC,CAAC;AAED,eAAeF,qBAAqB"}
1
+ {"version":3,"file":"build-loop-props-content.js","names":["upperFirst","flatten","getLinkToPublishedContent","getLoopPropsLimit","getPropValue","processDataSummaryValue","getLoopValue","value","keyField","separateValues","propsToDisplay","loopProps","data","regularValues","loopValues","forEach","options","propertiesToDisplay","prop","isArrayValue","Array","isArray","isLoopableProp","includes","buildLoopPropsContent","limit","loopPropsWithContent","loopLimit","i","propsArray","map","label","modifier","key","loopValue","propValue","processedValue","linkToPublishedContent","filter","Boolean","push"],"sources":["../../../../src/components/DataSummary/helpers/build-loop-props-content.js"],"sourcesContent":["import upperFirst from 'lodash.upperfirst';\nimport flatten from 'lodash.flatten';\nimport getLinkToPublishedContent from './get-link-to-published-content';\nimport getLoopPropsLimit from './get-loop-props-limit';\nimport getPropValue from './get-prop-value';\nimport { processDataSummaryValue } from '../../../helpers';\n\nconst getLoopValue = value => {\n const { keyField } = value;\n return value[keyField];\n};\n\nconst separateValues = (propsToDisplay, loopProps, data) => {\n const regularValues = {};\n const loopValues = {};\n\n propsToDisplay.forEach(options => {\n const { propertiesToDisplay } = options;\n propertiesToDisplay.forEach(prop => {\n const value = getPropValue(prop, data, options);\n const isArrayValue = Array.isArray(value);\n if (!value) return;\n const isLoopableProp = loopProps.includes(prop) && isArrayValue;\n\n if (isLoopableProp) {\n loopValues[prop] = value;\n } else {\n regularValues[prop] = value;\n }\n });\n });\n return [regularValues, loopValues];\n};\n\nconst buildLoopPropsContent = (loopProps = [], propsToDisplay = [], limit = 0, data = {}) => {\n const loopPropsWithContent = [];\n const [regularValues, loopValues] = separateValues(propsToDisplay, loopProps, data);\n\n const loopLimit = getLoopPropsLimit(loopValues, limit);\n\n for (let i = 0; i < loopLimit; i += 1) {\n const propsArray = flatten(\n propsToDisplay.map(options => {\n const { propertiesToDisplay, label, modifier = '' } = options;\n\n return propertiesToDisplay.map(key => {\n const loopValue = loopValues[key];\n const propValue = loopValue ? getLoopValue(loopValue[i]) : regularValues[key];\n if (!propValue) return null;\n\n const processedValue = processDataSummaryValue(propValue, options);\n const linkToPublishedContent = getLinkToPublishedContent(key, data);\n return [upperFirst(label), processedValue, linkToPublishedContent, modifier];\n });\n })\n ).filter(Boolean);\n loopPropsWithContent.push(propsArray);\n }\n\n return flatten(loopPropsWithContent);\n};\n\nexport default buildLoopPropsContent;\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,mBAAmB;AAC1C,OAAOC,OAAO,MAAM,gBAAgB;AACpC,OAAOC,yBAAyB,MAAM,iCAAiC;AACvE,OAAOC,iBAAiB,MAAM,wBAAwB;AACtD,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,SAASC,uBAAuB,QAAQ,kBAAkB;AAE1D,MAAMC,YAAY,GAAGC,KAAK,IAAI;EAC5B,M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AAEA,CAAC,GAAGD,SAAS,EAAEC,CAAC,IAAI,CAAC,EAAE;IACrC,MAAMC,UAAU,GAAG5B,OAAO,CACxBS,cAAc,CAACoB,GAAG,CAACd,OAAO,IAAI;MAC5B,MAAM;QAAEC,mBAAmB;QAAEc,KAAK;QAAEC,QAAQ,GAAG;MAAG,CAAC,GAAGhB,OAAO;MAE7D,OAAOC,mBAAmB,CAACa,GAAG,CAACG,GAAG,IAAI;QACpC,MAAMC,SAAS,GAAGpB,UAAU,CAACmB,GAAG,CAAC;QACjC,MAAME,SAAS,GAAGD,SAAS,GAAG5B,YAAY,CAAC4B,SAAS,CAACN,CAAC,CAAC,CAAC,GAAGf,aAAa,CAACoB,GAAG,CAAC;QAC7E,IAAI,CAACE,SAAS,EAAE,OAAO,IAAI;QAE3B,MAAMC,cAAc,GAAG/B,uBAAuB,CAAC8B,SAAS,EAAEnB,OAAO,CAAC;QAClE,MAAMqB,sBAAsB,GAAGnC,yBAAyB,CAAC+B,GAAG,EAAErB,IAAI,CAAC;QACnE,OAAO,CAACZ,UAAU,CAAC+B,KAAK,CAAC,EAAEK,cAAc,EAAEC,sBAAsB,EAAEL,QAAQ,CAAC;MAC9E,CAAC,CAAC;IACJ,CAAC,CACH,CAAC,CAACM,MAAM,CAACC,OAAO,CAAC;IACjBb,oBAAoB,CAACc,IAAI,CAACX,UAAU,CAAC;EACvC;EAEA,OAAO5B,OAAO,CAACyB,oBAAoB,CAAC;AACtC,CAAC;AAED,eAAeF,qBAAqB"}
@@ -1,7 +1,6 @@
1
- const getLinkToPublishedContent = (key = '', props = {}, currentValue = null) => {
1
+ const getLinkToPublishedContent = (key = '', props = {}) => {
2
2
  const [baseKey] = key.split('.');
3
3
  if (!props[baseKey]) return '';
4
- if (currentValue && typeof currentValue.url !== 'undefined') return currentValue.url;
5
4
  const content = Array.isArray(props[baseKey]) ? props[baseKey][0] : props[baseKey];
6
5
  return content && content.url ? content.url : '';
7
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"get-link-to-published-content.js","names":["getLinkToPublishedContent","key","props","currentValue","baseKey","split","url","content","Array","isArray"],"sources":["../../../../src/components/DataSummary/helpers/get-link-to-published-content.js"],"sourcesContent":["const getLinkToPublishedContent = (key = '', props = {}, currentValue = null) => {\n const [baseKey] = key.split('.');\n if (!props[baseKey]) return '';\n\n if (currentValue && typeof currentValue.url !== 'undefined') return currentValue.url;\n\n const content = Array.isArray(props[baseKey]) ? props[baseKey][0] : props[baseKey];\n return content && content.url ? content.url : '';\n};\n\nexport default getLinkToPublishedContent;\n"],"mappings":"AAAA,MAAMA,yBAAyB,GAAGA,CAACC,GAAG,GAAG,EAAE,EAAEC,KAAK,GAAG,CAAC,CAAC,EAAEC,YAAY,GAAG,IAAI,KAAK;EAC/E,MAAM,CAACC,OAAO,CAAC,GAAGH,GAAG,CAACI,KAAK,CAAC,GAAG,CAAC;EAChC,IAAI,CAACH,KAAK,CAACE,OAAO,CAAC,EAAE,OAAO,EAAE;EAE9B,IAAID,YAAY,IAAI,OAAOA,YAAY,CAACG,GAAG,KAAK,WAAW,EAAE,OAAOH,YAAY,CAACG,GAAG;EAEpF,MAAMC,OAAO,GAAGC,KAAK,CAACC,OAAO,CAACP,KAAK,CAACE,OAAO,CAAC,CAAC,GAAGF,KAAK,CAACE,OAAO,CAAC,CAAC,CAAC,CAAC,GAAGF,KAAK,CAACE,OAAO,CAAC;EAClF,OAAOG,OAAO,IAAIA,OAAO,CAACD,GAAG,GAAGC,OAAO,CAACD,GAAG,GAAG,EAAE;AAClD,CAAC;AAED,eAAeN,yBAAyB"}
1
+ {"version":3,"file":"get-link-to-published-content.js","names":["getLinkToPublishedContent","key","props","baseKey","split","content","Array","isArray","url"],"sources":["../../../../src/components/DataSummary/helpers/get-link-to-published-content.js"],"sourcesContent":["const getLinkToPublishedContent = (key = '', props = {}) => {\n const [baseKey] = key.split('.');\n if (!props[baseKey]) return '';\n const content = Array.isArray(props[baseKey]) ? props[baseKey][0] : props[baseKey];\n return content && content.url ? content.url : '';\n};\n\nexport default getLinkToPublishedContent;\n"],"mappings":"AAAA,MAAMA,yBAAyB,GAAGA,CAACC,GAAG,GAAG,EAAE,EAAEC,KAAK,GAAG,CAAC,CAAC,KAAK;EAC1D,MAAM,CAACC,OAAO,CAAC,GAAGF,GAAG,CAACG,KAAK,CAAC,GAAG,CAAC;EAChC,IAAI,CAACF,KAAK,CAACC,OAAO,CAAC,EAAE,OAAO,EAAE;EAC9B,MAAME,OAAO,GAAGC,KAAK,CAACC,OAAO,CAACL,KAAK,CAACC,OAAO,CAAC,CAAC,GAAGD,KAAK,CAACC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAGD,KAAK,CAACC,OAAO,CAAC;EAClF,OAAOE,OAAO,IAAIA,OAAO,CAACG,GAAG,GAAGH,OAAO,CAACG,GAAG,GAAG,EAAE;AAClD,CAAC;AAED,eAAeR,yBAAyB"}
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- const _excluded = ["type", "children", "settings", "modifier", "backgroundImage", "tagType", "dataNoSnippet"];
4
+ const _excluded = ["type", "children", "settings", "modifier", "backgroundImage", "tagType", "dataNoSnippet", "sticky"];
5
5
  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; }
6
6
  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) { _defineProperty(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; }
7
7
  import React from 'react';
@@ -20,7 +20,8 @@ const Layout = React.forwardRef((_ref, ref) => {
20
20
  modifier,
21
21
  backgroundImage,
22
22
  tagType,
23
- dataNoSnippet
23
+ dataNoSnippet,
24
+ sticky
24
25
  } = _ref,
25
26
  otherProps = _objectWithoutProperties(_ref, _excluded);
26
27
  const {
@@ -37,7 +38,8 @@ const Layout = React.forwardRef((_ref, ref) => {
37
38
  title
38
39
  } = settings;
39
40
  const classModifiers = getClassModifiers(type, _objectSpread({
40
- modifier
41
+ modifier,
42
+ sticky
41
43
  }, otherProps));
42
44
  const additionalRowModifier = checkIfRowHasColumns(type, children) ? ' display-row' : '';
43
45
  if (type === COLUMN && !hasChildren(children)) return null;
@@ -55,6 +57,7 @@ const Layout = React.forwardRef((_ref, ref) => {
55
57
  });
56
58
  Layout.propTypes = {
57
59
  type: PropTypes.string.isRequired,
60
+ sticky: PropTypes.bool,
58
61
  settings: PropTypes.shape({
59
62
  title: PropTypes.string
60
63
  }),
@@ -71,7 +74,8 @@ Layout.defaultProps = {
71
74
  backgroundImage: '',
72
75
  modifier: '',
73
76
  tagType: '',
74
- dataNoSnippet: false
77
+ dataNoSnippet: false,
78
+ sticky: false
75
79
  };
76
80
  export default Layout;
77
81
  //# sourceMappingURL=Layout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Layout.js","names":["React","PropTypes","Wrapper","getClassModifiers","useGetImages","getStylesToUpdate","checkIfRowHasColumns","renderChildren","hasChildren","COLUMN","Layout","forwardRef","_ref","ref","type","children","settings","modifier","backgroundImage","tagType","dataNoSnippet","otherProps","_objectWithoutProperties","_excluded","data","getFile","url","style","title","classModifiers","_objectSpread","additionalRowModifier","otherWrapperProps","createElement","_extends","className","modifiers","propTypes","string","isRequired","shape","bool","oneOfType","arrayOf","node","defaultProps"],"sources":["../../../src/components/Layout/Layout.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Wrapper from '../Wrapper';\nimport { getClassModifiers } from '../../utils';\nimport { useGetImages } from '../../hooks';\nimport { getStylesToUpdate, checkIfRowHasColumns } from './helpers';\nimport { renderChildren, hasChildren } from '../../helpers';\nimport { COLUMN } from '../../constants';\n\nconst Layout = React.forwardRef(\n (\n { type, children, settings, modifier, backgroundImage, tagType, dataNoSnippet, ...otherProps },\n ref\n ) => {\n const {\n data: { getFile: { url = null } = {} }\n } = useGetImages(backgroundImage);\n\n const style = getStylesToUpdate({ backgroundImage: url });\n const { title } = settings;\n\n const classModifiers = getClassModifiers(type, { modifier, ...otherProps });\n const additionalRowModifier = checkIfRowHasColumns(type, children) ? ' display-row' : '';\n\n if (type === COLUMN && !hasChildren(children)) return null;\n\n const otherWrapperProps = {};\n if (dataNoSnippet) otherWrapperProps['data-nosnippet'] = true;\n\n return (\n <Wrapper\n ref={ref}\n tagType={tagType}\n className={type}\n modifiers={`${classModifiers}${additionalRowModifier}`}\n style={style}\n {...otherWrapperProps}>\n {title && <h2 className=\"heading heading--section\">{title}</h2>}\n {renderChildren(children, otherProps)}\n </Wrapper>\n );\n }\n);\n\nLayout.propTypes = {\n type: PropTypes.string.isRequired,\n settings: PropTypes.shape({\n title: PropTypes.string\n }),\n modifier: PropTypes.string,\n backgroundImage: PropTypes.string,\n tagType: PropTypes.string,\n dataNoSnippet: PropTypes.bool,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired\n};\n\nLayout.defaultProps = {\n settings: {\n title: ''\n },\n backgroundImage: '',\n modifier: '',\n tagType: '',\n dataNoSnippet: false\n};\n\nexport default Layout;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,OAAO,MAAM,YAAY;AAChC,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,YAAY,QAAQ,aAAa;AAC1C,SAASC,iBAAiB,EAAEC,oBAAoB,QAAQ,WAAW;AACnE,S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A;EAAM,GACTK,iBAAiB,GACpBJ,KAAK,iBAAI5B,KAAA,CAAAiC,aAAA;IAAIE,SAAS,EAAC;EAA0B,GAAEP,KAAU,CAAC,EAC9DrB,cAAc,CAACQ,QAAQ,EAAEM,UAAU,CAC7B,CAAC;AAEd,CACF,CAAC;AAEDX,MAAM,CAAC2B,SAAS,GAAG;EACjBvB,IAAI,EAAEb,SAAS,CAACqC,MAAM,CAACC,UAAU;EACjCvB,QAAQ,EAAEf,SAAS,CAACuC,KAAK,CAAC;IACxBZ,KAAK,EAAE3B,SAAS,CAACqC;EACnB,CAAC,CAAC;EACFrB,QAAQ,EAAEhB,SAAS,CAACqC,MAAM;EAC1BpB,eAAe,EAAEjB,SAAS,CAACqC,MAAM;EACjCnB,OAAO,EAAElB,SAAS,CAACqC,MAAM;EACzBlB,aAAa,EAAEnB,SAAS,CAACwC,IAAI;EAC7B1B,QAAQ,EAAEd,SAAS,CAACyC,SAAS,CAAC,CAACzC,SAAS,CAAC0C,OAAO,CAAC1C,SAAS,CAAC2C,IAAI,CAAC,EAAE3C,SAAS,CAAC2C,IAAI,CAAC,CAAC,CAACL;AACrF,CAAC;AAED7B,MAAM,CAACmC,YAAY,GAAG;EACpB7B,QAAQ,EAAE;IACRY,KAAK,EAAE;EACT,CAAC;EACDV,eAAe,EAAE,EAAE;EACnBD,QAAQ,EAAE,EAAE;EACZE,OAAO,EAAE,EAAE;EACXC,aAAa,EAAE;AACjB,CAAC;AAED,eAAeV,MAAM"}
1
+ {"version":3,"file":"Layout.js","names":["React","PropTypes","Wrapper","getClassModifiers","useGetImages","getStylesToUpdate","checkIfRowHasColumns","renderChildren","hasChildren","COLUMN","Layout","forwardRef","_ref","ref","type","children","settings","modifier","backgroundImage","tagType","dataNoSnippet","sticky","otherProps","_objectWithoutProperties","_excluded","data","getFile","url","style","title","classModifiers","_objectSpread","additionalRowModifier","otherWrapperProps","createElement","_extends","className","modifiers","propTypes","string","isRequired","bool","shape","oneOfType","arrayOf","node","defaultProps"],"sources":["../../../src/components/Layout/Layout.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Wrapper from '../Wrapper';\nimport { getClassModifiers } from '../../utils';\nimport { useGetImages } from '../../hooks';\nimport { getStylesToUpdate, checkIfRowHasColumns } from './helpers';\nimport { renderChildren, hasChildren } from '../../helpers';\nimport { COLUMN } from '../../constants';\n\nconst Layout = React.forwardRef(\n (\n {\n type,\n children,\n settings,\n modifier,\n backgroundImage,\n tagType,\n dataNoSnippet,\n sticky,\n ...otherProps\n },\n ref\n ) => {\n const {\n data: { getFile: { url = null } = {} }\n } = useGetImages(backgroundImage);\n\n const style = getStylesToUpdate({ backgroundImage: url });\n const { title } = settings;\n\n const classModifiers = getClassModifiers(type, { modifier, sticky, ...otherProps });\n const additionalRowModifier = checkIfRowHasColumns(type, children) ? ' display-row' : '';\n\n if (type === COLUMN && !hasChildren(children)) return null;\n\n const otherWrapperProps = {};\n if (dataNoSnippet) otherWrapperProps['data-nosnippet'] = true;\n\n return (\n <Wrapper\n ref={ref}\n tagType={tagType}\n className={type}\n modifiers={`${classModifiers}${additionalRowModifier}`}\n style={style}\n {...otherWrapperProps}>\n {title && <h2 className=\"heading heading--section\">{title}</h2>}\n {renderChildren(children, otherProps)}\n </Wrapper>\n );\n }\n);\n\nLayout.propTypes = {\n type: PropTypes.string.isRequired,\n sticky: PropTypes.bool,\n settings: PropTypes.shape({\n title: PropTypes.string\n }),\n modifier: PropTypes.string,\n backgroundImage: PropTypes.string,\n tagType: PropTypes.string,\n dataNoSnippet: PropTypes.bool,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired\n};\n\nLayout.defaultProps = {\n settings: {\n title: ''\n },\n backgroundImage: '',\n modifier: '',\n tagType: '',\n dataNoSnippet: false,\n sticky: false\n};\n\nexport default Layout;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OA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in-updates.1",
3
+ "version": "0.132.0-alpha.0",
4
4
  "description": "Blaze react page builder",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-es/index.js",
@@ -27,15 +27,15 @@
27
27
  },
28
28
  "license": "GPL-3.0",
29
29
  "dependencies": {
30
- "@blaze-cms/core-auth-ui": "0.132.0-admin-updates.0",
31
- "@blaze-cms/core-errors": "0.132.0-admin-updates.0",
32
- "@blaze-cms/core-errors-ui": "0.132.0-admin-updates.0",
30
+ "@blaze-cms/core-auth-ui": "^0.131.0",
31
+ "@blaze-cms/core-errors": "^0.131.0",
32
+ "@blaze-cms/core-errors-ui": "^0.131.0",
33
33
  "@blaze-cms/image-cdn-react": "0.3.0-alpha.5",
34
- "@blaze-cms/nextjs-components": "0.132.0-admin-updates.0",
35
- "@blaze-cms/plugin-search-ui": "0.132.0-admin-updates.1",
36
- "@blaze-cms/setup-ui": "0.132.0-admin-updates.0",
37
- "@blaze-cms/utils": "0.132.0-admin-updates.0",
38
- "@blaze-cms/utils-handlebars": "0.132.0-admin-updates.0",
34
+ "@blaze-cms/nextjs-components": "^0.131.0",
35
+ "@blaze-cms/plugin-search-ui": "0.132.0-alpha.0",
36
+ "@blaze-cms/setup-ui": "^0.131.0",
37
+ "@blaze-cms/utils": "^0.131.0",
38
+ "@blaze-cms/utils-handlebars": "^0.131.0",
39
39
  "@blaze-react/breadcrumb": "0.8.0-alpha.60",
40
40
  "@blaze-react/button": "0.5.19",
41
41
  "@blaze-react/checkboxes": "0.5.31",
@@ -89,5 +89,5 @@
89
89
  "lib/*",
90
90
  "lib-es/*"
91
91
  ],
92
- "gitHead": "7d0cac53177294b81aa22198200b9236bd922306"
92
+ "gitHead": "5ff34c278c267dac8183650ad896302040bb109c"
93
93
  }
@@ -45,12 +45,11 @@ const buildLoopPropsContent = (loopProps = [], propsToDisplay = [], limit = 0, d
45
45
 
46
46
  return propertiesToDisplay.map(key => {
47
47
  const loopValue = loopValues[key];
48
- const loopValueItem = loopValue && loopValue[i];
49
- const propValue = loopValueItem ? getLoopValue(loopValueItem) : regularValues[key];
48
+ const propValue = loopValue ? getLoopValue(loopValue[i]) : regularValues[key];
50
49
  if (!propValue) return null;
51
50
 
52
51
  const processedValue = processDataSummaryValue(propValue, options);
53
- const linkToPublishedContent = getLinkToPublishedContent(key, data, loopValueItem);
52
+ const linkToPublishedContent = getLinkToPublishedContent(key, data);
54
53
  return [upperFirst(label), processedValue, linkToPublishedContent, modifier];
55
54
  });
56
55
  })
@@ -1,9 +1,6 @@
1
- const getLinkToPublishedContent = (key = '', props = {}, currentValue = null) => {
1
+ const getLinkToPublishedContent = (key = '', props = {}) => {
2
2
  const [baseKey] = key.split('.');
3
3
  if (!props[baseKey]) return '';
4
-
5
- if (currentValue && typeof currentValue.url !== 'undefined') return currentValue.url;
6
-
7
4
  const content = Array.isArray(props[baseKey]) ? props[baseKey][0] : props[baseKey];
8
5
  return content && content.url ? content.url : '';
9
6
  };
@@ -9,7 +9,17 @@ import { COLUMN } from '../../constants';
9
9
 
10
10
  const Layout = React.forwardRef(
11
11
  (
12
- { type, children, settings, modifier, backgroundImage, tagType, dataNoSnippet, ...otherProps },
12
+ {
13
+ type,
14
+ children,
15
+ settings,
16
+ modifier,
17
+ backgroundImage,
18
+ tagType,
19
+ dataNoSnippet,
20
+ sticky,
21
+ ...otherProps
22
+ },
13
23
  ref
14
24
  ) => {
15
25
  const {
@@ -19,7 +29,7 @@ const Layout = React.forwardRef(
19
29
  const style = getStylesToUpdate({ backgroundImage: url });
20
30
  const { title } = settings;
21
31
 
22
- const classModifiers = getClassModifiers(type, { modifier, ...otherProps });
32
+ const classModifiers = getClassModifiers(type, { modifier, sticky, ...otherProps });
23
33
  const additionalRowModifier = checkIfRowHasColumns(type, children) ? ' display-row' : '';
24
34
 
25
35
  if (type === COLUMN && !hasChildren(children)) return null;
@@ -44,6 +54,7 @@ const Layout = React.forwardRef(
44
54
 
45
55
  Layout.propTypes = {
46
56
  type: PropTypes.string.isRequired,
57
+ sticky: PropTypes.bool,
47
58
  settings: PropTypes.shape({
48
59
  title: PropTypes.string
49
60
  }),
@@ -61,7 +72,8 @@ Layout.defaultProps = {
61
72
  backgroundImage: '',
62
73
  modifier: '',
63
74
  tagType: '',
64
- dataNoSnippet: false
75
+ dataNoSnippet: false,
76
+ sticky: false
65
77
  };
66
78
 
67
79
  export default Layout;
@@ -90,45 +90,4 @@ describe('buildLoopPropsContent helper function', () => {
90
90
  });
91
91
  expect.hasAssertions();
92
92
  });
93
-
94
- it('should nested items with urls', () => {
95
- const data = {
96
- nestedLoopProp: [
97
- {
98
- nestedValue: 'abc',
99
- url: 'http://blazecms.app/abc'
100
- },
101
- {
102
- nestedValue: '123',
103
- url: 'http://blazecms.app/123'
104
- },
105
- {
106
- nestedValue: 'no url',
107
- url: null
108
- }
109
- ]
110
- };
111
- const withUrl = buildLoopPropsContent(
112
- mockedLoopProps,
113
- [
114
- {
115
- bold: false,
116
- enableLink: true,
117
- label: '',
118
- modifier: '',
119
- prefix: '',
120
- propertiesToDisplay: ['nestedLoopProp.nestedValue'],
121
- shouldStrip: true
122
- }
123
- ],
124
- 0,
125
- data
126
- );
127
-
128
- withUrl.forEach(([, value, url], index) => {
129
- expect(value).toEqual(data.nestedLoopProp[index].nestedValue);
130
- expect(url).toEqual(data.nestedLoopProp[index].url || '');
131
- });
132
- expect.hasAssertions();
133
- });
134
93
  });
@@ -38,25 +38,4 @@ describe('get link to published content', () => {
38
38
  const result = getLinkToPublishedContent(publishedKey, props);
39
39
  expect(result).toEqual('');
40
40
  });
41
-
42
- it('should return url from the currentValue', () => {
43
- const currentValue = { url: 'currentValueUrl' };
44
- const props = { content: [content] };
45
- const result = getLinkToPublishedContent(publishedKey, props, currentValue);
46
- expect(result).toEqual(currentValue.url);
47
- });
48
-
49
- it('should return url from the currentValue even if falsey', () => {
50
- const currentValue = { url: null };
51
- const props = { content: [content] };
52
- const result = getLinkToPublishedContent(publishedKey, props, currentValue);
53
- expect(result).toEqual(currentValue.url);
54
- });
55
-
56
- it('should not return url from the currentValue if not set', () => {
57
- const currentValue = {};
58
- const props = { content: [content] };
59
- const result = getLinkToPublishedContent(publishedKey, props, currentValue);
60
- expect(result).toEqual(content.url);
61
- });
62
41
  });
@@ -1,72 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`Placeholder component should render PlaceholderIcon 1`] = `
4
- <DocumentFragment>
5
- <div
6
- class="editor-view__placeholder"
7
- data-testid="placeholder-icon"
8
- >
9
- <svg
10
- height="25px"
11
- version="1.1"
12
- viewBox="0 0 16 16"
13
- width="25px"
14
- xmlns="http://www.w3.org/2000/svg"
15
- >
16
- <title>
17
- card
18
- </title>
19
- <g
20
- fill="none"
21
- fill-rule="evenodd"
22
- id="Icons"
23
- stroke="none"
24
- stroke-width="1"
25
- >
26
- <g
27
- id="card"
28
- transform="translate(-261.000000, -216.000000)"
29
- >
30
- <g
31
- transform="translate(261.000000, 216.000000)"
32
- >
33
- <path
34
- d="M15,1 L15,9.53124644 L14.998,9.531 L14.9986024,7.67959976 L11.4210663,4.62547112 L7.4590683,8.08893259 C7.08560181,8.77082265 6.07591438,8.77082265 5.51715851,8.27688661 L3.50145721,6.5 L1,8.77 L1,7.323 L2.58011188,5.9054667 C3.10161735,5.44445974 3.91799869,5.41372594 4.47882094,5.81326531 L4.59488493,5.9054667 L6.4402744,7.56106172 L10.4252459,3.98593625 C10.9840017,3.49200022 11.8812631,3.49200022 12.4400189,3.98593625 L14.9986024,6.28137475 L14.998,1 Z M6.14778213,2.60821539 C6.69719001,2.60821539 7.14257312,3.0379169 7.14257312,3.56798059 C7.14257312,4.09804429 6.69719002,4.52774581 6.14778213,4.52774581 C5.88422964,4.52580316 5.6316942,4.42547921 5.44313851,4.24781429 C5.25594548,4.06784498 5.15142164,3.82293899 5.15297371,3.56798059 C5.15297371,3.0379169 5.59837425,2.60821539 6.14778213,2.60821539 Z"
35
- fill="#63779C"
36
- fill-rule="nonzero"
37
- id="Combined-Shape"
38
- />
39
- <path
40
- d="M3,13 C3,12.7238576 3.22385763,12.5 3.5,12.5 L12.5,12.5 C12.7761424,12.5 13,12.7238576 13,13 C13,13.2761424 12.7761424,13.5 12.5,13.5 L3.5,13.5 C3.22385763,13.5 3,13.2761424 3,13 Z"
41
- fill="#899BBC"
42
- fill-rule="nonzero"
43
- id="Shape"
44
- />
45
- <rect
46
- height="15"
47
- id="Rectangle"
48
- rx="2"
49
- stroke="#899BBC"
50
- width="15"
51
- x="0.5"
52
- y="0.5"
53
- />
54
- <line
55
- id="Line-2"
56
- stroke="#63779C"
57
- stroke-linecap="square"
58
- x1="0.5"
59
- x2="15.5"
60
- y1="10.5"
61
- y2="10.5"
62
- />
63
- </g>
64
- </g>
65
- </g>
66
- </svg>
67
- <span>
68
- card
69
- </span>
70
- </div>
71
- </DocumentFragment>
72
- `;
@@ -1,20 +0,0 @@
1
- /**
2
- * @jest-environment jsdom
3
- */
4
- import { render } from '@blaze-cms/tools/test-helpers/test-functions';
5
-
6
- import PlaceholderIcon from '../../../../../../blaze-plugin-page-builder-ui/src/components/EditorView/PlaceholderIcon';
7
- import { CardIcon } from '../../../../../../blaze-plugin-page-builder-ui/src/components/EditorView/Icons';
8
-
9
- const mockedProps = {
10
- type: 'card',
11
- icon: CardIcon
12
- };
13
-
14
- describe('Placeholder component', () => {
15
- it('should render PlaceholderIcon', () => {
16
- const { asFragment, getByTestId } = render(PlaceholderIcon, mockedProps);
17
- expect(getByTestId('placeholder-icon')).toBeDefined();
18
- expect(asFragment()).toMatchSnapshot();
19
- });
20
- });