vevet 3.3.2 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/lib/cjs/base/Component/index.js.map +1 -1
  2. package/lib/cjs/components/AnimationFrame/index.js.map +1 -1
  3. package/lib/cjs/components/BaseTimeline/index.js.map +1 -1
  4. package/lib/cjs/components/Ctx2D/index.js.map +1 -1
  5. package/lib/cjs/components/Ctx2DPrerender/index.js.map +1 -1
  6. package/lib/cjs/components/CustomCursor/index.js.map +1 -1
  7. package/lib/cjs/components/DraggerBase/index.js.map +1 -1
  8. package/lib/cjs/components/DraggerDirection/index.js.map +1 -1
  9. package/lib/cjs/components/DraggerMove/index.js.map +1 -1
  10. package/lib/cjs/components/Preloader/index.js.map +1 -1
  11. package/lib/cjs/components/ProgressPreloader/index.js +4 -1
  12. package/lib/cjs/components/ProgressPreloader/index.js.map +1 -1
  13. package/lib/cjs/components/ScrollBar/index.js.map +1 -1
  14. package/lib/cjs/components/ScrollView/index.js.map +1 -1
  15. package/lib/cjs/components/SectionScrollProgress/index.js.map +1 -1
  16. package/lib/cjs/components/SlideProgress/index.js +185 -0
  17. package/lib/cjs/components/SlideProgress/index.js.map +1 -0
  18. package/lib/cjs/components/SlideProgress/types.js +3 -0
  19. package/lib/cjs/components/SlideProgress/types.js.map +1 -0
  20. package/lib/cjs/components/SmoothScroll/index.js.map +1 -1
  21. package/lib/cjs/components/SmoothScrollDragPlugin/index.js.map +1 -1
  22. package/lib/cjs/components/SmoothScrollKeyboardPlugin/index.js.map +1 -1
  23. package/lib/cjs/components/SplitText/index.js.map +1 -1
  24. package/lib/cjs/components/Timeline/index.js.map +1 -1
  25. package/lib/cjs/components/index.js +1 -0
  26. package/lib/cjs/components/index.js.map +1 -1
  27. package/lib/cjs/version.js +1 -1
  28. package/lib/esm/base/Component/index.js.map +1 -1
  29. package/lib/esm/components/AnimationFrame/index.js.map +1 -1
  30. package/lib/esm/components/BaseTimeline/index.js.map +1 -1
  31. package/lib/esm/components/Ctx2D/index.js.map +1 -1
  32. package/lib/esm/components/Ctx2DPrerender/index.js.map +1 -1
  33. package/lib/esm/components/CustomCursor/index.js.map +1 -1
  34. package/lib/esm/components/DraggerBase/index.js.map +1 -1
  35. package/lib/esm/components/DraggerDirection/index.js.map +1 -1
  36. package/lib/esm/components/DraggerMove/index.js.map +1 -1
  37. package/lib/esm/components/Preloader/index.js.map +1 -1
  38. package/lib/esm/components/ProgressPreloader/index.js +4 -1
  39. package/lib/esm/components/ProgressPreloader/index.js.map +1 -1
  40. package/lib/esm/components/ScrollBar/index.js.map +1 -1
  41. package/lib/esm/components/ScrollView/index.js.map +1 -1
  42. package/lib/esm/components/SectionScrollProgress/index.js.map +1 -1
  43. package/lib/esm/components/SlideProgress/index.js +134 -0
  44. package/lib/esm/components/SlideProgress/index.js.map +1 -0
  45. package/lib/esm/components/SlideProgress/types.js +2 -0
  46. package/lib/esm/components/SlideProgress/types.js.map +1 -0
  47. package/lib/esm/components/SmoothScroll/index.js.map +1 -1
  48. package/lib/esm/components/SmoothScrollDragPlugin/index.js.map +1 -1
  49. package/lib/esm/components/SmoothScrollKeyboardPlugin/index.js.map +1 -1
  50. package/lib/esm/components/SplitText/index.js.map +1 -1
  51. package/lib/esm/components/Timeline/index.js.map +1 -1
  52. package/lib/esm/components/index.js +1 -0
  53. package/lib/esm/components/index.js.map +1 -1
  54. package/lib/esm/version.js +1 -1
  55. package/lib/types/base/Component/index.d.ts.map +1 -1
  56. package/lib/types/components/AnimationFrame/index.d.ts +11 -11
  57. package/lib/types/components/AnimationFrame/index.d.ts.map +1 -1
  58. package/lib/types/components/BaseTimeline/index.d.ts +7 -4
  59. package/lib/types/components/BaseTimeline/index.d.ts.map +1 -1
  60. package/lib/types/components/Ctx2D/index.d.ts +6 -6
  61. package/lib/types/components/Ctx2D/index.d.ts.map +1 -1
  62. package/lib/types/components/Ctx2DPrerender/index.d.ts +1 -1
  63. package/lib/types/components/Ctx2DPrerender/index.d.ts.map +1 -1
  64. package/lib/types/components/CustomCursor/index.d.ts +20 -19
  65. package/lib/types/components/CustomCursor/index.d.ts.map +1 -1
  66. package/lib/types/components/DraggerBase/index.d.ts +11 -10
  67. package/lib/types/components/DraggerBase/index.d.ts.map +1 -1
  68. package/lib/types/components/DraggerDirection/index.d.ts.map +1 -1
  69. package/lib/types/components/DraggerMove/index.d.ts +1 -1
  70. package/lib/types/components/DraggerMove/index.d.ts.map +1 -1
  71. package/lib/types/components/Marquee/index.d.ts +2 -1
  72. package/lib/types/components/Marquee/index.d.ts.map +1 -1
  73. package/lib/types/components/Preloader/index.d.ts +7 -7
  74. package/lib/types/components/Preloader/index.d.ts.map +1 -1
  75. package/lib/types/components/ProgressPreloader/index.d.ts +11 -9
  76. package/lib/types/components/ProgressPreloader/index.d.ts.map +1 -1
  77. package/lib/types/components/ScrollBar/index.d.ts +5 -4
  78. package/lib/types/components/ScrollBar/index.d.ts.map +1 -1
  79. package/lib/types/components/ScrollView/index.d.ts +1 -1
  80. package/lib/types/components/ScrollView/index.d.ts.map +1 -1
  81. package/lib/types/components/SectionScrollProgress/index.d.ts.map +1 -1
  82. package/lib/types/components/SlideProgress/index.d.ts +54 -0
  83. package/lib/types/components/SlideProgress/index.d.ts.map +1 -0
  84. package/lib/types/components/SlideProgress/types.d.ts +67 -0
  85. package/lib/types/components/SlideProgress/types.d.ts.map +1 -0
  86. package/lib/types/components/SmoothScroll/index.d.ts +6 -4
  87. package/lib/types/components/SmoothScroll/index.d.ts.map +1 -1
  88. package/lib/types/components/SmoothScrollDragPlugin/index.d.ts +12 -10
  89. package/lib/types/components/SmoothScrollDragPlugin/index.d.ts.map +1 -1
  90. package/lib/types/components/SmoothScrollKeyboardPlugin/index.d.ts +5 -4
  91. package/lib/types/components/SmoothScrollKeyboardPlugin/index.d.ts.map +1 -1
  92. package/lib/types/components/SplitText/index.d.ts +13 -13
  93. package/lib/types/components/SplitText/index.d.ts.map +1 -1
  94. package/lib/types/components/Timeline/index.d.ts +5 -5
  95. package/lib/types/components/Timeline/index.d.ts.map +1 -1
  96. package/lib/types/components/index.d.ts +1 -0
  97. package/lib/types/components/index.d.ts.map +1 -1
  98. package/lib/types/version.d.ts +1 -1
  99. package/package.json +4 -4
  100. package/src/Application/events/PageLoad/index.ts +1 -1
  101. package/src/Application/events/Viewport/index.ts +3 -3
  102. package/src/Application/index.ts +1 -1
  103. package/src/base/Callbacks/index.ts +2 -2
  104. package/src/base/Component/index.ts +4 -2
  105. package/src/base/Module/index.ts +13 -13
  106. package/src/base/Module/stories/index.tsx +1 -1
  107. package/src/base/MutableProps/index.ts +3 -3
  108. package/src/base/MutableProps/stories/index.tsx +1 -1
  109. package/src/base/Plugin/index.ts +2 -2
  110. package/src/components/AnimationFrame/index.ts +19 -16
  111. package/src/components/BaseTimeline/index.ts +10 -8
  112. package/src/components/BaseTimeline/stories/Nested.tsx +1 -1
  113. package/src/components/Ctx2D/index.ts +7 -7
  114. package/src/components/Ctx2DPrerender/index.ts +6 -3
  115. package/src/components/CustomCursor/index.ts +30 -28
  116. package/src/components/DraggerBase/index.ts +20 -18
  117. package/src/components/DraggerDirection/index.ts +6 -3
  118. package/src/components/DraggerMove/index.ts +9 -7
  119. package/src/components/Marquee/index.ts +3 -3
  120. package/src/components/Preloader/index.ts +12 -10
  121. package/src/components/ProgressPreloader/index.ts +25 -19
  122. package/src/components/ProgressPreloader/utils/preloadCustomElement.ts +1 -1
  123. package/src/components/ProgressPreloader/utils/preloadImage.ts +1 -1
  124. package/src/components/ProgressPreloader/utils/preloadVideo.ts +1 -1
  125. package/src/components/ScrollBar/Bar/index.ts +5 -5
  126. package/src/components/ScrollBar/index.ts +10 -8
  127. package/src/components/ScrollBar/stories/Default.tsx +1 -1
  128. package/src/components/ScrollBar/stories/WithInnerScroll.tsx +1 -1
  129. package/src/components/ScrollBar/stories/WithSmoothScrollComponent.tsx +1 -1
  130. package/src/components/ScrollBar/stories/index.stories.tsx +2 -2
  131. package/src/components/ScrollView/index.ts +13 -11
  132. package/src/components/ScrollView/stories/index.tsx +1 -1
  133. package/src/components/SectionScrollProgress/index.ts +6 -3
  134. package/src/components/SectionScrollProgress/stories/index.stories.tsx +1 -1
  135. package/src/components/SlideProgress/index.ts +226 -0
  136. package/src/components/SlideProgress/stories/index.stories.tsx +13 -0
  137. package/src/components/SlideProgress/stories/index.tsx +66 -0
  138. package/src/components/SlideProgress/types.ts +71 -0
  139. package/src/components/SmoothScroll/AnimatonFrame.ts +2 -2
  140. package/src/components/SmoothScroll/Elements.ts +3 -3
  141. package/src/components/SmoothScroll/index.ts +13 -11
  142. package/src/components/SmoothScroll/stories/Default.tsx +1 -1
  143. package/src/components/SmoothScroll/stories/WithHorizontal.tsx +1 -1
  144. package/src/components/SmoothScroll/stories/WithInnerLerp.tsx +1 -1
  145. package/src/components/SmoothScroll/stories/index.stories.tsx +2 -2
  146. package/src/components/SmoothScrollDragPlugin/index.ts +17 -14
  147. package/src/components/SmoothScrollDragPlugin/stories/index.tsx +1 -1
  148. package/src/components/SmoothScrollKeyboardPlugin/index.ts +11 -8
  149. package/src/components/SmoothScrollKeyboardPlugin/stories/index.tsx +1 -1
  150. package/src/components/SplitText/index.ts +18 -16
  151. package/src/components/Timeline/index.ts +9 -8
  152. package/src/components/Timeline/stories/Nested.tsx +1 -1
  153. package/src/components/index.ts +1 -0
  154. package/src/utils/common/mergeWithoutArrays.ts +1 -1
  155. package/src/utils/common/pickObjectProps.ts +1 -1
  156. package/src/utils/common/times.ts +1 -1
  157. package/src/utils/image/load.ts +2 -2
  158. package/src/utils/image/pathsToProps.ts +1 -1
  159. package/src/utils/listeners/onResize.ts +3 -3
  160. package/src/utils/math/clampScope.ts +1 -1
  161. package/src/utils/math/easing.ts +1 -1
  162. package/src/utils/math/lerp.ts +1 -1
  163. package/src/utils/math/normalizeNestedScope.ts +1 -1
  164. package/src/utils/math/wrap.ts +1 -1
  165. package/src/utils/scroll/getScrollValues.ts +1 -1
  166. package/src/utils/scroll/onScroll.ts +7 -7
  167. package/src/version.ts +1 -1
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  import { Plugin } from '../../base/Plugin';
2
3
  import { NSmoothScrollKeyboardPlugin } from './types';
