@blaze-cms/react-page-builder 0.139.0-alpha.1 → 0.139.0-alpha.4
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 +29 -0
- package/README.md +9 -0
- package/lib/BannerContext/helpers/set-initial-banner-counters.js +1 -2
- package/lib/BannerContext/helpers/set-initial-banner-counters.js.map +1 -1
- package/lib/BannerContext/index.js +4 -6
- package/lib/BannerContext/index.js.map +1 -1
- package/lib/HOC/recreateOnNavigation.js +1 -2
- package/lib/HOC/recreateOnNavigation.js.map +1 -1
- package/lib/HOC/withInfiniteScroll.js +3 -4
- package/lib/HOC/withInfiniteScroll.js.map +1 -1
- package/lib/HOC/withTitle.js +3 -4
- package/lib/HOC/withTitle.js.map +1 -1
- package/lib/PBContext/index.js +1 -2
- package/lib/PBContext/index.js.map +1 -1
- package/lib/application/query/index.js +15 -30
- package/lib/application/query/index.js.map +1 -1
- package/lib/components/BackToTop/BackToTop.js +3 -4
- package/lib/components/BackToTop/BackToTop.js.map +1 -1
- package/lib/components/BackToTop/index.js +1 -2
- package/lib/components/BackToTop/index.js.map +1 -1
- package/lib/components/Banner/AdSlotRender.js +3 -4
- package/lib/components/Banner/AdSlotRender.js.map +1 -1
- package/lib/components/Banner/Banner.js +3 -4
- package/lib/components/Banner/Banner.js.map +1 -1
- package/lib/components/Banner/BannerRender.js +1 -2
- package/lib/components/Banner/BannerRender.js.map +1 -1
- package/lib/components/Banner/helpers.js +10 -20
- package/lib/components/Banner/helpers.js.map +1 -1
- package/lib/components/Banner/index.js +3 -4
- package/lib/components/Banner/index.js.map +1 -1
- package/lib/components/BlazeLink.js +3 -4
- package/lib/components/BlazeLink.js.map +1 -1
- package/lib/components/Breadcrumb/Breadcrumb.js +3 -4
- package/lib/components/Breadcrumb/Breadcrumb.js.map +1 -1
- package/lib/components/Breadcrumb/index.js +1 -2
- package/lib/components/Breadcrumb/index.js.map +1 -1
- package/lib/components/Button.js +3 -4
- package/lib/components/Button.js.map +1 -1
- package/lib/components/Card/Card.js +8 -7
- package/lib/components/Card/Card.js.map +1 -1
- package/lib/components/Card/CardsContainer.js +4 -8
- package/lib/components/Card/CardsContainer.js.map +1 -1
- package/lib/components/Card/CardsFactory.js +1 -2
- package/lib/components/Card/CardsFactory.js.map +1 -1
- package/lib/components/Card/CardsRender.js +4 -6
- package/lib/components/Card/CardsRender.js.map +1 -1
- package/lib/components/Card/constants.js +2 -4
- package/lib/components/Card/constants.js.map +1 -1
- package/lib/components/Card/helpers/filter-query-setup.js +1 -2
- package/lib/components/Card/helpers/filter-query-setup.js.map +1 -1
- package/lib/components/Card/helpers/filters-setup.js +1 -2
- package/lib/components/Card/helpers/filters-setup.js.map +1 -1
- package/lib/components/Card/helpers/get-dynamic-grid-classes.js +1 -2
- package/lib/components/Card/helpers/get-dynamic-grid-classes.js.map +1 -1
- package/lib/components/Card/helpers/get-published-listing-url.js +1 -2
- package/lib/components/Card/helpers/get-published-listing-url.js.map +1 -1
- package/lib/components/Card/helpers/get-updated-items-to-display.js +1 -2
- package/lib/components/Card/helpers/get-updated-items-to-display.js.map +1 -1
- package/lib/components/Card/helpers/get-updated-sort-properties.js +1 -2
- package/lib/components/Card/helpers/get-updated-sort-properties.js.map +1 -1
- package/lib/components/Card/helpers/should-return.js +1 -2
- package/lib/components/Card/helpers/should-return.js.map +1 -1
- package/lib/components/Card/helpers/should-skip-single-query.js +1 -2
- package/lib/components/Card/helpers/should-skip-single-query.js.map +1 -1
- package/lib/components/Card/helpers/use-dynamic-size-key.js +1 -2
- package/lib/components/Card/helpers/use-dynamic-size-key.js.map +1 -1
- package/lib/components/Card/index.js +1 -2
- package/lib/components/Card/index.js.map +1 -1
- package/lib/components/Carousel/Carousel.js +27 -19
- package/lib/components/Carousel/Carousel.js.map +1 -1
- package/lib/components/Carousel/CarouselImage/CarouselImage.js +1 -2
- package/lib/components/Carousel/CarouselImage/CarouselImage.js.map +1 -1
- package/lib/components/Carousel/CarouselImage/index.js +1 -2
- package/lib/components/Carousel/CarouselImage/index.js.map +1 -1
- package/lib/components/Carousel/CarouselRender/CarouselRender.js +35 -62
- package/lib/components/Carousel/CarouselRender/CarouselRender.js.map +1 -1
- package/lib/components/Carousel/CarouselRender/index.js +1 -2
- package/lib/components/Carousel/CarouselRender/index.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/Carousel/index.js +1 -2
- package/lib/components/Carousel/index.js.map +1 -1
- package/lib/components/CarouselWrapper/CarouselWrapper.js +1 -2
- package/lib/components/CarouselWrapper/CarouselWrapper.js.map +1 -1
- package/lib/components/CarouselWrapper/DefaultCarousel.js +3 -4
- package/lib/components/CarouselWrapper/DefaultCarousel.js.map +1 -1
- package/lib/components/CarouselWrapper/SmoothScrollCarousel.js +1 -2
- package/lib/components/CarouselWrapper/SmoothScrollCarousel.js.map +1 -1
- package/lib/components/CarouselWrapper/index.js +1 -2
- package/lib/components/CarouselWrapper/index.js.map +1 -1
- package/lib/components/ClickWrapper.js +3 -4
- package/lib/components/ClickWrapper.js.map +1 -1
- package/lib/components/Code/Code.js +3 -4
- package/lib/components/Code/Code.js.map +1 -1
- package/lib/components/Code/ScriptTag.js +3 -4
- package/lib/components/Code/ScriptTag.js.map +1 -1
- package/lib/components/Code/helpers/wrap-script-tags.js +1 -2
- package/lib/components/Code/helpers/wrap-script-tags.js.map +1 -1
- package/lib/components/Code/index.js +1 -2
- package/lib/components/Code/index.js.map +1 -1
- package/lib/components/ContentGroup/ContentGroup.js +1 -2
- package/lib/components/ContentGroup/ContentGroup.js.map +1 -1
- package/lib/components/ContentGroup/ContentGroupTabs.js +3 -4
- package/lib/components/ContentGroup/ContentGroupTabs.js.map +1 -1
- package/lib/components/ContentGroup/constants.js +5 -10
- package/lib/components/ContentGroup/constants.js.map +1 -1
- package/lib/components/ContentGroup/helpers/get-active-tab.js +1 -2
- package/lib/components/ContentGroup/helpers/get-active-tab.js.map +1 -1
- package/lib/components/ContentGroup/helpers/get-sections-data.js +1 -2
- package/lib/components/ContentGroup/helpers/get-sections-data.js.map +1 -1
- package/lib/components/ContentGroup/index.js +1 -2
- package/lib/components/ContentGroup/index.js.map +1 -1
- package/lib/components/ContentGroupSection/ContentGroupSection.js +1 -2
- package/lib/components/ContentGroupSection/ContentGroupSection.js.map +1 -1
- package/lib/components/ContentGroupSection/index.js +1 -2
- package/lib/components/ContentGroupSection/index.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryFactory.js +3 -4
- package/lib/components/DataSummary/DataSummaryFactory.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryRender.js +1 -2
- package/lib/components/DataSummary/DataSummaryRender.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/HeadingLargeSummary/HeadingLargeSummary.js +1 -2
- package/lib/components/DataSummary/DataSummaryTypes/HeadingLargeSummary/HeadingLargeSummary.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/HeadingLargeSummary/HeadingLargeSummaryContent.js +3 -4
- package/lib/components/DataSummary/DataSummaryTypes/HeadingLargeSummary/HeadingLargeSummaryContent.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/HeadingLargeSummary/index.js +1 -2
- package/lib/components/DataSummary/DataSummaryTypes/HeadingLargeSummary/index.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/ItemDetailsSummary/ItemDetailsSummary.js +1 -2
- package/lib/components/DataSummary/DataSummaryTypes/ItemDetailsSummary/ItemDetailsSummary.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/ItemDetailsSummary/ItemDetailsSummaryContent.js +3 -4
- package/lib/components/DataSummary/DataSummaryTypes/ItemDetailsSummary/ItemDetailsSummaryContent.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/ItemDetailsSummary/index.js +1 -2
- package/lib/components/DataSummary/DataSummaryTypes/ItemDetailsSummary/index.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/LargeSummary/LargeSummary.js +1 -2
- package/lib/components/DataSummary/DataSummaryTypes/LargeSummary/LargeSummary.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/LargeSummary/LargeSummaryContent.js +3 -4
- package/lib/components/DataSummary/DataSummaryTypes/LargeSummary/LargeSummaryContent.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/LargeSummary/index.js +1 -2
- package/lib/components/DataSummary/DataSummaryTypes/LargeSummary/index.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/ListSummary/ListSummary.js +1 -2
- package/lib/components/DataSummary/DataSummaryTypes/ListSummary/ListSummary.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/ListSummary/ListSummaryContent.js +3 -4
- package/lib/components/DataSummary/DataSummaryTypes/ListSummary/ListSummaryContent.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/ListSummary/index.js +1 -2
- package/lib/components/DataSummary/DataSummaryTypes/ListSummary/index.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/TextSummary/TextSummary.js +1 -2
- package/lib/components/DataSummary/DataSummaryTypes/TextSummary/TextSummary.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/TextSummary/TextSummaryContent.js +3 -4
- package/lib/components/DataSummary/DataSummaryTypes/TextSummary/TextSummaryContent.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/TextSummary/index.js +1 -2
- package/lib/components/DataSummary/DataSummaryTypes/TextSummary/index.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/index.js +3 -4
- package/lib/components/DataSummary/DataSummaryTypes/index.js.map +1 -1
- package/lib/components/DataSummary/helpers/build-loop-props-content.js +1 -2
- 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 +1 -2
- package/lib/components/DataSummary/helpers/build-props-to-display-with-content.js.map +1 -1
- package/lib/components/DataSummary/helpers/get-data-summary-query.js +1 -2
- package/lib/components/DataSummary/helpers/get-data-summary-query.js.map +1 -1
- package/lib/components/DataSummary/helpers/get-link-based-on-value.js +1 -2
- package/lib/components/DataSummary/helpers/get-link-based-on-value.js.map +1 -1
- package/lib/components/DataSummary/helpers/get-link-props.js +1 -2
- package/lib/components/DataSummary/helpers/get-link-props.js.map +1 -1
- package/lib/components/DataSummary/helpers/get-link-to-published-content.js +1 -2
- package/lib/components/DataSummary/helpers/get-link-to-published-content.js.map +1 -1
- package/lib/components/DataSummary/helpers/get-loop-props-limit.js +1 -2
- package/lib/components/DataSummary/helpers/get-loop-props-limit.js.map +1 -1
- package/lib/components/DataSummary/helpers/get-prop-value.js +1 -2
- package/lib/components/DataSummary/helpers/get-prop-value.js.map +1 -1
- package/lib/components/DataSummary/helpers/get-value-from-array.js +3 -5
- package/lib/components/DataSummary/helpers/get-value-from-array.js.map +1 -1
- package/lib/components/DataSummary/helpers/parse-boolean-values.js +1 -2
- package/lib/components/DataSummary/helpers/parse-boolean-values.js.map +1 -1
- package/lib/components/DataSummary/helpers/strip-summary-props-content.js +1 -2
- package/lib/components/DataSummary/helpers/strip-summary-props-content.js.map +1 -1
- package/lib/components/DataSummary/index.js +1 -2
- package/lib/components/DataSummary/index.js.map +1 -1
- package/lib/components/EmailConfirm/EmailConfirm.js +3 -4
- package/lib/components/EmailConfirm/EmailConfirm.js.map +1 -1
- package/lib/components/EmailConfirm/index.js +1 -2
- package/lib/components/EmailConfirm/index.js.map +1 -1
- package/lib/components/EmailConfirm/mutation.js +1 -2
- package/lib/components/EmailConfirm/mutation.js.map +1 -1
- package/lib/components/Iframe/Iframe.js +1 -2
- package/lib/components/Iframe/Iframe.js.map +1 -1
- package/lib/components/Iframe/constants.js +2 -4
- package/lib/components/Iframe/constants.js.map +1 -1
- package/lib/components/Iframe/index.js +1 -2
- package/lib/components/Iframe/index.js.map +1 -1
- package/lib/components/Image/GlobalLightbox/GlobalLightbox.js +3 -4
- package/lib/components/Image/GlobalLightbox/GlobalLightbox.js.map +1 -1
- package/lib/components/Image/GlobalLightbox/NavButton.js +1 -2
- package/lib/components/Image/GlobalLightbox/NavButton.js.map +1 -1
- package/lib/components/Image/GlobalLightbox/index.js +3 -4
- package/lib/components/Image/GlobalLightbox/index.js.map +1 -1
- package/lib/components/Image/Image.js +3 -4
- package/lib/components/Image/Image.js.map +1 -1
- package/lib/components/Image/ImageDetails.js +1 -2
- package/lib/components/Image/ImageDetails.js.map +1 -1
- package/lib/components/Image/ImageFactory.js +3 -4
- package/lib/components/Image/ImageFactory.js.map +1 -1
- package/lib/components/Image/ImageRender.js +1 -2
- package/lib/components/Image/ImageRender.js.map +1 -1
- package/lib/components/Image/Lightbox/Lightbox.js +3 -4
- package/lib/components/Image/Lightbox/Lightbox.js.map +1 -1
- package/lib/components/Image/Lightbox/index.js +1 -2
- package/lib/components/Image/Lightbox/index.js.map +1 -1
- package/lib/components/Image/index.js +1 -2
- package/lib/components/Image/index.js.map +1 -1
- package/lib/components/ItemList/ItemListButton/ItemListButton.js +3 -4
- package/lib/components/ItemList/ItemListButton/ItemListButton.js.map +1 -1
- package/lib/components/ItemList/ItemListButton/index.js +1 -2
- package/lib/components/ItemList/ItemListButton/index.js.map +1 -1
- package/lib/components/ItemList/ItemListCounter/ItemListCounter.js +1 -2
- package/lib/components/ItemList/ItemListCounter/ItemListCounter.js.map +1 -1
- package/lib/components/ItemList/ItemListCounter/index.js +1 -2
- package/lib/components/ItemList/ItemListCounter/index.js.map +1 -1
- package/lib/components/ItemList/ItemListNew/ItemListNew.js +1 -2
- package/lib/components/ItemList/ItemListNew/ItemListNew.js.map +1 -1
- package/lib/components/ItemList/ItemListNew/index.js +1 -2
- package/lib/components/ItemList/ItemListNew/index.js.map +1 -1
- package/lib/components/ItemList/constants.js +5 -10
- package/lib/components/ItemList/constants.js.map +1 -1
- package/lib/components/ItemList/helpers/get-item-list-data.js +1 -2
- package/lib/components/ItemList/helpers/get-item-list-data.js.map +1 -1
- package/lib/components/ItemList/helpers/get-item-list-id.js +1 -2
- package/lib/components/ItemList/helpers/get-item-list-id.js.map +1 -1
- package/lib/components/ItemList/helpers/get-item-list-ids.js +1 -2
- package/lib/components/ItemList/helpers/get-item-list-ids.js.map +1 -1
- package/lib/components/ItemList/helpers/set-item-list-id.js +1 -2
- package/lib/components/ItemList/helpers/set-item-list-id.js.map +1 -1
- package/lib/components/ItemList/helpers/set-param-and-redirect.js +1 -2
- package/lib/components/ItemList/helpers/set-param-and-redirect.js.map +1 -1
- package/lib/components/ItemList/hooks/use-item-list-id.js +1 -2
- package/lib/components/ItemList/hooks/use-item-list-id.js.map +1 -1
- package/lib/components/Layout/Layout.js +8 -5
- package/lib/components/Layout/Layout.js.map +1 -1
- package/lib/components/Layout/LayoutFactory.js +3 -4
- package/lib/components/Layout/LayoutFactory.js.map +1 -1
- package/lib/components/Layout/LayoutWithStickyTimer.js +3 -4
- package/lib/components/Layout/LayoutWithStickyTimer.js.map +1 -1
- package/lib/components/Layout/constants.js +3 -6
- package/lib/components/Layout/constants.js.map +1 -1
- package/lib/components/Layout/helpers/check-if-row-has-columns.js +1 -2
- package/lib/components/Layout/helpers/check-if-row-has-columns.js.map +1 -1
- package/lib/components/Layout/helpers/get-styles-to-update.js +1 -2
- package/lib/components/Layout/helpers/get-styles-to-update.js.map +1 -1
- package/lib/components/Layout/index.js +1 -2
- package/lib/components/Layout/index.js.map +1 -1
- package/lib/components/LazyImage/LazyImage.js +1 -2
- package/lib/components/LazyImage/LazyImage.js.map +1 -1
- package/lib/components/LazyImage/index.js +3 -4
- package/lib/components/LazyImage/index.js.map +1 -1
- package/lib/components/List/ListBuilder.js +1 -2
- package/lib/components/List/ListBuilder.js.map +1 -1
- package/lib/components/List/ListFactory.js +3 -4
- package/lib/components/List/ListFactory.js.map +1 -1
- package/lib/components/List/ListRender.js +1 -2
- package/lib/components/List/ListRender.js.map +1 -1
- package/lib/components/List/components/Cards/CardRenderWithInfiniteScroll.js +1 -2
- package/lib/components/List/components/Cards/CardRenderWithInfiniteScroll.js.map +1 -1
- package/lib/components/List/components/Cards/CardsRender.js +3 -4
- package/lib/components/List/components/Cards/CardsRender.js.map +1 -1
- package/lib/components/List/components/Cards/CardsRenderItem.js +1 -2
- package/lib/components/List/components/Cards/CardsRenderItem.js.map +1 -1
- package/lib/components/List/components/Cards/CardsRenderWrapper.js +3 -4
- package/lib/components/List/components/Cards/CardsRenderWrapper.js.map +1 -1
- package/lib/components/List/components/Cards/index.js +1 -2
- package/lib/components/List/components/Cards/index.js.map +1 -1
- package/lib/components/List/components/Full/FullRender.js +3 -4
- package/lib/components/List/components/Full/FullRender.js.map +1 -1
- package/lib/components/List/components/Full/FullRenderItem.js +3 -4
- package/lib/components/List/components/Full/FullRenderItem.js.map +1 -1
- package/lib/components/List/components/Full/FullRenderWithInfiniteScroll.js +1 -2
- package/lib/components/List/components/Full/FullRenderWithInfiniteScroll.js.map +1 -1
- package/lib/components/List/components/Full/index.js +1 -2
- package/lib/components/List/components/Full/index.js.map +1 -1
- package/lib/components/List/components/Header/ListHeader.js +1 -2
- package/lib/components/List/components/Header/ListHeader.js.map +1 -1
- package/lib/components/List/components/Header/index.js +1 -2
- package/lib/components/List/components/Header/index.js.map +1 -1
- package/lib/components/List/components/Pagination/Classic.js +1 -2
- package/lib/components/List/components/Pagination/Classic.js.map +1 -1
- package/lib/components/List/components/Pagination/ListPagination.js +3 -4
- package/lib/components/List/components/Pagination/ListPagination.js.map +1 -1
- package/lib/components/List/components/Pagination/LoadMore.js +1 -2
- package/lib/components/List/components/Pagination/LoadMore.js.map +1 -1
- package/lib/components/List/components/Pagination/index.js +1 -2
- package/lib/components/List/components/Pagination/index.js.map +1 -1
- package/lib/components/List/components/helpers/check-if-should-render-banner.js +2 -4
- package/lib/components/List/components/helpers/check-if-should-render-banner.js.map +1 -1
- package/lib/components/List/components/helpers/check-if-should-render-gtm.js +1 -2
- package/lib/components/List/components/helpers/check-if-should-render-gtm.js.map +1 -1
- package/lib/components/List/constants.js +7 -14
- package/lib/components/List/constants.js.map +1 -1
- package/lib/components/List/helpers/build-az-aggregations.js +1 -2
- package/lib/components/List/helpers/build-az-aggregations.js.map +1 -1
- package/lib/components/List/helpers/build-az-url.js +2 -4
- package/lib/components/List/helpers/build-az-url.js.map +1 -1
- package/lib/components/List/helpers/build-pagination-items.js +1 -2
- package/lib/components/List/helpers/build-pagination-items.js.map +1 -1
- package/lib/components/List/helpers/build-pagination-url.js +1 -2
- package/lib/components/List/helpers/build-pagination-url.js.map +1 -1
- package/lib/components/List/helpers/get-az-query-filter.js +1 -2
- package/lib/components/List/helpers/get-az-query-filter.js.map +1 -1
- package/lib/components/List/helpers/get-items-per-page-to-use.js +1 -2
- package/lib/components/List/helpers/get-items-per-page-to-use.js.map +1 -1
- package/lib/components/List/helpers/get-list-component.js +1 -2
- package/lib/components/List/helpers/get-list-component.js.map +1 -1
- package/lib/components/List/helpers/get-list-query.js +1 -2
- package/lib/components/List/helpers/get-list-query.js.map +1 -1
- package/lib/components/List/helpers/get-list-specific-search-filter.js +1 -2
- package/lib/components/List/helpers/get-list-specific-search-filter.js.map +1 -1
- package/lib/components/List/helpers/get-sort-props.js +1 -2
- package/lib/components/List/helpers/get-sort-props.js.map +1 -1
- package/lib/components/List/helpers/has-required-item-list-details.js +1 -2
- package/lib/components/List/helpers/has-required-item-list-details.js.map +1 -1
- package/lib/components/List/helpers/sort-aggs.js +1 -2
- package/lib/components/List/helpers/sort-aggs.js.map +1 -1
- package/lib/components/List/helpers/strip-query-key.js +1 -2
- package/lib/components/List/helpers/strip-query-key.js.map +1 -1
- package/lib/components/List/index.js +1 -2
- package/lib/components/List/index.js.map +1 -1
- package/lib/components/Menu/Menu.js +4 -6
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/Menu/MenuContext.js +1 -2
- package/lib/components/Menu/MenuContext.js.map +1 -1
- package/lib/components/Menu/index.js +1 -2
- package/lib/components/Menu/index.js.map +1 -1
- package/lib/components/MenuItem/MenuItem.js +3 -4
- package/lib/components/MenuItem/MenuItem.js.map +1 -1
- package/lib/components/MenuItem/index.js +1 -2
- package/lib/components/MenuItem/index.js.map +1 -1
- package/lib/components/Modal/Modal.js +1 -2
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/Modal/index.js +1 -2
- package/lib/components/Modal/index.js.map +1 -1
- package/lib/components/SearchContent/SearchContent.js +58 -56
- package/lib/components/SearchContent/SearchContent.js.map +1 -1
- package/lib/components/SearchContent/SearchContentItems.js +1 -2
- package/lib/components/SearchContent/SearchContentItems.js.map +1 -1
- package/lib/components/SearchContent/SearchContentResults.js +17 -19
- package/lib/components/SearchContent/SearchContentResults.js.map +1 -1
- package/lib/components/SearchContent/SearchContentToggleIcon.js +9 -18
- package/lib/components/SearchContent/SearchContentToggleIcon.js.map +1 -1
- package/lib/components/SearchContent/constants.js +10 -0
- package/lib/components/SearchContent/constants.js.map +1 -0
- package/lib/components/SearchContent/index.js +1 -2
- package/lib/components/SearchContent/index.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilter/CloseMobileForm.js +1 -2
- package/lib/components/SearchFilter/SearchFilter/CloseMobileForm.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilter/FiltersList.js +3 -4
- package/lib/components/SearchFilter/SearchFilter/FiltersList.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilter/MobileFormToolbar.js +1 -2
- package/lib/components/SearchFilter/SearchFilter/MobileFormToolbar.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilter/ResetDesktopForm.js +1 -2
- package/lib/components/SearchFilter/SearchFilter/ResetDesktopForm.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilter/SearchFilter.js +3 -4
- package/lib/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilter/index.js +1 -2
- package/lib/components/SearchFilter/SearchFilter/index.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilterContainer.js +3 -5
- package/lib/components/SearchFilter/SearchFilterContainer.js.map +1 -1
- package/lib/components/SearchFilter/components/Checkbox.js +3 -4
- package/lib/components/SearchFilter/components/Checkbox.js.map +1 -1
- package/lib/components/SearchFilter/components/Range.js +1 -2
- package/lib/components/SearchFilter/components/Range.js.map +1 -1
- package/lib/components/SearchFilter/components/Select.js +1 -2
- package/lib/components/SearchFilter/components/Select.js.map +1 -1
- package/lib/components/SearchFilter/components/TextSearch.js +1 -2
- package/lib/components/SearchFilter/components/TextSearch.js.map +1 -1
- package/lib/components/SearchFilter/constants.js +24 -48
- package/lib/components/SearchFilter/constants.js.map +1 -1
- package/lib/components/SearchFilter/helpers/build-filters-query.js +1 -2
- package/lib/components/SearchFilter/helpers/build-filters-query.js.map +1 -1
- package/lib/components/SearchFilter/helpers/build-new-url.js +1 -2
- package/lib/components/SearchFilter/helpers/build-new-url.js.map +1 -1
- package/lib/components/SearchFilter/helpers/build-raw-query-stringified.js +1 -2
- package/lib/components/SearchFilter/helpers/build-raw-query-stringified.js.map +1 -1
- package/lib/components/SearchFilter/helpers/build-url-query.js +1 -2
- package/lib/components/SearchFilter/helpers/build-url-query.js.map +1 -1
- package/lib/components/SearchFilter/helpers/calculate-min-max.js +1 -2
- package/lib/components/SearchFilter/helpers/calculate-min-max.js.map +1 -1
- package/lib/components/SearchFilter/helpers/calculate-step.js +1 -2
- package/lib/components/SearchFilter/helpers/calculate-step.js.map +1 -1
- package/lib/components/SearchFilter/helpers/check-if-range-updated.js +1 -2
- package/lib/components/SearchFilter/helpers/check-if-range-updated.js.map +1 -1
- package/lib/components/SearchFilter/helpers/decode-encode.js +2 -4
- package/lib/components/SearchFilter/helpers/decode-encode.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-display-value.js +1 -2
- package/lib/components/SearchFilter/helpers/get-display-value.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js +1 -2
- package/lib/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-filter-value-from-query.js +1 -2
- package/lib/components/SearchFilter/helpers/get-filter-value-from-query.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-filter-values.js +1 -2
- package/lib/components/SearchFilter/helpers/get-filter-values.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-initial-filter-values.js +1 -2
- package/lib/components/SearchFilter/helpers/get-initial-filter-values.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-intersected-prop.js +1 -2
- package/lib/components/SearchFilter/helpers/get-intersected-prop.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-range-value.js +1 -2
- package/lib/components/SearchFilter/helpers/get-range-value.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-responsive-filter-classnames.js +1 -2
- package/lib/components/SearchFilter/helpers/get-responsive-filter-classnames.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-select-options.js +1 -2
- package/lib/components/SearchFilter/helpers/get-select-options.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-updated-filter-by.js +1 -2
- package/lib/components/SearchFilter/helpers/get-updated-filter-by.js.map +1 -1
- package/lib/components/SearchFilter/helpers/is-device-desktop.js +1 -2
- package/lib/components/SearchFilter/helpers/is-device-desktop.js.map +1 -1
- package/lib/components/SearchFilter/helpers/parse-filter-value.js +1 -2
- package/lib/components/SearchFilter/helpers/parse-filter-value.js.map +1 -1
- package/lib/components/SearchFilter/index.js +1 -2
- package/lib/components/SearchFilter/index.js.map +1 -1
- package/lib/components/SearchFilter/searchFilterReducer.js +1 -2
- package/lib/components/SearchFilter/searchFilterReducer.js.map +1 -1
- package/lib/components/SearchFilterSort/SearchFilterSort.js +1 -2
- package/lib/components/SearchFilterSort/SearchFilterSort.js.map +1 -1
- package/lib/components/SearchFilterSort/constants.js +4 -8
- package/lib/components/SearchFilterSort/constants.js.map +1 -1
- package/lib/components/SearchFilterSort/helpers/handle-sort-update.js +1 -2
- package/lib/components/SearchFilterSort/helpers/handle-sort-update.js.map +1 -1
- package/lib/components/SearchFilterSort/helpers/update-sort.js +2 -4
- package/lib/components/SearchFilterSort/helpers/update-sort.js.map +1 -1
- package/lib/components/SearchFilterSort/index.js +1 -2
- package/lib/components/SearchFilterSort/index.js.map +1 -1
- package/lib/components/SocialFollow/SFItem.js +1 -2
- package/lib/components/SocialFollow/SFItem.js.map +1 -1
- package/lib/components/SocialFollow/SocialFollow.js +1 -2
- package/lib/components/SocialFollow/SocialFollow.js.map +1 -1
- package/lib/components/SocialFollow/SocialFollowRender.js +1 -2
- package/lib/components/SocialFollow/SocialFollowRender.js.map +1 -1
- package/lib/components/SocialFollow/index.js +1 -2
- package/lib/components/SocialFollow/index.js.map +1 -1
- package/lib/components/SocialFollow/sf.config.js +4 -8
- package/lib/components/SocialFollow/sf.config.js.map +1 -1
- package/lib/components/SubMenu/SubMenu.js +1 -2
- package/lib/components/SubMenu/SubMenu.js.map +1 -1
- package/lib/components/SubMenu/index.js +1 -2
- package/lib/components/SubMenu/index.js.map +1 -1
- package/lib/components/TextBlock/TextBlockRender.js +1 -2
- package/lib/components/TextBlock/TextBlockRender.js.map +1 -1
- package/lib/components/TextBlock/index.js +1 -2
- package/lib/components/TextBlock/index.js.map +1 -1
- package/lib/components/Video/Video.js +1 -2
- package/lib/components/Video/Video.js.map +1 -1
- package/lib/components/Video/VideoModal.js +3 -4
- package/lib/components/Video/VideoModal.js.map +1 -1
- package/lib/components/Video/VideoRender.js +1 -2
- package/lib/components/Video/VideoRender.js.map +1 -1
- package/lib/components/Video/index.js +1 -2
- package/lib/components/Video/index.js.map +1 -1
- package/lib/components/Video/providers/Default.js +1 -2
- package/lib/components/Video/providers/Default.js.map +1 -1
- package/lib/components/Video/providers/JWPlayer/JWPlayerController.js +1 -2
- package/lib/components/Video/providers/JWPlayer/JWPlayerController.js.map +1 -1
- package/lib/components/Video/providers/JWPlayer/JWPlayerProvider.js +1 -2
- package/lib/components/Video/providers/JWPlayer/JWPlayerProvider.js.map +1 -1
- package/lib/components/Video/providers/Vimeo/VimeoProvider.js +3 -4
- package/lib/components/Video/providers/Vimeo/VimeoProvider.js.map +1 -1
- package/lib/components/Video/providers/Vimeo/helpers/add-extra-params-to-url.js +1 -2
- package/lib/components/Video/providers/Vimeo/helpers/add-extra-params-to-url.js.map +1 -1
- package/lib/components/Video/providers/YouTube/YouTubeProvider.js +1 -2
- package/lib/components/Video/providers/YouTube/YouTubeProvider.js.map +1 -1
- package/lib/components/Video/providers/YouTube/YoutubeEmbeded.js +3 -4
- package/lib/components/Video/providers/YouTube/YoutubeEmbeded.js.map +1 -1
- package/lib/components/Video/providers/YouTube/helpers/index.js +3 -6
- package/lib/components/Video/providers/YouTube/helpers/index.js.map +1 -1
- package/lib/components/Video/providers/get-provider.js +3 -4
- package/lib/components/Video/providers/get-provider.js.map +1 -1
- package/lib/components/Video/providers/index.js +1 -2
- package/lib/components/Video/providers/index.js.map +1 -1
- package/lib/components/Wrapper.js +1 -2
- package/lib/components/Wrapper.js.map +1 -1
- package/lib/components/index.js +3 -4
- package/lib/components/index.js.map +1 -1
- package/lib/constants/componentsDefaultValues.js +1 -2
- package/lib/constants/componentsDefaultValues.js.map +1 -1
- package/lib/constants/index.js +107 -212
- package/lib/constants/index.js.map +1 -1
- package/lib/helpers/append-images.js +1 -2
- package/lib/helpers/append-images.js.map +1 -1
- package/lib/helpers/build-az-filter.js +1 -2
- package/lib/helpers/build-az-filter.js.map +1 -1
- package/lib/helpers/build-checkbox-filters.js +1 -2
- package/lib/helpers/build-checkbox-filters.js.map +1 -1
- package/lib/helpers/build-image-properties.js +1 -2
- package/lib/helpers/build-image-properties.js.map +1 -1
- package/lib/helpers/build-inherited-filters.js +1 -2
- package/lib/helpers/build-inherited-filters.js.map +1 -1
- package/lib/helpers/build-link-extra-props.js +1 -2
- package/lib/helpers/build-link-extra-props.js.map +1 -1
- package/lib/helpers/build-props-query.js +1 -2
- package/lib/helpers/build-props-query.js.map +1 -1
- package/lib/helpers/build-query-fields.js +1 -2
- package/lib/helpers/build-query-fields.js.map +1 -1
- package/lib/helpers/build-query-key.js +1 -2
- package/lib/helpers/build-query-key.js.map +1 -1
- package/lib/helpers/build-raw-query-base.js +2 -4
- package/lib/helpers/build-raw-query-base.js.map +1 -1
- package/lib/helpers/build-raw-query.js +1 -2
- package/lib/helpers/build-raw-query.js.map +1 -1
- package/lib/helpers/build-search-values-checkbox-select.js +1 -2
- package/lib/helpers/build-search-values-checkbox-select.js.map +1 -1
- package/lib/helpers/build-search-values-text.js +1 -2
- package/lib/helpers/build-search-values-text.js.map +1 -1
- package/lib/helpers/build-set-filters.js +1 -2
- package/lib/helpers/build-set-filters.js.map +1 -1
- package/lib/helpers/build-sort-values.js +1 -2
- package/lib/helpers/build-sort-values.js.map +1 -1
- package/lib/helpers/check-for-error.js +1 -2
- package/lib/helpers/check-for-error.js.map +1 -1
- package/lib/helpers/check-props-to-use.js +1 -2
- package/lib/helpers/check-props-to-use.js.map +1 -1
- package/lib/helpers/entities/constants.js +3 -6
- package/lib/helpers/entities/constants.js.map +1 -1
- package/lib/helpers/get-checkbox-filters.js +1 -2
- package/lib/helpers/get-checkbox-filters.js.map +1 -1
- package/lib/helpers/get-click-wrapper-options.js +1 -2
- package/lib/helpers/get-click-wrapper-options.js.map +1 -1
- package/lib/helpers/get-current-offset.js +1 -2
- package/lib/helpers/get-current-offset.js.map +1 -1
- package/lib/helpers/get-dictionary-match.js +1 -2
- package/lib/helpers/get-dictionary-match.js.map +1 -1
- package/lib/helpers/get-display-count-data.js +1 -2
- package/lib/helpers/get-display-count-data.js.map +1 -1
- package/lib/helpers/get-elasticsearch-operator.js +1 -2
- package/lib/helpers/get-elasticsearch-operator.js.map +1 -1
- package/lib/helpers/get-entity-data.js +1 -2
- package/lib/helpers/get-entity-data.js.map +1 -1
- package/lib/helpers/get-entity-render-props.js +1 -2
- package/lib/helpers/get-entity-render-props.js.map +1 -1
- package/lib/helpers/get-extra-az-bits.js +1 -2
- package/lib/helpers/get-extra-az-bits.js.map +1 -1
- package/lib/helpers/get-filter-props.js +1 -2
- package/lib/helpers/get-filter-props.js.map +1 -1
- package/lib/helpers/get-filter-relation-keys.js +1 -2
- package/lib/helpers/get-filter-relation-keys.js.map +1 -1
- package/lib/helpers/get-generic-props.js +1 -2
- package/lib/helpers/get-generic-props.js.map +1 -1
- package/lib/helpers/get-generic-render-variables.js +1 -2
- package/lib/helpers/get-generic-render-variables.js.map +1 -1
- package/lib/helpers/get-image-ids.js +1 -2
- package/lib/helpers/get-image-ids.js.map +1 -1
- package/lib/helpers/get-inherited-filters.js +1 -2
- package/lib/helpers/get-inherited-filters.js.map +1 -1
- package/lib/helpers/get-items-to-display-ids.js +1 -2
- package/lib/helpers/get-items-to-display-ids.js.map +1 -1
- package/lib/helpers/get-modifiers.js +1 -2
- package/lib/helpers/get-modifiers.js.map +1 -1
- package/lib/helpers/get-pagination-index.js +1 -2
- package/lib/helpers/get-pagination-index.js.map +1 -1
- package/lib/helpers/get-parsed-prop-values.js +1 -2
- package/lib/helpers/get-parsed-prop-values.js.map +1 -1
- package/lib/helpers/get-parsed-summary-value.js +1 -2
- package/lib/helpers/get-parsed-summary-value.js.map +1 -1
- package/lib/helpers/get-prop-values.js +1 -2
- package/lib/helpers/get-prop-values.js.map +1 -1
- package/lib/helpers/get-query-filters.js +1 -2
- package/lib/helpers/get-query-filters.js.map +1 -1
- package/lib/helpers/get-query-props.js +1 -2
- package/lib/helpers/get-query-props.js.map +1 -1
- package/lib/helpers/get-required-schemas.js +1 -2
- package/lib/helpers/get-required-schemas.js.map +1 -1
- package/lib/helpers/get-sanitized-prop-values.js +1 -2
- package/lib/helpers/get-sanitized-prop-values.js.map +1 -1
- package/lib/helpers/get-search-filter-type.js +1 -2
- package/lib/helpers/get-search-filter-type.js.map +1 -1
- package/lib/helpers/get-sort-by-field-name.js +1 -2
- package/lib/helpers/get-sort-by-field-name.js.map +1 -1
- package/lib/helpers/get-unpublished-entity-name.js +1 -2
- package/lib/helpers/get-unpublished-entity-name.js.map +1 -1
- package/lib/helpers/get-updated-filter-by.js +1 -2
- package/lib/helpers/get-updated-filter-by.js.map +1 -1
- package/lib/helpers/get-wrapped-value-with-link.js +1 -2
- package/lib/helpers/get-wrapped-value-with-link.js.map +1 -1
- package/lib/helpers/has-children.js +1 -2
- package/lib/helpers/has-children.js.map +1 -1
- package/lib/helpers/inject-multiple-banners/get-banners-for-entities/index.js +1 -2
- package/lib/helpers/inject-multiple-banners/get-banners-for-entities/index.js.map +1 -1
- package/lib/helpers/inject-multiple-banners/get-banners-for-nodes/index.js +1 -2
- package/lib/helpers/inject-multiple-banners/get-banners-for-nodes/index.js.map +1 -1
- package/lib/helpers/inject-multiple-banners/index.js +1 -2
- package/lib/helpers/inject-multiple-banners/index.js.map +1 -1
- package/lib/helpers/is-browser.js +1 -2
- package/lib/helpers/is-browser.js.map +1 -1
- package/lib/helpers/is-filter-entitys-id.js +1 -2
- package/lib/helpers/is-filter-entitys-id.js.map +1 -1
- package/lib/helpers/is-object.js +1 -2
- package/lib/helpers/is-object.js.map +1 -1
- package/lib/helpers/is-using-relation-image.js +1 -2
- package/lib/helpers/is-using-relation-image.js.map +1 -1
- package/lib/helpers/parse-TextBlock.js +3 -4
- package/lib/helpers/parse-TextBlock.js.map +1 -1
- package/lib/helpers/parse-props-to-display.js +3 -4
- package/lib/helpers/parse-props-to-display.js.map +1 -1
- package/lib/helpers/process-data-summary-value.js +4 -6
- package/lib/helpers/process-data-summary-value.js.map +1 -1
- package/lib/helpers/remove-extra-items.js +1 -2
- package/lib/helpers/remove-extra-items.js.map +1 -1
- package/lib/helpers/remove-unwanted-characters.js +1 -2
- package/lib/helpers/remove-unwanted-characters.js.map +1 -1
- package/lib/helpers/render-children.js +1 -2
- package/lib/helpers/render-children.js.map +1 -1
- package/lib/helpers/should-render-waypoint.js +1 -2
- package/lib/helpers/should-render-waypoint.js.map +1 -1
- package/lib/helpers/should-show-property.js +1 -2
- package/lib/helpers/should-show-property.js.map +1 -1
- package/lib/helpers/sort-response-data.js +1 -2
- package/lib/helpers/sort-response-data.js.map +1 -1
- package/lib/helpers/split-children.js +1 -2
- package/lib/helpers/split-children.js.map +1 -1
- package/lib/helpers/update-childrens-parent.js +1 -2
- package/lib/helpers/update-childrens-parent.js.map +1 -1
- package/lib/hooks/helpers/RenderComponent.js +10 -4
- package/lib/hooks/helpers/RenderComponent.js.map +1 -1
- package/lib/hooks/helpers/StoreImages.js +1 -2
- package/lib/hooks/helpers/StoreImages.js.map +1 -1
- package/lib/hooks/helpers/append-gtm-classname.js +1 -2
- package/lib/hooks/helpers/append-gtm-classname.js.map +1 -1
- package/lib/hooks/helpers/buildPBComponents.js +1 -2
- package/lib/hooks/helpers/buildPBComponents.js.map +1 -1
- package/lib/hooks/helpers/check-banner-insertion-set.js +1 -2
- package/lib/hooks/helpers/check-banner-insertion-set.js.map +1 -1
- package/lib/hooks/helpers/check-collisions.js +2 -4
- package/lib/hooks/helpers/check-collisions.js.map +1 -1
- package/lib/hooks/helpers/constants.js +4 -8
- package/lib/hooks/helpers/constants.js.map +1 -1
- package/lib/hooks/helpers/get-banner-index.js +1 -2
- package/lib/hooks/helpers/get-banner-index.js.map +1 -1
- package/lib/hooks/helpers/get-banners-by-type.js +1 -2
- package/lib/hooks/helpers/get-banners-by-type.js.map +1 -1
- package/lib/hooks/helpers/get-lightbox-images.js +1 -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/index.js +1 -2
- package/lib/hooks/helpers/index.js.map +1 -1
- package/lib/hooks/helpers/inject-element-banners.js +1 -2
- package/lib/hooks/helpers/inject-element-banners.js.map +1 -1
- package/lib/hooks/helpers/inject-textblock-banners.js +1 -2
- package/lib/hooks/helpers/inject-textblock-banners.js.map +1 -1
- package/lib/hooks/helpers/insert-banners.js +1 -2
- package/lib/hooks/helpers/insert-banners.js.map +1 -1
- package/lib/hooks/helpers/update-targetings.js +1 -2
- package/lib/hooks/helpers/update-targetings.js.map +1 -1
- package/lib/hooks/use-banner-insertion.js +1 -2
- package/lib/hooks/use-banner-insertion.js.map +1 -1
- package/lib/hooks/use-check-mobile-screen.js +1 -2
- package/lib/hooks/use-check-mobile-screen.js.map +1 -1
- package/lib/hooks/use-get-entity-schema.js +1 -2
- package/lib/hooks/use-get-entity-schema.js.map +1 -1
- package/lib/hooks/use-get-entity-schemas-as-obj.js +1 -2
- package/lib/hooks/use-get-entity-schemas-as-obj.js.map +1 -1
- package/lib/hooks/use-get-image-id-from-relation.js +1 -2
- package/lib/hooks/use-get-image-id-from-relation.js.map +1 -1
- package/lib/hooks/use-get-images.js +1 -2
- package/lib/hooks/use-get-images.js.map +1 -1
- package/lib/hooks/use-get-single-entity-schema.js +1 -2
- package/lib/hooks/use-get-single-entity-schema.js.map +1 -1
- package/lib/hooks/use-page-builder.js +1 -2
- package/lib/hooks/use-page-builder.js.map +1 -1
- package/lib/index.js +13 -0
- package/lib/index.js.map +1 -1
- package/lib/utils/component-map.js +4 -5
- package/lib/utils/component-map.js.map +1 -1
- package/lib/utils/get-image-data.js +1 -2
- package/lib/utils/get-image-data.js.map +1 -1
- package/lib/utils/get-props-to-display-modifiers.js +1 -2
- package/lib/utils/get-props-to-display-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 +39 -0
- package/lib/utils/variant-handler.js.map +1 -0
- package/lib/variants/index.js +9 -0
- package/lib/variants/index.js.map +1 -0
- 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 +2 -5
- package/lib-es/components/Card/CardsContainer.js.map +1 -1
- package/lib-es/components/Card/CardsRender.js +1 -2
- package/lib-es/components/Card/CardsRender.js.map +1 -1
- 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/Layout/Layout.js +8 -4
- package/lib-es/components/Layout/Layout.js.map +1 -1
- 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/SearchFilterContainer.js +0 -1
- package/lib-es/components/SearchFilter/SearchFilterContainer.js.map +1 -1
- package/lib-es/helpers/process-data-summary-value.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/getVariant.js +14 -0
- package/lib-es/hooks/helpers/getVariant.js.map +1 -0
- 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/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 +4 -4
- 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/Layout/Layout.js +8 -5
- 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/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/Layout/Layout.test.js +11 -0
- package/tests/unit/src/components/Menu/__snapshots__/Menu.test.js.snap +1 -1
- 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardsRender.js","names":["React","useContext","useQuery","dynamic","PropTypes","MainContext","generateSingleItemQuery","SEARCH_PUBLISHED_CONTENT","AND","FULL","useGetEntitySchemasAsObj","useGetImages","getUpdatedFilterBy","getEntityData","getRequiredSchemas","sortResponseData","getUnpublishedEntityName","renderChildren","splitChildren","removeExtraItems","appendImages","filtersSetup","filterQuerySetup","shouldSkipSingleQuery","shouldReturn","getUpdatedSortProperties","getUpdatedItemsToDisplay","CardsContainer","CardsRender","_ref","entity","legacyEntity","entities","entityFields","itemsToDisplay","children","otherProps","_objectWithoutProperties","_excluded","isPreview","parent","itemId","parentId","itemEntity","parentEntity","filterBy","filterByProperty","sortby","sort","sortProperties","operator","filterOperator","useRandomSort","updatedSortProperties","sortbyFilters","variableProps","_objectSpread","entitiesToUse","primaryEntityToUse","unpublishedParentEntityName","allEntityNames","uniqueEntityNames","Set","data","mainSchemas","loading","_loading","error","_error","parentSchema","filterEntitySchema","entitiesTypes","map","ent","graphqlEntityMap","reduce","acc","entityType","docTypes","docType","type","entityTypes","eType","style","getAction","queryProps","inheritedFilters","entitySameAsCurrentItemEntity","action","filterEntityRelations","currentSchema","itemEntityUpdated","isFull","entityData","parentEntityData","_err","_load","variables","id","skip","requiredSchema","schemaLoading","schemaError","updatedFilterBy","updatedItemsToDisplay","limit","getEntitySchemas","Object","values","hasNoFiltersOrItemsToDisplay","length","cardData","cardsError","fetchPolicy","imageIds","imageId","filter","Boolean","imagesData","imagesLoading","isLoading","hasError","message","results","cardDataResults","orderedData","regularChildren","gtmChildren","name","updatedCards","createElement","Fragment","_extends","cardChildren","propTypes","oneOfType","arrayOf","node","string","isRequired","array","defaultProps"],"sources":["../../../src/components/Card/CardsRender.js"],"sourcesContent":["import React, { useContext } from 'react';\nimport { useQuery } from '@apollo/client';\nimport dynamic from 'next/dynamic';\nimport PropTypes from 'prop-types';\nimport { MainContext } from '@blaze-cms/nextjs-components';\nimport { generateSingleItemQuery } from '../../application/query';\nimport { SEARCH_PUBLISHED_CONTENT, AND, FULL } from '../../constants';\nimport { useGetEntitySchemasAsObj, useGetImages } from '../../hooks';\nimport {\n getUpdatedFilterBy,\n getEntityData,\n getRequiredSchemas,\n sortResponseData,\n getUnpublishedEntityName,\n renderChildren,\n splitChildren,\n removeExtraItems,\n appendImages\n} from '../../helpers';\nimport {\n filtersSetup,\n filterQuerySetup,\n shouldSkipSingleQuery,\n shouldReturn,\n getUpdatedSortProperties,\n getUpdatedItemsToDisplay\n} from './helpers';\n\nconst CardsContainer = dynamic(() => import('./CardsContainer'));\n\nconst CardsRender = ({\n entity: legacyEntity,\n entities,\n entityFields,\n itemsToDisplay,\n children,\n ...otherProps\n}) => {\n const { isPreview } = useContext(MainContext);\n const {\n parent: { itemId: parentId, itemEntity: parentEntity },\n filterBy = [],\n filterByProperty = [],\n sortby,\n sort,\n sortProperties = [],\n operator: filterOperator = AND,\n useRandomSort\n } = otherProps;\n const [updatedSortProperties, sortbyFilters] = getUpdatedSortProperties(\n sort,\n sortby,\n sortProperties\n );\n\n const variableProps = {\n ...otherProps,\n sortProperties: updatedSortProperties,\n sort: null,\n sortby: null\n };\n\n const entitiesToUse = entities || [legacyEntity];\n const primaryEntityToUse = entitiesToUse[0];\n const unpublishedParentEntityName = getUnpublishedEntityName(parentEntity);\n const allEntityNames = [...entitiesToUse, unpublishedParentEntityName];\n const uniqueEntityNames = [...new Set(allEntityNames)];\n const { data: mainSchemas = {}, loading: _loading, error: _error } = useGetEntitySchemasAsObj(\n uniqueEntityNames\n );\n const parentSchema = mainSchemas[unpublishedParentEntityName] || {};\n const filterEntitySchema = mainSchemas[primaryEntityToUse] || {};\n const entitiesTypes = entitiesToUse.map(ent => getEntityData(ent, mainSchemas[ent]));\n const graphqlEntityMap = entitiesTypes.reduce(\n (acc, entityType) => ({ ...acc, [entityType.entityType]: entityType.entity }),\n {}\n );\n const docTypes = entitiesTypes.map(({ docType: type }) => type);\n const entityTypes = entitiesTypes.map(({ entityType: eType }) => eType);\n\n const { style } = otherProps;\n\n const {\n getAction,\n queryProps,\n inheritedFilters,\n entitySameAsCurrentItemEntity,\n action,\n filterEntityRelations\n } = filtersSetup({\n entityFields,\n entityTypes,\n filterBy,\n filterByProperty,\n entities: entitiesToUse,\n currentSchema: parentSchema,\n filterEntitySchema,\n isPreview,\n itemEntityUpdated: unpublishedParentEntityName,\n isFull: style === FULL\n });\n\n const {\n data: { entityData: parentEntityData = {} } = {},\n error: _err,\n loading: _load\n } = useQuery(generateSingleItemQuery(getAction, queryProps), {\n variables: { id: parentId },\n skip: shouldSkipSingleQuery(_loading, getAction, queryProps)\n });\n\n const {\n data: requiredSchema = {},\n loading: schemaLoading,\n error: schemaError\n } = useGetEntitySchemasAsObj(\n getRequiredSchemas([...filterByProperty, ...sortbyFilters], filterEntitySchema),\n _loading\n );\n\n const updatedFilterBy = getUpdatedFilterBy(\n inheritedFilters,\n parentEntityData,\n parentSchema,\n filterEntitySchema,\n parentId,\n variableProps\n );\n\n const updatedItemsToDisplay = getUpdatedItemsToDisplay({\n itemsToDisplay,\n inheritedFilters,\n parentSchema,\n parentEntityData\n });\n\n const { limit, variables } = filterQuerySetup({\n getEntitySchemas: Object.values(requiredSchema),\n entity: primaryEntityToUse,\n updatedFilterBy,\n variableProps,\n docType: docTypes,\n filterOperator,\n filterEntityRelations,\n itemsToDisplay: updatedItemsToDisplay,\n entitySameAsCurrentItemEntity,\n useRandomSort\n });\n\n const hasNoFiltersOrItemsToDisplay = !updatedItemsToDisplay.length && !updatedFilterBy;\n\n const { data: cardData = {}, error: cardsError } = useQuery(action, {\n variables,\n fetchPolicy: useRandomSort ? 'cache-and-network' : 'cache-first',\n skip: shouldReturn(\n hasNoFiltersOrItemsToDisplay,\n _loading,\n _load,\n schemaLoading,\n _error,\n _err,\n schemaError\n )\n });\n\n const imageIds = updatedItemsToDisplay.map(({ imageId }) => imageId).filter(Boolean);\n const { data: imagesData, loading: imagesLoading } = useGetImages(imageIds, true);\n const isLoading = shouldReturn(_loading, _load, schemaLoading, imagesLoading);\n const hasError = shouldReturn(_error, _err, schemaError);\n\n if (hasNoFiltersOrItemsToDisplay) return null;\n if (isLoading) return null;\n if (hasError) return null;\n if (cardsError) return cardsError.message;\n let { results: cardDataResults } = cardData[SEARCH_PUBLISHED_CONTENT] || {};\n\n if (!cardDataResults || !cardDataResults.length) return null;\n\n cardDataResults = entitySameAsCurrentItemEntity\n ? removeExtraItems(cardDataResults, limit, parentId)\n : cardDataResults;\n if (!cardDataResults.length) return null;\n\n const orderedData = useRandomSort\n ? cardDataResults\n : sortResponseData(cardDataResults, updatedItemsToDisplay);\n const { regularChildren, gtmChildren } = splitChildren(\n children,\n cardDataResults,\n graphqlEntityMap,\n {\n name: variableProps.name\n }\n );\n const updatedCards = appendImages(imagesData, orderedData, updatedItemsToDisplay);\n\n return (\n <>\n {gtmChildren && renderChildren(gtmChildren)}\n <CardsContainer\n cardData={updatedCards}\n entity={primaryEntityToUse}\n gtmChildren={gtmChildren}\n cardChildren={regularChildren}\n graphqlEntityMap={graphqlEntityMap}\n parent={otherProps.parent}\n {...variableProps}\n />\n </>\n );\n};\n\nCardsRender.propTypes = {\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),\n entity: PropTypes.string.isRequired,\n entityFields: PropTypes.string.isRequired,\n itemsToDisplay: PropTypes.array,\n entities: PropTypes.array\n};\n\nCardsRender.defaultProps = {\n children: [],\n itemsToDisplay: [],\n entities: []\n};\n\nexport default CardsRender;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,OAAOC,OAAO,MAAM,cAAc;AAClC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,WAAW,QAAQ,8BAA8B;AAC1D,SAASC,uBAAuB,QAAQ,yBAAyB;AACjE,SAASC,wBAAwB,EAAEC,GAAG,EAAEC,IAAI,QAAQ,iBAAiB;AACrE,SAASC,wBAAwB,EAAEC,YAAY,QAAQ,aAAa;AACpE,SACEC,kBAAkB,EAClBC,aAAa,EACbC,kBAAkB,EAClBC,gBAAgB,EAChBC,wBAAwB,EACxBC,cAAc,EACdC,aAAa,EACbC,gBAAgB,EAChBC,YAAY,QACP,eAAe;AACtB,SACEC,YAAY,EACZC,gBAAgB,EAChBC,qBAAqB,EACrBC,YAAY,EACZC,wBAAwB,EACxBC,wBAAwB,QACnB,WAAW;AAElB,MAAMC,cAAc,GAAGxB,OAAO,CAAC,MAAM,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAEhE,MAAMyB,WAAW,GAAGC,IAAA,IAOd;EAAA,IAPe;MACnBC,MAAM,EAAEC,YAAY;MACpBC,QAAQ;MACRC,YAAY;MACZC,cAAc;MACdC;IAEF,CAAC,GAAAN,IAAA;IADIO,UAAU,GAAAC,wBAAA,CAAAR,IAAA,EAAAS,SAAA;EAEb,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,aAAa,CAACyE;EACtB,CACF,CAAC;EACD,MAAMC,YAAY,GAAG7G,YAAY,CAACkG,UAAU,EAAEO,WAAW,EAAErB,qBAAqB,CAAC;EAEjF,oBACExG,KAAA,CAAAkI,aAAA,CAAAlI,KAAA,CAAAmI,QAAA,QACGJ,WAAW,IAAI9G,cAAc,CAAC8G,WAAW,CAAC,eAC3C/H,KAAA,CAAAkI,aAAA,CAACvG,cAAc,EAAAyG,QAAA;IACbrB,QAAQ,EAAEkB,YAAa;IACvBnG,MAAM,EAAE4B,kBAAmB;IAC3BqE,WAAW,EAAEA,WAAY;IACzBM,YAAY,EAAEP,eAAgB;IAC9BpD,gBAAgB,EAAEA,gBAAiB;IACnClC,MAAM,EAAEJ,UAAU,CAACI;EAAO,GACtBe,aAAa,CAClB,CACD,CAAC;AAEP,CAAC;AAED3B,WAAW,CAAC0G,SAAS,GAAG;EACtBnG,QAAQ,EAAE/B,SAAS,CAACmI,SAAS,CAAC,CAACnI,SAAS,CAACoI,OAAO,CAACpI,SAAS,CAACqI,IAAI,CAAC,EAAErI,SAAS,CAACqI,IAAI,CAAC,CAAC;EAClF3G,MAAM,EAAE1B,SAAS,CAACsI,MAAM,CAACC,UAAU;EACnC1G,YAAY,EAAE7B,SAAS,CAACsI,MAAM,CAACC,UAAU;EACzCzG,cAAc,EAAE9B,SAAS,CAACwI,KAAK;EAC/B5G,QAAQ,EAAE5B,SAAS,CAACwI;AACtB,CAAC;AAEDhH,WAAW,CAACiH,YAAY,GAAG;EACzB1G,QAAQ,EAAE,EAAE;EACZD,cAAc,EAAE,EAAE;EAClBF,QAAQ,EAAE;AACZ,CAAC;AAED,eAAeJ,WAAW"}
|
|
1
|
+
{"version":3,"file":"CardsRender.js","names":["React","useContext","useQuery","dynamic","PropTypes","MainContext","generateSingleItemQuery","SEARCH_PUBLISHED_CONTENT","AND","FULL","useGetEntitySchemasAsObj","useGetImages","getUpdatedFilterBy","getEntityData","getRequiredSchemas","sortResponseData","getUnpublishedEntityName","renderChildren","splitChildren","removeExtraItems","appendImages","filtersSetup","filterQuerySetup","shouldSkipSingleQuery","shouldReturn","getUpdatedSortProperties","getUpdatedItemsToDisplay","CardsContainer","CardsRender","_ref","entity","legacyEntity","entities","entityFields","itemsToDisplay","children","otherProps","_objectWithoutProperties","_excluded","isPreview","parent","itemId","parentId","itemEntity","parentEntity","filterBy","filterByProperty","sortby","sort","sortProperties","operator","filterOperator","useRandomSort","updatedSortProperties","sortbyFilters","variableProps","_objectSpread","entitiesToUse","primaryEntityToUse","unpublishedParentEntityName","allEntityNames","uniqueEntityNames","Set","data","mainSchemas","loading","_loading","error","_error","parentSchema","filterEntitySchema","entitiesTypes","map","ent","graphqlEntityMap","reduce","acc","entityType","docTypes","docType","type","entityTypes","eType","style","getAction","queryProps","inheritedFilters","entitySameAsCurrentItemEntity","action","filterEntityRelations","currentSchema","itemEntityUpdated","isFull","entityData","parentEntityData","_err","_load","variables","id","skip","requiredSchema","schemaLoading","schemaError","updatedFilterBy","updatedItemsToDisplay","limit","getEntitySchemas","Object","values","hasNoFiltersOrItemsToDisplay","length","cardData","cardsError","fetchPolicy","imageIds","imageId","filter","Boolean","imagesData","imagesLoading","isLoading","hasError","message","results","cardDataResults","orderedData","regularChildren","gtmChildren","name","updatedCards","createElement","Fragment","_extends","cardChildren","propTypes","oneOfType","arrayOf","node","string","isRequired","array","defaultProps"],"sources":["../../../src/components/Card/CardsRender.js"],"sourcesContent":["import React, { useContext } from 'react';\nimport { useQuery } from '@apollo/client';\nimport dynamic from 'next/dynamic';\nimport PropTypes from 'prop-types';\nimport { MainContext } from '@blaze-cms/nextjs-components';\nimport { generateSingleItemQuery } from '../../application/query';\nimport { SEARCH_PUBLISHED_CONTENT, AND, FULL } from '../../constants';\nimport { useGetEntitySchemasAsObj, useGetImages } from '../../hooks';\nimport {\n getUpdatedFilterBy,\n getEntityData,\n getRequiredSchemas,\n sortResponseData,\n getUnpublishedEntityName,\n renderChildren,\n splitChildren,\n removeExtraItems,\n appendImages\n} from '../../helpers';\nimport {\n filtersSetup,\n filterQuerySetup,\n shouldSkipSingleQuery,\n shouldReturn,\n getUpdatedSortProperties,\n getUpdatedItemsToDisplay\n} from './helpers';\n\nconst CardsContainer = dynamic(() => import('./CardsContainer'));\n\nconst CardsRender = ({\n entity: legacyEntity,\n entities,\n entityFields,\n itemsToDisplay,\n children,\n ...otherProps\n}) => {\n const { isPreview } = useContext(MainContext);\n const {\n parent: { itemId: parentId, itemEntity: parentEntity },\n filterBy = [],\n filterByProperty = [],\n sortby,\n sort,\n sortProperties = [],\n operator: filterOperator = AND,\n useRandomSort\n } = otherProps;\n const [updatedSortProperties, sortbyFilters] = getUpdatedSortProperties(\n sort,\n sortby,\n sortProperties\n );\n\n const variableProps = {\n ...otherProps,\n sortProperties: updatedSortProperties,\n sort: null,\n sortby: null\n };\n\n const entitiesToUse = entities || [legacyEntity];\n const primaryEntityToUse = entitiesToUse[0];\n const unpublishedParentEntityName = getUnpublishedEntityName(parentEntity);\n const allEntityNames = [...entitiesToUse, unpublishedParentEntityName];\n const uniqueEntityNames = [...new Set(allEntityNames)];\n const { data: mainSchemas = {}, loading: _loading, error: _error } = useGetEntitySchemasAsObj(\n uniqueEntityNames\n );\n const parentSchema = mainSchemas[unpublishedParentEntityName] || {};\n const filterEntitySchema = mainSchemas[primaryEntityToUse] || {};\n const entitiesTypes = entitiesToUse.map(ent => getEntityData(ent, mainSchemas[ent]));\n const graphqlEntityMap = entitiesTypes.reduce(\n (acc, entityType) => ({ ...acc, [entityType.entityType]: entityType.entity }),\n {}\n );\n const docTypes = entitiesTypes.map(({ docType: type }) => type);\n const entityTypes = entitiesTypes.map(({ entityType: eType }) => eType);\n\n const { style } = otherProps;\n\n const {\n getAction,\n queryProps,\n inheritedFilters,\n entitySameAsCurrentItemEntity,\n action,\n filterEntityRelations\n } = filtersSetup({\n entityFields,\n entityTypes,\n filterBy,\n filterByProperty,\n entities: entitiesToUse,\n currentSchema: parentSchema,\n filterEntitySchema,\n isPreview,\n itemEntityUpdated: unpublishedParentEntityName,\n isFull: style === FULL\n });\n\n const {\n data: { entityData: parentEntityData = {} } = {},\n error: _err,\n loading: _load\n } = useQuery(generateSingleItemQuery(getAction, queryProps), {\n variables: { id: parentId },\n skip: shouldSkipSingleQuery(_loading, getAction, queryProps)\n });\n\n const {\n data: requiredSchema = {},\n loading: schemaLoading,\n error: schemaError\n } = useGetEntitySchemasAsObj(\n getRequiredSchemas([...filterByProperty, ...sortbyFilters], filterEntitySchema),\n _loading\n );\n\n const updatedFilterBy = getUpdatedFilterBy(\n inheritedFilters,\n parentEntityData,\n parentSchema,\n filterEntitySchema,\n parentId,\n variableProps\n );\n\n const updatedItemsToDisplay = getUpdatedItemsToDisplay({\n itemsToDisplay,\n inheritedFilters,\n parentSchema,\n parentEntityData\n });\n\n const { limit, variables } = filterQuerySetup({\n getEntitySchemas: Object.values(requiredSchema),\n entity: primaryEntityToUse,\n updatedFilterBy,\n variableProps,\n docType: docTypes,\n filterOperator,\n filterEntityRelations,\n itemsToDisplay: updatedItemsToDisplay,\n entitySameAsCurrentItemEntity,\n useRandomSort\n });\n\n const hasNoFiltersOrItemsToDisplay = !updatedItemsToDisplay.length && !updatedFilterBy;\n\n const { data: cardData = {}, error: cardsError } = useQuery(action, {\n variables,\n fetchPolicy: useRandomSort ? 'cache-and-network' : 'cache-first',\n skip: shouldReturn(\n hasNoFiltersOrItemsToDisplay,\n _loading,\n _load,\n schemaLoading,\n _error,\n _err,\n schemaError\n )\n });\n\n const imageIds = updatedItemsToDisplay.map(({ imageId }) => imageId).filter(Boolean);\n const { data: imagesData, loading: imagesLoading } = useGetImages(imageIds, true);\n const isLoading = shouldReturn(_loading, _load, schemaLoading, imagesLoading);\n const hasError = shouldReturn(_error, _err, schemaError);\n\n if (hasNoFiltersOrItemsToDisplay) return null;\n if (isLoading) return null;\n if (hasError) return null;\n if (cardsError) return cardsError.message;\n let { results: cardDataResults } = cardData[SEARCH_PUBLISHED_CONTENT] || {};\n\n if (!cardDataResults || !cardDataResults.length) return null;\n\n cardDataResults = entitySameAsCurrentItemEntity\n ? removeExtraItems(cardDataResults, limit, parentId)\n : cardDataResults;\n if (!cardDataResults.length) return null;\n\n const orderedData = useRandomSort\n ? cardDataResults\n : sortResponseData(cardDataResults, updatedItemsToDisplay);\n const { regularChildren, gtmChildren } = splitChildren(\n children,\n cardDataResults,\n graphqlEntityMap,\n {\n name: variableProps.name\n }\n );\n const updatedCards = appendImages(imagesData, orderedData, updatedItemsToDisplay);\n\n return (\n <>\n {gtmChildren && renderChildren(gtmChildren)}\n <CardsContainer\n cardData={updatedCards}\n entity={primaryEntityToUse}\n gtmChildren={gtmChildren}\n cardChildren={regularChildren}\n graphqlEntityMap={graphqlEntityMap}\n {...variableProps}\n />\n </>\n );\n};\n\nCardsRender.propTypes = {\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),\n entity: PropTypes.string.isRequired,\n entityFields: PropTypes.string.isRequired,\n itemsToDisplay: PropTypes.array,\n entities: PropTypes.array\n};\n\nCardsRender.defaultProps = {\n children: [],\n itemsToDisplay: [],\n entities: []\n};\n\nexport default CardsRender;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,OAAOC,OAAO,MAAM,cAAc;AAClC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,WAAW,QAAQ,8BAA8B;AAC1D,SAASC,uBAAuB,QAAQ,yBAAyB;AACjE,SAASC,wBAAwB,EAAEC,GAAG,EAAEC,IAAI,QAAQ,iBAAiB;AACrE,SAASC,wBAAwB,EAAEC,YAAY,QAAQ,aAAa;AACpE,SACEC,kBAAkB,EAClBC,aAAa,EACbC,kBAAkB,EAClBC,gBAAgB,EAChBC,wBAAwB,EACxBC,cAAc,EACdC,aAAa,EACbC,gBAAgB,EAChBC,YAAY,QACP,eAAe;AACtB,SACEC,YAAY,EACZC,gBAAgB,EA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,YAAY,GAAG;EACzB1G,QAAQ,EAAE,EAAE;EACZD,cAAc,EAAE,EAAE;EAClBF,QAAQ,EAAE;AACZ,CAAC;AAED,eAAeJ,WAAW"}
|
|
@@ -1,35 +1,45 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
const _excluded = ["caption", "imageIds", "isCaptionDisplayed"];
|
|
3
|
+
const _excluded = ["caption", "imageIds", "isCaptionDisplayed", "VariantComponent"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
+
import CarouselImage from './CarouselImage';
|
|
6
7
|
import CarouselRender from './CarouselRender';
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
import { useCarouselNavigation } from './hooks/useCarouselNavigation';
|
|
9
|
+
import { getDisplayCountData } from '../../helpers';
|
|
10
|
+
const Carousel = props => {
|
|
11
|
+
const {
|
|
9
12
|
caption,
|
|
10
13
|
imageIds,
|
|
11
|
-
isCaptionDisplayed
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
isCaptionDisplayed,
|
|
15
|
+
VariantComponent
|
|
16
|
+
} = props,
|
|
17
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
18
|
+
const navigationProps = useCarouselNavigation(props);
|
|
14
19
|
if (!imageIds || !imageIds.length) return null;
|
|
15
20
|
const shouldDisplayCaption = isCaptionDisplayed && caption;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
const {
|
|
22
|
+
shouldDisplayCount,
|
|
23
|
+
countMessage
|
|
24
|
+
} = getDisplayCountData(navigationProps.showCount, imageIds);
|
|
25
|
+
const ComponentToRender = VariantComponent || CarouselRender;
|
|
26
|
+
return /*#__PURE__*/React.createElement(ComponentToRender, _extends({
|
|
27
|
+
caption: caption,
|
|
28
|
+
imageIds: imageIds,
|
|
29
|
+
CarouselImage: CarouselImage,
|
|
30
|
+
shouldDisplayCaption: shouldDisplayCaption,
|
|
31
|
+
shouldDisplayCount: shouldDisplayCount,
|
|
32
|
+
countMessage: countMessage
|
|
33
|
+
}, navigationProps, otherProps));
|
|
26
34
|
};
|
|
27
35
|
Carousel.propTypes = {
|
|
28
36
|
caption: PropTypes.string,
|
|
29
37
|
imageIds: PropTypes.array,
|
|
30
|
-
isCaptionDisplayed: PropTypes.bool
|
|
38
|
+
isCaptionDisplayed: PropTypes.bool,
|
|
39
|
+
VariantComponent: PropTypes.func
|
|
31
40
|
};
|
|
32
41
|
Carousel.defaultProps = {
|
|
42
|
+
VariantComponent: null,
|
|
33
43
|
caption: '',
|
|
34
44
|
imageIds: [],
|
|
35
45
|
isCaptionDisplayed: false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.js","names":["React","PropTypes","CarouselRender","Carousel","
|
|
1
|
+
{"version":3,"file":"Carousel.js","names":["React","PropTypes","CarouselImage","CarouselRender","useCarouselNavigation","getDisplayCountData","Carousel","props","caption","imageIds","isCaptionDisplayed","VariantComponent","otherProps","_objectWithoutProperties","_excluded","navigationProps","length","shouldDisplayCaption","shouldDisplayCount","countMessage","showCount","ComponentToRender","createElement","_extends","propTypes","string","array","bool","func","defaultProps"],"sources":["../../../src/components/Carousel/Carousel.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport CarouselImage from './CarouselImage';\nimport CarouselRender from './CarouselRender';\nimport { useCarouselNavigation } from './hooks/useCarouselNavigation';\nimport { getDisplayCountData } from '../../helpers';\n\nconst Carousel = props => {\n const { caption, imageIds, isCaptionDisplayed, VariantComponent, ...otherProps } = props;\n\n const navigationProps = useCarouselNavigation(props);\n\n if (!imageIds || !imageIds.length) return null;\n const shouldDisplayCaption = isCaptionDisplayed && caption;\n\n const { shouldDisplayCount, countMessage } = getDisplayCountData(\n navigationProps.showCount,\n imageIds\n );\n\n const ComponentToRender = VariantComponent || CarouselRender;\n\n return (\n <ComponentToRender\n caption={caption}\n imageIds={imageIds}\n CarouselImage={CarouselImage}\n shouldDisplayCaption={shouldDisplayCaption}\n shouldDisplayCount={shouldDisplayCount}\n countMessage={countMessage}\n {...navigationProps}\n {...otherProps}\n />\n );\n};\n\nCarousel.propTypes = {\n caption: PropTypes.string,\n imageIds: PropTypes.array,\n isCaptionDisplayed: PropTypes.bool,\n VariantComponent: PropTypes.func\n};\n\nCarousel.defaultProps = {\n VariantComponent: null,\n caption: '',\n imageIds: [],\n isCaptionDisplayed: false\n};\n\nexport default Carousel;\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,SAASC,qBAAqB,QAAQ,+BAA+B;AACrE,SAASC,mBAAmB,QAAQ,eAAe;AAEnD,MAAMC,QAAQ,GAAGC,KAAK,IAAI;EACxB,MAAM;MAAEC,OAAO;MAAEC,QAAQ;MAAEC,kBAAkB;MAAEC;IAAgC,CAAC,GAAGJ,KAAK;IAApBK,UAAU,GAAAC,wBAAA,CAAKN,KAAK,EAAAO,SAAA;EAExF,MAAMC,eAAe,GAAGX,qBAAqB,CAACG,KAAK,CAAC;EAEpD,IAAI,CAACE,QAAQ,IAAI,CAACA,QAAQ,CAACO,MAAM,EAAE,OAAO,IAAI;EAC9C,MAAMC,oBAAoB,GAAGP,kBAAkB,IAAIF,OAAO;EAE1D,MAAM;IAAEU,kBAAkB;IAAEC;EAAa,CAAC,GAAGd,mBAAmB,CAC9DU,eAAe,CAACK,SAAS,EACzBX,QACF,CAAC;EAED,MAAMY,iBAAiB,GAAGV,gBAAgB,IAAIR,cAAc;EAE5D,oBACEH,KAAA,CAAAsB,aAAA,CAACD,iBAAiB,EAAAE,QAAA;IAChBf,OAAO,EAAEA,OAAQ;IACjBC,QAAQ,EAAEA,QAAS;IACnBP,aAAa,EAAEA,aAAc;IAC7Be,oBAAoB,EAAEA,oBAAqB;IAC3CC,kBAAkB,EAAEA,kBAAmB;IACvCC,YAAY,EAAEA;EAAa,GACvBJ,eAAe,EACfH,UAAU,CACf,CAAC;AAEN,CAAC;AAEDN,QAAQ,CAACkB,SAAS,GAAG;EACnBhB,OAAO,EAAEP,SAAS,CAACwB,MAAM;EACzBhB,QAAQ,EAAER,SAAS,CAACyB,KAAK;EACzBhB,kBAAkB,EAAET,SAAS,CAAC0B,IAAI;EAClChB,gBAAgB,EAAEV,SAAS,CAAC2B;AAC9B,CAAC;AAEDtB,QAAQ,CAACuB,YAAY,GAAG;EACtBlB,gBAAgB,EAAE,IAAI;EACtBH,OAAO,EAAE,EAAE;EACXC,QAAQ,EAAE,EAAE;EACZC,kBAAkB,EAAE;AACtB,CAAC;AAED,eAAeJ,QAAQ"}
|
|
@@ -1,66 +1,29 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
const _excluded = ["imageIds", "
|
|
4
|
-
import React
|
|
3
|
+
const _excluded = ["handleNavigation", "imageIds", "listRef", "shouldDisplayCount", "shouldDisplayCaption", "caption", "countMessage", "direction", "priorityLimit"];
|
|
4
|
+
import React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import CarouselImage from '../CarouselImage';
|
|
7
7
|
import { withTitle } from '../../../HOC';
|
|
8
|
-
import { getDisplayCountData } from '../../../helpers';
|
|
9
8
|
const CarouselRender = _ref => {
|
|
10
9
|
let {
|
|
10
|
+
handleNavigation,
|
|
11
11
|
imageIds,
|
|
12
|
-
|
|
12
|
+
listRef,
|
|
13
|
+
shouldDisplayCount,
|
|
14
|
+
shouldDisplayCaption,
|
|
15
|
+
caption,
|
|
16
|
+
countMessage,
|
|
17
|
+
direction,
|
|
13
18
|
priorityLimit
|
|
14
19
|
} = _ref,
|
|
15
20
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (!listRef) return null;
|
|
20
|
-
const {
|
|
21
|
-
current
|
|
22
|
-
} = listRef;
|
|
23
|
-
return current;
|
|
24
|
-
};
|
|
25
|
-
const moveScroll = (numberOfPixels, isNext) => {
|
|
26
|
-
const listElement = getListElement();
|
|
27
|
-
if (!listElement) return;
|
|
28
|
-
const totalDistance = listElement.scrollLeft + numberOfPixels;
|
|
29
|
-
const {
|
|
30
|
-
scrollLeft,
|
|
31
|
-
offsetWidth,
|
|
32
|
-
scrollWidth
|
|
33
|
-
} = listElement;
|
|
34
|
-
if (isNext && offsetWidth + scrollLeft >= scrollWidth) return;
|
|
35
|
-
const leftPosition = totalDistance < 0 ? 0 : Math.max(-scrollLeft, totalDistance);
|
|
36
|
-
listElement.scrollTo({
|
|
37
|
-
top: 0,
|
|
38
|
-
left: leftPosition,
|
|
39
|
-
behavior: 'smooth'
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
const handleNavigation = direction => {
|
|
43
|
-
setShowCount(false);
|
|
44
|
-
const listElement = getListElement();
|
|
45
|
-
if (!listElement) return;
|
|
46
|
-
const {
|
|
47
|
-
scrollWidth
|
|
48
|
-
} = listElement;
|
|
49
|
-
const offset = scrollWidth / imageIds.length;
|
|
50
|
-
direction ? moveScroll(offset, direction) : moveScroll(-offset, direction);
|
|
51
|
-
};
|
|
52
|
-
const navigation = {
|
|
53
|
-
next: true,
|
|
54
|
-
back: false
|
|
55
|
-
};
|
|
56
|
-
const {
|
|
57
|
-
shouldDisplayCount,
|
|
58
|
-
countMessage
|
|
59
|
-
} = getDisplayCountData(showCount, imageIds);
|
|
60
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
21
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
22
|
+
className: "carousel"
|
|
23
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
61
24
|
className: "carousel__button carousel__button--previous",
|
|
62
25
|
role: "button",
|
|
63
|
-
onClick: () => handleNavigation(
|
|
26
|
+
onClick: () => handleNavigation(direction.back)
|
|
64
27
|
}, /*#__PURE__*/React.createElement("div", {
|
|
65
28
|
className: "arrow arrow--left"
|
|
66
29
|
})), /*#__PURE__*/React.createElement("div", {
|
|
@@ -73,19 +36,36 @@ const CarouselRender = _ref => {
|
|
|
73
36
|
}, otherProps)))), /*#__PURE__*/React.createElement("div", {
|
|
74
37
|
className: "carousel__button carousel__button--next",
|
|
75
38
|
role: "button",
|
|
76
|
-
onClick: () => handleNavigation(
|
|
77
|
-
}, shouldDisplayCount && /*#__PURE__*/React.createElement("p",
|
|
39
|
+
onClick: () => handleNavigation(direction.next)
|
|
40
|
+
}, shouldDisplayCount && /*#__PURE__*/React.createElement("p", {
|
|
41
|
+
"data-testid": "count"
|
|
42
|
+
}, countMessage), /*#__PURE__*/React.createElement("div", {
|
|
78
43
|
className: "arrow arrow--right"
|
|
79
|
-
})))
|
|
44
|
+
}))), shouldDisplayCaption && /*#__PURE__*/React.createElement("div", {
|
|
45
|
+
className: "carousel__details",
|
|
46
|
+
"data-testid": "carousel-details"
|
|
47
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
className: "caption"
|
|
49
|
+
}, caption)));
|
|
80
50
|
};
|
|
81
51
|
CarouselRender.propTypes = {
|
|
52
|
+
caption: PropTypes.string,
|
|
53
|
+
shouldDisplayCaption: PropTypes.bool.isRequired,
|
|
82
54
|
imageIds: PropTypes.array,
|
|
83
55
|
displayCount: PropTypes.bool,
|
|
56
|
+
listRef: PropTypes.object,
|
|
57
|
+
countMessage: PropTypes.number,
|
|
58
|
+
direction: PropTypes.object.isRequired,
|
|
59
|
+
handleNavigation: PropTypes.func.isRequired,
|
|
60
|
+
shouldDisplayCount: PropTypes.bool.isRequired,
|
|
84
61
|
priorityLimit: PropTypes.number
|
|
85
62
|
};
|
|
86
63
|
CarouselRender.defaultProps = {
|
|
64
|
+
listRef: null,
|
|
87
65
|
imageIds: [],
|
|
66
|
+
caption: '',
|
|
88
67
|
displayCount: false,
|
|
68
|
+
countMessage: null,
|
|
89
69
|
priorityLimit: 0
|
|
90
70
|
};
|
|
91
71
|
export default withTitle(CarouselRender);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarouselRender.js","names":["React","
|
|
1
|
+
{"version":3,"file":"CarouselRender.js","names":["React","PropTypes","CarouselImage","withTitle","CarouselRender","_ref","handleNavigation","imageIds","listRef","shouldDisplayCount","shouldDisplayCaption","caption","countMessage","direction","priorityLimit","otherProps","_objectWithoutProperties","_excluded","createElement","className","role","onClick","back","ref","map","imageId","index","_extends","key","priority","next","propTypes","string","bool","isRequired","array","displayCount","object","number","func","defaultProps"],"sources":["../../../../src/components/Carousel/CarouselRender/CarouselRender.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport CarouselImage from '../CarouselImage';\nimport { withTitle } from '../../../HOC';\n\nconst CarouselRender = ({\n handleNavigation,\n imageIds,\n listRef,\n shouldDisplayCount,\n shouldDisplayCaption,\n caption,\n countMessage,\n direction,\n priorityLimit,\n ...otherProps\n}) => (\n <div className=\"carousel\">\n <div>\n <div\n className=\"carousel__button carousel__button--previous\"\n role=\"button\"\n onClick={() => handleNavigation(direction.back)}>\n <div className=\"arrow arrow--left\" />\n </div>\n <div className=\"carousel__list\" ref={listRef}>\n {imageIds.map((imageId, index) => (\n <CarouselImage\n key={imageId}\n priority={index < priorityLimit}\n imageId={imageId}\n {...otherProps}\n />\n ))}\n </div>\n <div\n className=\"carousel__button carousel__button--next\"\n role=\"button\"\n onClick={() => handleNavigation(direction.next)}>\n {shouldDisplayCount && <p data-testid=\"count\">{countMessage}</p>}\n <div className=\"arrow arrow--right\" />\n </div>\n </div>\n {shouldDisplayCaption && (\n <div className=\"carousel__details\" data-testid=\"carousel-details\">\n <div className=\"caption\">{caption}</div>\n </div>\n )}\n </div>\n);\n\nCarouselRender.propTypes = {\n caption: PropTypes.string,\n shouldDisplayCaption: PropTypes.bool.isRequired,\n imageIds: PropTypes.array,\n displayCount: PropTypes.bool,\n listRef: PropTypes.object,\n countMessage: PropTypes.number,\n direction: PropTypes.object.isRequired,\n handleNavigation: PropTypes.func.isRequired,\n shouldDisplayCount: PropTypes.bool.isRequired,\n priorityLimit: PropTypes.number\n};\n\nCarouselRender.defaultProps = {\n listRef: null,\n imageIds: [],\n caption: '',\n displayCount: false,\n countMessage: null,\n priorityLimit: 0\n};\n\nexport default withTitle(CarouselRender);\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,SAASC,SAAS,QAAQ,cAAc;AAExC,MAAMC,cAAc,GAAGC,IAAA;EAAA,IAAC;MACtBC,gBAAgB;MAChBC,QAAQ;MACRC,OAAO;MACPC,kBAAkB;MAClBC,oBAAoB;MACpBC,OAAO;MACPC,YAAY;MACZC,SAAS;MACTC;IAEF,CAAC,GAAAT,IAAA;IADIU,UAAU,GAAAC,wBAAA,CAAAX,IAAA,EAAAY,SAAA;EAAA,oBAEbjB,KAAA,CAAAkB,aAAA;IAAKC,SAAS,EAAC;EAAU,gBACvBnB,KAAA,CAAAkB,aAAA,2BACElB,KAAA,CAAAkB,aAAA;IACEC,SAAS,EAAC,6CAA6C;IACvDC,IAAI,EAAC,QAAQ;IACbC,OAAO,EAAEA,CAAA,KAAMf,gBAAgB,CAACO,SAAS,CAACS,IAAI;EAAE,gBAChDtB,KAAA,CAAAkB,aAAA;IAAKC,SAAS,EAAC;EAAmB,CAAE,CACjC,CAAC,eACNnB,KAAA,CAAAkB,aAAA;IAAKC,SAAS,EAAC,gBAAgB;IAACI,GAAG,EAAEf;EAAQ,GAC1CD,QAAQ,CAACiB,GAAG,C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;AAEDlC,cAAc,CAACoC,YAAY,GAAG;EAC5BhC,OAAO,EAAE,IAAI;EACbD,QAAQ,EAAE,EAAE;EACZI,OAAO,EAAE,EAAE;EACXyB,YAAY,EAAE,KAAK;EACnBxB,YAAY,EAAE,IAAI;EAClBE,aAAa,EAAE;AACjB,CAAC;AAED,eAAeX,SAAS,CAACC,cAAc,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { useState, useRef } from 'react';
|
|
2
|
+
export function useCarouselNavigation({
|
|
3
|
+
imageIds,
|
|
4
|
+
displayCount
|
|
5
|
+
}) {
|
|
6
|
+
const [showCount, setShowCount] = useState(displayCount);
|
|
7
|
+
const listRef = useRef(null);
|
|
8
|
+
const getListElement = () => {
|
|
9
|
+
if (!listRef.current) return null;
|
|
10
|
+
return listRef.current;
|
|
11
|
+
};
|
|
12
|
+
const moveScroll = (numberOfPixels, isNext) => {
|
|
13
|
+
const listElement = getListElement();
|
|
14
|
+
if (!listElement) return;
|
|
15
|
+
const totalDistance = listElement.scrollLeft + numberOfPixels;
|
|
16
|
+
const {
|
|
17
|
+
scrollLeft,
|
|
18
|
+
offsetWidth,
|
|
19
|
+
scrollWidth
|
|
20
|
+
} = listElement;
|
|
21
|
+
if (isNext && offsetWidth + scrollLeft >= scrollWidth) return;
|
|
22
|
+
const leftPosition = totalDistance < 0 ? 0 : Math.max(-scrollLeft, totalDistance);
|
|
23
|
+
listElement.scrollTo({
|
|
24
|
+
top: 0,
|
|
25
|
+
left: leftPosition,
|
|
26
|
+
behavior: 'smooth'
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
const handleNavigation = direction => {
|
|
30
|
+
setShowCount(false);
|
|
31
|
+
const listElement = getListElement();
|
|
32
|
+
if (!listElement) return;
|
|
33
|
+
const {
|
|
34
|
+
scrollWidth
|
|
35
|
+
} = listElement;
|
|
36
|
+
const offset = scrollWidth / imageIds.length;
|
|
37
|
+
direction ? moveScroll(offset, direction) : moveScroll(-offset, direction);
|
|
38
|
+
};
|
|
39
|
+
return {
|
|
40
|
+
listRef,
|
|
41
|
+
showCount,
|
|
42
|
+
handleNavigation,
|
|
43
|
+
direction: {
|
|
44
|
+
next: true,
|
|
45
|
+
back: false
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=useCarouselNavigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCarouselNavigation.js","names":["useState","useRef","useCarouselNavigation","imageIds","displayCount","showCount","setShowCount","listRef","getListElement","current","moveScroll","numberOfPixels","isNext","listElement","totalDistance","scrollLeft","offsetWidth","scrollWidth","leftPosition","Math","max","scrollTo","top","left","behavior","handleNavigation","direction","offset","length","next","back"],"sources":["../../../../src/components/Carousel/hooks/useCarouselNavigation.js"],"sourcesContent":["import { useState, useRef } from 'react';\n\nexport function useCarouselNavigation({ imageIds, displayCount }) {\n const [showCount, setShowCount] = useState(displayCount);\n const listRef = useRef(null);\n\n const getListElement = () => {\n if (!listRef.current) return null;\n return listRef.current;\n };\n\n const moveScroll = (numberOfPixels, isNext) => {\n const listElement = getListElement();\n if (!listElement) return;\n\n const totalDistance = listElement.scrollLeft + numberOfPixels;\n const { scrollLeft, offsetWidth, scrollWidth } = listElement;\n if (isNext && offsetWidth + scrollLeft >= scrollWidth) return;\n\n const leftPosition = totalDistance < 0 ? 0 : Math.max(-scrollLeft, totalDistance);\n\n listElement.scrollTo({\n top: 0,\n left: leftPosition,\n behavior: 'smooth'\n });\n };\n\n const handleNavigation = direction => {\n setShowCount(false);\n\n const listElement = getListElement();\n if (!listElement) return;\n\n const { scrollWidth } = listElement;\n const offset = scrollWidth / imageIds.length;\n\n direction ? moveScroll(offset, direction) : moveScroll(-offset, direction);\n };\n\n return {\n listRef,\n showCount,\n handleNavigation,\n direction: {\n next: true,\n back: false\n }\n };\n}\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,MAAM,QAAQ,OAAO;AAExC,OAAO,SAASC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U,CAAC,CAACiB,MAAM,EAAED,SAAS,CAAC;EAC5E,CAAC;EAED,OAAO;IACLnB,OAAO;IACPF,SAAS;IACToB,gBAAgB;IAChBC,SAAS,EAAE;MACTG,IAAI,EAAE,IAAI;MACVC,IAAI,EAAE;IACR;EACF,CAAC;AACH"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
const _excluded = ["type", "children", "settings", "modifier", "backgroundImage", "tagType", "dataNoSnippet", "sticky"];
|
|
4
|
+
const _excluded = ["type", "children", "settings", "modifier", "backgroundImage", "tagType", "dataNoSnippet", "sticky", "VariantComponent"];
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
import React from 'react';
|
|
@@ -21,7 +21,8 @@ const Layout = React.forwardRef((_ref, ref) => {
|
|
|
21
21
|
backgroundImage,
|
|
22
22
|
tagType,
|
|
23
23
|
dataNoSnippet,
|
|
24
|
-
sticky
|
|
24
|
+
sticky,
|
|
25
|
+
VariantComponent
|
|
25
26
|
} = _ref,
|
|
26
27
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
27
28
|
const {
|
|
@@ -45,7 +46,8 @@ const Layout = React.forwardRef((_ref, ref) => {
|
|
|
45
46
|
if (type === COLUMN && !hasChildren(children)) return null;
|
|
46
47
|
const otherWrapperProps = {};
|
|
47
48
|
if (dataNoSnippet) otherWrapperProps['data-nosnippet'] = true;
|
|
48
|
-
|
|
49
|
+
const WrapperComponent = VariantComponent || Wrapper;
|
|
50
|
+
return /*#__PURE__*/React.createElement(WrapperComponent, _extends({
|
|
49
51
|
ref: ref,
|
|
50
52
|
tagType: tagType,
|
|
51
53
|
className: type,
|
|
@@ -65,6 +67,7 @@ Layout.propTypes = {
|
|
|
65
67
|
backgroundImage: PropTypes.string,
|
|
66
68
|
tagType: PropTypes.string,
|
|
67
69
|
dataNoSnippet: PropTypes.bool,
|
|
70
|
+
VariantComponent: PropTypes.func,
|
|
68
71
|
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired
|
|
69
72
|
};
|
|
70
73
|
Layout.defaultProps = {
|
|
@@ -75,7 +78,8 @@ Layout.defaultProps = {
|
|
|
75
78
|
modifier: '',
|
|
76
79
|
tagType: '',
|
|
77
80
|
dataNoSnippet: false,
|
|
78
|
-
sticky: false
|
|
81
|
+
sticky: false,
|
|
82
|
+
VariantComponent: null
|
|
79
83
|
};
|
|
80
84
|
export default Layout;
|
|
81
85
|
//# sourceMappingURL=Layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.js","names":["React","PropTypes","Wrapper","getClassModifiers","useGetImages","getStylesToUpdate","checkIfRowHasColumns","renderChildren","hasChildren","COLUMN","Layout","forwardRef","_ref","ref","type","children","settings","modifier","backgroundImage","tagType","dataNoSnippet","sticky","otherProps","_objectWithoutProperties","_excluded","data","getFile","url","style","title","classModifiers","_objectSpread","additionalRowModifier","otherWrapperProps","createElement","_extends","className","modifiers","propTypes","string","isRequired","bool","shape","oneOfType","arrayOf","node","defaultProps"],"sources":["../../../src/components/Layout/Layout.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Wrapper from '../Wrapper';\nimport { getClassModifiers } from '../../utils';\nimport { useGetImages } from '../../hooks';\nimport { getStylesToUpdate, checkIfRowHasColumns } from './helpers';\nimport { renderChildren, hasChildren } from '../../helpers';\nimport { COLUMN } from '../../constants';\n\nconst Layout = React.forwardRef(\n (\n {\n type,\n children,\n settings,\n modifier,\n backgroundImage,\n tagType,\n dataNoSnippet,\n sticky,\n ...otherProps\n },\n ref\n ) => {\n const {\n data: { getFile: { url = null } = {} }\n } = useGetImages(backgroundImage);\n
|
|
1
|
+
{"version":3,"file":"Layout.js","names":["React","PropTypes","Wrapper","getClassModifiers","useGetImages","getStylesToUpdate","checkIfRowHasColumns","renderChildren","hasChildren","COLUMN","Layout","forwardRef","_ref","ref","type","children","settings","modifier","backgroundImage","tagType","dataNoSnippet","sticky","VariantComponent","otherProps","_objectWithoutProperties","_excluded","data","getFile","url","style","title","classModifiers","_objectSpread","additionalRowModifier","otherWrapperProps","WrapperComponent","createElement","_extends","className","modifiers","propTypes","string","isRequired","bool","shape","func","oneOfType","arrayOf","node","defaultProps"],"sources":["../../../src/components/Layout/Layout.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Wrapper from '../Wrapper';\nimport { getClassModifiers } from '../../utils';\nimport { useGetImages } from '../../hooks';\nimport { getStylesToUpdate, checkIfRowHasColumns } from './helpers';\nimport { renderChildren, hasChildren } from '../../helpers';\nimport { COLUMN } from '../../constants';\n\nconst Layout = React.forwardRef(\n (\n {\n type,\n children,\n settings,\n modifier,\n backgroundImage,\n tagType,\n dataNoSnippet,\n sticky,\n VariantComponent,\n ...otherProps\n },\n ref\n ) => {\n const {\n data: { getFile: { url = null } = {} }\n } = useGetImages(backgroundImage);\n const style = getStylesToUpdate({ backgroundImage: url });\n const { title } = settings;\n const classModifiers = getClassModifiers(type, { modifier, sticky, ...otherProps });\n const additionalRowModifier = checkIfRowHasColumns(type, children) ? ' display-row' : '';\n\n if (type === COLUMN && !hasChildren(children)) return null;\n\n const otherWrapperProps = {};\n if (dataNoSnippet) otherWrapperProps['data-nosnippet'] = true;\n\n const WrapperComponent = VariantComponent || Wrapper;\n\n return (\n <WrapperComponent\n ref={ref}\n tagType={tagType}\n className={type}\n modifiers={`${classModifiers}${additionalRowModifier}`}\n style={style}\n {...otherWrapperProps}>\n {title && <h2 className=\"heading heading--section\">{title}</h2>}\n {renderChildren(children, otherProps)}\n </WrapperComponent>\n );\n }\n);\n\nLayout.propTypes = {\n type: PropTypes.string.isRequired,\n sticky: PropTypes.bool,\n settings: PropTypes.shape({\n title: PropTypes.string\n }),\n modifier: PropTypes.string,\n backgroundImage: PropTypes.string,\n tagType: PropTypes.string,\n dataNoSnippet: PropTypes.bool,\n VariantComponent: PropTypes.func,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired\n};\n\nLayout.defaultProps = {\n settings: {\n title: ''\n },\n backgroundImage: '',\n modifier: '',\n tagType: '',\n dataNoSnippet: false,\n sticky: false,\n VariantComponent: null\n};\n\nexport default Layout;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,OAAO,MAAM,YAAY;AAChC,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,YAAY,QAAQ,aAAa;AAC1C,SAASC,iBAAiB,EAAEC,oBAAoB,QAAQ,WAAW;AACnE,SAASC,cAAc,EAAEC,WAAW,QAAQ,eAAe;AAC3D,SAASC,MAAM,QAAQ,iBAAiB;AAExC,MAAMC,MAAM,GAAGV,KAAK,CAACW,UAAU,CAC7B,CAAAC,IAAA,EAaEC,GAAG,KACA;EAAA,IAbH;MACEC,IAAI;MACJC,QAAQ;MACRC,QAAQ;MACRC,QAAQ;MACRC,eAAe;MACfC,OAAO;MACPC,aAAa;MACbC,MAAM;MACNC;IAEF,CAAC,GAAAV,IAAA;IADIW,UAAU,GAAAC,wBAAA,CAAA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AACC,UAAU;EACjCrB,MAAM,EAAEpB,SAAS,CAAC0C,IAAI;EACtB3B,QAAQ,EAAEf,SAAS,CAAC2C,KAAK,CAAC;IACxBd,KAAK,EAAE7B,SAAS,CAACwC;EACnB,CAAC,CAAC;EACFxB,QAAQ,EAAEhB,SAAS,CAACwC,MAAM;EAC1BvB,eAAe,EAAEjB,SAAS,CAACwC,MAAM;EACjCtB,OAAO,EAAElB,SAAS,CAACwC,MAAM;EACzBrB,aAAa,EAAEnB,SAAS,CAAC0C,IAAI;EAC7BrB,gBAAgB,EAAErB,SAAS,CAAC4C,IAAI;EAChC9B,QAAQ,EAAEd,SAAS,CAAC6C,SAAS,CAAC,CAAC7C,SAAS,CAAC8C,OAAO,CAAC9C,SAAS,CAAC+C,IAAI,CAAC,EAAE/C,SAAS,CAAC+C,IAAI,CAAC,CAAC,CAACN;AACrF,CAAC;AAEDhC,MAAM,CAACuC,YAAY,GAAG;EACpBjC,QAAQ,EAAE;IACRc,KAAK,EAAE;EACT,CAAC;EACDZ,eAAe,EAAE,EAAE;EACnBD,QAAQ,EAAE,EAAE;EACZE,OAAO,EAAE,EAAE;EACXC,aAAa,EAAE,KAAK;EACpBC,MAAM,EAAE,KAAK;EACbC,gBAAgB,EAAE;AACpB,CAAC;AAED,eAAeZ,MAAM"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
1
|
+
import React, { useState, useEffect, useRef } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { useRouter } from 'next/router';
|
|
4
4
|
import { useDebounceSearch } from '@blaze-cms/plugin-search-ui';
|
|
@@ -6,7 +6,6 @@ import SearchContentResults from './SearchContentResults';
|
|
|
6
6
|
import SearchContentToggleIcon from './SearchContentToggleIcon';
|
|
7
7
|
const SearchContent = ({
|
|
8
8
|
entities,
|
|
9
|
-
searchInputAlignment,
|
|
10
9
|
searchInputWrapperMobile,
|
|
11
10
|
searchInputWrapperDesktop,
|
|
12
11
|
isMobile,
|
|
@@ -14,7 +13,9 @@ const SearchContent = ({
|
|
|
14
13
|
modifier,
|
|
15
14
|
collapsedSearch
|
|
16
15
|
}) => {
|
|
16
|
+
const searchContentRef = useRef(null);
|
|
17
17
|
const [collapsed, setCollapsed] = useState(collapsedSearch);
|
|
18
|
+
const [showResults, setShowResults] = useState(false);
|
|
18
19
|
const router = useRouter();
|
|
19
20
|
const {
|
|
20
21
|
results,
|
|
@@ -27,14 +28,33 @@ const SearchContent = ({
|
|
|
27
28
|
resultKeys: 'id, name, image { url }, url'
|
|
28
29
|
});
|
|
29
30
|
useEffect(() => {
|
|
30
|
-
const handleRouteChange = () =>
|
|
31
|
+
const handleRouteChange = () => {
|
|
32
|
+
setSearchTerm('');
|
|
33
|
+
setShowResults(false);
|
|
34
|
+
if (collapsedSearch) setCollapsed(true);
|
|
35
|
+
};
|
|
31
36
|
router.events.on('routeChangeStart', handleRouteChange);
|
|
32
37
|
return () => {
|
|
33
38
|
router.events.off('routeChangeStart', handleRouteChange);
|
|
34
39
|
};
|
|
35
|
-
}, [router.events, setSearchTerm]);
|
|
40
|
+
}, [collapsedSearch, router.events, setSearchTerm]);
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
const handleClickOutside = event => {
|
|
43
|
+
if (searchContentRef.current && !searchContentRef.current.contains(event.target)) {
|
|
44
|
+
setShowResults(false);
|
|
45
|
+
if (collapsedSearch) {
|
|
46
|
+
setCollapsed(true);
|
|
47
|
+
setSearchTerm('');
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
document.addEventListener('click', handleClickOutside);
|
|
52
|
+
return () => {
|
|
53
|
+
document.removeEventListener('click', handleClickOutside);
|
|
54
|
+
};
|
|
55
|
+
}, [collapsedSearch, setSearchTerm]);
|
|
36
56
|
const responsiveClasses = isMobile ? searchInputWrapperMobile : searchInputWrapperDesktop;
|
|
37
|
-
const
|
|
57
|
+
const handleNavigation = (e, url) => {
|
|
38
58
|
e.preventDefault();
|
|
39
59
|
router.push(url);
|
|
40
60
|
};
|
|
@@ -43,63 +63,48 @@ const SearchContent = ({
|
|
|
43
63
|
router.push(`/search?search_term=${e.target.value}`);
|
|
44
64
|
}
|
|
45
65
|
};
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
if (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
66
|
+
const handleIconClick = () => {
|
|
67
|
+
const isCloseIcon = collapsedSearch ? !collapsed : debouncedSearchTerm;
|
|
68
|
+
if (collapsedSearch) setCollapsed(!collapsed);
|
|
69
|
+
if (isCloseIcon) {
|
|
70
|
+
setSearchTerm('');
|
|
71
|
+
setShowResults(false);
|
|
72
|
+
} else {
|
|
73
|
+
setShowResults(true);
|
|
74
|
+
}
|
|
52
75
|
};
|
|
53
76
|
const className = ['search-content', modifier, responsiveClasses].filter(Boolean).join(' ');
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}, /*#__PURE__*/React.createElement("label", {
|
|
59
|
-
className: "search-content--collapse__label"
|
|
60
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
61
|
-
className: "search-content--collapse__icon_wrapper"
|
|
62
|
-
}, /*#__PURE__*/React.createElement("svg", {
|
|
63
|
-
className: "search-content--collapse__icon",
|
|
64
|
-
viewBox: "0 0 20 20"
|
|
65
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
66
|
-
fillRule: "evenodd",
|
|
67
|
-
d: "M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",
|
|
68
|
-
clipRule: "evenodd"
|
|
69
|
-
}))), /*#__PURE__*/React.createElement("input", {
|
|
70
|
-
onFocus: () => setCollapsed(false),
|
|
71
|
-
onChange: e => setSearchTerm(e.target.value),
|
|
72
|
-
type: "text",
|
|
73
|
-
name: "search",
|
|
74
|
-
className: "search-content--collapse__input"
|
|
75
|
-
})))) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
76
|
-
className: className
|
|
77
|
+
const searchModifier = collapsed ? 'search-content--collapse' : 'search-content--expanded';
|
|
78
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
79
|
+
className: className,
|
|
80
|
+
ref: searchContentRef
|
|
77
81
|
}, /*#__PURE__*/React.createElement("div", {
|
|
78
|
-
className:
|
|
82
|
+
className: `${searchModifier}__wrapper`
|
|
79
83
|
}, /*#__PURE__*/React.createElement("label", {
|
|
80
|
-
className:
|
|
84
|
+
className: `${searchModifier}__label`
|
|
81
85
|
}, /*#__PURE__*/React.createElement("span", {
|
|
82
|
-
className:
|
|
86
|
+
className: `${searchModifier}__icon_wrapper`
|
|
83
87
|
}, /*#__PURE__*/React.createElement(SearchContentToggleIcon, {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
88
|
+
searchTerm: debouncedSearchTerm,
|
|
89
|
+
onClick: handleIconClick,
|
|
90
|
+
useCloseIcon: collapsedSearch ? !collapsed : debouncedSearchTerm
|
|
91
|
+
})), !collapsed && /*#__PURE__*/React.createElement("input", {
|
|
92
|
+
className: `${searchModifier}__input`,
|
|
87
93
|
type: "text",
|
|
88
94
|
name: "search",
|
|
89
|
-
onChange: e => setSearchTerm(e.target.value),
|
|
90
|
-
onKeyPress: handleKeyPress,
|
|
91
|
-
className: "search-content--expanded__input",
|
|
92
95
|
placeholder: placeholder,
|
|
93
96
|
value: searchTerm,
|
|
94
|
-
|
|
95
|
-
|
|
97
|
+
onChange: e => setSearchTerm(e.target.value),
|
|
98
|
+
onKeyPress: handleKeyPress,
|
|
99
|
+
onFocus: () => setShowResults(true),
|
|
100
|
+
"data-testid": "search-content-input"
|
|
101
|
+
}))), showResults && /*#__PURE__*/React.createElement(SearchContentResults, {
|
|
96
102
|
results: results,
|
|
97
103
|
debouncedSearchTerm: debouncedSearchTerm,
|
|
98
|
-
handleClick:
|
|
99
|
-
}))
|
|
104
|
+
handleClick: handleNavigation
|
|
105
|
+
}));
|
|
100
106
|
};
|
|
101
107
|
SearchContent.propTypes = {
|
|
102
|
-
searchInputAlignment: PropTypes.string,
|
|
103
108
|
searchInputWrapperMobile: PropTypes.string,
|
|
104
109
|
searchInputWrapperDesktop: PropTypes.string,
|
|
105
110
|
placeholder: PropTypes.string,
|
|
@@ -109,7 +114,6 @@ SearchContent.propTypes = {
|
|
|
109
114
|
collapsedSearch: PropTypes.bool
|
|
110
115
|
};
|
|
111
116
|
SearchContent.defaultProps = {
|
|
112
|
-
searchInputAlignment: '',
|
|
113
117
|
searchInputWrapperMobile: '',
|
|
114
118
|
searchInputWrapperDesktop: '',
|
|
115
119
|
placeholder: '',
|