@blaze-cms/react-page-builder 0.132.0-admin-updates.2 → 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.
package/CHANGELOG.md CHANGED
@@ -3,18 +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.2](https://github.com/thebyte9/blaze/compare/v0.132.0-admin-updates.1...v0.132.0-admin-updates.2) (2023-08-11)
7
-
8
-
9
- ### Bug Fixes
10
-
11
- * deconstruct sticky from children ([e2ad5f2](https://github.com/thebyte9/blaze/commit/e2ad5f245a300e8a38fd6256daa01dcff4c3e29c))
12
-
13
-
14
-
15
-
16
-
17
- # [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)
18
7
 
19
8
 
20
9
  ### Bug Fixes
@@ -25,6 +14,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
25
14
  * added logout handling for button ([#3983](https://github.com/thebyte9/blaze/issues/3983)) ([54ecb64](https://github.com/thebyte9/blaze/commit/54ecb64eb2e36ffe7e8dacb39a20a6a06487ba5e))
26
15
  * carousel - set min width to the content ([6d0dd8f](https://github.com/thebyte9/blaze/commit/6d0dd8fdd0381fa69c5b7a7084cc2960927d38a1))
27
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))
28
18
  * hash bits now persists through filter changes ([#3965](https://github.com/thebyte9/blaze/issues/3965)) ([30595ef](https://github.com/thebyte9/blaze/commit/30595ef155783e78adc4f153230dccb33556e2f8))
29
19
  * hash bits now persists through filter changes ([#3965](https://github.com/thebyte9/blaze/issues/3965)) ([a8700c6](https://github.com/thebyte9/blaze/commit/a8700c63715f864a1178630d810216c274484b97))
30
20
  * hlist component andle when no search filter ([#3982](https://github.com/thebyte9/blaze/issues/3982)) ([e3a502c](https://github.com/thebyte9/blaze/commit/e3a502ca5b6b4f9028072e0b2fe19630a240b840))
@@ -48,77 +38,25 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
48
38
 
49
39
 
50
40
 
51
- # [0.132.0-admin-updates.0](https://github.com/thebyte9/blaze/compare/v0.131.0...v0.132.0-admin-updates.0) (2023-07-27)
52
-
53
41
 
54
- ### Bug Fixes
55
42
 
56
- * add collapse property to searchContent ([#3964](https://github.com/thebyte9/blaze/issues/3964)) ([3703a29](https://github.com/thebyte9/blaze/commit/3703a29d9a838f857863430d9223025900f29880))
57
- * add collapse property to searchContent ([#3964](https://github.com/thebyte9/blaze/issues/3964)) ([d133a19](https://github.com/thebyte9/blaze/commit/d133a1965fdb447824dfdb87566809d7597a24b2))
58
- * add second render ([488b2b6](https://github.com/thebyte9/blaze/commit/488b2b65b437db9beff90eaf38f6a8d2dc30f3a9))
59
- * added logout handling for button ([#3983](https://github.com/thebyte9/blaze/issues/3983)) ([f634575](https://github.com/thebyte9/blaze/commit/f634575cd6865dbc23391634c177efe4826d44c6))
60
- * added logout handling for button ([#3983](https://github.com/thebyte9/blaze/issues/3983)) ([1940547](https://github.com/thebyte9/blaze/commit/19405477315238fe8b14c974645675ec285ee85a))
61
- * carousel - set min width to the content ([7313a94](https://github.com/thebyte9/blaze/commit/7313a947d816716c607afaed6eaa61c3f26b0e89))
62
- * handle data summary urls in loops correctly ([#3993](https://github.com/thebyte9/blaze/issues/3993)) ([008e1a1](https://github.com/thebyte9/blaze/commit/008e1a1f24f065b4060302c2c32d1aa32dd8a007))
63
- * hash bits now persists through filter changes ([#3965](https://github.com/thebyte9/blaze/issues/3965)) ([e0c37fc](https://github.com/thebyte9/blaze/commit/e0c37fcff2479f531f2f337b4e98b4edf57b4795))
64
- * hash bits now persists through filter changes ([#3965](https://github.com/thebyte9/blaze/issues/3965)) ([04e4cb3](https://github.com/thebyte9/blaze/commit/04e4cb380520ea7c9b20860bf9cb4ea2facd27ad))
65
- * hlist component andle when no search filter ([#3982](https://github.com/thebyte9/blaze/issues/3982)) ([268eddc](https://github.com/thebyte9/blaze/commit/268eddcc71d42b3d63770554684bf79a5f163b7e))
66
- * hlist component andle when no search filter ([#3982](https://github.com/thebyte9/blaze/issues/3982)) ([e9e1a6d](https://github.com/thebyte9/blaze/commit/e9e1a6da969d9afc5f9ddaffcb7bf2238c84d898))
67
- * improve animation ([b9111b5](https://github.com/thebyte9/blaze/commit/b9111b59f9f297f5b4701bf5c42b0acd718d9985))
68
- * remove log ([9eac18f](https://github.com/thebyte9/blaze/commit/9eac18fa06744a11d8e57d5b4a1d58f488ada931))
69
- * reset search filters and handle single text property ([#3996](https://github.com/thebyte9/blaze/issues/3996)) ([0160414](https://github.com/thebyte9/blaze/commit/016041454d30cc4cfc0a4c8e2d484fcedc2a631c))
70
- * 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)
71
44
 
72
45
 
73
- ### Features
46
+ ### Bug Fixes
74
47
 
75
- * 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))
76
- * 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))
77
- * add sticky setting to column and row ([#3988](https://github.com/thebyte9/blaze/issues/3988)) ([1d1a219](https://github.com/thebyte9/blaze/commit/1d1a21901b23fe184e1eadf2bbb49551dd5f9b33))
78
- * 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))
79
- * 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))
80
- * 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))
81
- * 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))
82
- * 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))
83
- * 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))
84
49
 
85
50
 
86
51
 
87
52
 
88
53
 
89
- # [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)
90
55
 
91
56
 
92
57
  ### Bug Fixes
93
58
 
94
- * add collapse property to searchContent ([#3964](https://github.com/thebyte9/blaze/issues/3964)) ([3703a29](https://github.com/thebyte9/blaze/commit/3703a29d9a838f857863430d9223025900f29880))
95
- * add collapse property to searchContent ([#3964](https://github.com/thebyte9/blaze/issues/3964)) ([d133a19](https://github.com/thebyte9/blaze/commit/d133a1965fdb447824dfdb87566809d7597a24b2))
96
- * add second render ([488b2b6](https://github.com/thebyte9/blaze/commit/488b2b65b437db9beff90eaf38f6a8d2dc30f3a9))
97
- * added logout handling for button ([#3983](https://github.com/thebyte9/blaze/issues/3983)) ([f634575](https://github.com/thebyte9/blaze/commit/f634575cd6865dbc23391634c177efe4826d44c6))
98
- * added logout handling for button ([#3983](https://github.com/thebyte9/blaze/issues/3983)) ([1940547](https://github.com/thebyte9/blaze/commit/19405477315238fe8b14c974645675ec285ee85a))
99
- * carousel - set min width to the content ([7313a94](https://github.com/thebyte9/blaze/commit/7313a947d816716c607afaed6eaa61c3f26b0e89))
100
- * handle data summary urls in loops correctly ([#3993](https://github.com/thebyte9/blaze/issues/3993)) ([008e1a1](https://github.com/thebyte9/blaze/commit/008e1a1f24f065b4060302c2c32d1aa32dd8a007))
101
- * hash bits now persists through filter changes ([#3965](https://github.com/thebyte9/blaze/issues/3965)) ([e0c37fc](https://github.com/thebyte9/blaze/commit/e0c37fcff2479f531f2f337b4e98b4edf57b4795))
102
- * hash bits now persists through filter changes ([#3965](https://github.com/thebyte9/blaze/issues/3965)) ([04e4cb3](https://github.com/thebyte9/blaze/commit/04e4cb380520ea7c9b20860bf9cb4ea2facd27ad))
103
- * hlist component andle when no search filter ([#3982](https://github.com/thebyte9/blaze/issues/3982)) ([268eddc](https://github.com/thebyte9/blaze/commit/268eddcc71d42b3d63770554684bf79a5f163b7e))
104
- * hlist component andle when no search filter ([#3982](https://github.com/thebyte9/blaze/issues/3982)) ([e9e1a6d](https://github.com/thebyte9/blaze/commit/e9e1a6da969d9afc5f9ddaffcb7bf2238c84d898))
105
- * improve animation ([b9111b5](https://github.com/thebyte9/blaze/commit/b9111b59f9f297f5b4701bf5c42b0acd718d9985))
106
- * remove log ([9eac18f](https://github.com/thebyte9/blaze/commit/9eac18fa06744a11d8e57d5b4a1d58f488ada931))
107
- * reset search filters and handle single text property ([#3996](https://github.com/thebyte9/blaze/issues/3996)) ([0160414](https://github.com/thebyte9/blaze/commit/016041454d30cc4cfc0a4c8e2d484fcedc2a631c))
108
- * set width to carousel container ([d8f3ffb](https://github.com/thebyte9/blaze/commit/d8f3ffbdd22df47dcac88446828c2af5ac0f3318))
109
-
110
-
111
- ### Features
112
-
113
- * 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))
114
- * 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))
115
- * add sticky setting to column and row ([#3988](https://github.com/thebyte9/blaze/issues/3988)) ([1d1a219](https://github.com/thebyte9/blaze/commit/1d1a21901b23fe184e1eadf2bbb49551dd5f9b33))
116
- * 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))
117
- * 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))
118
- * 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))
119
- * 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))
120
- * 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))
121
- * 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))
122
60
 
123
61
 
124
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":";;;;;;;;;;;;;;;;;AAA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,IAAIA,SAAS,CAACR,CAAC,CAAC;QAC/C,IAAMU,SAAS,GAAGD,aAAa,GAAGxC,YAAY,CAACwC,aAAa,CAAC,GAAGjC,aAAa,CAAC+B,GAAG,CAAC;QAClF,IAAI,CAACG,SAAS,EAAE,OAAO,IAAI;QAE3B,IAAMC,cAAc,GAAG,IAAAC,gCAAuB,EAACF,SAAS,EAAE/B,OAAO,CAAC;QAClE,IAAMkC,sBAAsB,GAAG,IAAAC,qCAAyB,EAACP,GAAG,EAAEhC,IAAI,EAAEkC,aAAa,CAAC;QAClF,OAAO,CAAC,IAAAM,kBAAU,EAACX,KAAK,CAAC,EAAEO,cAAc,EAAEE,sBAAsB,EAAEP,QAAQ,CAAC;MAC9E,CAAC,CAAC;IACJ,CAAC,CACH,CAAC,CAACU,MAAM,CAACC,OAAO,CAAC;IACjBxB,oBAAoB,CAACyB,IAAI,CAACjB,UAAU,CAAC;EACvC,CAAC;EAlBD,KAAK,IAAID,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,GA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Aa,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"}
@@ -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"}
@@ -44,11 +44,10 @@ const buildLoopPropsContent = (loopProps = [], propsToDisplay = [], limit = 0, d
44
44
  } = options;
45
45
  return propertiesToDisplay.map(key => {
46
46
  const loopValue = loopValues[key];
47
- const loopValueItem = loopValue && loopValue[i];
48
- const propValue = loopValueItem ? getLoopValue(loopValueItem) : regularValues[key];
47
+ const propValue = loopValue ? getLoopValue(loopValue[i]) : regularValues[key];
49
48
  if (!propValue) return null;
50
49
  const processedValue = processDataSummaryValue(propValue, options);
51
- const linkToPublishedContent = getLinkToPublishedContent(key, data, loopValueItem);
50
+ const linkToPublishedContent = getLinkToPublishedContent(key, data);
52
51
  return [upperFirst(label), processedValue, linkToPublishedContent, modifier];
53
52
  });
54
53
  })).filter(Boolean);
@@ -1 +1 @@
1
- {"version":3,"file":"build-loop-props-content.js","names":["upperFirst","flatten","getLinkToPublishedContent","getLoopPropsLimit","getPropValue","processDataSummaryValue","getLoopValue","value","keyField","separateValues","propsToDisplay","loopProps","data","regularValues","loopValues","forEach","options","propertiesToDisplay","prop","isArrayValue","Array","isArray","isLoopableProp","includes","buildLoopPropsContent","limit","loopPropsWithContent","loopLimit","i","propsArray","map","label","modifier","key","loopValue","loopValueItem","propValue","processedValue","linkToPublishedContent","filter","Boolean","push"],"sources":["../../../../src/components/DataSummary/helpers/build-loop-props-content.js"],"sourcesContent":["import upperFirst from 'lodash.upperfirst';\nimport flatten from 'lodash.flatten';\nimport getLinkToPublishedContent from './get-link-to-published-content';\nimport getLoopPropsLimit from './get-loop-props-limit';\nimport getPropValue from './get-prop-value';\nimport { processDataSummaryValue } from '../../../helpers';\n\nconst getLoopValue = value => {\n const { keyField } = value;\n return value[keyField];\n};\n\nconst separateValues = (propsToDisplay, loopProps, data) => {\n const regularValues = {};\n const loopValues = {};\n\n propsToDisplay.forEach(options => {\n const { propertiesToDisplay } = options;\n propertiesToDisplay.forEach(prop => {\n const value = getPropValue(prop, data, options);\n const isArrayValue = Array.isArray(value);\n if (!value) return;\n const isLoopableProp = loopProps.includes(prop) && isArrayValue;\n\n if (isLoopableProp) {\n loopValues[prop] = value;\n } else {\n regularValues[prop] = value;\n }\n });\n });\n return [regularValues, loopValues];\n};\n\nconst buildLoopPropsContent = (loopProps = [], propsToDisplay = [], limit = 0, data = {}) => {\n const loopPropsWithContent = [];\n const [regularValues, loopValues] = separateValues(propsToDisplay, loopProps, data);\n\n const loopLimit = getLoopPropsLimit(loopValues, limit);\n\n for (let i = 0; i < loopLimit; i += 1) {\n const propsArray = flatten(\n propsToDisplay.map(options => {\n const { propertiesToDisplay, label, modifier = '' } = options;\n\n return propertiesToDisplay.map(key => {\n const loopValue = loopValues[key];\n const loopValueItem = loopValue && loopValue[i];\n const propValue = loopValueItem ? getLoopValue(loopValueItem) : regularValues[key];\n if (!propValue) return null;\n\n const processedValue = processDataSummaryValue(propValue, options);\n const linkToPublishedContent = getLinkToPublishedContent(key, data, loopValueItem);\n return [upperFirst(label), processedValue, linkToPublishedContent, modifier];\n });\n })\n ).filter(Boolean);\n loopPropsWithContent.push(propsArray);\n }\n\n return flatten(loopPropsWithContent);\n};\n\nexport default buildLoopPropsContent;\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,mBAAmB;AAC1C,OAAOC,OAAO,MAAM,gBAAgB;AACpC,OAAOC,yBAAyB,MAAM,iCAAiC;AACvE,OAAOC,iBAAiB,MAAM,wBAAwB;AACtD,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,SAASC,uBAAuB,QAAQ,kBAAkB;AAE1D,MAAMC,YAAY,GAAGC,KAAK,IAAI;EAC5B,MAAM;IAAEC;EAAS,CAAC,GAAGD,KAAK;EAC1B,OAAOA,KAAK,CAACC,QAAQ,CAAC;AACxB,CAAC;AAED,MAAMC,cAAc,GAAGA,CAACC,cAAc,EAAEC,SAAS,EAAEC,IAAI,KAAK;EAC1D,MAAMC,aAAa,GAAG,CAAC,CAAC;EACxB,MAAMC,UAAU,GAAG,CAAC,CAAC;EA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,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,MAAM;IAAEC;EAAS,CAAC,GA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AAEC,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaze-cms/react-page-builder",
3
- "version": "0.132.0-admin-updates.2",
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": "0d7923777d1ae01be3231ca8e6935ec3698eca07"
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
  };
@@ -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
- });