3
4
  import type { SmoothScroll as SmoothScrollInstance } from '../SmoothScroll';
@@ -9,15 +10,15 @@ export declare class SmoothScrollKeyboardPlugin<StaticProps extends NSmoothScrol
9
10
  protected _getDefaultProps(): import("ts-essentials").DeepRequired<StaticProps & ChangeableProps> & {
10
11
  iterator: number;
11
12
  };
12
- private _tabDebounceTimeout?;
13
+ protected _tabDebounceTimeout?: NodeJS.Timeout;
13
14
  /** Initialize the class */
14
15
  protected _init(): void;
15
16
  /** Check if keyboard events may be ignored */
16
- private _canIgnoreKeyboardEvents;
17
+ protected _canIgnoreKeyboardEvents(): boolean;
17
18
  /** Check if scroll container is in viewport */
18
- private _checkScrollContainerInViewport;
19
+ protected _checkScrollContainerInViewport(): boolean;
19
20
  /** Check if scroll ended */
20
- private _checkIsEndOfScroll;
21
+ protected _checkIsEndOfScroll(): boolean;
21
22
  /** Event on `keydown` */
22
23
  protected _handleKeydown(event: KeyboardEvent): void;
23
24
  /** Handle Tab key */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/SmoothScrollKeyboardPlugin/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,IAAI,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE5E,YAAY,EAAE,2BAA2B,EAAE,CAAC;AAE5C;;GAEG;AACH,qBAAa,0BAA0B,CACrC,WAAW,SAAS,2BAA2B,CAAC,YAAY,GAAG,2BAA2B,CAAC,YAAY,EACvG,eAAe,SAAS,2BAA2B,CAAC,gBAAgB,GAAG,2BAA2B,CAAC,gBAAgB,EACnH,cAA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IAC3B,SAAS,CAAC,KAAK;IAQf,8CAA8C;IAC9C,SAAS,CAAC,wBAAwB;IAUlC,+CAA+C;IAC/C,SAAS,CAAC,+BAA+B;IAazC,4BAA4B;IAC5B,SAAS,CAAC,mBAAmB;IAS7B,yBAAyB;IACzB,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,aAAa;IAmF7C,qBAAqB;IACrB,SAAS,CAAC,UAAU;IAkCpB,yBAAyB;IACzB,SAAS,CAAC,QAAQ;CAOnB"}
