@blaze-cms/react-page-builder 0.131.0-project-admin-customisations.0 → 0.131.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -21
- package/lib/HOC/recreateOnNavigation.js +29 -0
- package/lib/HOC/recreateOnNavigation.js.map +1 -0
- package/lib/components/Button.js +1 -2
- package/lib/components/Button.js.map +1 -1
- package/lib/components/Card/CardsRender.js +6 -13
- package/lib/components/Card/CardsRender.js.map +1 -1
- package/lib/components/Card/helpers/index.js +0 -7
- package/lib/components/Card/helpers/index.js.map +1 -1
- package/lib/components/Code/Code.js +3 -7
- package/lib/components/Code/Code.js.map +1 -1
- package/lib/components/ContentGroupSection/ContentGroupSection.js +4 -1
- package/lib/components/ContentGroupSection/ContentGroupSection.js.map +1 -1
- package/lib/components/DataSummary/helpers/build-loop-props-content.js +1 -3
- package/lib/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
- package/lib/components/DataSummary/helpers/build-props-to-display-with-content.js +2 -3
- package/lib/components/DataSummary/helpers/build-props-to-display-with-content.js.map +1 -1
- package/lib/components/Layout/Layout.js +3 -2
- package/lib/components/Layout/Layout.js.map +1 -1
- package/lib/components/Layout/LayoutFactory.js +35 -0
- package/lib/components/Layout/LayoutFactory.js.map +1 -0
- package/lib/components/Layout/LayoutWithStickyTimer.js +66 -0
- package/lib/components/Layout/LayoutWithStickyTimer.js.map +1 -0
- package/lib/components/Layout/index.js +2 -2
- package/lib/components/Layout/index.js.map +1 -1
- package/lib/components/List/ListFactory.js +11 -16
- package/lib/components/List/ListFactory.js.map +1 -1
- package/lib/components/List/helpers/index.js +0 -14
- package/lib/components/List/helpers/index.js.map +1 -1
- package/lib/components/SearchContent/SearchContent.js +6 -8
- package/lib/components/SearchContent/SearchContent.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilter/SearchFilter.js +11 -17
- package/lib/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilterContainer.js +85 -63
- package/lib/components/SearchFilter/SearchFilterContainer.js.map +1 -1
- package/lib/components/SearchFilter/helpers/build-filters-query.js +1 -3
- package/lib/components/SearchFilter/helpers/build-filters-query.js.map +1 -1
- package/lib/components/SearchFilter/helpers/build-new-query.js +15 -0
- package/lib/components/SearchFilter/helpers/build-new-query.js.map +1 -0
- package/lib/components/SearchFilter/helpers/build-query.js +37 -0
- package/lib/components/SearchFilter/helpers/build-query.js.map +1 -0
- package/lib/components/SearchFilter/helpers/get-initial-filter-values.js +43 -0
- package/lib/components/SearchFilter/helpers/get-initial-filter-values.js.map +1 -0
- package/lib/components/SearchFilter/helpers/index.js +11 -18
- package/lib/components/SearchFilter/helpers/index.js.map +1 -1
- package/lib/components/SearchFilter/index.js.map +1 -1
- package/lib/components/SearchFilterSort/SearchFilterSort.js +11 -31
- package/lib/components/SearchFilterSort/SearchFilterSort.js.map +1 -1
- package/lib/components/SearchFilterSort/helpers/handle-sort-update.js +5 -19
- package/lib/components/SearchFilterSort/helpers/handle-sort-update.js.map +1 -1
- package/lib/components/SearchFilterSort/helpers/update-sort.js +5 -9
- package/lib/components/SearchFilterSort/helpers/update-sort.js.map +1 -1
- package/lib/helpers/build-inherited-filters.js +0 -2
- package/lib/helpers/build-inherited-filters.js.map +1 -1
- package/lib/helpers/build-props-query.js +2 -5
- package/lib/helpers/build-props-query.js.map +1 -1
- package/lib/helpers/build-set-filters.js +1 -5
- package/lib/helpers/build-set-filters.js.map +1 -1
- package/lib/helpers/get-query-filters.js +8 -6
- package/lib/helpers/get-query-filters.js.map +1 -1
- package/lib/helpers/get-query-props.js +2 -13
- package/lib/helpers/get-query-props.js.map +1 -1
- package/lib/helpers/get-wrapped-value-with-link.js +3 -2
- package/lib/helpers/get-wrapped-value-with-link.js.map +1 -1
- package/lib/helpers/index.js +0 -14
- package/lib/helpers/index.js.map +1 -1
- package/lib/helpers/parse-props-to-display.js +8 -13
- package/lib/helpers/parse-props-to-display.js.map +1 -1
- package/lib/utils/get-class-modifiers.js +1 -1
- package/lib/utils/get-class-modifiers.js.map +1 -1
- package/lib-es/HOC/recreateOnNavigation.js +20 -0
- package/lib-es/HOC/recreateOnNavigation.js.map +1 -0
- package/lib-es/components/Button.js +1 -2
- package/lib-es/components/Button.js.map +1 -1
- package/lib-es/components/Card/CardsRender.js +7 -14
- package/lib-es/components/Card/CardsRender.js.map +1 -1
- package/lib-es/components/Card/helpers/index.js +0 -1
- package/lib-es/components/Card/helpers/index.js.map +1 -1
- package/lib-es/components/Code/Code.js +4 -8
- package/lib-es/components/Code/Code.js.map +1 -1
- package/lib-es/components/ContentGroupSection/ContentGroupSection.js +8 -4
- package/lib-es/components/ContentGroupSection/ContentGroupSection.js.map +1 -1
- package/lib-es/components/DataSummary/helpers/build-loop-props-content.js +1 -3
- package/lib-es/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
- package/lib-es/components/DataSummary/helpers/build-props-to-display-with-content.js +3 -4
- package/lib-es/components/DataSummary/helpers/build-props-to-display-with-content.js.map +1 -1
- package/lib-es/components/Layout/Layout.js +3 -2
- package/lib-es/components/Layout/Layout.js.map +1 -1
- package/lib-es/components/Layout/LayoutFactory.js +14 -0
- package/lib-es/components/Layout/LayoutFactory.js.map +1 -0
- package/lib-es/components/Layout/LayoutWithStickyTimer.js +42 -0
- package/lib-es/components/Layout/LayoutWithStickyTimer.js.map +1 -0
- package/lib-es/components/Layout/index.js +2 -2
- package/lib-es/components/Layout/index.js.map +1 -1
- package/lib-es/components/List/ListFactory.js +12 -16
- package/lib-es/components/List/ListFactory.js.map +1 -1
- package/lib-es/components/List/helpers/index.js +0 -2
- package/lib-es/components/List/helpers/index.js.map +1 -1
- package/lib-es/components/SearchContent/SearchContent.js +6 -8
- package/lib-es/components/SearchContent/SearchContent.js.map +1 -1
- package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js +11 -18
- package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
- package/lib-es/components/SearchFilter/SearchFilterContainer.js +72 -47
- package/lib-es/components/SearchFilter/SearchFilterContainer.js.map +1 -1
- package/lib-es/components/SearchFilter/helpers/build-filters-query.js +0 -2
- package/lib-es/components/SearchFilter/helpers/build-filters-query.js.map +1 -1
- package/lib-es/components/SearchFilter/helpers/build-new-query.js +6 -0
- package/lib-es/components/SearchFilter/helpers/build-new-query.js.map +1 -0
- package/lib-es/components/SearchFilter/helpers/build-query.js +23 -0
- package/lib-es/components/SearchFilter/helpers/build-query.js.map +1 -0
- package/lib-es/components/SearchFilter/helpers/get-initial-filter-values.js +26 -0
- package/lib-es/components/SearchFilter/helpers/get-initial-filter-values.js.map +1 -0
- package/lib-es/components/SearchFilter/helpers/index.js +4 -5
- package/lib-es/components/SearchFilter/helpers/index.js.map +1 -1
- package/lib-es/components/SearchFilter/index.js +2 -2
- package/lib-es/components/SearchFilter/index.js.map +1 -1
- package/lib-es/components/SearchFilterSort/SearchFilterSort.js +10 -26
- package/lib-es/components/SearchFilterSort/SearchFilterSort.js.map +1 -1
- package/lib-es/components/SearchFilterSort/helpers/handle-sort-update.js +4 -21
- package/lib-es/components/SearchFilterSort/helpers/handle-sort-update.js.map +1 -1
- package/lib-es/components/SearchFilterSort/helpers/update-sort.js +4 -8
- package/lib-es/components/SearchFilterSort/helpers/update-sort.js.map +1 -1
- package/lib-es/helpers/build-inherited-filters.js +0 -2
- package/lib-es/helpers/build-inherited-filters.js.map +1 -1
- package/lib-es/helpers/build-props-query.js +2 -4
- package/lib-es/helpers/build-props-query.js.map +1 -1
- package/lib-es/helpers/build-set-filters.js +1 -5
- package/lib-es/helpers/build-set-filters.js.map +1 -1
- package/lib-es/helpers/get-query-filters.js +8 -6
- package/lib-es/helpers/get-query-filters.js.map +1 -1
- package/lib-es/helpers/get-query-props.js +2 -10
- package/lib-es/helpers/get-query-props.js.map +1 -1
- package/lib-es/helpers/get-wrapped-value-with-link.js +2 -2
- package/lib-es/helpers/get-wrapped-value-with-link.js.map +1 -1
- package/lib-es/helpers/index.js +0 -2
- package/lib-es/helpers/index.js.map +1 -1
- package/lib-es/helpers/parse-props-to-display.js +9 -12
- package/lib-es/helpers/parse-props-to-display.js.map +1 -1
- package/lib-es/utils/get-class-modifiers.js +1 -1
- package/lib-es/utils/get-class-modifiers.js.map +1 -1
- package/package.json +10 -10
- package/src/HOC/recreateOnNavigation.js +21 -0
- package/src/components/Button.js +1 -2
- package/src/components/Card/CardsRender.js +7 -27
- package/src/components/Card/helpers/index.js +0 -1
- package/src/components/Code/Code.js +3 -7
- package/src/components/ContentGroupSection/ContentGroupSection.js +1 -1
- package/src/components/DataSummary/helpers/build-loop-props-content.js +1 -4
- package/src/components/DataSummary/helpers/build-props-to-display-with-content.js +3 -6
- package/src/components/Layout/Layout.js +29 -32
- package/src/components/Layout/LayoutFactory.js +17 -0
- package/src/components/Layout/LayoutWithStickyTimer.js +40 -0
- package/src/components/Layout/index.js +2 -2
- package/src/components/List/ListFactory.js +15 -25
- package/src/components/List/helpers/index.js +0 -2
- package/src/components/SearchContent/SearchContent.js +6 -8
- package/src/components/SearchFilter/SearchFilter/SearchFilter.js +12 -21
- package/src/components/SearchFilter/SearchFilterContainer.js +69 -57
- package/src/components/SearchFilter/helpers/build-filters-query.js +1 -9
- package/src/components/SearchFilter/helpers/build-new-query.js +6 -0
- package/src/components/SearchFilter/helpers/build-query.js +26 -0
- package/src/components/SearchFilter/helpers/get-initial-filter-values.js +30 -0
- package/src/components/SearchFilter/helpers/index.js +7 -9
- package/src/components/SearchFilter/index.js +2 -2
- package/src/components/SearchFilterSort/SearchFilterSort.js +8 -18
- package/src/components/SearchFilterSort/helpers/handle-sort-update.js +5 -14
- package/src/components/SearchFilterSort/helpers/update-sort.js +3 -7
- package/src/helpers/build-inherited-filters.js +1 -3
- package/src/helpers/build-props-query.js +2 -4
- package/src/helpers/build-set-filters.js +1 -2
- package/src/helpers/get-query-filters.js +4 -4
- package/src/helpers/get-query-props.js +4 -12
- package/src/helpers/get-wrapped-value-with-link.js +3 -6
- package/src/helpers/index.js +0 -2
- package/src/helpers/parse-props-to-display.js +21 -25
- package/src/utils/get-class-modifiers.js +1 -1
- package/tests/helpers/mocks.js +5 -3
- package/tests/unit/src/HOC/recreateOnNavigation.test.js +28 -0
- package/tests/unit/src/components/Code/Code.test.js +0 -5
- package/tests/unit/src/components/Code/__snapshots__/Code.test.js.snap +0 -8
- package/tests/unit/src/components/DataSummary/helpers/build-loop-props-content.test.js +0 -9
- package/tests/unit/src/components/Layout/Layout.test.js +1 -1
- package/tests/unit/src/components/Layout/LayoutFactory.test.js +53 -0
- package/tests/unit/src/components/SearchFilter/__snapshots__/SearchFilterContainer.test.js.snap +7 -1
- package/tests/unit/src/components/SearchFilter/helpers/build-new-query.test.js +10 -10
- package/tests/unit/src/components/SearchFilter/helpers/build-query.test.js +7 -24
- package/tests/unit/src/components/SearchFilter/helpers/get-initial-filter-values.test.js +10 -10
- package/tests/unit/src/components/SearchFilterSort/SearchFilterSort.test.js +1 -4
- package/tests/unit/src/components/SearchFilterSort/helpers/handle-sort-update.test.js +19 -26
- package/tests/unit/src/components/SearchFilterSort/helpers/update-sort.test.js +1 -10
- package/tests/unit/src/helpers/build-props-query.test.js +0 -25
- package/tests/unit/src/helpers/get-wrapped-value-with-link.test.js +2 -2
- package/tests/unit/src/helpers/parse-props-to-display.test.js +0 -4
- package/lib/components/Card/helpers/get-updated-items-to-display.js +0 -55
- package/lib/components/Card/helpers/get-updated-items-to-display.js.map +0 -1
- package/lib/components/List/helpers/get-list-query.js +0 -43
- package/lib/components/List/helpers/get-list-query.js.map +0 -1
- package/lib/components/List/helpers/get-list-specific-search-filter.js +0 -21
- package/lib/components/List/helpers/get-list-specific-search-filter.js.map +0 -1
- package/lib/components/List/helpers/strip-query-key.js +0 -14
- package/lib/components/List/helpers/strip-query-key.js.map +0 -1
- package/lib/components/SearchFilter/helpers/build-new-url.js +0 -17
- package/lib/components/SearchFilter/helpers/build-new-url.js.map +0 -1
- package/lib/components/SearchFilter/helpers/build-url-query.js +0 -48
- package/lib/components/SearchFilter/helpers/build-url-query.js.map +0 -1
- package/lib/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js +0 -32
- package/lib/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js.map +0 -1
- package/lib/components/SearchFilter/helpers/get-filter-values.js +0 -31
- package/lib/components/SearchFilter/helpers/get-filter-values.js.map +0 -1
- package/lib/components/SearchFilter/searchFilterReducer.js +0 -45
- package/lib/components/SearchFilter/searchFilterReducer.js.map +0 -1
- package/lib/helpers/build-query-key.js +0 -16
- package/lib/helpers/build-query-key.js.map +0 -1
- package/lib/helpers/process-data-summary-value.js +0 -56
- package/lib/helpers/process-data-summary-value.js.map +0 -1
- package/lib-es/components/Card/helpers/get-updated-items-to-display.js +0 -32
- package/lib-es/components/Card/helpers/get-updated-items-to-display.js.map +0 -1
- package/lib-es/components/List/helpers/get-list-query.js +0 -24
- package/lib-es/components/List/helpers/get-list-query.js.map +0 -1
- package/lib-es/components/List/helpers/get-list-specific-search-filter.js +0 -12
- package/lib-es/components/List/helpers/get-list-specific-search-filter.js.map +0 -1
- package/lib-es/components/List/helpers/strip-query-key.js +0 -6
- package/lib-es/components/List/helpers/strip-query-key.js.map +0 -1
- package/lib-es/components/SearchFilter/helpers/build-new-url.js +0 -8
- package/lib-es/components/SearchFilter/helpers/build-new-url.js.map +0 -1
- package/lib-es/components/SearchFilter/helpers/build-url-query.js +0 -30
- package/lib-es/components/SearchFilter/helpers/build-url-query.js.map +0 -1
- package/lib-es/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js +0 -18
- package/lib-es/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js.map +0 -1
- package/lib-es/components/SearchFilter/helpers/get-filter-values.js +0 -19
- package/lib-es/components/SearchFilter/helpers/get-filter-values.js.map +0 -1
- package/lib-es/components/SearchFilter/searchFilterReducer.js +0 -28
- package/lib-es/components/SearchFilter/searchFilterReducer.js.map +0 -1
- package/lib-es/helpers/build-query-key.js +0 -7
- package/lib-es/helpers/build-query-key.js.map +0 -1
- package/lib-es/helpers/process-data-summary-value.js +0 -36
- package/lib-es/helpers/process-data-summary-value.js.map +0 -1
- package/src/components/Card/helpers/get-updated-items-to-display.js +0 -32
- package/src/components/List/helpers/get-list-query.js +0 -28
- package/src/components/List/helpers/get-list-specific-search-filter.js +0 -10
- package/src/components/List/helpers/strip-query-key.js +0 -6
- package/src/components/SearchFilter/helpers/build-new-url.js +0 -8
- package/src/components/SearchFilter/helpers/build-url-query.js +0 -31
- package/src/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js +0 -17
- package/src/components/SearchFilter/helpers/get-filter-values.js +0 -21
- package/src/components/SearchFilter/searchFilterReducer.js +0 -15
- package/src/helpers/build-query-key.js +0 -7
- package/src/helpers/process-data-summary-value.js +0 -22
- package/tests/unit/src/components/Card/helpers/get-updated-items-to-display.test.js +0 -72
- package/tests/unit/src/helpers/__snapshots__/get-wrapped-value-with-link.test.js.snap +0 -18
- package/tests/unit/src/helpers/prcoess-data-summary-value.test.js +0 -52
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-props-to-display.js","names":["React","Fragment","at","isObject","getParsedPropValues","getSanitizedPropValues","BOLD_TAG","BLANK_SPACE_UNICODE_STRING","
|
|
1
|
+
{"version":3,"file":"parse-props-to-display.js","names":["React","Fragment","at","isObject","getParsedPropValues","getSanitizedPropValues","BOLD_TAG","BLANK_SPACE_UNICODE_STRING","parsePropsToDisplay","props","propsToDisplay","filter","Boolean","map","bold","propertiesToDisplay","prefix","suffix","shouldStrip","enableLink","currentIndex","Wrapper","parsedPropValues","sanitizedPropValues","length","stringEndBlank","createElement"],"sources":["../../src/helpers/parse-props-to-display.js"],"sourcesContent":["import React, { Fragment } from 'react';\nimport at from 'lodash.at';\nimport isObject from './is-object';\nimport getParsedPropValues from './get-parsed-prop-values';\nimport getSanitizedPropValues from './get-sanitized-prop-values';\nimport { BOLD_TAG, BLANK_SPACE_UNICODE_STRING } from '../constants';\n\n// TODO this helper should be removed if database is wiped clean and all elements change to new props struc\nconst parsePropsToDisplay = (props = {}, propsToDisplay = []) => {\n if (!isObject(propsToDisplay[0])) return at(props, propsToDisplay).filter(Boolean);\n\n return propsToDisplay.map(\n ({ bold, propertiesToDisplay, prefix, suffix, shouldStrip, enableLink }, currentIndex) => {\n const Wrapper = bold ? BOLD_TAG : Fragment;\n\n const parsedPropValues = getParsedPropValues({\n propertiesToDisplay,\n props,\n enableLink,\n shouldStrip\n });\n\n const sanitizedPropValues = getSanitizedPropValues(parsedPropValues);\n if (!sanitizedPropValues || !sanitizedPropValues.length) return null;\n const stringEndBlank =\n currentIndex + 1 === propsToDisplay.length ? '' : BLANK_SPACE_UNICODE_STRING;\n\n return (\n <Wrapper>\n {prefix} {sanitizedPropValues} {suffix}\n {stringEndBlank}\n </Wrapper>\n );\n }\n );\n};\n\nexport default parsePropsToDisplay;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,mBAAmB,MAAM,0BAA0B;AAC1D,OAAOC,sBAAsB,MAAM,6BAA6B;AAChE,SAASC,QAAQ,EAAEC,0BAA0B,QAAQ,cAAc;;AAEnE;AACA,MAAMC,mBAAmB,GAAGA,CAACC,KAAK,GAAG,CAAC,CAAC,EAAEC,cAAc,GAAG,EAAE,KAAK;EAC/D,IAAI,CAACP,QAAQ,CAACO,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,OAAOR,EAAE,CAACO,KAAK,EAAEC,cAAc,CAAC,CAACC,MAAM,CAACC,OAAO,CAAC;EAElF,OAAOF,cAAc,CAACG,GAAG,CACvB,CAAC;IAAEC,IAAI;IAAEC,mBAAmB;IAAEC,MAAM;IAAEC,MAAM;IAAEC,WAAW;IAAEC;EAAW,CAAC,EAAEC,YAAY,KAAK;IACxF,MAAMC,OAAO,GAAGP,IAAI,GAAGR,QAAQ,GAAGL,QAAQ;IAE1C,MAAMqB,gBAAgB,GAAGlB,mBAAmB,CAAC;MAC3CW,mBAAmB;MACnBN,KAAK;MACLU,UAAU;MACVD;IACF,CAAC,CAAC;IAEF,MAAMK,mBAAmB,GAAGlB,sBAAsB,CAACiB,gBAAgB,CAAC;IACpE,IAAI,CAACC,mBAAmB,IAAI,CAACA,mBAAmB,CAACC,MAAM,EAAE,OAAO,IAAI;IACpE,MAAMC,cAAc,GAClBL,YAAY,GAAG,CAAC,KAAKV,cAAc,CAACc,MAAM,GAAG,EAAE,GAAGjB,0BAA0B;IAE9E,oBACEP,KAAA,CAAA0B,aAAA,CAACL,OAAO,QACLL,MAAM,EAAC,GAAC,EAACO,mBAAmB,EAAC,GAAC,EAACN,MAAM,EACrCQ,cACM,CAAC;EAEd,CACF,CAAC;AACH,CAAC;AAED,eAAejB,mBAAmB"}
|
|
@@ -29,7 +29,7 @@ const commonAttributes = {
|
|
|
29
29
|
};
|
|
30
30
|
const supportedTypes = {
|
|
31
31
|
row: {
|
|
32
|
-
props: [WIDTH, ...responsiveProps, ...commonProps]
|
|
32
|
+
props: [WIDTH, STICKY, ...responsiveProps, ...commonProps]
|
|
33
33
|
},
|
|
34
34
|
column: {
|
|
35
35
|
props: [WIDTH, STICKY, ...responsiveProps, ...commonProps]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-class-modifiers.js","names":["BUTTON","BUTTON_ICON","CLASS_MODIFIERS","ICON_BUTTON","LINK","CODE","COMPONENTS_DEFAULT_VALUES","BUTTON_TYPE","DEFAULT","DESKTOP","GTM_CLASS_NAME","HIDE","ICON","MOBILE","MODIFIER","SIZE","STICKY","STYLE","TABLET","WIDTH","ALIGNMENT","commonProps","responsiveProps","buttonProps","iconProps","commonAttributes","props","prefix","supportedTypes","row","column","button","icon","textBlock","_objectSpread","banner","image","hero","video","list","code","getClassModifiers","type","supportedProps","defaultValues","modifiers","map","prop","propValue","stringValue","isResponsiveProp","includes","undefined","filter","Boolean","unshift","join"],"sources":["../../src/utils/get-class-modifiers.js"],"sourcesContent":["import { BUTTON, BUTTON_ICON, CLASS_MODIFIERS, ICON_BUTTON, LINK, CODE } from '../constants';\nimport COMPONENTS_DEFAULT_VALUES from '../constants/componentsDefaultValues';\n\nconst {\n BUTTON_TYPE,\n DEFAULT,\n DESKTOP,\n GTM_CLASS_NAME,\n HIDE,\n ICON,\n MOBILE,\n MODIFIER,\n SIZE,\n STICKY,\n STYLE,\n TABLET,\n WIDTH,\n ALIGNMENT\n} = CLASS_MODIFIERS;\nconst commonProps = [GTM_CLASS_NAME, MODIFIER];\nconst responsiveProps = [DESKTOP, TABLET, MOBILE];\nconst buttonProps = [SIZE, BUTTON_TYPE, ICON, STYLE, ALIGNMENT, ...commonProps];\nconst iconProps = [BUTTON_TYPE, ...commonProps];\n\nconst commonAttributes = { props: commonProps, prefix: null };\n\nconst supportedTypes = {\n row: { props: [WIDTH, ...responsiveProps, ...commonProps] },\n column: { props: [WIDTH, STICKY, ...responsiveProps, ...commonProps] },\n button: {\n props: buttonProps,\n prefix: BUTTON\n },\n icon: { props: iconProps, prefix: ICON_BUTTON },\n textBlock: { ...commonAttributes },\n banner: { ...commonAttributes },\n image: { ...commonAttributes },\n hero: { ...commonAttributes },\n video: { ...commonAttributes },\n list: { ...commonAttributes },\n code: { ...commonAttributes, prefix: CODE }\n};\n\nexport default function getClassModifiers(type, props) {\n const { props: supportedProps, prefix } = supportedTypes[type] || {};\n const defaultValues = COMPONENTS_DEFAULT_VALUES[type] || {};\n if (!supportedProps) return '';\n\n const modifiers = supportedProps\n .map(prop => {\n const propValue = props[prop];\n const stringValue = typeof propValue === 'boolean' ? prop : propValue;\n const isResponsiveProp = responsiveProps.includes(prop);\n if (prop === ICON) return propValue ? BUTTON_ICON : '';\n if (prop === MODIFIER && propValue) return `${propValue}`;\n if (propValue === DEFAULT || stringValue === type) return '';\n if (isResponsiveProp) return propValue ? '' : `${HIDE}-${prop}`;\n if (propValue === null || propValue === undefined) return defaultValues[prop] || '';\n if (prop === WIDTH || prop === LINK) return `${type}--${propValue}`;\n if (prop === GTM_CLASS_NAME) return `${propValue}`;\n if (prop === STICKY) return propValue ? `${type}--${stringValue}` : '';\n\n return stringValue ? `${type}--${stringValue}` : '';\n })\n .filter(Boolean);\n if (prefix) modifiers.unshift(prefix);\n\n return modifiers.join(' ');\n}\n"],"mappings":";;;AAAA,SAASA,MAAM,EAAEC,WAAW,EAAEC,eAAe,EAAEC,WAAW,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAC5F,OAAOC,yBAAyB,MAAM,sCAAsC;AAE5E,MAAM;EACJC,WAAW;EACXC,OAAO;EACPC,OAAO;EACPC,cAAc;EACdC,IAAI;EACJC,IAAI;EACJC,MAAM;EACNC,QAAQ;EACRC,IAAI;EACJC,MAAM;EACNC,KAAK;EACLC,MAAM;EACNC,KAAK;EACLC;AACF,CAAC,GAAGlB,eAAe;AACnB,MAAMmB,WAAW,GAAG,CAACX,cAAc,EAAEI,QAAQ,CAAC;AAC9C,MAAMQ,eAAe,GAAG,CAACb,OAAO,EAAES,MAAM,EAAEL,MAAM,CAAC;AACjD,MAAMU,WAAW,GAAG,CAACR,IAAI,EAAER,WAAW,EAAEK,IAAI,EAAEK,KAAK,EAAEG,SAAS,EAAE,GAAGC,WAAW,CAAC;AAC/E,MAAMG,SAAS,GAAG,CAACjB,WAAW,EAAE,GAAGc,WAAW,CAAC;AAE/C,MAAMI,gBAAgB,GAAG;EAAEC,KAAK,EAAEL,WAAW;EAAEM,MAAM,EAAE;AAAK,CAAC;AAE7D,MAAMC,cAAc,GAAG;EACrBC,GAAG,EAAE;IAAEH,KAAK,EAAE,CAACP,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"get-class-modifiers.js","names":["BUTTON","BUTTON_ICON","CLASS_MODIFIERS","ICON_BUTTON","LINK","CODE","COMPONENTS_DEFAULT_VALUES","BUTTON_TYPE","DEFAULT","DESKTOP","GTM_CLASS_NAME","HIDE","ICON","MOBILE","MODIFIER","SIZE","STICKY","STYLE","TABLET","WIDTH","ALIGNMENT","commonProps","responsiveProps","buttonProps","iconProps","commonAttributes","props","prefix","supportedTypes","row","column","button","icon","textBlock","_objectSpread","banner","image","hero","video","list","code","getClassModifiers","type","supportedProps","defaultValues","modifiers","map","prop","propValue","stringValue","isResponsiveProp","includes","undefined","filter","Boolean","unshift","join"],"sources":["../../src/utils/get-class-modifiers.js"],"sourcesContent":["import { BUTTON, BUTTON_ICON, CLASS_MODIFIERS, ICON_BUTTON, LINK, CODE } from '../constants';\nimport COMPONENTS_DEFAULT_VALUES from '../constants/componentsDefaultValues';\n\nconst {\n BUTTON_TYPE,\n DEFAULT,\n DESKTOP,\n GTM_CLASS_NAME,\n HIDE,\n ICON,\n MOBILE,\n MODIFIER,\n SIZE,\n STICKY,\n STYLE,\n TABLET,\n WIDTH,\n ALIGNMENT\n} = CLASS_MODIFIERS;\nconst commonProps = [GTM_CLASS_NAME, MODIFIER];\nconst responsiveProps = [DESKTOP, TABLET, MOBILE];\nconst buttonProps = [SIZE, BUTTON_TYPE, ICON, STYLE, ALIGNMENT, ...commonProps];\nconst iconProps = [BUTTON_TYPE, ...commonProps];\n\nconst commonAttributes = { props: commonProps, prefix: null };\n\nconst supportedTypes = {\n row: { props: [WIDTH, STICKY, ...responsiveProps, ...commonProps] },\n column: { props: [WIDTH, STICKY, ...responsiveProps, ...commonProps] },\n button: {\n props: buttonProps,\n prefix: BUTTON\n },\n icon: { props: iconProps, prefix: ICON_BUTTON },\n textBlock: { ...commonAttributes },\n banner: { ...commonAttributes },\n image: { ...commonAttributes },\n hero: { ...commonAttributes },\n video: { ...commonAttributes },\n list: { ...commonAttributes },\n code: { ...commonAttributes, prefix: CODE }\n};\n\nexport default function getClassModifiers(type, props) {\n const { props: supportedProps, prefix } = supportedTypes[type] || {};\n const defaultValues = COMPONENTS_DEFAULT_VALUES[type] || {};\n if (!supportedProps) return '';\n\n const modifiers = supportedProps\n .map(prop => {\n const propValue = props[prop];\n const stringValue = typeof propValue === 'boolean' ? prop : propValue;\n const isResponsiveProp = responsiveProps.includes(prop);\n if (prop === ICON) return propValue ? BUTTON_ICON : '';\n if (prop === MODIFIER && propValue) return `${propValue}`;\n if (propValue === DEFAULT || stringValue === type) return '';\n if (isResponsiveProp) return propValue ? '' : `${HIDE}-${prop}`;\n if (propValue === null || propValue === undefined) return defaultValues[prop] || '';\n if (prop === WIDTH || prop === LINK) return `${type}--${propValue}`;\n if (prop === GTM_CLASS_NAME) return `${propValue}`;\n if (prop === STICKY) return propValue ? `${type}--${stringValue}` : '';\n\n return stringValue ? `${type}--${stringValue}` : '';\n })\n .filter(Boolean);\n if (prefix) modifiers.unshift(prefix);\n\n return modifiers.join(' ');\n}\n"],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaze-cms/react-page-builder",
|
|
3
|
-
"version": "0.131.0
|
|
3
|
+
"version": "0.131.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.131.0
|
|
31
|
-
"@blaze-cms/core-errors": "0.131.0
|
|
32
|
-
"@blaze-cms/core-errors-ui": "0.131.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.131.0
|
|
35
|
-
"@blaze-cms/plugin-search-ui": "0.131.0
|
|
36
|
-
"@blaze-cms/setup-ui": "0.131.0
|
|
37
|
-
"@blaze-cms/utils": "0.131.0
|
|
38
|
-
"@blaze-cms/utils-handlebars": "0.131.0
|
|
34
|
+
"@blaze-cms/nextjs-components": "^0.131.0",
|
|
35
|
+
"@blaze-cms/plugin-search-ui": "^0.131.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": "
|
|
92
|
+
"gitHead": "8448393caa59dd524bd263a07d7bb263550cda13"
|
|
93
93
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useRouter } from 'next/router';
|
|
3
|
+
|
|
4
|
+
const recreateOnNavigation = Component => {
|
|
5
|
+
const InnerComponent = props => {
|
|
6
|
+
const { name } = props;
|
|
7
|
+
const router = useRouter();
|
|
8
|
+
const key = `${router.asPath}:${name}`;
|
|
9
|
+
return <Component {...props} key={key} />;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
InnerComponent.WrappedComponent = Component;
|
|
13
|
+
|
|
14
|
+
InnerComponent.displayName = `recreateOnNavigation(${Component.displayName ||
|
|
15
|
+
Component.name ||
|
|
16
|
+
'Component'})`;
|
|
17
|
+
|
|
18
|
+
return InnerComponent;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default recreateOnNavigation;
|
package/src/components/Button.js
CHANGED
|
@@ -59,8 +59,7 @@ const Button = props => {
|
|
|
59
59
|
|
|
60
60
|
const logout = () => {
|
|
61
61
|
handleLogout(client);
|
|
62
|
-
|
|
63
|
-
return url ? router.reload(urlToUse) : router.reload();
|
|
62
|
+
url ? router.reload(urlToUse) : router.reload();
|
|
64
63
|
};
|
|
65
64
|
|
|
66
65
|
const handleClick = () => {
|
|
@@ -22,8 +22,7 @@ import {
|
|
|
22
22
|
filterQuerySetup,
|
|
23
23
|
shouldSkipSingleQuery,
|
|
24
24
|
shouldReturn,
|
|
25
|
-
getUpdatedSortProperties
|
|
26
|
-
getUpdatedItemsToDisplay
|
|
25
|
+
getUpdatedSortProperties
|
|
27
26
|
} from './helpers';
|
|
28
27
|
|
|
29
28
|
const CardsContainer = dynamic(() => import('./CardsContainer'));
|
|
@@ -96,7 +95,6 @@ const CardsRender = ({
|
|
|
96
95
|
isPreview,
|
|
97
96
|
itemEntityUpdated: unpublishedParentEntityName
|
|
98
97
|
});
|
|
99
|
-
|
|
100
98
|
const {
|
|
101
99
|
data: { entityData: parentEntityData = {} } = {},
|
|
102
100
|
error: _err,
|
|
@@ -124,13 +122,6 @@ const CardsRender = ({
|
|
|
124
122
|
variableProps
|
|
125
123
|
);
|
|
126
124
|
|
|
127
|
-
const updatedItemsToDisplay = getUpdatedItemsToDisplay({
|
|
128
|
-
itemsToDisplay,
|
|
129
|
-
inheritedFilters,
|
|
130
|
-
parentSchema,
|
|
131
|
-
parentEntityData
|
|
132
|
-
});
|
|
133
|
-
|
|
134
125
|
const { limit, variables } = filterQuerySetup({
|
|
135
126
|
getEntitySchemas: Object.values(requiredSchema),
|
|
136
127
|
entity: primaryEntityToUse,
|
|
@@ -139,33 +130,22 @@ const CardsRender = ({
|
|
|
139
130
|
docType: docTypes,
|
|
140
131
|
filterOperator,
|
|
141
132
|
filterEntityRelations,
|
|
142
|
-
itemsToDisplay
|
|
133
|
+
itemsToDisplay,
|
|
143
134
|
entitySameAsCurrentItemEntity,
|
|
144
135
|
useRandomSort
|
|
145
136
|
});
|
|
146
|
-
|
|
147
|
-
const hasNoFiltersOrItemsToDisplay = !updatedItemsToDisplay.length && !updatedFilterBy;
|
|
148
|
-
|
|
149
137
|
const { data: cardData, error: cardsError, loading: cardsLoading } = useQuery(action, {
|
|
150
138
|
variables,
|
|
151
139
|
fetchPolicy: useRandomSort ? 'cache-and-network' : 'cache-first',
|
|
152
|
-
skip: shouldReturn(
|
|
153
|
-
hasNoFiltersOrItemsToDisplay,
|
|
154
|
-
_loading,
|
|
155
|
-
_load,
|
|
156
|
-
schemaLoading,
|
|
157
|
-
_error,
|
|
158
|
-
_err,
|
|
159
|
-
schemaError
|
|
160
|
-
)
|
|
140
|
+
skip: shouldReturn(!updatedFilterBy, _loading, _load, schemaLoading, _error, _err, schemaError)
|
|
161
141
|
});
|
|
162
142
|
|
|
163
|
-
const imageIds =
|
|
143
|
+
const imageIds = itemsToDisplay.map(({ imageId }) => imageId).filter(Boolean);
|
|
164
144
|
const { data: imagesData, loading: imagesLoading } = useGetImages(imageIds, true);
|
|
165
145
|
const isLoading = shouldReturn(_loading, _load, schemaLoading, cardsLoading, imagesLoading);
|
|
166
146
|
const hasError = shouldReturn(_error, _err, schemaError);
|
|
167
147
|
|
|
168
|
-
if (
|
|
148
|
+
if (!updatedFilterBy) return null;
|
|
169
149
|
if (isLoading) return null;
|
|
170
150
|
if (hasError) return null;
|
|
171
151
|
if (cardsError) return cardsError.message;
|
|
@@ -180,7 +160,7 @@ const CardsRender = ({
|
|
|
180
160
|
|
|
181
161
|
const orderedData = useRandomSort
|
|
182
162
|
? cardDataResults
|
|
183
|
-
: sortResponseData(cardDataResults,
|
|
163
|
+
: sortResponseData(cardDataResults, itemsToDisplay);
|
|
184
164
|
const { regularChildren, gtmChildren } = splitChildren(
|
|
185
165
|
children,
|
|
186
166
|
cardDataResults,
|
|
@@ -189,7 +169,7 @@ const CardsRender = ({
|
|
|
189
169
|
name: variableProps.name
|
|
190
170
|
}
|
|
191
171
|
);
|
|
192
|
-
const updatedCards = appendImages(imagesData, orderedData,
|
|
172
|
+
const updatedCards = appendImages(imagesData, orderedData, itemsToDisplay);
|
|
193
173
|
|
|
194
174
|
return (
|
|
195
175
|
<>
|
|
@@ -6,4 +6,3 @@ export { default as filterQuerySetup } from './filter-query-setup';
|
|
|
6
6
|
export { default as shouldReturn } from './should-return';
|
|
7
7
|
export { default as shouldSkipSingleQuery } from './should-skip-single-query';
|
|
8
8
|
export { default as getUpdatedSortProperties } from './get-updated-sort-properties';
|
|
9
|
-
export { default as getUpdatedItemsToDisplay } from './get-updated-items-to-display';
|
|
@@ -7,30 +7,26 @@ import { getClassModifiers } from '../../utils';
|
|
|
7
7
|
import { CODE } from '../../constants';
|
|
8
8
|
import { wrapScriptTags } from './helpers';
|
|
9
9
|
|
|
10
|
-
const Code = memo(({ code: embedCode, parserOptions,
|
|
10
|
+
const Code = memo(({ code: embedCode, parserOptions, ...otherProps }) => {
|
|
11
11
|
if (!embedCode) return null;
|
|
12
12
|
|
|
13
13
|
const parsedCode = parseHTML(embedCode, parserOptions);
|
|
14
14
|
const wrappedCode = wrapScriptTags(parsedCode);
|
|
15
15
|
const modifiers = getClassModifiers(CODE, { ...otherProps });
|
|
16
16
|
|
|
17
|
-
if (disableWrapper) return wrappedCode;
|
|
18
|
-
|
|
19
17
|
return <Wrapper modifiers={modifiers}>{wrappedCode}</Wrapper>;
|
|
20
18
|
});
|
|
21
19
|
|
|
22
20
|
Code.propTypes = {
|
|
23
21
|
code: PropTypes.string,
|
|
24
22
|
modifier: PropTypes.string,
|
|
25
|
-
parserOptions: PropTypes.object
|
|
26
|
-
disableWrapper: PropTypes.bool
|
|
23
|
+
parserOptions: PropTypes.object
|
|
27
24
|
};
|
|
28
25
|
|
|
29
26
|
Code.defaultProps = {
|
|
30
27
|
code: '',
|
|
31
28
|
modifier: '',
|
|
32
|
-
parserOptions: {}
|
|
33
|
-
disableWrapper: false
|
|
29
|
+
parserOptions: {}
|
|
34
30
|
};
|
|
35
31
|
|
|
36
32
|
export default withTitle(Code);
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { hasChildren } from '../../helpers';
|
|
4
4
|
|
|
5
|
-
const ContentGroupSection = ({ children, name }) => {
|
|
5
|
+
const ContentGroupSection = ({ children, name, ...props }) => {
|
|
6
6
|
if (!hasChildren(children)) return null;
|
|
7
7
|
|
|
8
8
|
return (
|
|
@@ -3,7 +3,6 @@ import flatten from 'lodash.flatten';
|
|
|
3
3
|
import getLinkToPublishedContent from './get-link-to-published-content';
|
|
4
4
|
import getLoopPropsLimit from './get-loop-props-limit';
|
|
5
5
|
import getPropValue from './get-prop-value';
|
|
6
|
-
import { processDataSummaryValue } from '../../../helpers';
|
|
7
6
|
|
|
8
7
|
const getLoopValue = value => {
|
|
9
8
|
const { keyField } = value;
|
|
@@ -47,10 +46,8 @@ const buildLoopPropsContent = (loopProps = [], propsToDisplay = [], limit = 0, d
|
|
|
47
46
|
const loopValue = loopValues[key];
|
|
48
47
|
const propValue = loopValue ? getLoopValue(loopValue[i]) : regularValues[key];
|
|
49
48
|
if (!propValue) return null;
|
|
50
|
-
|
|
51
|
-
const processedValue = processDataSummaryValue(propValue, options);
|
|
52
49
|
const linkToPublishedContent = getLinkToPublishedContent(key, data);
|
|
53
|
-
return [upperFirst(label),
|
|
50
|
+
return [upperFirst(label), propValue, linkToPublishedContent, modifier];
|
|
54
51
|
});
|
|
55
52
|
})
|
|
56
53
|
).filter(Boolean);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import upperFirst from 'lodash.upperfirst';
|
|
2
2
|
import flatten from 'lodash.flatten';
|
|
3
|
-
import { isObject
|
|
3
|
+
import { isObject } from '../../../helpers';
|
|
4
4
|
import getLinkToPublishedContent from './get-link-to-published-content';
|
|
5
5
|
import getPropValue from './get-prop-value';
|
|
6
6
|
import getLinkBasedOnValue from './get-link-based-on-value';
|
|
@@ -27,18 +27,15 @@ const buildPropsToDisplayWithContent = (props, propsToDisplay = []) => {
|
|
|
27
27
|
const objPropValue = getPropValue(key, props, options);
|
|
28
28
|
if (!objPropValue) return null;
|
|
29
29
|
|
|
30
|
-
const
|
|
30
|
+
const link = getLink(enableLink, key, props, objPropValue);
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return [upperFirst(label), processedValue, link, modifier];
|
|
32
|
+
return [upperFirst(label), objPropValue, link, modifier];
|
|
35
33
|
});
|
|
36
34
|
})
|
|
37
35
|
).filter(Boolean);
|
|
38
36
|
};
|
|
39
37
|
|
|
40
38
|
export default buildPropsToDisplayWithContent;
|
|
41
|
-
|
|
42
39
|
function getLink(enableLink, key, props, objPropValue) {
|
|
43
40
|
let link = '';
|
|
44
41
|
if (enableLink) {
|
|
@@ -7,43 +7,40 @@ import { getStylesToUpdate, checkIfRowHasColumns } from './helpers';
|
|
|
7
7
|
import { renderChildren, hasChildren } from '../../helpers';
|
|
8
8
|
import { COLUMN } from '../../constants';
|
|
9
9
|
|
|
10
|
-
const Layout = (
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
...otherProps
|
|
19
|
-
}) => {
|
|
20
|
-
const {
|
|
21
|
-
data: { getFile: { url = null } = {} }
|
|
22
|
-
} = useGetImages(backgroundImage);
|
|
10
|
+
const Layout = React.forwardRef(
|
|
11
|
+
(
|
|
12
|
+
{ type, children, settings, modifier, backgroundImage, tagType, dataNoSnippet, ...otherProps },
|
|
13
|
+
ref
|
|
14
|
+
) => {
|
|
15
|
+
const {
|
|
16
|
+
data: { getFile: { url = null } = {} }
|
|
17
|
+
} = useGetImages(backgroundImage);
|
|
23
18
|
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
const style = getStylesToUpdate({ backgroundImage: url });
|
|
20
|
+
const { title } = settings;
|
|
26
21
|
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
const classModifiers = getClassModifiers(type, { modifier, ...otherProps });
|
|
23
|
+
const additionalRowModifier = checkIfRowHasColumns(type, children) ? ' display-row' : '';
|
|
29
24
|
|
|
30
|
-
|
|
25
|
+
if (type === COLUMN && !hasChildren(children)) return null;
|
|
31
26
|
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
const otherWrapperProps = {};
|
|
28
|
+
if (dataNoSnippet) otherWrapperProps['data-nosnippet'] = true;
|
|
34
29
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
30
|
+
return (
|
|
31
|
+
<Wrapper
|
|
32
|
+
ref={ref}
|
|
33
|
+
tagType={tagType}
|
|
34
|
+
className={type}
|
|
35
|
+
modifiers={`${classModifiers}${additionalRowModifier}`}
|
|
36
|
+
style={style}
|
|
37
|
+
{...otherWrapperProps}>
|
|
38
|
+
{title && <h2 className="heading heading--section">{title}</h2>}
|
|
39
|
+
{renderChildren(children, otherProps)}
|
|
40
|
+
</Wrapper>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
);
|
|
47
44
|
|
|
48
45
|
Layout.propTypes = {
|
|
49
46
|
type: PropTypes.string.isRequired,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import dynamic from 'next/dynamic';
|
|
3
|
+
import Layout from './Layout';
|
|
4
|
+
|
|
5
|
+
const LayoutWithStickyTimer = dynamic(() =>
|
|
6
|
+
import(/* webpackChunkName: "blazePbLayoutWithStickyTimer" */ './LayoutWithStickyTimer')
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
const LayoutFactory = props => {
|
|
10
|
+
const { sticky, stickyTimer } = props;
|
|
11
|
+
|
|
12
|
+
if (sticky && stickyTimer) return <LayoutWithStickyTimer {...props} />;
|
|
13
|
+
|
|
14
|
+
return <Layout {...props} />;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default LayoutFactory;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { useInView } from '@blaze-react/utils/lib/customHooks';
|
|
4
|
+
import recreateOnNavigation from '../../HOC/recreateOnNavigation';
|
|
5
|
+
import Layout from './Layout';
|
|
6
|
+
|
|
7
|
+
const LayoutWithStickyTimer = ({ sticky, stickyTimer, ...otherProps }) => {
|
|
8
|
+
const [isIntersecting, outerRef] = useInView({});
|
|
9
|
+
const [isSticky, setIsSticky] = useState(sticky);
|
|
10
|
+
|
|
11
|
+
useEffect(
|
|
12
|
+
() => {
|
|
13
|
+
if (isIntersecting && sticky && !!stickyTimer) {
|
|
14
|
+
setIsSticky(true);
|
|
15
|
+
const timer = setTimeout(() => {
|
|
16
|
+
setIsSticky(false);
|
|
17
|
+
}, stickyTimer);
|
|
18
|
+
|
|
19
|
+
return () => {
|
|
20
|
+
clearTimeout(timer);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
[isIntersecting, stickyTimer, sticky]
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
return <Layout {...otherProps} sticky={isSticky} ref={sticky ? outerRef : null} />;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
LayoutWithStickyTimer.propTypes = {
|
|
31
|
+
sticky: PropTypes.bool,
|
|
32
|
+
stickyTimer: PropTypes.number
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
LayoutWithStickyTimer.defaultProps = {
|
|
36
|
+
sticky: false,
|
|
37
|
+
stickyTimer: 0
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default recreateOnNavigation(LayoutWithStickyTimer);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import LayoutFactory from './LayoutFactory';
|
|
2
2
|
|
|
3
|
-
export default
|
|
3
|
+
export default LayoutFactory;
|
|
@@ -7,13 +7,7 @@ import { MainContext } from '@blaze-cms/nextjs-components';
|
|
|
7
7
|
import { generateSingleItemQuery, getItemList } from '../../application/query';
|
|
8
8
|
import ListBuilder from './ListBuilder';
|
|
9
9
|
import { AZ_LIST_TYPE } from './constants';
|
|
10
|
-
import {
|
|
11
|
-
getAzQueryFilter,
|
|
12
|
-
getSortProps,
|
|
13
|
-
hasRequiredItemListDetails,
|
|
14
|
-
getListSpecificSearchFilter,
|
|
15
|
-
getListQuery
|
|
16
|
-
} from './helpers';
|
|
10
|
+
import { getAzQueryFilter, getSortProps, hasRequiredItemListDetails } from './helpers';
|
|
17
11
|
import {
|
|
18
12
|
getGenericProps,
|
|
19
13
|
getRequiredSchemas,
|
|
@@ -43,7 +37,7 @@ const ListFactory = props => {
|
|
|
43
37
|
type,
|
|
44
38
|
sortby: defaultSortBy,
|
|
45
39
|
sort: defaultSort,
|
|
46
|
-
|
|
40
|
+
searchFilter,
|
|
47
41
|
operator: filterOperator,
|
|
48
42
|
sortProperties,
|
|
49
43
|
itemListName
|
|
@@ -52,13 +46,11 @@ const ListFactory = props => {
|
|
|
52
46
|
const router = useRouter();
|
|
53
47
|
const { asPath } = router;
|
|
54
48
|
const parsedQuery = asPath.replace(/%5D/g, ']').replace(/%5B/g, '[');
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const updatedQuery = getListQuery(query, hasListSpecificFilters, name);
|
|
61
|
-
const { sort: querySort, sortby: querySortBy } = updatedQuery;
|
|
49
|
+
const {
|
|
50
|
+
query,
|
|
51
|
+
url,
|
|
52
|
+
query: { sort: querySort, sortby: querySortBy, itemListId: queryItemListId } = {}
|
|
53
|
+
} = parseUrl(parsedQuery);
|
|
62
54
|
const { sortbyFilters, updatedSortProperties } = getSortProps({
|
|
63
55
|
querySort,
|
|
64
56
|
sortProperties,
|
|
@@ -70,8 +62,8 @@ const ListFactory = props => {
|
|
|
70
62
|
const itemListId = getItemListId(itemListName, queryItemListId);
|
|
71
63
|
const { itemEntity: parentEntity, itemId: parentId } = parent;
|
|
72
64
|
const updatedParentEntity = getUnpublishedEntityName(parentEntity);
|
|
73
|
-
const paginationIndex = getPaginationIndex(
|
|
74
|
-
const azFilter = getAzQueryFilter(
|
|
65
|
+
const paginationIndex = getPaginationIndex(query, name);
|
|
66
|
+
const azFilter = getAzQueryFilter(query, name);
|
|
75
67
|
|
|
76
68
|
const entitiesToUse = entities && entities.length ? entities : [legacyEntity];
|
|
77
69
|
const [filterEntity] = entitiesToUse;
|
|
@@ -131,12 +123,10 @@ const ListFactory = props => {
|
|
|
131
123
|
const [textFilter] = getSearchFilterType(searchFilter, TEXT_SEARCH);
|
|
132
124
|
const shouldApplyTextFilter = textFilter && textFilter.propsToDisplay.length;
|
|
133
125
|
const operator = shouldApplyTextFilter ? getElasticsearchOperator(textFilter) : AND_OPERATOR;
|
|
134
|
-
const valuesText = shouldApplyTextFilter
|
|
135
|
-
|
|
136
|
-
: [];
|
|
137
|
-
const { valuesAnd, valuesOr } = getQueryFilters(searchFilter, updatedQuery, name);
|
|
126
|
+
const valuesText = shouldApplyTextFilter ? buildSearchValuesText(textFilter, query) : [];
|
|
127
|
+
const { valuesAnd, valuesOr } = getQueryFilters(searchFilter, query);
|
|
138
128
|
const isTextSearchFilterApplied = !!(
|
|
139
|
-
|
|
129
|
+
query.search_term &&
|
|
140
130
|
searchFilter &&
|
|
141
131
|
getSearchFilterType(searchFilter, TEXT_SEARCH).length
|
|
142
132
|
);
|
|
@@ -149,7 +139,7 @@ const ListFactory = props => {
|
|
|
149
139
|
const listProps = {
|
|
150
140
|
...props,
|
|
151
141
|
...genericProps,
|
|
152
|
-
query
|
|
142
|
+
query,
|
|
153
143
|
url,
|
|
154
144
|
isCard,
|
|
155
145
|
isAZ,
|
|
@@ -189,7 +179,7 @@ ListFactory.propTypes = {
|
|
|
189
179
|
name: PropTypes.string,
|
|
190
180
|
sortby: PropTypes.array,
|
|
191
181
|
sort: PropTypes.string,
|
|
192
|
-
|
|
182
|
+
searchFilter: PropTypes.object,
|
|
193
183
|
sortProperties: PropTypes.array,
|
|
194
184
|
itemListName: PropTypes.string
|
|
195
185
|
};
|
|
@@ -205,7 +195,7 @@ ListFactory.defaultProps = {
|
|
|
205
195
|
sortProperties: [],
|
|
206
196
|
sort: '',
|
|
207
197
|
operator: AND,
|
|
208
|
-
|
|
198
|
+
searchFilter: {},
|
|
209
199
|
itemListName: ''
|
|
210
200
|
};
|
|
211
201
|
|
|
@@ -7,5 +7,3 @@ export { default as getItemsPerPageToUse } from './get-items-per-page-to-use';
|
|
|
7
7
|
export { default as getSortProps } from './get-sort-props';
|
|
8
8
|
export { default as hasRequiredItemListDetails } from './has-required-item-list-details';
|
|
9
9
|
export { default as getListComponent } from './get-list-component';
|
|
10
|
-
export { default as getListQuery } from './get-list-query';
|
|
11
|
-
export { default as getListSpecificSearchFilter } from './get-list-specific-search-filter';
|
|
@@ -10,12 +10,12 @@ const SearchContent = ({
|
|
|
10
10
|
searchInputAlignment,
|
|
11
11
|
searchInputWrapperMobile,
|
|
12
12
|
searchInputWrapperDesktop,
|
|
13
|
+
collapsible,
|
|
13
14
|
isMobile,
|
|
14
15
|
placeholder,
|
|
15
|
-
modifier
|
|
16
|
-
collapsedSearch
|
|
16
|
+
modifier
|
|
17
17
|
}) => {
|
|
18
|
-
const [collapsed, setCollapsed] = useState(
|
|
18
|
+
const [collapsed, setCollapsed] = useState(collapsible);
|
|
19
19
|
const router = useRouter();
|
|
20
20
|
|
|
21
21
|
const { results, searchTerm, setSearchTerm, debouncedSearchTerm } = useDebounceSearch({
|
|
@@ -50,7 +50,7 @@ const SearchContent = ({
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
const handleOnBlur = () => {
|
|
53
|
-
if (!
|
|
53
|
+
if (!collapsible) return;
|
|
54
54
|
if (!debouncedSearchTerm || debouncedSearchTerm === '') setCollapsed(true);
|
|
55
55
|
};
|
|
56
56
|
|
|
@@ -120,8 +120,7 @@ SearchContent.propTypes = {
|
|
|
120
120
|
isMobile: PropTypes.bool,
|
|
121
121
|
collapsible: PropTypes.bool,
|
|
122
122
|
entities: PropTypes.array.isRequired,
|
|
123
|
-
modifier: PropTypes.string
|
|
124
|
-
collapsedSearch: PropTypes.bool
|
|
123
|
+
modifier: PropTypes.string
|
|
125
124
|
};
|
|
126
125
|
|
|
127
126
|
SearchContent.defaultProps = {
|
|
@@ -131,8 +130,7 @@ SearchContent.defaultProps = {
|
|
|
131
130
|
placeholder: '',
|
|
132
131
|
isMobile: false,
|
|
133
132
|
collapsible: false,
|
|
134
|
-
modifier: ''
|
|
135
|
-
collapsedSearch: false
|
|
133
|
+
modifier: ''
|
|
136
134
|
};
|
|
137
135
|
|
|
138
136
|
export default SearchContent;
|