@studiometa/ui 0.2.12 → 0.2.14

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 (217) hide show
  1. package/atoms/AnchorScrollTo/AnchorScrollTo.cjs +3 -3
  2. package/atoms/AnchorScrollTo/AnchorScrollTo.d.ts +8 -15
  3. package/atoms/AnchorScrollTo/AnchorScrollTo.js +26 -1
  4. package/atoms/AnchorScrollTo/index.cjs +20 -0
  5. package/atoms/AnchorScrollTo/index.d.ts +1 -0
  6. package/atoms/AnchorScrollTo/index.js +1 -0
  7. package/atoms/Cursor/Cursor.cjs +16 -9
  8. package/atoms/Cursor/Cursor.d.ts +19 -117
  9. package/atoms/Cursor/Cursor.js +111 -1
  10. package/atoms/Cursor/index.cjs +20 -0
  11. package/atoms/Cursor/index.d.ts +1 -0
  12. package/atoms/Cursor/index.js +1 -0
  13. package/atoms/Figure/Figure.cjs +15 -9
  14. package/atoms/Figure/Figure.d.ts +18 -53
  15. package/atoms/Figure/Figure.js +56 -1
  16. package/atoms/Figure/FigureTwicPics.cjs +10 -10
  17. package/atoms/Figure/FigureTwicPics.d.ts +16 -37
  18. package/atoms/Figure/FigureTwicPics.js +51 -1
  19. package/atoms/Figure/index.cjs +4 -14
  20. package/atoms/Figure/index.d.ts +2 -2
  21. package/atoms/Figure/index.js +2 -1
  22. package/atoms/LargeText/LargeText.cjs +17 -10
  23. package/atoms/LargeText/LargeText.d.ts +19 -40
  24. package/atoms/LargeText/LargeText.js +68 -1
  25. package/atoms/LargeText/index.cjs +20 -0
  26. package/atoms/LargeText/index.d.ts +1 -0
  27. package/atoms/LargeText/index.js +1 -0
  28. package/atoms/LazyInclude/LazyInclude.cjs +2 -2
  29. package/atoms/LazyInclude/LazyInclude.d.ts +17 -36
  30. package/atoms/LazyInclude/LazyInclude.js +46 -1
  31. package/atoms/LazyInclude/index.cjs +20 -0
  32. package/atoms/LazyInclude/index.d.ts +1 -0
  33. package/atoms/LazyInclude/index.js +1 -0
  34. package/atoms/Prefetch/AbstractPrefetch.cjs +6 -6
  35. package/atoms/Prefetch/AbstractPrefetch.d.ts +12 -35
  36. package/atoms/Prefetch/AbstractPrefetch.js +58 -1
  37. package/atoms/Prefetch/PrefetchWhenOver.cjs +5 -8
  38. package/atoms/Prefetch/PrefetchWhenOver.d.ts +8 -14
  39. package/atoms/Prefetch/PrefetchWhenOver.js +19 -1
  40. package/atoms/Prefetch/PrefetchWhenVisible.cjs +5 -8
  41. package/atoms/Prefetch/PrefetchWhenVisible.d.ts +10 -14
  42. package/atoms/Prefetch/PrefetchWhenVisible.js +20 -1
  43. package/atoms/Prefetch/index.cjs +5 -16
  44. package/atoms/Prefetch/index.d.ts +3 -3
  45. package/atoms/Prefetch/index.js +3 -1
  46. package/atoms/ScrollAnimation/AbstractScrollAnimation.cjs +17 -14
  47. package/atoms/ScrollAnimation/AbstractScrollAnimation.d.ts +19 -89
  48. package/atoms/ScrollAnimation/AbstractScrollAnimation.js +67 -1
  49. package/atoms/ScrollAnimation/ScrollAnimation.cjs +5 -14
  50. package/atoms/ScrollAnimation/ScrollAnimation.d.ts +13 -51
  51. package/atoms/ScrollAnimation/ScrollAnimation.js +21 -1
  52. package/atoms/ScrollAnimation/ScrollAnimationChild.cjs +37 -14
  53. package/atoms/ScrollAnimation/ScrollAnimationChild.d.ts +19 -6
  54. package/atoms/ScrollAnimation/ScrollAnimationChild.js +53 -1
  55. package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.cjs +6 -9
  56. package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.d.ts +8 -2
  57. package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.js +17 -1
  58. package/atoms/ScrollAnimation/ScrollAnimationParent.cjs +8 -8
  59. package/atoms/ScrollAnimation/ScrollAnimationParent.d.ts +14 -26
  60. package/atoms/ScrollAnimation/ScrollAnimationParent.js +27 -1
  61. package/atoms/ScrollAnimation/ScrollAnimationWithEase.cjs +6 -9
  62. package/atoms/ScrollAnimation/ScrollAnimationWithEase.d.ts +15 -2
  63. package/atoms/ScrollAnimation/ScrollAnimationWithEase.js +17 -1
  64. package/atoms/ScrollAnimation/animationScrollWithEase.cjs +24 -16
  65. package/atoms/ScrollAnimation/animationScrollWithEase.d.ts +10 -8
  66. package/atoms/ScrollAnimation/animationScrollWithEase.js +36 -1
  67. package/atoms/ScrollAnimation/index.cjs +9 -24
  68. package/atoms/ScrollAnimation/index.d.ts +7 -7
  69. package/atoms/ScrollAnimation/index.js +7 -1
  70. package/atoms/ScrollReveal/ScrollReveal.cjs +7 -4
  71. package/atoms/ScrollReveal/ScrollReveal.d.ts +16 -59
  72. package/atoms/ScrollReveal/ScrollReveal.js +54 -1
  73. package/atoms/ScrollReveal/index.cjs +3 -12
  74. package/atoms/ScrollReveal/index.d.ts +1 -1
  75. package/atoms/ScrollReveal/index.js +1 -1
  76. package/atoms/index.cjs +5 -18
  77. package/atoms/index.d.ts +8 -8
  78. package/atoms/index.js +8 -1
  79. package/decorators/index.cjs +3 -12
  80. package/decorators/index.d.ts +1 -1
  81. package/decorators/index.js +1 -1
  82. package/decorators/withTransition.cjs +44 -29
  83. package/decorators/withTransition.d.ts +21 -33
  84. package/decorators/withTransition.js +60 -1
  85. package/index.cjs +1 -1
  86. package/index.d.ts +5 -5
  87. package/index.js +5 -1
  88. package/molecules/Accordion/Accordion.cjs +7 -10
  89. package/molecules/Accordion/Accordion.d.ts +5 -23
  90. package/molecules/Accordion/Accordion.js +19 -1
  91. package/molecules/Accordion/AccordionCore.cjs +6 -8
  92. package/molecules/Accordion/AccordionCore.d.ts +22 -70
  93. package/molecules/Accordion/AccordionCore.js +32 -1
  94. package/molecules/Accordion/AccordionItem.cjs +39 -23
  95. package/molecules/Accordion/AccordionItem.d.ts +24 -94
  96. package/molecules/Accordion/AccordionItem.js +153 -1
  97. package/molecules/Accordion/index.cjs +21 -0
  98. package/molecules/Accordion/index.d.ts +2 -0
  99. package/molecules/Accordion/index.js +2 -0
  100. package/molecules/Menu/Menu.cjs +6 -10
  101. package/molecules/Menu/Menu.d.ts +24 -84
  102. package/molecules/Menu/Menu.js +114 -1
  103. package/molecules/Menu/MenuBtn.cjs +7 -5
  104. package/molecules/Menu/MenuBtn.d.ts +7 -9
  105. package/molecules/Menu/MenuBtn.js +30 -1
  106. package/molecules/Menu/MenuList.cjs +13 -11
  107. package/molecules/Menu/MenuList.d.ts +16 -53
  108. package/molecules/Menu/MenuList.js +113 -1
  109. package/molecules/Menu/index.cjs +5 -16
  110. package/molecules/Menu/index.d.ts +3 -3
  111. package/molecules/Menu/index.js +3 -1
  112. package/molecules/Modal/Modal.cjs +42 -13
  113. package/molecules/Modal/Modal.d.ts +69 -140
  114. package/molecules/Modal/Modal.js +163 -1
  115. package/molecules/Modal/ModalWithTransition.cjs +4 -7
  116. package/molecules/Modal/ModalWithTransition.d.ts +6 -22
  117. package/molecules/Modal/ModalWithTransition.js +46 -1
  118. package/molecules/Modal/index.cjs +21 -0
  119. package/molecules/Modal/index.d.ts +2 -0
  120. package/molecules/Modal/index.js +2 -0
  121. package/molecules/Panel/Panel.cjs +41 -26
  122. package/molecules/Panel/Panel.d.ts +22 -21
  123. package/molecules/Panel/Panel.js +108 -1
  124. package/molecules/Panel/index.cjs +20 -0
  125. package/molecules/Panel/index.d.ts +1 -0
  126. package/molecules/Panel/index.js +1 -0
  127. package/molecules/Slider/AbstractSliderChild.cjs +7 -9
  128. package/molecules/Slider/AbstractSliderChild.d.ts +11 -30
  129. package/molecules/Slider/AbstractSliderChild.js +48 -1
  130. package/molecules/Slider/Slider.cjs +46 -30
  131. package/molecules/Slider/Slider.d.ts +40 -157
  132. package/molecules/Slider/Slider.js +279 -1
  133. package/molecules/Slider/SliderBtn.cjs +4 -7
  134. package/molecules/Slider/SliderBtn.d.ts +12 -23
  135. package/molecules/Slider/SliderBtn.js +34 -1
  136. package/molecules/Slider/SliderCount.cjs +4 -7
  137. package/molecules/Slider/SliderCount.d.ts +10 -16
  138. package/molecules/Slider/SliderCount.js +19 -1
  139. package/molecules/Slider/SliderDots.cjs +8 -8
  140. package/molecules/Slider/SliderDots.d.ts +11 -31
  141. package/molecules/Slider/SliderDots.js +32 -1
  142. package/molecules/Slider/SliderDrag.cjs +2 -2
  143. package/molecules/Slider/SliderDrag.d.ts +12 -30
  144. package/molecules/Slider/SliderDrag.js +34 -1
  145. package/molecules/Slider/SliderItem.cjs +12 -6
  146. package/molecules/Slider/SliderItem.d.ts +21 -33
  147. package/molecules/Slider/SliderItem.js +93 -1
  148. package/molecules/Slider/SliderProgress.cjs +4 -7
  149. package/molecules/Slider/SliderProgress.d.ts +10 -25
  150. package/molecules/Slider/SliderProgress.js +26 -1
  151. package/molecules/Slider/index.cjs +10 -26
  152. package/molecules/Slider/index.d.ts +8 -8
  153. package/molecules/Slider/index.js +8 -1
  154. package/molecules/Sticky/Sticky.cjs +16 -10
  155. package/molecules/Sticky/Sticky.d.ts +30 -68
  156. package/molecules/Sticky/Sticky.js +110 -1
  157. package/molecules/Sticky/index.cjs +20 -0
  158. package/molecules/Sticky/index.d.ts +1 -0
  159. package/molecules/Sticky/index.js +1 -0
  160. package/molecules/TableOfContent/TableOfContent.cjs +5 -8
  161. package/molecules/TableOfContent/TableOfContent.d.ts +19 -41
  162. package/molecules/TableOfContent/TableOfContent.js +42 -1
  163. package/molecules/TableOfContent/TableOfContentAnchor.cjs +9 -5
  164. package/molecules/TableOfContent/TableOfContentAnchor.d.ts +14 -17
  165. package/molecules/TableOfContent/TableOfContentAnchor.js +43 -1
  166. package/molecules/TableOfContent/index.cjs +4 -14
  167. package/molecules/TableOfContent/index.d.ts +2 -2
  168. package/molecules/TableOfContent/index.js +2 -1
  169. package/molecules/Tabs/Tabs.cjs +42 -22
  170. package/molecules/Tabs/Tabs.d.ts +28 -90
  171. package/molecules/Tabs/Tabs.js +123 -1
  172. package/molecules/Tabs/index.cjs +20 -0
  173. package/molecules/Tabs/index.d.ts +1 -0
  174. package/molecules/Tabs/index.js +1 -0
  175. package/molecules/index.cjs +7 -24
  176. package/molecules/index.d.ts +9 -10
  177. package/molecules/index.js +9 -1
  178. package/organisms/Frame/Frame.cjs +20 -43
  179. package/organisms/Frame/Frame.d.ts +21 -98
  180. package/organisms/Frame/Frame.js +161 -1
  181. package/organisms/Frame/FrameAnchor.cjs +2 -2
  182. package/organisms/Frame/FrameAnchor.d.ts +7 -16
  183. package/organisms/Frame/FrameAnchor.js +18 -1
  184. package/organisms/Frame/FrameForm.cjs +2 -2
  185. package/organisms/Frame/FrameForm.d.ts +10 -16
  186. package/organisms/Frame/FrameForm.js +18 -1
  187. package/organisms/Frame/FrameTarget.cjs +15 -7
  188. package/organisms/Frame/FrameTarget.d.ts +17 -26
  189. package/organisms/Frame/FrameTarget.js +79 -1
  190. package/organisms/Frame/index.cjs +6 -18
  191. package/organisms/Frame/index.d.ts +4 -4
  192. package/organisms/Frame/index.js +4 -1
  193. package/organisms/index.cjs +1 -1
  194. package/organisms/index.d.ts +1 -1
  195. package/organisms/index.js +1 -1
  196. package/package.json +2 -2
  197. package/primitives/Draggable/Draggable.cjs +9 -6
  198. package/primitives/Draggable/Draggable.d.ts +10 -11
  199. package/primitives/Draggable/Draggable.js +33 -1
  200. package/primitives/Draggable/index.cjs +20 -0
  201. package/primitives/Draggable/index.d.ts +1 -0
  202. package/primitives/Draggable/index.js +1 -0
  203. package/primitives/Sentinel/Sentinel.cjs +2 -2
  204. package/primitives/Sentinel/Sentinel.d.ts +6 -5
  205. package/primitives/Sentinel/Sentinel.js +15 -1
  206. package/primitives/Sentinel/index.cjs +20 -0
  207. package/primitives/Sentinel/index.d.ts +1 -0
  208. package/primitives/Sentinel/index.js +1 -0
  209. package/primitives/Transition/Transition.cjs +12 -3
  210. package/primitives/Transition/Transition.d.ts +13 -7
  211. package/primitives/Transition/Transition.js +16 -1
  212. package/primitives/Transition/index.cjs +20 -0
  213. package/primitives/Transition/index.d.ts +1 -0
  214. package/primitives/Transition/index.js +1 -0
  215. package/primitives/index.cjs +5 -16
  216. package/primitives/index.d.ts +3 -3
  217. package/primitives/index.js +3 -1