@@ -16,43 +16,43 @@ export declare class SplitText<StaticProps extends NSplitText.IStaticProps = NSp
16
16
  };
17
17
  get prefix(): string;
18
18
  /** Initial text */
19
- private _initialText;
19
+ protected _initialText: string;
20
20
  /** Initial HTML content */
21
- private _initialHTML;
21
+ protected _initialHTML: string;
22
22
  /** If the text is already split into letters and words */
23
- private _isBaseSplit;
23
+ protected _isBaseSplit: boolean;
24
24
  /** Text container */
25
- private _container;
25
+ protected _container: HTMLElement;
26
26
  /** Text container */
27
27
  get container(): HTMLElement;
28
28
  /** Letters */
29
- private _letters;
29
+ protected _letters: NSplitText.ILetter[];
30
30
  /** Letters */
31
31
  get letters(): NSplitText.ILetter[];
32
32
  /** Words */
33
- private _words;
33
+ protected _words: NSplitText.IWord[];
34
34
  /** Words */
35
35
  get words(): NSplitText.IWord[];
36
36
  /** Lines */
37
- private _lines;
37
+ protected _lines: NSplitText.ILine[];
38
38
  /** Lines */
39
39
  get lines(): NSplitText.ILine[];
40
40
  constructor(initialProps: StaticProps & ChangeableProps, canInit?: boolean);
41
41
  protected _init(): void;
42
42
  /** Set resize events */
43
- private _setResize;
43
+ protected _setResize(): void;
44
44
  /** Split the text */
45
45
  splitText(): void;
