well-waterfall 0.0.39 → 0.0.40

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
@@ -136,7 +136,7 @@ eval("\n\n/* istanbul ignore next */\nfunction styleTagTransform(css, styleElem
136
136
  \**************************/
137
137
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
138
138
 
139
- 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\");\nconsole.log(\"🚿 Hello from Wellflow Waterfall\");\n\n\n\n\nconst sliders = [];\n\n// Helper function to get an attribute with type conversion\nfunction getAttr(el, attrName, defaultValue) {\n const value = $(el).attr(attrName);\n console.log(attrName, value, defaultValue, typeof defaultValue, value === true);\n if (value === undefined || value === null) return defaultValue;\n\n if (typeof defaultValue === \"boolean\") {\n return value;\n }\n if (typeof defaultValue === \"number\") {\n return parseInt(value, 10);\n }\n return value;\n}\n\n$(\"[waterfall]\").each(function (index) {\n const $this = $(this);\n const name = getAttr($this, \"waterfall\", `Swiper ${index}`);\n const debug = getAttr($this, \"debug-mode\", false);\n\n console.log(\"Running in\", debug ? \"debug mode\" : \"normal mode\");\n\n function printDebug(str, el) {\n if (!debug) return;\n console.log(str, \": \", el);\n }\n\n const swiperConfig = {\n a11y: {\n prevSlideMessage: getAttr($this, \"a11y-prev-message\", \"Previous Slide\"),\n nextSlideMessage: getAttr($this, \"a11y-next-message\", \"Next Slide\"),\n },\n allowSlideNext: getAttr($this, \"allow-slide-next\", true),\n allowSlidePrev: getAttr($this, \"allow-slide-prev\", true),\n allowTouchMove: getAttr($this, \"allow-touch-move\", true),\n autoHeight: getAttr($this, \"auto-height\", false),\n breakpoints: {\n 478: {\n centeredSlides: getAttr($this, \"lmobile-centered-slides\", false),\n slidesPerView: getAttr($this, \"lmobile-slides-per-view\", \"auto\"),\n spaceBetween: getAttr($this, \"lmobile-space-between\", 10),\n },\n 767: {\n centeredSlides: getAttr($this, \"tablet-centered-slides\", false),\n slidesPerView: getAttr($this, \"tablet-slides-per-view\", \"auto\"),\n spaceBetween: getAttr($this, \"tablet-space-between\", 10),\n },\n 991: {\n centeredSlides: getAttr($this, \"desktop-centered-slides\", false),\n slidesPerView: getAttr($this, \"desktop-slides-per-view\", \"auto\"),\n spaceBetween: getAttr($this, \"desktop-space-between\", 10),\n },\n 1280: {\n centeredSlides: getAttr($this, \"large-centered-slides\", false),\n slidesPerView: getAttr($this, \"large-slides-per-view\", \"auto\"),\n spaceBetween: getAttr($this, \"large-space-between\", 10),\n },\n 1440: {\n centeredSlides: getAttr($this, \"xlarge-centered-slides\", false),\n slidesPerView: getAttr($this, \"xlarge-slides-per-view\", \"auto\"),\n spaceBetween: getAttr($this, \"xlarge-space-between\", 10),\n },\n },\n breakpointsBase: getAttr($this, \"breakpoints-base\", 'window'),\n centerInsufficientSlides: getAttr($this, \"center-insufficient-slides\", 'false'),\n centeredSlides: getAttr($this, \"centered-slides\", 'false'),\n containerModifierClass: getAttr($this, \"container-modifier-class\", 'swiper-'),\n createElements: getAttr($this, \"create-elements\", 'false'),\n cssMode: getAttr($this, \"css-mode\", 'false'),\n direction: getAttr($this, \"direction\", \"horizontal\"),\n edgeSwipeDetection: getAttr($this, \"edge-swipe-detection\", false),\n edgeSwipeThreshold: getAttr($this, \"edge-swipe-threshold\", 20),\n effect: getAttr($this, \"effect\", \"slide\"),\n enabled: getAttr($this, \"enabled\", true),\n eventsPrefix: getAttr($this, \"events-prefix\", \"swiper\"),\n focusableElements: getAttr($this, \"focusable-elements\", 'input, select, option, textarea, button, video, label'),\n // freeMode: {\n // enabled: getAttr($this, \"free-mode-enabled\", false),\n // sticky: getAttr($this, \"free-mode-sticky\", false),\n // },\n grabCursor: getAttr($this, \"grab-cursor\", false),\n //grid: null,\n //hashNavigation: null,\n //height: getAttr($this, \"height\", \"null\"),\n //history: null,\n //injectStyles: null,\n //injectStylesUrls: null,\n //lazyPreloadPrevNext: getAttr($this, \"lazy-preload-prev-next\", \"0\"),\n //lazyPreloaderClass: getAttr($this, \"lazy-preloader-class\", \"swiper-lazy-preloader\"),\n longSwipes: getAttr($this, \"long-swipes\", false),\n longSwipesMs: getAttr($this, \"long-swipes-ms\", 300),\n longSwipesRatio: getAttr($this, \"long-swipes-ratio\", 0.5),\n loop: getAttr($this, \"loop-mode\", false),\n loopAddBlankSlides: getAttr($this, \"loop-add-blank-slides\", true),\n loopAdditionalSlides: getAttr($this, \"loop-additional-slides\", 0),\n loopPreventsSliding: getAttr($this, \"loop-prevents-sliding\", true),\n maxBackfaceHiddenSlides: getAttr($this, \"max-backface-hidden-slides\", 10),\n //modules: null, // take a look at this\n //mouseWheel: null,\n //navigation: null,\n nested: getAttr($this, 'nested', 'false'),\n noSwiping: getAttr($this, 'no-swiping', 'true'),\n noSwipingClass: getAttr($this, 'no-swiping-class', 'swiper-no-swiping'),\n //noSwipingSelector: getAttr($this, 'no-swiping-selector', 'null'),\n normalizeSlideIndex: getAttr($this, \"normalize-slide-index\", true),\n observeParents: getAttr($this, 'observe-parents', 'false'),\n observeSlideChildren: getAttr($this, 'observe-slide-children', 'false'),\n //observer: null,\n //on: null,\n //onAny: null,\n oneWayMovement: getAttr($this, 'one-way-movement', 'false'),\n //pagination: null,\n //parallax: null,\n passiveListeners: getAttr($this, 'passive-listeners', 'true'),\n preventClicks: getAttr($this, 'prevent-clicks', 'true'),\n preventClicksPropagation: getAttr($this, 'prevent-clicks-propagation', 'true'),\n preventInteractionOnTransition: getAttr($this, 'prevent-interaction-on-transition', 'false'),\n resistance: getAttr($this, 'resistance', 'true'),\n resizeObserver: getAttr($this, 'resize-observer', 'true'),\n rewind: getAttr($this, 'rewind', 'false'),\n runCallbacksOnInit: getAttr($this, 'run-callbacks-on-init', 'true'),\n //scrollbar: null,\n setWrapperSize: getAttr($this, 'set-wrapper-size', 'false'),\n shortSwipes: getAttr($this, 'shortSwipes', 'true'),\n simulateTouch: getAttr($this, 'simulate-touch', 'true'),\n slideActiveClass: getAttr($this, 'slide-active-class', 'swiper-slide-active'),\n slideBlankClass: getAttr($this, 'slide-blank-class', 'swiper-slide-blank'),\n slideClass: getAttr($this, 'slide-class', 'swiper-slide'),\n slideFullyVisibleClass: getAttr($this, 'slide-fully-visible-class', 'swiper-slide-fully-visible'),\n slideNextClass: getAttr($this, 'slide-next-class', 'swiper-slide-next'),\n slidePrevClass: getAttr($this, 'slide-prev-class', 'swiper-slide-prev'),\n slideToClickedSlide: getAttr($this, 'slide-to-clicked-slide', 'false'),\n slideVisibleClass: getAttr($this, 'slide-visible-class', 'swiper-slide-visible'),\n slidesOffsetAfter: getAttr($this, 'slides-offset-after', 0),\n slidesOffsetBefore: getAttr($this, 'slides-offset-before', 0),\n slidesPerGroup: getAttr($this, 'slides-per-group', 1),\n slidesPerGroupAuto: getAttr($this, 'slides-per-group-auto', 'false'),\n slidesPerGroupSkip: getAttr($this, 'slides-per-group-skip', 0),\n slidesPerView: getAttr($this, \"slides-per-view\", 1),\n spaceBetween: getAttr($this, \"space-between\", 0),\n speed: getAttr($this, \"speed\", 300),\n //swipeHandler: getAttr($this, \"swipe-handler\", null),\n swiperElementNodeName: getAttr($this, \"swiper-element-node-name\", \"SWIPER-CONTAINER\"),\n threshold: getAttr($this, \"threshold\", 5),\n //thumbs: null,\n touchAngle: getAttr($this, \"touch-angle\", 45),\n touchEventsTarget: getAttr($this, \"touch-events-target\", \"wrapper\"),\n touchMoveStopPropagation: getAttr($this, \"touch-move-stop-propagation\", false),\n touchRatio: getAttr($this, \"touch-ratio\", 1),\n touchReleaseOnEdges: getAttr($this, \"touch-release-on-edges\", false),\n touchStartForcePreventDefault: getAttr($this, \"touch-start-force-prevent-default\", false),\n touchStartPreventDefault: getAttr($this, \"touch-start-prevent-default\", true),\n uniqueNavElements: getAttr($this, \"unique-nav-elements\", true),\n updateOnWindowResize: getAttr($this, \"update-on-window-resize\", true),\n //url: getAttr($this, \"url\", \"null\"),\n //userAgent: getAttr($this, \"user-agent\", \"null\"),\n //virtual: null,\n virtualTranslate: getAttr($this, \"virtual-translate\", false),\n watchOverflow: getAttr($this, \"watch-overflow\", true),\n watchSlidesProgress: getAttr($this, \"watch-slides-progress\", false),\n //width: getAttr($this, \"width\", \"null\"),\n wrapperClass: getAttr($this, \"wrapper-class\", \"swiper-wrapper\"),\n //zoom: null,\n };\n\n //------- Modules --------------------------------\n const autoplayMode = getAttr($this, \"autoplay-mode\", false);\n printDebug(\"AUTOPLAY MODE\", autoplayMode);\n\n const paginationMode = getAttr($this, \"pagination-mode\", false);\n printDebug(\"PAGINATION MODE\", paginationMode);\n\n const navigationMode = getAttr($this, \"navigation-mode\", false);\n printDebug(\"NAVIGATION MODE\", navigationMode);\n\n const scrollbarMode = getAttr($this, \"scrollbar-mode\", false);\n printDebug(\"SCROLLBAR MODE\", scrollbarMode);\n\n // AUTOPLAY\n if (autoplayMode) {\n swiperConfig.autoplay = {\n delay: getAttr($this, \"delay\", 0),\n disableOnInteraction: getAttr($this, \"disable-on-interaction\", false),\n reverseDirection: getAttr($this, \"reverse-direction\", false),\n pauseOnMouseEnter: getAttr($this, \"pause-on-mouse-enter\", false),\n stopOnLastSlide: getAttr($this, \"stop-on-last-slide\", false),\n };\n // Add CSS for Smooth Autoplay\n $(\"[smoothautoplay='true']\").find(\".swiper-wrapper\").css(\"transition-timing-function\", \"linear\");\n }\n\n // PAGINATION\n const paginationEl = $this.find(\"[waterfall-el='pagination']\")[0];\n let paginationType = getAttr($this, \"pagination-type\", \"bullets\");\n printDebug(\"PAGINATION\", paginationEl);\n printDebug(\"PAGINATION TYPE\", paginationType);\n printDebug(\"BULLET CLASS\", $this.find(\"[waterfall-el='pagination-bullet']\").attr(\"class\"));\n printDebug(\"BULLET ACTIVE CLASS\", getAttr($this, \"bullet-active-class\", \"swiper-pagination-bullet-active\"));\n\n let bulletRenderFn;\n if (paginationType === \"numberBullets\") {\n bulletRenderFn = function (index, className) {\n return `<span class=\"${className}\">${index + 1}</span>`;\n }\n }\n\n if (paginationType === \"bullets\") {\n bulletRenderFn = function (index, className) {\n return `<span class=\"${className}\"></span>`;\n }\n }\n\n // Convert type back to bullets\n if (paginationType === \"numberBullets\") paginationType = \"bullets\";\n\n if (paginationMode) {\n swiperConfig.pagination = {\n el: paginationEl,\n clickable: getAttr($this, \"pagination-clickable\", true),\n bulletClass: $this.find(\"[waterfall-el='pagination-bullet']\").attr(\"class\"),\n bulletActiveClass: getAttr($this, \"bullet-active-class\", \"swiper-pagination-bullet-active\"),\n type: paginationType,\n dynamicBullets: false,\n renderBullet: bulletRenderFn,\n };\n }\n\n // NAVIGATION\n if (navigationMode) {\n swiperConfig.navigation = {\n nextEl: $this.find(\"[waterfall-el='next']\")[0],\n prevEl: $this.find(\"[waterfall-el='prev']\")[0],\n };\n printDebug(\"NEXT BUTTON\", swiperConfig.navigation.nextEl);\n printDebug(\"PREV BUTTON\", swiperConfig.navigation.prevEl);\n }\n\n // SCROLLBAR\n const scrollbarEl = $this.find(\"[waterfall-el='scrollbar']\")[0];\n printDebug(\"SCROLLBAR\", scrollbarEl);\n const scrollbarDrag = $(scrollbarEl).find(\"[waterfall-el='scrollbar-drag']\")[0];\n printDebug(\"SCROLLBAR DRAG\", scrollbarDrag);\n\n if (scrollbarMode) {\n swiperConfig.scrollbar = {\n dragClass: $(scrollbarDrag).attr(\"class\"),\n dragSize: getAttr($this, \"drag-size\", \"auto\"),\n draggable: getAttr($this, \"draggable\", true),\n el: scrollbarEl,\n enabled: getAttr($this, \"scrollbar-enabled\", true),\n hide: getAttr($this, \"scrollbar-hide\", true),\n horizontalClass: getAttr($this, \"scrollbar-horizontal-class\", \"swiper-scrollbar-horizontal\"),\n lockClass: getAttr($this, \"scrollbar-lock-class\", \"swiper-scrollbar-lock\"),\n scrollbarDisabledClass: getAttr($this, \"scrollbar-disabled-class\", \"swiper-scrollbar-disabled\"),\n snapOnRelease: getAttr($this, \"snap-on-release\", false),\n verticalClass: getAttr($this, \"scrollbar-vertical-class\", \"swiper-scrollbar-vertical\"),\n };\n }\n\n console.log(swiperConfig);\n\n // Initialize swiper\n const swiper = new swiper_bundle__WEBPACK_IMPORTED_MODULE_0__[\"default\"]($this.find(\".swiper\")[0], swiperConfig);\n\n sliders.push({ name, slider: swiper });\n});\n\n\n//# sourceURL=webpack://Waterfall/./src/waterfall.js?");
139
+ 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\");\nconsole.log(\"🚿 Hello from Wellflow Waterfall \" + process.env.VERSION);\n\n\n\n\nconst sliders = [];\n\n// Helper function to get an attribute with type conversion\nfunction getAttr(el, attrName, defaultValue) {\n const value = $(el).attr(attrName);\n console.log(attrName, value, defaultValue, typeof defaultValue, typeof value);\n if (value === undefined || value === null) return defaultValue;\n\n if (typeof defaultValue === \"boolean\") {\n return value;\n }\n if (typeof defaultValue === \"number\") {\n return parseInt(value, 10);\n }\n return value;\n}\n\n$(\"[waterfall]\").each(function (index) {\n const $this = $(this);\n const name = getAttr($this, \"waterfall\", `Swiper ${index}`);\n const debug = getAttr($this, \"debug-mode\", false);\n\n console.log(\"Running in\", debug ? \"debug mode\" : \"normal mode\");\n\n function printDebug(str, el) {\n if (!debug) return;\n console.log(str, \": \", el);\n }\n\n const swiperConfig = {\n // a11y: {\n // prevSlideMessage: getAttr($this, \"a11y-prev-message\", \"Previous Slide\"),\n // nextSlideMessage: getAttr($this, \"a11y-next-message\", \"Next Slide\"),\n // },\n // allowSlideNext: getAttr($this, \"allow-slide-next\", true),\n // allowSlidePrev: getAttr($this, \"allow-slide-prev\", true),\n // allowTouchMove: getAttr($this, \"allow-touch-move\", true),\n // autoHeight: getAttr($this, \"auto-height\", false),\n // breakpoints: {\n // 478: {\n // centeredSlides: getAttr($this, \"lmobile-centered-slides\", false),\n // slidesPerView: getAttr($this, \"lmobile-slides-per-view\", \"auto\"),\n // spaceBetween: getAttr($this, \"lmobile-space-between\", 10),\n // },\n // 767: {\n // centeredSlides: getAttr($this, \"tablet-centered-slides\", false),\n // slidesPerView: getAttr($this, \"tablet-slides-per-view\", \"auto\"),\n // spaceBetween: getAttr($this, \"tablet-space-between\", 10),\n // },\n // 991: {\n // centeredSlides: getAttr($this, \"desktop-centered-slides\", false),\n // slidesPerView: getAttr($this, \"desktop-slides-per-view\", \"auto\"),\n // spaceBetween: getAttr($this, \"desktop-space-between\", 10),\n // },\n // 1280: {\n // centeredSlides: getAttr($this, \"large-centered-slides\", false),\n // slidesPerView: getAttr($this, \"large-slides-per-view\", \"auto\"),\n // spaceBetween: getAttr($this, \"large-space-between\", 10),\n // },\n // 1440: {\n // centeredSlides: getAttr($this, \"xlarge-centered-slides\", false),\n // slidesPerView: getAttr($this, \"xlarge-slides-per-view\", \"auto\"),\n // spaceBetween: getAttr($this, \"xlarge-space-between\", 10),\n // },\n // },\n // breakpointsBase: getAttr($this, \"breakpoints-base\", 'window'),\n // centerInsufficientSlides: getAttr($this, \"center-insufficient-slides\", 'false'),\n centeredSlides: getAttr($this, \"centered-slides\", 'false'),\n // containerModifierClass: getAttr($this, \"container-modifier-class\", 'swiper-'),\n // createElements: getAttr($this, \"create-elements\", 'false'),\n // cssMode: getAttr($this, \"css-mode\", 'false'),\n // direction: getAttr($this, \"direction\", \"horizontal\"),\n // edgeSwipeDetection: getAttr($this, \"edge-swipe-detection\", false),\n // edgeSwipeThreshold: getAttr($this, \"edge-swipe-threshold\", 20),\n // effect: getAttr($this, \"effect\", \"slide\"),\n // enabled: getAttr($this, \"enabled\", true),\n // eventsPrefix: getAttr($this, \"events-prefix\", \"swiper\"),\n // focusableElements: getAttr($this, \"focusable-elements\", 'input, select, option, textarea, button, video, label'),\n // freeMode: {\n // enabled: getAttr($this, \"free-mode-enabled\", false),\n // sticky: getAttr($this, \"free-mode-sticky\", false),\n // },\n // grabCursor: getAttr($this, \"grab-cursor\", false),\n //grid: null,\n //hashNavigation: null,\n //height: getAttr($this, \"height\", \"null\"),\n //history: null,\n //injectStyles: null,\n //injectStylesUrls: null,\n //lazyPreloadPrevNext: getAttr($this, \"lazy-preload-prev-next\", \"0\"),\n //lazyPreloaderClass: getAttr($this, \"lazy-preloader-class\", \"swiper-lazy-preloader\"),\n // longSwipes: getAttr($this, \"long-swipes\", false),\n // longSwipesMs: getAttr($this, \"long-swipes-ms\", 300),\n // longSwipesRatio: getAttr($this, \"long-swipes-ratio\", 0.5),\n loop: getAttr($this, \"loop-mode\", false),\n // loopAddBlankSlides: getAttr($this, \"loop-add-blank-slides\", true),\n // loopAdditionalSlides: getAttr($this, \"loop-additional-slides\", 0),\n // loopPreventsSliding: getAttr($this, \"loop-prevents-sliding\", true),\n // maxBackfaceHiddenSlides: getAttr($this, \"max-backface-hidden-slides\", 10),\n //modules: null, // take a look at this\n //mouseWheel: null,\n //navigation: null,\n // nested: getAttr($this, 'nested', 'false'),\n // noSwiping: getAttr($this, 'no-swiping', 'true'),\n // noSwipingClass: getAttr($this, 'no-swiping-class', 'swiper-no-swiping'),\n //noSwipingSelector: getAttr($this, 'no-swiping-selector', 'null'),\n // normalizeSlideIndex: getAttr($this, \"normalize-slide-index\", true),\n // observeParents: getAttr($this, 'observe-parents', 'false'),\n // observeSlideChildren: getAttr($this, 'observe-slide-children', 'false'),\n //observer: null,\n //on: null,\n //onAny: null,\n //oneWayMovement: getAttr($this, 'one-way-movement', 'false'),\n //pagination: null,\n //parallax: null,\n // passiveListeners: getAttr($this, 'passive-listeners', 'true'),\n // preventClicks: getAttr($this, 'prevent-clicks', 'true'),\n // preventClicksPropagation: getAttr($this, 'prevent-clicks-propagation', 'true'),\n // preventInteractionOnTransition: getAttr($this, 'prevent-interaction-on-transition', 'false'),\n // resistance: getAttr($this, 'resistance', 'true'),\n // resizeObserver: getAttr($this, 'resize-observer', 'true'),\n // rewind: getAttr($this, 'rewind', 'false'),\n // runCallbacksOnInit: getAttr($this, 'run-callbacks-on-init', 'true'),\n //scrollbar: null,\n // setWrapperSize: getAttr($this, 'set-wrapper-size', 'false'),\n // shortSwipes: getAttr($this, 'shortSwipes', 'true'),\n // simulateTouch: getAttr($this, 'simulate-touch', 'true'),\n // slideActiveClass: getAttr($this, 'slide-active-class', 'swiper-slide-active'),\n // slideBlankClass: getAttr($this, 'slide-blank-class', 'swiper-slide-blank'),\n // slideClass: getAttr($this, 'slide-class', 'swiper-slide'),\n // slideFullyVisibleClass: getAttr($this, 'slide-fully-visible-class', 'swiper-slide-fully-visible'),\n // slideNextClass: getAttr($this, 'slide-next-class', 'swiper-slide-next'),\n // slidePrevClass: getAttr($this, 'slide-prev-class', 'swiper-slide-prev'),\n // slideToClickedSlide: getAttr($this, 'slide-to-clicked-slide', 'false'),\n // slideVisibleClass: getAttr($this, 'slide-visible-class', 'swiper-slide-visible'),\n // slidesOffsetAfter: getAttr($this, 'slides-offset-after', 0),\n // slidesOffsetBefore: getAttr($this, 'slides-offset-before', 0),\n // slidesPerGroup: getAttr($this, 'slides-per-group', 1),\n // slidesPerGroupAuto: getAttr($this, 'slides-per-group-auto', 'false'),\n // slidesPerGroupSkip: getAttr($this, 'slides-per-group-skip', 0),\n slidesPerView: getAttr($this, \"slides-per-view\", 1),\n spaceBetween: getAttr($this, \"space-between\", 0),\n speed: getAttr($this, \"speed\", 300),\n //swipeHandler: getAttr($this, \"swipe-handler\", null),\n // swiperElementNodeName: getAttr($this, \"swiper-element-node-name\", \"SWIPER-CONTAINER\"),\n // threshold: getAttr($this, \"threshold\", 5),\n // //thumbs: null,\n // touchAngle: getAttr($this, \"touch-angle\", 45),\n // touchEventsTarget: getAttr($this, \"touch-events-target\", \"wrapper\"),\n // touchMoveStopPropagation: getAttr($this, \"touch-move-stop-propagation\", false),\n // touchRatio: getAttr($this, \"touch-ratio\", 1),\n // touchReleaseOnEdges: getAttr($this, \"touch-release-on-edges\", false),\n // touchStartForcePreventDefault: getAttr($this, \"touch-start-force-prevent-default\", false),\n // touchStartPreventDefault: getAttr($this, \"touch-start-prevent-default\", true),\n // uniqueNavElements: getAttr($this, \"unique-nav-elements\", true),\n //updateOnWindowResize: getAttr($this, \"update-on-window-resize\", true),\n //url: getAttr($this, \"url\", \"null\"),\n //userAgent: getAttr($this, \"user-agent\", \"null\"),\n //virtual: null,\n //virtualTranslate: getAttr($this, \"virtual-translate\", false),\n //watchOverflow: getAttr($this, \"watch-overflow\", true),\n //watchSlidesProgress: getAttr($this, \"watch-slides-progress\", false),\n //width: getAttr($this, \"width\", \"null\"),\n //wrapperClass: getAttr($this, \"wrapper-class\", \"swiper-wrapper\"),\n //zoom: null,\n };\n\n //------- Modules --------------------------------\n const autoplayMode = getAttr($this, \"autoplay-mode\", false);\n printDebug(\"AUTOPLAY MODE\", autoplayMode);\n\n const paginationMode = getAttr($this, \"pagination-mode\", false);\n printDebug(\"PAGINATION MODE\", paginationMode);\n\n const navigationMode = getAttr($this, \"navigation-mode\", false);\n printDebug(\"NAVIGATION MODE\", navigationMode);\n\n const scrollbarMode = getAttr($this, \"scrollbar-mode\", false);\n printDebug(\"SCROLLBAR MODE\", scrollbarMode);\n\n // AUTOPLAY\n if (autoplayMode) {\n swiperConfig.autoplay = {\n delay: getAttr($this, \"delay\", 0),\n disableOnInteraction: getAttr($this, \"disable-on-interaction\", false),\n reverseDirection: getAttr($this, \"reverse-direction\", false),\n pauseOnMouseEnter: getAttr($this, \"pause-on-mouse-enter\", false),\n stopOnLastSlide: getAttr($this, \"stop-on-last-slide\", false),\n };\n // Add CSS for Smooth Autoplay\n $(\"[smoothautoplay='true']\").find(\".swiper-wrapper\").css(\"transition-timing-function\", \"linear\");\n }\n\n // PAGINATION\n const paginationEl = $this.find(\"[waterfall-el='pagination']\")[0];\n let paginationType = getAttr($this, \"pagination-type\", \"bullets\");\n printDebug(\"PAGINATION\", paginationEl);\n printDebug(\"PAGINATION TYPE\", paginationType);\n printDebug(\"BULLET CLASS\", $this.find(\"[waterfall-el='pagination-bullet']\").attr(\"class\"));\n printDebug(\"BULLET ACTIVE CLASS\", getAttr($this, \"bullet-active-class\", \"swiper-pagination-bullet-active\"));\n\n let bulletRenderFn;\n if (paginationType === \"numberBullets\") {\n bulletRenderFn = function (index, className) {\n return `<span class=\"${className}\">${index + 1}</span>`;\n }\n }\n\n if (paginationType === \"bullets\") {\n bulletRenderFn = function (index, className) {\n return `<span class=\"${className}\"></span>`;\n }\n }\n\n // Convert type back to bullets\n if (paginationType === \"numberBullets\") paginationType = \"bullets\";\n\n if (paginationMode) {\n swiperConfig.pagination = {\n el: paginationEl,\n clickable: getAttr($this, \"pagination-clickable\", true),\n bulletClass: $this.find(\"[waterfall-el='pagination-bullet']\").attr(\"class\"),\n bulletActiveClass: getAttr($this, \"bullet-active-class\", \"swiper-pagination-bullet-active\"),\n type: paginationType,\n dynamicBullets: false,\n renderBullet: bulletRenderFn,\n };\n }\n\n // NAVIGATION\n if (navigationMode) {\n swiperConfig.navigation = {\n nextEl: $this.find(\"[waterfall-el='next']\")[0],\n prevEl: $this.find(\"[waterfall-el='prev']\")[0],\n };\n printDebug(\"NEXT BUTTON\", swiperConfig.navigation.nextEl);\n printDebug(\"PREV BUTTON\", swiperConfig.navigation.prevEl);\n }\n\n // SCROLLBAR\n const scrollbarEl = $this.find(\"[waterfall-el='scrollbar']\")[0];\n printDebug(\"SCROLLBAR\", scrollbarEl);\n const scrollbarDrag = $(scrollbarEl).find(\"[waterfall-el='scrollbar-drag']\")[0];\n printDebug(\"SCROLLBAR DRAG\", scrollbarDrag);\n\n if (scrollbarMode) {\n swiperConfig.scrollbar = {\n dragClass: $(scrollbarDrag).attr(\"class\"),\n dragSize: getAttr($this, \"drag-size\", \"auto\"),\n draggable: getAttr($this, \"draggable\", true),\n el: scrollbarEl,\n enabled: getAttr($this, \"scrollbar-enabled\", true),\n hide: getAttr($this, \"scrollbar-hide\", true),\n horizontalClass: getAttr($this, \"scrollbar-horizontal-class\", \"swiper-scrollbar-horizontal\"),\n lockClass: getAttr($this, \"scrollbar-lock-class\", \"swiper-scrollbar-lock\"),\n scrollbarDisabledClass: getAttr($this, \"scrollbar-disabled-class\", \"swiper-scrollbar-disabled\"),\n snapOnRelease: getAttr($this, \"snap-on-release\", false),\n verticalClass: getAttr($this, \"scrollbar-vertical-class\", \"swiper-scrollbar-vertical\"),\n };\n }\n\n console.log(swiperConfig);\n\n // Initialize swiper\n const swiper = new swiper_bundle__WEBPACK_IMPORTED_MODULE_0__[\"default\"]($this.find(\".swiper\")[0], swiperConfig);\n\n sliders.push({ name, slider: swiper });\n});\n\n\n//# sourceURL=webpack://Waterfall/./src/waterfall.js?");
140
140
 
