@pernod-ricard-global-cms/jsutils 1.7.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/jsutils.js +6 -14
  2. package/package.json +2 -2
package/jsutils.js CHANGED
@@ -231,21 +231,13 @@ export function footerIntersection(entries, element) {
231
231
  * Dynamically retrieves the swiper css and js and returns a resolved promise when they have both been successfully fetched.
232
232
  * @returns {promise}
233
233
  */
234
- export function getSwiperAssets() {
234
+ export function getSwiperAssetsV2(options = { css: 'bundle' }) {
235
235
  const getSwiperJs = () =>
236
- import(/* webpackChunkName: 'swiper' */ '../../swiper/swiper-bundle.js');
236
+ import(/* webpackChunkName: 'swiper' */ 'NodeModules/swiper/swiper.esm');
237
237
 
238
- const getSwiperCss = () =>
239
- import(
240
- /* webpackChunkName: 'swiper' */
241
- '../../swiper/swiper-bundle.min.css'
242
- );
243
-
244
- const promisedJs = Promise.all([getSwiperJs(), getSwiperCss()]).then(
245
- (values) => {
246
- return values;
247
- }
248
- );
238
+ const promisedJs = Promise.all([getSwiperJs()]).then((values) => {
239
+ return values;
240
+ });
249
241
  return promisedJs;
250
242
  }
251
243
 
@@ -600,9 +592,9 @@ const api = {
600
592
  eventListenerDebouncer,
601
593
  footerIntersection,
602
594
  getPosition,
603
- getSwiperAssets,
604
595
  getGsap,
605
596
  getJquery,
597
+ getSwiperAssetsV2,
606
598
  inCriticalCssConfig,
607
599
  injectYouTubeIframeScript,
608
600
  isEmailValid,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pernod-ricard-global-cms/jsutils",
3
- "version": "1.7.1",
3
+ "version": "2.0.0",
4
4
  "description": "Handy collection of Javascript utility functions",
5
5
  "type": "module",
6
6
  "main": "jsutils.js",
@@ -21,7 +21,7 @@
21
21
  "gsap": "^3.7.1",
22
22
  "jquery": "^3.6.0",
23
23
  "prettier": "^2.5.1",
24
- "swiper": "^6.8.3"
24
+ "swiper": "^8.1.4"
25
25
  },
26
26
  "devDependencies": {
27
27
  "jasmine": "^3.9.0",