46
46
  /** Split the text into words */
47
- private _splitIntoWords;
47
+ protected _splitIntoWords(): void;
48
48
  /** Split the text into letters */
49
- private _splitIntoLetters;
49
+ protected _splitIntoLetters(): void;
50
50
  /** Append split words to the container */
51
- private _appendWords;
51
+ protected _appendWords(): void;
52
52
  /** Split the text into lines */
53
- private _splitIntoLines;
53
+ protected _splitIntoLines(): void;
54
54
  /** Remove all lines */
55
- private _removeLines;
55
+ protected _removeLines(): void;
56
56
  /** Destroy the module */
57
57
  protected _destroy(): void;
58
58
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/SplitText/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGrC,YAAY,EAAE,UAAU,EAAE,CAAC;AAE3B;;;GAGG;AACH,qBAAa,SAAS,CACpB,WAAW,SAAS,UAAU,CAAC,YAAY,GAAG,UAAU,CAAC,YAAY,EACrE,eAAe,SAAS,UAAU,CAAC,gBAAgB,GAAG,UAAU,CAAC,gBAAgB,EACjF,cAAc,SAAS,UAAU,CAAC,eAAe,GAAG,UAAU,CAAC,eAAe,CAC9E,SAAQ,cAAc,CAAC,WAAW,EAAE,eAAe,EAAE,cAAc,CAAC;IACpE,SAAS,CAAC,gBAAgB;;;;;;;;IAY1B,IAAI,MAAM,WAET;IAED,mBAAmB;IACnB,OAAO,CAAC,YAAY,CAAS;IAE7B,2BAA2B;IAC3B,OAAO,CAAC,YAAY,CAAS;IAE7B,0DAA0D;IAC1D,OAAO,CAAC,YAAY,CAAU;IAE9B,qBAAqB;IACrB,OAAO,CAAC,UAAU,CAAc;IAEhC,qBAAqB;IACrB,IAAI,SAAS,gBAEZ;IAED,cAAc;IACd,OAAO,CAAC,QAAQ,CAAuB;IAEvC,cAAc;IACd,IAAI,OAAO,yBAEV;IAED,YAAY;IACZ,OAAO,CAAC,MAAM,CAAqB;IAEnC,YAAY;IACZ,IAAI,KAAK,uBAER;IAED,YAAY;IACZ,OAAO,CAAC,MAAM,CAAqB;IAEnC,YAAY;IACZ,IAAI,KAAK,uBAER;gBAEW,YAAY,EAAE,WAAW,GAAG,eAAe,EAAE,OA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AAE,UAAU,CAAC,OAAO,EAAE,CAAC;IAEzC,cAAc;IACd,IAAI,OAAO,yBAEV;IAED,YAAY;IACZ,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC,KAAK,EAAE,CAAC;IAErC,YAAY;IACZ,IAAI,KAAK,uBAER;IAED,YAAY;IACZ,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC,KAAK,EAAE,CAAC;IAErC,YAAY;IACZ,IAAI,KAAK,uBAER;gBAEW,YAAY,EAAE,WAAW,GAAG,eAAe,EAAE,OAAO,UAAO;IAkCvE,SAAS,CAAC,KAAK;IAMf,wBAAwB;IACxB,SAAS,CAAC,UAAU;IAqBpB,qBAAqB;IACd,SAAS;IAqBhB,gCAAgC;IAChC,SAAS,CAAC,eAAe;IAuFzB,kCAAkC;IAClC,SAAS,CAAC,iBAAiB;IAsC3B,0CAA0C;IAC1C,SAAS,CAAC,YAAY;IActB,gCAAgC;IAChC,SAAS,CAAC,eAAe;IAwEzB,uBAAuB;IACvB,SAAS,CAAC,YAAY;IAOtB,yBAAyB;IACzB,SAAS,CAAC,QAAQ;CAKnB"}
@@ -13,17 +13,17 @@ export declare class Timeline<StaticProps extends NTimeline.IStaticProps = NTime
13
13
  hasNestedEasingProgress: boolean;
14
14
  };
15
15
  /** The animation frame */
16
- private _animationFrame?;
16
+ protected _animationFrame?: number;
17
17
  /** Last time when animationFrame callback has been called */
18
- private _animationFrameLastTime;
18
+ protected _animationFrameLastTime: number;
19
19
  /** Timeline is playing */
20
20
  get isPlaying(): boolean;
21
21
  /** Timeline is reversed */
22
- private _isReversed;
22
+ protected _isReversed: boolean;
23
23
  /** Timeline is reversed */
24
24
  get isReversed(): boolean;
25
25
  /** Timeline is paused */
26
- private _isPaused;
26
+ protected _isPaused: boolean;
27
27
  /** Timeline is paused */
28
28
  get isPaused(): boolean;
29
29
  constructor(initialProps?: StaticProps & ChangeableProps, canInit?: boolean);
@@ -36,7 +36,7 @@ export declare class Timeline<StaticProps extends NTimeline.IStaticProps = NTime
36
36
  /** Reset timeline */
37
37
  reset(): void;
38
38
  /** Start animation */
39
- private _animate;
39
+ protected _animate(): void;
40
40
  /** Events on progress */
41
41
  protected _handleProgressUpdate(): void;
