well-waterfall 0.2.15 → 0.2.16

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/dist/waterfall.js CHANGED
@@ -166,7 +166,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
166
166
  \******************************/
167
167
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
168
168
 
169
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ keyboardConfig: () => (/* binding */ keyboardConfig)\n/* harmony export */ });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ \"./src/util.ts\");\n\nfunction keyboardConfig($this) {\n return {\n enabled: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'keyboard-enabled', 'false'),\n onlyInViewport: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'keyboard-only-in-viewport', 'true'),\n pageUpDown: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'keyboard-page-up-down', 'true'),\n };\n}\n\n\n//# sourceURL=webpack://Waterfall/./src/modules/input.ts?");
169
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ keyboardConfig: () => (/* binding */ keyboardConfig),\n/* harmony export */ mouseConfig: () => (/* binding */ mouseConfig)\n/* harmony export */ });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ \"./src/util.ts\");\n\nfunction keyboardConfig($this) {\n return {\n enabled: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'keyboard-enabled', 'false'),\n onlyInViewport: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'keyboard-only-in-viewport', 'true'),\n pageUpDown: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'keyboard-page-up-down', 'true'),\n };\n}\nfunction mouseConfig($this) {\n return {\n enabled: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'mouse-enabled', 'false'),\n eventsTarget: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'mouse-events-target', 'container'),\n forceToAxis: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'mouse-force-to-axis', 'false'),\n invert: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'mouse-invert', 'false'),\n noMouseWheelClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'no-mouse-wheel-class', 'swiper-no-mousewheel'),\n releaseOnEdges: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'mouse-release-on-edges', 'false'),\n sensitivity: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'mouse-sensitivity', '1'),\n thresholdDelta: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'mouse-threshold-delta', 'null'),\n thresholdTime: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'mouse-threshold-time', 'null'),\n };\n}\n\n\n//# sourceURL=webpack://Waterfall/./src/modules/input.ts?");
170
170
 
171
171
  /***/ }),
172
172
 
@@ -256,7 +256,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
256
256
  \**************************/
257
257
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
258
258
 
