@searchspring/snap-preact-components 0.53.0 → 0.53.1

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":"Carousel.d.ts","sourceRoot":"","sources":["../../../../../src/components/Molecules/Carousel/Carousel.tsx"],"names":[],"mappings":";AAWA,OAAO,KAAK,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAIzE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAc,MAAM,gBAAgB,CAAC;AAkI9E,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BtC,CAAC;AAEF,eAAO,MAAM,kCAAkC;;;;;;CAM9C,CAAC;AAEF,eAAO,MAAM,QAAQ,eAAyB,aAAa,KAAG,WAuP5D,CAAC;AAEH,MAAM,WAAW,aAAc,SAAQ,cAAc;IACpD,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,UAAU,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC;IAClC,UAAU,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC;IACzC,UAAU,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC;IACzC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,YAAY,K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AAC,OAAO,GAAG,MAAM,CAAC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC;IACzC,UAAU,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC;IACzC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,YAAY,KAAK,IAAI,CAAC;IACnF,iBAAiB,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IAC3E,iBAAiB,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IAC3E,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC7C,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IACvC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC5C,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;IAChB,QAAQ,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;CACxB"}
@@ -205,6 +205,14 @@ exports.Carousel = (0, mobx_react_1.observer)(function (properties) {
205
205
  breakpoints: properties.vertical
206
206
  ? JSON.parse(JSON.stringify(exports.defaultVerticalCarouselBreakpoints))
207
207
  : JSON.parse(JSON.stringify(exports.defaultCarouselBreakpoints)), pagination: false, loop: true, autoAdjustSlides: true }, (_a = globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.components) === null || _a === void 0 ? void 0 : _a.carousel), properties), (_c = (_b = properties.theme) === null || _b === void 0 ? void 0 : _b.components) === null || _c === void 0 ? void 0 : _c.carousel);
208
+ Object.keys(props.breakpoints).forEach(function (breakpoint) {
209
+ var breakPointProps = props.breakpoints[breakpoint];
210
+ // make certain props numbers
211
+ if (breakPointProps.slidesPerView)
212
+ breakPointProps.slidesPerView = Number(breakPointProps.slidesPerView) || 1;
213
+ if (breakPointProps.slidesPerGroup)
214
+ breakPointProps.slidesPerGroup = Number(breakPointProps.slidesPerGroup) || 1;
215
+ });
208
216
  var displaySettings = (0, useDisplaySettings_1.useDisplaySettings)(props.breakpoints);
