vevet 2.0.1-dev.9 → 2.0.2

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 (130) hide show
  1. package/build/cdn/index.js +1 -1
  2. package/build/cjs/app/Application.js +8 -8
  3. package/build/cjs/app/events/PageLoad.js +3 -3
  4. package/build/cjs/app/events/Viewport.js +5 -5
  5. package/build/cjs/base/Callbacks.js +3 -3
  6. package/build/cjs/base/Module.js +16 -7
  7. package/build/cjs/base/MutableProp.js +10 -10
  8. package/build/cjs/components/animation-frame/AnimationFrame.js +1 -1
  9. package/build/cjs/components/canvas/Ctx2D.js +7 -3
  10. package/build/cjs/components/canvas/Ctx2DPrerender.js +17 -3
  11. package/build/cjs/components/cursor/CustomCursor.js +12 -12
  12. package/build/cjs/components/dragger/Dragger.js +8 -8
  13. package/build/cjs/components/dragger/DraggerMove.js +2 -2
  14. package/build/cjs/components/loading/Preloader.js +5 -5
  15. package/build/cjs/components/loading/ProgressPreloader.js +17 -5
  16. package/build/cjs/components/page/Page.js +37 -9
  17. package/build/cjs/components/scroll/plugins/SmoothScrollKeyboardPlugin.js +2 -2
  18. package/build/cjs/components/scroll/scrollable/ScrollEventsBase.js +1 -1
  19. package/build/cjs/components/scroll/scrollable/ScrollView.js +133 -73
  20. package/build/cjs/components/scroll/scrollbar/Bar.js +18 -15
  21. package/build/cjs/components/scroll/scrollbar/ScrollBar.js +9 -7
  22. package/build/cjs/components/scroll/smooth-scroll/SmoothScroll.js +26 -22
  23. package/build/cjs/components/text/SplitText.js +34 -12
  24. package/build/cjs/components/timeline/StaticTimeline.js +4 -4
  25. package/build/cjs/components/timeline/Timeline.js +2 -2
  26. package/build/cjs/handlers/wheel/WheelHandler.js +4 -4
  27. package/build/cjs/utils/common/mergeWithoutArrays.js +1 -1
  28. package/build/cjs/utils/common/randID.js +2 -2
  29. package/build/cjs/utils/listeners/onScroll.js +66 -28
  30. package/build/cjs/utils/math/{boundVal.js → clamp.js} +3 -3
  31. package/build/cjs/utils/math/clampScope.js +16 -0
  32. package/build/cjs/utils/math/inScope.js +10 -0
  33. package/build/cjs/utils/math/index.js +13 -7
  34. package/build/cjs/utils/math/scoped.js +18 -0
  35. package/build/cjs/utils/math/{spreadScopeProgress.js → spreadScope.js} +2 -2
  36. package/build/cjs/utils/math/wrap.js +13 -0
  37. package/build/es/base/Module.js +2 -4
  38. package/build/es/components/animation-frame/AnimationFrame.js +2 -2
  39. package/build/es/components/canvas/Ctx2D.js +6 -2
  40. package/build/es/components/canvas/Ctx2DPrerender.js +16 -2
  41. package/build/es/components/loading/ProgressPreloader.js +14 -2
  42. package/build/es/components/page/Page.js +32 -8
  43. package/build/es/components/scroll/scrollable/ScrollView.js +112 -62
  44. package/build/es/components/scroll/scrollbar/Bar.js +9 -6
  45. package/build/es/components/scroll/scrollbar/ScrollBar.js +3 -1
  46. package/build/es/components/scroll/smooth-scroll/SmoothScroll.js +13 -9
  47. package/build/es/components/text/SplitText.js +25 -3
  48. package/build/es/components/timeline/StaticTimeline.js +3 -3
  49. package/build/es/components/timeline/Timeline.js +2 -2
  50. package/build/es/utils/listeners/onScroll.js +65 -28
  51. package/build/es/utils/math/{boundVal.js → clamp.js} +2 -2
  52. package/build/es/utils/math/clampScope.js +8 -0
  53. package/build/es/utils/math/inScope.js +6 -0
  54. package/build/es/utils/math/index.js +7 -4
  55. package/build/es/utils/math/scoped.js +14 -0
  56. package/build/es/utils/math/{spreadScopeProgress.js → spreadScope.js} +1 -1
  57. package/build/es/utils/math/wrap.js +10 -0
  58. package/build/types/base/Module.d.ts.map +1 -1
  59. package/build/types/components/canvas/Ctx2D.d.ts +9 -0
  60. package/build/types/components/canvas/Ctx2D.d.ts.map +1 -1
  61. package/build/types/components/canvas/Ctx2DPrerender.d.ts +1 -1
  62. package/build/types/components/canvas/Ctx2DPrerender.d.ts.map +1 -1
  63. package/build/types/components/loading/ProgressPreloader.d.ts +7 -0
  64. package/build/types/components/loading/ProgressPreloader.d.ts.map +1 -1
  65. package/build/types/components/page/Page.d.ts +2 -0
  66. package/build/types/components/page/Page.d.ts.map +1 -1
  67. package/build/types/components/scroll/scrollable/ScrollView.d.ts +40 -14
  68. package/build/types/components/scroll/scrollable/ScrollView.d.ts.map +1 -1
  69. package/build/types/components/scroll/scrollbar/Bar.d.ts.map +1 -1
  70. package/build/types/components/scroll/scrollbar/ScrollBar.d.ts +4 -0
  71. package/build/types/components/scroll/scrollbar/ScrollBar.d.ts.map +1 -1
  72. package/build/types/components/scroll/smooth-scroll/SmoothScroll.d.ts +4 -0
  73. package/build/types/components/scroll/smooth-scroll/SmoothScroll.d.ts.map +1 -1
  74. package/build/types/components/text/SplitText.d.ts +10 -0
  75. package/build/types/components/text/SplitText.d.ts.map +1 -1
  76. package/build/types/utils/listeners/onScroll.d.ts +10 -6
  77. package/build/types/utils/listeners/onScroll.d.ts.map +1 -1
  78. package/build/types/utils/math/clamp.d.ts +5 -0
  79. package/build/types/utils/math/clamp.d.ts.map +1 -0
  80. package/build/types/utils/math/clampScope.d.ts +5 -0
  81. package/build/types/utils/math/clampScope.d.ts.map +1 -0
  82. package/build/types/utils/math/inScope.d.ts +5 -0
  83. package/build/types/utils/math/inScope.d.ts.map +1 -0
  84. package/build/types/utils/math/index.d.ts +7 -4
  85. package/build/types/utils/math/index.d.ts.map +1 -1
  86. package/build/types/utils/math/scoped.d.ts +12 -0
  87. package/build/types/utils/math/scoped.d.ts.map +1 -0
  88. package/build/types/utils/math/spreadScope.d.ts +5 -0
  89. package/build/types/utils/math/spreadScope.d.ts.map +1 -0
  90. package/build/types/utils/math/wrap.d.ts +5 -0
  91. package/build/types/utils/math/wrap.d.ts.map +1 -0
  92. package/package.json +3 -3
  93. package/src/ts/base/Module.ts +5 -4
  94. package/src/ts/components/animation-frame/AnimationFrame.ts +2 -2
  95. package/src/ts/components/canvas/Ctx2D.ts +16 -1
  96. package/src/ts/components/canvas/Ctx2DPrerender.ts +19 -6
  97. package/src/ts/components/loading/ProgressPreloader.ts +21 -2
  98. package/src/ts/components/page/Page.ts +34 -8
  99. package/src/ts/components/scroll/scrollable/ScrollView.ts +155 -86
  100. package/src/ts/components/scroll/scrollbar/Bar.ts +9 -6
  101. package/src/ts/components/scroll/scrollbar/ScrollBar.ts +7 -0
  102. package/src/ts/components/scroll/smooth-scroll/SmoothScroll.ts +17 -8
  103. package/src/ts/components/text/SplitText.ts +38 -2
  104. package/src/ts/components/timeline/StaticTimeline.ts +4 -4
  105. package/src/ts/components/timeline/Timeline.ts +2 -2
  106. package/src/ts/utils/listeners/onScroll.ts +101 -38
  107. package/src/ts/utils/math/{boundVal.ts → clamp.ts} +3 -3
  108. package/src/ts/utils/math/clampScope.ts +16 -0
  109. package/src/ts/utils/math/inScope.ts +9 -0
  110. package/src/ts/utils/math/index.ts +12 -6
  111. package/src/ts/utils/math/scoped.ts +17 -0
  112. package/src/ts/utils/math/{spreadScopeProgress.ts → spreadScope.ts} +2 -2
  113. package/src/ts/utils/math/wrap.ts +18 -0
  114. package/build/cjs/components/scroll/custom-scroll/CustomScroll.js +0 -517
  115. package/build/cjs/components/split-text/SplitText.js +0 -233
  116. package/build/cjs/utils/math/scopeProgress.js +0 -25
  117. package/build/es/components/scroll/custom-scroll/CustomScroll.js +0 -486
  118. package/build/es/components/split-text/SplitText.js +0 -199
  119. package/build/es/utils/math/scopeProgress.js +0 -22
  120. package/build/types/components/scroll/custom-scroll/CustomScroll.d.ts +0 -322
  121. package/build/types/components/scroll/custom-scroll/CustomScroll.d.ts.map +0 -1
  122. package/build/types/components/split-text/SplitText.d.ts +0 -118
  123. package/build/types/components/split-text/SplitText.d.ts.map +0 -1
  124. package/build/types/utils/math/boundVal.d.ts +0 -5
  125. package/build/types/utils/math/boundVal.d.ts.map +0 -1
  126. package/build/types/utils/math/scopeProgress.d.ts +0 -20
  127. package/build/types/utils/math/scopeProgress.d.ts.map +0 -1
  128. package/build/types/utils/math/spreadScopeProgress.d.ts +0 -5
  129. package/build/types/utils/math/spreadScopeProgress.d.ts.map +0 -1
  130. package/src/ts/utils/math/scopeProgress.ts +0 -23