@@ -1,8 +1,6 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
5
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
6
  var __export = (target, all) => {
@@ -17,34 +15,27 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
21
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
19
  var __publicField = (obj, key, value) => {
23
20
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
24
21
  return value;
25
22
  };
26
23
 
27
- // packages/ui/atoms/ScrollAnimation/ScrollAnimation.js
24
+ // packages/ui/atoms/ScrollAnimation/ScrollAnimation.ts
28
25
  var ScrollAnimation_exports = {};
29
26
  __export(ScrollAnimation_exports, {
30
- default: () => ScrollAnimation
27
+ ScrollAnimation: () => ScrollAnimation
31
28
  });
32
29
  module.exports = __toCommonJS(ScrollAnimation_exports);
33
30
  var import_js_toolkit = require("@studiometa/js-toolkit");
34
- var import_AbstractScrollAnimation = __toESM(require("./AbstractScrollAnimation.cjs"), 1);
35
- var ScrollAnimation = class extends (0, import_js_toolkit.withScrolledInView)(import_AbstractScrollAnimation.default, {}) {
31
+ var import_AbstractScrollAnimation = require("./AbstractScrollAnimation.cjs");
32
+ var ScrollAnimation = class extends (0, import_js_toolkit.withScrolledInView)(import_AbstractScrollAnimation.AbstractScrollAnimation, {}) {
36
33
  get target() {
37
34
  return this.$refs.target;
38
35
  }
39
- get dampFactor() {
40
- return this.$options.dampFactor;
41
- }
42
- get dampPrecision() {
43
- return this.$options.dampPrecision;
44
- }
45
36
  };
46
37
  __publicField(ScrollAnimation, "config", {
47
- ...import_AbstractScrollAnimation.default.config,
38
+ ...import_AbstractScrollAnimation.AbstractScrollAnimation.config,
48
39
  name: "ScrollAnimation",
49
40
  refs: ["target"]
50
41
  });
@@ -1,60 +1,22 @@
1
- /**
2
- * @typedef {ScrollAnimation & { $refs: { target: HTMLElement }}} ScrollAnimationInterface
3
- */
1
+ import type { BaseConfig, BaseProps } from '@studiometa/js-toolkit';
2
+ import { AbstractScrollAnimation } from './AbstractScrollAnimation.js';
3
+ export interface ScrollAnimationProps extends BaseProps {
4
+ $refs: {
5
+ target: HTMLElement;
6
+ };
7
+ }
8
+ declare const ScrollAnimation_base: import("@studiometa/js-toolkit").BaseDecorator<import("@studiometa/js-toolkit").WithScrolledInViewInterface, AbstractScrollAnimation<BaseProps>, import("@studiometa/js-toolkit").WithScrolledInViewProps>;
4
9
  /**
5
10
  * ScrollAnimation class.
6
11
  */
7
- export default class ScrollAnimation extends AbstractScrollAnimation {
12
+ export declare class ScrollAnimation<T extends BaseProps = BaseProps> extends ScrollAnimation_base<T & ScrollAnimationProps> {
8
13
  /**
9
14
  * Config.
10
15
  */
11
- static config: {
12
- name: string;
13
- refs: string[];
14
- options: {
15
- playRange: {
16
- type: ArrayConstructor;
17
- default: () => number[];
18
- };
19
- dampFactor: {
20
- type: NumberConstructor;
21
- default: number;
22
- };
23
- dampPrecision: {
24
- type: NumberConstructor;
25
- default: number;
26
- };
27
- from: {
28
- type: ObjectConstructor;
29
- default: () => {};
30
- };
31
- to: {
32
- type: ObjectConstructor;
33
- default: () => {};
34
- };
35
- keyframes: {
36
- type: ArrayConstructor;
37
- };
38
- easing: {
39
- type: ArrayConstructor;
40
- default: () => number[];
41
- };
42
- };
43
- };
44
- /**
45
- * Get the damp factor from the freezed options.
46
- * @returns {number}
47
- */
48
- get dampFactor(): number;
16
+ static config: BaseConfig;
49
17
  /**
50
- * Get the damp precision from the freezed options.
51
- * @returns {number}
18
+ * Use the `target` ref as animation target.
52
19
  */
53
- get dampPrecision(): number;
20
+ get target(): HTMLElement;
54
21
  }
55
- export type ScrollAnimationInterface = ScrollAnimation & {
56
- $refs: {
57
- target: HTMLElement;
58
- };
59
- };
60
- import AbstractScrollAnimation from "./AbstractScrollAnimation.js";
22
+ export {};
@@ -1 +1,21 @@
1
- import{withScrolledInView as r}from"@studiometa/js-toolkit";import t from"./AbstractScrollAnimation.js";class i extends r(t,{}){static config={...t.config,name:"ScrollAnimation",refs:["target"]};get target(){return this.$refs.target}get dampFactor(){return this.$options.dampFactor}get dampPrecision(){return this.$options.dampPrecision}}export{i as default};
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => {
4
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ return value;
6
+ };
7
+ import { withScrolledInView } from "@studiometa/js-toolkit";
8
+ import { AbstractScrollAnimation } from "./AbstractScrollAnimation.js";
9
+ class ScrollAnimation extends withScrolledInView(AbstractScrollAnimation, {}) {
10
+ get target() {
11
+ return this.$refs.target;
12
+ }
13
+ }
14
+ __publicField(ScrollAnimation, "config", {
15
+ ...AbstractScrollAnimation.config,
16
+ name: "ScrollAnimation",
17
+ refs: ["target"]
18
+ });
19
+ export {
20
+ ScrollAnimation
21
+ };
@@ -1,8 +1,6 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
5
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
6
  var __export = (target, all) => {
@@ -17,35 +15,60 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
21
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
19
  var __publicField = (obj, key, value) => {
23
20
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
24
21
  return value;
25
22
  };
26
23
 
27
- // packages/ui/atoms/ScrollAnimation/ScrollAnimationChild.js
24
+ // packages/ui/atoms/ScrollAnimation/ScrollAnimationChild.ts
28
25
  var ScrollAnimationChild_exports = {};
29
26
  __export(ScrollAnimationChild_exports, {
30
- default: () => ScrollAnimationChild
27
+ ScrollAnimationChild: () => ScrollAnimationChild
31
28
  });
32
29
  module.exports = __toCommonJS(ScrollAnimationChild_exports);
33
30
  var import_utils = require("@studiometa/js-toolkit/utils");
34
- var import_AbstractScrollAnimation = __toESM(require("./AbstractScrollAnimation.cjs"), 1);
35
- var ScrollAnimationChild = class extends import_AbstractScrollAnimation.default {
36
- dampedProgress = {
37
- x: 0,
38
- y: 0
39
- };
31
+ var import_AbstractScrollAnimation = require("./AbstractScrollAnimation.cjs");
32
+ function updateProps(that, props, dampFactor, dampPrecision, axis = "x") {
33
+ that.dampedCurrent[axis] = (0, import_utils.damp)(props.current[axis], that.dampedCurrent[axis], dampFactor, dampPrecision);
34
+ that.dampedProgress[axis] = (0, import_utils.clamp01)(
35
+ (that.dampedCurrent[axis] - props.start[axis]) / (props.end[axis] - props.start[axis])
36
+ );
37
+ }
38
+ var ScrollAnimationChild = class extends import_AbstractScrollAnimation.AbstractScrollAnimation {
39
+ constructor() {
40
+ super(...arguments);
41
+ __publicField(this, "dampedCurrent", {
42
+ x: 0,
43
+ y: 0
44
+ });
45
+ __publicField(this, "dampedProgress", {
46
+ x: 0,
47
+ y: 0
48
+ });
49
+ }
40
50
  scrolledInView(props) {
41
- this.dampedProgress.y = (0, import_utils.damp)(props.progress.y, this.dampedProgress.y, this.$options.dampFactor, this.$options.dampPrecision);
42
- this.dampedProgress.x = (0, import_utils.damp)(props.progress.x, this.dampedProgress.x, this.$options.dampFactor, this.$options.dampPrecision);
51
+ const { dampFactor, dampPrecision } = this.$options;
52
+ updateProps(this, props, dampFactor, dampPrecision, "x");
53
+ updateProps(this, props, dampFactor, dampPrecision, "y");
54
+ props.dampedCurrent = this.dampedCurrent;
43
55
  props.dampedProgress = this.dampedProgress;
44
56
  super.scrolledInView(props);
45
57
  }
46
58
  };
47
59
  __publicField(ScrollAnimationChild, "config", {
48
60
  name: "ScrollAnimationChild",
49
- ...import_AbstractScrollAnimation.default.config
61
+ ...import_AbstractScrollAnimation.AbstractScrollAnimation.config,
62
+ options: {
63
+ ...import_AbstractScrollAnimation.AbstractScrollAnimation.config.options,
64
+ dampFactor: {
65
+ type: Number,
66
+ default: 0.1
67
+ },
68
+ dampPrecision: {
69
+ type: Number,
70
+ default: 1e-3
71
+ }
72
+ }
50
73
  });
51
74
  if (module.exports.default) module.exports = module.exports.default;
@@ -1,13 +1,26 @@
1
+ import type { BaseConfig, BaseProps, ScrollInViewProps, WithScrolledInViewProps } from '@studiometa/js-toolkit';
2
+ import { AbstractScrollAnimation } from './AbstractScrollAnimation.js';
3
+ export interface ScrollAnimationChildProps extends BaseProps {
4
+ $options: WithScrolledInViewProps['$options'];
5
+ }
1
6
  /**
2
7
  * ScrollAnimationChild class.
3
8
  */
4
- export default class ScrollAnimationChild extends AbstractScrollAnimation {
9
+ export declare class ScrollAnimationChild<T extends BaseProps = BaseProps> extends AbstractScrollAnimation<T & ScrollAnimationChildProps> {
10
+ /**
11
+ * Config.
12
+ */
13
+ static config: BaseConfig;
14
+ /**
15
+ * Local damped current values.
16
+ */
17
+ dampedCurrent: ScrollInViewProps['dampedCurrent'];
5
18
  /**
6
19
  * Local damped progress.
7
20
  */
8
- dampedProgress: {
9
- x: number;
10
- y: number;
11
- };
21
+ dampedProgress: ScrollInViewProps['dampedCurrent'];
22
+ /**
23
+ * Compute local damped progress.
24
+ */
25
+ scrolledInView(props: ScrollInViewProps): void;
12
26
  }
13
- import AbstractScrollAnimation from "./AbstractScrollAnimation.js";
@@ -1 +1,53 @@
1
- import{damp as o}from"@studiometa/js-toolkit/utils";import i from"./AbstractScrollAnimation.js";class r extends i{static config={name:"ScrollAnimationChild",...i.config};dampedProgress={x:0,y:0};scrolledInView(s){this.dampedProgress.y=o(s.progress.y,this.dampedProgress.y,this.$options.dampFactor,this.$options.dampPrecision),this.dampedProgress.x=o(s.progress.x,this.dampedProgress.x,this.$options.dampFactor,this.$options.dampPrecision),s.dampedProgress=this.dampedProgress,super.scrolledInView(s)}}export{r as default};
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => {
4
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ return value;
6
+ };
7
+ import { damp, clamp01 } from "@studiometa/js-toolkit/utils";
8
+ import { AbstractScrollAnimation } from "./AbstractScrollAnimation.js";
9
+ function updateProps(that, props, dampFactor, dampPrecision, axis = "x") {
10
+ that.dampedCurrent[axis] = damp(props.current[axis], that.dampedCurrent[axis], dampFactor, dampPrecision);
11
+ that.dampedProgress[axis] = clamp01(
12
+ (that.dampedCurrent[axis] - props.start[axis]) / (props.end[axis] - props.start[axis])
13
+ );
14
+ }
15
+ class ScrollAnimationChild extends AbstractScrollAnimation {
16
+ constructor() {
17
+ super(...arguments);
18
+ __publicField(this, "dampedCurrent", {
19
+ x: 0,
20
+ y: 0
21
+ });
22
+ __publicField(this, "dampedProgress", {
23
+ x: 0,
24
+ y: 0
25
+ });
26
+ }
27
+ scrolledInView(props) {
28
+ const { dampFactor, dampPrecision } = this.$options;
29
+ updateProps(this, props, dampFactor, dampPrecision, "x");
30
+ updateProps(this, props, dampFactor, dampPrecision, "y");
31
+ props.dampedCurrent = this.dampedCurrent;
32
+ props.dampedProgress = this.dampedProgress;
33
+ super.scrolledInView(props);
34
+ }
35
+ }
36
+ __publicField(ScrollAnimationChild, "config", {
37
+ name: "ScrollAnimationChild",
38
+ ...AbstractScrollAnimation.config,
39
+ options: {
40
+ ...AbstractScrollAnimation.config.options,
41
+ dampFactor: {
42
+ type: Number,
43
+ default: 0.1
44
+ },
45
+ dampPrecision: {
46
+ type: Number,
47
+ default: 1e-3
48
+ }
49
+ }
50
+ });
51
+ export {
52
+ ScrollAnimationChild
53
+ };
@@ -1,8 +1,6 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
5
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
6
  var __export = (target, all) => {
@@ -17,25 +15,24 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
21
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
19
  var __publicField = (obj, key, value) => {
23
20
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
24
21
  return value;
25
22
  };
26
23
 
27
- // packages/ui/atoms/ScrollAnimation/ScrollAnimationChildWithEase.js
24
+ // packages/ui/atoms/ScrollAnimation/ScrollAnimationChildWithEase.ts
28
25
  var ScrollAnimationChildWithEase_exports = {};
29
26
  __export(ScrollAnimationChildWithEase_exports, {
30
- default: () => ScrollAnimationChildWithEase
27
+ ScrollAnimationChildWithEase: () => ScrollAnimationChildWithEase
31
28
  });
32
29
  module.exports = __toCommonJS(ScrollAnimationChildWithEase_exports);
33
- var import_ScrollAnimationChild = __toESM(require("./ScrollAnimationChild.cjs"), 1);
34
- var import_animationScrollWithEase = __toESM(require("./animationScrollWithEase.cjs"), 1);
35
- var ScrollAnimationChildWithEase = class extends (0, import_animationScrollWithEase.default)(import_ScrollAnimationChild.default) {
30
+ var import_ScrollAnimationChild = require("./ScrollAnimationChild.cjs");
31
+ var import_animationScrollWithEase = require("./animationScrollWithEase.cjs");
32
+ var ScrollAnimationChildWithEase = class extends (0, import_animationScrollWithEase.animationScrollWithEase)(import_ScrollAnimationChild.ScrollAnimationChild) {
36
33
  };
37
34
  __publicField(ScrollAnimationChildWithEase, "config", {
38
- ...import_ScrollAnimationChild.default.config,
35
+ ...import_ScrollAnimationChild.ScrollAnimationChild.config,
39
36
  name: "ScrollAnimationChildWithEase"
40
37
  });
41
38
  if (module.exports.default) module.exports = module.exports.default;
@@ -1,6 +1,12 @@
1
+ import type { BaseConfig } from '@studiometa/js-toolkit';
2
+ declare const ScrollAnimationChildWithEase_base: import("@studiometa/js-toolkit").BaseDecorator<import("./animationScrollWithEase.js").AnimationScrollWithEaseInterface, import("./AbstractScrollAnimation.js").AbstractScrollAnimation<import("@studiometa/js-toolkit").BaseProps>, import("./animationScrollWithEase.js").AnimationScrollWithEaseProps>;
1
3
  /**
2
4
  * ScrollAnimationChild class.
3
5
  */
4
- export default class ScrollAnimationChildWithEase extends ScrollAnimationChild {
6
+ export declare class ScrollAnimationChildWithEase extends ScrollAnimationChildWithEase_base {
7
+ /**
8
+ * Config.
9
+ */
10
+ static config: BaseConfig;
5
11
  }
6
- import ScrollAnimationChild from "./ScrollAnimationChild.js";
12
+ export {};
@@ -1 +1,17 @@
1
- import i from"./ScrollAnimationChild.js";import o from"./animationScrollWithEase.js";class t extends o(i){static config={...i.config,name:"ScrollAnimationChildWithEase"}}export{t as default};
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => {
4
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ return value;
6
+ };
7
+ import { ScrollAnimationChild } from "./ScrollAnimationChild.js";
8
+ import { animationScrollWithEase } from "./animationScrollWithEase.js";
9
+ class ScrollAnimationChildWithEase extends animationScrollWithEase(ScrollAnimationChild) {
10
+ }
11
+ __publicField(ScrollAnimationChildWithEase, "config", {
12
+ ...ScrollAnimationChild.config,
13
+ name: "ScrollAnimationChildWithEase"
14
+ });
15
+ export {
16
+ ScrollAnimationChildWithEase
17
+ };
@@ -1,8 +1,6 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
5
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
6
  var __export = (target, all) => {
@@ -17,22 +15,24 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
21
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
19
  var __publicField = (obj, key, value) => {
23
20
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
24
21
  return value;
25
22
  };
26
23
 
27
- // packages/ui/atoms/ScrollAnimation/ScrollAnimationParent.js
24
+ // packages/ui/atoms/ScrollAnimation/ScrollAnimationParent.ts
28
25
  var ScrollAnimationParent_exports = {};
29
26
  __export(ScrollAnimationParent_exports, {
30
- default: () => ScrollAnimationParent
27
+ ScrollAnimationParent: () => ScrollAnimationParent
31
28
  });
32
29
  module.exports = __toCommonJS(ScrollAnimationParent_exports);
33
30
  var import_js_toolkit = require("@studiometa/js-toolkit");
34
- var import_ScrollAnimationChild = __toESM(require("./ScrollAnimationChild.cjs"), 1);
35
- var ScrollAnimationParent = class extends (0, import_js_toolkit.withScrolledInView)(import_js_toolkit.Base, {}) {
31
+ var import_ScrollAnimationChild = require("./ScrollAnimationChild.cjs");
32
+ var ScrollAnimationParent = class extends (0, import_js_toolkit.withScrolledInView)(
33
+ import_js_toolkit.Base,
34
+ {}
35
+ ) {
36
36
  scrolledInView(props) {
37
37
  this.$children.ScrollAnimationChild.forEach((child) => {
38
38
  child.scrolledInView(props);
@@ -42,7 +42,7 @@ var ScrollAnimationParent = class extends (0, import_js_toolkit.withScrolledInVi
42
42
  __publicField(ScrollAnimationParent, "config", {
43
43
  name: "ScrollAnimationParent",
44
44
  components: {
45
- ScrollAnimationChild: import_ScrollAnimationChild.default
45
+ ScrollAnimationChild: import_ScrollAnimationChild.ScrollAnimationChild
46
46
  }
47
47
  });
48
48
  if (module.exports.default) module.exports = module.exports.default;
@@ -1,35 +1,23 @@
1
- /**
2
- * @typedef {ScrollAnimationParent & {
3
- * $children: {
4
- * ScrollAnimationChild: ScrollAnimationChild[],
5
- * },
6
- * }} ScrollAnimationInterface
7
- */
1
+ import { Base, ScrollInViewProps } from '@studiometa/js-toolkit';
2
+ import type { BaseConfig, BaseProps } from '@studiometa/js-toolkit';
3
+ import { ScrollAnimationChild } from './ScrollAnimationChild.js';
4
+ export interface ScrollAnimationParentProps extends BaseProps {
5
+ $children: {
6
+ ScrollAnimationChild: ScrollAnimationChild[];
7
+ };
8
+ }
9
+ declare const ScrollAnimationParent_base: import("@studiometa/js-toolkit").BaseDecorator<import("@studiometa/js-toolkit").WithScrolledInViewInterface, Base<BaseProps>, import("@studiometa/js-toolkit").WithScrolledInViewProps>;
8
10
  /**
9
11
  * ScrollAnimationParent class.
10
12
  */
11
- export default class ScrollAnimationParent extends Base {
13
+ export declare class ScrollAnimationParent<T extends BaseProps = BaseProps> extends ScrollAnimationParent_base<T & ScrollAnimationParentProps> {
12
14
  /**
13
15
  * Config.
14
16
  */
15
- static config: {
16
- name: string;
17
- components: {
18
- ScrollAnimationChild: typeof ScrollAnimationChild;
19
- };
20
- };
17
+ static config: BaseConfig;
21
18
  /**
22
- * @todo Optimize default value read
23
- * @todo do not add unnecessary styles
24
- * @todo freeze options for better perf
25
- * @this {ScrollAnimationInterface}
19
+ * Scrolled in view hook.
26
20
  */
27
- scrolledInView(this: ScrollAnimationInterface, props: any): void;
21
+ scrolledInView(props: ScrollInViewProps): void;
28
22
  }
29
- export type ScrollAnimationInterface = ScrollAnimationParent & {
30
- $children: {
31
- ScrollAnimationChild: ScrollAnimationChild[];
32
- };
33
- };
34
- import { Base } from "@studiometa/js-toolkit";
35
- import ScrollAnimationChild from "./ScrollAnimationChild.js";
23
+ export {};
@@ -1 +1,27 @@
1
- import{Base as l,withScrolledInView as n}from"@studiometa/js-toolkit";import e from"./ScrollAnimationChild.js";class r extends n(l,{}){static config={name:"ScrollAnimationParent",components:{ScrollAnimationChild:e}};scrolledInView(i){this.$children.ScrollAnimationChild.forEach(o=>{o.scrolledInView(i)})}}export{r as default};
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => {
4
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ return value;
6
+ };
7
+ import { Base, withScrolledInView } from "@studiometa/js-toolkit";
8
+ import { ScrollAnimationChild } from "./ScrollAnimationChild.js";
9
+ class ScrollAnimationParent extends withScrolledInView(
10
+ Base,
11
+ {}
12
+ ) {
13
+ scrolledInView(props) {
14
+ this.$children.ScrollAnimationChild.forEach((child) => {
15
+ child.scrolledInView(props);
16
+ });
17
+ }
18
+ }
19
+ __publicField(ScrollAnimationParent, "config", {
20
+ name: "ScrollAnimationParent",
21
+ components: {
22
+ ScrollAnimationChild
23
+ }
24
+ });
25
+ export {
26
+ ScrollAnimationParent
27
+ };
@@ -1,8 +1,6 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
5
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
6
  var __export = (target, all) => {
@@ -17,25 +15,24 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
21
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
19
  var __publicField = (obj, key, value) => {
23
20
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
24
21
  return value;
25
22
  };
26
23
 
27
- // packages/ui/atoms/ScrollAnimation/ScrollAnimationWithEase.js
24
+ // packages/ui/atoms/ScrollAnimation/ScrollAnimationWithEase.ts
28
25
  var ScrollAnimationWithEase_exports = {};
29
26
  __export(ScrollAnimationWithEase_exports, {
30
- default: () => ScrollAnimationWithEase
27
+ ScrollAnimationWithEase: () => ScrollAnimationWithEase
31
28
  });
32
29
  module.exports = __toCommonJS(ScrollAnimationWithEase_exports);
33
- var import_ScrollAnimation = __toESM(require("./ScrollAnimation.cjs"), 1);
34
- var import_animationScrollWithEase = __toESM(require("./animationScrollWithEase.cjs"), 1);
35
- var ScrollAnimationWithEase = class extends (0, import_animationScrollWithEase.default)(import_ScrollAnimation.default) {
30
+ var import_ScrollAnimation = require("./ScrollAnimation.cjs");
31
+ var import_animationScrollWithEase = require("./animationScrollWithEase.cjs");
32
+ var ScrollAnimationWithEase = class extends (0, import_animationScrollWithEase.animationScrollWithEase)(import_ScrollAnimation.ScrollAnimation) {
36
33
  };
37
34
  __publicField(ScrollAnimationWithEase, "config", {
38
- ...import_ScrollAnimation.default.config,
35
+ ...import_ScrollAnimation.ScrollAnimation.config,
39
36
  name: "ScrollAnimationWithEase"
40
37
  });
41
38
  if (module.exports.default) module.exports = module.exports.default;
@@ -1,6 +1,19 @@
1
+ declare const ScrollAnimationWithEase_base: import("@studiometa/js-toolkit").BaseDecorator<import("./animationScrollWithEase.js").AnimationScrollWithEaseInterface, import("./AbstractScrollAnimation.js").AbstractScrollAnimation<import("@studiometa/js-toolkit").BaseProps>, import("./animationScrollWithEase.js").AnimationScrollWithEaseProps>;
1
2
  /**
2
3
  * ScrollAnimation class.
3
4
  */
4
- export default class ScrollAnimationWithEase extends ScrollAnimation {
5
+ export declare class ScrollAnimationWithEase extends ScrollAnimationWithEase_base {
6
+ /**
7
+ * Config.
8
+ */
9
+ static config: {
10
+ name: string;
11
+ debug?: boolean;
12
+ log?: boolean;
13
+ refs?: string[];
14
+ emits?: string[];
15
+ components?: import("@studiometa/js-toolkit/Base/index.js").BaseConfigComponents;
16
+ options?: import("@studiometa/js-toolkit/Base/managers/OptionsManager.js").OptionsSchema;
17
+ };
5
18
  }
6
- import ScrollAnimation from "./ScrollAnimation.js";
19
+ export {};
@@ -1 +1,17 @@
1
- import i from"./ScrollAnimation.js";import o from"./animationScrollWithEase.js";class t extends o(i){static config={...i.config,name:"ScrollAnimationWithEase"}}export{t as default};
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => {
4
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ return value;
6
+ };
7
+ import { ScrollAnimation } from "./ScrollAnimation.js";
8
+ import { animationScrollWithEase } from "./animationScrollWithEase.js";
9
+ class ScrollAnimationWithEase extends animationScrollWithEase(ScrollAnimation) {
10
+ }
11
+ __publicField(ScrollAnimationWithEase, "config", {
12
+ ...ScrollAnimation.config,
13
+ name: "ScrollAnimationWithEase"
14
+ });
15
+ export {
16
+ ScrollAnimationWithEase
17
+ };