vevet 3.20.0 → 4.0.0-beta.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.
- package/README.md +81 -18
- package/lib/cjs/{Application → Vevet}/events/createOnPageLoad/index.js +7 -7
- package/lib/cjs/Vevet/events/createOnPageLoad/index.js.map +1 -0
- package/lib/cjs/Vevet/events/createOnPageLoad/types.js.map +1 -0
- package/lib/cjs/{Application → Vevet}/events/createViewport/index.js +19 -25
- package/lib/cjs/Vevet/events/createViewport/index.js.map +1 -0
- package/lib/cjs/Vevet/events/createViewport/types.js.map +1 -0
- package/lib/cjs/Vevet/exported.js +3 -0
- package/lib/cjs/Vevet/exported.js.map +1 -0
- package/lib/cjs/Vevet/global.js +3 -0
- package/lib/cjs/Vevet/global.js.map +1 -0
- package/lib/cjs/Vevet/index.js +94 -0
- package/lib/cjs/Vevet/index.js.map +1 -0
- package/lib/cjs/{Application → Vevet}/types.js.map +1 -1
- package/lib/cjs/{utils/internal → Vevet/utils}/fetchWebpSupport.js +1 -1
- package/lib/cjs/Vevet/utils/fetchWebpSupport.js.map +1 -0
- package/lib/cjs/Vevet/utils/getDeviceInfo.js.map +1 -0
- package/lib/cjs/base/Callbacks/index.js +65 -48
- package/lib/cjs/base/Callbacks/index.js.map +1 -1
- package/lib/cjs/base/Component/index.js +15 -4
- package/lib/cjs/base/Component/index.js.map +1 -1
- package/lib/cjs/base/Module/index.js +118 -64
- package/lib/cjs/base/Module/index.js.map +1 -1
- package/lib/cjs/base/MutableProps/index.js +30 -55
- package/lib/cjs/base/MutableProps/index.js.map +1 -1
- package/lib/cjs/base/Plugin/index.js +20 -1
- package/lib/cjs/base/Plugin/index.js.map +1 -1
- package/lib/cjs/components/AnimationFrame/index.js +14 -21
- package/lib/cjs/components/AnimationFrame/index.js.map +1 -1
- package/lib/cjs/components/Ctx2D/index.js +40 -25
- package/lib/cjs/components/Ctx2D/index.js.map +1 -1
- package/lib/cjs/components/Ctx2DPrerender/index.js +17 -7
- package/lib/cjs/components/Ctx2DPrerender/index.js.map +1 -1
- package/lib/cjs/components/CustomCursor/index.js +75 -51
- package/lib/cjs/components/CustomCursor/index.js.map +1 -1
- package/lib/cjs/components/{SmoothScroll → CustomScroll}/AnimatonFrame.js +2 -2
- package/lib/cjs/components/{SmoothScroll → CustomScroll}/AnimatonFrame.js.map +1 -1
- package/lib/cjs/components/{SmoothScroll → CustomScroll}/Elements.js +9 -9
- package/lib/cjs/components/{SmoothScroll → CustomScroll}/Elements.js.map +1 -1
- package/lib/cjs/components/{SmoothScroll → CustomScroll}/index.js +68 -62
- package/lib/cjs/components/CustomScroll/index.js.map +1 -0
- package/lib/cjs/components/CustomScroll/types.js.map +1 -0
- package/lib/cjs/components/{SmoothScrollDragPlugin → CustomScrollDragPlugin}/index.js +45 -44
- package/lib/cjs/components/CustomScrollDragPlugin/index.js.map +1 -0
- package/lib/cjs/components/CustomScrollDragPlugin/types.js.map +1 -0
- package/lib/cjs/components/{SmoothScrollKeyboardPlugin → CustomScrollKeyboardPlugin}/index.js +51 -47
- package/lib/cjs/components/CustomScrollKeyboardPlugin/index.js.map +1 -0
- package/lib/cjs/components/CustomScrollKeyboardPlugin/types.js.map +1 -0
- package/lib/cjs/components/DraggerBase/index.js +74 -26
- package/lib/cjs/components/DraggerBase/index.js.map +1 -1
- package/lib/cjs/components/DraggerDirection/index.js +12 -6
- package/lib/cjs/components/DraggerDirection/index.js.map +1 -1
- package/lib/cjs/components/DraggerMove/index.js +44 -13
- package/lib/cjs/components/DraggerMove/index.js.map +1 -1
- package/lib/cjs/components/Marquee/index.js +240 -160
- package/lib/cjs/components/Marquee/index.js.map +1 -1
- package/lib/cjs/components/Preloader/index.js +45 -16
- package/lib/cjs/components/Preloader/index.js.map +1 -1
- package/lib/cjs/components/ProgressPreloader/index.js +79 -41
- package/lib/cjs/components/ProgressPreloader/index.js.map +1 -1
- package/lib/cjs/components/ProgressPreloader/utils/preloadCustomElement.js +12 -1
- package/lib/cjs/components/ProgressPreloader/utils/preloadCustomElement.js.map +1 -1
- package/lib/cjs/components/ScrollBar/Bar/index.js +90 -36
- package/lib/cjs/components/ScrollBar/Bar/index.js.map +1 -1
- package/lib/cjs/components/ScrollBar/index.js +59 -20
- package/lib/cjs/components/ScrollBar/index.js.map +1 -1
- package/lib/cjs/components/ScrollView/index.js +56 -20
- package/lib/cjs/components/ScrollView/index.js.map +1 -1
- package/lib/cjs/components/SectionScrollProgress/index.js +68 -31
- package/lib/cjs/components/SectionScrollProgress/index.js.map +1 -1
- package/lib/cjs/components/SlideProgress/index.js +72 -38
- package/lib/cjs/components/SlideProgress/index.js.map +1 -1
- package/lib/cjs/components/SplitText/index.js +52 -23
- package/lib/cjs/components/SplitText/index.js.map +1 -1
- package/lib/cjs/components/SplitText/utils/splitBase.js +6 -1
- package/lib/cjs/components/SplitText/utils/splitBase.js.map +1 -1
- package/lib/cjs/components/SplitText/utils/wrapLetters.js +11 -3
- package/lib/cjs/components/SplitText/utils/wrapLetters.js.map +1 -1
- package/lib/cjs/components/SplitText/utils/wrapLines.js +11 -5
- package/lib/cjs/components/SplitText/utils/wrapLines.js.map +1 -1
- package/lib/cjs/components/SplitText/utils/wrapWords.js +13 -2
- package/lib/cjs/components/SplitText/utils/wrapWords.js.map +1 -1
- package/lib/cjs/components/Timeline/index.js +77 -21
- package/lib/cjs/components/Timeline/index.js.map +1 -1
- package/lib/cjs/components/index.js +4 -4
- package/lib/cjs/components/index.js.map +1 -1
- package/lib/cjs/index.js +10 -3
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/types/index.js +19 -0
- package/lib/cjs/types/index.js.map +1 -0
- package/lib/cjs/utils/common/PCancelable.js +16 -0
- package/lib/cjs/utils/common/PCancelable.js.map +1 -1
- package/lib/cjs/utils/common/normalizedTimeoutCallback.js +19 -4
- package/lib/cjs/utils/common/normalizedTimeoutCallback.js.map +1 -1
- package/lib/cjs/utils/common/objectKeys.js +11 -1
- package/lib/cjs/utils/common/objectKeys.js.map +1 -1
- package/lib/cjs/utils/common/pickObjectProps.js +14 -2
- package/lib/cjs/utils/common/pickObjectProps.js.map +1 -1
- package/lib/cjs/utils/common/times.js +12 -3
- package/lib/cjs/utils/common/times.js.map +1 -1
- package/lib/cjs/utils/common/uid.js +4 -2
- package/lib/cjs/utils/common/uid.js.map +1 -1
- package/lib/cjs/utils/image/load.js +3 -3
- package/lib/cjs/utils/image/load.js.map +1 -1
- package/lib/cjs/utils/image/pathsToProps.js +10 -4
- package/lib/cjs/utils/image/pathsToProps.js.map +1 -1
- package/lib/cjs/utils/image/sizesToSrcSet.js +7 -3
- package/lib/cjs/utils/image/sizesToSrcSet.js.map +1 -1
- package/lib/cjs/utils/internal/getApp.js +12 -0
- package/lib/cjs/utils/internal/getApp.js.map +1 -1
- package/lib/cjs/utils/listeners/isIntersectionObserverSupported.js +1 -1
- package/lib/cjs/utils/listeners/onResize.js +8 -10
- package/lib/cjs/utils/listeners/onResize.js.map +1 -1
- package/lib/cjs/utils/math/clamp.js +10 -5
- package/lib/cjs/utils/math/clamp.js.map +1 -1
- package/lib/cjs/utils/math/clampScope.js +8 -1
- package/lib/cjs/utils/math/clampScope.js.map +1 -1
- package/lib/cjs/utils/math/easing.js +4 -1
- package/lib/cjs/utils/math/easing.js.map +1 -1
- package/lib/cjs/utils/math/inScope.js +6 -3
- package/lib/cjs/utils/math/inScope.js.map +1 -1
- package/lib/cjs/utils/math/lerp.js +11 -3
- package/lib/cjs/utils/math/lerp.js.map +1 -1
- package/lib/cjs/utils/math/normalizeNestedScope.js +12 -3
- package/lib/cjs/utils/math/normalizeNestedScope.js.map +1 -1
- package/lib/cjs/utils/math/scoped.js +18 -7
- package/lib/cjs/utils/math/scoped.js.map +1 -1
- package/lib/cjs/utils/math/spreadScope.js +17 -3
- package/lib/cjs/utils/math/spreadScope.js.map +1 -1
- package/lib/cjs/utils/math/wrap.js +9 -3
- package/lib/cjs/utils/math/wrap.js.map +1 -1
- package/lib/cjs/utils/scroll/getScrollValues.js +13 -1
- package/lib/cjs/utils/scroll/getScrollValues.js.map +1 -1
- package/lib/cjs/utils/scroll/isPageScrolling.js +30 -0
- package/lib/cjs/utils/scroll/isPageScrolling.js.map +1 -1
- package/lib/cjs/utils/scroll/normalizeWheel.js +7 -2
- package/lib/cjs/utils/scroll/normalizeWheel.js.map +1 -1
- package/lib/cjs/utils/scroll/onScroll.js +14 -7
- package/lib/cjs/utils/scroll/onScroll.js.map +1 -1
- package/lib/cjs/utils/scroll/scrollTo.js +8 -7
- package/lib/cjs/utils/scroll/scrollTo.js.map +1 -1
- package/lib/cjs/utils/scroll/scrollToElement.js +8 -6
- package/lib/cjs/utils/scroll/scrollToElement.js.map +1 -1
- package/lib/esm/{Application → Vevet}/events/createOnPageLoad/index.js +7 -7
- package/lib/esm/Vevet/events/createOnPageLoad/index.js.map +1 -0
- package/lib/esm/Vevet/events/createOnPageLoad/types.js.map +1 -0
- package/lib/esm/{Application → Vevet}/events/createViewport/index.js +20 -26
- package/lib/esm/Vevet/events/createViewport/index.js.map +1 -0
- package/lib/esm/Vevet/events/createViewport/types.js.map +1 -0
- package/lib/esm/Vevet/exported.js +2 -0
- package/lib/esm/Vevet/exported.js.map +1 -0
- package/lib/esm/Vevet/global.js +2 -0
- package/lib/esm/Vevet/global.js.map +1 -0
- package/lib/esm/Vevet/index.js +72 -0
- package/lib/esm/Vevet/index.js.map +1 -0
- package/lib/esm/{Application → Vevet}/types.js.map +1 -1
- package/lib/esm/{utils/internal → Vevet/utils}/fetchWebpSupport.js +1 -1
- package/lib/esm/Vevet/utils/fetchWebpSupport.js.map +1 -0
- package/lib/esm/Vevet/utils/getDeviceInfo.js.map +1 -0
- package/lib/esm/base/Callbacks/index.js +66 -48
- package/lib/esm/base/Callbacks/index.js.map +1 -1
- package/lib/esm/base/Component/index.js +15 -4
- package/lib/esm/base/Component/index.js.map +1 -1
- package/lib/esm/base/Module/index.js +119 -65
- package/lib/esm/base/Module/index.js.map +1 -1
- package/lib/esm/base/MutableProps/index.js +35 -60
- package/lib/esm/base/MutableProps/index.js.map +1 -1
- package/lib/esm/base/Plugin/index.js +20 -1
- package/lib/esm/base/Plugin/index.js.map +1 -1
- package/lib/esm/components/AnimationFrame/index.js +14 -21
- package/lib/esm/components/AnimationFrame/index.js.map +1 -1
- package/lib/esm/components/Ctx2D/index.js +40 -25
- package/lib/esm/components/Ctx2D/index.js.map +1 -1
- package/lib/esm/components/Ctx2DPrerender/index.js +17 -7
- package/lib/esm/components/Ctx2DPrerender/index.js.map +1 -1
- package/lib/esm/components/CustomCursor/index.js +75 -51
- package/lib/esm/components/CustomCursor/index.js.map +1 -1
- package/lib/esm/components/{SmoothScroll → CustomScroll}/AnimatonFrame.js +2 -2
- package/lib/esm/components/{SmoothScroll → CustomScroll}/AnimatonFrame.js.map +1 -1
- package/lib/esm/components/{SmoothScroll → CustomScroll}/Elements.js +8 -8
- package/lib/esm/components/{SmoothScroll → CustomScroll}/Elements.js.map +1 -1
- package/lib/esm/components/{SmoothScroll → CustomScroll}/index.js +26 -20
- package/lib/esm/components/CustomScroll/index.js.map +1 -0
- package/lib/esm/components/CustomScroll/types.js.map +1 -0
- package/lib/esm/components/{SmoothScrollDragPlugin → CustomScrollDragPlugin}/index.js +28 -27
- package/lib/esm/components/CustomScrollDragPlugin/index.js.map +1 -0
- package/lib/esm/components/CustomScrollDragPlugin/types.js.map +1 -0
- package/lib/esm/components/{SmoothScrollKeyboardPlugin → CustomScrollKeyboardPlugin}/index.js +37 -33
- package/lib/esm/components/CustomScrollKeyboardPlugin/index.js.map +1 -0
- package/lib/esm/components/CustomScrollKeyboardPlugin/types.js.map +1 -0
- package/lib/esm/components/DraggerBase/index.js +74 -28
- package/lib/esm/components/DraggerBase/index.js.map +1 -1
- package/lib/esm/components/DraggerDirection/index.js +12 -6
- package/lib/esm/components/DraggerDirection/index.js.map +1 -1
- package/lib/esm/components/DraggerMove/index.js +44 -13
- package/lib/esm/components/DraggerMove/index.js.map +1 -1
- package/lib/esm/components/Marquee/index.js +220 -161
- package/lib/esm/components/Marquee/index.js.map +1 -1
- package/lib/esm/components/Preloader/index.js +45 -16
- package/lib/esm/components/Preloader/index.js.map +1 -1
- package/lib/esm/components/ProgressPreloader/index.js +79 -40
- package/lib/esm/components/ProgressPreloader/index.js.map +1 -1
- package/lib/esm/components/ProgressPreloader/utils/preloadCustomElement.js +12 -1
- package/lib/esm/components/ProgressPreloader/utils/preloadCustomElement.js.map +1 -1
- package/lib/esm/components/ScrollBar/Bar/index.js +89 -32
- package/lib/esm/components/ScrollBar/Bar/index.js.map +1 -1
- package/lib/esm/components/ScrollBar/index.js +49 -15
- package/lib/esm/components/ScrollBar/index.js.map +1 -1
- package/lib/esm/components/ScrollView/index.js +56 -20
- package/lib/esm/components/ScrollView/index.js.map +1 -1
- package/lib/esm/components/SectionScrollProgress/index.js +68 -31
- package/lib/esm/components/SectionScrollProgress/index.js.map +1 -1
- package/lib/esm/components/SlideProgress/index.js +72 -38
- package/lib/esm/components/SlideProgress/index.js.map +1 -1
- package/lib/esm/components/SplitText/index.js +52 -23
- package/lib/esm/components/SplitText/index.js.map +1 -1
- package/lib/esm/components/SplitText/utils/splitBase.js +6 -1
- package/lib/esm/components/SplitText/utils/splitBase.js.map +1 -1
- package/lib/esm/components/SplitText/utils/wrapLetters.js +11 -3
- package/lib/esm/components/SplitText/utils/wrapLetters.js.map +1 -1
- package/lib/esm/components/SplitText/utils/wrapLines.js +11 -5
- package/lib/esm/components/SplitText/utils/wrapLines.js.map +1 -1
- package/lib/esm/components/SplitText/utils/wrapWords.js +13 -2
- package/lib/esm/components/SplitText/utils/wrapWords.js.map +1 -1
- package/lib/esm/components/Timeline/index.js +70 -22
- package/lib/esm/components/Timeline/index.js.map +1 -1
- package/lib/esm/components/index.js +4 -4
- package/lib/esm/components/index.js.map +1 -1
- package/lib/esm/index.js +9 -3
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/types/index.js +3 -0
- package/lib/esm/types/index.js.map +1 -0
- package/lib/esm/utils/common/PCancelable.js +16 -0
- package/lib/esm/utils/common/PCancelable.js.map +1 -1
- package/lib/esm/utils/common/normalizedTimeoutCallback.js +19 -4
- package/lib/esm/utils/common/normalizedTimeoutCallback.js.map +1 -1
- package/lib/esm/utils/common/objectKeys.js +11 -1
- package/lib/esm/utils/common/objectKeys.js.map +1 -1
- package/lib/esm/utils/common/pickObjectProps.js +14 -2
- package/lib/esm/utils/common/pickObjectProps.js.map +1 -1
- package/lib/esm/utils/common/times.js +12 -3
- package/lib/esm/utils/common/times.js.map +1 -1
- package/lib/esm/utils/common/uid.js +4 -2
- package/lib/esm/utils/common/uid.js.map +1 -1
- package/lib/esm/utils/image/load.js +3 -3
- package/lib/esm/utils/image/load.js.map +1 -1
- package/lib/esm/utils/image/pathsToProps.js +10 -4
- package/lib/esm/utils/image/pathsToProps.js.map +1 -1
- package/lib/esm/utils/image/sizesToSrcSet.js +7 -3
- package/lib/esm/utils/image/sizesToSrcSet.js.map +1 -1
- package/lib/esm/utils/internal/getApp.js +12 -0
- package/lib/esm/utils/internal/getApp.js.map +1 -1
- package/lib/esm/utils/listeners/isIntersectionObserverSupported.js +1 -1
- package/lib/esm/utils/listeners/onResize.js +8 -10
- package/lib/esm/utils/listeners/onResize.js.map +1 -1
- package/lib/esm/utils/math/clamp.js +10 -5
- package/lib/esm/utils/math/clamp.js.map +1 -1
- package/lib/esm/utils/math/clampScope.js +8 -1
- package/lib/esm/utils/math/clampScope.js.map +1 -1
- package/lib/esm/utils/math/easing.js +4 -1
- package/lib/esm/utils/math/easing.js.map +1 -1
- package/lib/esm/utils/math/inScope.js +6 -3
- package/lib/esm/utils/math/inScope.js.map +1 -1
- package/lib/esm/utils/math/lerp.js +11 -3
- package/lib/esm/utils/math/lerp.js.map +1 -1
- package/lib/esm/utils/math/normalizeNestedScope.js +12 -3
- package/lib/esm/utils/math/normalizeNestedScope.js.map +1 -1
- package/lib/esm/utils/math/scoped.js +17 -6
- package/lib/esm/utils/math/scoped.js.map +1 -1
- package/lib/esm/utils/math/spreadScope.js +17 -3
- package/lib/esm/utils/math/spreadScope.js.map +1 -1
- package/lib/esm/utils/math/wrap.js +9 -3
- package/lib/esm/utils/math/wrap.js.map +1 -1
- package/lib/esm/utils/scroll/getScrollValues.js +13 -1
- package/lib/esm/utils/scroll/getScrollValues.js.map +1 -1
- package/lib/esm/utils/scroll/isPageScrolling.js +30 -0
- package/lib/esm/utils/scroll/isPageScrolling.js.map +1 -1
- package/lib/esm/utils/scroll/normalizeWheel.js +7 -2
- package/lib/esm/utils/scroll/normalizeWheel.js.map +1 -1
- package/lib/esm/utils/scroll/onScroll.js +14 -7
- package/lib/esm/utils/scroll/onScroll.js.map +1 -1
- package/lib/esm/utils/scroll/scrollTo.js +8 -7
- package/lib/esm/utils/scroll/scrollTo.js.map +1 -1
- package/lib/esm/utils/scroll/scrollToElement.js +8 -6
- package/lib/esm/utils/scroll/scrollToElement.js.map +1 -1
- package/lib/styles/base.scss +0 -2
- package/lib/styles/components/CustomCursor.scss +7 -7
- package/{src/styles/components/SmoothScroll.scss → lib/styles/components/CustomScroll.scss} +3 -3
- package/lib/styles/components/Preloader.scss +1 -1
- package/lib/styles/components/ScrollBar.scss +4 -4
- package/lib/styles/components/index.scss +1 -1
- package/lib/styles/index.scss +0 -1
- package/lib/types/Vevet/events/createOnPageLoad/index.d.ts +3 -0
- package/lib/types/Vevet/events/createOnPageLoad/index.d.ts.map +1 -0
- package/lib/types/Vevet/events/createOnPageLoad/types.d.ts +20 -0
- package/lib/types/Vevet/events/createOnPageLoad/types.d.ts.map +1 -0
- package/lib/types/Vevet/events/createViewport/index.d.ts +4 -0
- package/lib/types/Vevet/events/createViewport/index.d.ts.map +1 -0
- package/lib/types/Vevet/events/createViewport/types.d.ts +85 -0
- package/lib/types/Vevet/events/createViewport/types.d.ts.map +1 -0
- package/lib/types/Vevet/exported.d.ts +6 -0
- package/lib/types/Vevet/exported.d.ts.map +1 -0
- package/lib/types/Vevet/global.d.ts +51 -0
- package/lib/types/Vevet/global.d.ts.map +1 -0
- package/lib/types/Vevet/index.d.ts +4 -0
- package/lib/types/Vevet/index.d.ts.map +1 -0
- package/lib/types/Vevet/types.d.ts +43 -0
- package/lib/types/Vevet/types.d.ts.map +1 -0
- package/lib/types/Vevet/utils/fetchWebpSupport.d.ts +3 -0
- package/lib/types/Vevet/utils/fetchWebpSupport.d.ts.map +1 -0
- package/lib/types/Vevet/utils/getDeviceInfo.d.ts.map +1 -0
- package/lib/types/base/Callbacks/index.d.ts +67 -46
- package/lib/types/base/Callbacks/index.d.ts.map +1 -1
- package/lib/types/base/Callbacks/types.d.ts +46 -14
- package/lib/types/base/Callbacks/types.d.ts.map +1 -1
- package/lib/types/base/Component/index.d.ts +19 -5
- package/lib/types/base/Component/index.d.ts.map +1 -1
- package/lib/types/base/Component/types.d.ts +15 -3
- package/lib/types/base/Component/types.d.ts.map +1 -1
- package/lib/types/base/Module/index.d.ts +124 -74
- package/lib/types/base/Module/index.d.ts.map +1 -1
- package/lib/types/base/Module/types.d.ts +29 -3
- package/lib/types/base/Module/types.d.ts.map +1 -1
- package/lib/types/base/MutableProps/index.d.ts +34 -77
- package/lib/types/base/MutableProps/index.d.ts.map +1 -1
- package/lib/types/base/MutableProps/types.d.ts +14 -8
- package/lib/types/base/MutableProps/types.d.ts.map +1 -1
- package/lib/types/base/Plugin/index.d.ts +24 -1
- package/lib/types/base/Plugin/index.d.ts.map +1 -1
- package/lib/types/base/Plugin/types.d.ts +11 -0
- package/lib/types/base/Plugin/types.d.ts.map +1 -1
- package/lib/types/components/AnimationFrame/index.d.ts +20 -18
- package/lib/types/components/AnimationFrame/index.d.ts.map +1 -1
- package/lib/types/components/AnimationFrame/types.d.ts +18 -3
- package/lib/types/components/AnimationFrame/types.d.ts.map +1 -1
- package/lib/types/components/Ctx2D/index.d.ts +37 -15
- package/lib/types/components/Ctx2D/index.d.ts.map +1 -1
- package/lib/types/components/Ctx2D/types.d.ts +40 -13
- package/lib/types/components/Ctx2D/types.d.ts.map +1 -1
- package/lib/types/components/Ctx2DPrerender/index.d.ts +13 -4
- package/lib/types/components/Ctx2DPrerender/index.d.ts.map +1 -1
- package/lib/types/components/Ctx2DPrerender/types.d.ts +13 -2
- package/lib/types/components/Ctx2DPrerender/types.d.ts.map +1 -1
- package/lib/types/components/CustomCursor/index.d.ts +59 -36
- package/lib/types/components/CustomCursor/index.d.ts.map +1 -1
- package/lib/types/components/CustomCursor/types.d.ts +52 -12
- package/lib/types/components/CustomCursor/types.d.ts.map +1 -1
- package/lib/types/components/{SmoothScroll → CustomScroll}/AnimatonFrame.d.ts.map +1 -1
- package/lib/types/components/{SmoothScroll → CustomScroll}/Elements.d.ts +3 -3
- package/lib/types/components/{SmoothScroll → CustomScroll}/Elements.d.ts.map +1 -1
- package/lib/types/components/{SmoothScroll → CustomScroll}/index.d.ts +45 -32
- package/lib/types/components/CustomScroll/index.d.ts.map +1 -0
- package/lib/types/components/CustomScroll/types.d.ts +137 -0
- package/lib/types/components/CustomScroll/types.d.ts.map +1 -0
- package/lib/types/components/CustomScrollDragPlugin/index.d.ts +62 -0
- package/lib/types/components/CustomScrollDragPlugin/index.d.ts.map +1 -0
- package/lib/types/components/CustomScrollDragPlugin/types.d.ts +52 -0
- package/lib/types/components/CustomScrollDragPlugin/types.d.ts.map +1 -0
- package/lib/types/components/CustomScrollKeyboardPlugin/index.d.ts +47 -0
- package/lib/types/components/CustomScrollKeyboardPlugin/index.d.ts.map +1 -0
- package/lib/types/components/CustomScrollKeyboardPlugin/types.d.ts +16 -0
- package/lib/types/components/{SmoothScrollKeyboardPlugin → CustomScrollKeyboardPlugin}/types.d.ts.map +1 -1
- package/lib/types/components/DraggerBase/index.d.ts +93 -28
- package/lib/types/components/DraggerBase/index.d.ts.map +1 -1
- package/lib/types/components/DraggerBase/types.d.ts +21 -3
- package/lib/types/components/DraggerBase/types.d.ts.map +1 -1
- package/lib/types/components/DraggerDirection/index.d.ts +6 -2
- package/lib/types/components/DraggerDirection/index.d.ts.map +1 -1
- package/lib/types/components/DraggerDirection/types.d.ts +15 -1
- package/lib/types/components/DraggerDirection/types.d.ts.map +1 -1
- package/lib/types/components/DraggerMove/index.d.ts +38 -8
- package/lib/types/components/DraggerMove/index.d.ts.map +1 -1
- package/lib/types/components/DraggerMove/types.d.ts +15 -2
- package/lib/types/components/DraggerMove/types.d.ts.map +1 -1
- package/lib/types/components/Marquee/index.d.ts +59 -36
- package/lib/types/components/Marquee/index.d.ts.map +1 -1
- package/lib/types/components/Marquee/types.d.ts +18 -8
- package/lib/types/components/Marquee/types.d.ts.map +1 -1
- package/lib/types/components/Preloader/index.d.ts +52 -15
- package/lib/types/components/Preloader/index.d.ts.map +1 -1
- package/lib/types/components/Preloader/types.d.ts +16 -5
- package/lib/types/components/Preloader/types.d.ts.map +1 -1
- package/lib/types/components/ProgressPreloader/index.d.ts +85 -25
- package/lib/types/components/ProgressPreloader/index.d.ts.map +1 -1
- package/lib/types/components/ProgressPreloader/types.d.ts +51 -14
- package/lib/types/components/ProgressPreloader/types.d.ts.map +1 -1
- package/lib/types/components/ProgressPreloader/utils/preloadCustomElement.d.ts +3 -0
- package/lib/types/components/ProgressPreloader/utils/preloadCustomElement.d.ts.map +1 -1
- package/lib/types/components/ScrollBar/Bar/index.d.ts +81 -16
- package/lib/types/components/ScrollBar/Bar/index.d.ts.map +1 -1
- package/lib/types/components/ScrollBar/Bar/types.d.ts +38 -16
- package/lib/types/components/ScrollBar/Bar/types.d.ts.map +1 -1
- package/lib/types/components/ScrollBar/index.d.ts +49 -12
- package/lib/types/components/ScrollBar/index.d.ts.map +1 -1
- package/lib/types/components/ScrollBar/types.d.ts +8 -6
- package/lib/types/components/ScrollBar/types.d.ts.map +1 -1
- package/lib/types/components/ScrollView/index.d.ts +65 -21
- package/lib/types/components/ScrollView/index.d.ts.map +1 -1
- package/lib/types/components/SectionScrollProgress/index.d.ts +83 -28
- package/lib/types/components/SectionScrollProgress/index.d.ts.map +1 -1
- package/lib/types/components/SectionScrollProgress/types.d.ts +15 -6
- package/lib/types/components/SectionScrollProgress/types.d.ts.map +1 -1
- package/lib/types/components/SlideProgress/index.d.ts +59 -24
- package/lib/types/components/SlideProgress/index.d.ts.map +1 -1
- package/lib/types/components/SlideProgress/types.d.ts +24 -15
- package/lib/types/components/SlideProgress/types.d.ts.map +1 -1
- package/lib/types/components/SplitText/index.d.ts +64 -18
- package/lib/types/components/SplitText/index.d.ts.map +1 -1
- package/lib/types/components/SplitText/types.d.ts +36 -8
- package/lib/types/components/SplitText/types.d.ts.map +1 -1
- package/lib/types/components/SplitText/utils/splitBase.d.ts +3 -1
- package/lib/types/components/SplitText/utils/splitBase.d.ts.map +1 -1
- package/lib/types/components/SplitText/utils/wrapLetters.d.ts +3 -1
- package/lib/types/components/SplitText/utils/wrapLetters.d.ts.map +1 -1
- package/lib/types/components/SplitText/utils/wrapLines.d.ts +3 -1
- package/lib/types/components/SplitText/utils/wrapLines.d.ts.map +1 -1
- package/lib/types/components/SplitText/utils/wrapWords.d.ts +3 -1
- package/lib/types/components/SplitText/utils/wrapWords.d.ts.map +1 -1
- package/lib/types/components/Timeline/index.d.ts +69 -21
- package/lib/types/components/Timeline/index.d.ts.map +1 -1
- package/lib/types/components/Timeline/types.d.ts +32 -7
- package/lib/types/components/Timeline/types.d.ts.map +1 -1
- package/lib/types/components/index.d.ts +4 -4
- package/lib/types/components/index.d.ts.map +1 -1
- package/lib/types/index.d.ts +9 -2
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/types/index.d.ts +3 -0
- package/lib/types/types/index.d.ts.map +1 -0
- package/lib/types/types/utility.d.ts +2 -3
- package/lib/types/types/utility.d.ts.map +1 -1
- package/lib/types/utils/common/PCancelable.d.ts +16 -0
- package/lib/types/utils/common/PCancelable.d.ts.map +1 -1
- package/lib/types/utils/common/normalizedTimeoutCallback.d.ts +19 -4
- package/lib/types/utils/common/normalizedTimeoutCallback.d.ts.map +1 -1
- package/lib/types/utils/common/objectKeys.d.ts +11 -1
- package/lib/types/utils/common/objectKeys.d.ts.map +1 -1
- package/lib/types/utils/common/pickObjectProps.d.ts +14 -2
- package/lib/types/utils/common/pickObjectProps.d.ts.map +1 -1
- package/lib/types/utils/common/times.d.ts +12 -3
- package/lib/types/utils/common/times.d.ts.map +1 -1
- package/lib/types/utils/common/uid.d.ts +4 -2
- package/lib/types/utils/common/uid.d.ts.map +1 -1
- package/lib/types/utils/image/load.d.ts +8 -5
- package/lib/types/utils/image/load.d.ts.map +1 -1
- package/lib/types/utils/image/pathsToProps.d.ts +10 -4
- package/lib/types/utils/image/pathsToProps.d.ts.map +1 -1
- package/lib/types/utils/image/sizesToSrcSet.d.ts +7 -3
- package/lib/types/utils/image/sizesToSrcSet.d.ts.map +1 -1
- package/lib/types/utils/internal/getApp.d.ts +9 -1
- package/lib/types/utils/internal/getApp.d.ts.map +1 -1
- package/lib/types/utils/listeners/isIntersectionObserverSupported.d.ts +1 -1
- package/lib/types/utils/listeners/onResize.d.ts +11 -12
- package/lib/types/utils/listeners/onResize.d.ts.map +1 -1
- package/lib/types/utils/math/clamp.d.ts +7 -2
- package/lib/types/utils/math/clamp.d.ts.map +1 -1
- package/lib/types/utils/math/clampScope.d.ts +8 -1
- package/lib/types/utils/math/clampScope.d.ts.map +1 -1
- package/lib/types/utils/math/easing.d.ts +4 -1
- package/lib/types/utils/math/easing.d.ts.map +1 -1
- package/lib/types/utils/math/inScope.d.ts +5 -2
- package/lib/types/utils/math/inScope.d.ts.map +1 -1
- package/lib/types/utils/math/lerp.d.ts +10 -2
- package/lib/types/utils/math/lerp.d.ts.map +1 -1
- package/lib/types/utils/math/normalizeNestedScope.d.ts +12 -3
- package/lib/types/utils/math/normalizeNestedScope.d.ts.map +1 -1
- package/lib/types/utils/math/scoped.d.ts +16 -5
- package/lib/types/utils/math/scoped.d.ts.map +1 -1
- package/lib/types/utils/math/spreadScope.d.ts +17 -3
- package/lib/types/utils/math/spreadScope.d.ts.map +1 -1
- package/lib/types/utils/math/wrap.d.ts +9 -3
- package/lib/types/utils/math/wrap.d.ts.map +1 -1
- package/lib/types/utils/scroll/getScrollValues.d.ts +13 -1
- package/lib/types/utils/scroll/getScrollValues.d.ts.map +1 -1
- package/lib/types/utils/scroll/isPageScrolling.d.ts +20 -0
- package/lib/types/utils/scroll/isPageScrolling.d.ts.map +1 -1
- package/lib/types/utils/scroll/normalizeWheel.d.ts +10 -2
- package/lib/types/utils/scroll/normalizeWheel.d.ts.map +1 -1
- package/lib/types/utils/scroll/onScroll.d.ts +10 -5
- package/lib/types/utils/scroll/onScroll.d.ts.map +1 -1
- package/lib/types/utils/scroll/scrollTo.d.ts +12 -9
- package/lib/types/utils/scroll/scrollTo.d.ts.map +1 -1
- package/lib/types/utils/scroll/scrollToElement.d.ts +9 -7
- package/lib/types/utils/scroll/scrollToElement.d.ts.map +1 -1
- package/package.json +6 -7
- package/src/{Application → Vevet}/events/createOnPageLoad/index.ts +8 -8
- package/src/Vevet/events/createOnPageLoad/types.ts +21 -0
- package/src/{Application → Vevet}/events/createViewport/index.ts +33 -35
- package/src/{Application → Vevet}/events/createViewport/stories/index.tsx +7 -5
- package/src/Vevet/events/createViewport/types.ts +93 -0
- package/src/Vevet/exported.ts +15 -0
- package/src/Vevet/global.ts +51 -0
- package/src/Vevet/index.ts +98 -0
- package/src/{Application → Vevet}/stories/index.tsx +2 -2
- package/src/Vevet/types.ts +48 -0
- package/src/base/Callbacks/index.ts +70 -51
- package/src/base/Callbacks/types.ts +53 -14
- package/src/base/Component/index.ts +19 -5
- package/src/base/Component/types.ts +15 -3
- package/src/base/Module/index.ts +125 -78
- package/src/base/Module/types.ts +32 -3
- package/src/base/MutableProps/index.ts +44 -73
- package/src/base/MutableProps/types.ts +15 -8
- package/src/base/Plugin/index.ts +24 -1
- package/src/base/Plugin/types.ts +11 -0
- package/src/components/AnimationFrame/index.ts +21 -28
- package/src/components/AnimationFrame/types.ts +23 -3
- package/src/components/Ctx2D/index.ts +46 -34
- package/src/components/Ctx2D/types.ts +53 -13
- package/src/components/Ctx2DPrerender/index.ts +18 -7
- package/src/components/Ctx2DPrerender/types.ts +13 -2
- package/src/components/CustomCursor/index.ts +85 -60
- package/src/components/CustomCursor/stories/index.tsx +0 -3
- package/src/components/CustomCursor/types.ts +63 -12
- package/src/components/{SmoothScroll → CustomScroll}/AnimatonFrame.ts +2 -2
- package/src/components/{SmoothScroll → CustomScroll}/Elements.ts +14 -14
- package/src/components/{SmoothScroll → CustomScroll}/index.ts +55 -42
- package/src/components/{SmoothScroll → CustomScroll}/stories/Default.tsx +8 -8
- package/src/components/{SmoothScroll → CustomScroll}/stories/WithHorizontal.tsx +9 -9
- package/src/components/{SmoothScroll → CustomScroll}/stories/WithInnerLerp.tsx +9 -9
- package/src/components/{SmoothScroll → CustomScroll}/stories/index.stories.tsx +1 -1
- package/src/components/CustomScroll/types.ts +165 -0
- package/src/components/{SmoothScrollDragPlugin → CustomScrollDragPlugin}/index.ts +41 -41
- package/src/components/{SmoothScrollDragPlugin → CustomScrollDragPlugin}/stories/index.stories.tsx +1 -1
- package/src/components/{SmoothScrollDragPlugin → CustomScrollDragPlugin}/stories/index.tsx +10 -10
- package/src/components/CustomScrollDragPlugin/types.ts +59 -0
- package/src/components/{SmoothScrollKeyboardPlugin → CustomScrollKeyboardPlugin}/index.ts +47 -43
- package/src/components/{SmoothScrollKeyboardPlugin → CustomScrollKeyboardPlugin}/stories/index.stories.tsx +1 -1
- package/src/components/{SmoothScrollKeyboardPlugin → CustomScrollKeyboardPlugin}/stories/index.tsx +10 -10
- package/src/components/{SmoothScrollKeyboardPlugin → CustomScrollKeyboardPlugin}/types.ts +6 -2
- package/src/components/DraggerBase/index.ts +101 -37
- package/src/components/DraggerBase/types.ts +25 -3
- package/src/components/DraggerDirection/index.ts +12 -6
- package/src/components/DraggerDirection/types.ts +18 -1
- package/src/components/DraggerMove/index.ts +44 -13
- package/src/components/DraggerMove/types.ts +17 -2
- package/src/components/Marquee/index.ts +255 -186
- package/src/components/Marquee/stories/index.tsx +16 -2
- package/src/components/Marquee/types.ts +18 -8
- package/src/components/Preloader/index.ts +56 -20
- package/src/components/Preloader/types.ts +18 -5
- package/src/components/ProgressPreloader/index.ts +104 -48
- package/src/components/ProgressPreloader/types.ts +65 -14
- package/src/components/ProgressPreloader/utils/preloadCustomElement.ts +13 -2
- package/src/components/ScrollBar/Bar/index.ts +112 -62
- package/src/components/ScrollBar/Bar/types.ts +46 -17
- package/src/components/ScrollBar/index.ts +65 -20
- package/src/components/ScrollBar/stories/{WithSmoothScrollComponent.tsx → WithCustomScrollComponent.tsx} +5 -5
- package/src/components/ScrollBar/stories/index.stories.tsx +3 -3
- package/src/components/ScrollBar/types.ts +10 -6
- package/src/components/ScrollView/index.ts +73 -27
- package/src/components/ScrollView/stories/index.tsx +5 -2
- package/src/components/SectionScrollProgress/index.ts +97 -41
- package/src/components/SectionScrollProgress/stories/WithCustomScroll.tsx +6 -6
- package/src/components/SectionScrollProgress/types.ts +19 -6
- package/src/components/SlideProgress/index.ts +78 -45
- package/src/components/SlideProgress/types.ts +24 -15
- package/src/components/SplitText/index.ts +71 -31
- package/src/components/SplitText/types.ts +48 -8
- package/src/components/SplitText/utils/splitBase.ts +6 -2
- package/src/components/SplitText/utils/wrapLetters.ts +11 -3
- package/src/components/SplitText/utils/wrapLines.ts +11 -5
- package/src/components/SplitText/utils/wrapWords.ts +14 -3
- package/src/components/Timeline/index.ts +98 -26
- package/src/components/Timeline/stories/index.stories.tsx +0 -5
- package/src/components/Timeline/types.ts +37 -7
- package/src/components/index.ts +4 -4
- package/src/index.ts +14 -4
- package/src/styles/base.scss +0 -2
- package/src/styles/components/CustomCursor.scss +7 -7
- package/{lib/styles/components/SmoothScroll.scss → src/styles/components/CustomScroll.scss} +3 -3
- package/src/styles/components/Preloader.scss +1 -1
- package/src/styles/components/ScrollBar.scss +4 -4
- package/src/styles/components/index.scss +1 -1
- package/src/styles/index.scss +0 -1
- package/src/types/index.ts +2 -0
- package/src/types/utility.ts +2 -2
- package/src/utils/common/PCancelable.ts +17 -0
- package/src/utils/common/normalizedTimeoutCallback.ts +19 -4
- package/src/utils/common/objectKeys.ts +12 -2
- package/src/utils/common/pickObjectProps.ts +16 -4
- package/src/utils/common/times.ts +12 -3
- package/src/utils/common/uid.ts +5 -3
- package/src/utils/image/load.ts +9 -4
- package/src/utils/image/pathsToProps.ts +10 -4
- package/src/utils/image/sizesToSrcSet.ts +7 -3
- package/src/utils/internal/getApp.ts +25 -0
- package/src/utils/listeners/isIntersectionObserverSupported.ts +1 -1
- package/src/utils/listeners/onResize.ts +12 -17
- package/src/utils/math/clamp.ts +10 -5
- package/src/utils/math/clampScope.ts +9 -2
- package/src/utils/math/easing.ts +4 -1
- package/src/utils/math/inScope.ts +6 -3
- package/src/utils/math/lerp.ts +11 -3
- package/src/utils/math/normalizeNestedScope.ts +12 -3
- package/src/utils/math/scoped.ts +17 -6
- package/src/utils/math/spreadScope.ts +17 -3
- package/src/utils/math/wrap.ts +9 -3
- package/src/utils/scroll/getScrollValues.ts +13 -1
- package/src/utils/scroll/isPageScrolling.ts +31 -0
- package/src/utils/scroll/normalizeWheel.ts +10 -2
- package/src/utils/scroll/onScroll.ts +18 -11
- package/src/utils/scroll/scrollTo.ts +16 -10
- package/src/utils/scroll/scrollToElement.ts +9 -7
- package/lib/cjs/Application/events/createOnPageLoad/index.js.map +0 -1
- package/lib/cjs/Application/events/createOnPageLoad/types.js.map +0 -1
- package/lib/cjs/Application/events/createViewport/index.js.map +0 -1
- package/lib/cjs/Application/events/createViewport/types.js.map +0 -1
- package/lib/cjs/Application/index.js +0 -222
- package/lib/cjs/Application/index.js.map +0 -1
- package/lib/cjs/components/BaseTimeline/index.js +0 -125
- package/lib/cjs/components/BaseTimeline/index.js.map +0 -1
- package/lib/cjs/components/BaseTimeline/types.js.map +0 -1
- package/lib/cjs/components/SmoothScroll/index.js.map +0 -1
- package/lib/cjs/components/SmoothScroll/types.js.map +0 -1
- package/lib/cjs/components/SmoothScrollDragPlugin/index.js.map +0 -1
- package/lib/cjs/components/SmoothScrollDragPlugin/types.js.map +0 -1
- package/lib/cjs/components/SmoothScrollKeyboardPlugin/index.js.map +0 -1
- package/lib/cjs/components/SmoothScrollKeyboardPlugin/types.js +0 -3
- package/lib/cjs/components/SmoothScrollKeyboardPlugin/types.js.map +0 -1
- package/lib/cjs/utils/internal/fetchWebpSupport.js.map +0 -1
- package/lib/cjs/utils/internal/getDeviceInfo.js.map +0 -1
- package/lib/cjs/vevet.js +0 -6
- package/lib/cjs/vevet.js.map +0 -1
- package/lib/esm/Application/events/createOnPageLoad/index.js.map +0 -1
- package/lib/esm/Application/events/createOnPageLoad/types.js.map +0 -1
- package/lib/esm/Application/events/createViewport/index.js.map +0 -1
- package/lib/esm/Application/events/createViewport/types.js.map +0 -1
- package/lib/esm/Application/index.js +0 -134
- package/lib/esm/Application/index.js.map +0 -1
- package/lib/esm/components/BaseTimeline/index.js +0 -75
- package/lib/esm/components/BaseTimeline/index.js.map +0 -1
- package/lib/esm/components/BaseTimeline/types.js.map +0 -1
- package/lib/esm/components/SmoothScroll/index.js.map +0 -1
- package/lib/esm/components/SmoothScroll/types.js.map +0 -1
- package/lib/esm/components/SmoothScrollDragPlugin/index.js.map +0 -1
- package/lib/esm/components/SmoothScrollDragPlugin/types.js.map +0 -1
- package/lib/esm/components/SmoothScrollKeyboardPlugin/index.js.map +0 -1
- package/lib/esm/components/SmoothScrollKeyboardPlugin/types.js +0 -2
- package/lib/esm/components/SmoothScrollKeyboardPlugin/types.js.map +0 -1
- package/lib/esm/utils/internal/fetchWebpSupport.js.map +0 -1
- package/lib/esm/utils/internal/getDeviceInfo.js.map +0 -1
- package/lib/esm/vevet.js +0 -3
- package/lib/esm/vevet.js.map +0 -1
- package/lib/styles/globals/index.scss +0 -18
- package/lib/types/Application/events/createOnPageLoad/index.d.ts +0 -5
- package/lib/types/Application/events/createOnPageLoad/index.d.ts.map +0 -1
- package/lib/types/Application/events/createOnPageLoad/types.d.ts +0 -5
- package/lib/types/Application/events/createOnPageLoad/types.d.ts.map +0 -1
- package/lib/types/Application/events/createViewport/index.d.ts +0 -20
- package/lib/types/Application/events/createViewport/index.d.ts.map +0 -1
- package/lib/types/Application/events/createViewport/types.d.ts +0 -52
- package/lib/types/Application/events/createViewport/types.d.ts.map +0 -1
- package/lib/types/Application/index.d.ts +0 -89
- package/lib/types/Application/index.d.ts.map +0 -1
- package/lib/types/Application/types.d.ts +0 -41
- package/lib/types/Application/types.d.ts.map +0 -1
- package/lib/types/components/BaseTimeline/index.d.ts +0 -40
- package/lib/types/components/BaseTimeline/index.d.ts.map +0 -1
- package/lib/types/components/BaseTimeline/types.d.ts +0 -34
- package/lib/types/components/BaseTimeline/types.d.ts.map +0 -1
- package/lib/types/components/SmoothScroll/index.d.ts.map +0 -1
- package/lib/types/components/SmoothScroll/types.d.ts +0 -110
- package/lib/types/components/SmoothScroll/types.d.ts.map +0 -1
- package/lib/types/components/SmoothScrollDragPlugin/index.d.ts +0 -50
- package/lib/types/components/SmoothScrollDragPlugin/index.d.ts.map +0 -1
- package/lib/types/components/SmoothScrollDragPlugin/types.d.ts +0 -39
- package/lib/types/components/SmoothScrollDragPlugin/types.d.ts.map +0 -1
- package/lib/types/components/SmoothScrollKeyboardPlugin/index.d.ts +0 -31
- package/lib/types/components/SmoothScrollKeyboardPlugin/index.d.ts.map +0 -1
- package/lib/types/components/SmoothScrollKeyboardPlugin/types.d.ts +0 -12
- package/lib/types/utils/internal/fetchWebpSupport.d.ts +0 -3
- package/lib/types/utils/internal/fetchWebpSupport.d.ts.map +0 -1
- package/lib/types/utils/internal/getDeviceInfo.d.ts.map +0 -1
- package/lib/types/vevet.d.ts +0 -3
- package/lib/types/vevet.d.ts.map +0 -1
- package/src/Application/events/createOnPageLoad/types.ts +0 -5
- package/src/Application/events/createViewport/types.ts +0 -55
- package/src/Application/index.ts +0 -204
- package/src/Application/types.ts +0 -41
- package/src/components/BaseTimeline/index.ts +0 -123
- package/src/components/BaseTimeline/stories/Basic.tsx +0 -65
- package/src/components/BaseTimeline/stories/Nested.tsx +0 -108
- package/src/components/BaseTimeline/stories/index.stories.tsx +0 -16
- package/src/components/BaseTimeline/types.ts +0 -36
- package/src/components/SmoothScroll/types.ts +0 -119
- package/src/components/SmoothScrollDragPlugin/types.ts +0 -40
- package/src/components/Timeline/stories/Nested.tsx +0 -135
- package/src/styles/globals/index.scss +0 -18
- package/src/vevet.ts +0 -4
- /package/lib/cjs/{Application → Vevet}/events/createOnPageLoad/types.js +0 -0
- /package/lib/cjs/{Application → Vevet}/events/createViewport/types.js +0 -0
- /package/lib/cjs/{Application → Vevet}/types.js +0 -0
- /package/lib/cjs/{utils/internal → Vevet/utils}/getDeviceInfo.js +0 -0
- /package/lib/cjs/components/{BaseTimeline → CustomScroll}/types.js +0 -0
- /package/lib/cjs/components/{SmoothScroll → CustomScrollDragPlugin}/types.js +0 -0
- /package/lib/cjs/components/{SmoothScrollDragPlugin → CustomScrollKeyboardPlugin}/types.js +0 -0
- /package/lib/esm/{Application → Vevet}/events/createOnPageLoad/types.js +0 -0
- /package/lib/esm/{Application → Vevet}/events/createViewport/types.js +0 -0
- /package/lib/esm/{Application → Vevet}/types.js +0 -0
- /package/lib/esm/{utils/internal → Vevet/utils}/getDeviceInfo.js +0 -0
- /package/lib/esm/components/{BaseTimeline → CustomScroll}/types.js +0 -0
- /package/lib/esm/components/{SmoothScroll → CustomScrollDragPlugin}/types.js +0 -0
- /package/lib/esm/components/{SmoothScrollDragPlugin → CustomScrollKeyboardPlugin}/types.js +0 -0
- /package/lib/types/{utils/internal → Vevet/utils}/getDeviceInfo.d.ts +0 -0
- /package/lib/types/components/{SmoothScroll → CustomScroll}/AnimatonFrame.d.ts +0 -0
- /package/src/{Application → Vevet}/events/.eslintrc +0 -0
- /package/src/{Application → Vevet}/events/createViewport/stories/index.stories.tsx +0 -0
- /package/src/{Application → Vevet}/stories/index.stories.tsx +0 -0
- /package/src/{utils/internal → Vevet/utils}/fetchWebpSupport.ts +0 -0
- /package/src/{utils/internal → Vevet/utils}/getDeviceInfo.ts +0 -0
|
@@ -11,7 +11,8 @@ import { NDraggerBase } from '../DraggerBase';
|
|
|
11
11
|
export type { NSlideProgress };
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Slide progress handler
|
|
14
|
+
* Slide progress handler.
|
|
15
|
+
* This class manages sliding progress with options like dragging, wheel interactions, and smooth transitions.
|
|
15
16
|
*/
|
|
16
17
|
export class SlideProgress<
|
|
17
18
|
StaticProps extends NSlideProgress.IStaticProps = NSlideProgress.IStaticProps,
|
|
@@ -39,44 +40,48 @@ export class SlideProgress<
|
|
|
39
40
|
};
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
/** Animation frame */
|
|
43
|
+
/** Animation frame for smooth animations */
|
|
43
44
|
protected _animationFrame: AnimationFrame;
|
|
44
45
|
|
|
45
|
-
/**
|
|
46
|
+
/** Dragging behavior manager */
|
|
46
47
|
protected _dragger: DraggerMove;
|
|
47
48
|
|
|
48
|
-
/**
|
|
49
|
+
/** Stores the current and target progress values */
|
|
49
50
|
protected _progressLerp: NSlideProgress.IWithLerp = { current: 0, target: 0 };
|
|
50
51
|
|
|
51
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* Gets the current progress value.
|
|
54
|
+
*/
|
|
52
55
|
get progress() {
|
|
53
56
|
return this._progressLerp.current;
|
|
54
57
|
}
|
|
55
58
|
|
|
56
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* Gets the nearest stepped progress value.
|
|
61
|
+
*/
|
|
57
62
|
get steppedProgress() {
|
|
58
63
|
return this._getNearestStep(this._progressLerp.current);
|
|
59
64
|
}
|
|
60
65
|
|
|
61
|
-
/**
|
|
66
|
+
/** Timeline for smooth transitions */
|
|
62
67
|
protected _timelineTo?: Timeline;
|
|
63
68
|
|
|
64
|
-
/**
|
|
69
|
+
/** Timeout for sticky behavior at the end */
|
|
65
70
|
protected _stickyEndTimeout?: NodeJS.Timeout;
|
|
66
71
|
|
|
67
|
-
/**
|
|
72
|
+
/** Determines if dragging is allowed */
|
|
68
73
|
protected _canDragMove = false;
|
|
69
74
|
|
|
70
|
-
/** Direction */
|
|
75
|
+
/** Direction of progress */
|
|
71
76
|
protected _direction: 1 | -1 = 1;
|
|
72
77
|
|
|
73
|
-
/**
|
|
78
|
+
/** Intensity of wheel interaction */
|
|
74
79
|
protected _wheelIntensity = 0;
|
|
75
80
|
|
|
76
|
-
/** Current handler */
|
|
81
|
+
/** Current handler for user interactions: 'wheel' or 'drag' */
|
|
77
82
|
protected _currentHandler: 'wheel' | 'drag' = 'wheel';
|
|
78
83
|
|
|
79
|
-
/**
|
|
84
|
+
/** Checks if the page is scrolling */
|
|
80
85
|
protected _createIsPageScrolling: ReturnType<typeof createIsPageScrolling>;
|
|
81
86
|
|
|
82
87
|
constructor(initialProps?: StaticProps & ChangeableProps, canInit = true) {
|
|
@@ -84,80 +89,88 @@ export class SlideProgress<
|
|
|
84
89
|
|
|
85
90
|
const { container } = this.props;
|
|
86
91
|
|
|
87
|
-
//
|
|
92
|
+
// Create the animation frame
|
|
88
93
|
this._animationFrame = new AnimationFrame();
|
|
89
94
|
this._animationFrame.addCallback('frame', () =>
|
|
90
95
|
this._handleAnimationFrame(),
|
|
91
96
|
);
|
|
92
97
|
|
|
93
|
-
//
|
|
98
|
+
// Create the dragger
|
|
94
99
|
this._dragger = new DraggerMove({ container });
|
|
95
100
|
this._dragger.addCallback('move', (event) => this._handleDrag(event));
|
|
96
101
|
this._dragger.addCallback('start', ({ event }) => event.stopPropagation());
|
|
97
102
|
this._dragger.addCallback('end', () => this._handleDragEnd());
|
|
98
103
|
|
|
99
|
-
//
|
|
104
|
+
// Add wheel event listener
|
|
100
105
|
this.addEventListener(container, 'wheel', (event) =>
|
|
101
106
|
this._handleWheel(event),
|
|
102
107
|
);
|
|
103
108
|
|
|
104
|
-
//
|
|
109
|
+
// Create page scrolling check
|
|
105
110
|
this._createIsPageScrolling = createIsPageScrolling();
|
|
106
111
|
|
|
107
|
-
//
|
|
112
|
+
// Initialize the class
|
|
108
113
|
if (canInit) {
|
|
109
114
|
this.init();
|
|
110
115
|
}
|
|
111
116
|
}
|
|
112
117
|
|
|
118
|
+
/**
|
|
119
|
+
* Handles mutation of properties.
|
|
120
|
+
*/
|
|
113
121
|
protected _onPropsMutate() {
|
|
114
122
|
super._onPropsMutate();
|
|
115
123
|
|
|
116
124
|
this._dragger.changeProps({ isEnabled: this.props.hasDrag });
|
|
117
125
|
}
|
|
118
126
|
|
|
119
|
-
/**
|
|
127
|
+
/**
|
|
128
|
+
* Handles wheel events for adjusting progress.
|
|
129
|
+
* @param event - The wheel event.
|
|
130
|
+
*/
|
|
120
131
|
protected _handleWheel(event: WheelEvent) {
|
|
121
132
|
if (this._timelineTo || !this.props.hasWheel) {
|
|
122
133
|
return;
|
|
123
134
|
}
|
|
124
135
|
|
|
125
|
-
//
|
|
136
|
+
// Clear sticky timeout
|
|
126
137
|
if (this._stickyEndTimeout) {
|
|
127
138
|
clearTimeout(this._stickyEndTimeout);
|
|
128
139
|
this._stickyEndTimeout = undefined;
|
|
129
140
|
}
|
|
130
141
|
|
|
131
|
-
//
|
|
142
|
+
// Vars
|
|
132
143
|
const { _progressLerp: progress } = this;
|
|
133
144
|
const { container, min, max, wheelSpeed } = this.props;
|
|
134
145
|
|
|
135
|
-
//
|
|
146
|
+
// Update handler
|
|
136
147
|
this._currentHandler = 'wheel';
|
|
137
148
|
|
|
138
|
-
//
|
|
149
|
+
// Normalize wheel data
|
|
139
150
|
const wheel = normalizeWheel(event);
|
|
140
151
|
const y = (wheel.pixelY / container.clientHeight) * wheelSpeed;
|
|
141
152
|
|
|
142
|
-
//
|
|
153
|
+
// Update direction and target progress
|
|
143
154
|
this._wheelIntensity += y;
|
|
144
155
|
this._direction = this._wheelIntensity > 0 ? 1 : -1;
|
|
145
|
-
|
|
146
|
-
// update target
|
|
147
156
|
progress.target = clamp(progress.target + y, [min, max]);
|
|
157
|
+
|
|
148
158
|
this._animationFrame.play();
|
|
149
159
|
|
|
150
|
-
//
|
|
160
|
+
// Set timeout for sticky behavior
|
|
151
161
|
this._stickyEndTimeout = setTimeout(() => {
|
|
152
162
|
this._wheelIntensity = 0;
|
|
153
163
|
this._goStickyEnd();
|
|
154
164
|
}, 100);
|
|
155
165
|
|
|
156
|
-
//
|
|
166
|
+
// Callbacks
|
|
157
167
|
this.callbacks.tbt('wheel', wheel);
|
|
158
168
|
}
|
|
159
169
|
|
|
160
|
-
/**
|
|
170
|
+
/**
|
|
171
|
+
* Checks if dragging is allowed.
|
|
172
|
+
* @param absDiff - Absolute difference in dragging distance.
|
|
173
|
+
*/
|
|
161
174
|
protected _checkCanDragMove(absDiff: NDraggerBase.IVector2) {
|
|
162
175
|
const { dragDirection, dragThreshold } = this.props;
|
|
163
176
|
|
|
@@ -180,7 +193,10 @@ export class SlideProgress<
|
|
|
180
193
|
return false;
|
|
181
194
|
}
|
|
182
195
|
|
|
183
|
-
/**
|
|
196
|
+
/**
|
|
197
|
+
* Handles the drag movement for adjusting progress.
|
|
198
|
+
* @param data - The drag event data.
|
|
199
|
+
*/
|
|
184
200
|
protected _handleDrag(data: NDraggerMove.IMoveParameter) {
|
|
185
201
|
const isPageScrolling = this._createIsPageScrolling.get();
|
|
186
202
|
|
|
@@ -201,11 +217,10 @@ export class SlideProgress<
|
|
|
201
217
|
}
|
|
202
218
|
event.stopPropagation();
|
|
203
219
|
|
|
204
|
-
//
|
|
220
|
+
// Update handler
|
|
205
221
|
this._currentHandler = 'drag';
|
|
206
222
|
|
|
207
|
-
//
|
|
208
|
-
|
|
223
|
+
// Drag logic
|
|
209
224
|
const defaultIterator = dragDirection === 'y' ? step.y : step.x;
|
|
210
225
|
const iteratorDivider =
|
|
211
226
|
dragDirection === 'y' ? container.clientHeight : container.clientWidth;
|
|
@@ -218,18 +233,23 @@ export class SlideProgress<
|
|
|
218
233
|
|
|
219
234
|
this._animationFrame.play();
|
|
220
235
|
|
|
221
|
-
//
|
|
236
|
+
// Callbacks
|
|
222
237
|
this.callbacks.tbt('dragMove', data);
|
|
223
238
|
}
|
|
224
239
|
|
|
225
|
-
/**
|
|
240
|
+
/**
|
|
241
|
+
* Handles the end of a drag event and triggers sticky behavior.
|
|
242
|
+
*/
|
|
226
243
|
private _handleDragEnd() {
|
|
227
244
|
this._canDragMove = false;
|
|
228
245
|
|
|
229
246
|
this._goStickyEnd();
|
|
230
247
|
}
|
|
231
248
|
|
|
232
|
-
/**
|
|
249
|
+
/**
|
|
250
|
+
* Gets the nearest step value to the given progress value.
|
|
251
|
+
* @param value - The progress value.
|
|
252
|
+
*/
|
|
233
253
|
protected _getNearestStep(value: number) {
|
|
234
254
|
const { step, stepThreshold: stepThresholdProp, dragSpeed } = this.props;
|
|
235
255
|
const threshold = clamp(stepThresholdProp, [0.001, 0.5]);
|
|
@@ -255,11 +275,13 @@ export class SlideProgress<
|
|
|
255
275
|
return Math.round(value / this.props.step) * this.props.step;
|
|
256
276
|
}
|
|
257
277
|
|
|
258
|
-
/**
|
|
278
|
+
/**
|
|
279
|
+
* Handles the animation frame and updates the progress values.
|
|
280
|
+
*/
|
|
259
281
|
protected _handleAnimationFrame() {
|
|
260
282
|
const { _progressLerp: progress } = this;
|
|
261
283
|
const { ease, friction, step } = this.props;
|
|
262
|
-
const {
|
|
284
|
+
const { fpsMultiplier } = this._animationFrame;
|
|
263
285
|
|
|
264
286
|
const nearestSteppedProgress = this._getNearestStep(progress.target);
|
|
265
287
|
|
|
@@ -267,11 +289,11 @@ export class SlideProgress<
|
|
|
267
289
|
progress.target = lerp(
|
|
268
290
|
progress.target,
|
|
269
291
|
nearestSteppedProgress,
|
|
270
|
-
friction * ease *
|
|
292
|
+
friction * ease * fpsMultiplier,
|
|
271
293
|
0,
|
|
272
294
|
);
|
|
273
295
|
|
|
274
|
-
this._updateCurrentProgress(ease *
|
|
296
|
+
this._updateCurrentProgress(ease * fpsMultiplier);
|
|
275
297
|
|
|
276
298
|
if (
|
|
277
299
|
progress.current === progress.target &&
|
|
@@ -284,12 +306,17 @@ export class SlideProgress<
|
|
|
284
306
|
this.render();
|
|
285
307
|
}
|
|
286
308
|
|
|
287
|
-
/**
|
|
309
|
+
/**
|
|
310
|
+
* Renders the component and triggers any necessary callbacks.
|
|
311
|
+
*/
|
|
288
312
|
public render() {
|
|
289
313
|
this.callbacks.tbt('render', undefined);
|
|
290
314
|
}
|
|
291
315
|
|
|
292
|
-
/**
|
|
316
|
+
/**
|
|
317
|
+
* Updates the current progress and triggers callbacks if necessary.
|
|
318
|
+
* @param ease - The ease value for interpolation.
|
|
319
|
+
*/
|
|
293
320
|
protected _updateCurrentProgress(ease: number) {
|
|
294
321
|
const progress = this._progressLerp;
|
|
295
322
|
|
|
@@ -304,7 +331,9 @@ export class SlideProgress<
|
|
|
304
331
|
}
|
|
305
332
|
}
|
|
306
333
|
|
|
307
|
-
/**
|
|
334
|
+
/**
|
|
335
|
+
* Sticks the progress to the nearest step at the end of user interaction.
|
|
336
|
+
*/
|
|
308
337
|
protected _goStickyEnd() {
|
|
309
338
|
const { stickyEndDuration } = this.props;
|
|
310
339
|
|
|
@@ -328,7 +357,9 @@ export class SlideProgress<
|
|
|
328
357
|
});
|
|
329
358
|
}
|
|
330
359
|
|
|
331
|
-
/**
|
|
360
|
+
/**
|
|
361
|
+
* Animates the progress to a specific value.
|
|
362
|
+
*/
|
|
332
363
|
public to({
|
|
333
364
|
value: endValue,
|
|
334
365
|
duration: durationProp = 500,
|
|
@@ -370,7 +401,9 @@ export class SlideProgress<
|
|
|
370
401
|
this._animationFrame.play();
|
|
371
402
|
}
|
|
372
403
|
|
|
373
|
-
/**
|
|
404
|
+
/**
|
|
405
|
+
* Destroys the component and clears all timeouts and resources.
|
|
406
|
+
*/
|
|
374
407
|
protected _destroy() {
|
|
375
408
|
super._destroy();
|
|
376
409
|
|
|
@@ -5,88 +5,97 @@ import { NDraggerMove } from '../DraggerMove';
|
|
|
5
5
|
|
|
6
6
|
export namespace NSlideProgress {
|
|
7
7
|
export interface IStaticProps extends NComponent.IStaticProps {
|
|
8
|
-
/** HTML
|
|
8
|
+
/** HTML container element where the component is applied */
|
|
9
9
|
container: HTMLElement;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export interface IChangeableProps extends NComponent.IChangeableProps {
|
|
13
|
-
/** Minimum progress
|
|
13
|
+
/** Minimum value of the progress */
|
|
14
14
|
min: number;
|
|
15
|
-
/** Maximum progress
|
|
15
|
+
/** Maximum value of the progress */
|
|
16
16
|
max: number;
|
|
17
|
-
/**
|
|
17
|
+
/** The step size for progress increments */
|
|
18
18
|
step: number;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Threshold to determine step size changes. Ranges from 0.001 to 0.5.
|
|
21
21
|
* @default 0.1
|
|
22
22
|
*/
|
|
23
23
|
stepThreshold?: number;
|
|
24
24
|
/**
|
|
25
|
-
* Linear interpolation
|
|
25
|
+
* Linear interpolation easing factor
|
|
26
26
|
* @default 0.1
|
|
27
27
|
*/
|
|
28
28
|
ease?: number;
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* Friction applied during interpolation
|
|
31
31
|
* @default 0.5
|
|
32
32
|
*/
|
|
33
33
|
friction?: number;
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* Enable or disable drag events for progress control
|
|
36
36
|
* @default true
|
|
37
37
|
*/
|
|
38
38
|
hasDrag?: boolean;
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
40
|
+
* Speed factor for dragging movements
|
|
41
41
|
* @default 1
|
|
42
42
|
*/
|
|
43
43
|
dragSpeed?: number;
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
45
|
+
* Direction of the drag movement (either 'x' or 'y')
|
|
46
46
|
* @default 'y'
|
|
47
47
|
*/
|
|
48
48
|
dragDirection?: 'x' | 'y';
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
50
|
+
* Enable or disable mouse wheel events for progress control
|
|
51
51
|
* @default true
|
|
52
52
|
*/
|
|
53
53
|
hasWheel?: boolean;
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
55
|
+
* Speed factor for mouse wheel movements
|
|
56
56
|
* @default 1
|
|
57
57
|
*/
|
|
58
58
|
wheelSpeed?: number;
|
|
59
59
|
/**
|
|
60
|
-
* Duration
|
|
60
|
+
* Duration for sticky animation to snap to the nearest step. If `null`, sticky animation is disabled.
|
|
61
61
|
* @default 500
|
|
62
62
|
*/
|
|
63
63
|
stickyEndDuration?: TDuration | null;
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
65
|
+
* Minimum threshold for drag movements (in pixels).
|
|
66
66
|
* @default 3
|
|
67
67
|
*/
|
|
68
68
|
dragThreshold?: number;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
export interface ICallbacksTypes extends NComponent.ICallbacksTypes {
|
|
72
|
+
/** Fired during the rendering process */
|
|
72
73
|
render: undefined;
|
|
74
|
+
/** Fired when a step is completed */
|
|
73
75
|
step: undefined;
|
|
76
|
+
/** Fired when a wheel event is detected */
|
|
74
77
|
wheel: TNormalizeWheel;
|
|
78
|
+
/** Fired when a drag event moves the slider */
|
|
75
79
|
dragMove: NDraggerMove.IMoveParameter;
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
export interface IWithLerp {
|
|
83
|
+
/** Current progress value */
|
|
79
84
|
current: number;
|
|
85
|
+
/** Target progress value */
|
|
80
86
|
target: number;
|
|
81
87
|
}
|
|
82
88
|
|
|
83
89
|
export type TDuration = number | ((multiplier: number) => number);
|
|
84
90
|
|
|
85
91
|
export interface IToProps {
|
|
92
|
+
/** Target progress value */
|
|
86
93
|
value: number;
|
|
87
|
-
/**
|
|
94
|
+
/** Duration of the animation (in ms or function). Default is `500`. */
|
|
88
95
|
duration?: TDuration;
|
|
96
|
+
/** Callback to be fired during the animation progress */
|
|
89
97
|
onProgress?: (props: NTimeline.ICallbacksTypes['progress']) => void;
|
|
98
|
+
/** Callback to be fired when the animation ends */
|
|
90
99
|
onEnd?: () => void;
|
|
91
100
|
}
|
|
92
101
|
}
|
|
@@ -10,8 +10,9 @@ export type { NSplitText };
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* SplitText is a component that splits your text into lines, words, and letters so that you can animate them.
|
|
13
|
-
* It supports auto-resizing for lines and styled content when using
|
|
14
|
-
*
|
|
13
|
+
* It supports auto-resizing for lines and styled content when using HTML inside your text.
|
|
14
|
+
*
|
|
15
|
+
* Inspired by GSAP's SplitText plugin and SplitType.
|
|
15
16
|
*
|
|
16
17
|
* P.S. Apply `fontKerning: none` to your container to prevent large layout shifts.
|
|
17
18
|
*
|
|
@@ -46,73 +47,105 @@ export class SplitText<
|
|
|
46
47
|
return `${getApp().prefix}split-text`;
|
|
47
48
|
}
|
|
48
49
|
|
|
50
|
+
/**
|
|
51
|
+
* Class name used for individual letters.
|
|
52
|
+
*/
|
|
49
53
|
get letterClassName() {
|
|
50
54
|
return this.className('__letter');
|
|
51
55
|
}
|
|
52
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Class name used for individual words.
|
|
59
|
+
*/
|
|
53
60
|
get wordClassName() {
|
|
54
61
|
return this.className('__word');
|
|
55
62
|
}
|
|
56
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Class name used for individual lines.
|
|
66
|
+
*/
|
|
57
67
|
get lineClassName() {
|
|
58
68
|
return this.className('__line');
|
|
59
69
|
}
|
|
60
70
|
|
|
61
|
-
/**
|
|
71
|
+
/**
|
|
72
|
+
* Initial HTML content of the container before splitting.
|
|
73
|
+
*/
|
|
62
74
|
protected _initialHTML: string;
|
|
63
75
|
|
|
64
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* Tracks if the text has already been split into base elements (words & letters).
|
|
78
|
+
*/
|
|
65
79
|
protected _isBaseSplit = false;
|
|
66
80
|
|
|
67
|
-
/**
|
|
81
|
+
/**
|
|
82
|
+
* The text container where the split text is stored.
|
|
83
|
+
*/
|
|
68
84
|
protected _container: HTMLElement;
|
|
69
85
|
|
|
70
|
-
/**
|
|
86
|
+
/**
|
|
87
|
+
* Returns the text container element.
|
|
88
|
+
*/
|
|
71
89
|
get container() {
|
|
72
90
|
return this._container;
|
|
73
91
|
}
|
|
74
92
|
|
|
75
|
-
/**
|
|
93
|
+
/**
|
|
94
|
+
* List of letter elements generated after splitting.
|
|
95
|
+
*/
|
|
76
96
|
protected _letters: NSplitText.ILetter[];
|
|
77
97
|
|
|
78
|
-
/**
|
|
98
|
+
/**
|
|
99
|
+
* Returns the list of letter elements.
|
|
100
|
+
*/
|
|
79
101
|
get letters() {
|
|
80
102
|
return this._letters;
|
|
81
103
|
}
|
|
82
104
|
|
|
83
|
-
/**
|
|
105
|
+
/**
|
|
106
|
+
* List of word elements generated after splitting.
|
|
107
|
+
*/
|
|
84
108
|
protected _words: NSplitText.IWord[];
|
|
85
109
|
|
|
86
|
-
/**
|
|
110
|
+
/**
|
|
111
|
+
* Returns the list of word elements.
|
|
112
|
+
*/
|
|
87
113
|
get words() {
|
|
88
114
|
return this._words;
|
|
89
115
|
}
|
|
90
116
|
|
|
91
|
-
/**
|
|
117
|
+
/**
|
|
118
|
+
* List of line elements generated after splitting.
|
|
119
|
+
*/
|
|
92
120
|
protected _lines: NSplitText.ILine[];
|
|
93
121
|
|
|
94
|
-
/**
|
|
122
|
+
/**
|
|
123
|
+
* Returns the list of line elements.
|
|
124
|
+
*/
|
|
95
125
|
get lines() {
|
|
96
126
|
return this._lines;
|
|
97
127
|
}
|
|
98
128
|
|
|
99
|
-
/**
|
|
129
|
+
/**
|
|
130
|
+
* Result from `wrapLines` utility used to manage the split lines.
|
|
131
|
+
* @ignore
|
|
132
|
+
*/
|
|
100
133
|
protected _lineWrapper?: ReturnType<typeof wrapLines>;
|
|
101
134
|
|
|
102
135
|
constructor(initialProps: StaticProps & ChangeableProps, canInit = true) {
|
|
103
136
|
super(initialProps, false);
|
|
104
137
|
|
|
105
|
-
//
|
|
138
|
+
// Get text container
|
|
106
139
|
this._container = selectOne(this.props.container) as HTMLElement;
|
|
107
140
|
this.toggleClassName(this._container, this.className(''), true);
|
|
108
141
|
|
|
109
|
-
//
|
|
142
|
+
// Disable translation for text elements
|
|
110
143
|
this._container.translate = false;
|
|
111
144
|
|
|
112
|
-
//
|
|
145
|
+
// Store initial HTML content
|
|
113
146
|
this._initialHTML = this._container.innerHTML;
|
|
114
147
|
|
|
115
|
-
//
|
|
148
|
+
// Initialize default properties
|
|
116
149
|
this._letters = [];
|
|
117
150
|
this._words = [];
|
|
118
151
|
this._lines = [];
|
|
@@ -122,13 +155,18 @@ export class SplitText<
|
|
|
122
155
|
}
|
|
123
156
|
}
|
|
124
157
|
|
|
158
|
+
/**
|
|
159
|
+
* Initializes the component.
|
|
160
|
+
*/
|
|
125
161
|
protected _init() {
|
|
126
162
|
super._init();
|
|
127
163
|
|
|
128
164
|
this._setResize();
|
|
129
165
|
}
|
|
130
166
|
|
|
131
|
-
/**
|
|
167
|
+
/**
|
|
168
|
+
* Sets up resize events for the component, allowing it to respond to viewport or container size changes.
|
|
169
|
+
*/
|
|
132
170
|
protected _setResize() {
|
|
133
171
|
const { viewportTarget, resizeDebounce, hasLines } = this.props;
|
|
134
172
|
|
|
@@ -150,24 +188,24 @@ export class SplitText<
|
|
|
150
188
|
this.addDestroyableAction(() => resizeHandler.remove());
|
|
151
189
|
}
|
|
152
190
|
|
|
153
|
-
/**
|
|
191
|
+
/**
|
|
192
|
+
* Splits the text in the container into letters, words, and optionally lines, based on the component properties.
|
|
193
|
+
*/
|
|
154
194
|
public splitText() {
|
|
155
|
-
// launch callbacks
|
|
156
195
|
this.callbacks.tbt('beforeSplit', undefined);
|
|
157
196
|
|
|
158
|
-
// split intro base elements
|
|
159
197
|
this._splitBase();
|
|
160
198
|
|
|
161
|
-
// split text into lines
|
|
162
199
|
if (this.props.hasLines) {
|
|
163
200
|
this._splitIntoLines();
|
|
164
201
|
}
|
|
165
202
|
|
|
166
|
-
// launch callbacks
|
|
167
203
|
this.callbacks.tbt('split', undefined);
|
|
168
204
|
}
|
|
169
205
|
|
|
170
|
-
/**
|
|
206
|
+
/**
|
|
207
|
+
* Splits the text into base elements (letters and words).
|
|
208
|
+
*/
|
|
171
209
|
private _splitBase() {
|
|
172
210
|
if (this._isBaseSplit) {
|
|
173
211
|
return;
|
|
@@ -178,8 +216,6 @@ export class SplitText<
|
|
|
178
216
|
|
|
179
217
|
this._isBaseSplit = true;
|
|
180
218
|
|
|
181
|
-
// split text
|
|
182
|
-
|
|
183
219
|
const { helper, words, letters } = splitBase({
|
|
184
220
|
container,
|
|
185
221
|
letterClassName,
|
|
@@ -189,22 +225,24 @@ export class SplitText<
|
|
|
189
225
|
wordTag,
|
|
190
226
|
});
|
|
191
227
|
|
|
192
|
-
//
|
|
193
|
-
|
|
228
|
+
// Clear the original content
|
|
194
229
|
while (container.childNodes[0]) {
|
|
195
230
|
container.childNodes[0].remove();
|
|
196
231
|
}
|
|
197
232
|
|
|
233
|
+
// Append the new elements
|
|
198
234
|
while (helper.childNodes[0]) {
|
|
199
235
|
container.appendChild(helper.childNodes[0]);
|
|
200
236
|
}
|
|
201
237
|
|
|
202
|
-
//
|
|
238
|
+
// Update elements
|
|
203
239
|
this._words = words;
|
|
204
240
|
this._letters = letters;
|
|
205
241
|
}
|
|
206
242
|
|
|
207
|
-
/**
|
|
243
|
+
/**
|
|
244
|
+
* Splits the text into lines by wrapping word elements into line containers.
|
|
245
|
+
*/
|
|
208
246
|
protected _splitIntoLines() {
|
|
209
247
|
const { container, words, lineClassName } = this;
|
|
210
248
|
const { lineTag } = this.props;
|
|
@@ -226,7 +264,9 @@ export class SplitText<
|
|
|
226
264
|
this._lines = this._lineWrapper.lines;
|
|
227
265
|
}
|
|
228
266
|
|
|
229
|
-
/**
|
|
267
|
+
/**
|
|
268
|
+
* Destroys the component, restoring the container to its initial HTML state.
|
|
269
|
+
*/
|
|
230
270
|
protected _destroy() {
|
|
231
271
|
super._destroy();
|
|
232
272
|
|