vevet 3.19.2 → 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 +72 -66
- 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 +12 -5
- 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 +13 -12
- 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 +6 -2
- 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/cjs/version.js +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 +30 -24
- 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 +12 -5
- 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 +11 -12
- 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 +6 -2
- 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/esm/version.js +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 +46 -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/lib/types/version.d.ts +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 +61 -44
- 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 +12 -5
- 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 +16 -21
- package/src/utils/math/clamp.ts +10 -5
- package/src/utils/math/clampScope.ts +9 -2
- package/src/utils/math/easing.ts +6 -2
- 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/src/version.ts +1 -1
- 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 -105
- 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 -114
- 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
|
@@ -18,14 +18,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
exports.Component = void 0;
|
|
19
19
|
var Module_1 = require("../Module");
|
|
20
20
|
/**
|
|
21
|
-
* A class
|
|
21
|
+
* A class representing a component that extends the functionality of the {@link Module} class.
|
|
22
|
+
* It allows for the addition of plugins, which can further extend or enhance the component's behavior.
|
|
22
23
|
*/
|
|
23
24
|
var Component = /** @class */ (function (_super) {
|
|
24
25
|
__extends(Component, _super);
|
|
25
26
|
function Component() {
|
|
26
27
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
27
28
|
}
|
|
28
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* Adds a plugin to the component. The plugin is initialized upon being added,
|
|
31
|
+
* and the plugin's `component` property is set to the current component instance.
|
|
32
|
+
*
|
|
33
|
+
* @param plugin - An instance of the {@link Plugin} class to be added.
|
|
34
|
+
*/
|
|
29
35
|
Component.prototype.addPlugin = function (plugin) {
|
|
30
36
|
if (typeof this._plugins === 'undefined') {
|
|
31
37
|
this._plugins = [];
|
|
@@ -35,12 +41,17 @@ var Component = /** @class */ (function (_super) {
|
|
|
35
41
|
plugin.component = this;
|
|
36
42
|
plugin.init();
|
|
37
43
|
};
|
|
38
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* Destroys all plugins associated with the component.
|
|
46
|
+
* This ensures proper cleanup when the component is destroyed.
|
|
47
|
+
*/
|
|
39
48
|
Component.prototype._destroyPlugins = function () {
|
|
40
49
|
var _a;
|
|
41
50
|
(_a = this._plugins) === null || _a === void 0 ? void 0 : _a.forEach(function (plugin) { return plugin.destroy(); });
|
|
42
51
|
};
|
|
43
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* Destroys the component, ensuring that all plugins are properly destroyed as well.
|
|
54
|
+
*/
|
|
44
55
|
Component.prototype._destroy = function () {
|
|
45
56
|
_super.prototype._destroy.call(this);
|
|
46
57
|
this._destroyPlugins();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/base/Component/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,oCAAmC;AAMnC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/base/Component/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,oCAAmC;AAMnC;;;GAGG;AACH;IAMU,6BAAoD;IAN9D;;IA+CA,CAAC;IAlCC;;;;;OAKG;IACI,6BAAS,GAAhB,UAAuD,MAAS;QAC9D,IAAI,OAAO,IAAI,CAAC,QAAQ,KAAK,WAAW,EAAE;YACxC,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;SACpB;QAED,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAE3B,6CAA6C;QAC7C,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;QACxB,MAAM,CAAC,IAAI,EAAE,CAAC;IAChB,CAAC;IAED;;;OAGG;IACK,mCAAe,GAAvB;;QACE,MAAA,IAAI,CAAC,QAAQ,0CAAE,OAAO,CAAC,UAAC,MAAM,IAAK,OAAA,MAAM,CAAC,OAAO,EAAE,EAAhB,CAAgB,CAAC,CAAC;IACvD,CAAC;IAED;;OAEG;IACO,4BAAQ,GAAlB;QACE,iBAAM,QAAQ,WAAE,CAAC;QAEjB,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IACH,gBAAC;AAAD,CAAC,AA/CD,CAMU,eAAM,GAyCf;AA/CY,8BAAS"}
|
|
@@ -17,61 +17,56 @@ var MutableProps_1 = require("../MutableProps");
|
|
|
17
17
|
var Callbacks_1 = require("../Callbacks");
|
|
18
18
|
var getApp_1 = require("../../utils/internal/getApp");
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* A base class for modules that handle responsive properties, event listeners, and custom callbacks.
|
|
21
|
+
* This class provides a structure for modules that can dynamically respond to viewport changes, property mutations, and various lifecycle events.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
*
|
|
25
|
+
* interface IStaticProps extends NModule.IStaticProps {
|
|
26
|
+
* staticName: 'My name';
|
|
27
|
+
* }
|
|
28
|
+
*
|
|
29
|
+
* interface IChangeableProps extends NModule.IChangeableProps {
|
|
30
|
+
* weight: number;
|
|
31
|
+
* height: number;
|
|
32
|
+
* }
|
|
33
|
+
*
|
|
34
|
+
* interface ICallbacks extends NModule.ICallbacksTypes {}
|
|
35
|
+
*
|
|
36
|
+
* const module = new Module<IStaticProps, IChangeableProps, ICallbacks>({
|
|
37
|
+
* staticName: 'My name',
|
|
38
|
+
* weight: 70,
|
|
39
|
+
* height: 175,
|
|
40
|
+
* }, false);
|
|
41
|
+
*
|
|
42
|
+
* module.addResponsiveProps({
|
|
43
|
+
* breakpoint: 'viewport_phone',
|
|
44
|
+
* settings: {
|
|
45
|
+
* weight: 80,
|
|
46
|
+
* },
|
|
47
|
+
* });
|
|
48
|
+
*
|
|
49
|
+
* module.init();
|
|
50
|
+
*
|
|
51
|
+
* module.addCallback('propsMutate', () => console.log('mutate props'));
|
|
52
|
+
* module.addCallback('destroy', () => console.log('destroy'));
|
|
21
53
|
*/
|
|
22
54
|
var Module = /** @class */ (function () {
|
|
23
55
|
/**
|
|
24
|
-
*
|
|
56
|
+
* Creates a new instance of the Module class.
|
|
25
57
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* }
|
|
29
|
-
|
|
30
|
-
* interface IChangeableProps extends NModule.IChangeableProps {
|
|
31
|
-
* weight: number;
|
|
32
|
-
* height: number;
|
|
33
|
-
* }
|
|
34
|
-
|
|
35
|
-
* interface ICallbacks extends NModule.ICallbacksTypes {}
|
|
36
|
-
|
|
37
|
-
* const module = new Module<IStaticProps, IChangeableProps, ICallbacks>(
|
|
38
|
-
* {
|
|
39
|
-
* staticName: 'My name',
|
|
40
|
-
* weight: 70,
|
|
41
|
-
* height: 175,
|
|
42
|
-
* },
|
|
43
|
-
* false
|
|
44
|
-
* );
|
|
45
|
-
|
|
46
|
-
* module.addResponsiveProps({
|
|
47
|
-
* breakpoint: 'viewport_phone',
|
|
48
|
-
* settings: {
|
|
49
|
-
* weight: 80,
|
|
50
|
-
* },
|
|
51
|
-
* });
|
|
52
|
-
|
|
53
|
-
* module.init();
|
|
54
|
-
|
|
55
|
-
* module.addCallback('propsMutate', () => console.log('mutate props'));
|
|
56
|
-
|
|
57
|
-
* module.addCallback('destroy', () => console.log('destroy'));
|
|
58
|
+
* @param initialProps - The initial static and changeable properties to be used by the module.
|
|
59
|
+
* @param canInit - Whether to automatically initialize the module after construction. Set this to `false` if you want to add responsive properties before initializing.
|
|
58
60
|
*/
|
|
59
|
-
function Module(
|
|
60
|
-
/** Initial properties */
|
|
61
|
-
initialProps,
|
|
62
|
-
/**
|
|
63
|
-
* Defines if you need to call {@linkcode Module.init} at the constructor's end.
|
|
64
|
-
* If you want to add responsive properties, set this parameter to `false`.
|
|
65
|
-
*/
|
|
66
|
-
canInit) {
|
|
61
|
+
function Module(initialProps, canInit) {
|
|
67
62
|
if (canInit === void 0) { canInit = true; }
|
|
68
63
|
var _this = this;
|
|
69
|
-
/**
|
|
64
|
+
/** Tracks whether the module has been initialized */
|
|
70
65
|
this._isInitialized = false;
|
|
71
|
-
/**
|
|
66
|
+
/** Tracks whether the module has been destroyed */
|
|
72
67
|
this._isDestroyed = false;
|
|
73
68
|
if (!(0, getApp_1.getApp)()) {
|
|
74
|
-
throw new Error('Vevet.Application does not exist yet
|
|
69
|
+
throw new Error('Vevet.Application does not exist yet');
|
|
75
70
|
}
|
|
76
71
|
this._callbacks = new Callbacks_1.Callbacks();
|
|
77
72
|
this._listeners = [];
|
|
@@ -84,13 +79,16 @@ var Module = /** @class */ (function () {
|
|
|
84
79
|
}
|
|
85
80
|
}
|
|
86
81
|
/**
|
|
87
|
-
*
|
|
82
|
+
* Retrieves the default properties for the module. This method is intended to be overridden in subclasses to provide default values for the module's properties.
|
|
88
83
|
*/
|
|
89
84
|
Module.prototype._getDefaultProps = function () {
|
|
90
85
|
return {};
|
|
91
86
|
};
|
|
92
87
|
Object.defineProperty(Module.prototype, "props", {
|
|
93
|
-
/**
|
|
88
|
+
/**
|
|
89
|
+
* The current properties of the module, which include both static and changeable properties.
|
|
90
|
+
* These can be retrieved dynamically during the module's lifecycle.
|
|
91
|
+
*/
|
|
94
92
|
get: function () {
|
|
95
93
|
return this._mutableProps.props;
|
|
96
94
|
},
|
|
@@ -98,7 +96,9 @@ var Module = /** @class */ (function () {
|
|
|
98
96
|
configurable: true
|
|
99
97
|
});
|
|
100
98
|
Object.defineProperty(Module.prototype, "callbacks", {
|
|
101
|
-
/**
|
|
99
|
+
/**
|
|
100
|
+
* Retrieves the module's registered callbacks.
|
|
101
|
+
*/
|
|
102
102
|
get: function () {
|
|
103
103
|
return this._callbacks;
|
|
104
104
|
},
|
|
@@ -106,7 +106,7 @@ var Module = /** @class */ (function () {
|
|
|
106
106
|
configurable: true
|
|
107
107
|
});
|
|
108
108
|
Object.defineProperty(Module.prototype, "name", {
|
|
109
|
-
/**
|
|
109
|
+
/** The name of the module, derived from the class name */
|
|
110
110
|
get: function () {
|
|
111
111
|
return this.constructor.name;
|
|
112
112
|
},
|
|
@@ -114,7 +114,7 @@ var Module = /** @class */ (function () {
|
|
|
114
114
|
configurable: true
|
|
115
115
|
});
|
|
116
116
|
Object.defineProperty(Module.prototype, "prefix", {
|
|
117
|
-
/**
|
|
117
|
+
/** Optional prefix for class names used by the module */
|
|
118
118
|
get: function () {
|
|
119
119
|
return '';
|
|
120
120
|
},
|
|
@@ -122,7 +122,9 @@ var Module = /** @class */ (function () {
|
|
|
122
122
|
configurable: true
|
|
123
123
|
});
|
|
124
124
|
Object.defineProperty(Module.prototype, "isInitialized", {
|
|
125
|
-
/**
|
|
125
|
+
/**
|
|
126
|
+
* Checks if the module has been initialized.
|
|
127
|
+
*/
|
|
126
128
|
get: function () {
|
|
127
129
|
return this._isInitialized;
|
|
128
130
|
},
|
|
@@ -130,14 +132,20 @@ var Module = /** @class */ (function () {
|
|
|
130
132
|
configurable: true
|
|
131
133
|
});
|
|
132
134
|
Object.defineProperty(Module.prototype, "isDestroyed", {
|
|
133
|
-
/**
|
|
135
|
+
/**
|
|
136
|
+
* Checks if the module has been destroyed.
|
|
137
|
+
*/
|
|
134
138
|
get: function () {
|
|
135
139
|
return this._isDestroyed;
|
|
136
140
|
},
|
|
137
141
|
enumerable: false,
|
|
138
142
|
configurable: true
|
|
139
143
|
});
|
|
140
|
-
/**
|
|
144
|
+
/**
|
|
145
|
+
* Adds responsive property rules to the module. This must be done before initialization.
|
|
146
|
+
*
|
|
147
|
+
* @param rules - The responsive property rules to be added.
|
|
148
|
+
*/
|
|
141
149
|
Module.prototype.addResponsiveProps = function (rules) {
|
|
142
150
|
if (this.isInitialized) {
|
|
143
151
|
throw new Error('Responsive properties cannot be added after `init` is called');
|
|
@@ -146,7 +154,11 @@ var Module = /** @class */ (function () {
|
|
|
146
154
|
this._mutableProps.addResponsiveProps(rules);
|
|
147
155
|
}
|
|
148
156
|
};
|
|
149
|
-
/**
|
|
157
|
+
/**
|
|
158
|
+
* Updates the changeable properties of the module.
|
|
159
|
+
*
|
|
160
|
+
* @param props - The properties to be updated.
|
|
161
|
+
*/
|
|
150
162
|
Module.prototype.changeProps = function (props) {
|
|
151
163
|
if (this.isDestroyed) {
|
|
152
164
|
return;
|
|
@@ -155,12 +167,14 @@ var Module = /** @class */ (function () {
|
|
|
155
167
|
this._callbacks.tbt('propsChange', undefined);
|
|
156
168
|
};
|
|
157
169
|
/**
|
|
158
|
-
* This method is called
|
|
170
|
+
* This method is called internally when the module's properties change.
|
|
159
171
|
*/
|
|
160
172
|
Module.prototype._onPropsMutate = function () {
|
|
161
173
|
this._callbacks.tbt('propsMutate', undefined);
|
|
162
174
|
};
|
|
163
|
-
/**
|
|
175
|
+
/**
|
|
176
|
+
* Initializes the module. Calls the internal `_init` method and marks the module as initialized.
|
|
177
|
+
*/
|
|
164
178
|
Module.prototype.init = function () {
|
|
165
179
|
if (this.isInitialized) {
|
|
166
180
|
return;
|
|
@@ -168,26 +182,49 @@ var Module = /** @class */ (function () {
|
|
|
168
182
|
this._isInitialized = true;
|
|
169
183
|
this._init();
|
|
170
184
|
};
|
|
171
|
-
/**
|
|
185
|
+
/**
|
|
186
|
+
* Additional initialization logic that can be overridden in subclasses.
|
|
187
|
+
*/
|
|
172
188
|
Module.prototype._init = function () { };
|
|
173
|
-
/**
|
|
189
|
+
/**
|
|
190
|
+
* Adds an action to the list of actions to be executed when the module is destroyed.
|
|
191
|
+
*
|
|
192
|
+
* @param action - The function to execute during destruction.
|
|
193
|
+
*/
|
|
174
194
|
Module.prototype.addDestroyableAction = function (action) {
|
|
175
195
|
this._destroyableActions.push(action);
|
|
176
196
|
};
|
|
177
197
|
/**
|
|
178
|
-
*
|
|
198
|
+
* Adds a viewport callback that will be automatically removed when the module is destroyed.
|
|
199
|
+
*
|
|
200
|
+
* @param target - The viewport target (e.g., width or height).
|
|
201
|
+
* @param action - The callback function to execute when the viewport target changes.
|
|
202
|
+
* @param data - Additional data for the callback.
|
|
179
203
|
*/
|
|
180
204
|
Module.prototype.addViewportCallback = function (target, action, data) {
|
|
181
205
|
if (data === void 0) { data = {}; }
|
|
182
206
|
var callback = (0, getApp_1.getApp)().viewport.callbacks.add(target, action, __assign(__assign({}, data), { name: this.constructor.name }));
|
|
183
207
|
this.addDestroyableAction(function () { return callback.remove(); });
|
|
184
208
|
};
|
|
185
|
-
/**
|
|
209
|
+
/**
|
|
210
|
+
* Adds a custom callback to the module.
|
|
211
|
+
*
|
|
212
|
+
* @param target - The event type to listen for (e.g., 'propsChange', 'destroy').
|
|
213
|
+
* @param action - The function to execute when the event is triggered.
|
|
214
|
+
* @param settings - Additional settings for the callback.
|
|
215
|
+
*/
|
|
186
216
|
Module.prototype.addCallback = function (target, action, settings) {
|
|
187
217
|
if (settings === void 0) { settings = {}; }
|
|
188
218
|
return this.callbacks.add(target, action, settings);
|
|
189
219
|
};
|
|
190
|
-
/**
|
|
220
|
+
/**
|
|
221
|
+
* Adds a DOM event listener that will be automatically removed when the module is destroyed.
|
|
222
|
+
*
|
|
223
|
+
* @param el - The target element for the event listener.
|
|
224
|
+
* @param target - The event type to listen for (e.g., 'click', 'resize').
|
|
225
|
+
* @param callback - The callback function to execute when the event is triggered.
|
|
226
|
+
* @param options - Additional options for the event listener.
|
|
227
|
+
*/
|
|
191
228
|
Module.prototype.addEventListener = function (el, target, callback, options) {
|
|
192
229
|
var _this = this;
|
|
193
230
|
var listener = (0, vevet_dom_1.addEventListener)(el, target, callback, options);
|
|
@@ -197,6 +234,12 @@ var Module = /** @class */ (function () {
|
|
|
197
234
|
return listener.remove();
|
|
198
235
|
} });
|
|
199
236
|
};
|
|
237
|
+
/**
|
|
238
|
+
* Helper function to generate class names with the module's prefix.
|
|
239
|
+
*
|
|
240
|
+
* @param classNames - The class names to generate.
|
|
241
|
+
* @returns A string of class names with the module's prefix applied.
|
|
242
|
+
*/
|
|
200
243
|
Module.prototype.className = function () {
|
|
201
244
|
var _this = this;
|
|
202
245
|
var classNames = [];
|
|
@@ -205,7 +248,13 @@ var Module = /** @class */ (function () {
|
|
|
205
248
|
}
|
|
206
249
|
return classNames.map(function (value) { return "".concat(_this.prefix).concat(value); }).join(' ');
|
|
207
250
|
};
|
|
208
|
-
/**
|
|
251
|
+
/**
|
|
252
|
+
* Toggles a class name on an element, and keeps track of it for removal when the module is destroyed.
|
|
253
|
+
*
|
|
254
|
+
* @param element - The target DOM element.
|
|
255
|
+
* @param className - The class name to toggle.
|
|
256
|
+
* @param isActive - Whether the class should be added or removed.
|
|
257
|
+
*/
|
|
209
258
|
Module.prototype.toggleClassName = function (element, className, isActive) {
|
|
210
259
|
var isAlreadyExists = element.classList.contains(className);
|
|
211
260
|
element.classList.toggle(className, isActive);
|
|
@@ -213,14 +262,19 @@ var Module = /** @class */ (function () {
|
|
|
213
262
|
this._classNamesToRemove.push({ element: element, className: className });
|
|
214
263
|
}
|
|
215
264
|
};
|
|
216
|
-
/**
|
|
265
|
+
/**
|
|
266
|
+
* Destroys the module, cleaning up resources, callbacks, and event listeners.
|
|
267
|
+
*/
|
|
217
268
|
Module.prototype.destroy = function () {
|
|
218
269
|
if (this.isDestroyed) {
|
|
219
270
|
return;
|
|
220
271
|
}
|
|
221
272
|
this._destroy();
|
|
222
273
|
};
|
|
223
|
-
/**
|
|
274
|
+
/**
|
|
275
|
+
* Internal method to handle the destruction of the module.
|
|
276
|
+
* It removes all callbacks, destroys properties, and cleans up event listeners and class names.
|
|
277
|
+
*/
|
|
224
278
|
Module.prototype._destroy = function () {
|
|
225
279
|
this._callbacks.tbt('destroy', undefined);
|
|
226
280
|
this._callbacks.destroy();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/base/Module/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,uCAKmB;AAEnB,gDAA8D;AAC9D,0CAAqD;AAErD,kDAAiD;AAOjD
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/base/Module/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,uCAKmB;AAEnB,gDAA8D;AAC9D,0CAAqD;AAErD,kDAAiD;AAOjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH;IA0EE;;;;;OAKG;IACH,gBAAY,YAA4C,EAAE,OAAc;QAAd,wBAAA,EAAA,cAAc;QAAxE,iBAwBC;QAlDD,qDAAqD;QAC7C,mBAAc,GAAG,KAAK,CAAC;QAS/B,mDAAmD;QAC3C,iBAAY,GAAG,KAAK,CAAC;QAgB3B,IAAI,CAAC,IAAA,eAAM,GAAE,EAAE;YACb,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CA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,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAE9C,IAAI,CAAC,eAAe,EAAE;YACpB,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,OAAO,SAAA,EAAE,SAAS,WAAA,EAAE,CAAC,CAAC;SACvD;IACH,CAAC;IAED;;OAEG;IACI,wBAAO,GAAd;QACE,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,OAAO;SACR;QAED,IAAI,CAAC,QAAQ,EAAE,CAAC;IAClB,CAAC;IAED;;;OAGG;IACO,yBAAQ,GAAlB;QACE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAC1C,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;QAE1B,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;QAE7B,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,UAAC,MAAM,IAAK,OAAA,MAAM,EAAE,EAAR,CAAQ,CAAC,CAAC;QACvD,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,UAAC,QAAQ,IAAK,OAAA,QAAQ,CAAC,MAAM,EAAE,EAAjB,CAAiB,CAAC,CAAC;QAEzD,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,UAAC,EAAsB;gBAApB,OAAO,aAAA,EAAE,SAAS,eAAA;YACpD,OAAA,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC;QAAnC,CAAmC,CACpC,CAAC;QAEF,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC3B,CAAC;IACH,aAAC;AAAD,CAAC,AA3SD,IA2SC;AA3SY,wBAAM"}
|
|
@@ -23,89 +23,60 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
23
23
|
exports.MutableProps = void 0;
|
|
24
24
|
var getApp_1 = require("../../utils/internal/getApp");
|
|
25
25
|
/**
|
|
26
|
-
* A class for
|
|
27
|
-
*
|
|
28
|
-
* There are two ways to change properties:
|
|
29
|
-
* - To set a resize-listener on window (or use {@linkcode Viewport}).
|
|
30
|
-
* When the window is resized, change the properties with the help of
|
|
31
|
-
* {@linkcode MutableProps.changeProps}
|
|
32
|
-
*
|
|
33
|
-
* - The second way is to use the MutableProps and add responsive properties
|
|
34
|
-
* with help of {@linkcode MutableProps.addResponsiveProps}.
|
|
26
|
+
* A class for managing mutable properties that can change based on window size (responsive design).
|
|
27
|
+
* This allows certain properties to update dynamically when the window is resized or in response to manual changes.
|
|
35
28
|
*
|
|
36
29
|
* @example
|
|
37
30
|
*
|
|
38
31
|
* interface IStatic {
|
|
39
32
|
* static: string;
|
|
40
33
|
* }
|
|
41
|
-
|
|
34
|
+
*
|
|
42
35
|
* interface IChangeable {
|
|
43
36
|
* changeable: string;
|
|
44
37
|
* }
|
|
45
|
-
|
|
38
|
+
*
|
|
46
39
|
* const props = new MutableProps<IStatic, IChangeable>({
|
|
47
40
|
* static: '',
|
|
48
41
|
* changeable: 'something',
|
|
49
42
|
* });
|
|
50
|
-
|
|
43
|
+
*
|
|
51
44
|
* props.addResponsiveProps({
|
|
52
45
|
* breakpoint: 'viewport_phone',
|
|
53
46
|
* settings: {
|
|
54
47
|
* changeable: 'phone',
|
|
55
48
|
* },
|
|
56
49
|
* });
|
|
57
|
-
|
|
50
|
+
*
|
|
58
51
|
* props.changeProps({ changeable: 'changed' });
|
|
59
52
|
*/
|
|
60
53
|
var MutableProps = /** @class */ (function () {
|
|
61
54
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* const static = {
|
|
65
|
-
* myProp: true,
|
|
66
|
-
* };
|
|
55
|
+
* Initializes the `MutableProps` instance with static and changeable properties,
|
|
56
|
+
* and sets up a mutation callback to be called when properties change.
|
|
67
57
|
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* settings: {
|
|
72
|
-
* myProp: false
|
|
73
|
-
* }
|
|
74
|
-
* }
|
|
75
|
-
* ];
|
|
76
|
-
*
|
|
77
|
-
* const props = new MutableProps(static, responsive);
|
|
58
|
+
* @param initProps - Initial properties, including both static and changeable properties.
|
|
59
|
+
* @param _onMutate - Callback function triggered whenever the properties change.
|
|
60
|
+
* @param _name - The name used to identify the set of responsive properties.
|
|
78
61
|
*/
|
|
79
|
-
function MutableProps(
|
|
80
|
-
/**
|
|
81
|
-
* The properties that were set while initialization.
|
|
82
|
-
* These properties will nevet change.
|
|
83
|
-
*/
|
|
84
|
-
_initProps,
|
|
85
|
-
/**
|
|
86
|
-
* A callback that is launched when properties are changed
|
|
87
|
-
*/
|
|
88
|
-
_onMutate,
|
|
89
|
-
/**
|
|
90
|
-
* Name of the responsive properties.
|
|
91
|
-
*/
|
|
92
|
-
_name) {
|
|
62
|
+
function MutableProps(initProps, _onMutate, _name) {
|
|
93
63
|
if (_onMutate === void 0) { _onMutate = function () { }; }
|
|
94
64
|
if (_name === void 0) { _name = 'Responsive Props'; }
|
|
95
|
-
this._initProps = _initProps;
|
|
96
65
|
this._onMutate = _onMutate;
|
|
97
66
|
this._name = _name;
|
|
98
67
|
/**
|
|
99
|
-
* A set of responsive rules
|
|
68
|
+
* A set of responsive rules defining how properties should change based on viewport size or device type.
|
|
69
|
+
* Each rule is defined by a breakpoint and corresponding property settings.
|
|
100
70
|
*/
|
|
101
71
|
this._responsiveRules = [];
|
|
102
|
-
this._refProps = __assign({},
|
|
103
|
-
this._props = __assign({},
|
|
72
|
+
this._refProps = __assign({}, initProps);
|
|
73
|
+
this._props = __assign({}, initProps);
|
|
104
74
|
this._activeBreakpoints = [];
|
|
105
75
|
}
|
|
106
76
|
Object.defineProperty(MutableProps.prototype, "props", {
|
|
107
77
|
/**
|
|
108
|
-
*
|
|
78
|
+
* Retrieves the current properties.
|
|
79
|
+
* These may change either due to responsive rules or through manual updates.
|
|
109
80
|
*/
|
|
110
81
|
get: function () {
|
|
111
82
|
return this._props;
|
|
@@ -114,18 +85,21 @@ var MutableProps = /** @class */ (function () {
|
|
|
114
85
|
configurable: true
|
|
115
86
|
});
|
|
116
87
|
/**
|
|
117
|
-
*
|
|
88
|
+
* Adds responsive rules that define how the properties should change based on viewport breakpoints.
|
|
89
|
+
*
|
|
90
|
+
* @param rules - Responsive rules specifying breakpoints and corresponding property settings.
|
|
118
91
|
*/
|
|
119
92
|
MutableProps.prototype.addResponsiveProps = function (rules) {
|
|
120
93
|
this._responsiveRules.push(rules);
|
|
121
94
|
this._responseProps();
|
|
122
|
-
if (
|
|
95
|
+
if (this._viewportCallback) {
|
|
123
96
|
return;
|
|
124
97
|
}
|
|
125
98
|
this._viewportCallback = (0, getApp_1.getApp)().viewport.callbacks.add('width', this._responseProps.bind(this), { name: this._name });
|
|
126
99
|
};
|
|
127
100
|
/**
|
|
128
|
-
*
|
|
101
|
+
* Handles updating the properties based on the current viewport size.
|
|
102
|
+
* It checks all responsive rules and applies the appropriate settings for active breakpoints.
|
|
129
103
|
*/
|
|
130
104
|
MutableProps.prototype._responseProps = function () {
|
|
131
105
|
var _this = this;
|
|
@@ -135,8 +109,7 @@ var MutableProps = /** @class */ (function () {
|
|
|
135
109
|
var statProp = __assign({}, this._refProps);
|
|
136
110
|
var prevActiveBreakpointsString = __spreadArray([], this._activeBreakpoints, true).join('_');
|
|
137
111
|
this._activeBreakpoints = [];
|
|
138
|
-
//
|
|
139
|
-
// and check if a proper breakpoint exists
|
|
112
|
+
// Evaluate each responsive rule to see if it should be applied
|
|
140
113
|
this._responsiveRules.forEach(function (_a) {
|
|
141
114
|
var settings = _a.settings, breakpoint = _a.breakpoint;
|
|
142
115
|
if (typeof breakpoint === 'number') {
|
|
@@ -173,13 +146,15 @@ var MutableProps = /** @class */ (function () {
|
|
|
173
146
|
// otherwise, change the properties
|
|
174
147
|
this._props = __assign(__assign({}, this._props), newProps);
|
|
175
148
|
}
|
|
176
|
-
// callback
|
|
149
|
+
// Call the mutation callback if properties have changed
|
|
177
150
|
if (isPropsChanged) {
|
|
178
151
|
this._onMutate();
|
|
179
152
|
}
|
|
180
153
|
};
|
|
181
154
|
/**
|
|
182
|
-
*
|
|
155
|
+
* Manually changes the properties. The updated properties persist and trigger the mutation callback.
|
|
156
|
+
*
|
|
157
|
+
* @param props - A partial set of changeable properties to be updated.
|
|
183
158
|
*/
|
|
184
159
|
MutableProps.prototype.changeProps = function (props) {
|
|
185
160
|
this._props = __assign(__assign({}, this._props), props);
|
|
@@ -187,7 +162,7 @@ var MutableProps = /** @class */ (function () {
|
|
|
187
162
|
this._onMutate();
|
|
188
163
|
};
|
|
189
164
|
/**
|
|
190
|
-
*
|
|
165
|
+
* Cleans up and destroys the responsive properties.
|
|
191
166
|
*/
|
|
192
167
|
MutableProps.prototype.destroy = function () {
|
|
193
168
|
if (this._viewportCallback) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/base/MutableProps/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAiD;AAMjD
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/base/MutableProps/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAiD;AAMjD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH;IAgCE;;;;;;;OAOG;IACH,sBACE,SAAwC,EAChC,SAAgC,EAChC,KAA0B;QAD1B,0BAAA,EAAA,0BAA+B,CAAC;QAChC,sBAAA,EAAA,0BAA0B;QAD1B,cAAS,GAAT,SAAS,CAAuB;QAChC,UAAK,GAAL,KAAK,CAAqB;QA3BpC;;;WAGG;QACK,qBAAgB,GAAiD,EAAE,CAAC;QAyB1E,IAAI,CAAC,SAAS,gBAAQ,SAAS,CAAE,CAAC;QAClC,IAAI,CAAC,MAAM,gBAAQ,SAAS,CAAE,CAAC;QAC/B,IAAI,CAAC,kBAAkB,GAAG,EAAE,CAAC;IAC/B,CAAC;IAMD,sBAAI,+BAAK;QAJ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AC,SAAS,EAAE,CAAC;SAClB;IACH,CAAC;IAED;;;;OAIG;IACI,kCAAW,GAAlB,UAAmB,KAA+B;QAChD,IAAI,CAAC,MAAM,yBAAQ,IAAI,CAAC,MAAM,GAAK,KAAK,CAAE,CAAC;QAC3C,IAAI,CAAC,SAAS,yBAAQ,IAAI,CAAC,SAAS,GAAK,KAAK,CAAE,CAAC;QAEjD,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAED;;OAEG;IACI,8BAAO,GAAd;QACE,IAAI,IAAI,CAAC,iBAAiB,EAAE;YAC1B,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC;SACjC;IACH,CAAC;IACH,mBAAC;AAAD,CAAC,AAlKD,IAkKC;AAlKY,oCAAY"}
|
|
@@ -18,23 +18,42 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
exports.Plugin = void 0;
|
|
19
19
|
var Module_1 = require("../Module");
|
|
20
20
|
/**
|
|
21
|
-
* A class for Plugins.
|
|
21
|
+
* A base abstract class for Plugins that extend the functionality of components.
|
|
22
|
+
* A plugin is designed to attach to a component and modify or enhance its behavior.
|
|
23
|
+
* It inherits from the {@link Module} class and adds functionality to work with a component.
|
|
22
24
|
*/
|
|
23
25
|
var Plugin = /** @class */ (function (_super) {
|
|
24
26
|
__extends(Plugin, _super);
|
|
27
|
+
/**
|
|
28
|
+
* Constructs the plugin.
|
|
29
|
+
*
|
|
30
|
+
* @param initialProps - Initial static and changeable properties for the plugin.
|
|
31
|
+
*/
|
|
25
32
|
function Plugin(initialProps) {
|
|
26
33
|
return _super.call(this, initialProps, false) || this;
|
|
27
34
|
}
|
|
28
35
|
Object.defineProperty(Plugin.prototype, "component", {
|
|
36
|
+
/**
|
|
37
|
+
* Retrieves the component to which this plugin is attached.
|
|
38
|
+
*/
|
|
29
39
|
get: function () {
|
|
30
40
|
return this._component;
|
|
31
41
|
},
|
|
42
|
+
/**
|
|
43
|
+
* Sets the component for this plugin. This method is called by the parent component when the plugin is added.
|
|
44
|
+
*/
|
|
32
45
|
set: function (value) {
|
|
33
46
|
this._component = value;
|
|
34
47
|
},
|
|
35
48
|
enumerable: false,
|
|
36
49
|
configurable: true
|
|
37
50
|
});
|
|
51
|
+
/**
|
|
52
|
+
* Initializes the plugin and ensures it is properly associated with a component.
|
|
53
|
+
* If the component is not set before calling `init`, it throws an error.
|
|
54
|
+
*
|
|
55
|
+
* @throws {Error} If `component` is not set.
|
|
56
|
+
*/
|
|
38
57
|
Plugin.prototype.init = function () {
|
|
39
58
|
if (!this.component) {
|
|
40
59
|
throw new Error('Component is unknown. Be sure that `plugin.component` is non-nullable.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/base/Plugin/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,oCAAmC;AAKnC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/base/Plugin/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,oCAAmC;AAKnC;;;;GAIG;AACH;IAKU,0BAAoD;IAC5D;;;;OAIG;IACH,gBAAY,YAA4C;eACtD,kBAAM,YAAY,EAAE,KAAK,CAAC;IAC5B,CAAC;IAWD,sBAAI,6BAAS;QAHb;;WAEG;aACH;YACE,OAAO,IAAI,CAAC,UAAU,CAAC;QACzB,CAAC;QAED;;WAEG;aACH,UAAc,KAAK;YACjB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAC1B,CAAC;;;OAPA;IASD;;;;;OAKG;IACI,qBAAI,GAAX;QACE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,MAAM,IAAI,KAAK,CACb,wEAAwE,CACzE,CAAC;SACH;QAED,iBAAM,IAAI,WAAE,CAAC;IACf,CAAC;IACH,aAAC;AAAD,CAAC,AAlDD,CAKU,eAAM,GA6Cf;AAlDqB,wBAAM"}
|