@blaze-cms/react-page-builder 0.139.0-project-admin-customisations.0 → 0.139.1-core-styles.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 +77 -3
- package/README.md +9 -0
- package/lib/components/Banner/BannerRender.js +2 -2
- package/lib/components/Banner/BannerRender.js.map +1 -1
- package/lib/components/Banner/helpers.js +2 -2
- package/lib/components/Banner/helpers.js.map +1 -1
- package/lib/components/BlazeLink.js +2 -2
- package/lib/components/BlazeLink.js.map +1 -1
- package/lib/components/Button.js +2 -2
- package/lib/components/Button.js.map +1 -1
- package/lib/components/Card/Card.js +5 -3
- package/lib/components/Card/Card.js.map +1 -1
- package/lib/components/Card/CardsContainer.js +3 -6
- package/lib/components/Card/CardsContainer.js.map +1 -1
- package/lib/components/Card/CardsRender.js +3 -4
- package/lib/components/Card/CardsRender.js.map +1 -1
- package/lib/components/Card/helpers/filter-query-setup.js +2 -2
- package/lib/components/Card/helpers/filter-query-setup.js.map +1 -1
- package/lib/components/Carousel/Carousel.js +26 -17
- package/lib/components/Carousel/Carousel.js.map +1 -1
- package/lib/components/Carousel/CarouselRender/CarouselRender.js +34 -60
- package/lib/components/Carousel/CarouselRender/CarouselRender.js.map +1 -1
- package/lib/components/Carousel/hooks/useCarouselNavigation.js +56 -0
- package/lib/components/Carousel/hooks/useCarouselNavigation.js.map +1 -0
- package/lib/components/ClickWrapper.js +2 -2
- package/lib/components/ClickWrapper.js.map +1 -1
- package/lib/components/Code/Code.js +2 -2
- package/lib/components/Code/Code.js.map +1 -1
- package/lib/components/Image/Image.js +2 -2
- package/lib/components/Image/Image.js.map +1 -1
- package/lib/components/Image/ImageFactory.js +20 -8
- package/lib/components/Image/ImageFactory.js.map +1 -1
- package/lib/components/Image/ImageRender.js +8 -2
- package/lib/components/Image/ImageRender.js.map +1 -1
- package/lib/components/Layout/Layout.js +9 -5
- package/lib/components/Layout/Layout.js.map +1 -1
- package/lib/components/List/ListBuilder.js +2 -2
- package/lib/components/List/ListBuilder.js.map +1 -1
- package/lib/components/List/ListFactory.js +2 -2
- package/lib/components/List/ListFactory.js.map +1 -1
- package/lib/components/List/components/Cards/CardsRender.js +2 -2
- package/lib/components/List/components/Cards/CardsRender.js.map +1 -1
- package/lib/components/List/components/Full/FullRender.js +9 -5
- package/lib/components/List/components/Full/FullRender.js.map +1 -1
- package/lib/components/List/components/Full/FullRenderItem.js +2 -2
- package/lib/components/List/components/Full/FullRenderItem.js.map +1 -1
- package/lib/components/List/components/Pagination/ListPagination.js +2 -2
- package/lib/components/List/components/Pagination/ListPagination.js.map +1 -1
- package/lib/components/List/helpers/build-az-url.js +2 -2
- package/lib/components/List/helpers/build-az-url.js.map +1 -1
- package/lib/components/List/helpers/build-pagination-url.js +2 -2
- package/lib/components/List/helpers/build-pagination-url.js.map +1 -1
- package/lib/components/SearchContent/SearchContent.js +55 -52
- package/lib/components/SearchContent/SearchContent.js.map +1 -1
- package/lib/components/SearchContent/SearchContentResults.js +16 -17
- package/lib/components/SearchContent/SearchContentResults.js.map +1 -1
- package/lib/components/SearchContent/SearchContentToggleIcon.js +8 -16
- package/lib/components/SearchContent/SearchContentToggleIcon.js.map +1 -1
- package/lib/components/SearchContent/constants.js +12 -0
- package/lib/components/SearchContent/constants.js.map +1 -0
- package/lib/components/SearchFilter/components/Range.js +2 -2
- package/lib/components/SearchFilter/components/Range.js.map +1 -1
- package/lib/components/SearchFilter/searchFilterReducer.js +2 -2
- package/lib/components/SearchFilterSort/helpers/update-sort.js +2 -2
- package/lib/components/SearchFilterSort/helpers/update-sort.js.map +1 -1
- package/lib/components/TextBlock/index.js +2 -2
- package/lib/components/TextBlock/index.js.map +1 -1
- package/lib/components/Video/Video.js +2 -2
- package/lib/components/Video/Video.js.map +1 -1
- package/lib/components/Video/providers/JWPlayer/JWPlayerProvider.js +2 -2
- package/lib/components/Video/providers/JWPlayer/JWPlayerProvider.js.map +1 -1
- package/lib/helpers/append-images.js +2 -2
- package/lib/helpers/build-raw-query-base.js +2 -2
- package/lib/helpers/build-raw-query-base.js.map +1 -1
- package/lib/helpers/build-raw-query.js +2 -2
- package/lib/helpers/build-raw-query.js.map +1 -1
- package/lib/helpers/get-banner-data.js +2 -2
- package/lib/helpers/get-click-wrapper-options.js +2 -2
- package/lib/helpers/get-click-wrapper-options.js.map +1 -1
- package/lib/helpers/get-entities-with-banner.js +2 -2
- package/lib/helpers/get-entities-with-banner.js.map +1 -1
- package/lib/helpers/get-generic-props.js +2 -2
- package/lib/helpers/get-generic-props.js.map +1 -1
- package/lib/helpers/get-generic-render-variables.js +2 -2
- package/lib/helpers/get-generic-render-variables.js.map +1 -1
- package/lib/helpers/inject-multiple-banners/get-banners-for-nodes/get-banners-for-nodes.js +2 -2
- package/lib/helpers/inject-multiple-banners/get-banners-for-nodes/get-banners-for-nodes.js.map +1 -1
- package/lib/helpers/process-data-summary-value.js +2 -2
- package/lib/helpers/process-data-summary-value.js.map +1 -1
- package/lib/helpers/remove-unwanted-characters.js +2 -2
- package/lib/helpers/render-children.js +2 -2
- package/lib/helpers/render-children.js.map +1 -1
- package/lib/helpers/split-children.js +2 -2
- package/lib/helpers/update-childrens-parent.js +2 -2
- package/lib/hooks/helpers/RenderComponent.js +9 -2
- package/lib/hooks/helpers/RenderComponent.js.map +1 -1
- package/lib/hooks/helpers/append-gtm-classname.js +2 -2
- package/lib/hooks/helpers/append-gtm-classname.js.map +1 -1
- package/lib/hooks/helpers/buildPBComponents.js +2 -2
- package/lib/hooks/helpers/buildPBComponents.js.map +1 -1
- package/lib/hooks/helpers/get-lightbox-images.js +2 -2
- package/lib/hooks/helpers/get-lightbox-images.js.map +1 -1
- package/lib/hooks/helpers/getVariant.js +18 -0
- package/lib/hooks/helpers/getVariant.js.map +1 -0
- package/lib/hooks/helpers/inject-element-banners.js +2 -2
- package/lib/hooks/helpers/inject-element-banners.js.map +1 -1
- package/lib/hooks/helpers/inject-textblock-banners.js +2 -2
- package/lib/hooks/helpers/inject-textblock-banners.js.map +1 -1
- package/lib/hooks/use-get-image-id-from-relation.js +2 -2
- package/lib/hooks/use-get-image-id-from-relation.js.map +1 -1
- package/lib/hooks/use-get-images.js +4 -3
- package/lib/hooks/use-get-images.js.map +1 -1
- package/lib/index.js +13 -0
- package/lib/index.js.map +1 -1
- package/lib/utils/component-map.js +4 -4
- package/lib/utils/component-map.js.map +1 -1
- package/lib/utils/get-class-modifiers.js +2 -2
- package/lib/utils/get-class-modifiers.js.map +1 -1
- package/lib/utils/index.js +7 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/variant-handler.js +40 -0
- package/lib/utils/variant-handler.js.map +1 -0
- package/lib/variants/index.js +10 -0
- package/lib/variants/index.js.map +1 -0
- package/lib-es/components/Banner/BannerRender.js +2 -2
- package/lib-es/components/Banner/helpers.js +2 -2
- package/lib-es/components/BlazeLink.js +2 -2
- package/lib-es/components/Button.js +2 -2
- package/lib-es/components/Card/Card.js +5 -3
- package/lib-es/components/Card/Card.js.map +1 -1
- package/lib-es/components/Card/CardsContainer.js +4 -7
- package/lib-es/components/Card/CardsContainer.js.map +1 -1
- package/lib-es/components/Card/CardsRender.js +3 -4
- package/lib-es/components/Card/CardsRender.js.map +1 -1
- package/lib-es/components/Card/helpers/filter-query-setup.js +2 -2
- package/lib-es/components/Carousel/Carousel.js +27 -17
- package/lib-es/components/Carousel/Carousel.js.map +1 -1
- package/lib-es/components/Carousel/CarouselRender/CarouselRender.js +33 -53
- package/lib-es/components/Carousel/CarouselRender/CarouselRender.js.map +1 -1
- package/lib-es/components/Carousel/hooks/useCarouselNavigation.js +49 -0
- package/lib-es/components/Carousel/hooks/useCarouselNavigation.js.map +1 -0
- package/lib-es/components/ClickWrapper.js +2 -2
- package/lib-es/components/Code/Code.js +2 -2
- package/lib-es/components/Image/Image.js +2 -2
- package/lib-es/components/Image/ImageFactory.js +18 -8
- package/lib-es/components/Image/ImageFactory.js.map +1 -1
- package/lib-es/components/Image/ImageRender.js +9 -3
- package/lib-es/components/Image/ImageRender.js.map +1 -1
- package/lib-es/components/Layout/Layout.js +10 -6
- package/lib-es/components/Layout/Layout.js.map +1 -1
- package/lib-es/components/List/ListBuilder.js +2 -2
- package/lib-es/components/List/ListFactory.js +2 -2
- package/lib-es/components/List/components/Cards/CardsRender.js +2 -2
- package/lib-es/components/List/components/Full/FullRender.js +11 -7
- package/lib-es/components/List/components/Full/FullRender.js.map +1 -1
- package/lib-es/components/List/components/Full/FullRenderItem.js +2 -2
- package/lib-es/components/List/components/Pagination/ListPagination.js +2 -2
- package/lib-es/components/List/helpers/build-az-url.js +2 -2
- package/lib-es/components/List/helpers/build-pagination-url.js +2 -2
- package/lib-es/components/SearchContent/SearchContent.js +53 -49
- package/lib-es/components/SearchContent/SearchContent.js.map +1 -1
- package/lib-es/components/SearchContent/SearchContentResults.js +16 -17
- package/lib-es/components/SearchContent/SearchContentResults.js.map +1 -1
- package/lib-es/components/SearchContent/SearchContentToggleIcon.js +13 -23
- package/lib-es/components/SearchContent/SearchContentToggleIcon.js.map +1 -1
- package/lib-es/components/SearchContent/constants.js +4 -0
- package/lib-es/components/SearchContent/constants.js.map +1 -0
- package/lib-es/components/SearchFilter/components/Range.js +2 -2
- package/lib-es/components/SearchFilter/searchFilterReducer.js +2 -2
- package/lib-es/components/SearchFilterSort/helpers/update-sort.js +2 -2
- package/lib-es/components/TextBlock/index.js +2 -2
- package/lib-es/components/Video/Video.js +2 -2
- package/lib-es/components/Video/providers/JWPlayer/JWPlayerProvider.js +2 -2
- package/lib-es/helpers/append-images.js +2 -2
- package/lib-es/helpers/build-raw-query-base.js +2 -2
- package/lib-es/helpers/build-raw-query.js +2 -2
- package/lib-es/helpers/get-banner-data.js +2 -2
- package/lib-es/helpers/get-click-wrapper-options.js +2 -2
- package/lib-es/helpers/get-entities-with-banner.js +2 -2
- package/lib-es/helpers/get-generic-props.js +2 -2
- package/lib-es/helpers/get-generic-render-variables.js +2 -2
- package/lib-es/helpers/inject-multiple-banners/get-banners-for-nodes/get-banners-for-nodes.js +2 -2
- package/lib-es/helpers/process-data-summary-value.js +2 -2
- package/lib-es/helpers/remove-unwanted-characters.js +2 -2
- package/lib-es/helpers/render-children.js +2 -2
- package/lib-es/helpers/split-children.js +2 -2
- package/lib-es/helpers/update-childrens-parent.js +2 -2
- package/lib-es/hooks/helpers/RenderComponent.js +5 -2
- package/lib-es/hooks/helpers/RenderComponent.js.map +1 -1
- package/lib-es/hooks/helpers/append-gtm-classname.js +2 -2
- package/lib-es/hooks/helpers/buildPBComponents.js +2 -2
- package/lib-es/hooks/helpers/get-lightbox-images.js +2 -2
- package/lib-es/hooks/helpers/getVariant.js +14 -0
- package/lib-es/hooks/helpers/getVariant.js.map +1 -0
- package/lib-es/hooks/helpers/inject-element-banners.js +2 -2
- package/lib-es/hooks/helpers/inject-textblock-banners.js +2 -2
- package/lib-es/hooks/use-get-image-id-from-relation.js +2 -2
- package/lib-es/hooks/use-get-image-id-from-relation.js.map +1 -1
- package/lib-es/hooks/use-get-images.js +4 -4
- package/lib-es/hooks/use-get-images.js.map +1 -1
- package/lib-es/index.js +2 -1
- package/lib-es/index.js.map +1 -1
- package/lib-es/utils/component-map.js +4 -4
- package/lib-es/utils/component-map.js.map +1 -1
- package/lib-es/utils/get-class-modifiers.js +2 -2
- package/lib-es/utils/index.js +2 -1
- package/lib-es/utils/index.js.map +1 -1
- package/lib-es/utils/variant-handler.js +26 -0
- package/lib-es/utils/variant-handler.js.map +1 -0
- package/lib-es/variants/index.js +2 -0
- package/lib-es/variants/index.js.map +1 -0
- package/package.json +11 -11
- package/src/components/Card/Card.js +1 -2
- package/src/components/Card/CardsContainer.js +0 -3
- package/src/components/Card/CardsRender.js +0 -1
- package/src/components/Carousel/Carousel.js +28 -12
- package/src/components/Carousel/CarouselRender/CarouselRender.js +36 -56
- package/src/components/Carousel/hooks/useCarouselNavigation.js +50 -0
- package/src/components/Image/ImageFactory.js +20 -5
- package/src/components/Image/ImageRender.js +14 -8
- package/src/components/Layout/Layout.js +8 -5
- package/src/components/List/components/Full/FullRender.js +11 -3
- package/src/components/SearchContent/SearchContent.js +66 -52
- package/src/components/SearchContent/SearchContentResults.js +17 -17
- package/src/components/SearchContent/SearchContentToggleIcon.js +10 -23
- package/src/components/SearchContent/constants.js +6 -0
- package/src/hooks/helpers/RenderComponent.js +4 -0
- package/src/hooks/helpers/getVariant.js +11 -0
- package/src/hooks/use-get-image-id-from-relation.js +13 -2
- package/src/hooks/use-get-images.js +4 -4
- package/src/index.js +2 -1
- package/src/utils/component-map.js +4 -5
- package/src/utils/index.js +9 -1
- package/src/utils/variant-handler.js +33 -0
- package/src/variants/index.js +1 -0
- package/tests/unit/src/components/Carousel/Carousel.test.js +23 -0
- package/tests/unit/src/components/Carousel/CarouselRender/CarouselRender.test.js +14 -22
- package/tests/unit/src/components/Carousel/__snapshots__/Carousel.test.js.snap +10 -0
- package/tests/unit/src/components/Image/ImageFactory.test.js +20 -3
- package/tests/unit/src/components/Image/ImageRender.test.js +12 -0
- package/tests/unit/src/components/Image/__snapshots__/ImageFactory.test.js.snap +24 -0
- package/tests/unit/src/components/Image/__snapshots__/ImageRender.test.js.snap +9 -0
- package/tests/unit/src/components/Image/mocks.js +49 -1
- package/tests/unit/src/components/Layout/Layout.test.js +11 -0
- package/tests/unit/src/components/List/components/Full/FullRender.test.js +14 -1
- package/tests/unit/src/components/List/components/Full/__snapshots__/FullRender.test.js.snap +24 -6
- package/tests/unit/src/components/List/components/mocks.js +9 -3
- package/tests/unit/src/components/Menu/__snapshots__/Menu.test.js.snap +1 -1
- package/tests/unit/src/components/PlaceholderIcon/__snapshots__/index.test.js.snap +4 -6
- package/tests/unit/src/components/SearchContent/SearchContent.test.js +32 -7
- package/tests/unit/src/components/SearchContent/__snapshots__/SearchContent.test.js.snap +66 -2
- package/tests/unit/src/utils/variant-handler.test.js +41 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
4
|
function removeUnwantedCharacters(value) {
|
|
5
5
|
const args = value !== null && value !== void 0 ? value : '';
|
|
6
6
|
return Array.isArray(args) ? value.map(removeUnwantedCharacters) : removeCharacters(args);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { CHILD_PROPS_TO_USE } from '../constants';
|
|
6
6
|
const buildChildProps = (childProps, parentProps) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
4
|
/* eslint-disable no-param-reassign */
|
|
5
5
|
const filterChildren = (children, parentComponent) => {
|
|
6
6
|
const withGTMChildren = [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
4
|
const updateChildrensParent = (cardChildren, id, entity) => {
|
|
5
5
|
const hasCardChildren = !!cardChildren && Object.keys(cardChildren).length && cardChildren.props;
|
|
6
6
|
if (hasCardChildren && cardChildren.props.children) {
|
|
@@ -5,6 +5,7 @@ import React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import ErrorBoundary from '@blaze-cms/core-errors-ui';
|
|
7
7
|
import getComponent from './getComponent';
|
|
8
|
+
import getVariant from './getVariant';
|
|
8
9
|
import appendGtmClassName from './append-gtm-classname';
|
|
9
10
|
import { PB_TYPE_IMAGE, PB_TYPE_BANNER, PB_TYPE_TEXTBLOCK, PB_TYPE_CAROUSEL } from './constants';
|
|
10
11
|
import { BannerContextProvider } from '../../BannerContext';
|
|
@@ -30,10 +31,12 @@ const RenderComponent = _ref => {
|
|
|
30
31
|
const imageOptions = isImage ? imageProps : {};
|
|
31
32
|
if (!Component) return null;
|
|
32
33
|
const updatedSettings = appendGtmClassName(settings, childComponents);
|
|
34
|
+
const [VariantComponent, variantSettings] = getVariant(settings);
|
|
33
35
|
return /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(Component, _extends({
|
|
34
36
|
key: id,
|
|
35
|
-
type: type
|
|
36
|
-
|
|
37
|
+
type: type,
|
|
38
|
+
VariantComponent: VariantComponent
|
|
39
|
+
}, options, imageOptions, nestedComponentsProps, updatedSettings, variantSettings, {
|
|
37
40
|
name: name || settings.name
|
|
38
41
|
}), hasTextBlockBanners ? /*#__PURE__*/React.createElement(BannerContextProvider, {
|
|
39
42
|
siblings: siblings,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderComponent.js","names":["React","PropTypes","ErrorBoundary","getComponent","appendGtmClassName","PB_TYPE_IMAGE","PB_TYPE_BANNER","PB_TYPE_TEXTBLOCK","PB_TYPE_CAROUSEL","BannerContextProvider","RenderComponent","_ref","component","imageProps","childComponents","options","textBlockBanners","hasTextBlockBanners","siblings","nestedComponentsProps","_objectWithoutProperties","_excluded","type","settings","id","name","Component","isImage","includes","imageOptions","updatedSettings","createElement","_extends","key","banners","pbOptions","propTypes","shape","string","object","items","array","isRequired","node","bool","defaultProps"],"sources":["../../../src/hooks/helpers/RenderComponent.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport ErrorBoundary from '@blaze-cms/core-errors-ui';\nimport getComponent from './getComponent';\nimport appendGtmClassName from './append-gtm-classname';\nimport { PB_TYPE_IMAGE, PB_TYPE_BANNER, PB_TYPE_TEXTBLOCK, PB_TYPE_CAROUSEL } from './constants';\nimport { BannerContextProvider } from '../../BannerContext';\n\nconst RenderComponent = ({\n component,\n imageProps,\n childComponents,\n options = {},\n textBlockBanners,\n hasTextBlockBanners,\n siblings,\n ...nestedComponentsProps\n}) => {\n const { type, settings, id, name } = component;\n const Component = getComponent(type);\n const isImage = [PB_TYPE_IMAGE, PB_TYPE_BANNER, PB_TYPE_TEXTBLOCK, PB_TYPE_CAROUSEL].includes(\n type\n );\n const imageOptions = isImage ? imageProps : {};\n if (!Component) return null;\n const updatedSettings = appendGtmClassName(settings, childComponents);\n\n return (\n <ErrorBoundary>\n <Component\n key={id}\n type={type}\n {...options}\n {...imageOptions}\n {...nestedComponentsProps}\n {...updatedSettings}\n name={name || settings.name}>\n {hasTextBlockBanners ? (\n <BannerContextProvider siblings={siblings} banners={textBlockBanners} pbOptions={options}>\n {childComponents}\n </BannerContextProvider>\n ) : (\n childComponents\n )}\n </Component>\n </ErrorBoundary>\n );\n};\n\nRenderComponent.propTypes = {\n component: PropTypes.shape({\n type: PropTypes.string,\n id: PropTypes.string,\n name: PropTypes.string,\n settings: PropTypes.object,\n items: PropTypes.array\n }).isRequired,\n imageProps: PropTypes.object.isRequired,\n options: PropTypes.object.isRequired,\n childComponents: PropTypes.node.isRequired,\n textBlockBanners: PropTypes.array,\n hasTextBlockBanners: PropTypes.bool,\n siblings: PropTypes.array\n};\n\nRenderComponent.defaultProps = { textBlockBanners: null, hasTextBlockBanners: false, siblings: [] };\n\nexport default RenderComponent;\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,aAAa,MAAM,2BAA2B;AACrD,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,kBAAkB,MAAM,wBAAwB;AACvD,SAASC,aAAa,EAAEC,cAAc,EAAEC,iBAAiB,EAAEC,gBAAgB,QAAQ,aAAa;AAChG,SAASC,qBAAqB,QAAQ,qBAAqB;AAE3D,MAAMC,eAAe,GAAGC,IAAA,IASlB;EAAA,IATmB;MACvBC,SAAS;MACTC,UAAU;MACVC,eAAe;MACfC,OAAO,GAAG,CAAC,CAAC;MACZC,gBAAgB;MAChBC,mBAAmB;MACnBC;IAEF,CAAC,GAAAP,IAAA;IADIQ,qBAAqB,GAAAC,wBAAA,CAAAT,IAAA,EAAAU,SAAA;EAExB,MAAM;IAAEC,IAAI;IAAEC,QAAQ;IAAEC,EAAE;IAAEC;EAAK,CAAC,GAAGb,SAAS;EAC9C,MAAMc,SAAS,
|
|
1
|
+
{"version":3,"file":"RenderComponent.js","names":["React","PropTypes","ErrorBoundary","getComponent","getVariant","appendGtmClassName","PB_TYPE_IMAGE","PB_TYPE_BANNER","PB_TYPE_TEXTBLOCK","PB_TYPE_CAROUSEL","BannerContextProvider","RenderComponent","_ref","component","imageProps","childComponents","options","textBlockBanners","hasTextBlockBanners","siblings","nestedComponentsProps","_objectWithoutProperties","_excluded","type","settings","id","name","Component","isImage","includes","imageOptions","updatedSettings","VariantComponent","variantSettings","createElement","_extends","key","banners","pbOptions","propTypes","shape","string","object","items","array","isRequired","node","bool","defaultProps"],"sources":["../../../src/hooks/helpers/RenderComponent.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport ErrorBoundary from '@blaze-cms/core-errors-ui';\nimport getComponent from './getComponent';\nimport getVariant from './getVariant';\nimport appendGtmClassName from './append-gtm-classname';\nimport { PB_TYPE_IMAGE, PB_TYPE_BANNER, PB_TYPE_TEXTBLOCK, PB_TYPE_CAROUSEL } from './constants';\nimport { BannerContextProvider } from '../../BannerContext';\n\nconst RenderComponent = ({\n component,\n imageProps,\n childComponents,\n options = {},\n textBlockBanners,\n hasTextBlockBanners,\n siblings,\n ...nestedComponentsProps\n}) => {\n const { type, settings, id, name } = component;\n const Component = getComponent(type);\n const isImage = [PB_TYPE_IMAGE, PB_TYPE_BANNER, PB_TYPE_TEXTBLOCK, PB_TYPE_CAROUSEL].includes(\n type\n );\n const imageOptions = isImage ? imageProps : {};\n if (!Component) return null;\n const updatedSettings = appendGtmClassName(settings, childComponents);\n const [VariantComponent, variantSettings] = getVariant(settings);\n\n return (\n <ErrorBoundary>\n <Component\n key={id}\n type={type}\n VariantComponent={VariantComponent}\n {...options}\n {...imageOptions}\n {...nestedComponentsProps}\n {...updatedSettings}\n {...variantSettings}\n name={name || settings.name}>\n {hasTextBlockBanners ? (\n <BannerContextProvider siblings={siblings} banners={textBlockBanners} pbOptions={options}>\n {childComponents}\n </BannerContextProvider>\n ) : (\n childComponents\n )}\n </Component>\n </ErrorBoundary>\n );\n};\n\nRenderComponent.propTypes = {\n component: PropTypes.shape({\n type: PropTypes.string,\n id: PropTypes.string,\n name: PropTypes.string,\n settings: PropTypes.object,\n items: PropTypes.array\n }).isRequired,\n imageProps: PropTypes.object.isRequired,\n options: PropTypes.object.isRequired,\n childComponents: PropTypes.node.isRequired,\n textBlockBanners: PropTypes.array,\n hasTextBlockBanners: PropTypes.bool,\n siblings: PropTypes.array\n};\n\nRenderComponent.defaultProps = { textBlockBanners: null, hasTextBlockBanners: false, siblings: [] };\n\nexport default RenderComponent;\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,aAAa,MAAM,2BAA2B;AACrD,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,kBAAkB,MAAM,wBAAwB;AACvD,SAASC,aAAa,EAAEC,cAAc,EAAEC,iBAAiB,EAAEC,gBAAgB,QAAQ,aAAa;AAChG,SAASC,qBAAqB,QAAQ,qBAAqB;AAE3D,MAAMC,eAAe,GAAGC,IAAA,IASlB;EAAA,IATmB;MACvBC,SAAS;MACTC,UAAU;MACVC,eAAe;MACfC,OAAO,GAAG,CAAC,CAAC;MACZC,gBAAgB;MAChBC,mBAAmB;MACnBC;IAEF,CAAC,GAAAP,IAAA;IADIQ,qBAAqB,GAAAC,wBAAA,CAAAT,IAAA,EAAAU,SAAA;EAExB,MAAM;IAAEC,IAAI;IAAEC,QAAQ;IAAEC,EAAE;IAAEC;EAAK,CAAC,GAAGb,SAAS;EAC9C,MAAMc,SAAS,GAAGxB,YAAY,CAACoB,IAAI,CAAC;EACpC,MAAMK,OAAO,GAAG,CAACtB,aAAa,EAAEC,cAAc,EAAEC,iBAAiB,EAAEC,gBAAgB,CAAC,CAACoB,QAAQ,CAC3FN,IACF,CAAC;EACD,MAAMO,YAAY,GAAGF,OAAO,GAAGd,UAAU,GAAG,CAAC,CAAC;EAC9C,IAAI,CAACa,SAAS,EAAE,OAAO,IAAI;EAC3B,MAAMI,eAAe,GAAG1B,kBAAkB,CAACmB,QAAQ,EAAET,eAAe,CAAC;EACrE,MAAM,CAACiB,gBAAgB,EAAEC,eAAe,CAAC,GAAG7B,UAAU,CAACoB,QAAQ,CAAC;EAEhE,oBACExB,KAAA,CAAAkC,aAAA,CAAChC,aAAa,qBACZF,KAAA,CAAAkC,aAAA,CAACP,SAAS,EAAAQ,QAAA;IACRC,GAAG,EAAEX,EAAG;IACRF,IAAI,EAAEA,IAAK;IACXS,gBAAgB,EAAEA;EAAiB,GAC/BhB,OAAO,EACPc,YAAY,EACZV,qBAAqB,EACrBW,eAAe,EACfE,eAAe;IACnBP,IAAI,EAAEA,IAAI,IAAIF,QAAQ,CAACE;EAAK,IAC3BR,mBAAmB,gBAClBlB,KAAA,CAAAkC,aAAA,CAACxB,qBAAqB;IAACS,QAAQ,EAAEA,QAAS;IAACkB,OAAO,EAAEpB,gBAAiB;IAACqB,SAAS,EAAEtB;EAAQ,GACtFD,eACoB,CAAC,GAExBA,eAEO,CACE,CAAC;AAEpB,CAAC;AAEDJ,eAAe,CAAC4B,SAAS,GAAG;EAC1B1B,SAAS,EAAEZ,SAAS,CAACuC,KAAK,CAAC;IACzBjB,IAAI,EAAEtB,SAAS,CAACwC,MAAM;IACtBhB,EAAE,EAAExB,SAAS,CAACwC,MAAM;IACpBf,IAAI,EAAEzB,SAAS,CAACwC,MAAM;IACtBjB,QAAQ,EAAEvB,SAAS,CAACyC,MAAM;IAC1BC,KAAK,EAAE1C,SAAS,CAAC2C;EACnB,CAAC,CAAC,CAACC,UAAU;EACb/B,UAAU,EAAEb,SAAS,CAACyC,MAAM,CAACG,UAAU;EACvC7B,OAAO,EAAEf,SAAS,CAACyC,MAAM,CAACG,UAAU;EACpC9B,eAAe,EAAEd,SAAS,CAAC6C,IAAI,CAACD,UAAU;EAC1C5B,gBAAgB,EAAEhB,SAAS,CAAC2C,KAAK;EACjC1B,mBAAmB,EAAEjB,SAAS,CAAC8C,IAAI;EACnC5B,QAAQ,EAAElB,SAAS,CAAC2C;AACtB,CAAC;AAEDjC,eAAe,CAACqC,YAAY,GAAG;EAAE/B,gBAAgB,EAAE,IAAI;EAAEC,mBAAmB,EAAE,KAAK;EAAEC,QAAQ,EAAE;AAAG,CAAC;AAEnG,eAAeR,eAAe"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
4
|
import { GTM } from '../../constants';
|
|
5
5
|
const appendGtmClassName = (settings, childComponents) => {
|
|
6
6
|
if (!childComponents || Array.isArray(childComponents)) return settings;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import cloneDeep from 'lodash.clonedeep';
|
|
6
6
|
import GlobalLightbox from '../../components/Image/GlobalLightbox';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
4
|
import { PB_TYPE_IMAGE, PB_TYPE_CAROUSEL, PB_TYPE_BANNER } from './constants';
|
|
5
5
|
function checkIfHasLightboxAndImages(component) {
|
|
6
6
|
const isImage = [PB_TYPE_IMAGE, PB_TYPE_CAROUSEL].includes(component.type);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { variantHandler } from '../../utils';
|
|
2
|
+
export default function getVariant(settings) {
|
|
3
|
+
const {
|
|
4
|
+
variant
|
|
5
|
+
} = settings;
|
|
6
|
+
if (!variant) return [null, {}];
|
|
7
|
+
const {
|
|
8
|
+
VariantComponent,
|
|
9
|
+
getSettings
|
|
10
|
+
} = variantHandler.get(variant) || {};
|
|
11
|
+
const variantSettings = !!getSettings && typeof getSettings === 'function' ? getSettings(settings) : settings;
|
|
12
|
+
return [VariantComponent, variantSettings];
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=getVariant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getVariant.js","names":["variantHandler","getVariant","settings","variant","VariantComponent","getSettings","get","variantSettings"],"sources":["../../../src/hooks/helpers/getVariant.js"],"sourcesContent":["import { variantHandler } from '../../utils';\n\nexport default function getVariant(settings) {\n const { variant } = settings;\n if (!variant) return [null, {}];\n const { VariantComponent, getSettings } = variantHandler.get(variant) || {};\n const variantSettings =\n !!getSettings && typeof getSettings === 'function' ? getSettings(settings) : settings;\n\n return [VariantComponent, variantSettings];\n}\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,aAAa;AAE5C,eAAe,SAASC,UAAUA,CAACC,QAAQ,EAAE;EAC3C,MAAM;IAAEC;EAAQ,CAAC,GAAGD,QAAQ;EAC5B,IAAI,CAACC,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;EAC/B,MAAM;IAAEC,gBAAgB;IAAEC;EAAY,CAAC,GAAGL,cAAc,CAACM,GAAG,CAACH,OAAO,CAAC,IAAI,CAAC,CAAC;EAC3E,MAAMI,eAAe,GACnB,CAAC,CAACF,WAAW,IAAI,OAAOA,WAAW,KAAK,UAAU,GAAGA,WAAW,CAACH,QAAQ,CAAC,GAAGA,QAAQ;EAEvF,OAAO,CAACE,gBAAgB,EAAEG,eAAe,CAAC;AAC5C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
4
|
import updateTargetings from './update-targetings';
|
|
5
5
|
import { IMAGE } from '../../constants';
|
|
6
6
|
import { PB_TYPE_BANNER } from './constants';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
function ownKeys(
|
|
4
|
-
function _objectSpread(
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import Banner from '../../components/Banner';
|
|
7
7
|
import { getCollisions, checkIfHasCollided } from './check-collisions';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useQuery } from '@apollo/client';
|
|
2
2
|
import { generateSingleItemQuery } from '../application/query';
|
|
3
|
-
function useGetImageIdFromRelation(id, imageRelation, actions, isUsingRelationImage, isPreview) {
|
|
4
|
-
const skip = !id || typeof id !== 'string' || !isUsingRelationImage || !Object.keys(actions).length;
|
|
3
|
+
function useGetImageIdFromRelation(id, imageRelation, actions, isUsingRelationImage, isPreview, hasImgSrc) {
|
|
4
|
+
const skip = !id || hasImgSrc || typeof id !== 'string' || !isUsingRelationImage || !Object.keys(actions).length;
|
|
5
5
|
const [imageRelationData = ''] = imageRelation;
|
|
6
6
|
const [relationName = '', relationProp = ''] = imageRelationData.split('.');
|
|
7
7
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-get-image-id-from-relation.js","names":["useQuery","generateSingleItemQuery","useGetImageIdFromRelation","id","imageRelation","actions","isUsingRelationImage","isPreview","skip","Object","keys","length","imageRelationData","relationName","relationProp","split","getPublished","get","getAction","props","data","loading","error","variables"],"sources":["../../src/hooks/use-get-image-id-from-relation.js"],"sourcesContent":["import { useQuery } from '@apollo/client';\nimport { generateSingleItemQuery } from '../application/query';\n\nfunction useGetImageIdFromRelation(id
|
|
1
|
+
{"version":3,"file":"use-get-image-id-from-relation.js","names":["useQuery","generateSingleItemQuery","useGetImageIdFromRelation","id","imageRelation","actions","isUsingRelationImage","isPreview","hasImgSrc","skip","Object","keys","length","imageRelationData","relationName","relationProp","split","getPublished","get","getAction","props","data","loading","error","variables"],"sources":["../../src/hooks/use-get-image-id-from-relation.js"],"sourcesContent":["import { useQuery } from '@apollo/client';\nimport { generateSingleItemQuery } from '../application/query';\n\nfunction useGetImageIdFromRelation(\n id,\n imageRelation,\n actions,\n isUsingRelationImage,\n isPreview,\n hasImgSrc\n) {\n const skip =\n !id ||\n hasImgSrc ||\n typeof id !== 'string' ||\n !isUsingRelationImage ||\n !Object.keys(actions).length;\n\n const [imageRelationData = ''] = imageRelation;\n const [relationName = '', relationProp = ''] = imageRelationData.split('.');\n const { getPublished, get } = actions;\n const getAction = isPreview ? get : getPublished || get;\n\n const props = imageRelationData ? `${relationName} { ${relationProp} }` : 'id';\n const { data = {}, loading, error } = useQuery(generateSingleItemQuery(getAction, props), {\n variables: { id },\n skip\n });\n return { data, loading, error };\n}\n\nexport default useGetImageIdFromRelation;\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,uBAAuB,QAAQ,sBAAsB;AAE9D,SAASC,yBAAyBA,CAChCC,EAAE,EACFC,aAAa,EACbC,OAAO,EACPC,oBAAoB,EACpBC,SAAS,EACTC,SAAS,EACT;EACA,MAAMC,IAAI,GACR,CAACN,EAAE,IACHK,SAAS,IACT,OAAOL,EAAE,KAAK,QAAQ,IACtB,CAACG,oBAAoB,IACrB,CAACI,MAAM,CAACC,IAAI,CAACN,OAAO,CAAC,CAACO,MAAM;EAE9B,MAAM,CAACC,iBAAiB,GAAG,EAAE,CAAC,GAAGT,aAAa;EAC9C,MAAM,CAACU,YAAY,GAAG,EAAE,EAAEC,YAAY,GAAG,EAAE,CAAC,GAAGF,iBAAiB,CAACG,KAAK,CAAC,GAAG,CAAC;EAC3E,MAAM;IAAEC,YAAY;IAAEC;EAAI,CAAC,GAAGb,OAAO;EACrC,MAAMc,SAAS,GAAGZ,SAAS,GAAGW,GAAG,GAAGD,YAAY,IAAIC,GAAG;EAEvD,MAAME,KAAK,GAAGP,iBAAiB,GAAI,GAAEC,YAAa,MAAKC,YAAa,IAAG,GAAG,IAAI;EAC9E,MAAM;IAAEM,IAAI,GAAG,CAAC,CAAC;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGvB,QAAQ,CAACC,uBAAuB,CAACkB,SAAS,EAAEC,KAAK,CAAC,EAAE;IACxFI,SAAS,EAAE;MAAErB;IAAG,CAAC;IACjBM;EACF,CAAC,CAAC;EACF,OAAO;IAAEY,IAAI;IAAEC,OAAO;IAAEC;EAAM,CAAC;AACjC;AAEA,eAAerB,yBAAyB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useQuery } from '@apollo/client';
|
|
2
2
|
import { getFiles, getFileById } from '../application/query';
|
|
3
|
-
function
|
|
3
|
+
function checkShouldSkip(id) {
|
|
4
4
|
return !id || Array.isArray(id) && !id.length;
|
|
5
5
|
}
|
|
6
6
|
const getWhereQuery = id => {
|
|
@@ -13,8 +13,8 @@ const getWhereQuery = id => {
|
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
|
-
const useGetImages = (id, hasMultipleIds = false) => {
|
|
17
|
-
const
|
|
16
|
+
const useGetImages = (id, hasMultipleIds = false, skip = false) => {
|
|
17
|
+
const shouldSkip = skip || checkShouldSkip(id);
|
|
18
18
|
const variables = hasMultipleIds ? getWhereQuery(id) : {
|
|
19
19
|
id
|
|
20
20
|
};
|
|
@@ -25,7 +25,7 @@ const useGetImages = (id, hasMultipleIds = false) => {
|
|
|
25
25
|
error
|
|
26
26
|
} = useQuery(currentQuery, {
|
|
27
27
|
variables,
|
|
28
|
-
skip
|
|
28
|
+
skip: shouldSkip
|
|
29
29
|
});
|
|
30
30
|
return {
|
|
31
31
|
data,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-get-images.js","names":["useQuery","getFiles","getFileById","
|
|
1
|
+
{"version":3,"file":"use-get-images.js","names":["useQuery","getFiles","getFileById","checkShouldSkip","id","Array","isArray","length","getWhereQuery","inClause","where","_in","useGetImages","hasMultipleIds","skip","shouldSkip","variables","currentQuery","data","loading","error"],"sources":["../../src/hooks/use-get-images.js"],"sourcesContent":["import { useQuery } from '@apollo/client';\nimport { getFiles, getFileById } from '../application/query';\n\nfunction checkShouldSkip(id) {\n return !id || (Array.isArray(id) && !id.length);\n}\n\nconst getWhereQuery = id => {\n const inClause = Array.isArray(id) ? id : [id];\n return { where: { id: { _in: inClause } } };\n};\n\nconst useGetImages = (id, hasMultipleIds = false, skip = false) => {\n const shouldSkip = skip || checkShouldSkip(id);\n const variables = hasMultipleIds ? getWhereQuery(id) : { id };\n const currentQuery = hasMultipleIds ? getFiles : getFileById;\n const { data = {}, loading, error } = useQuery(currentQuery, { variables, skip: shouldSkip });\n\n return { data, loading, error };\n};\n\nexport default useGetImages;\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,QAAQ,EAAEC,WAAW,QAAQ,sBAAsB;AAE5D,SAASC,eAAeA,CAACC,EAAE,EAAE;EAC3B,OAAO,CAACA,EAAE,IAAKC,KAAK,CAACC,OAAO,CAACF,EAAE,CAAC,IAAI,CAACA,EAAE,CAACG,MAAO;AACjD;AAEA,MAAMC,aAAa,GAAGJ,EAAE,IAAI;EAC1B,MAAMK,QAAQ,GAAGJ,KAAK,CAACC,OAAO,CAACF,EAAE,CAAC,GAAGA,EAAE,GAAG,CAACA,EAAE,CAAC;EAC9C,OAAO;IAAEM,KAAK,EAAE;MAAEN,EAAE,EAAE;QAAEO,GAAG,EAAEF;MAAS;IAAE;EAAE,CAAC;AAC7C,CAAC;AAED,MAAMG,YAAY,GAAGA,CAACR,EAAE,EAAES,cAAc,GAAG,KAAK,EAAEC,IAAI,GAAG,KAAK,KAAK;EACjE,MAAMC,UAAU,GAAGD,IAAI,IAAIX,eAAe,CAACC,EAAE,CAAC;EAC9C,MAAMY,SAAS,GAAGH,cAAc,GAAGL,aAAa,CAACJ,EAAE,CAAC,GAAG;IAAEA;EAAG,CAAC;EAC7D,MAAMa,YAAY,GAAGJ,cAAc,GAAGZ,QAAQ,GAAGC,WAAW;EAC5D,MAAM;IAAEgB,IAAI,GAAG,CAAC,CAAC;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGpB,QAAQ,CAACiB,YAAY,EAAE;IAAED,SAAS;IAAEF,IAAI,EAAEC;EAAW,CAAC,CAAC;EAE7F,OAAO;IAAEG,IAAI;IAAEC,OAAO;IAAEC;EAAM,CAAC;AACjC,CAAC;AAED,eAAeR,YAAY"}
|
package/lib-es/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export { default as buildPBComponents } from './hooks/helpers/buildPBComponents';
|
|
2
2
|
export { default as getLightboxImages } from './hooks/helpers/get-lightbox-images';
|
|
3
3
|
export { default as getComponent } from './hooks/helpers/getComponent';
|
|
4
|
-
export { componentMap, getClassModifiers } from './utils';
|
|
4
|
+
export { componentMap, variantHandler, getClassModifiers } from './utils';
|
|
5
5
|
export { default as components } from './components';
|
|
6
|
+
export { default as variants } from './variants';
|
|
6
7
|
export { getAction, generateSingleItemQuery, generateMultiItemQuery, getEntitySchema, getSingleEntitySchema, getUser } from './application/query';
|
|
7
8
|
export { buildPropsQuery, getUnpublishedEntityName, renderChildren, hasChildren } from './helpers';
|
|
8
9
|
export { withTitle } from './HOC';
|
package/lib-es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","buildPBComponents","getLightboxImages","getComponent","componentMap","getClassModifiers","components","getAction","generateSingleItemQuery","generateMultiItemQuery","getEntitySchema","getSingleEntitySchema","getUser","buildPropsQuery","getUnpublishedEntityName","renderChildren","hasChildren","withTitle","useGetEntitySchema","useGetEntitySchemasAsObj","useGetSingleEntitySchema","summaryComponents","buildPropsToDisplayWithContent"],"sources":["../src/index.js"],"sourcesContent":["export { default as buildPBComponents } from './hooks/helpers/buildPBComponents';\nexport { default as getLightboxImages } from './hooks/helpers/get-lightbox-images';\nexport { default as getComponent } from './hooks/helpers/getComponent';\nexport { componentMap, getClassModifiers } from './utils';\nexport { default as components } from './components';\nexport {\n getAction,\n generateSingleItemQuery,\n generateMultiItemQuery,\n getEntitySchema,\n getSingleEntitySchema,\n getUser\n} from './application/query';\nexport { buildPropsQuery, getUnpublishedEntityName, renderChildren, hasChildren } from './helpers';\nexport { withTitle } from './HOC';\nexport { useGetEntitySchema, useGetEntitySchemasAsObj, useGetSingleEntitySchema } from './hooks';\nexport { summaryComponents } from './components/DataSummary/DataSummaryTypes';\nexport { buildPropsToDisplayWithContent } from './components/DataSummary/helpers';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,iBAAiB,QAAQ,mCAAmC;AAChF,SAASD,OAAO,IAAIE,iBAAiB,QAAQ,qCAAqC;AAClF,SAASF,OAAO,IAAIG,YAAY,QAAQ,8BAA8B;AACtE,SAASC,YAAY,EAAEC,iBAAiB,QAAQ,SAAS;
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","buildPBComponents","getLightboxImages","getComponent","componentMap","variantHandler","getClassModifiers","components","variants","getAction","generateSingleItemQuery","generateMultiItemQuery","getEntitySchema","getSingleEntitySchema","getUser","buildPropsQuery","getUnpublishedEntityName","renderChildren","hasChildren","withTitle","useGetEntitySchema","useGetEntitySchemasAsObj","useGetSingleEntitySchema","summaryComponents","buildPropsToDisplayWithContent"],"sources":["../src/index.js"],"sourcesContent":["export { default as buildPBComponents } from './hooks/helpers/buildPBComponents';\nexport { default as getLightboxImages } from './hooks/helpers/get-lightbox-images';\nexport { default as getComponent } from './hooks/helpers/getComponent';\nexport { componentMap, variantHandler, getClassModifiers } from './utils';\nexport { default as components } from './components';\nexport { default as variants } from './variants';\nexport {\n getAction,\n generateSingleItemQuery,\n generateMultiItemQuery,\n getEntitySchema,\n getSingleEntitySchema,\n getUser\n} from './application/query';\nexport { buildPropsQuery, getUnpublishedEntityName, renderChildren, hasChildren } from './helpers';\nexport { withTitle } from './HOC';\nexport { useGetEntitySchema, useGetEntitySchemasAsObj, useGetSingleEntitySchema } from './hooks';\nexport { summaryComponents } from './components/DataSummary/DataSummaryTypes';\nexport { buildPropsToDisplayWithContent } from './components/DataSummary/helpers';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,iBAAiB,QAAQ,mCAAmC;AAChF,SAASD,OAAO,IAAIE,iBAAiB,QAAQ,qCAAqC;AAClF,SAASF,OAAO,IAAIG,YAAY,QAAQ,8BAA8B;AACtE,SAASC,YAAY,EAAEC,cAAc,EAAEC,iBAAiB,QAAQ,SAAS;AACzE,SAASN,OAAO,IAAIO,UAAU,QAAQ,cAAc;AACpD,SAASP,OAAO,IAAIQ,QAAQ,QAAQ,YAAY;AAChD,SACEC,SAAS,EACTC,uBAAuB,EACvBC,sBAAsB,EACtBC,eAAe,EACfC,qBAAqB,EACrBC,OAAO,QACF,qBAAqB;AAC5B,SAASC,eAAe,EAAEC,wBAAwB,EAAEC,cAAc,EAAEC,WAAW,QAAQ,WAAW;AAClG,SAASC,SAAS,QAAQ,OAAO;AACjC,SAASC,kBAAkB,EAAEC,wBAAwB,EAAEC,wBAAwB,QAAQ,SAAS;AAChG,SAASC,iBAAiB,QAAQ,2CAA2C;AAC7E,SAASC,8BAA8B,QAAQ,kCAAkC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BlazeError } from '@blaze-cms/core-errors';
|
|
2
|
-
function
|
|
2
|
+
function componentMapHandler() {
|
|
3
3
|
const components = new Map();
|
|
4
4
|
function get(key) {
|
|
5
5
|
return components.get(key);
|
|
@@ -16,7 +16,7 @@ function componentMap() {
|
|
|
16
16
|
}
|
|
17
17
|
function validate(key, component) {
|
|
18
18
|
if (!key || !component) throw new BlazeError('Component requires key and component');
|
|
19
|
-
if (components.has(key) && key !== 'array') throw new BlazeError(`Component already
|
|
19
|
+
if (components.has(key) && key !== 'array') throw new BlazeError(`Component already exists`);
|
|
20
20
|
}
|
|
21
21
|
return {
|
|
22
22
|
id: Math.random(),
|
|
@@ -25,6 +25,6 @@ function componentMap() {
|
|
|
25
25
|
getAll
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
const
|
|
29
|
-
export default
|
|
28
|
+
const componentMap = componentMapHandler();
|
|
29
|
+
export default componentMap;
|
|
30
30
|
//# sourceMappingURL=component-map.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-map.js","names":["BlazeError","
|
|
1
|
+
{"version":3,"file":"component-map.js","names":["BlazeError","componentMapHandler","components","Map","get","key","getAll","Array","from","entries","add","component","validate","set","has","id","Math","random","componentMap"],"sources":["../../src/utils/component-map.js"],"sourcesContent":["import { BlazeError } from '@blaze-cms/core-errors';\n\nfunction componentMapHandler() {\n const components = new Map();\n function get(key) {\n return components.get(key);\n }\n\n function getAll() {\n return Array.from(components.entries());\n }\n\n function add({ key, component }) {\n validate(key, component);\n components.set(key, component);\n }\n\n function validate(key, component) {\n if (!key || !component) throw new BlazeError('Component requires key and component');\n if (components.has(key) && key !== 'array') throw new BlazeError(`Component already exists`);\n }\n\n return {\n id: Math.random(),\n add,\n get,\n getAll\n };\n}\n\nconst componentMap = componentMapHandler();\n\nexport default componentMap;\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,wBAAwB;AAEnD,SAASC,mBAAmBA,CAAA,EAAG;EAC7B,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAAC,CAAC;EAC5B,SAASC,GAAGA,CAACC,GAAG,EAAE;IAChB,OAAOH,UAAU,CAACE,GAAG,CAACC,GAAG,CAAC;EAC5B;EAEA,SAASC,MAAMA,CAAA,EAAG;IAChB,OAAOC,KAAK,CAACC,IAAI,CAACN,UAAU,CAACO,OAAO,CAAC,CAAC,CAAC;EACzC;EAEA,SAASC,GAAGA,CAAC;IAAEL,GAAG;IAAEM;EAAU,CAAC,EAAE;IAC/BC,QAAQ,CAACP,GAAG,EAAEM,SAAS,CAAC;IACxBT,UAAU,CAACW,GAAG,CAACR,GAAG,EAAEM,SAAS,CAAC;EAChC;EAEA,SAASC,QAAQA,CAACP,GAAG,EAAEM,SAAS,EAAE;IAChC,IAAI,CAACN,GAAG,IAAI,CAACM,SAAS,EAAE,MAAM,IAAIX,UAAU,CAAC,sCAAsC,CAAC;IACpF,IAAIE,UAAU,CAACY,GAAG,CAACT,GAAG,CAAC,IAAIA,GAAG,KAAK,OAAO,EAAE,MAAM,IAAIL,UAAU,CAAE,0BAAyB,CAAC;EAC9F;EAEA,OAAO;IACLe,EAAE,EAAEC,IAAI,CAACC,MAAM,CAAC,CAAC;IACjBP,GAAG;IACHN,GAAG;IACHE;EACF,CAAC;AACH;AAEA,MAAMY,YAAY,GAAGjB,mBAAmB,CAAC,CAAC;AAE1C,eAAeiB,YAAY"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
4
|
import { BUTTON, BUTTON_ICON, CLASS_MODIFIERS, ICON_BUTTON, LINK, CODE } from '../constants';
|
|
5
5
|
import COMPONENTS_DEFAULT_VALUES from '../constants/componentsDefaultValues';
|
|
6
6
|
const {
|
package/lib-es/utils/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import getClassModifiers from './get-class-modifiers';
|
|
2
2
|
import componentMap from './component-map';
|
|
3
|
+
import variantHandler from './variant-handler';
|
|
3
4
|
import isObjectEmpty from './is-object-empty';
|
|
4
5
|
import getImageData from './get-image-data';
|
|
5
6
|
import getPropsToDisplayModifiers from './get-props-to-display-modifiers';
|
|
6
|
-
export {
|
|
7
|
+
export { componentMap, variantHandler, getClassModifiers, isObjectEmpty, getImageData, getPropsToDisplayModifiers };
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["getClassModifiers","componentMap","isObjectEmpty","getImageData","getPropsToDisplayModifiers"],"sources":["../../src/utils/index.js"],"sourcesContent":["import getClassModifiers from './get-class-modifiers';\nimport componentMap from './component-map';\nimport isObjectEmpty from './is-object-empty';\nimport getImageData from './get-image-data';\nimport getPropsToDisplayModifiers from './get-props-to-display-modifiers';\n\nexport {
|
|
1
|
+
{"version":3,"file":"index.js","names":["getClassModifiers","componentMap","variantHandler","isObjectEmpty","getImageData","getPropsToDisplayModifiers"],"sources":["../../src/utils/index.js"],"sourcesContent":["import getClassModifiers from './get-class-modifiers';\nimport componentMap from './component-map';\nimport variantHandler from './variant-handler';\nimport isObjectEmpty from './is-object-empty';\nimport getImageData from './get-image-data';\nimport getPropsToDisplayModifiers from './get-props-to-display-modifiers';\n\nexport {\n componentMap,\n variantHandler,\n getClassModifiers,\n isObjectEmpty,\n getImageData,\n getPropsToDisplayModifiers\n};\n"],"mappings":"AAAA,OAAOA,iBAAiB,MAAM,uBAAuB;AACrD,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,cAAc,MAAM,mBAAmB;AAC9C,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,0BAA0B,MAAM,kCAAkC;AAEzE,SACEJ,YAAY,EACZC,cAAc,EACdF,iBAAiB,EACjBG,aAAa,EACbC,YAAY,EACZC,0BAA0B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BlazeError } from '@blaze-cms/core-errors';
|
|
2
|
+
function variantMapHandler() {
|
|
3
|
+
const variants = new Map();
|
|
4
|
+
function get(key) {
|
|
5
|
+
return variants.get(key);
|
|
6
|
+
}
|
|
7
|
+
function getAll() {
|
|
8
|
+
return Array.from(variants.entries());
|
|
9
|
+
}
|
|
10
|
+
function add(key, variant) {
|
|
11
|
+
validate(key, variant);
|
|
12
|
+
variants.set(key, variant);
|
|
13
|
+
}
|
|
14
|
+
function validate(key, variant) {
|
|
15
|
+
if (!key || !variant) throw new BlazeError('Variant requires key and component');
|
|
16
|
+
if (variants.has(key) && key !== 'array') throw new BlazeError(`Variant already exists`);
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
add,
|
|
20
|
+
get,
|
|
21
|
+
getAll
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
const variantHandler = variantMapHandler();
|
|
25
|
+
export default variantHandler;
|
|
26
|
+
//# sourceMappingURL=variant-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variant-handler.js","names":["BlazeError","variantMapHandler","variants","Map","get","key","getAll","Array","from","entries","add","variant","validate","set","has","variantHandler"],"sources":["../../src/utils/variant-handler.js"],"sourcesContent":["import { BlazeError } from '@blaze-cms/core-errors';\n\nfunction variantMapHandler() {\n const variants = new Map();\n\n function get(key) {\n return variants.get(key);\n }\n\n function getAll() {\n return Array.from(variants.entries());\n }\n\n function add(key, variant) {\n validate(key, variant);\n variants.set(key, variant);\n }\n\n function validate(key, variant) {\n if (!key || !variant) throw new BlazeError('Variant requires key and component');\n if (variants.has(key) && key !== 'array') throw new BlazeError(`Variant already exists`);\n }\n\n return {\n add,\n get,\n getAll\n };\n}\n\nconst variantHandler = variantMapHandler();\n\nexport default variantHandler;\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,wBAAwB;AAEnD,SAASC,iBAAiBA,CAAA,EAAG;EAC3B,MAAMC,QAAQ,GAAG,IAAIC,GAAG,CAAC,CAAC;EAE1B,SAASC,GAAGA,CAACC,GAAG,EAAE;IAChB,OAAOH,QAAQ,CAACE,GAAG,CAACC,GAAG,CAAC;EAC1B;EAEA,SAASC,MAAMA,CAAA,EAAG;IAChB,OAAOC,KAAK,CAACC,IAAI,CAACN,QAAQ,CAACO,OAAO,CAAC,CAAC,CAAC;EACvC;EAEA,SAASC,GAAGA,CAACL,GAAG,EAAEM,OAAO,EAAE;IACzBC,QAAQ,CAACP,GAAG,EAAEM,OAAO,CAAC;IACtBT,QAAQ,CAACW,GAAG,CAACR,GAAG,EAAEM,OAAO,CAAC;EAC5B;EAEA,SAASC,QAAQA,CAACP,GAAG,EAAEM,OAAO,EAAE;IAC9B,IAAI,CAACN,GAAG,IAAI,CAACM,OAAO,EAAE,MAAM,IAAIX,UAAU,CAAC,oCAAoC,CAAC;IAChF,IAAIE,QAAQ,CAACY,GAAG,CAACT,GAAG,CAAC,IAAIA,GAAG,KAAK,OAAO,EAAE,MAAM,IAAIL,UAAU,CAAE,wBAAuB,CAAC;EAC1F;EAEA,OAAO;IACLU,GAAG;IACHN,GAAG;IACHE;EACF,CAAC;AACH;AAEA,MAAMS,cAAc,GAAGd,iBAAiB,CAAC,CAAC;AAE1C,eAAec,cAAc"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/variants/index.js"],"sourcesContent":["export default {};\n"],"mappings":"AAAA,eAAe,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaze-cms/react-page-builder",
|
|
3
|
-
"version": "0.139.
|
|
3
|
+
"version": "0.139.1-core-styles.0",
|
|
4
4
|
"description": "Blaze react page builder",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-es/index.js",
|
|
@@ -27,22 +27,22 @@
|
|
|
27
27
|
},
|
|
28
28
|
"license": "GPL-3.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@blaze-cms/core-auth-ui": "0.139.
|
|
31
|
-
"@blaze-cms/core-errors": "0.139.
|
|
32
|
-
"@blaze-cms/core-errors-ui": "0.139.
|
|
30
|
+
"@blaze-cms/core-auth-ui": "0.139.1-core-styles.0",
|
|
31
|
+
"@blaze-cms/core-errors": "0.139.1-core-styles.0",
|
|
32
|
+
"@blaze-cms/core-errors-ui": "0.139.1-core-styles.0",
|
|
33
33
|
"@blaze-cms/image-cdn-react": "0.3.0-alpha.6",
|
|
34
|
-
"@blaze-cms/nextjs-components": "0.139.
|
|
35
|
-
"@blaze-cms/plugin-search-ui": "0.139.
|
|
36
|
-
"@blaze-cms/setup-ui": "0.139.
|
|
37
|
-
"@blaze-cms/utils": "0.139.
|
|
38
|
-
"@blaze-cms/utils-handlebars": "0.139.
|
|
34
|
+
"@blaze-cms/nextjs-components": "0.139.1-core-styles.0",
|
|
35
|
+
"@blaze-cms/plugin-search-ui": "0.139.1-core-styles.0",
|
|
36
|
+
"@blaze-cms/setup-ui": "0.139.1-core-styles.0",
|
|
37
|
+
"@blaze-cms/utils": "0.139.1-core-styles.0",
|
|
38
|
+
"@blaze-cms/utils-handlebars": "0.139.1-core-styles.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",
|
|
42
42
|
"@blaze-react/input": "0.5.30",
|
|
43
43
|
"@blaze-react/modal": "0.5.19",
|
|
44
44
|
"@blaze-react/range-filter": "0.7.2",
|
|
45
|
-
"@blaze-react/select": "0.
|
|
45
|
+
"@blaze-react/select": "0.8.0-alpha.64",
|
|
46
46
|
"@blaze-react/utils": "0.5.15",
|
|
47
47
|
"core-js": "^3.2.1",
|
|
48
48
|
"entities": "^2.0.0",
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
"lib/*",
|
|
90
90
|
"lib-es/*"
|
|
91
91
|
],
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "7631974706a04751ed0abf368bd0cd3b1c4c1b07"
|
|
93
93
|
}
|
|
@@ -41,13 +41,13 @@ const Card = ({
|
|
|
41
41
|
titleOverlayModifier,
|
|
42
42
|
overlayModifier,
|
|
43
43
|
gridModifier,
|
|
44
|
-
parent,
|
|
45
44
|
pageBuilderComponents,
|
|
46
45
|
__typename: dataEntity,
|
|
47
46
|
...otherProps
|
|
48
47
|
}) => {
|
|
49
48
|
const entity = graphqlEntityMap[dataEntity];
|
|
50
49
|
updateChildrensParent(cardChildren, id, entity);
|
|
50
|
+
const parent = { itemId: id, itemEntity: entity };
|
|
51
51
|
const router = useRouter();
|
|
52
52
|
const { imageSrc, shouldDisplayThumbnail, altText } = getImageDefinedProps({
|
|
53
53
|
image,
|
|
@@ -181,7 +181,6 @@ const Card = ({
|
|
|
181
181
|
};
|
|
182
182
|
|
|
183
183
|
Card.propTypes = {
|
|
184
|
-
parent: PropTypes.object.isRequired,
|
|
185
184
|
id: PropTypes.string.isRequired,
|
|
186
185
|
image: PropTypes.shape({
|
|
187
186
|
url: PropTypes.string,
|
|
@@ -36,7 +36,6 @@ const CardContainer = ({
|
|
|
36
36
|
autoScrollTimer,
|
|
37
37
|
overlayModifier,
|
|
38
38
|
titleOverlayModifier,
|
|
39
|
-
parent,
|
|
40
39
|
...cardProps
|
|
41
40
|
}) => {
|
|
42
41
|
const { itemId } = useContext(MainContext);
|
|
@@ -70,7 +69,6 @@ const CardContainer = ({
|
|
|
70
69
|
if (hasNewBannerSettings && shouldRenderBanner) bannerIndex += 1;
|
|
71
70
|
if (!hasNewBannerSettings && baseAdunit) bannerIndex += 1;
|
|
72
71
|
const parsedCardProps = {
|
|
73
|
-
parent,
|
|
74
72
|
key: id,
|
|
75
73
|
id,
|
|
76
74
|
enableCarousel,
|
|
@@ -133,7 +131,6 @@ const CardContainer = ({
|
|
|
133
131
|
|
|
134
132
|
CardContainer.propTypes = {
|
|
135
133
|
pageBuilderComponents: PropTypes.array,
|
|
136
|
-
parent: PropTypes.object.isRequired,
|
|
137
134
|
cardData: PropTypes.array.isRequired,
|
|
138
135
|
graphqlEntityMap: PropTypes.object.isRequired,
|
|
139
136
|
name: PropTypes.string,
|
|
@@ -1,32 +1,48 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import CarouselImage from './CarouselImage';
|
|
3
4
|
import CarouselRender from './CarouselRender';
|
|
5
|
+
import { useCarouselNavigation } from './hooks/useCarouselNavigation';
|
|
6
|
+
import { getDisplayCountData } from '../../helpers';
|
|
7
|
+
|
|
8
|
+
const Carousel = props => {
|
|
9
|
+
const { caption, imageIds, isCaptionDisplayed, VariantComponent, ...otherProps } = props;
|
|
10
|
+
|
|
11
|
+
const navigationProps = useCarouselNavigation(props);
|
|
4
12
|
|
|
5
|
-
const Carousel = ({ caption, imageIds, isCaptionDisplayed, ...otherProps }) => {
|
|
6
13
|
if (!imageIds || !imageIds.length) return null;
|
|
7
14
|
const shouldDisplayCaption = isCaptionDisplayed && caption;
|
|
8
15
|
|
|
16
|
+
const { shouldDisplayCount, countMessage } = getDisplayCountData(
|
|
17
|
+
navigationProps.showCount,
|
|
18
|
+
imageIds
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const ComponentToRender = VariantComponent || CarouselRender;
|
|
22
|
+
|
|
9
23
|
return (
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
{shouldDisplayCaption
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
24
|
+
<ComponentToRender
|
|
25
|
+
caption={caption}
|
|
26
|
+
imageIds={imageIds}
|
|
27
|
+
CarouselImage={CarouselImage}
|
|
28
|
+
shouldDisplayCaption={shouldDisplayCaption}
|
|
29
|
+
shouldDisplayCount={shouldDisplayCount}
|
|
30
|
+
countMessage={countMessage}
|
|
31
|
+
{...navigationProps}
|
|
32
|
+
{...otherProps}
|
|
33
|
+
/>
|
|
20
34
|
);
|
|
21
35
|
};
|
|
22
36
|
|
|
23
37
|
Carousel.propTypes = {
|
|
24
38
|
caption: PropTypes.string,
|
|
25
39
|
imageIds: PropTypes.array,
|
|
26
|
-
isCaptionDisplayed: PropTypes.bool
|
|
40
|
+
isCaptionDisplayed: PropTypes.bool,
|
|
41
|
+
VariantComponent: PropTypes.func
|
|
27
42
|
};
|
|
28
43
|
|
|
29
44
|
Carousel.defaultProps = {
|
|
45
|
+
VariantComponent: null,
|
|
30
46
|
caption: '',
|
|
31
47
|
imageIds: [],
|
|
32
48
|
isCaptionDisplayed: false
|