@shopgate/engage 7.31.0-alpha.6 → 7.31.0-alpha.7

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../components/View/components/Content/index.jsx"],"names":[],"mappings":"AAyPe,+EAUd"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../components/View/components/Content/index.jsx"],"names":[],"mappings":"AAiQe,+EAUd"}
@@ -12,7 +12,7 @@ import { EVENT_KEYBOARD_WILL_CHANGE } from '@shopgate/pwa-core/constants/AppEven
12
12
  import SurroundPortals from '@shopgate/pwa-common/components/SurroundPortals';
13
13
  import { VIEW_CONTENT } from '@shopgate/pwa-common/constants/Portals';
14
14
  import { applyScrollContainer, isIOs } from '@shopgate/engage/core/helpers';
15
- import { makeStyles, cx, responsiveMediaQuery } from '@shopgate/engage/styles';
15
+ import { makeStyles, responsiveMediaQuery } from '@shopgate/engage/styles';
16
16
  import { IS_PAGE_PREVIEW_ACTIVE } from '@shopgate/engage/page/constants';
17
17
  import { ConditionalWrapper } from "../../../ConditionalWrapper";
18
18
  import Above from "../Above";
@@ -46,6 +46,9 @@ const useStyles = makeStyles()({
46
46
  backgroundColor: 'var(--page-background-color)'
47
47
  },
48
48
  containerInner: {
49
+ display: 'flex',
50
+ flexGrow: 1,
51
+ flexDirection: 'column',
49
52
  ':after': {
50
53
  content: "''",
51
54
  display: 'block',
@@ -55,6 +58,11 @@ const useStyles = makeStyles()({
55
58
  },
56
59
  containerInnerIosScroll: {
57
60
  minHeight: 'calc(100% + var(--extra-ios-scroll-space, 0px))'
61
+ },
62
+ scrollableContent: {
63
+ display: 'flex',
64
+ flexDirection: 'column',
65
+ flexGrow: 1
58
66
  }
59
67
  });
60
68
 
@@ -75,7 +83,8 @@ const ViewContent = ({
75
83
  const routeContext = useContext(RouteContext);
76
84
  const scrollContainer = applyScrollContainer();
77
85
  const {
78
- classes
86
+ classes,
87
+ cx
79
88
  } = useStyles();
80
89
  const ref = useRef((() => {
81
90
  if (scrollContainer) {
@@ -179,7 +188,7 @@ const ViewContent = ({
179
188
  children: /*#__PURE__*/_jsx("div", {
180
189
  className: cx(classes.containerInner, isIOs && scrollContainer && classes.containerInnerIosScroll),
181
190
  children: /*#__PURE__*/_jsxs("div", {
182
- className: "engage__view__content__scrollable-content",
191
+ className: cx(classes.scrollableContent, 'engage__view__content__scrollable-content'),
183
192
  children: [/*#__PURE__*/_jsx(Helmet, {
184
193
  title: appConfig.shopName
185
194
  }), /*#__PURE__*/_jsx(Above, {}), /*#__PURE__*/_jsx(ResponsiveContainer, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopgate/engage",
3
- "version": "7.31.0-alpha.6",
3
+ "version": "7.31.0-alpha.7",
4
4
  "description": "Shopgate's ENGAGE library.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Shopgate <support@shopgate.com>",
@@ -18,12 +18,12 @@
18
18
  "dependencies": {
19
19
  "@emotion/react": "^11.14.0",
20
20
  "@shopgate/native-modules": "1.0.0-beta.25",
21
- "@shopgate/pwa-common": "7.31.0-alpha.6",
22
- "@shopgate/pwa-common-commerce": "7.31.0-alpha.6",
23
- "@shopgate/pwa-core": "7.31.0-alpha.6",
24
- "@shopgate/pwa-ui-ios": "7.31.0-alpha.6",
25
- "@shopgate/pwa-ui-material": "7.31.0-alpha.6",
26
- "@shopgate/pwa-ui-shared": "7.31.0-alpha.6",
21
+ "@shopgate/pwa-common": "7.31.0-alpha.7",
22
+ "@shopgate/pwa-common-commerce": "7.31.0-alpha.7",
23
+ "@shopgate/pwa-core": "7.31.0-alpha.7",
24
+ "@shopgate/pwa-ui-ios": "7.31.0-alpha.7",
25
+ "@shopgate/pwa-ui-material": "7.31.0-alpha.7",
26
+ "@shopgate/pwa-ui-shared": "7.31.0-alpha.7",
27
27
  "@stripe/react-stripe-js": "^1.16.5",
28
28
  "@stripe/stripe-js": "^1.44.1",
29
29
  "@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.toLowerCase(), [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: paginationType,
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
  };
@@ -34,7 +34,8 @@ const MediaSlider = ({
34
34
  'aria-hidden': ariaHidden,
35
35
  renderPlaceholder,
36
36
  className,
37
- paginationType
37
+ paginationType,
38
+ swiperProps
38
39
  }) => {
39
40
  const {
40
41
  classes
@@ -71,6 +72,7 @@ const MediaSlider = ({
71
72
  controls: media.some(m => m.type === MEDIA_TYPE_VIDEO),
72
73
  className: className,
73
74
  "aria-hidden": ariaHidden,
75
+ ...swiperProps,
74
76
  children: media.map(singleMedia => {
75
77
  const Type = typeRenders[singleMedia.type];
76
78
  return /*#__PURE__*/_jsx(Swiper.Item, {
@@ -92,6 +94,7 @@ MediaSlider.defaultProps = {
92
94
  media: null,
93
95
  renderPlaceholder: featuredMedia => /*#__PURE__*/_jsx(MediaImage, {
94
96
  ...featuredMedia
95
- })
97
+ }),
98
+ swiperProps: {}
96
99
  };
97
100
  export default connect(MediaSlider);