@shopgate/engage 7.30.4-beta.1 → 7.30.4-beta.3
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.
|
@@ -4,6 +4,7 @@ import "core-js/modules/es.string.replace.js";
|
|
|
4
4
|
import React, { Component } from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import Helmet from 'react-helmet';
|
|
7
|
+
import classNames from 'classnames';
|
|
7
8
|
import ResponsiveContainer from '@shopgate/engage/components/ResponsiveContainer';
|
|
8
9
|
import appConfig from '@shopgate/pwa-common/helpers/config';
|
|
9
10
|
import event from '@shopgate/pwa-core/classes/Event';
|
|
@@ -17,7 +18,7 @@ import { ConditionalWrapper } from "../../../ConditionalWrapper";
|
|
|
17
18
|
import Above from "../Above";
|
|
18
19
|
import Below from "../Below";
|
|
19
20
|
import ParallaxProvider from "./components/ParallaxProvider";
|
|
20
|
-
import { container, containerInner } from "./style";
|
|
21
|
+
import { container, containerInner, scrollableContent } from "./style";
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
24
|
* The ViewContent component.
|
|
@@ -155,7 +156,7 @@ let ViewContent = /*#__PURE__*/function (_Component) {
|
|
|
155
156
|
children: /*#__PURE__*/_jsx("div", {
|
|
156
157
|
className: containerInner,
|
|
157
158
|
children: /*#__PURE__*/_jsxs("div", {
|
|
158
|
-
className:
|
|
159
|
+
className: classNames(scrollableContent, 'engage__view__content__scrollable-content'),
|
|
159
160
|
children: [/*#__PURE__*/_jsx(Helmet, {
|
|
160
161
|
title: appConfig.shopName
|
|
161
162
|
}), /*#__PURE__*/_jsx(Above, {}), /*#__PURE__*/_jsx(ResponsiveContainer, {
|
|
@@ -27,6 +27,9 @@ export const container = css({
|
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
export const containerInner = css({
|
|
30
|
+
display: 'flex',
|
|
31
|
+
flexGrow: 1,
|
|
32
|
+
flexDirection: 'column',
|
|
30
33
|
...(isIOs && useScrollContainer() ? {
|
|
31
34
|
// Make the scroll container content a bit higher than the actual scroll container to
|
|
32
35
|
// get a rubber band effect in all situations
|
|
@@ -38,4 +41,9 @@ export const containerInner = css({
|
|
|
38
41
|
pointerEvents: 'none',
|
|
39
42
|
paddingBottom: 'calc(var(--page-content-offset-bottom) + var(--keyboard-height))'
|
|
40
43
|
}
|
|
44
|
+
});
|
|
45
|
+
export const scrollableContent = css({
|
|
46
|
+
display: 'flex',
|
|
47
|
+
flexDirection: 'column',
|
|
48
|
+
flexGrow: 1
|
|
41
49
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopgate/engage",
|
|
3
|
-
"version": "7.30.4-beta.
|
|
3
|
+
"version": "7.30.4-beta.3",
|
|
4
4
|
"description": "Shopgate's ENGAGE library.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Shopgate <support@shopgate.com>",
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@emotion/react": "^11.14.0",
|
|
19
19
|
"@shopgate/native-modules": "1.0.0-beta.25",
|
|
20
|
-
"@shopgate/pwa-common": "7.30.4-beta.
|
|
21
|
-
"@shopgate/pwa-common-commerce": "7.30.4-beta.
|
|
22
|
-
"@shopgate/pwa-core": "7.30.4-beta.
|
|
23
|
-
"@shopgate/pwa-ui-ios": "7.30.4-beta.
|
|
24
|
-
"@shopgate/pwa-ui-material": "7.30.4-beta.
|
|
25
|
-
"@shopgate/pwa-ui-shared": "7.30.4-beta.
|
|
20
|
+
"@shopgate/pwa-common": "7.30.4-beta.3",
|
|
21
|
+
"@shopgate/pwa-common-commerce": "7.30.4-beta.3",
|
|
22
|
+
"@shopgate/pwa-core": "7.30.4-beta.3",
|
|
23
|
+
"@shopgate/pwa-ui-ios": "7.30.4-beta.3",
|
|
24
|
+
"@shopgate/pwa-ui-material": "7.30.4-beta.3",
|
|
25
|
+
"@shopgate/pwa-ui-shared": "7.30.4-beta.3",
|
|
26
26
|
"@stripe/react-stripe-js": "^1.16.5",
|
|
27
27
|
"@stripe/stripe-js": "^1.44.1",
|
|
28
28
|
"@virtuous/conductor": "~2.5.0",
|
|
@@ -19,7 +19,8 @@ const ImageSliderWidget = () => {
|
|
|
19
19
|
const {
|
|
20
20
|
slides,
|
|
21
21
|
swiperProps,
|
|
22
|
-
borderRadius
|
|
22
|
+
borderRadius,
|
|
23
|
+
paginationType
|
|
23
24
|
} = useImageSliderWidget();
|
|
24
25
|
const {
|
|
25
26
|
classes
|
|
@@ -29,6 +30,7 @@ const ImageSliderWidget = () => {
|
|
|
29
30
|
}
|
|
30
31
|
return /*#__PURE__*/_jsx(Swiper, {
|
|
31
32
|
indicators: true,
|
|
33
|
+
paginationType: paginationType,
|
|
32
34
|
...swiperProps,
|
|
33
35
|
children: slides.map(slide => {
|
|
34
36
|
if (!slide.image.url) {
|
|
@@ -30,7 +30,7 @@ import { resolveBorderRadiusFromWidgetConfig } from "../../helpers";
|
|
|
30
30
|
* @property {number} slidesPerViewCustomMedium Slides per view for medium screens.
|
|
31
31
|
* @property {number} slidesPerViewCustomLarge Slides per view for large screens.
|
|
32
32
|
* @property {number} imageSpacing Optional gap between image slides (in pixels).
|
|
33
|
-
* @property {"default"|"off"|"bullets"|"progressbar"|"fraction"} paginationStyle
|
|
33
|
+
* @property {"default"|"off"|"bullets"|"bulletsBelow"|"progressbar"|"fraction"} paginationStyle
|
|
34
34
|
* @property {"default"|"none"|"rounded"|"custom"} borderRadius The border radius option.
|
|
35
35
|
* @property {number} [borderRadiusCustom] The custom border radius value.
|
|
36
36
|
* the pagination type for the slider.
|
|
@@ -71,7 +71,7 @@ export const useImageSliderWidget = () => {
|
|
|
71
71
|
borderRadius,
|
|
72
72
|
borderRadiusCustom
|
|
73
73
|
});
|
|
74
|
-
const paginationType = useMemo(() => paginationStyle === 'default' ? 'bullets' : paginationStyle
|
|
74
|
+
const paginationType = useMemo(() => paginationStyle === 'default' ? 'bullets' : paginationStyle, [paginationStyle]);
|
|
75
75
|
const imagesWithUrls = useMemo(() => images.filter(img => img?.image?.url), [images]);
|
|
76
76
|
|
|
77
77
|
/**
|
|
@@ -134,7 +134,9 @@ export const useImageSliderWidget = () => {
|
|
|
134
134
|
slidesPerView: slidesPerViewSmall,
|
|
135
135
|
breakpoints,
|
|
136
136
|
pagination: showPagination ? {
|
|
137
|
-
type
|
|
137
|
+
// The "bulletsBelow" pagination type is a custom variant of "bullets" and needs to be set
|
|
138
|
+
// to "bullets" for Swiper to render it
|
|
139
|
+
type: paginationType === 'bulletsBelow' ? 'bullets' : paginationType,
|
|
138
140
|
clickable: true,
|
|
139
141
|
dynamicBullets: true
|
|
140
142
|
} : false,
|
|
@@ -166,6 +168,9 @@ export const useImageSliderWidget = () => {
|
|
|
166
168
|
return {
|
|
167
169
|
slides: imagesWithUrls,
|
|
168
170
|
swiperProps,
|
|
169
|
-
borderRadius: borderRadiusResolved
|
|
171
|
+
borderRadius: borderRadiusResolved,
|
|
172
|
+
// Since "bulletsBelow" is a custom pagination type we need to use the paginationType prop of
|
|
173
|
+
// our Swiper component, since it's can't be passed with the pagination object in swiperProps
|
|
174
|
+
paginationType: paginationType === 'bulletsBelow' ? 'bulletsBelow' : undefined
|
|
170
175
|
};
|
|
171
176
|
};
|
|
@@ -24,7 +24,8 @@ const MediaSlider = ({
|
|
|
24
24
|
'aria-hidden': ariaHidden,
|
|
25
25
|
renderPlaceholder,
|
|
26
26
|
className,
|
|
27
|
-
paginationType
|
|
27
|
+
paginationType,
|
|
28
|
+
swiperProps
|
|
28
29
|
}) => {
|
|
29
30
|
let currentSlide = 0;
|
|
30
31
|
|
|
@@ -58,6 +59,7 @@ const MediaSlider = ({
|
|
|
58
59
|
controls: media.some(m => m.type === MEDIA_TYPE_VIDEO),
|
|
59
60
|
className: className,
|
|
60
61
|
"aria-hidden": ariaHidden,
|
|
62
|
+
...swiperProps,
|
|
61
63
|
children: media.map(singleMedia => {
|
|
62
64
|
const Type = typeRenders[singleMedia.type];
|
|
63
65
|
return /*#__PURE__*/_jsx(Swiper.Item, {
|
|
@@ -79,6 +81,7 @@ MediaSlider.defaultProps = {
|
|
|
79
81
|
media: null,
|
|
80
82
|
renderPlaceholder: featuredMedia => /*#__PURE__*/_jsx(MediaImage, {
|
|
81
83
|
...featuredMedia
|
|
82
|
-
})
|
|
84
|
+
}),
|
|
85
|
+
swiperProps: {}
|
|
83
86
|
};
|
|
84
87
|
export default connect(MediaSlider);
|