vevet 4.3.1 → 4.4.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 (77) hide show
  1. package/lib/cjs/components/CustomScrollDragPlugin/index.js +3 -0
  2. package/lib/cjs/components/CustomScrollDragPlugin/index.js.map +1 -1
  3. package/lib/cjs/components/DraggerBase/index.js +29 -114
  4. package/lib/cjs/components/DraggerBase/index.js.map +1 -1
  5. package/lib/cjs/components/DraggerDirection/index.js +7 -8
  6. package/lib/cjs/components/DraggerDirection/index.js.map +1 -1
  7. package/lib/cjs/components/DraggerMove/index.js +81 -62
  8. package/lib/cjs/components/DraggerMove/index.js.map +1 -1
  9. package/lib/cjs/components/Marquee/index.js +2 -0
  10. package/lib/cjs/components/Marquee/index.js.map +1 -1
  11. package/lib/cjs/components/ScrollBar/Bar/index.js +1 -2
  12. package/lib/cjs/components/ScrollBar/Bar/index.js.map +1 -1
  13. package/lib/cjs/components/SlideProgress/index.js +32 -58
  14. package/lib/cjs/components/SlideProgress/index.js.map +1 -1
  15. package/lib/cjs/utils/scroll/index.js +0 -1
  16. package/lib/cjs/utils/scroll/index.js.map +1 -1
  17. package/lib/cjs/version.js +1 -1
  18. package/lib/esm/components/CustomScrollDragPlugin/index.js +3 -0
  19. package/lib/esm/components/CustomScrollDragPlugin/index.js.map +1 -1
  20. package/lib/esm/components/DraggerBase/index.js +29 -105
  21. package/lib/esm/components/DraggerBase/index.js.map +1 -1
  22. package/lib/esm/components/DraggerDirection/index.js +7 -8
  23. package/lib/esm/components/DraggerDirection/index.js.map +1 -1
  24. package/lib/esm/components/DraggerMove/index.js +81 -62
  25. package/lib/esm/components/DraggerMove/index.js.map +1 -1
  26. package/lib/esm/components/Marquee/index.js +2 -0
  27. package/lib/esm/components/Marquee/index.js.map +1 -1
  28. package/lib/esm/components/ScrollBar/Bar/index.js +1 -2
  29. package/lib/esm/components/ScrollBar/Bar/index.js.map +1 -1
  30. package/lib/esm/components/SlideProgress/index.js +33 -57
  31. package/lib/esm/components/SlideProgress/index.js.map +1 -1
  32. package/lib/esm/utils/scroll/index.js +0 -1
  33. package/lib/esm/utils/scroll/index.js.map +1 -1
  34. package/lib/esm/version.js +1 -1
  35. package/lib/types/components/CustomScrollDragPlugin/index.d.ts.map +1 -1
  36. package/lib/types/components/DraggerBase/index.d.ts +5 -56
  37. package/lib/types/components/DraggerBase/index.d.ts.map +1 -1
  38. package/lib/types/components/DraggerBase/types.d.ts +5 -9
  39. package/lib/types/components/DraggerBase/types.d.ts.map +1 -1
  40. package/lib/types/components/DraggerDirection/index.d.ts +3 -3
  41. package/lib/types/components/DraggerDirection/index.d.ts.map +1 -1
  42. package/lib/types/components/DraggerMove/index.d.ts +27 -22
  43. package/lib/types/components/DraggerMove/index.d.ts.map +1 -1
  44. package/lib/types/components/DraggerMove/types.d.ts +7 -10
  45. package/lib/types/components/DraggerMove/types.d.ts.map +1 -1
  46. package/lib/types/components/Marquee/index.d.ts.map +1 -1
  47. package/lib/types/components/ScrollBar/Bar/index.d.ts.map +1 -1
  48. package/lib/types/components/SlideProgress/index.d.ts +2 -13
  49. package/lib/types/components/SlideProgress/index.d.ts.map +1 -1
  50. package/lib/types/components/SlideProgress/types.d.ts +3 -1
  51. package/lib/types/components/SlideProgress/types.d.ts.map +1 -1
  52. package/lib/types/utils/scroll/index.d.ts +0 -1
  53. package/lib/types/utils/scroll/index.d.ts.map +1 -1
  54. package/lib/types/version.d.ts +1 -1
  55. package/package.json +1 -1
  56. package/src/components/CustomScrollDragPlugin/index.ts +4 -0
  57. package/src/components/DraggerBase/index.ts +41 -142
  58. package/src/components/DraggerBase/types.ts +5 -11
  59. package/src/components/DraggerDirection/index.ts +12 -11
  60. package/src/components/DraggerDirection/stories/index.tsx +1 -0
  61. package/src/components/DraggerMove/index.ts +100 -77
  62. package/src/components/DraggerMove/stories/index.stories.tsx +3 -1
  63. package/src/components/DraggerMove/stories/index.tsx +7 -4
  64. package/src/components/DraggerMove/types.ts +8 -11
  65. package/src/components/Marquee/index.ts +3 -0
  66. package/src/components/ScrollBar/Bar/index.ts +0 -3
  67. package/src/components/SlideProgress/index.ts +40 -78
  68. package/src/components/SlideProgress/types.ts +3 -1
  69. package/src/utils/scroll/index.ts +0 -1
  70. package/src/version.ts +1 -1
  71. package/lib/cjs/utils/scroll/isPageScrolling.js +0 -73
  72. package/lib/cjs/utils/scroll/isPageScrolling.js.map +0 -1
  73. package/lib/esm/utils/scroll/isPageScrolling.js +0 -69
  74. package/lib/esm/utils/scroll/isPageScrolling.js.map +0 -1
  75. package/lib/types/utils/scroll/isPageScrolling.d.ts +0 -25
  76. package/lib/types/utils/scroll/isPageScrolling.d.ts.map +0 -1
  77. package/src/utils/scroll/isPageScrolling.ts +0 -80