@@ -31,6 +31,10 @@ export declare namespace NSmoothScroll {
31
31
  * @default false
32
32
  */
33
33
  animationFrame?: false | AnimationFrame;
34
+ /**
35
+ * @default 0
36
+ */
37
+ resizeTimeout?: number;
34
38
  }
35
39
  /**
36
40
  * Changeable properties
@@ -1 +1 @@
1
- {"version":3,"file":"SmoothScroll.d.ts","sourceRoot":"","sources":["../../../../../src/ts/components/scroll/smooth-scroll/SmoothScroll.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAKrD,yBAAiB,aAAa,CAAC;IAE3B;;OAEG;IACH,UAAiB,UAAW,SAAQ,UAAU,CAAC,UAAU;QACrD;;WAEG;QACH,SAAS,CAAC,EAAE;YACR;;;;eAIG;YACH,KAAK,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;YAC7B;;;;eAIG;YACH,QAAQ,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,UAAU,CAAC,WAAW,CAAC,GAAG,WAAW,GAAG,WAAW,EAAE,CAAC;SACrF,CAAC;QACF;;;;WAIG;QACH,cAAc,CAAC,EAAE,KAAK,GAAG,cAAc,CAAC;KAC3C;IAED;;OAEG;IACH,UAAiB,cAAe,SAAQ,UAAU,CAAC,cAAc;QAC7D;;;WAGG;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB;;;WAGG;QACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B;;;WAGG;QACH,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB;;;WAGG;QACH,YAAY,CAA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SAAS,CAAC,KAAK,CACX,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,IAAI,SAAsB;IAa9B;;OAEG;IACH,SAAS,CAAC,YAAY,CAClB,EAAE,GAAE,kBAAkB,GAAG,KAAa;IAU1C;;OAEG;IACH,SAAS,CAAC,eAAe;IAgBzB;;OAEG;IACI,QAAQ;IA2Cf;;OAEG;IACH,SAAS,CAAC,QAAQ;CA0BrB"}
@@ -1,3 +1,4 @@
1
+ import { NViewport } from '../../app/events/Viewport';
1
2
  import { Component, NComponent } from '../../base/Component';
2
3
  import { RequiredModuleProp } from '../../utils/types/utility';
3
4
  export declare namespace NSplitText {
@@ -20,6 +21,15 @@ export declare namespace NSplitText {
20
21
  * @default false
21
22
  */