42
42
  /** Destroy the timeline */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Timeline/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B;;GAEG;AACH,qBAAa,QAAQ,CACnB,WAAW,SAAS,SAAS,CAAC,YAAY,GAAG,SAAS,CAAC,YAAY,EACnE,eAAe,SAAS,SAAS,CAAC,gBAAgB,GAAG,SAAS,CAAC,gBAAgB,EAC/E,cAAc,SAAS,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,eAAe,CAC5E,SAAQ,YAAY,CAAC,WAAW,EAAE,eAAe,EAAE,cAAc,CAAC;IAClE,SAAS,CAAC,gBAAgB;;;;;;;IAQ1B,0BAA0B;IAC1B,OAAO,CAAC,eAAe,CAAC,CAAS;IAEjC,6DAA6D;IAC7D,OAAO,CAAC,uBAAuB,CAAS;IAExC,0BAA0B;IAC1B,IAAI,SAAS,YAEZ;IAED,2BAA2B;IAC3B,OAAO,CAAC,WAAW,CAAU;IAE7B,2BAA2B;IAC3B,IAAI,UAAU,YAEb;IAED,yBAAyB;IACzB,OAAO,CAAC,SAAS,CAAU;IAE3B,yBAAyB;IACzB,IAAI,QAAQ,YAEX;gBAEW,YAAY,CAAC,EAAE,WAAW,GAAG,eAAe,EAAE,OAAO,UAAO;IAcxE,wBAAwB;IACjB,IAAI;IAcX,uBAAuB;IAChB,OAAO;IAcd,sBAAsB;IACf,KAAK;IAaZ,qBAAqB;IACd,KAAK;IASZ,sBAAsB;IACtB,OAAO,CAAC,QAAQ;IAoChB,yBAAyB;IACz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IAC3B,SAAS,CAAC,QAAQ;CAKnB"}
@@ -11,6 +11,7 @@ export * from './ProgressPreloader';
11
11
  export * from './ScrollBar';
12
12
  export * from './ScrollView';
13
13
  export * from './SectionScrollProgress';
14
+ export * from './SlideProgress';
14
15
  export * from './SmoothScroll';
15
16
  export * from './SmoothScrollDragPlugin';
16
17
  export * from './SmoothScrollKeyboardPlugin';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
@@ -1,3 +1,3 @@
1
- declare const version = "3.3.2";
1
+ declare const version = "3.5.0";
2
2
  export default version;
3
3
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vevet",
3
- "version": "3.3.2",
3
+ "version": "3.5.0",
4
4
  "description": "Vevet - a JavaScript library of ready-made solutions and helpers",
5
5
  "scripts": {
6
6
  "storybook": "storybook dev -p 6006",
@@ -68,7 +68,7 @@
68
68
  "vevet-dom": "^0.0.15"
69
69
  },
70
70
  "devDependencies": {
71
- "@anton.bobrov/eslint-config": "1.3.0",
71
+ "@anton.bobrov/eslint-config": "1.4.0",
72
72
  "@babel/preset-env": "^7.22.10",
73
73
  "@babel/preset-react": "^7.18.6",
74
74
  "@babel/preset-typescript": "^7.22.5",
@@ -84,11 +84,11 @@
84
84
  "@types/normalize-wheel": "^1.0.1",
85
85
  "@types/react": "18.0.18",
86
86
  "copyfiles": "^2.4.1",
87
- "eslint": "^8.23.0",
87
+ "eslint": "^8.53.0",
88
88
  "eslint-plugin-storybook": "^0.6.13",
89
89
  "gh-pages": "^6.0.0",
90
90
  "npm-run-all": "^4.1.5",
91
- "prettier": "^2.8.4",
91
+ "prettier": "^3.0.3",
92
92
  "react": "^18.2.0",
93
93
  "react-dom": "^18.2.0",
94
94
  "rimraf": "^5.0.1",
@@ -40,7 +40,7 @@ export class PageLoad extends Callbacks<NPageLoad.ICallbacksTypes> {
40
40
  }
41
41
 
42
42
  this._loadListener = addEventListener(window, 'load', () =>
43
- this._handleLoaded()
43
+ this._handleLoaded(),
44
44
  );
45
45
  }
46
46
 
