@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,24 +1,18 @@
1
- /**
2
- * @typedef {FrameForm & {
3
- * $el: HTMLFormElement
4
- * }} FrameFormInterface
5
- */
1
+ import { Base } from '@studiometa/js-toolkit';
2
+ import type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';
3
+ export interface FrameFormProps extends BaseProps {
4
+ $el: HTMLFormElement;
5
+ }
6
6
  /**
7
7
  * FrameForm class.
8
8
  */
9
- export default class FrameForm extends Base {
10
- static config: {
11
- name: string;
12
- };
9
+ export declare class FrameForm<T extends BaseProps = BaseProps> extends Base<T & FrameFormProps> {
10
+ /**
11
+ * Config.
12
+ */
13
+ static config: BaseConfig;
13
14
  /**
14
15
  * Get the form action.
15
- *
16
- * @this {FrameFormInterface}
17
- * @returns {string}
18
16
  */
19
17
  get action(): string;
20
18
  }
21
- export type FrameFormInterface = FrameForm & {
22
- $el: HTMLFormElement;
23
- };
24
- import { Base } from "@studiometa/js-toolkit";
@@ -1 +1,18 @@
1
- import{Base as e}from"@studiometa/js-toolkit";class t extends e{static config={name:"FrameForm"};get action(){return this.$el.action}}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 { Base } from "@studiometa/js-toolkit";
8
+ class FrameForm extends Base {
9
+ get action() {
10
+ return this.$el.action;
11
+ }
12
+ }
13
+ __publicField(FrameForm, "config", {
14
+ name: "FrameForm"
15
+ });
16
+ export {
17
+ FrameForm
18
+ };
@@ -21,10 +21,10 @@ var __publicField = (obj, key, value) => {
21
21
  return value;
22
22
  };
23
23
 
24
- // packages/ui/organisms/Frame/FrameTarget.js
24
+ // packages/ui/organisms/Frame/FrameTarget.ts
25
25
  var FrameTarget_exports = {};
26
26
  __export(FrameTarget_exports, {
27
- default: () => FrameTarget
27
+ FrameTarget: () => FrameTarget
28
28
  });
29
29
  module.exports = __toCommonJS(FrameTarget_exports);
30
30
  var import_utils = require("@studiometa/js-toolkit/utils");
@@ -36,7 +36,8 @@ var _FrameTarget = class extends import_primitives.Transition {
36
36
  return options;
37
37
  }
38
38
  get id() {
39
- return this.$options.id ?? this.$el.id;
39
+ var _a;
40
+ return (_a = this.$options.id) != null ? _a : this.$el.id;
40
41
  }
41
42
  async enter() {
42
43
  this.$log("enter");
@@ -45,9 +46,13 @@ var _FrameTarget = class extends import_primitives.Transition {
45
46
  switch (this.$options.mode) {
46
47
  case "append":
47
48
  case "prepend":
48
- await Promise.all(Array.from(this.$el.children).filter((child) => from.split(" ").every((className) => child.classList.contains(className))).map((child) => {
49
- return (0, import_utils.transition)(child, transitionStyles, enterKeep && "keep");
50
- }));
49
+ await Promise.all(
50
+ Array.from(this.$el.children).filter(
51
+ (child) => from.split(" ").every((className) => child.classList.contains(className))
52
+ ).map(
53
+ (child) => (0, import_utils.transition)(child, transitionStyles, enterKeep && "keep")
54
+ )
55
+ );
51
56
  break;
52
57
  case "replace":
53
58
  default:
@@ -62,7 +67,10 @@ var _FrameTarget = class extends import_primitives.Transition {
62
67
  Array.from(newTarget.$el.children).forEach((child) => {
63
68
  child.classList.add(...this.$options.enterFrom.split(" "));
64
69
  });
65
- this.$el.insertAdjacentHTML(_FrameTarget.__INSERT_MODES[this.$options.mode], newTarget.$el.innerHTML);
70
+ this.$el.insertAdjacentHTML(
71
+ _FrameTarget.__INSERT_MODES[this.$options.mode],
72
+ newTarget.$el.innerHTML
73
+ );
66
74
  break;
67
75
  case "replace":
68
76
  default:
@@ -1,45 +1,37 @@
1
- declare const FrameTarget_base: typeof import("@studiometa/js-toolkit").Base & (new (...a: any[]) => {
2
- readonly target: HTMLElement | HTMLElement[];
3
- enter(target?: HTMLElement | HTMLElement[]): Promise<void | void[]>;
4
- leave(target?: HTMLElement | HTMLElement[]): Promise<void | void[]>;
5
- });
1
+ import type { BaseConfig, BaseProps } from '@studiometa/js-toolkit';
2
+ import { Transition } from '../../primitives/index.js';
3
+ export interface FrameTargetProps extends BaseProps {
4
+ $options: {
5
+ mode: 'replace' | 'prepend' | 'append';
6
+ id: string;
7
+ leaveKeep: true;
8
+ };
9
+ }
6
10
  /**
7
11
  * FrameTarget class.
8
12
  */
9
- export default class FrameTarget extends FrameTarget_base {
13
+ export declare class FrameTarget<T extends BaseProps = BaseProps> extends Transition<T & FrameTargetProps> {
10
14
  /**
11
15
  * Config.
12
16
  */
13
- static config: {
14
- name: string;
15
- log: boolean;
16
- options: {
17
- mode: {
18
- type: StringConstructor;
19
- default: string;
20
- };
21
- id: StringConstructor;
22
- };
23
- debug?: boolean;
24
- refs?: string[];
25
- emits?: string[];
26
- components?: import("@studiometa/js-toolkit/Base/index.js").BaseConfigComponents;
27
- };
17
+ static config: BaseConfig;
28
18
  /**
29
19
  * Insert modes.
30
20
  */
31
21
  static __INSERT_MODES: {
32
- prepend: string;
33
- append: string;
22
+ readonly prepend: "afterbegin";
23
+ readonly append: "beforeend";
34
24
  };
25
+ /**
26
+ * Override options.
27
+ */
28
+ get $options(): import("@studiometa/js-toolkit/Base/managers/OptionsManager.js").default & import("@studiometa/js-toolkit/Base/index.js").BaseOptions & (T & FrameTargetProps & import("../../index.js").TransitionProps)["$options"];
35
29
  /**
36
30
  * Get uniq ID.
37
- * @returns {string}
38
31
  */
39
32
  get id(): string;
40
33
  /**
41
34
  * Enter transition.
42
- * @returns {Promise<void>}
43
35
  */
44
36
  enter(): Promise<void>;
45
37
  /**
@@ -50,4 +42,3 @@ export default class FrameTarget extends FrameTarget_base {
50
42
  */
51
43
  updateContent(newTarget: FrameTarget): void;
52
44
  }
53
- export {};
@@ -1 +1,79 @@
1
- import{transition as a}from"@studiometa/js-toolkit/utils";import{Transition as r}from"../../primitives/index.js";class o extends r{static config={...r.config,name:"FrameTarget",log:!0,options:{...r.config.options,mode:{type:String,default:"replace"},id:String}};static __INSERT_MODES={prepend:"afterbegin",append:"beforeend"};get $options(){const e=super.$options;return e.leaveKeep=!0,e}get id(){return this.$options.id??this.$el.id}async enter(){this.$log("enter");const{enterFrom:e,enterActive:t,enterTo:p,leaveTo:l,enterKeep:s}=this.$options,i={from:e,active:t,to:p};switch(this.$options.mode){case"append":case"prepend":await Promise.all(Array.from(this.$el.children).filter(n=>e.split(" ").every(c=>n.classList.contains(c))).map(n=>a(n,i,s&&"keep")));break;case"replace":default:i.from=Array.from(new Set([e,l].flat())).join(" "),await a(this.$el,i,s&&"keep")}}updateContent(e){switch(this.$options.mode){case"prepend":case"append":Array.from(e.$el.children).forEach(t=>{t.classList.add(...this.$options.enterFrom.split(" "))}),this.$el.insertAdjacentHTML(o.__INSERT_MODES[this.$options.mode],e.$el.innerHTML);break;case"replace":default:this.$el.innerHTML=e.$el.innerHTML;break}}}export{o 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 { transition } from "@studiometa/js-toolkit/utils";
8
+ import { Transition } from "../../primitives/index.js";
9
+ const _FrameTarget = class extends Transition {
10
+ get $options() {
11
+ const options = super.$options;
12
+ options.leaveKeep = true;
13
+ return options;
14
+ }
15
+ get id() {
16
+ var _a;
17
+ return (_a = this.$options.id) != null ? _a : this.$el.id;
18
+ }
19
+ async enter() {
20
+ this.$log("enter");
21
+ const { enterFrom: from, enterActive: active, enterTo: to, leaveTo, enterKeep } = this.$options;
22
+ const transitionStyles = { from, active, to };
23
+ switch (this.$options.mode) {
24
+ case "append":
25
+ case "prepend":
26
+ await Promise.all(
27
+ Array.from(this.$el.children).filter(
28
+ (child) => from.split(" ").every((className) => child.classList.contains(className))
29
+ ).map(
30
+ (child) => transition(child, transitionStyles, enterKeep && "keep")
31
+ )
32
+ );
33
+ break;
34
+ case "replace":
35
+ default:
36
+ transitionStyles.from = Array.from(new Set([from, leaveTo].flat())).join(" ");
37
+ await transition(this.$el, transitionStyles, enterKeep && "keep");
38
+ }
39
+ }
40
+ updateContent(newTarget) {
41
+ switch (this.$options.mode) {
42
+ case "prepend":
43
+ case "append":
44
+ Array.from(newTarget.$el.children).forEach((child) => {
45
+ child.classList.add(...this.$options.enterFrom.split(" "));
46
+ });
47
+ this.$el.insertAdjacentHTML(
48
+ _FrameTarget.__INSERT_MODES[this.$options.mode],
49
+ newTarget.$el.innerHTML
50
+ );
51
+ break;
52
+ case "replace":
53
+ default:
54
+ this.$el.innerHTML = newTarget.$el.innerHTML;
55
+ break;
56
+ }
57
+ }
58
+ };
59
+ let FrameTarget = _FrameTarget;
60
+ __publicField(FrameTarget, "config", {
61
+ ...Transition.config,
62
+ name: "FrameTarget",
63
+ log: true,
64
+ options: {
65
+ ...Transition.config.options,
66
+ mode: {
67
+ type: String,
68
+ default: "replace"
69
+ },
70
+ id: String
71
+ }
72
+ });
73
+ __publicField(FrameTarget, "__INSERT_MODES", {
74
+ prepend: "afterbegin",
75
+ append: "beforeend"
76
+ });
77
+ export {
78
+ FrameTarget
79
+ };
@@ -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,20 +10,14 @@ 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/organisms/Frame/index.js
16
+ // packages/ui/organisms/Frame/index.ts
23
17
  var Frame_exports = {};
24
- __export(Frame_exports, {
25
- Frame: () => import_Frame.default,
26
- FrameAnchor: () => import_FrameAnchor.default,
27
- FrameForm: () => import_FrameForm.default,
28
- FrameTarget: () => import_FrameTarget.default
29
- });
30
18
  module.exports = __toCommonJS(Frame_exports);
31
- var import_Frame = __toESM(require("./Frame.cjs"), 1);
32
- var import_FrameAnchor = __toESM(require("./FrameAnchor.cjs"), 1);
33
- var import_FrameForm = __toESM(require("./FrameForm.cjs"), 1);
34
- var import_FrameTarget = __toESM(require("./FrameTarget.cjs"), 1);
19
+ __reExport(Frame_exports, require("./Frame.cjs"), module.exports);
20
+ __reExport(Frame_exports, require("./FrameAnchor.cjs"), module.exports);
21
+ __reExport(Frame_exports, require("./FrameForm.cjs"), module.exports);
22
+ __reExport(Frame_exports, require("./FrameTarget.cjs"), module.exports);
35
23
  if (module.exports.default) module.exports = module.exports.default;
@@ -1,4 +1,4 @@
1
- export { default as Frame } from "./Frame.js";
2
- export { default as FrameAnchor } from "./FrameAnchor.js";
3
- export { default as FrameForm } from "./FrameForm.js";
4
- export { default as FrameTarget } from "./FrameTarget.js";
1
+ export * from './Frame.js';
2
+ export * from './FrameAnchor.js';
3
+ export * from './FrameForm.js';
4
+ export * from './FrameTarget.js';
@@ -1 +1,4 @@
1
- import{default as e}from"./Frame.js";import{default as m}from"./FrameAnchor.js";import{default as f}from"./FrameForm.js";import{default as d}from"./FrameTarget.js";export{e as Frame,m as FrameAnchor,f as FrameForm,d as FrameTarget};
1
+ export * from "./Frame.js";
2
+ export * from "./FrameAnchor.js";
3
+ export * from "./FrameForm.js";
4
+ export * from "./FrameTarget.js";
@@ -13,7 +13,7 @@ var __copyProps = (to, from, except, desc) => {
13
13
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
15
 
16
- // packages/ui/organisms/index.js
16
+ // packages/ui/organisms/index.ts
17
17
  var organisms_exports = {};
18
18
  module.exports = __toCommonJS(organisms_exports);
19
19
  __reExport(organisms_exports, require("./Frame/index.cjs"), module.exports);
@@ -1 +1 @@
1
- export * from "./Frame/index.js";
1
+ export * from './Frame/index.js';
@@ -1 +1 @@
1
- export*from"./Frame/index.js";
1
+ export * from "./Frame/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studiometa/ui",
3
- "version": "0.2.12",
3
+ "version": "0.2.14",
4
4
  "description": "A set of opiniated, unstyled and accessible components",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "homepage": "https://github.com/studiometa/ui#readme",
31
31
  "dependencies": {
32
- "@studiometa/js-toolkit": "^2.4.1",
32
+ "@studiometa/js-toolkit": "^2.5.0",
33
33
  "deepmerge": "^4.2.2"
34
34
  }
35
35
  }
@@ -21,19 +21,22 @@ var __publicField = (obj, key, value) => {
21
21
  return value;
22
22
  };
23
23
 
24
- // packages/ui/primitives/Draggable/Draggable.js
24
+ // packages/ui/primitives/Draggable/Draggable.ts
25
25
  var Draggable_exports = {};
26
26
  __export(Draggable_exports, {
27
- default: () => Draggable
27
+ Draggable: () => Draggable
28
28
  });
29
29
  module.exports = __toCommonJS(Draggable_exports);
30
30
  var import_js_toolkit = require("@studiometa/js-toolkit");
31
31
  var import_utils = require("@studiometa/js-toolkit/utils");
32
32
  var Draggable = class extends (0, import_js_toolkit.withDrag)(import_js_toolkit.Base) {
33
- x = 0;
34
- y = 0;
35
- originX = 0;
36
- originY = 0;
33
+ constructor() {
34
+ super(...arguments);
35
+ __publicField(this, "x", 0);
36
+ __publicField(this, "y", 0);
37
+ __publicField(this, "originX", 0);
38
+ __publicField(this, "originY", 0);
39
+ }
37
40
  dragged(props) {
38
41
  if (props.mode === "start") {
39
42
  this.originX = this.x;
@@ -1,34 +1,33 @@
1
+ import { Base } from '@studiometa/js-toolkit';
2
+ import type { BaseProps, BaseConfig, DragServiceProps } from '@studiometa/js-toolkit';
3
+ declare const Draggable_base: import("@studiometa/js-toolkit").BaseDecorator<import("@studiometa/js-toolkit").BaseInterface, Base<BaseProps>, BaseProps>;
1
4
  /**
2
5
  * Draggable class.
3
6
  */
4
- export default class Draggable extends Base {
5
- static config: {
6
- name: string;
7
- };
7
+ export declare class Draggable<T extends BaseProps = BaseProps> extends Draggable_base<T> {
8
+ /**
9
+ * Config.
10
+ */
11
+ static config: BaseConfig;
8
12
  /**
9
13
  * Horizontal transformation.
10
- * @type {number}
11
14
  */
12
15
  x: number;
13
16
  /**
14
17
  * Vertical transformation.
15
- * @type {number}
16
18
  */
17
19
  y: number;
18
20
  /**
19
21
  * Horizontal position origin.
20
- * @type {number}
21
22
  */
22
23
  originX: number;
23
24
  /**
24
25
  * Vertical position origin.
25
- * @type {number}
26
26
  */
27
27
  originY: number;
28
28
  /**
29
29
  * Drag service hook.
30
- * @param {import('@studiometa/js-toolkit/services/drag.js').DragServiceProps} props
31
30
  */
32
- dragged(props: import('@studiometa/js-toolkit/services/drag.js').DragServiceProps): void;
31
+ dragged(props: DragServiceProps): void;
33
32
  }
34
- import { Base } from "@studiometa/js-toolkit";
33
+ export {};
@@ -1 +1,33 @@
1
- import{Base as t,withDrag as r}from"@studiometa/js-toolkit";import{matrix as a}from"@studiometa/js-toolkit/utils";class e extends r(t){static config={name:"DraggableElement"};x=0;y=0;originX=0;originY=0;dragged(i){if(i.mode==="start"){this.originX=this.x,this.originY=this.y;return}this.x=this.originX+i.x-i.origin.x,this.y=this.originY+i.y-i.origin.y,this.$el.style.transform=a({translateX:this.x,translateY:this.y})}}export{e 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, withDrag } from "@studiometa/js-toolkit";
8
+ import { matrix } from "@studiometa/js-toolkit/utils";
9
+ class Draggable extends withDrag(Base) {
10
+ constructor() {
11
+ super(...arguments);
12
+ __publicField(this, "x", 0);
13
+ __publicField(this, "y", 0);
14
+ __publicField(this, "originX", 0);
15
+ __publicField(this, "originY", 0);
16
+ }
17
+ dragged(props) {
18
+ if (props.mode === "start") {
19
+ this.originX = this.x;
20
+ this.originY = this.y;
21
+ return;
22
+ }
23
+ this.x = this.originX + props.x - props.origin.x;
24
+ this.y = this.originY + props.y - props.origin.y;
25
+ this.$el.style.transform = matrix({ translateX: this.x, translateY: this.y });
26
+ }
27
+ }
28
+ __publicField(Draggable, "config", {
29
+ name: "DraggableElement"
30
+ });
31
+ export {
32
+ Draggable
33
+ };
@@ -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/primitives/Draggable/index.ts
17
+ var Draggable_exports = {};
18
+ module.exports = __toCommonJS(Draggable_exports);
19
+ __reExport(Draggable_exports, require("./Draggable.cjs"), module.exports);
20
+ if (module.exports.default) module.exports = module.exports.default;
@@ -0,0 +1 @@
1
+ export * from './Draggable.js';
@@ -0,0 +1 @@
1
+ export * from "./Draggable.js";
@@ -21,10 +21,10 @@ var __publicField = (obj, key, value) => {
21
21
  return value;
22
22
  };
23
23
 
24
- // packages/ui/primitives/Sentinel/Sentinel.js
24
+ // packages/ui/primitives/Sentinel/Sentinel.ts
25
25
  var Sentinel_exports = {};
26
26
  __export(Sentinel_exports, {
27
- default: () => Sentinel
27
+ Sentinel: () => Sentinel
28
28
  });
29
29
  module.exports = __toCommonJS(Sentinel_exports);
30
30
  var import_js_toolkit = require("@studiometa/js-toolkit");
@@ -1,12 +1,13 @@
1
+ import { Base } from '@studiometa/js-toolkit';
2
+ import type { BaseConfig } from '@studiometa/js-toolkit';
3
+ declare const Sentinel_base: import("@studiometa/js-toolkit").BaseDecorator<import("@studiometa/js-toolkit").WithIntersectionObserverInterface, Base<import("@studiometa/js-toolkit").BaseProps>, import("@studiometa/js-toolkit").WithIntersectionObserverProps>;
1
4
  /**
2
5
  * Sentinel class.
3
6
  */
4
- export default class Sentinel extends Base {
7
+ export declare class Sentinel extends Sentinel_base {
5
8
  /**
6
9
  * Config.
7
10
  */
8
- static config: {
9
- name: string;
10
- };
11
+ static config: BaseConfig;
11
12
  }
12
- import { Base } from "@studiometa/js-toolkit";
13
+ export {};
@@ -1 +1,15 @@
1
- import{Base as e,withIntersectionObserver as t}from"@studiometa/js-toolkit";class n extends t(e,{threshold:[0,1]}){static config={name:"Sentinel"}}export{n 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, withIntersectionObserver } from "@studiometa/js-toolkit";
8
+ class Sentinel extends withIntersectionObserver(Base, { threshold: [0, 1] }) {
9
+ }
10
+ __publicField(Sentinel, "config", {
11
+ name: "Sentinel"
12
+ });
13
+ export {
14
+ Sentinel
15
+ };
@@ -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/primitives/Sentinel/index.ts
17
+ var Sentinel_exports = {};
18
+ module.exports = __toCommonJS(Sentinel_exports);
19
+ __reExport(Sentinel_exports, require("./Sentinel.cjs"), module.exports);
20
+ if (module.exports.default) module.exports = module.exports.default;
@@ -0,0 +1 @@
1
+ export * from './Sentinel.js';
@@ -0,0 +1 @@
1
+ export * from "./Sentinel.js";
@@ -2,6 +2,7 @@ var __defProp = Object.defineProperty;
2
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5
6
  var __export = (target, all) => {
6
7
  for (var name in all)
7
8
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -15,14 +16,22 @@ var __copyProps = (to, from, except, desc) => {
15
16
  return to;
16
17
  };
17
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var __publicField = (obj, key, value) => {
20
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
21
+ return value;
22
+ };
18
23
 
19
- // packages/ui/primitives/Transition/Transition.js
24
+ // packages/ui/primitives/Transition/Transition.ts
20
25
  var Transition_exports = {};
21
26
  __export(Transition_exports, {
22
- default: () => Transition_default
27
+ Transition: () => Transition
23
28
  });
24
29
  module.exports = __toCommonJS(Transition_exports);
25
30
  var import_js_toolkit = require("@studiometa/js-toolkit");
26
31
  var import_decorators = require("../../decorators/index.cjs");
27
- var Transition_default = (0, import_decorators.withTransition)(import_js_toolkit.Base);
32
+ var Transition = class extends (0, import_decorators.withTransition)(import_js_toolkit.Base) {
33
+ };
34
+ __publicField(Transition, "config", {
35
+ name: "Transition"
36
+ });
28
37
  if (module.exports.default) module.exports = module.exports.default;
@@ -1,7 +1,13 @@
1
- declare const _default: typeof Base & (new (...a: any[]) => {
2
- readonly target: HTMLElement | HTMLElement[];
3
- enter(target?: HTMLElement | HTMLElement[]): Promise<void | void[]>;
4
- leave(target?: HTMLElement | HTMLElement[]): Promise<void | void[]>;
5
- });
6
- export default _default;
7
- import { Base } from "@studiometa/js-toolkit";
1
+ import { Base, BaseProps } from '@studiometa/js-toolkit';
2
+ import type { BaseConfig } from '@studiometa/js-toolkit';
3
+ declare const Transition_base: import("@studiometa/js-toolkit").BaseDecorator<import("../../decorators/withTransition.js").TransitionInterface, Base<BaseProps>, import("../../decorators/withTransition.js").TransitionProps>;
4
+ /**
5
+ * Transition class.
6
+ */
7
+ export declare class Transition<T extends BaseProps = BaseProps> extends Transition_base<T> {
8
+ /**
9
+ * Config.
10
+ */
11
+ static config: BaseConfig;
12
+ }
13
+ export {};
@@ -1 +1,16 @@
1
- import{Base as o}from"@studiometa/js-toolkit";import{withTransition as r}from"../../decorators/index.js";var m=r(o);export{m 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
+ import { withTransition } from "../../decorators/index.js";
9
+ class Transition extends withTransition(Base) {
10
+ }
11
+ __publicField(Transition, "config", {
12
+ name: "Transition"
13
+ });
14
+ export {
15
+ Transition
16
+ };