259
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var swiper_bundle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! swiper/bundle */ \"./node_modules/swiper/swiper-bundle.mjs\");\n/* harmony import */ var swiper_css_bundle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! swiper/css/bundle */ \"./node_modules/swiper/swiper-bundle.css\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ \"./src/util.ts\");\n/* harmony import */ var _modules_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modules/navigation */ \"./src/modules/navigation.ts\");\n/* harmony import */ var _modules_breakpoints__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./modules/breakpoints */ \"./src/modules/breakpoints.ts\");\n/* harmony import */ var _modules_pagination__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./modules/pagination */ \"./src/modules/pagination.ts\");\n/* harmony import */ var _modules_scrollbar__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./modules/scrollbar */ \"./src/modules/scrollbar.ts\");\n/* harmony import */ var _modules_playback__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./modules/playback */ \"./src/modules/playback.ts\");\n/* harmony import */ var _modules_effect__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./modules/effect */ \"./src/modules/effect.ts\");\n/* harmony import */ var _modules_layout__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./modules/layout */ \"./src/modules/layout.ts\");\n/* harmony import */ var _modules_general__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./modules/general */ \"./src/modules/general.ts\");\n/* harmony import */ var _modules_slideCount__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./modules/slideCount */ \"./src/modules/slideCount.ts\");\n/* harmony import */ var _modules_thumbs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./modules/thumbs */ \"./src/modules/thumbs.ts\");\n/* harmony import */ var _modules_input__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./modules/input */ \"./src/modules/input.ts\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconsole.log(`🚿 Hello from Wellflow Waterfall v${\"0.2.15\"}`);\nconst sliders = [];\n// Initialize Thumb Sliders first\n$('[waterfall][waterfall-el=\"thumbs\"]').each((index, el) => initConfig(el, index));\n// Initialize all other sliders\n$('[waterfall]')\n .not('[waterfall-el=\"thumbs\"]')\n .each((index, el) => initConfig(el, index));\nfunction initConfig(el, index) {\n {\n const $this = $(el);\n const name = (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseString)($this, 'waterfall', `Swiper ${index}`);\n if (!name)\n return;\n const debug = Boolean((0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'debug-mode', false) || false);\n console.log(`Initializing Waterfall: ${name} ${debug ? '[DEBUG MODE]' : ''}`);\n // GENERAL CONFIG\n const swiperConfig = (0,_modules_general__WEBPACK_IMPORTED_MODULE_10__.generalConfig)($this);\n // BREAKPOINTS\n swiperConfig.breakpoints = (0,_modules_breakpoints__WEBPACK_IMPORTED_MODULE_4__.breakpointsConfig)($this);\n // PLAYBACK\n const playbackMode = (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'playback-mode', 'none');\n if (playbackMode === 'loop')\n swiperConfig.loop = true;\n if (playbackMode === 'rewind')\n swiperConfig.rewind = true;\n if (playbackMode === 'none') {\n swiperConfig.loop = false;\n swiperConfig.rewind = false;\n }\n swiperConfig.autoplay = (0,_modules_playback__WEBPACK_IMPORTED_MODULE_7__.autoplayConfig)($this);\n // NAVIGATION\n swiperConfig.navigation = (0,_modules_navigation__WEBPACK_IMPORTED_MODULE_3__.navigationConfig)($this, name);\n // PAGINATION\n let pagination = $this.find(\"[waterfall-el='pagination-bullet']\").length;\n if (pagination)\n swiperConfig.pagination = (0,_modules_pagination__WEBPACK_IMPORTED_MODULE_5__.paginationConfig)($this);\n // SCROLLBAR\n const $scrollbar = $this.find(\"[waterfall-el='scrollbar']\");\n if ($scrollbar)\n swiperConfig.scrollbar = (0,_modules_scrollbar__WEBPACK_IMPORTED_MODULE_6__.scrollbarConfig)($this);\n // EFFECT\n swiperConfig.fadeEffect = (0,_modules_effect__WEBPACK_IMPORTED_MODULE_8__.fadeConfig)($this);\n swiperConfig.coverflowEffect = (0,_modules_effect__WEBPACK_IMPORTED_MODULE_8__.coverflowEffect)($this);\n swiperConfig.flipEffect = (0,_modules_effect__WEBPACK_IMPORTED_MODULE_8__.flipEffect)($this);\n swiperConfig.cardsEffect = (0,_modules_effect__WEBPACK_IMPORTED_MODULE_8__.cardsEffect)($this);\n swiperConfig.cubeEffect = (0,_modules_effect__WEBPACK_IMPORTED_MODULE_8__.cubeEffect)($this);\n // FREE MODE\n swiperConfig.freeMode = (0,_modules_playback__WEBPACK_IMPORTED_MODULE_7__.freeModeConfig)($this);\n // GRID\n swiperConfig.grid = (0,_modules_layout__WEBPACK_IMPORTED_MODULE_9__.gridConfig)($this);\n // THUMBS\n const isThumbs = (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'waterfall-el', null) === 'thumbs';\n if (!isThumbs)\n swiperConfig.thumbs = (0,_modules_thumbs__WEBPACK_IMPORTED_MODULE_12__.thumbsConfig)($this, sliders);\n // ZOOM - NOT IMPLEMENTED\n // KEYBOARD\n swiperConfig.keyboard = (0,_modules_input__WEBPACK_IMPORTED_MODULE_13__.keyboardConfig)($this);\n // Clean up the config and debug\n (0,_util__WEBPACK_IMPORTED_MODULE_2__.printDebug)(debug, 'CONFIG (UNCLEANED)', swiperConfig);\n const config = (0,_util__WEBPACK_IMPORTED_MODULE_2__.removeNullOrUndefinedKeys)(swiperConfig);\n (0,_util__WEBPACK_IMPORTED_MODULE_2__.printDebug)(debug, 'CONFIG', config);\n // Initialize swiper\n const swiper = new swiper_bundle__WEBPACK_IMPORTED_MODULE_0__[\"default\"]($this.find('.swiper')[0], config);\n // Add to sliders array\n sliders.push({ name, swiper: swiper });\n }\n}\n(0,_modules_slideCount__WEBPACK_IMPORTED_MODULE_11__.initSlideCount)();\n\n\n//# sourceURL=webpack://Waterfall/./src/waterfall.ts?");
259
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var swiper_bundle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! swiper/bundle */ \"./node_modules/swiper/swiper-bundle.mjs\");\n/* harmony import */ var swiper_css_bundle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! swiper/css/bundle */ \"./node_modules/swiper/swiper-bundle.css\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ \"./src/util.ts\");\n/* harmony import */ var _modules_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modules/navigation */ \"./src/modules/navigation.ts\");\n/* harmony import */ var _modules_breakpoints__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./modules/breakpoints */ \"./src/modules/breakpoints.ts\");\n/* harmony import */ var _modules_pagination__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./modules/pagination */ \"./src/modules/pagination.ts\");\n/* harmony import */ var _modules_scrollbar__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./modules/scrollbar */ \"./src/modules/scrollbar.ts\");\n/* harmony import */ var _modules_playback__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./modules/playback */ \"./src/modules/playback.ts\");\n/* harmony import */ var _modules_effect__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./modules/effect */ \"./src/modules/effect.ts\");\n/* harmony import */ var _modules_layout__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./modules/layout */ \"./src/modules/layout.ts\");\n/* harmony import */ var _modules_general__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./modules/general */ \"./src/modules/general.ts\");\n/* harmony import */ var _modules_slideCount__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./modules/slideCount */ \"./src/modules/slideCount.ts\");\n/* harmony import */ var _modules_thumbs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./modules/thumbs */ \"./src/modules/thumbs.ts\");\n/* harmony import */ var _modules_input__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./modules/input */ \"./src/modules/input.ts\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconsole.log(`🚿 Hello from Wellflow Waterfall v${\"0.2.16\"}`);\nconst sliders = [];\n// Initialize Thumb Sliders first\n$('[waterfall][waterfall-el=\"thumbs\"]').each((index, el) => initConfig(el, index));\n// Initialize all other sliders\n$('[waterfall]')\n .not('[waterfall-el=\"thumbs\"]')\n .each((index, el) => initConfig(el, index));\nfunction initConfig(el, index) {\n {\n const $this = $(el);\n const name = (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseString)($this, 'waterfall', `Swiper ${index}`);\n if (!name)\n return;\n const debug = Boolean((0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'debug-mode', false) || false);\n console.log(`Initializing Waterfall: ${name} ${debug ? '[DEBUG MODE]' : ''}`);\n // GENERAL CONFIG\n const swiperConfig = (0,_modules_general__WEBPACK_IMPORTED_MODULE_10__.generalConfig)($this);\n // BREAKPOINTS\n swiperConfig.breakpoints = (0,_modules_breakpoints__WEBPACK_IMPORTED_MODULE_4__.breakpointsConfig)($this);\n // PLAYBACK\n const playbackMode = (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'playback-mode', 'none');\n if (playbackMode === 'loop')\n swiperConfig.loop = true;\n if (playbackMode === 'rewind')\n swiperConfig.rewind = true;\n if (playbackMode === 'none') {\n swiperConfig.loop = false;\n swiperConfig.rewind = false;\n }\n swiperConfig.autoplay = (0,_modules_playback__WEBPACK_IMPORTED_MODULE_7__.autoplayConfig)($this);\n // NAVIGATION\n swiperConfig.navigation = (0,_modules_navigation__WEBPACK_IMPORTED_MODULE_3__.navigationConfig)($this, name);\n // PAGINATION\n let pagination = $this.find(\"[waterfall-el='pagination-bullet']\").length;\n if (pagination)\n swiperConfig.pagination = (0,_modules_pagination__WEBPACK_IMPORTED_MODULE_5__.paginationConfig)($this);\n // SCROLLBAR\n const $scrollbar = $this.find(\"[waterfall-el='scrollbar']\");\n if ($scrollbar)\n swiperConfig.scrollbar = (0,_modules_scrollbar__WEBPACK_IMPORTED_MODULE_6__.scrollbarConfig)($this);\n // EFFECT\n swiperConfig.fadeEffect = (0,_modules_effect__WEBPACK_IMPORTED_MODULE_8__.fadeConfig)($this);\n swiperConfig.coverflowEffect = (0,_modules_effect__WEBPACK_IMPORTED_MODULE_8__.coverflowEffect)($this);\n swiperConfig.flipEffect = (0,_modules_effect__WEBPACK_IMPORTED_MODULE_8__.flipEffect)($this);\n swiperConfig.cardsEffect = (0,_modules_effect__WEBPACK_IMPORTED_MODULE_8__.cardsEffect)($this);\n swiperConfig.cubeEffect = (0,_modules_effect__WEBPACK_IMPORTED_MODULE_8__.cubeEffect)($this);\n // FREE MODE\n swiperConfig.freeMode = (0,_modules_playback__WEBPACK_IMPORTED_MODULE_7__.freeModeConfig)($this);\n // GRID\n swiperConfig.grid = (0,_modules_layout__WEBPACK_IMPORTED_MODULE_9__.gridConfig)($this);\n // THUMBS\n const isThumbs = (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'waterfall-el', null) === 'thumbs';\n if (!isThumbs)\n swiperConfig.thumbs = (0,_modules_thumbs__WEBPACK_IMPORTED_MODULE_12__.thumbsConfig)($this, sliders);\n // ZOOM - NOT IMPLEMENTED\n // KEYBOARD\n swiperConfig.keyboard = (0,_modules_input__WEBPACK_IMPORTED_MODULE_13__.keyboardConfig)($this);\n // MOUSE\n swiperConfig.mouse = (0,_modules_input__WEBPACK_IMPORTED_MODULE_13__.mouseConfig)($this);\n // Clean up the config and debug\n //printDebug(debug, 'CONFIG (UNCLEANED)', swiperConfig);\n const config = (0,_util__WEBPACK_IMPORTED_MODULE_2__.removeNullOrUndefinedKeys)(swiperConfig);\n (0,_util__WEBPACK_IMPORTED_MODULE_2__.printDebug)(debug, 'CONFIG', config);\n // Initialize swiper\n const swiper = new swiper_bundle__WEBPACK_IMPORTED_MODULE_0__[\"default\"]($this.find('.swiper')[0], config);\n // Add to sliders array\n sliders.push({ name, swiper: swiper });\n }\n}\n(0,_modules_slideCount__WEBPACK_IMPORTED_MODULE_11__.initSlideCount)();\n\n\n//# sourceURL=webpack://Waterfall/./src/waterfall.ts?");
260
260
 