209
217
  if (displaySettings && Object.keys(displaySettings).length) {
210
218
  var theme_1 = (0, deepmerge_1.default)((props === null || props === void 0 ? void 0 : props.theme) || {}, (displaySettings === null || displaySettings === void 0 ? void 0 : displaySettings.theme) || {}, { arrayMerge: function (destinationArray, sourceArray) { return sourceArray; } });
@@ -241,18 +249,13 @@ exports.Carousel = (0, mobx_react_1.observer)(function (properties) {
241
249
  }
242
250
  (0, hooks_1.useEffect)(function () {
243
251
  //backwards compatability for legacy styles
244
- var swipers = document.querySelectorAll('.swiper');
245
- swipers.forEach(function (elem) {
246
- elem.classList.add('swiper-container', 'swiper-container-pointer-events');
247
- });
248
- var verticalSwipers = document.querySelectorAll('.swiper-vertical');
249
- verticalSwipers.forEach(function (elem) {
250
- elem.classList.add('swiper-container-vertical');
251
- });
252
- var horizontalSwipers = document.querySelectorAll('.swiper-horizontal');
253
- horizontalSwipers.forEach(function (elem) {
254
- elem.classList.add('swiper-container-horizontal');
255
- });
252
+ if (rootComponentRef.current) {
253
+ var rootElem = rootComponentRef.current;
254
+ var swiperElem = rootElem.querySelector('.swiper');
255
+ swiperElem === null || swiperElem === void 0 ? void 0 : swiperElem.classList.add('swiper-container', 'swiper-container-pointer-events');
256
+ (swiperElem === null || swiperElem === void 0 ? void 0 : swiperElem.classList.contains('swiper-vertical')) && swiperElem.classList.add('swiper-container-vertical');
257
+ (swiperElem === null || swiperElem === void 0 ? void 0 : swiperElem.classList.contains('swiper-horizontal')) && swiperElem.classList.add('swiper-container-horizontal');
258
+ }
256
259
  //add usable class to last visible slide.
257
260
  attachClasstoLastVisibleSlide();
258
261
  }, []);
@@ -1 +1 @@
1
- {"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../../../../../src/components/Molecules/Carousel/Carousel.tsx"],"names":[],"mappings":";AAWA,OAAO,KAAK,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAIzE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAc,MAAM,gBAAgB,CAAC;AAkI9E,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BtC,CAAC;AAEF,eAAO,MAAM,kCAAkC;;;;;;CAM9C,CAAC;AAEF,eAAO,MAAM,QAAQ,eAAyB,aAAa,KAAG,WAuP5D,CAAC;AAEH,MAAM,WAAW,aAAc,SAAQ,cAAc;IACpD,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,UAAU,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC;IAClC,UAAU,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC;IACzC,UAAU,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC;IACzC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,EAAE,UAAU,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UAAU,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC;IACzC,UAAU,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC;IACzC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,YAAY,KAAK,IAAI,CAAC;IACnF,iBAAiB,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IAC3E,iBAAiB,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IAC3E,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC7C,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IACvC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC5C,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;IAChB,QAAQ,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;CACxB"}
@@ -181,6 +181,14 @@ export const Carousel = observer((properties) => {
181
181
  ...properties,
182
182
  ...properties.theme?.components?.carousel,
183
183
  };
184
+ Object.keys(props.breakpoints).forEach((breakpoint) => {
185
+ const breakPointProps = props.breakpoints[breakpoint];
186
+ // make certain props numbers
187
+ if (breakPointProps.slidesPerView)
188
+ breakPointProps.slidesPerView = Number(breakPointProps.slidesPerView) || 1;
189
+ if (breakPointProps.slidesPerGroup)
190
+ breakPointProps.slidesPerGroup = Number(breakPointProps.slidesPerGroup) || 1;
191
+ });
184
192
  const displaySettings = useDisplaySettings(props.breakpoints);
185
193
  if (displaySettings && Object.keys(displaySettings).length) {
186
194
  const theme = deepmerge(props?.theme || {}, displaySettings?.theme || {}, { arrayMerge: (destinationArray, sourceArray) => sourceArray });
@@ -226,18 +234,13 @@ export const Carousel = observer((properties) => {
226
234
  }
227
235
  useEffect(() => {
228
236
  //backwards compatability for legacy styles
229
- const swipers = document.querySelectorAll('.swiper');
230
- swipers.forEach((elem) => {
231
- elem.classList.add('swiper-container', 'swiper-container-pointer-events');
232
- });
233
- const verticalSwipers = document.querySelectorAll('.swiper-vertical');
234
- verticalSwipers.forEach((elem) => {
235
- elem.classList.add('swiper-container-vertical');
236
- });
237
- const horizontalSwipers = document.querySelectorAll('.swiper-horizontal');
238
- horizontalSwipers.forEach((elem) => {
239
- elem.classList.add('swiper-container-horizontal');
240
- });
237
+ if (rootComponentRef.current) {
238
+ const rootElem = rootComponentRef.current;
239
+ const swiperElem = rootElem.querySelector('.swiper');
240
+ swiperElem?.classList.add('swiper-container', 'swiper-container-pointer-events');
241
+ swiperElem?.classList.contains('swiper-vertical') && swiperElem.classList.add('swiper-container-vertical');
242
+ swiperElem?.classList.contains('swiper-horizontal') && swiperElem.classList.add('swiper-container-horizontal');
243
+ }
241
244
  //add usable class to last visible slide.
242
245
  attachClasstoLastVisibleSlide();
243
246
  }, []);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@searchspring/snap-preact-components",
3
- "version": "0.53.0",
3
+ "version": "0.53.1",
4
4
  "description": "Snap Preact Component Library",
5
5
  "author": "Searchspring",
6
6
  "license": "MIT",
@@ -29,7 +29,7 @@
29
29
  "dependencies": {
30
30
  "@cypress/react": "^8.0.0",
31
31
  "@emotion/react": "11.9.0",
32
- "@searchspring/snap-toolbox": "^0.53.0",
32
+ "@searchspring/snap-toolbox": "^0.53.1",
33
33
  "classnames": "^2.3.2",
34
34
  "cypress": "^12.15.0",
35
35
  "cypress-wait-until": "^1.7.2",
@@ -37,7 +37,7 @@
37
37
  "dequal": "2.0.3",
38
38
  "mobx-react": "7.6.0",
39
39
  "react-ranger": "2.1.0",
40
- "swiper": "11.0.7"
40
+ "swiper": "11.1.0"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "mobx": "6.9.0",
@@ -52,14 +52,14 @@
52
52
  "@babel/preset-env": "^7.21.4",
53
53
  "@babel/preset-react": "^7.18.6",
54
54
  "@babel/runtime": "^7.21.0",
55
- "@searchspring/snap-client": "^0.53.0",
56
- "@searchspring/snap-controller": "^0.53.0",
57
- "@searchspring/snap-event-manager": "^0.53.0",
58
- "@searchspring/snap-logger": "^0.53.0",
59
- "@searchspring/snap-profiler": "^0.53.0",
60
- "@searchspring/snap-store-mobx": "^0.53.0",
61
- "@searchspring/snap-tracker": "^0.53.0",
62
- "@searchspring/snap-url-manager": "^0.53.0",
55
+ "@searchspring/snap-client": "^0.53.1",
56
+ "@searchspring/snap-controller": "^0.53.1",
57
+ "@searchspring/snap-event-manager": "^0.53.1",
58
+ "@searchspring/snap-logger": "^0.53.1",
59
+ "@searchspring/snap-profiler": "^0.53.1",
60
+ "@searchspring/snap-store-mobx": "^0.53.1",
61
+ "@searchspring/snap-tracker": "^0.53.1",
62
+ "@searchspring/snap-url-manager": "^0.53.1",
63
63
  "@storybook/addon-actions": "6.4.22",
64
64
  "@storybook/addon-controls": "6.4.22",
65
65
  "@storybook/addon-docs": "6.4.22",
@@ -83,5 +83,5 @@
83
83
  "webpack-merge": "^5.8.0"
84
84
  },
85
85
  "sideEffects": false,
86
- "gitHead": "4f8bd81f6aab37463877aee73b69653f1af428b7"
86
+ "gitHead": "53686cc7e416d1d9f33ab2c4918601dae7722565"
87
87
  }