141
141
  /***/ }),
142
142
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "well-waterfall",
3
- "version": "0.0.39",
3
+ "version": "0.0.40",
4
4
  "description": "An attribute-based wrapper of SwiperJS for Webflow",
5
5
  "main": "waterfall.js",
6
6
  "scripts": {
package/src/waterfall.js CHANGED
@@ -1,4 +1,4 @@
1
- console.log("🚿 Hello from Wellflow Waterfall");
1
+ console.log("🚿 Hello from Wellflow Waterfall " + process.env.VERSION);
2
2
 
3
3
  import Swiper from 'swiper/bundle';
4
4
  import 'swiper/css/bundle';
@@ -8,7 +8,7 @@ const sliders = [];
8
8
  // Helper function to get an attribute with type conversion
9
9
  function getAttr(el, attrName, defaultValue) {
10
10
  const value = $(el).attr(attrName);
11
- console.log(attrName, value, defaultValue, typeof defaultValue, value === true);
11
+ console.log(attrName, value, defaultValue, typeof defaultValue, typeof value);
12
12
  if (value === undefined || value === null) return defaultValue;
13
13
 
14
14
  if (typeof defaultValue === "boolean") {
@@ -33,59 +33,59 @@ $("[waterfall]").each(function (index) {
33
33
  }
34
34
 
35
35
  const swiperConfig = {
36
- a11y: {
37
- prevSlideMessage: getAttr($this, "a11y-prev-message", "Previous Slide"),
38
- nextSlideMessage: getAttr($this, "a11y-next-message", "Next Slide"),
39
- },
40
- allowSlideNext: getAttr($this, "allow-slide-next", true),
41
- allowSlidePrev: getAttr($this, "allow-slide-prev", true),
42
- allowTouchMove: getAttr($this, "allow-touch-move", true),
43
- autoHeight: getAttr($this, "auto-height", false),
44
- breakpoints: {
45
- 478: {
46
- centeredSlides: getAttr($this, "lmobile-centered-slides", false),
47
- slidesPerView: getAttr($this, "lmobile-slides-per-view", "auto"),
48
- spaceBetween: getAttr($this, "lmobile-space-between", 10),
49
- },
50
- 767: {
51
- centeredSlides: getAttr($this, "tablet-centered-slides", false),
52
- slidesPerView: getAttr($this, "tablet-slides-per-view", "auto"),
53
- spaceBetween: getAttr($this, "tablet-space-between", 10),
54
- },
55
- 991: {
56
- centeredSlides: getAttr($this, "desktop-centered-slides", false),
57
- slidesPerView: getAttr($this, "desktop-slides-per-view", "auto"),
58
- spaceBetween: getAttr($this, "desktop-space-between", 10),
59
- },
60
- 1280: {
61
- centeredSlides: getAttr($this, "large-centered-slides", false),
62
- slidesPerView: getAttr($this, "large-slides-per-view", "auto"),
63
- spaceBetween: getAttr($this, "large-space-between", 10),
64
- },
65
- 1440: {
66
- centeredSlides: getAttr($this, "xlarge-centered-slides", false),
67
- slidesPerView: getAttr($this, "xlarge-slides-per-view", "auto"),
68
- spaceBetween: getAttr($this, "xlarge-space-between", 10),
69
- },
70
- },
71
- breakpointsBase: getAttr($this, "breakpoints-base", 'window'),
72
- centerInsufficientSlides: getAttr($this, "center-insufficient-slides", 'false'),
36
+ // a11y: {
37
+ // prevSlideMessage: getAttr($this, "a11y-prev-message", "Previous Slide"),
38
+ // nextSlideMessage: getAttr($this, "a11y-next-message", "Next Slide"),
39
+ // },
40
+ // allowSlideNext: getAttr($this, "allow-slide-next", true),
41
+ // allowSlidePrev: getAttr($this, "allow-slide-prev", true),
42
+ // allowTouchMove: getAttr($this, "allow-touch-move", true),
43
+ // autoHeight: getAttr($this, "auto-height", false),
44
+ // breakpoints: {
45
+ // 478: {
46
+ // centeredSlides: getAttr($this, "lmobile-centered-slides", false),
47
+ // slidesPerView: getAttr($this, "lmobile-slides-per-view", "auto"),
48
+ // spaceBetween: getAttr($this, "lmobile-space-between", 10),
49
+ // },
50
+ // 767: {
51
+ // centeredSlides: getAttr($this, "tablet-centered-slides", false),
52
+ // slidesPerView: getAttr($this, "tablet-slides-per-view", "auto"),
53
+ // spaceBetween: getAttr($this, "tablet-space-between", 10),
54
+ // },
55
+ // 991: {
56
+ // centeredSlides: getAttr($this, "desktop-centered-slides", false),
57
+ // slidesPerView: getAttr($this, "desktop-slides-per-view", "auto"),
58
+ // spaceBetween: getAttr($this, "desktop-space-between", 10),
59
+ // },
60
+ // 1280: {
61
+ // centeredSlides: getAttr($this, "large-centered-slides", false),
62
+ // slidesPerView: getAttr($this, "large-slides-per-view", "auto"),
63
+ // spaceBetween: getAttr($this, "large-space-between", 10),
64
+ // },
65
+ // 1440: {
66
+ // centeredSlides: getAttr($this, "xlarge-centered-slides", false),
67
+ // slidesPerView: getAttr($this, "xlarge-slides-per-view", "auto"),
68
+ // spaceBetween: getAttr($this, "xlarge-space-between", 10),
69
+ // },
70
+ // },
71
+ // breakpointsBase: getAttr($this, "breakpoints-base", 'window'),
72
+ // centerInsufficientSlides: getAttr($this, "center-insufficient-slides", 'false'),
73
73
  centeredSlides: getAttr($this, "centered-slides", 'false'),
74
- containerModifierClass: getAttr($this, "container-modifier-class", 'swiper-'),
75
- createElements: getAttr($this, "create-elements", 'false'),
76
- cssMode: getAttr($this, "css-mode", 'false'),
77
- direction: getAttr($this, "direction", "horizontal"),
78
- edgeSwipeDetection: getAttr($this, "edge-swipe-detection", false),
79
- edgeSwipeThreshold: getAttr($this, "edge-swipe-threshold", 20),
80
- effect: getAttr($this, "effect", "slide"),
81
- enabled: getAttr($this, "enabled", true),
82
- eventsPrefix: getAttr($this, "events-prefix", "swiper"),
83
- focusableElements: getAttr($this, "focusable-elements", 'input, select, option, textarea, button, video, label'),
74
+ // containerModifierClass: getAttr($this, "container-modifier-class", 'swiper-'),
75
+ // createElements: getAttr($this, "create-elements", 'false'),
76
+ // cssMode: getAttr($this, "css-mode", 'false'),
77
+ // direction: getAttr($this, "direction", "horizontal"),
78
+ // edgeSwipeDetection: getAttr($this, "edge-swipe-detection", false),
79
+ // edgeSwipeThreshold: getAttr($this, "edge-swipe-threshold", 20),
80
+ // effect: getAttr($this, "effect", "slide"),
81
+ // enabled: getAttr($this, "enabled", true),
82
+ // eventsPrefix: getAttr($this, "events-prefix", "swiper"),
83
+ // focusableElements: getAttr($this, "focusable-elements", 'input, select, option, textarea, button, video, label'),
84
84
  // freeMode: {
85
85
  // enabled: getAttr($this, "free-mode-enabled", false),
86
86
  // sticky: getAttr($this, "free-mode-sticky", false),
87
87
  // },
88
- grabCursor: getAttr($this, "grab-cursor", false),
88
+ // grabCursor: getAttr($this, "grab-cursor", false),
89
89
  //grid: null,
90
90
  //hashNavigation: null,
91
91
  //height: getAttr($this, "height", "null"),
@@ -94,79 +94,79 @@ $("[waterfall]").each(function (index) {
94
94
  //injectStylesUrls: null,
95
95
  //lazyPreloadPrevNext: getAttr($this, "lazy-preload-prev-next", "0"),
96
96
  //lazyPreloaderClass: getAttr($this, "lazy-preloader-class", "swiper-lazy-preloader"),
97
- longSwipes: getAttr($this, "long-swipes", false),
98
- longSwipesMs: getAttr($this, "long-swipes-ms", 300),
99
- longSwipesRatio: getAttr($this, "long-swipes-ratio", 0.5),
97
+ // longSwipes: getAttr($this, "long-swipes", false),
98
+ // longSwipesMs: getAttr($this, "long-swipes-ms", 300),
99
+ // longSwipesRatio: getAttr($this, "long-swipes-ratio", 0.5),
100
100
  loop: getAttr($this, "loop-mode", false),
101
- loopAddBlankSlides: getAttr($this, "loop-add-blank-slides", true),
102
- loopAdditionalSlides: getAttr($this, "loop-additional-slides", 0),
103
- loopPreventsSliding: getAttr($this, "loop-prevents-sliding", true),
104
- maxBackfaceHiddenSlides: getAttr($this, "max-backface-hidden-slides", 10),
101
+ // loopAddBlankSlides: getAttr($this, "loop-add-blank-slides", true),
102
+ // loopAdditionalSlides: getAttr($this, "loop-additional-slides", 0),
103
+ // loopPreventsSliding: getAttr($this, "loop-prevents-sliding", true),
104
+ // maxBackfaceHiddenSlides: getAttr($this, "max-backface-hidden-slides", 10),
105
105
  //modules: null, // take a look at this
106
106
  //mouseWheel: null,
107
107
  //navigation: null,
108
- nested: getAttr($this, 'nested', 'false'),
109
- noSwiping: getAttr($this, 'no-swiping', 'true'),
110
- noSwipingClass: getAttr($this, 'no-swiping-class', 'swiper-no-swiping'),
108
+ // nested: getAttr($this, 'nested', 'false'),
109
+ // noSwiping: getAttr($this, 'no-swiping', 'true'),
110
+ // noSwipingClass: getAttr($this, 'no-swiping-class', 'swiper-no-swiping'),
111
111
  //noSwipingSelector: getAttr($this, 'no-swiping-selector', 'null'),
112
- normalizeSlideIndex: getAttr($this, "normalize-slide-index", true),
113
- observeParents: getAttr($this, 'observe-parents', 'false'),
114
- observeSlideChildren: getAttr($this, 'observe-slide-children', 'false'),
112
+ // normalizeSlideIndex: getAttr($this, "normalize-slide-index", true),
113
+ // observeParents: getAttr($this, 'observe-parents', 'false'),
114
+ // observeSlideChildren: getAttr($this, 'observe-slide-children', 'false'),
115
115
  //observer: null,
116
116
  //on: null,
117
117
  //onAny: null,
118
- oneWayMovement: getAttr($this, 'one-way-movement', 'false'),
118
+ //oneWayMovement: getAttr($this, 'one-way-movement', 'false'),
119
119
  //pagination: null,
120
120
  //parallax: null,
121
- passiveListeners: getAttr($this, 'passive-listeners', 'true'),
122
- preventClicks: getAttr($this, 'prevent-clicks', 'true'),
123
- preventClicksPropagation: getAttr($this, 'prevent-clicks-propagation', 'true'),
124
- preventInteractionOnTransition: getAttr($this, 'prevent-interaction-on-transition', 'false'),
125
- resistance: getAttr($this, 'resistance', 'true'),
126
- resizeObserver: getAttr($this, 'resize-observer', 'true'),
127
- rewind: getAttr($this, 'rewind', 'false'),
128
- runCallbacksOnInit: getAttr($this, 'run-callbacks-on-init', 'true'),
121
+ // passiveListeners: getAttr($this, 'passive-listeners', 'true'),
122
+ // preventClicks: getAttr($this, 'prevent-clicks', 'true'),
123
+ // preventClicksPropagation: getAttr($this, 'prevent-clicks-propagation', 'true'),
124
+ // preventInteractionOnTransition: getAttr($this, 'prevent-interaction-on-transition', 'false'),
125
+ // resistance: getAttr($this, 'resistance', 'true'),
126
+ // resizeObserver: getAttr($this, 'resize-observer', 'true'),
127
+ // rewind: getAttr($this, 'rewind', 'false'),
128
+ // runCallbacksOnInit: getAttr($this, 'run-callbacks-on-init', 'true'),
129
129
  //scrollbar: null,
130
- setWrapperSize: getAttr($this, 'set-wrapper-size', 'false'),
131
- shortSwipes: getAttr($this, 'shortSwipes', 'true'),
132
- simulateTouch: getAttr($this, 'simulate-touch', 'true'),
133
- slideActiveClass: getAttr($this, 'slide-active-class', 'swiper-slide-active'),
134
- slideBlankClass: getAttr($this, 'slide-blank-class', 'swiper-slide-blank'),
135
- slideClass: getAttr($this, 'slide-class', 'swiper-slide'),
136
- slideFullyVisibleClass: getAttr($this, 'slide-fully-visible-class', 'swiper-slide-fully-visible'),
137
- slideNextClass: getAttr($this, 'slide-next-class', 'swiper-slide-next'),
138
- slidePrevClass: getAttr($this, 'slide-prev-class', 'swiper-slide-prev'),
139
- slideToClickedSlide: getAttr($this, 'slide-to-clicked-slide', 'false'),
140
- slideVisibleClass: getAttr($this, 'slide-visible-class', 'swiper-slide-visible'),
141
- slidesOffsetAfter: getAttr($this, 'slides-offset-after', 0),
142
- slidesOffsetBefore: getAttr($this, 'slides-offset-before', 0),
143
- slidesPerGroup: getAttr($this, 'slides-per-group', 1),
144
- slidesPerGroupAuto: getAttr($this, 'slides-per-group-auto', 'false'),
145
- slidesPerGroupSkip: getAttr($this, 'slides-per-group-skip', 0),
130
+ // setWrapperSize: getAttr($this, 'set-wrapper-size', 'false'),
131
+ // shortSwipes: getAttr($this, 'shortSwipes', 'true'),
132
+ // simulateTouch: getAttr($this, 'simulate-touch', 'true'),
133
+ // slideActiveClass: getAttr($this, 'slide-active-class', 'swiper-slide-active'),
134
+ // slideBlankClass: getAttr($this, 'slide-blank-class', 'swiper-slide-blank'),
135
+ // slideClass: getAttr($this, 'slide-class', 'swiper-slide'),
136
+ // slideFullyVisibleClass: getAttr($this, 'slide-fully-visible-class', 'swiper-slide-fully-visible'),
137
+ // slideNextClass: getAttr($this, 'slide-next-class', 'swiper-slide-next'),
138
+ // slidePrevClass: getAttr($this, 'slide-prev-class', 'swiper-slide-prev'),
139
+ // slideToClickedSlide: getAttr($this, 'slide-to-clicked-slide', 'false'),
140
+ // slideVisibleClass: getAttr($this, 'slide-visible-class', 'swiper-slide-visible'),
141
+ // slidesOffsetAfter: getAttr($this, 'slides-offset-after', 0),
142
+ // slidesOffsetBefore: getAttr($this, 'slides-offset-before', 0),
143
+ // slidesPerGroup: getAttr($this, 'slides-per-group', 1),
144
+ // slidesPerGroupAuto: getAttr($this, 'slides-per-group-auto', 'false'),
145
+ // slidesPerGroupSkip: getAttr($this, 'slides-per-group-skip', 0),
146
146
  slidesPerView: getAttr($this, "slides-per-view", 1),
147
147
  spaceBetween: getAttr($this, "space-between", 0),
148
148
  speed: getAttr($this, "speed", 300),
149
149
  //swipeHandler: getAttr($this, "swipe-handler", null),
150
- swiperElementNodeName: getAttr($this, "swiper-element-node-name", "SWIPER-CONTAINER"),
151
- threshold: getAttr($this, "threshold", 5),
152
- //thumbs: null,
153
- touchAngle: getAttr($this, "touch-angle", 45),
154
- touchEventsTarget: getAttr($this, "touch-events-target", "wrapper"),
155
- touchMoveStopPropagation: getAttr($this, "touch-move-stop-propagation", false),
156
- touchRatio: getAttr($this, "touch-ratio", 1),
157
- touchReleaseOnEdges: getAttr($this, "touch-release-on-edges", false),
158
- touchStartForcePreventDefault: getAttr($this, "touch-start-force-prevent-default", false),
159
- touchStartPreventDefault: getAttr($this, "touch-start-prevent-default", true),
160
- uniqueNavElements: getAttr($this, "unique-nav-elements", true),
161
- updateOnWindowResize: getAttr($this, "update-on-window-resize", true),
150
+ // swiperElementNodeName: getAttr($this, "swiper-element-node-name", "SWIPER-CONTAINER"),
151
+ // threshold: getAttr($this, "threshold", 5),
152
+ // //thumbs: null,
153
+ // touchAngle: getAttr($this, "touch-angle", 45),
154
+ // touchEventsTarget: getAttr($this, "touch-events-target", "wrapper"),
155
+ // touchMoveStopPropagation: getAttr($this, "touch-move-stop-propagation", false),
156
+ // touchRatio: getAttr($this, "touch-ratio", 1),
157
+ // touchReleaseOnEdges: getAttr($this, "touch-release-on-edges", false),
158
+ // touchStartForcePreventDefault: getAttr($this, "touch-start-force-prevent-default", false),
159
+ // touchStartPreventDefault: getAttr($this, "touch-start-prevent-default", true),
160
+ // uniqueNavElements: getAttr($this, "unique-nav-elements", true),
161
+ //updateOnWindowResize: getAttr($this, "update-on-window-resize", true),
162
162
  //url: getAttr($this, "url", "null"),
163
163
  //userAgent: getAttr($this, "user-agent", "null"),
164
164
  //virtual: null,
165
- virtualTranslate: getAttr($this, "virtual-translate", false),
166
- watchOverflow: getAttr($this, "watch-overflow", true),
167
- watchSlidesProgress: getAttr($this, "watch-slides-progress", false),
165
+ //virtualTranslate: getAttr($this, "virtual-translate", false),
166
+ //watchOverflow: getAttr($this, "watch-overflow", true),
167
+ //watchSlidesProgress: getAttr($this, "watch-slides-progress", false),
168
168
  //width: getAttr($this, "width", "null"),
169
- wrapperClass: getAttr($this, "wrapper-class", "swiper-wrapper"),
169
+ //wrapperClass: getAttr($this, "wrapper-class", "swiper-wrapper"),
170
170
  //zoom: null,
171
171
  };
172
172