261
261
  /***/ }),
262
262
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "well-waterfall",
3
- "version": "0.2.15",
3
+ "version": "0.2.16",
4
4
  "description": "An attribute-based wrapper of SwiperJS for Webflow",
5
5
  "main": "waterfall.js",
6
6
  "scripts": {
@@ -7,3 +7,21 @@ export function keyboardConfig($this: JQuery<HTMLElement>) {
7
7
  pageUpDown: parseAttr($this, 'keyboard-page-up-down', 'true'),
8
8
  };
9
9
  }
10
+
11
+ export function mouseConfig($this: JQuery<HTMLElement>) {
12
+ return {
13
+ enabled: parseAttr($this, 'mouse-enabled', 'false'),
14
+ eventsTarget: parseAttr($this, 'mouse-events-target', 'container'),
15
+ forceToAxis: parseAttr($this, 'mouse-force-to-axis', 'false'),
16
+ invert: parseAttr($this, 'mouse-invert', 'false'),
17
+ noMouseWheelClass: parseAttr(
18
+ $this,
19
+ 'no-mouse-wheel-class',
20
+ 'swiper-no-mousewheel',
21
+ ),
22
+ releaseOnEdges: parseAttr($this, 'mouse-release-on-edges', 'false'),
23
+ sensitivity: parseAttr($this, 'mouse-sensitivity', '1'),
24
+ thresholdDelta: parseAttr($this, 'mouse-threshold-delta', 'null'),
25
+ thresholdTime: parseAttr($this, 'mouse-threshold-time', 'null'),
26
+ };
27
+ }
package/src/waterfall.ts CHANGED
@@ -23,7 +23,7 @@ import { generalConfig } from './modules/general';
23
23
  import { initSlideCount } from './modules/slideCount';
24
24
  import { thumbsConfig } from './modules/thumbs';
25
25
  import { Waterfall } from './types/waterfall';
26
- import { keyboardConfig } from './modules/input';
26
+ import { keyboardConfig, mouseConfig } from './modules/input';
27
27
 
28
28
  console.log(`🚿 Hello from Wellflow Waterfall v${APP_VERSION}`);
29
29
 
@@ -100,8 +100,11 @@ function initConfig(el: HTMLElement, index: number) {
100
100
  // KEYBOARD
101
101
  swiperConfig.keyboard = keyboardConfig($this);
102
102
 
103
+ // MOUSE
104
+ swiperConfig.mouse = mouseConfig($this);
105
+
103
106
  // Clean up the config and debug
104
- printDebug(debug, 'CONFIG (UNCLEANED)', swiperConfig);
107
+ //printDebug(debug, 'CONFIG (UNCLEANED)', swiperConfig);
105
108
  const config = removeNullOrUndefinedKeys(swiperConfig);
106
109
  printDebug(debug, 'CONFIG', config);
107
110