@blaze-cms/react-page-builder 0.130.0-admin-updates.6 → 0.130.0-admin-updates.8

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,6 +3,17 @@
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.130.0-admin-updates.8](https://github.com/thebyte9/blaze/compare/v0.130.0-admin-updates.7...v0.130.0-admin-updates.8) (2023-06-29)
7
+
8
+
9
+ ### Features
10
+
11
+ * enableLink in data summary now works with neste objects ([#3974](https://github.com/thebyte9/blaze/issues/3974)) ([e1442ac](https://github.com/thebyte9/blaze/commit/e1442acfa141f6d7d4c5d7e0366e531410ff4f7c))
12
+
13
+
14
+
15
+
16
+
6
17
  # [0.130.0-admin-updates.6](https://github.com/thebyte9/blaze/compare/v0.130.0-admin-updates.5...v0.130.0-admin-updates.6) (2023-06-27)
7
18
 
8
19
 
@@ -66,12 +66,15 @@ var buildComplexProps = function buildComplexProps(shouldAddCategoryProps, props
66
66
  var _ref$relations = _ref.relations,
67
67
  relations = _ref$relations === void 0 ? [] : _ref$relations,
68
68
  _ref$dynamicPropertie = _ref.dynamicProperties,
69
- dynamicProperties = _ref$dynamicPropertie === void 0 ? {} : _ref$dynamicPropertie;
69
+ dynamicProperties = _ref$dynamicPropertie === void 0 ? {} : _ref$dynamicPropertie,
70
+ _ref$properties = _ref.properties,
71
+ properties = _ref$properties === void 0 ? {} : _ref$properties;
70
72
  return Object.keys(props).map(function (base) {
71
73
  var nestedProps = props[base];
72
74
  var hasLink = !!linkProps.find(function (linkProp) {
73
75
  return linkProp.includes(base);
74
76
  });
77
+ var matchingProperty = !!properties[base];
75
78
  var matchingRelation = relations.find(function (_ref2) {
76
79
  var localField = _ref2.localField;
77
80
  return localField === base;
@@ -80,7 +83,7 @@ var buildComplexProps = function buildComplexProps(shouldAddCategoryProps, props
80
83
  return dynamicKey === base;
81
84
  });
82
85
  if (matchingRelation && !nestedProps.includes('id')) nestedProps.push('id');
83
- if (hasLink && (!!matchingRelation || !!matchingDynamicProp)) nestedProps.push('url');
86
+ if (hasLink && (!!matchingProperty || !!matchingRelation || !!matchingDynamicProp)) nestedProps.push('url');
84
87
  var jointNestedProps = nestedProps.join(',');
85
88
  if (base === 'category' && shouldAddCategoryProps) return "".concat(base, "{").concat(jointNestedProps, ", ").concat(categoryProps, "}");
86
89
  if (base.includes('published')) {
@@ -1 +1 @@
1
- {"version":3,"file":"build-props-query.js","names":["_constants","require","defaultProps","ID","categoryProps","checkProps","props","Object","keys","filter","prop","CATEGORY_ID","length","buildPropsQuery","entitySchema","extraProps","arguments","undefined","cardOptions","linkProps","parsedSchema","getEntitySchema","extraPropsHaveCategory","includes","_getTypeBaseProps","getTypeBaseProps","typeBasedProps","shouldAddCategoryProps","allProps","concat","_toConsumableArray2","uniqueProps","Set","basicProps","nestedProps","forEach","push","_prop$split","split","_prop$split2","_slicedToArray2","base","nested","complexProps","buildComplexProps","join","_ref","_ref$relations","relations","_ref$dynamicPropertie","dynamicProperties","map","hasLink","find","linkProp","matchingRelation","_ref2","localField","matchingDynamicProp","dynamicKey","jointNestedProps","isCard","_ref3","_ref3$displayCategory","displayCategory","_ref3$displayThumbnai","displayThumbnail","interfaces","properties","isContent","hasCategory","hasPreheader","PREHEADER_PROP","apply","getCategoyProps","getContentProps","url","_ref4","HEADLINE_PROP","_default","exports"],"sources":["../../src/helpers/build-props-query.js"],"sourcesContent":["import { CATEGORY_ID, ID, PREHEADER_PROP, HEADLINE_PROP } from '../constants';\n\nconst defaultProps = [ID, 'name'];\nconst categoryProps = 'id publishedListingPage{id, url}';\n\nconst checkProps = props =>\n !!(props && Object.keys(props).filter(prop => prop === CATEGORY_ID).length);\n\nconst buildPropsQuery = (entitySchema, extraProps = [], cardOptions = null, linkProps = []) => {\n const parsedSchema = entitySchema.getEntitySchema ? entitySchema.getEntitySchema : entitySchema;\n const extraPropsHaveCategory = !!extraProps.filter(prop => prop.includes('category.')).length;\n const { typeBasedProps, shouldAddCategoryProps } = getTypeBaseProps(\n parsedSchema,\n cardOptions,\n extraPropsHaveCategory\n );\n\n const allProps = [...typeBasedProps, ...extraProps];\n const uniqueProps = [...new Set([...allProps])];\n const basicProps = [];\n const nestedProps = {};\n uniqueProps.forEach(prop => {\n if (prop) {\n if (!prop.includes('.')) {\n basicProps.push(prop);\n return;\n }\n const [base, nested] = prop.split('.');\n if (!nestedProps[base]) nestedProps[base] = [nested];\n else nestedProps[base].push(nested);\n }\n });\n\n const complexProps = buildComplexProps(\n shouldAddCategoryProps,\n nestedProps,\n parsedSchema,\n linkProps\n );\n\n return [...basicProps, ...complexProps].join(',');\n};\n\nconst buildComplexProps = (\n shouldAddCategoryProps,\n props,\n { relations = [], dynamicProperties = {} },\n linkProps\n) =>\n Object.keys(props).map(base => {\n const nestedProps = props[base];\n const hasLink = !!linkProps.find(linkProp => linkProp.includes(base));\n const matchingRelation = relations.find(({ localField }) => localField === base);\n const matchingDynamicProp = Object.keys(dynamicProperties).find(\n dynamicKey => dynamicKey === base\n );\n\n if (matchingRelation && !nestedProps.includes('id')) nestedProps.push('id');\n if (hasLink && (!!matchingRelation || !!matchingDynamicProp)) nestedProps.push('url');\n const jointNestedProps = nestedProps.join(',');\n if (base === 'category' && shouldAddCategoryProps)\n return `${base}{${jointNestedProps}, ${categoryProps}}`;\n if (base.includes('published')) {\n return `${base}{${jointNestedProps},url}`;\n }\n return `${base}{${jointNestedProps}}`;\n });\n\nconst getTypeBaseProps = (entitySchema, cardOptions, extraPropsHaveCategory) => {\n const isCard = !!cardOptions;\n const { displayCategory = true, displayThumbnail = true } = cardOptions || {};\n\n const shouldAddCategoryProps =\n (isCard && displayCategory) || (!isCard && !extraPropsHaveCategory);\n\n if (!isCard) return { typeBasedProps: [ID], shouldAddCategoryProps };\n\n const { interfaces, properties, dynamicProperties, relations } = entitySchema;\n\n const isContent = !!interfaces.includes('content/content');\n const hasCategory = checkProps(properties) || checkProps(dynamicProperties);\n const hasPreheader = properties[PREHEADER_PROP];\n\n const typeBasedProps = [...defaultProps];\n\n typeBasedProps.push(...getCategoyProps(shouldAddCategoryProps, hasCategory, hasPreheader));\n typeBasedProps.push(...getContentProps(isContent));\n\n if (properties.url || dynamicProperties.url) typeBasedProps.push('url');\n\n if (displayThumbnail && relations.find(({ localField }) => localField === 'image')) {\n typeBasedProps.push('image.id', 'image.url', 'image.data');\n }\n\n return { typeBasedProps, shouldAddCategoryProps };\n};\n\nconst getContentProps = isContent => (isContent ? ['url', 'sponsored', 'featured'] : []);\n\nconst getCategoyProps = (shouldAddCategoryProps, hasCategory, hasPreheader) => {\n if (!shouldAddCategoryProps) return [];\n const props = [];\n if (hasCategory)\n props.push('category.name', 'category.listingPageId', 'category.listingPageEntity');\n\n if (hasPreheader) {\n props.push(`${PREHEADER_PROP}{name}`);\n props.push(HEADLINE_PROP);\n }\n\n return props;\n};\n\nexport default buildPropsQuery;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAMC,YAAY,GAAG,CAACC,aAAE,EAAE,MAAM,CAAC;AACjC,IAAMC,aAAa,GAAG,kCAAkC;AAExD,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAGC,KAAK;EAAA,OACtB,CAAC,EAAEA,KAAK,IAAIC,MAAM,CAACC,IAAI,CAACF,KAAK,CAAC,CAACG,MAAM,CAAC,UAAAC,IAAI;IAAA,OAAIA,IAAI,KAAKC,sBAAW;EAAA,EAAC,CAACC,MAAM,CAAC;AAAA;AAE7E,IAAMC,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,YAAY,EAA0D;EAAA,IAAxDC,UAAU,GAAAC,SAAA,CAAAJ,MAAA,QAAAI,SAAA,QAAAC,SAAA,GAAAD,SAAA,MAAG,EAAE;EAAA,IAAEE,WAAW,GAAAF,SAAA,CAAAJ,MAAA,QAAAI,SA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GAAG,SAAlBA,eAAeA,CAAGN,SAAS;EAAA,OAAKA,SAAS,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE;AAAA,CAAC;AAExF,IAAMK,eAAe,GAAG,SAAlBA,eAAeA,CAAI/C,sBAAsB,EAAE2C,WAAW,EAAEC,YAAY,EAAK;EAC7E,IAAI,CAAC5C,sBAAsB,EAAE,OAAO,EAAE;EACtC,IAAMrB,KAAK,GAAG,EAAE;EAChB,IAAIgE,WAAW,EACbhE,KAAK,CAAC8B,IAAI,CAAC,eAAe,EAAE,wBAAwB,EAAE,4BAA4B,CAAC;EAErF,IAAImC,YAAY,EAAE;IAChBjE,KAAK,CAAC8B,IAAI,IAAAP,MAAA,CAAI2C,yBAAc,WAAQ,CAAC;IACrClE,KAAK,CAAC8B,IAAI,CAAC0C,wBAAa,CAAC;EAC3B;EAEA,OAAOxE,KAAK;AACd,CAAC;AAAC,IAAAyE,QAAA,GAEalE,eAAe;AAAAmE,OAAA,cAAAD,QAAA"}
1
+ {"version":3,"file":"build-props-query.js","names":["_constants","require","defaultProps","ID","categoryProps","checkProps","props","Object","keys","filter","prop","CATEGORY_ID","length","buildPropsQuery","entitySchema","extraProps","arguments","undefined","cardOptions","linkProps","parsedSchema","getEntitySchema","extraPropsHaveCategory","includes","_getTypeBaseProps","getTypeBaseProps","typeBasedProps","shouldAddCategoryProps","allProps","concat","_toConsumableArray2","uniqueProps","Set","basicProps","nestedProps","forEach","push","_prop$split","split","_prop$split2","_slicedToArray2","base","nested","complexProps","buildComplexProps","join","_ref","_ref$relations","relations","_ref$dynamicPropertie","dynamicProperties","_ref$properties","properties","map","hasLink","find","linkProp","matchingProperty","matchingRelation","_ref2","localField","matchingDynamicProp","dynamicKey","jointNestedProps","isCard","_ref3","_ref3$displayCategory","displayCategory","_ref3$displayThumbnai","displayThumbnail","interfaces","isContent","hasCategory","hasPreheader","PREHEADER_PROP","apply","getCategoyProps","getContentProps","url","_ref4","HEADLINE_PROP","_default","exports"],"sources":["../../src/helpers/build-props-query.js"],"sourcesContent":["import { CATEGORY_ID, ID, PREHEADER_PROP, HEADLINE_PROP } from '../constants';\n\nconst defaultProps = [ID, 'name'];\nconst categoryProps = 'id publishedListingPage{id, url}';\n\nconst checkProps = props =>\n !!(props && Object.keys(props).filter(prop => prop === CATEGORY_ID).length);\n\nconst buildPropsQuery = (entitySchema, extraProps = [], cardOptions = null, linkProps = []) => {\n const parsedSchema = entitySchema.getEntitySchema ? entitySchema.getEntitySchema : entitySchema;\n const extraPropsHaveCategory = !!extraProps.filter(prop => prop.includes('category.')).length;\n const { typeBasedProps, shouldAddCategoryProps } = getTypeBaseProps(\n parsedSchema,\n cardOptions,\n extraPropsHaveCategory\n );\n\n const allProps = [...typeBasedProps, ...extraProps];\n const uniqueProps = [...new Set([...allProps])];\n const basicProps = [];\n const nestedProps = {};\n uniqueProps.forEach(prop => {\n if (prop) {\n if (!prop.includes('.')) {\n basicProps.push(prop);\n return;\n }\n const [base, nested] = prop.split('.');\n if (!nestedProps[base]) nestedProps[base] = [nested];\n else nestedProps[base].push(nested);\n }\n });\n\n const complexProps = buildComplexProps(\n shouldAddCategoryProps,\n nestedProps,\n parsedSchema,\n linkProps\n );\n\n return [...basicProps, ...complexProps].join(',');\n};\n\nconst buildComplexProps = (\n shouldAddCategoryProps,\n props,\n { relations = [], dynamicProperties = {}, properties = {} },\n linkProps\n) =>\n Object.keys(props).map(base => {\n const nestedProps = props[base];\n const hasLink = !!linkProps.find(linkProp => linkProp.includes(base));\n const matchingProperty = !!properties[base];\n const matchingRelation = relations.find(({ localField }) => localField === base);\n const matchingDynamicProp = Object.keys(dynamicProperties).find(\n dynamicKey => dynamicKey === base\n );\n\n if (matchingRelation && !nestedProps.includes('id')) nestedProps.push('id');\n if (hasLink && (!!matchingProperty || !!matchingRelation || !!matchingDynamicProp))\n nestedProps.push('url');\n const jointNestedProps = nestedProps.join(',');\n if (base === 'category' && shouldAddCategoryProps)\n return `${base}{${jointNestedProps}, ${categoryProps}}`;\n if (base.includes('published')) {\n return `${base}{${jointNestedProps},url}`;\n }\n return `${base}{${jointNestedProps}}`;\n });\n\nconst getTypeBaseProps = (entitySchema, cardOptions, extraPropsHaveCategory) => {\n const isCard = !!cardOptions;\n const { displayCategory = true, displayThumbnail = true } = cardOptions || {};\n\n const shouldAddCategoryProps =\n (isCard && displayCategory) || (!isCard && !extraPropsHaveCategory);\n\n if (!isCard) return { typeBasedProps: [ID], shouldAddCategoryProps };\n\n const { interfaces, properties, dynamicProperties, relations } = entitySchema;\n\n const isContent = !!interfaces.includes('content/content');\n const hasCategory = checkProps(properties) || checkProps(dynamicProperties);\n const hasPreheader = properties[PREHEADER_PROP];\n\n const typeBasedProps = [...defaultProps];\n\n typeBasedProps.push(...getCategoyProps(shouldAddCategoryProps, hasCategory, hasPreheader));\n typeBasedProps.push(...getContentProps(isContent));\n\n if (properties.url || dynamicProperties.url) typeBasedProps.push('url');\n\n if (displayThumbnail && relations.find(({ localField }) => localField === 'image')) {\n typeBasedProps.push('image.id', 'image.url', 'image.data');\n }\n\n return { typeBasedProps, shouldAddCategoryProps };\n};\n\nconst getContentProps = isContent => (isContent ? ['url', 'sponsored', 'featured'] : []);\n\nconst getCategoyProps = (shouldAddCategoryProps, hasCategory, hasPreheader) => {\n if (!shouldAddCategoryProps) return [];\n const props = [];\n if (hasCategory)\n props.push('category.name', 'category.listingPageId', 'category.listingPageEntity');\n\n if (hasPreheader) {\n props.push(`${PREHEADER_PROP}{name}`);\n props.push(HEADLINE_PROP);\n }\n\n return props;\n};\n\nexport default buildPropsQuery;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAMC,YAAY,GAAG,CAACC,aAAE,EAAE,MAAM,CAAC;AACjC,IAAMC,aAAa,GAAG,kCAAkC;AAExD,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAGC,KAAK;EAAA,OACtB,CAAC,EAAEA,KA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buildPropsQuery = (entitySchema, extraProps = [], cardOptions = null, link
28
28
  };
29
29
  const buildComplexProps = (shouldAddCategoryProps, props, {
30
30
  relations = [],
31
- dynamicProperties = {}
31
+ dynamicProperties = {},
32
+ properties = {}
32
33
  }, linkProps) => Object.keys(props).map(base => {
33
34
  const nestedProps = props[base];
34
35
  const hasLink = !!linkProps.find(linkProp => linkProp.includes(base));
36
+ const matchingProperty = !!properties[base];
35
37
  const matchingRelation = relations.find(({
36
38
  localField
37
39
  }) => localField === base);
38
40
  const matchingDynamicProp = Object.keys(dynamicProperties).find(dynamicKey => dynamicKey === base);
39
41
  if (matchingRelation && !nestedProps.includes('id')) nestedProps.push('id');
40
- if (hasLink && (!!matchingRelation || !!matchingDynamicProp)) nestedProps.push('url');
42
+ if (hasLink && (!!matchingProperty || !!matchingRelation || !!matchingDynamicProp)) nestedProps.push('url');
41
43
  const jointNestedProps = nestedProps.join(',');
42
44
  if (base === 'category' && shouldAddCategoryProps) return `${base}{${jointNestedProps}, ${categoryProps}}`;
43
45
  if (base.includes('published')) {
@@ -1 +1 @@
1
- {"version":3,"file":"build-props-query.js","names":["CATEGORY_ID","ID","PREHEADER_PROP","HEADLINE_PROP","defaultProps","categoryProps","checkProps","props","Object","keys","filter","prop","length","buildPropsQuery","entitySchema","extraProps","cardOptions","linkProps","parsedSchema","getEntitySchema","extraPropsHaveCategory","includes","typeBasedProps","shouldAddCategoryProps","getTypeBaseProps","allProps","uniqueProps","Set","basicProps","nestedProps","forEach","push","base","nested","split","complexProps","buildComplexProps","join","relations","dynamicProperties","map","hasLink","find","linkProp","matchingRelation","localField","matchingDynamicProp","dynamicKey","jointNestedProps","isCard","displayCategory","displayThumbnail","interfaces","properties","isContent","hasCategory","hasPreheader","getCategoyProps","getContentProps","url"],"sources":["../../src/helpers/build-props-query.js"],"sourcesContent":["import { CATEGORY_ID, ID, PREHEADER_PROP, HEADLINE_PROP } from '../constants';\n\nconst defaultProps = [ID, 'name'];\nconst categoryProps = 'id publishedListingPage{id, url}';\n\nconst checkProps = props =>\n !!(props && Object.keys(props).filter(prop => prop === CATEGORY_ID).length);\n\nconst buildPropsQuery = (entitySchema, extraProps = [], cardOptions = null, linkProps = []) => {\n const parsedSchema = entitySchema.getEntitySchema ? entitySchema.getEntitySchema : entitySchema;\n const extraPropsHaveCategory = !!extraProps.filter(prop => prop.includes('category.')).length;\n const { typeBasedProps, shouldAddCategoryProps } = getTypeBaseProps(\n parsedSchema,\n cardOptions,\n extraPropsHaveCategory\n );\n\n const allProps = [...typeBasedProps, ...extraProps];\n const uniqueProps = [...new Set([...allProps])];\n const basicProps = [];\n const nestedProps = {};\n uniqueProps.forEach(prop => {\n if (prop) {\n if (!prop.includes('.')) {\n basicProps.push(prop);\n return;\n }\n const [base, nested] = prop.split('.');\n if (!nestedProps[base]) nestedProps[base] = [nested];\n else nestedProps[base].push(nested);\n }\n });\n\n const complexProps = buildComplexProps(\n shouldAddCategoryProps,\n nestedProps,\n parsedSchema,\n linkProps\n );\n\n return [...basicProps, ...complexProps].join(',');\n};\n\nconst buildComplexProps = (\n shouldAddCategoryProps,\n props,\n { relations = [], dynamicProperties = {} },\n linkProps\n) =>\n Object.keys(props).map(base => {\n const nestedProps = props[base];\n const hasLink = !!linkProps.find(linkProp => linkProp.includes(base));\n const matchingRelation = relations.find(({ localField }) => localField === base);\n const matchingDynamicProp = Object.keys(dynamicProperties).find(\n dynamicKey => dynamicKey === base\n );\n\n if (matchingRelation && !nestedProps.includes('id')) nestedProps.push('id');\n if (hasLink && (!!matchingRelation || !!matchingDynamicProp)) nestedProps.push('url');\n const jointNestedProps = nestedProps.join(',');\n if (base === 'category' && shouldAddCategoryProps)\n return `${base}{${jointNestedProps}, ${categoryProps}}`;\n if (base.includes('published')) {\n return `${base}{${jointNestedProps},url}`;\n }\n return `${base}{${jointNestedProps}}`;\n });\n\nconst getTypeBaseProps = (entitySchema, cardOptions, extraPropsHaveCategory) => {\n const isCard = !!cardOptions;\n const { displayCategory = true, displayThumbnail = true } = cardOptions || {};\n\n const shouldAddCategoryProps =\n (isCard && displayCategory) || (!isCard && !extraPropsHaveCategory);\n\n if (!isCard) return { typeBasedProps: [ID], shouldAddCategoryProps };\n\n const { interfaces, properties, dynamicProperties, relations } = entitySchema;\n\n const isContent = !!interfaces.includes('content/content');\n const hasCategory = checkProps(properties) || checkProps(dynamicProperties);\n const hasPreheader = properties[PREHEADER_PROP];\n\n const typeBasedProps = [...defaultProps];\n\n typeBasedProps.push(...getCategoyProps(shouldAddCategoryProps, hasCategory, hasPreheader));\n typeBasedProps.push(...getContentProps(isContent));\n\n if (properties.url || dynamicProperties.url) typeBasedProps.push('url');\n\n if (displayThumbnail && relations.find(({ localField }) => localField === 'image')) {\n typeBasedProps.push('image.id', 'image.url', 'image.data');\n }\n\n return { typeBasedProps, shouldAddCategoryProps };\n};\n\nconst getContentProps = isContent => (isContent ? ['url', 'sponsored', 'featured'] : []);\n\nconst getCategoyProps = (shouldAddCategoryProps, hasCategory, hasPreheader) => {\n if (!shouldAddCategoryProps) return [];\n const props = [];\n if (hasCategory)\n props.push('category.name', 'category.listingPageId', 'category.listingPageEntity');\n\n if (hasPreheader) {\n props.push(`${PREHEADER_PROP}{name}`);\n props.push(HEADLINE_PROP);\n }\n\n return props;\n};\n\nexport default buildPropsQuery;\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,EAAE,EAAEC,cAAc,EAAEC,aAAa,QAAQ,cAAc;AAE7E,MAAMC,YAAY,GAAG,CAACH,EAAE,EAAE,MAAM,CAAC;AACjC,MAAMI,aAAa,GAAG,kCAAkC;AAExD,MAAMC,UAAU,GAAGC,KAAK,IACtB,CAAC,EAAEA,KAAK,IAAIC,MAAM,CAACC,IAAI,CAACF,KAAK,CAAC,CAACG,MAAM,CAACC,IAAI,IAAIA,IAAI,KAAKX,WAAW,CAAC,CAACY,MAAM,CAAC;AAE7E,MAAMC,eAAe,GAAGA,CAACC,YAAY,EAAEC,UAAU,GAAG,EAAE,EAAEC,WAAW,GAAG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,CAACS,IAAI,CAAC,UAAU,EAAE,WAAW,EAAE,YAAY,CAAC;EAC5D;EAEA,OAAO;IAAET,cAAc;IAAEC;EAAuB,CAAC;AACnD,CAAC;AAED,MAAMmC,eAAe,GAAGJ,SAAS,IAAKA,SAAS,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,EAAG;AAExF,MAAMG,eAAe,GAAGA,CAAClC,sBAAsB,EAAEgC,WAAW,EAAEC,YAAY,KAAK;EAC7E,IAAI,CAACjC,sBAAsB,EAAE,OAAO,EAAE;EACtC,MAAMhB,KAAK,GAAG,EAAE;EAChB,IAAIgD,WAAW,EACbhD,KAAK,CAACwB,IAAI,CAAC,eAAe,EAAE,wBAAwB,EAAE,4BAA4B,CAAC;EAErF,IAAIyB,YAAY,EAAE;IAChBjD,KAAK,CAACwB,IAAI,CAAE,GAAE7B,cAAe,QAAO,CAAC;IACrCK,KAAK,CAACwB,IAAI,CAAC5B,aAAa,CAAC;EAC3B;EAEA,OAAOI,KAAK;AACd,CAAC;AAED,eAAeM,eAAe"}
1
+ {"version":3,"file":"build-props-query.js","names":["CATEGORY_ID","ID","PREHEADER_PROP","HEADLINE_PROP","defaultProps","categoryProps","checkProps","props","Object","keys","filter","prop","length","buildPropsQuery","entitySchema","extraProps","cardOptions","linkProps","parsedSchema","getEntitySchema","extraPropsHaveCategory","includes","typeBasedProps","shouldAddCategoryProps","getTypeBaseProps","allProps","uniqueProps","Set","basicProps","nestedProps","forEach","push","base","nested","split","complexProps","buildComplexProps","join","relations","dynamicProperties","properties","map","hasLink","find","linkProp","matchingProperty","matchingRelation","localField","matchingDynamicProp","dynamicKey","jointNestedProps","isCard","displayCategory","displayThumbnail","interfaces","isContent","hasCategory","hasPreheader","getCategoyProps","getContentProps","url"],"sources":["../../src/helpers/build-props-query.js"],"sourcesContent":["import { CATEGORY_ID, ID, PREHEADER_PROP, HEADLINE_PROP } from '../constants';\n\nconst defaultProps = [ID, 'name'];\nconst categoryProps = 'id publishedListingPage{id, url}';\n\nconst checkProps = props =>\n !!(props && Object.keys(props).filter(prop => prop === CATEGORY_ID).length);\n\nconst buildPropsQuery = (entitySchema, extraProps = [], cardOptions = null, linkProps = []) => {\n const parsedSchema = entitySchema.getEntitySchema ? entitySchema.getEntitySchema : entitySchema;\n const extraPropsHaveCategory = !!extraProps.filter(prop => prop.includes('category.')).length;\n const { typeBasedProps, shouldAddCategoryProps } = getTypeBaseProps(\n parsedSchema,\n cardOptions,\n extraPropsHaveCategory\n );\n\n const allProps = [...typeBasedProps, ...extraProps];\n const uniqueProps = [...new Set([...allProps])];\n const basicProps = [];\n const nestedProps = {};\n uniqueProps.forEach(prop => {\n if (prop) {\n if (!prop.includes('.')) {\n basicProps.push(prop);\n return;\n }\n const [base, nested] = prop.split('.');\n if (!nestedProps[base]) nestedProps[base] = [nested];\n else nestedProps[base].push(nested);\n }\n });\n\n const complexProps = buildComplexProps(\n shouldAddCategoryProps,\n nestedProps,\n parsedSchema,\n linkProps\n );\n\n return [...basicProps, ...complexProps].join(',');\n};\n\nconst buildComplexProps = (\n shouldAddCategoryProps,\n props,\n { relations = [], dynamicProperties = {}, properties = {} },\n linkProps\n) =>\n Object.keys(props).map(base => {\n const nestedProps = props[base];\n const hasLink = !!linkProps.find(linkProp => linkProp.includes(base));\n const matchingProperty = !!properties[base];\n const matchingRelation = relations.find(({ localField }) => localField === base);\n const matchingDynamicProp = Object.keys(dynamicProperties).find(\n dynamicKey => dynamicKey === base\n );\n\n if (matchingRelation && !nestedProps.includes('id')) nestedProps.push('id');\n if (hasLink && (!!matchingProperty || !!matchingRelation || !!matchingDynamicProp))\n nestedProps.push('url');\n const jointNestedProps = nestedProps.join(',');\n if (base === 'category' && shouldAddCategoryProps)\n return `${base}{${jointNestedProps}, ${categoryProps}}`;\n if (base.includes('published')) {\n return `${base}{${jointNestedProps},url}`;\n }\n return `${base}{${jointNestedProps}}`;\n });\n\nconst getTypeBaseProps = (entitySchema, cardOptions, extraPropsHaveCategory) => {\n const isCard = !!cardOptions;\n const { displayCategory = true, displayThumbnail = true } = cardOptions || {};\n\n const shouldAddCategoryProps =\n (isCard && displayCategory) || (!isCard && !extraPropsHaveCategory);\n\n if (!isCard) return { typeBasedProps: [ID], shouldAddCategoryProps };\n\n const { interfaces, properties, dynamicProperties, relations } = entitySchema;\n\n const isContent = !!interfaces.includes('content/content');\n const hasCategory = checkProps(properties) || checkProps(dynamicProperties);\n const hasPreheader = properties[PREHEADER_PROP];\n\n const typeBasedProps = [...defaultProps];\n\n typeBasedProps.push(...getCategoyProps(shouldAddCategoryProps, hasCategory, hasPreheader));\n typeBasedProps.push(...getContentProps(isContent));\n\n if (properties.url || dynamicProperties.url) typeBasedProps.push('url');\n\n if (displayThumbnail && relations.find(({ localField }) => localField === 'image')) {\n typeBasedProps.push('image.id', 'image.url', 'image.data');\n }\n\n return { typeBasedProps, shouldAddCategoryProps };\n};\n\nconst getContentProps = isContent => (isContent ? ['url', 'sponsored', 'featured'] : []);\n\nconst getCategoyProps = (shouldAddCategoryProps, hasCategory, hasPreheader) => {\n if (!shouldAddCategoryProps) return [];\n const props = [];\n if (hasCategory)\n props.push('category.name', 'category.listingPageId', 'category.listingPageEntity');\n\n if (hasPreheader) {\n props.push(`${PREHEADER_PROP}{name}`);\n props.push(HEADLINE_PROP);\n }\n\n return props;\n};\n\nexport default buildPropsQuery;\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,EAAE,EAAEC,cAAc,EAAEC,aAAa,QAAQ,cAAc;AAE7E,MAAMC,YAAY,GAAG,CAACH,EAAE,EAAE,MAAM,CAAC;AACjC,MAAMI,aAAa,GAAG,kCAAkC;AAExD,MAAMC,UAAU,GAAGC,KAAK,IACtB,CAAC,EAAEA,KAAK,IAAIC,MAAM,CAACC,IAAI,CAACF,KAAK,CAAC,CAACG,MAAM,CAACC,IAAI,IAAIA,IAAI,KAAKX,WAAW,CAAC,CAACY,MAAM,CAAC;AAE7E,MAAMC,eAAe,GAAGA,CAACC,YA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AAEtC,cAAc,CAACS,IAAI,CAAC,KAAK,CAAC;EAEvE,IAAIsB,gBAAgB,IAAIf,SAAS,CAACK,IAAI,CAAC,CAAC;IAAEI;EAAW,CAAC,KAAKA,UAAU,KAAK,OAAO,CAAC,EAAE;IAClFzB,cAAc,CAACS,IAAI,CAAC,UAAU,EAAE,WAAW,EAAE,YAAY,CAAC;EAC5D;EAEA,OAAO;IAAET,cAAc;IAAEC;EAAuB,CAAC;AACnD,CAAC;AAED,MAAMoC,eAAe,GAAGJ,SAAS,IAAKA,SAAS,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,EAAG;AAExF,MAAMG,eAAe,GAAGA,CAACnC,sBAAsB,EAAEiC,WAAW,EAAEC,YAAY,KAAK;EAC7E,IAAI,CAAClC,sBAAsB,EAAE,OAAO,EAAE;EACtC,MAAMhB,KAAK,GAAG,EAAE;EAChB,IAAIiD,WAAW,EACbjD,KAAK,CAACwB,IAAI,CAAC,eAAe,EAAE,wBAAwB,EAAE,4BAA4B,CAAC;EAErF,IAAI0B,YAAY,EAAE;IAChBlD,KAAK,CAACwB,IAAI,CAAE,GAAE7B,cAAe,QAAO,CAAC;IACrCK,KAAK,CAACwB,IAAI,CAAC5B,aAAa,CAAC;EAC3B;EAEA,OAAOI,KAAK;AACd,CAAC;AAED,eAAeM,eAAe"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaze-cms/react-page-builder",
3
- "version": "0.130.0-admin-updates.6",
3
+ "version": "0.130.0-admin-updates.8",
4
4
  "description": "Blaze react page builder",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-es/index.js",
@@ -89,5 +89,5 @@
89
89
  "lib/*",
90
90
  "lib-es/*"
91
91
  ],
92
- "gitHead": "b9d0211de22635574875beede5105697dbb24377"
92
+ "gitHead": "4b393fc952a6c63e502d86863a62d56f5f32f69f"
93
93
  }
@@ -44,19 +44,21 @@ const buildPropsQuery = (entitySchema, extraProps = [], cardOptions = null, link
44
44
  const buildComplexProps = (
45
45
  shouldAddCategoryProps,
46
46
  props,
47
- { relations = [], dynamicProperties = {} },
47
+ { relations = [], dynamicProperties = {}, properties = {} },
48
48
  linkProps
49
49
  ) =>
50
50
  Object.keys(props).map(base => {
51
51
  const nestedProps = props[base];
52
52
  const hasLink = !!linkProps.find(linkProp => linkProp.includes(base));
53
+ const matchingProperty = !!properties[base];
53
54
  const matchingRelation = relations.find(({ localField }) => localField === base);
54
55
  const matchingDynamicProp = Object.keys(dynamicProperties).find(
55
56
  dynamicKey => dynamicKey === base
56
57
  );
57
58
 
58
59
  if (matchingRelation && !nestedProps.includes('id')) nestedProps.push('id');
59
- if (hasLink && (!!matchingRelation || !!matchingDynamicProp)) nestedProps.push('url');
60
+ if (hasLink && (!!matchingProperty || !!matchingRelation || !!matchingDynamicProp))
61
+ nestedProps.push('url');
60
62
  const jointNestedProps = nestedProps.join(',');
61
63
  if (base === 'category' && shouldAddCategoryProps)
62
64
  return `${base}{${jointNestedProps}, ${categoryProps}}`;
@@ -182,6 +182,31 @@ describe('get card render props', () => {
182
182
  'id,name,url,sponsored,featured,category{name,listingPageId,listingPageEntity, id publishedListingPage{id, url}},address{country,id}'
183
183
  );
184
184
  });
185
+
186
+ it('should url props where enableLink is set', () => {
187
+ const _data = {
188
+ getEntitySchema: {
189
+ interfaces: [CONTENT_INTERFACE],
190
+ properties: {
191
+ id: 'id',
192
+ nestedProperty: {
193
+ type: 'object'
194
+ }
195
+ },
196
+ relations: [{ localField: 'address' }],
197
+ dynamicProperties: {
198
+ nestedDynamicProperty: {
199
+ type: 'object'
200
+ }
201
+ }
202
+ }
203
+ };
204
+ const linkProps = ['nestedProperty.title', 'nestedDynamicProperty.title', 'address.title'];
205
+ const query = buildPropsQuery(_data, linkProps, {}, linkProps);
206
+ expect(query).toEqual(
207
+ 'id,name,url,sponsored,featured,nestedProperty{title,url},nestedDynamicProperty{title,url},address{title,id,url}'
208
+ );
209
+ });
185
210
  });
186
211
 
187
212
  function testUrlProperty({ extraProperties = {}, dynamicProperties = {}, cardProps }) {