22
23
  appendLines?: boolean;
24
+ /**
25
+ * Viewport resize event target
26
+ * @default ''
27
+ */
28
+ viewportTarget?: keyof NViewport.CallbacksTypes;
29
+ /**
30
+ * @default 0
31
+ */
32
+ resizeTimeout?: number;
23
33
  }
24
34
  /**
25
35
  * Changeable properties
@@ -1 +1 @@
1
- {"version":3,"file":"SplitText.d.ts","sourceRoot":"","sources":["../../../../src/ts/components/text/SplitText.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAI/D,yBAAiB,UAAU,CAAC;IAExB;;OAEG;IACH,UAAiB,UAAW,SAAQ,UAAU,CAAC,UAAU;QACrD;;;WAGG;QACH,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;QAC7B;;;WAGG;QACH,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB;;;WAGG;QACH,WAAW,CAAC,EAAE,OAAO,CAAC;KACzB;IAED;;OAEG;IACH,UAAiB,cAAe,SAAQ,UAAU,CAAC,cAAc;KAAI;IAErE;;OAEG;IACH,UAAiB,cAAe,SAAQ,UAAU,CAAC,cAAc;QAC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AC,UAAU,EAAG,WAAW,CAAC;IAEnC,IAAI,OAAO,wBAEV;IACD,SAAS,CAAC,QAAQ,EAAE,UAAU,CAAC,MAAM,EAAE,CAAC;IAExC,IAAI,KAAK,sBAER;IACD,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC;IAEpC,IAAI,KAAK,sBAER;IACD,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC;gBAKhC,WAAW,CAAC,EAAE,CAAC,UAAU,GAAG,cAAc,CAAC,EAC3C,IAAI,UAAO;IAsCf,SAAS,CAAC,UAAU;IAgBpB;;OAEG;IACI,SAAS;IAmBhB;;OAEG;IACH,SAAS,CAAC,eAAe;IAiEzB;;OAEG;IACH,SAAS,CAAC,YAAY;IAYtB;;OAEG;IACH,SAAS,CAAC,YAAY;IActB;;OAEG;IACH,SAAS,CAAC,iBAAiB;IAkC3B;;OAEG;IACH,SAAS,CAAC,eAAe;IA8DzB;;OAEG;IACH,SAAS,CAAC,YAAY;IAYtB;;OAEG;IACH,SAAS,CAAC,QAAQ;CASrB"}
@@ -1,14 +1,18 @@
1
- import { SmoothScroll } from '../../components/scroll/smooth-scroll/SmoothScroll';
2
1
  import { IRemovable } from '../types/general';
2
+ import { SmoothScroll } from '../../components/scroll/smooth-scroll/SmoothScroll';
3
+ declare type Container = string | Element | SmoothScroll | Window;
4
+ interface ArgData {
5
+ scrollTop: number;
6
+ scrollLeft: number;
7
+ }
3
8
  interface Props {
4
- passive?: boolean;
9
+ container: Container;
10
+ callback: (data: ArgData) => void;
11
+ isPassive?: boolean;
5
12
  }
6
13
  /**
7
14
  * Add OnScroll event
8
15
  */
