@studiometa/ui 0.2.13 → 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 +45 -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,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/Figure/FigureTwicPics.js
24
+ // packages/ui/atoms/Figure/FigureTwicPics.ts
28
25
  var FigureTwicPics_exports = {};
29
26
  __export(FigureTwicPics_exports, {
30
- default: () => FigureTwicPics
27
+ FigureTwicPics: () => FigureTwicPics
31
28
  });
32
29
  module.exports = __toCommonJS(FigureTwicPics_exports);
33
- var import_Figure = __toESM(require("./Figure.cjs"), 1);
30
+ var import_Figure = require("./Figure.cjs");
34
31
  function normalizeSize(that, prop) {
35
32
  const { step } = that.$options;
36
33
  return Math.ceil(that.$refs.img[prop] / step) * step;
37
34
  }
38
- var FigureTwicPics = class extends import_Figure.default {
35
+ var FigureTwicPics = class extends import_Figure.Figure {
39
36
  get domain() {
40
37
  const url = new URL(this.$refs.img.dataset.src);
41
38
  return url.host;
@@ -45,7 +42,10 @@ var FigureTwicPics = class extends import_Figure.default {
45
42
  url.host = this.domain;
46
43
  const width = normalizeSize(this, "offsetWidth");
47
44
  const height = normalizeSize(this, "offsetHeight");
48
- url.searchParams.set("twic", ["v1", this.$options.transform, `${this.$options.mode}=${width}x${height}`].filter(Boolean).join("/"));
45
+ url.searchParams.set(
46
+ "twic",
47
+ ["v1", this.$options.transform, `${this.$options.mode}=${width}x${height}`].filter(Boolean).join("/")
48
+ );
49
49
  url.search = decodeURIComponent(url.search);
50
50
  super.src = url.toString();
51
51
  }
@@ -54,10 +54,10 @@ var FigureTwicPics = class extends import_Figure.default {
54
54
  }
55
55
  };
56
56
  __publicField(FigureTwicPics, "config", {
57
- ...import_Figure.default.config,
57
+ ...import_Figure.Figure.config,
58
58
  name: "FigureTwicPics",
59
59
  options: {
60
- ...import_Figure.default.config.options,
60
+ ...import_Figure.Figure.config.options,
61
61
  transform: String,
62
62
  step: {
63
63
  type: Number,
@@ -1,53 +1,32 @@
1
+ import type { BaseConfig, BaseProps } from '@studiometa/js-toolkit';
2
+ import { Figure } from './Figure.js';
3
+ export interface FigureTwicPicsProps extends BaseProps {
4
+ $options: {
5
+ transform: string;
6
+ step: number;
7
+ mode: string;
8
+ };
9
+ }
1
10
  /**
2
11
  * Figure class.
3
12
  *
4
13
  * Manager lazyloading image sources.
5
14
  */
6
- export default class FigureTwicPics extends Figure {
15
+ export declare class FigureTwicPics<T extends BaseProps = BaseProps> extends Figure<T & FigureTwicPicsProps> {
7
16
  /**
8
17
  * Config.
9
18
  */
10
- static config: {
11
- name: string;
12
- options: {
13
- transform: StringConstructor;
14
- step: {
15
- type: NumberConstructor;
16
- default: number;
17
- };
18
- mode: {
19
- type: StringConstructor;
20
- default: string;
21
- };
22
- lazy: BooleanConstructor;
23
- };
24
- refs: string[];
25
- debug?: boolean;
26
- log?: boolean;
27
- emits?: string[];
28
- components?: import("@studiometa/js-toolkit/Base/index.js").BaseConfigComponents;
29
- };
19
+ static config: BaseConfig;
30
20
  /**
31
21
  * Get the TwicPics domain.
32
- *
33
- * @this {FigureTwicPicsInterface}
34
- * @returns {string}
35
22
  */
36
23
  get domain(): string;
24
+ /**
25
+ * Add TwicPics transforms and domain to the URL.
26
+ */
27
+ set src(value: string);
37
28
  /**
38
29
  * Reassign the source from the original on resized.
39
- *
40
- * @this {FigureTwicPicsInterface}
41
- * @returns {void}
42
30
  */
43
- resized(this: FigureTwicPicsInterface): void;
31
+ resized(): void;
44
32
  }
45
- export type FigureInterface = import('./Figure.js').FigureInterface;
46
- export type FigureTwicPicsInterface = FigureTwicPics & FigureInterface & {
47
- $options: {
48
- transform: string;
49
- step: number;
50
- mode: string;
51
- };
52
- };
53
- import Figure from "./Figure.js";
@@ -1 +1,51 @@
1
- import e from"./Figure.js";function o(i,s){const{step:t}=i.$options;return Math.ceil(i.$refs.img[s]/t)*t}class c extends e{static config={...e.config,name:"FigureTwicPics",options:{...e.config.options,transform:String,step:{type:Number,default:50},mode:{type:String,default:"cover"}}};get domain(){return new URL(this.$refs.img.dataset.src).host}set src(s){const t=new URL(s,window.location.origin);t.host=this.domain;const r=o(this,"offsetWidth"),n=o(this,"offsetHeight");t.searchParams.set("twic",["v1",this.$options.transform,`${this.$options.mode}=${r}x${n}`].filter(Boolean).join("/")),t.search=decodeURIComponent(t.search),super.src=t.toString()}resized(){this.src=this.$refs.img.dataset.src}}export{c 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 { Figure } from "./Figure.js";
8
+ function normalizeSize(that, prop) {
9
+ const { step } = that.$options;
10
+ return Math.ceil(that.$refs.img[prop] / step) * step;
11
+ }
12
+ class FigureTwicPics extends Figure {
13
+ get domain() {
14
+ const url = new URL(this.$refs.img.dataset.src);
15
+ return url.host;
16
+ }
17
+ set src(value) {
18
+ const url = new URL(value, window.location.origin);
19
+ url.host = this.domain;
20
+ const width = normalizeSize(this, "offsetWidth");
21
+ const height = normalizeSize(this, "offsetHeight");
22
+ url.searchParams.set(
23
+ "twic",
24
+ ["v1", this.$options.transform, `${this.$options.mode}=${width}x${height}`].filter(Boolean).join("/")
25
+ );
26
+ url.search = decodeURIComponent(url.search);
27
+ super.src = url.toString();
28
+ }
29
+ resized() {
30
+ this.src = this.$refs.img.dataset.src;
31
+ }
32
+ }
33
+ __publicField(FigureTwicPics, "config", {
34
+ ...Figure.config,
35
+ name: "FigureTwicPics",
36
+ options: {
37
+ ...Figure.config.options,
38
+ transform: String,
39
+ step: {
40
+ type: Number,
41
+ default: 50
42
+ },
43
+ mode: {
44
+ type: String,
45
+ default: "cover"
46
+ }
47
+ }
48
+ });
49
+ export {
50
+ FigureTwicPics
51
+ };
@@ -1,13 +1,7 @@
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
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
5
  var __copyProps = (to, from, except, desc) => {
12
6
  if (from && typeof from === "object" || typeof from === "function") {
13
7
  for (let key of __getOwnPropNames(from))
@@ -16,16 +10,12 @@ var __copyProps = (to, from, except, desc) => {
16
10
  }
17
11
  return to;
18
12
  };
19
- 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));
13
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
15
 
22
- // packages/ui/atoms/Figure/index.js
16
+ // packages/ui/atoms/Figure/index.ts
23
17
  var Figure_exports = {};
24
- __export(Figure_exports, {
25
- Figure: () => import_Figure.default,
26
- FigureTwicPics: () => import_FigureTwicPics.default
27
- });
28
18
  module.exports = __toCommonJS(Figure_exports);
29
- var import_Figure = __toESM(require("./Figure.cjs"), 1);
30
- var import_FigureTwicPics = __toESM(require("./FigureTwicPics.cjs"), 1);
19
+ __reExport(Figure_exports, require("./Figure.cjs"), module.exports);
20
+ __reExport(Figure_exports, require("./FigureTwicPics.cjs"), module.exports);
31
21
  if (module.exports.default) module.exports = module.exports.default;
@@ -1,2 +1,2 @@
1
- export { default as Figure } from "./Figure.js";
2
- export { default as FigureTwicPics } from "./FigureTwicPics.js";
1
+ export * from './Figure.js';
2
+ export * from './FigureTwicPics.js';
@@ -1 +1,2 @@
1
- import{default as a}from"./Figure.js";import{default as i}from"./FigureTwicPics.js";export{a as Figure,i as FigureTwicPics};
1
+ export * from "./Figure.js";
2
+ export * from "./FigureTwicPics.js";
@@ -21,22 +21,25 @@ var __publicField = (obj, key, value) => {
21
21
  return value;
22
22
  };
23
23
 
24
- // packages/ui/atoms/LargeText/LargeText.js
24
+ // packages/ui/atoms/LargeText/LargeText.ts
25
25
  var LargeText_exports = {};
26
26
  __export(LargeText_exports, {
27
- default: () => LargeText
27
+ LargeText: () => LargeText
28
28
  });
29
29
  module.exports = __toCommonJS(LargeText_exports);
30
30
  var import_js_toolkit = require("@studiometa/js-toolkit");
31
31
  var import_utils = require("@studiometa/js-toolkit/utils");
32
32
  var LargeText = class extends (0, import_js_toolkit.withMountWhenInView)(import_js_toolkit.Base, { rootMargin: "50%" }) {
33
- x = 0;
34
- deltaY = 0;
35
- transform = {
36
- skewX: 0,
37
- x: 0
38
- };
39
- width = 0;
33
+ constructor() {
34
+ super(...arguments);
35
+ __publicField(this, "x", 0);
36
+ __publicField(this, "deltaY", 0);
37
+ __publicField(this, "transform", {
38
+ skewX: 0,
39
+ x: 0
40
+ });
41
+ __publicField(this, "width", 0);
42
+ }
40
43
  mounted() {
41
44
  this.width = this.$refs.target.clientWidth;
42
45
  }
@@ -50,7 +53,11 @@ var LargeText = class extends (0, import_js_toolkit.withMountWhenInView)(import_
50
53
  this.x -= (Math.abs(this.deltaY) + 1) * this.$options.sensitivity;
51
54
  this.transform.x = (0, import_utils.damp)(this.x, this.transform.x, 0.25);
52
55
  if (this.$options.skew) {
53
- this.transform.skewX = (0, import_utils.damp)((0, import_utils.clamp)(this.deltaY * -1, -50, 50) * this.$options.skewSensitivity, this.transform.skewX, 0.25);
56
+ this.transform.skewX = (0, import_utils.damp)(
57
+ (0, import_utils.clamp)(this.deltaY * -1, -50, 50) * this.$options.skewSensitivity,
58
+ this.transform.skewX,
59
+ 0.25
60
+ );
54
61
  }
55
62
  if (this.x <= this.width * -1) {
56
63
  this.x = 0;
@@ -1,17 +1,20 @@
1
- /**
2
- * @typedef {LargeText & {
3
- * $refs: { target: HTMLElement },
4
- * $options: {
5
- * skew: boolean,
6
- * sensitivity: number,
7
- * skewSensitivity: number,
8
- * }
9
- * }} LargeTextInterface
10
- */
1
+ import { Base } from '@studiometa/js-toolkit';
2
+ import type { BaseProps, BaseInterface, ScrollServiceProps } from '@studiometa/js-toolkit';
3
+ export interface LargeTextProps extends BaseProps {
4
+ $refs: {
5
+ target: HTMLElement;
6
+ };
7
+ $options: {
8
+ skew: boolean;
9
+ sensitivity: number;
10
+ skewSensitivity: number;
11
+ };
12
+ }
13
+ declare const LargeText_base: import("@studiometa/js-toolkit").BaseDecorator<import("@studiometa/js-toolkit").WithMountWhenInViewInterface, Base<BaseProps>, import("@studiometa/js-toolkit").WithMountWhenInViewProps>;
11
14
  /**
12
15
  * Large text class.
13
16
  */
14
- export default class LargeText extends Base {
17
+ export declare class LargeText<T extends BaseProps = BaseProps> extends LargeText_base<T & LargeTextProps> implements BaseInterface {
15
18
  /**
16
19
  * Config.
17
20
  */
@@ -32,12 +35,10 @@ export default class LargeText extends Base {
32
35
  };
33
36
  /**
34
37
  * Translate X.
35
- * @type {number}
36
38
  */
37
39
  x: number;
38
40
  /**
39
41
  * Scroll delta Y.
40
- * @type {number}
41
42
  */
42
43
  deltaY: number;
43
44
  /**
@@ -49,45 +50,23 @@ export default class LargeText extends Base {
49
50
  };
50
51
  /**
51
52
  * Target width.
52
- * @type {number}
53
53
  */
54
54
  width: number;
55
55
  /**
56
56
  * Set width on mount.
57
- *
58
- * @this {LargeTextInterface}
59
- * @returns {void}
60
57
  */
61
- mounted(this: LargeTextInterface): void;
58
+ mounted(): void;
62
59
  /**
63
60
  * Set width on resize.
64
- *
65
- * @this {LargeTextInterface}
66
- * @returns {void}
67
61
  */
68
- resized(this: LargeTextInterface): void;
62
+ resized(): void;
69
63
  /**
70
64
  * Update delta scroll on scroll.
71
- *
72
- * @param {import('@studiometa/js-toolkit/services/scroll').ScrollServiceProps} props
73
- * @returns {void}
74
65
  */
75
- scrolled(props: import('@studiometa/js-toolkit/services/scroll').ScrollServiceProps): void;
66
+ scrolled(props: ScrollServiceProps): void;
76
67
  /**
77
68
  * Update values on raf.
78
- *
79
- * @this {LargeTextInterface}
80
69
  */
81
- ticked(this: LargeTextInterface): () => void;
70
+ ticked(): () => void;
82
71
  }
83
- export type LargeTextInterface = LargeText & {
84
- $refs: {
85
- target: HTMLElement;
86
- };
87
- $options: {
88
- skew: boolean;
89
- sensitivity: number;
90
- skewSensitivity: number;
91
- };
92
- };
93
- import { Base } from "@studiometa/js-toolkit";
72
+ export {};
@@ -1 +1,68 @@
1
- import{Base as s,withMountWhenInView as e}from"@studiometa/js-toolkit";import{damp as t,clamp as h,transform as r}from"@studiometa/js-toolkit/utils";class a extends e(s,{rootMargin:"50%"}){static config={name:"LargeText",refs:["target"],options:{skew:Boolean,sensitivity:{type:Number,default:1},skewSensitivity:{type:Number,default:1}}};x=0;deltaY=0;transform={skewX:0,x:0};width=0;mounted(){this.width=this.$refs.target.clientWidth}resized(){this.width=this.$refs.target.clientWidth}scrolled(i){this.deltaY=i.delta.y}ticked(){return this.x-=(Math.abs(this.deltaY)+1)*this.$options.sensitivity,this.transform.x=t(this.x,this.transform.x,.25),this.$options.skew&&(this.transform.skewX=t(h(this.deltaY*-1,-50,50)*this.$options.skewSensitivity,this.transform.skewX,.25)),this.x<=this.width*-1?(this.x=0,this.transform.x+=this.width):this.$options.sensitivity<0&&this.x>=this.width&&(this.x=0,this.transform.x-=this.width),()=>{r(this.$refs.target,this.transform)}}}export{a 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, withMountWhenInView } from "@studiometa/js-toolkit";
8
+ import { damp, clamp, transform } from "@studiometa/js-toolkit/utils";
9
+ class LargeText extends withMountWhenInView(Base, { rootMargin: "50%" }) {
10
+ constructor() {
11
+ super(...arguments);
12
+ __publicField(this, "x", 0);
13
+ __publicField(this, "deltaY", 0);
14
+ __publicField(this, "transform", {
15
+ skewX: 0,
16
+ x: 0
17
+ });
18
+ __publicField(this, "width", 0);
19
+ }
20
+ mounted() {
21
+ this.width = this.$refs.target.clientWidth;
22
+ }
23
+ resized() {
24
+ this.width = this.$refs.target.clientWidth;
25
+ }
26
+ scrolled(props) {
27
+ this.deltaY = props.delta.y;
28
+ }
29
+ ticked() {
30
+ this.x -= (Math.abs(this.deltaY) + 1) * this.$options.sensitivity;
31
+ this.transform.x = damp(this.x, this.transform.x, 0.25);
32
+ if (this.$options.skew) {
33
+ this.transform.skewX = damp(
34
+ clamp(this.deltaY * -1, -50, 50) * this.$options.skewSensitivity,
35
+ this.transform.skewX,
36
+ 0.25
37
+ );
38
+ }
39
+ if (this.x <= this.width * -1) {
40
+ this.x = 0;
41
+ this.transform.x += this.width;
42
+ } else if (this.$options.sensitivity < 0 && this.x >= this.width) {
43
+ this.x = 0;
44
+ this.transform.x -= this.width;
45
+ }
46
+ return () => {
47
+ transform(this.$refs.target, this.transform);
48
+ };
49
+ }
50
+ }
51
+ __publicField(LargeText, "config", {
52
+ name: "LargeText",
53
+ refs: ["target"],
54
+ options: {
55
+ skew: Boolean,
56
+ sensitivity: {
57
+ type: Number,
58
+ default: 1
59
+ },
60
+ skewSensitivity: {
61
+ type: Number,
62
+ default: 1
63
+ }
64
+ }
65
+ });
66
+ export {
67
+ LargeText
68
+ };
@@ -0,0 +1,20 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // packages/ui/atoms/LargeText/index.ts
17
+ var LargeText_exports = {};
18
+ module.exports = __toCommonJS(LargeText_exports);
19
+ __reExport(LargeText_exports, require("./LargeText.cjs"), module.exports);
20
+ if (module.exports.default) module.exports = module.exports.default;
@@ -0,0 +1 @@
1
+ export * from './LargeText.js';
@@ -0,0 +1 @@
1
+ export * from "./LargeText.js";
@@ -21,10 +21,10 @@ var __publicField = (obj, key, value) => {
21
21
  return value;
22
22
  };
23
23
 
24
- // packages/ui/atoms/LazyInclude/LazyInclude.js
24
+ // packages/ui/atoms/LazyInclude/LazyInclude.ts
25
25
  var LazyInclude_exports = {};
26
26
  __export(LazyInclude_exports, {
27
- default: () => LazyInclude
27
+ LazyInclude: () => LazyInclude
28
28
  });
29
29
  module.exports = __toCommonJS(LazyInclude_exports);
30
30
  var import_js_toolkit = require("@studiometa/js-toolkit");
@@ -1,12 +1,19 @@
1
- /**
2
- * @typedef {{ src: string, terminateOnLoad: boolean }} LazyIncludeOptions
3
- * @typedef {{ loading: HTMLElement, error: HTMLElement }} LazyIncludeRefs
4
- * @typedef {LazyInclude & { $refs: LazyIncludeRefs, $options: LazyIncludeOptions }} LazyIncludeInterface
5
- */
1
+ import { Base } from '@studiometa/js-toolkit';
2
+ import type { BaseProps, BaseInterface } from '@studiometa/js-toolkit';
3
+ export interface LazyIncludeProps extends BaseProps {
4
+ $refs: {
5
+ loading: HTMLElement;
6
+ error: HTMLElement;
7
+ };
8
+ $options: {
9
+ src: string;
10
+ terminateOnLoad: boolean;
11
+ };
12
+ }
6
13
  /**
7
14
  * LazyInclude class.
8
15
  */
9
- export default class LazyInclude extends Base {
16
+ export declare class LazyInclude<T extends BaseProps = BaseProps> extends Base<T & LazyIncludeProps> implements BaseInterface {
10
17
  /**
11
18
  * Config.
12
19
  */
@@ -21,44 +28,18 @@ export default class LazyInclude extends Base {
21
28
  };
22
29
  /**
23
30
  * Load the lazy content on mount.
24
- *
25
- * @this {LazyIncludeInterface}
26
- * @returns {void}
27
31
  */
28
- mounted(this: LazyIncludeInterface): void;
32
+ mounted(): void;
29
33
  /**
30
34
  * Set content.
31
- *
32
- * @this {LazyIncludeInterface}
33
- * @param {string} content
34
- * @returns {void}
35
35
  */
36
- onContent(this: LazyIncludeInterface, content: string): void;
36
+ onContent(content: string): void;
37
37
  /**
38
38
  * Set error.
39
- *
40
- * @this {LazyIncludeInterface}
41
- * @returns {void}
42
39
  */
43
- onError(this: LazyIncludeInterface): void;
40
+ onError(): void;
44
41
  /**
45
42
  * Always.
46
- *
47
- * @this {LazyIncludeInterface}
48
- * @returns {void}
49
43
  */
50
- onAlways(this: LazyIncludeInterface): void;
44
+ onAlways(): void;
51
45
  }
52
- export type LazyIncludeOptions = {
53
- src: string;
54
- terminateOnLoad: boolean;
55
- };
56
- export type LazyIncludeRefs = {
57
- loading: HTMLElement;
58
- error: HTMLElement;
59
- };
60
- export type LazyIncludeInterface = LazyInclude & {
61
- $refs: LazyIncludeRefs;
62
- $options: LazyIncludeOptions;
63
- };
64
- import { Base } from "@studiometa/js-toolkit";
@@ -1 +1,46 @@
1
- import{Base as e}from"@studiometa/js-toolkit";class i extends e{static config={name:"LazyInclude",refs:["loading","error"],emits:["content","error","always"],options:{src:String,terminateOnLoad:Boolean}};mounted(){if(!this.$options.src){this.$log("The `src` option is missing. Define it with the `data-option-src` attribute");return}fetch(this.$options.src).then(t=>t.text()).then(t=>{this.$emit("content",t)}).catch(t=>{this.$emit("error",t)}).finally(()=>{this.$emit("always")})}onContent(t){this.$refs.loading.style.display="none",this.$el.innerHTML=t}onError(){this.$refs.error.style.display="block"}onAlways(){this.$options.terminateOnLoad&&this.$terminate()}}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 { Base } from "@studiometa/js-toolkit";
8
+ class LazyInclude extends Base {
9
+ mounted() {
10
+ if (!this.$options.src) {
11
+ this.$log("The `src` option is missing. Define it with the `data-option-src` attribute");
12
+ return;
13
+ }
14
+ fetch(this.$options.src).then((response) => response.text()).then((content) => {
15
+ this.$emit("content", content);
16
+ }).catch((error) => {
17
+ this.$emit("error", error);
18
+ }).finally(() => {
19
+ this.$emit("always");
20
+ });
21
+ }
22
+ onContent(content) {
23
+ this.$refs.loading.style.display = "none";
24
+ this.$el.innerHTML = content;
25
+ }
26
+ onError() {
27
+ this.$refs.error.style.display = "block";
28
+ }
29
+ onAlways() {
30
+ if (this.$options.terminateOnLoad) {
31
+ this.$terminate();
32
+ }
33
+ }
34
+ }
35
+ __publicField(LazyInclude, "config", {
36
+ name: "LazyInclude",
37
+ refs: ["loading", "error"],
38
+ emits: ["content", "error", "always"],
39
+ options: {
40
+ src: String,
41
+ terminateOnLoad: Boolean
42
+ }
43
+ });
44
+ export {
45
+ LazyInclude
46
+ };
@@ -0,0 +1,20 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // packages/ui/atoms/LazyInclude/index.ts
17
+ var LazyInclude_exports = {};
18
+ module.exports = __toCommonJS(LazyInclude_exports);
19
+ __reExport(LazyInclude_exports, require("./LazyInclude.cjs"), module.exports);
20
+ if (module.exports.default) module.exports = module.exports.default;
@@ -0,0 +1 @@
1
+ export * from './LazyInclude.js';
@@ -0,0 +1 @@
1
+ export * from "./LazyInclude.js";