@@ -159,12 +159,12 @@ export class Viewport extends Callbacks<NViewport.ICallbacksTypes> {
159
159
  if (this.isLandscape) {
160
160
  this._updateBreakpointClassNames(
161
161
  EOrientationTypes.Landscape,
162
- orientationTypes
162
+ orientationTypes,
163
163
  );
164
164
  } else if (this.isPortrait) {
165
165
  this._updateBreakpointClassNames(
166
166
  EOrientationTypes.Portrait,
167
- orientationTypes
167
+ orientationTypes,
168
168
  );
169
169
  } else {
170
170
  this._updateBreakpointClassNames('', orientationTypes);
@@ -195,7 +195,7 @@ export class Viewport extends Callbacks<NViewport.ICallbacksTypes> {
195
195
  /** Launch callbacks on resize. */
196
196
  private _onResize(
197
197
  /** force all callbacks */
198
- force = false
198
+ force = false,
199
199
  ) {
200
200
  const { _width: prevWidth, _height: prevHeight } = this;
201
201
 
@@ -192,7 +192,7 @@ export class Application {
192
192
  /** Action on page loaded */
193
193
  public onPageLoad() {
194
194
  return new PCancelable((resolve: (...arg: any) => void) =>
195
- this._pageLoad.onLoad(resolve)
195
+ this._pageLoad.onLoad(resolve),
196
196
  );
197
197
  }
198
198
 
@@ -64,7 +64,7 @@ export class Callbacks<Types extends NCallbacks.ITypes = NCallbacks.ITypes> {
64
64
  public add<T extends keyof Types>(
65
65
  target: T,
66
66
  action: NCallbacks.TAction<Types[T]>,
67
- settings: NCallbacks.ISettings = {}
67
+ settings: NCallbacks.ISettings = {},
68
68
  ): NCallbacks.IAddedCallback {
69
69
  const id = uid('callback');
70
70
 
@@ -160,7 +160,7 @@ export class Callbacks<Types extends NCallbacks.ITypes = NCallbacks.ITypes> {
160
160
  */
161
161
  private _callAction(
162
162
  { id, isEnabled, timeout, isOnce, action }: NCallbacks.ICallback<Types>,
163
- parameter: Types[keyof Types]
163
+ parameter: Types[keyof Types],
164
164
  ) {
165
165
  if (!isEnabled) {
166
166
  return;
@@ -9,8 +9,10 @@ export type { NComponent };
9
9
  */
10
10
  export class Component<
11
11
  StaticProps extends NComponent.IStaticProps = NComponent.IStaticProps,
12
- ChangeableProps extends NComponent.IChangeableProps = NComponent.IChangeableProps,
13
- CallbacksTypes extends NComponent.ICallbacksTypes = NComponent.ICallbacksTypes
12
+ ChangeableProps extends
13
+ NComponent.IChangeableProps = NComponent.IChangeableProps,
14
+ CallbacksTypes extends
15
+ NComponent.ICallbacksTypes = NComponent.ICallbacksTypes,
14
16
  > extends Module<StaticProps, ChangeableProps, CallbacksTypes> {
15
17
  /** Inner plugins */
16
18
  private _plugins?: Plugin[];
@@ -22,7 +22,7 @@ type TViewportAdd = Viewport['add'];
22
22
  export class Module<
23
23
  StaticProps extends NModule.IStaticProps = NModule.IStaticProps,
24
24
  ChangeableProps extends NModule.IChangeableProps = NModule.IChangeableProps,
25
- CallbacksTypes extends NModule.ICallbacksTypes = NModule.ICallbacksTypes
25
+ CallbacksTypes extends NModule.ICallbacksTypes = NModule.ICallbacksTypes,
26
26
  > {
27
27
  /**
28
28
  * Get Default properties (should be extended)
@@ -139,13 +139,13 @@ export class Module<
139
139
  * Defines if you need to call {@linkcode Module.init} at the constructor's end.
140
140
  * If you want to add responsive properties, set this parameter to `false`.
141
141
  */
142
- canInit = true
142
+ canInit = true,
143
143
  ) {
144
144
  if (window.vevetApp) {
145
145
  this._app = window.vevetApp;
146
146
  } else {
147
147
  throw new Error(
148
- 'Vevet.Application does not exist yet. Call "new Vevet.Application()" before using all the stuff'
148
+ 'Vevet.Application does not exist yet. Call "new Vevet.Application()" before using all the stuff',
149
149
  );
150
150
  }
151
151
 
@@ -156,13 +156,13 @@ export class Module<
156
156
 
157
157
  const props = mergeWithoutArrays(
158
158
  this._getDefaultProps(),
159
- initialProps || {}
159
+ initialProps || {},
160
160
  );
161
161
 
162
162
  this._mutableProps = new MutableProps(
163
163
  props as StaticProps & ChangeableProps,
164
164
  () => this._onPropsMutate(),
165
- this.name
165
+ this.name,
166
166
  );
167
167
 
168
168
  if (canInit) {
@@ -174,7 +174,7 @@ export class Module<
174
174
  public addResponsiveProps(rules: NMutableProps.IResponsive<ChangeableProps>) {
175
175
  if (this.isInitialized) {
176
176
  throw new Error(
177
- 'Responsive properties cannot be added after `init` is called'
177
+ 'Responsive properties cannot be added after `init` is called',
178
178
  );
179
179
  } else {
180
180
  this._mutableProps.addResponsiveProps(rules);
@@ -232,7 +232,7 @@ export class Module<
232
232
  public addViewportCallback(
233
233
  target: Parameters<TViewportAdd>[0],
234
234
  action: Parameters<TViewportAdd>[1],
235
- data: Parameters<TViewportAdd>[2] = {}
235
+ data: Parameters<TViewportAdd>[2] = {},
236
236
  ) {
237
237
  const callback = this._app.viewport.add(target, action, {
238
238
  ...data,
@@ -246,7 +246,7 @@ export class Module<
246
246
  public addCallback<T extends keyof CallbacksTypes>(
247
247
  target: T,
248
248
  action: NCallbacks.TAction<CallbacksTypes[T]>,
249
- settings: NCallbacks.ISettings = {}
249
+ settings: NCallbacks.ISettings = {},
250
250
  ) {
251
251
  return this.callbacks.add(target, action, settings);
252
252
  }
@@ -255,12 +255,12 @@ export class Module<
255
255
  public addEventListener<
256
256
  El extends ListenerElement,
257
257
  Target extends keyof HTMLElementEventMap,
258
- Callback extends (evt: HTMLElementEventMap[Target]) => void
258
+ Callback extends (evt: HTMLElementEventMap[Target]) => void,
259
259
  >(
260
260
  el: El,
261
261
  target: Target,
262
262
  callback: Callback,
263
- options?: IAddEventListenerOptions
263
+ options?: IAddEventListenerOptions,
264
264
  ): IAddEventListener {
265
265
  const listener = addEventListener(el, target, callback, options);
266
266
  this._listeners.push(listener);
@@ -269,7 +269,7 @@ export class Module<
269
269
  ...listener,
270
270
  remove: () => {
271
271
  this._listeners = this._listeners.filter(
272
- (item) => item.id !== listener.id
272
+ (item) => item.id !== listener.id,
273
273
  );
274
274
 
275
275
  return listener.remove();
@@ -285,7 +285,7 @@ export class Module<
285
285
  protected toggleClassName(
286
286
  element: Element,
287
287
  className: string,
288
- isActive: boolean
288
+ isActive: boolean,
289
289
  ) {
290
290
  const isAlreadyExists = element.classList.contains(className);
291
291
 
@@ -316,7 +316,7 @@ export class Module<
316
316
  this._listeners.forEach((listener) => listener.remove());
317
317
 
318
318
  this._classNamesToRemove.forEach(({ element, className }) =>
319
- element.classList.remove(className)
319
+ element.classList.remove(className),
320
320
  );
321
321
 
322
322
  this._isDestroyed = true;
@@ -22,7 +22,7 @@ export const Component: FC = () => {
22
22
  weight: 70,
23
23
  height: 175,
24
24
  },
25
- false
25
+ false,
26
26
  );
27
27
 
28
28
  module.addResponsiveProps({
@@ -48,7 +48,7 @@ export class MutableProps<
48
48
  * Mutable Properties
49
49
  * (may change on window resize or through {@linkcode MutableProps.changeProps})
50
50
  */
51
- ChangeableProps extends Record<string, any>
51
+ ChangeableProps extends Record<string, any>,
52
52
  > {
53
53
  /**
54
54
  * Vevet Application.
@@ -120,7 +120,7 @@ export class MutableProps<
120
120
  /**
121
121
  * Name of the responsive properties.
122
122
  */
123
- private _name = 'Responsive Props'
123
+ private _name = 'Responsive Props',
124
124
  ) {
125
125
  this._app = window.vevetApp;
126
126
  this._refProps = mergeWithoutArrays({}, _initProps);
@@ -144,7 +144,7 @@ export class MutableProps<
144
144
  this._viewportCallback = this._app.viewport.add(
145
145
  'width',
146
146
  this._responseProps.bind(this),
147
- { name: this._name }
147
+ { name: this._name },
148
148
  );
149
149
  }
150
150
 
@@ -27,7 +27,7 @@ export const Component: FC = () => {
27
27
  console.log('changed on viewport resize', { ...props.props });
28
28
 
29
29
  setFeatures({ ...props.props });
30
- }
30
+ },
31
31
  );
32
32
 
33
33
  props.changeProps({ name: 'second name' });
@@ -10,7 +10,7 @@ export abstract class Plugin<
10
10
  StaticProps extends NPlugin.IStaticProps = NPlugin.IStaticProps,
11
11
  ChangeableProps extends NPlugin.IChangeableProps = NPlugin.IChangeableProps,
12
12
  CallbacksTypes extends NPlugin.ICallbacksTypes = NPlugin.ICallbacksTypes,
13
- Component = any
13
+ Component = any,
14
14
  > extends Module<StaticProps, ChangeableProps, CallbacksTypes> {
15
15
  constructor(initialProps?: StaticProps & ChangeableProps) {
16
16
  super(initialProps, false);
@@ -29,7 +29,7 @@ export abstract class Plugin<
29
29
  public init() {
30
30
  if (!this.component) {
31
31
  throw new Error(
32
- 'Component is unknown. Be sure that `plugin.component` is non-nullable.'
32
+ 'Component is unknown. Be sure that `plugin.component` is non-nullable.',
33
33
  );
34
34
  }
35
35
 
@@ -7,9 +7,12 @@ export type { NAnimationFrame };
7
7
  * Launch an animation frame with a certain FPS
8
8
  */
9
9
  export class AnimationFrame<
10
- StaticProps extends NAnimationFrame.IStaticProps = NAnimationFrame.IStaticProps,
11
- ChangeableProps extends NAnimationFrame.IChangeableProps = NAnimationFrame.IChangeableProps,
12
- CallbacksTypes extends NAnimationFrame.ICallbacksTypes = NAnimationFrame.ICallbacksTypes
10
+ StaticProps extends
11
+ NAnimationFrame.IStaticProps = NAnimationFrame.IStaticProps,
12
+ ChangeableProps extends
13
+ NAnimationFrame.IChangeableProps = NAnimationFrame.IChangeableProps,
14
+ CallbacksTypes extends
15
+ NAnimationFrame.ICallbacksTypes = NAnimationFrame.ICallbacksTypes,
13
16
  > extends ComponentClass<StaticProps, ChangeableProps, CallbacksTypes> {
14
17
  protected _getDefaultProps() {
15
18
  return {
@@ -21,29 +24,29 @@ export class AnimationFrame<
21
24
  }
22
25
 
23
26
  /** If the frame is launched */
24
- private _isPlaying: boolean;
27
+ protected _isPlaying: boolean;
25
28
 
26
29
  get isPlaying() {
27
30
  return this._isPlaying;
28
31
  }
29
32
 
30
33
  /** The animation frame */
31
- private _frame: number | null;
34
+ protected _frame: number | null;
32
35
 
33
36
  /** Last frame time */
34
- private _frameIndex: number;
37
+ protected _frameIndex: number;
35
38
 
36
39
  /** First frame time */
37
- private _firstFrameTime: null | number;
40
+ protected _firstFrameTime: null | number;
38
41
 
39
42
  /** Last frame time */
40
- private _lastFrameTime: null | number;
43
+ protected _lastFrameTime: null | number;
41
44
 
42
45
  /** Array of frame time durations */
43
- private _frameDurations: number[];
46
+ protected _frameDurations: number[];
44
47
 
45
48
  /** Computed fps */
46
- private _computedFPS: number;
49
+ protected _computedFPS: number;
47
50
 
48
51
  /** Computed real time fps */
49
52
  get computedFPS() {
@@ -107,7 +110,7 @@ export class AnimationFrame<
107
110
  }
108
111
 
109
112
  /** Play animation */
110
- private _play() {
113
+ protected _play() {
111
114
  if (this.isPlaying) {
112
115
  return;
113
116
  }
@@ -130,7 +133,7 @@ export class AnimationFrame<
130
133
  }
131
134
 
132
135
  /** Pause animation */
133
- private _pause() {
136
+ protected _pause() {
134
137
  if (!this.isPlaying) {
135
138
  return;
136
139
  }
@@ -147,7 +150,7 @@ export class AnimationFrame<
147
150
  }
148
151
 
149
152
  /** Launch the animation frame */
150
- private _animate() {
153
+ protected _animate() {
151
154
  if (!this._isPlaying) {
152
155
  return;
153
156
  }
@@ -164,7 +167,7 @@ export class AnimationFrame<
164
167
  const minFrameDuration =
165
168
  this.props.fps === 'auto' ? 1 : 1000 / this.props.fps;
166
169
  const newFrameIndex = Math.floor(
167
- (startTime - this._firstFrameTime) / minFrameDuration
170
+ (startTime - this._firstFrameTime) / minFrameDuration,
168
171
  );
169
172
 
170
173
  // break if frame index the same
@@ -186,7 +189,7 @@ export class AnimationFrame<
186
189
  }
187
190
 
188
191
  /** Compute real-time FPS */
189
- private _computeFPS(startTime: number) {
192
+ protected _computeFPS(startTime: number) {
190
193
  const lastFrameDuration = startTime - (this._lastFrameTime ?? startTime);
191
194
 
192
195
  // skip frames that seem not real
@@ -201,7 +204,7 @@ export class AnimationFrame<
201
204
  }
202
205
 
203
206
  const totalFramesDuration = this._frameDurations.reduce(
204
- (prev, curr) => prev + curr
207
+ (prev, curr) => prev + curr,
205
208
  );
206
209
 
207
210
  const approximateFrameDuration =
@@ -11,8 +11,10 @@ export type { NBaseTimeline };
11
11
  */
12
12
  export class BaseTimeline<
13
13
  StaticProps extends NBaseTimeline.IStaticProps = NBaseTimeline.IStaticProps,
14
- ChangeableProps extends NBaseTimeline.IChangeableProps = NBaseTimeline.IChangeableProps,
15
- CallbacksTypes extends NBaseTimeline.ICallbacksTypes = NBaseTimeline.ICallbacksTypes
14
+ ChangeableProps extends
15
+ NBaseTimeline.IChangeableProps = NBaseTimeline.IChangeableProps,
16
+ CallbacksTypes extends
17
+ NBaseTimeline.ICallbacksTypes = NBaseTimeline.ICallbacksTypes,
16
18
  > extends ComponentClass<StaticProps, ChangeableProps, CallbacksTypes> {
17
19
  protected _getDefaultProps() {
18
20
  return {
@@ -24,7 +26,7 @@ export class BaseTimeline<
24
26
  }
25
27
 
26
28
  /** Global timeline progress */
27
- private _progress: number;
29
+ protected _progress: number;
28
30
 
29
31
  /** Global timeline progress */
30
32
  get progress() {
@@ -38,7 +40,7 @@ export class BaseTimeline<
38
40
  }
39
41
 
40
42
  /** Easing progress */
41
- private _easing: number;
43
+ protected _easing: number;
42
44
 
43
45
  /** Easing progress */
44
46
  get easing() {
@@ -46,7 +48,7 @@ export class BaseTimeline<
46
48
  }
47
49
 
48
50
  /** Nested timelines */
49
- private _nestedTimelines: { id: string; timeline: BaseTimeline }[];
51
+ protected _nestedTimelines: { id: string; timeline: BaseTimeline }[];
50
52
 
51
53
  constructor(initialProps?: StaticProps & ChangeableProps, canInit = true) {
52
54
  super(initialProps, false);
@@ -70,7 +72,7 @@ export class BaseTimeline<
70
72
  return {
71
73
  remove: () => {
72
74
  this._nestedTimelines = this._nestedTimelines.filter(
73
- ({ id: nestedTimelineId }) => nestedTimelineId !== id
75
+ ({ id: nestedTimelineId }) => nestedTimelineId !== id,
74
76
  );
75
77
  },
76
78
  };
@@ -89,7 +91,7 @@ export class BaseTimeline<
89
91
  }
90
92
 
91
93
  /** Render nested timelines */
92
- private _renderNestedTimelines() {
94
+ protected _renderNestedTimelines() {
93
95
  const { length } = this._nestedTimelines;
94
96
  if (length === 0) {
95
97
  return;
@@ -103,7 +105,7 @@ export class BaseTimeline<
103
105
  const timelineProgress = clampScope(
104
106
  progressForNestedTimeline,
105
107
  timeline.props.nestedScope,
106
- [0, 1]
108
+ [0, 1],
107
109
  );
108
110
 
109
111
  // eslint-disable-next-line no-param-reassign
@@ -15,7 +15,7 @@ export const Nested: FC = () => {
15
15
 
16
16
  if (containerRef.current) {
17
17
  const children = Array.from(
18
- containerRef.current.children
18
+ containerRef.current.children,
19
19
  ) as HTMLElement[];
20
20
 
21
21
  const scopes = spreadScope(children.length, 0.9);