9
- export default function onScroll(selector: string | Element | SmoothScroll | Window, callback: (arg: {
10
- scrollTop: number;
11
- scrollLeft: number;
12
- }) => void, props?: Props): IRemovable;
16
+ export default function onScroll({ container, callback, isPassive, }: Props): IRemovable;
13
17
  export {};
14
18
  //# sourceMappingURL=onScroll.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"onScroll.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/listeners/onScroll.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,oDAAoD,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,UAAU,KAAK;IACX,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC5B,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,YAAY,GAAG,MAAM,EAClD,QAAQ,EAAE,CAAC,GAAG,EAAE;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAA;CACrB,KAAK,IAAI,EACV,KAAK,CAAC,EAAE,KAAK,GACd,UAAU,CA6CZ"}
1
+ {"version":3,"file":"onScroll.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/listeners/onScroll.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oDAAoD,CAAC;AAGlF,aAAK,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,YAAY,GAAG,MAAM,CAAC;AAE1D,UAAU,OAAO;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACtB;AAeD,UAAU,KAAK;IACX,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAID;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAE,EAC9B,SAAS,EACT,QAAQ,EACR,SAAiB,GACpB,EAAE,KAAK,GAAG,UAAU,CAsFpB"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Clamp the value between two points
3
+ */
4
+ export default function clamp(val: number, scope?: number[]): number;
5
+ //# sourceMappingURL=clamp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clamp.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/math/clamp.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,KAAK,CACzB,GAAG,EAAE,MAAM,EACX,KAAK,WAAS,UASjB"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Get progress relatively to the scope and clamp it within two points
3
+ */
4
+ export default function clampScoped(val: number, scope?: number[], clampScope?: number[]): number;
5
+ //# sourceMappingURL=clampScope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clampScope.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/math/clampScope.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAC/B,GAAG,EAAE,MAAM,EACX,KAAK,WAAS,EACd,UAAU,WAAS,UAMtB"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Check if the value is within the scope
3
+ */
4
+ export default function inScope(val: number, scopeValue?: number[]): boolean;
5
+ //# sourceMappingURL=inScope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inScope.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/math/inScope.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAC3B,GAAG,EAAE,MAAM,EACX,UAAU,WAAS,WAGtB"}
@@ -1,6 +1,9 @@
1
- import boundVal from './boundVal';
1
+ import clamp from './clamp';
2
2
  import lerp from './lerp';
3
- import scopeProgress from './scopeProgress';
4
- import spreadScopeProgress from './spreadScopeProgress';
5
- export { boundVal, lerp, scopeProgress, spreadScopeProgress, };
3
+ import scoped from './scoped';
4
+ import spreadScope from './spreadScope';
5
+ import inScope from './inScope';
6
+ import clampScope from './clampScope';
7
+ import wrap from './wrap';
8
+ export { clamp, lerp, scoped, spreadScope, inScope, clampScope, wrap, };
6
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/math/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAExD,OAAO,EACH,QAAQ,EACR,IAAI,EACJ,aAAa,EACb,mBAAmB,GACtB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/math/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAE1B,OAAO,EACH,KAAK,EACL,IAAI,EACJ,MAAM,EACN,WAAW,EACX,OAAO,EACP,UAAU,EACV,IAAI,GACP,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Get progress relatively to the scope.
3
+ *
4
+ * @example
5
+ *
6
+ * scope(.35, [0, 1]);
7
+ * // => .5
8
+ * scope(.35, [.25, 1]);
9
+ * // => .133
10
+ */
11
+ export default function scoped(val: number, scopeValue?: number[]): number;
12
+ //# sourceMappingURL=scoped.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scoped.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/math/scoped.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAC1B,GAAG,EAAE,MAAM,EACX,UAAU,WAAS,UAItB"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Distribute scope progress among a certain quantity of timelines.
3
+ */
4
+ export default function spreadScope(quantity: number, shift: number): number[][];
5
+ //# sourceMappingURL=spreadScope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spreadScope.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/math/spreadScope.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAC/B,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,cAYhB"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Wrap values
3
+ */
4
+ export default function wrap(min: number, max: number, value: number): number | ((val: number) => number);
5
+ //# sourceMappingURL=wrap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrap.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/math/wrap.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,IAAI,CACxB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,sCAIhB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vevet",
3
- "version": "2.0.1-dev.9",
3
+ "version": "2.0.2",
4
4
  "description": "VEVET - A JavaScript library",
5
5
  "browserslist": [
6
6
  "since 2015"
@@ -17,7 +17,7 @@
17
17
  "prepare:cdn": "webpack --config ./config/webpack.cdn.js",
18
18
  "lint:js": "eslint . --ext .ts,.js",
19
19
  "prepare": "npm run prepare:all",
20
- "release": "npm version prerelease --preid=dev && npm publish"
20
+ "release": "npm version patch && npm publish"
21
21
  },
22
22
  "main": "./build/cjs/index.js",
23
23
  "types": "./build/types/index.d.ts",
@@ -99,7 +99,7 @@
99
99
  "dependencies": {
100
100
  "detect-browser": "^5.2.0",
101
101
  "easing-progress": "0.0.4",
102
- "get-image-pos": "0.0.9",
102
+ "get-image-pos": "0.0.11",
103
103
  "ismobilejs": "^1.1.1",
104
104
  "lodash.mergewith": "^4.6.2",
105
105
  "normalize-wheel": "^1.0.1",
@@ -299,12 +299,13 @@ export class Module<
299
299
  public addViewportCallback (
300
300
  target: Parameters<Viewport['add']>[0],
301
301
  func: Parameters<Viewport['add']>[1],
302
- data: Parameters<Viewport['add']>[2] = {
303
- name: this.constructor.name,
304
- },
302
+ data: Parameters<Viewport['add']>[2] = {},
305
303
 
306
304
  ) {
307
- const callback = this._app.viewport.add(target, func, data);
305
+ const callback = this._app.viewport.add(target, func, {
306
+ ...data,
307
+ name: this.constructor.name,
308
+ });
308
309
  this._viewportCallbacks.push(callback);
309
310
  return callback;
310
311
  }
@@ -1,5 +1,5 @@
1
1
  import { Component, NComponent } from '../../base/Component';
2
- import { boundVal } from '../../utils/math';
2
+ import { clamp } from '../../utils/math';
3
3
  import { RequiredModuleProp } from '../../utils/types/utility';
4
4
 
5
5
 
@@ -237,7 +237,7 @@ export class AnimationFrame <
237
237
 
238
238
  // calculate real fps
239
239
  const timeDiff = currentTime - this._prevFrameTime;
240
- const realFPS = boundVal(
240
+ const realFPS = clamp(
241
241
  timeDiff === 0 ? 1000 / 60 : Math.floor(1000 / timeDiff),
242
242
  [1, Infinity],
243
243
  );
@@ -26,6 +26,15 @@ export namespace NCtx2D {
26
26
  * @default false
27
27
  */
28
28
  updateOnResize?: boolean | keyof NViewport.CallbacksTypes;
29
+ /**
30
+ * If need to resize when initializing
31
+ * @default true
32
+ */
33
+ initialResize?: boolean;
34
+ /**
35
+ * @default 0
36
+ */
37
+ resizeTimeout?: number;
29
38
  }
30
39
 
31
40
  /**
@@ -157,7 +166,9 @@ export class Ctx2D <
157
166
  });
158
167
  this._ctx = this._canvas.getContext('2d')!;
159
168
  // and resize it for the first time
160
- this.resize();
169
+ if (this.prop.initialResize) {
170
+ this.resize();
171
+ }
161
172
 
162
173
  // initialize the class
163
174
  if (init) {
@@ -173,6 +184,8 @@ export class Ctx2D <
173
184
  container: false,
174
185
  append: true,
175
186
  updateOnResize: false,
187
+ initialResize: true,
188
+ resizeTimeout: 0,
176
189
  width: false,
177
190
  height: false,
178
191
  dpr: false,
@@ -186,6 +199,8 @@ export class Ctx2D <
186
199
  const viewportTarget: keyof NViewport.CallbacksTypes = typeof this.prop.updateOnResize === 'boolean' ? '' : this.prop.updateOnResize;
187
200
  this.addViewportCallback(viewportTarget, () => {
188
201
  this.resize();
202
+ }, {
203
+ timeout: this.prop.resizeTimeout,
189
204
  });
190
205
  this.resize();
191
206
  }
@@ -13,7 +13,7 @@ export namespace NCtx2DPrerender {
13
13
  /**
14
14
  * Media element
15
15
  */
16
- media: BaseProp['source'] | false;
16
+ media: BaseProp['source'] | Ctx2DPrerender | false;
17
17
  }
18
18
 
19
19
  /**
@@ -78,9 +78,23 @@ export class Ctx2DPrerender <
78
78
  return;
79
79
  }
80
80
 
81
+ // get source info
82
+ let source: BaseProp['source'];
83
+ let sourceWidth: number | undefined;
84
+ let sourceHeight: number | undefined;
85
+ if (media instanceof Ctx2D) {
86
+ source = media.canvas;
87
+ sourceWidth = media.width;
88
+ sourceHeight = media.height;
89
+ } else {
90
+ source = media;
91
+ }
92
+
81
93
  // get media sizes
82
94
  const size = getPos({
83
- source: media,
95
+ source,
96
+ sourceWidth,
97
+ sourceHeight,
84
98
  rule: this.prop.posRule,
85
99
  scale: 1,
86
100
  width: this.width,
@@ -89,10 +103,9 @@ export class Ctx2DPrerender <
89
103
  this._ctx.clearRect(0, 0, this.width, this.height);
90
104
  // render the media
91
105
  this._ctx.drawImage(
92
- media,
93
- 0, 0,
94
- size.sourceWidth, size.sourceHeight,
95
- size.x, size.y, size.width, size.height,
106
+ source,
107
+ size.x, size.y,
108
+ size.width, size.height,
96
109
  );
97
110
  // launch callbacks on prerender
98
111
  this.callbacks.tbt('prerender', false);
@@ -40,6 +40,13 @@ export namespace NProgressPreloader {
40
40
  * @default '.js-preload'
41
41
  */
42
42
  custom?: string | false;
43
+ /**
44
+ * If you enable images, video, or custom loaders,
45
+ * all these resources will be preloaded. In cases when you may want not
46
+ * to preload a certain resource, you can add to it the class name specified here.
47
+ * @default 'js-preload-ignore'
48
+ */
49
+ ignoreClassName?: string;
43
50
  };
44
51
  /**
45
52
  * Smooth calculation settings
@@ -107,6 +114,7 @@ export class ProgressPreloader <
107
114
  img: true,
108
115
  video: true,
109
116
  custom: '.js-preload',
117
+ ignoreClassName: 'js-preload-ignore',
110
118
  },
111
119
  calc: {
112
120
  lerp: 0.1,
@@ -275,6 +283,9 @@ export class ProgressPreloader <
275
283
  if (loaders.img) {
276
284
  const imgs = selectAll('img');
277
285
  imgs.forEach((img) => {
286
+ if (img.classList.contains(loaders.ignoreClassName)) {
287
+ return;
288
+ }
278
289
  this._imgs.push(img);
279
290
  this._resourcesTotal += 1;
280
291
  });
@@ -284,6 +295,9 @@ export class ProgressPreloader <
284
295
  if (loaders.video) {
285
296
  const videos = selectAll('video');
286
297
  videos.forEach((video) => {
298
+ if (video.classList.contains(loaders.ignoreClassName)) {
299
+ return;
300
+ }
287
301
  this._videos.push(video);
288
302
  this._resourcesTotal += 1;
289
303
  });
@@ -291,7 +305,12 @@ export class ProgressPreloader <
291
305
 
292
306
  // get custom resources
293
307
  if (loaders.custom) {
294
- this._customResources = Array.from(selectAll(loaders.custom));
308
+ this._customResources = Array.from(selectAll(loaders.custom)).filter((el) => {
309
+ if (el.classList.contains(loaders.ignoreClassName)) {
310
+ return false;
311
+ }
312
+ return true;
313
+ });
295
314
  this._resourcesTotal += this._customResources.length;
296
315
  }
297
316
  }
@@ -318,7 +337,7 @@ export class ProgressPreloader <
318
337
  img.addEventListener('error', () => {
319
338
  this._handleLoadedResource();
320
339
  });
321
- image.src = img.src;
340
+ image.src = img.currentSrc || img.src;
322
341
  }
323
342
  });
324
343
 
@@ -52,6 +52,11 @@ export class Page <
52
52
  ChangeableProp,
53
53
  CallbacksTypes
54
54
  > {
55
+ protected _blocked: boolean;
56
+ protected get blocked () {
57
+ return this._blocked;
58
+ }
59
+
55
60
  /**
56
61
  * If the page is created
57
62
  */
@@ -95,6 +100,7 @@ export class Page <
95
100
  super(initialProp, false);
96
101
 
97
102
  // set default vars
103
+ this._blocked = false;
98
104
  this._created = false;
99
105
  this._shown = false;
100
106
  this._hidden = false;
@@ -129,11 +135,12 @@ export class Page <
129
135
  resolve, reject,
130
136
  ) => {
131
137
  this.canCreate().then(() => {
132
- if (this.created) {
138
+ if (this.created || this.blocked) {
139
+ reject();
133
140
  return;
134
141
  }
135
142
  // update vars
136
- this._created = true;
143
+ this._blocked = true;
137
144
  this._shown = false;
138
145
  this._hidden = false;
139
146
  this._destroyed = false;
@@ -147,7 +154,11 @@ export class Page <
147
154
  // actions
148
155
  this._create().then(() => {
149
156
  this.callbacks.tbt('create', false);
157
+ this._blocked = false;
158
+ this._created = true;
150
159
  resolve();
160
+ }).catch(() => {
161
+ reject();
151
162
  });
152
163
  }).catch(() => {
153
164
  reject();
@@ -191,19 +202,24 @@ export class Page <
191
202
  resolve, reject,
192
203
  ) => {
193
204
  this.canShow().then(() => {
194
- if (this.shown) {
205
+ if (this.shown || this.blocked) {
206
+ reject();
195
207
  return;
196
208
  }
197
209
  // update vars
210
+ this._blocked = true;
198
211
  this._created = true;
199
- this._shown = true;
200
212
  this._hidden = false;
201
213
  this._destroyed = false;
202
214
 
203
215
  // actions
204
216
  this._show().then(() => {
205
217
  this.callbacks.tbt('show', false);
218
+ this._blocked = false;
219
+ this._shown = true;
206
220
  resolve();
221
+ }).catch(() => {
222
+ reject();
207
223
  });
208
224
  // launch events
209
225
  }).catch(() => {
@@ -249,19 +265,24 @@ export class Page <
249
265
  reject: (...arg: any) => void,
250
266
  ) => {
251
267
  this.canHide().then(() => {
252
- if (this.hidden) {
268
+ if (this.hidden || this.blocked) {
269
+ reject();
253
270
  return;
254
271
  }
255
272
  // update vars
273
+ this._blocked = true;
256
274
  this._created = true;
257
275
  this._shown = false;
258
- this._hidden = true;
259
276
  this._destroyed = false;
260
277
 
261
278
  // actions
262
279
  this._hide().then(() => {
263
280
  this.callbacks.tbt('hide', false);
281
+ this._blocked = false;
282
+ this._hidden = true;
264
283
  resolve();
284
+ }).catch(() => {
285
+ reject();
265
286
  });
266
287
  }).catch(() => {
267
288
  reject();
@@ -306,14 +327,15 @@ export class Page <
306
327
  reject: (...arg: any) => void,
307
328
  ) => {
308
329
  this.canDestroy().then(() => {
309
- if (this.destroyed) {
330
+ if (this.destroyed || this.blocked) {
331
+ reject();
310
332
  return;
311
333
  }
312
334
  // change vars
335
+ this._blocked = true;
313
336
  this._created = false;
314
337
  this._shown = false;
315
338
  this._hidden = true;
316
- this._destroyed = true;
317
339
 
318
340
  // update page
319
341
  this._app.page = false;
@@ -322,7 +344,11 @@ export class Page <
322
344
 
323
345
  // actions
324
346
  this._destroy().then(() => {
347
+ this._blocked = false;
348
+ this._destroyed = true;
325
349
  resolve();
350
+ }).catch(() => {
351
+ reject();
326
352
  });
327
353
  }).catch(() => {
328
354
  reject();