@@ -1,73 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createIsPageScrolling = void 0;
4
- var common_1 = require("../common");
5
- var addEventListener_1 = require("../dom/addEventListener");
6
- var ids = [];
7
- var timeout = null;
8
- var listener;
9
- var isScrolling = false;
10
- /**
11
- * Creates a scroll event listener if it doesn't exist and updates the `isScrolling` state.
12
- * This listener detects if the user is scrolling and sets a timeout of 150ms to reset the `isScrolling` state.
13
- */
14
- function createListener() {
15
- if (!listener) {
16
- listener = (0, addEventListener_1.addEventListener)(window, 'scroll', function () {
17
- if (timeout) {
18
- clearTimeout(timeout);
19
- }
20
- isScrolling = true;
21
- timeout = setTimeout(function () {
22
- isScrolling = false;
23
- }, 150);
24
- });
25
- }
26
- }
27
- /**
28
- * Destroys the scroll event listener when there are no more IDs associated with it..
29
- */
30
- function destroyListener() {
31
- if (ids.length === 0) {
32
- listener === null || listener === void 0 ? void 0 : listener();
33
- listener = undefined;
34
- }
35
- }
36
- /**
37
- * Creates an instance to check whether the page is currently scrolling.
38
- * This function manages the scroll state across multiple instances, ensuring the listener is created only once.
39
- *
40
- * @example
41
- *
42
- * const scrollChecker = createIsPageScrolling();
43
- *
44
- * // Check if page is scrolling
45
- * const isPageScrolling = scrollChecker.get(); // => true or false
46
- *
47
- * // Destroy the instance when not needed
48
- * scrollChecker.destroy();
49
- */
50
- function createIsPageScrolling() {
51
- var id = (0, common_1.uid)('is-page-scrolling');
52
- ids.push(id);
53
- createListener();
54
- /**
55
- * Removes the current instance's ID from the tracking list and destroys the listener if no other IDs exist.
56
- */
57
- function destroy() {
58
- ids = ids.filter(function (item) { return item !== id; });
59
- destroyListener();
60
- }
61
- return {
62
- /**
63
- * @returns {boolean} - Returns whether the page is currently scrolling.
64
- */
65
- get: function () { return isScrolling; },
66
- /**
67
- * Destroys the scroll listener instance.
68
- */
69
- destroy: destroy,
70
- };
71
- }
72
- exports.createIsPageScrolling = createIsPageScrolling;
73
- //# sourceMappingURL=isPageScrolling.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isPageScrolling.js","sourceRoot":"","sources":["../../../../src/utils/scroll/isPageScrolling.ts"],"names":[],"mappings":";;;AAAA,oCAAgC;AAChC,4DAA2D;AAE3D,IAAI,GAAG,GAAa,EAAE,CAAC;AAEvB,IAAI,OAAO,GAA0B,IAAI,CAAC;AAC1C,IAAI,QAAkC,CAAC;AAEvC,IAAI,WAAW,GAAG,KAAK,CAAC;AAExB;;;GAGG;AACH,SAAS,cAAc;IACrB,IAAI,CAAC,QAAQ,EAAE;QACb,QAAQ,GAAG,IAAA,mCAAgB,EAAC,MAAM,EAAE,QAAQ,EAAE;YAC5C,IAAI,OAAO,EAAE;gBACX,YAAY,CAAC,OAAO,CAAC,CAAC;aACvB;YAED,WAAW,GAAG,IAAI,CAAC;YAEnB,OAAO,GAAG,UAAU,CAAC;gBACnB,WAAW,GAAG,KAAK,CAAC;YACtB,CAAC,EAAE,GAAG,CAAC,CAAC;QACV,CAAC,CAAC,CAAC;KACJ;AACH,CAAC;AAED;;GAEG;AACH,SAAS,eAAe;IACtB,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;QACpB,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,EAAI,CAAC;QACb,QAAQ,GAAG,SAAS,CAAC;KACtB;AACH,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,SAAgB,qBAAqB;IACnC,IAAM,EAAE,GAAG,IAAA,YAAG,EAAC,mBAAmB,CAAC,CAAC;IACpC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEb,cAAc,EAAE,CAAC;IAEjB;;OAEG;IACH,SAAS,OAAO;QACd,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,UAAC,IAAI,IAAK,OAAA,IAAI,KAAK,EAAE,EAAX,CAAW,CAAC,CAAC;QACxC,eAAe,EAAE,CAAC;IACpB,CAAC;IAED,OAAO;QACL;;WAEG;QACH,GAAG,EAAE,cAAM,OAAA,WAAW,EAAX,CAAW;QAEtB;;WAEG;QACH,OAAO,SAAA;KACR,CAAC;AACJ,CAAC;AAzBD,sDAyBC"}
@@ -1,69 +0,0 @@
1
- import { uid } from '../common';
2
- import { addEventListener } from '../dom/addEventListener';
3
- let ids = [];
4
- let timeout = null;
5
- let listener;
6
- let isScrolling = false;
7
- /**
8
- * Creates a scroll event listener if it doesn't exist and updates the `isScrolling` state.
9
- * This listener detects if the user is scrolling and sets a timeout of 150ms to reset the `isScrolling` state.
10
- */
11
- function createListener() {
12
- if (!listener) {
13
- listener = addEventListener(window, 'scroll', () => {
14
- if (timeout) {
15
- clearTimeout(timeout);
16
- }
17
- isScrolling = true;
18
- timeout = setTimeout(() => {
19
- isScrolling = false;
20
- }, 150);
21
- });
22
- }
23
- }
24
- /**
25
- * Destroys the scroll event listener when there are no more IDs associated with it..
26
- */
27
- function destroyListener() {
28
- if (ids.length === 0) {
29
- listener === null || listener === void 0 ? void 0 : listener();
30
- listener = undefined;
31
- }
32
- }
33
- /**
34
- * Creates an instance to check whether the page is currently scrolling.
35
- * This function manages the scroll state across multiple instances, ensuring the listener is created only once.
36
- *
37
- * @example
38
- *
39
- * const scrollChecker = createIsPageScrolling();
40
- *
41
- * // Check if page is scrolling
42
- * const isPageScrolling = scrollChecker.get(); // => true or false
43
- *
44
- * // Destroy the instance when not needed
45
- * scrollChecker.destroy();
46
- */
47
- export function createIsPageScrolling() {
48
- const id = uid('is-page-scrolling');
49
- ids.push(id);
50
- createListener();
51
- /**
52
- * Removes the current instance's ID from the tracking list and destroys the listener if no other IDs exist.
53
- */
54
- function destroy() {
55
- ids = ids.filter((item) => item !== id);
56
- destroyListener();
57
- }
58
- return {
59
- /**
60
- * @returns {boolean} - Returns whether the page is currently scrolling.
61
- */
62
- get: () => isScrolling,
63
- /**
64
- * Destroys the scroll listener instance.
65
- */
66
- destroy,
67
- };
68
- }
69
- //# sourceMappingURL=isPageScrolling.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isPageScrolling.js","sourceRoot":"","sources":["../../../../src/utils/scroll/isPageScrolling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,IAAI,GAAG,GAAa,EAAE,CAAC;AAEvB,IAAI,OAAO,GAA0B,IAAI,CAAC;AAC1C,IAAI,QAAkC,CAAC;AAEvC,IAAI,WAAW,GAAG,KAAK,CAAC;AAExB;;;GAGG;AACH,SAAS,cAAc;IACrB,IAAI,CAAC,QAAQ,EAAE;QACb,QAAQ,GAAG,gBAAgB,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE;YACjD,IAAI,OAAO,EAAE;gBACX,YAAY,CAAC,OAAO,CAAC,CAAC;aACvB;YAED,WAAW,GAAG,IAAI,CAAC;YAEnB,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;gBACxB,WAAW,GAAG,KAAK,CAAC;YACtB,CAAC,EAAE,GAAG,CAAC,CAAC;QACV,CAAC,CAAC,CAAC;KACJ;AACH,CAAC;AAED;;GAEG;AACH,SAAS,eAAe;IACtB,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;QACpB,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,EAAI,CAAC;QACb,QAAQ,GAAG,SAAS,CAAC;KACtB;AACH,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,qBAAqB;IACnC,MAAM,EAAE,GAAG,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACpC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEb,cAAc,EAAE,CAAC;IAEjB;;OAEG;IACH,SAAS,OAAO;QACd,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC;QACxC,eAAe,EAAE,CAAC;IACpB,CAAC;IAED,OAAO;QACL;;WAEG;QACH,GAAG,EAAE,GAAG,EAAE,CAAC,WAAW;QAEtB;;WAEG;QACH,OAAO;KACR,CAAC;AACJ,CAAC"}
@@ -1,25 +0,0 @@
1
- /**
2
- * Creates an instance to check whether the page is currently scrolling.
3
- * This function manages the scroll state across multiple instances, ensuring the listener is created only once.
4
- *
5
- * @example
6
- *
7
- * const scrollChecker = createIsPageScrolling();
8
- *
9
- * // Check if page is scrolling
10
- * const isPageScrolling = scrollChecker.get(); // => true or false
11
- *
12
- * // Destroy the instance when not needed
13
- * scrollChecker.destroy();
14
- */
15
- export declare function createIsPageScrolling(): {
16
- /**
17
- * @returns {boolean} - Returns whether the page is currently scrolling.
18
- */
19
- get: () => boolean;
20
- /**
21
- * Destroys the scroll listener instance.
22
- */
23
- destroy: () => void;
24
- };
25
- //# sourceMappingURL=isPageScrolling.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isPageScrolling.d.ts","sourceRoot":"","sources":["../../../../src/utils/scroll/isPageScrolling.ts"],"names":[],"mappings":"AAwCA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB;IAejC;;OAEG;;IAGH;;OAEG;;EAGN"}
@@ -1,80 +0,0 @@
1
- import { uid } from '../common';
2
- import { addEventListener } from '../dom/addEventListener';
3
-
4
- let ids: string[] = [];
5
-
6
- let timeout: NodeJS.Timeout | null = null;
7
- let listener: (() => void) | undefined;
8
-
9
- let isScrolling = false;
10
-
11
- /**
12
- * Creates a scroll event listener if it doesn't exist and updates the `isScrolling` state.
13
- * This listener detects if the user is scrolling and sets a timeout of 150ms to reset the `isScrolling` state.
14
- */
15
- function createListener() {
16
- if (!listener) {
17
- listener = addEventListener(window, 'scroll', () => {
18
- if (timeout) {
19
- clearTimeout(timeout);
20
- }
21
-
22
- isScrolling = true;
23
-
24
- timeout = setTimeout(() => {
25
- isScrolling = false;
26
- }, 150);
27
- });
28
- }
29
- }
30
-
31
- /**
32
- * Destroys the scroll event listener when there are no more IDs associated with it..
33
- */
34
- function destroyListener() {
35
- if (ids.length === 0) {
36
- listener?.();
37
- listener = undefined;
38
- }
39
- }
40
-
41
- /**
42
- * Creates an instance to check whether the page is currently scrolling.
43
- * This function manages the scroll state across multiple instances, ensuring the listener is created only once.
44
- *
45
- * @example
46
- *
47
- * const scrollChecker = createIsPageScrolling();
48
- *
49
- * // Check if page is scrolling
50
- * const isPageScrolling = scrollChecker.get(); // => true or false
51
- *
52
- * // Destroy the instance when not needed
53
- * scrollChecker.destroy();
54
- */
55
- export function createIsPageScrolling() {
56
- const id = uid('is-page-scrolling');
57
- ids.push(id);
58
-
59
- createListener();
60
-
61
- /**
62
- * Removes the current instance's ID from the tracking list and destroys the listener if no other IDs exist.
63
- */
64
- function destroy() {
65
- ids = ids.filter((item) => item !== id);
66
- destroyListener();
67
- }
68
-
69
- return {
70
- /**
71
- * @returns {boolean} - Returns whether the page is currently scrolling.
72
- */
73
- get: () => isScrolling,
74
-
75
- /**
76
- * Destroys the scroll listener instance.
77
- */
78
- destroy,
79
- };
80
- }