@studiometa/ui 0.2.13 → 0.2.15

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 (361) hide show
  1. package/atoms/AnchorScrollTo/AnchorScrollTo.cjs +4 -3
  2. package/atoms/AnchorScrollTo/AnchorScrollTo.cjs.map +7 -0
  3. package/atoms/AnchorScrollTo/AnchorScrollTo.d.ts +8 -15
  4. package/atoms/AnchorScrollTo/AnchorScrollTo.js +21 -1
  5. package/atoms/AnchorScrollTo/AnchorScrollTo.js.map +7 -0
  6. package/atoms/AnchorScrollTo/index.cjs +21 -0
  7. package/atoms/AnchorScrollTo/index.cjs.map +7 -0
  8. package/atoms/AnchorScrollTo/index.d.ts +1 -0
  9. package/atoms/AnchorScrollTo/index.js +2 -0
  10. package/atoms/AnchorScrollTo/index.js.map +7 -0
  11. package/atoms/Cursor/Cursor.cjs +8 -3
  12. package/atoms/Cursor/Cursor.cjs.map +7 -0
  13. package/atoms/Cursor/Cursor.d.ts +19 -117
  14. package/atoms/Cursor/Cursor.js +103 -1
  15. package/atoms/Cursor/Cursor.js.map +7 -0
  16. package/atoms/Cursor/index.cjs +21 -0
  17. package/atoms/Cursor/index.cjs.map +7 -0
  18. package/atoms/Cursor/index.d.ts +1 -0
  19. package/atoms/Cursor/index.js +2 -0
  20. package/atoms/Cursor/index.js.map +7 -0
  21. package/atoms/Figure/Figure.cjs +16 -9
  22. package/atoms/Figure/Figure.cjs.map +7 -0
  23. package/atoms/Figure/Figure.d.ts +18 -53
  24. package/atoms/Figure/Figure.js +51 -1
  25. package/atoms/Figure/Figure.js.map +7 -0
  26. package/atoms/Figure/FigureTwicPics.cjs +11 -10
  27. package/atoms/Figure/FigureTwicPics.cjs.map +7 -0
  28. package/atoms/Figure/FigureTwicPics.d.ts +16 -37
  29. package/atoms/Figure/FigureTwicPics.js +46 -1
  30. package/atoms/Figure/FigureTwicPics.js.map +7 -0
  31. package/atoms/Figure/index.cjs +5 -14
  32. package/atoms/Figure/index.cjs.map +7 -0
  33. package/atoms/Figure/index.d.ts +2 -2
  34. package/atoms/Figure/index.js +3 -1
  35. package/atoms/Figure/index.js.map +7 -0
  36. package/atoms/LargeText/LargeText.cjs +8 -3
  37. package/atoms/LargeText/LargeText.cjs.map +7 -0
  38. package/atoms/LargeText/LargeText.d.ts +19 -40
  39. package/atoms/LargeText/LargeText.js +60 -1
  40. package/atoms/LargeText/LargeText.js.map +7 -0
  41. package/atoms/LargeText/index.cjs +21 -0
  42. package/atoms/LargeText/index.cjs.map +7 -0
  43. package/atoms/LargeText/index.d.ts +1 -0
  44. package/atoms/LargeText/index.js +2 -0
  45. package/atoms/LargeText/index.js.map +7 -0
  46. package/atoms/LazyInclude/LazyInclude.cjs +3 -2
  47. package/atoms/LazyInclude/LazyInclude.cjs.map +7 -0
  48. package/atoms/LazyInclude/LazyInclude.d.ts +17 -36
  49. package/atoms/LazyInclude/LazyInclude.js +41 -1
  50. package/atoms/LazyInclude/LazyInclude.js.map +7 -0
  51. package/atoms/LazyInclude/index.cjs +21 -0
  52. package/atoms/LazyInclude/index.cjs.map +7 -0
  53. package/atoms/LazyInclude/index.d.ts +1 -0
  54. package/atoms/LazyInclude/index.js +2 -0
  55. package/atoms/LazyInclude/index.js.map +7 -0
  56. package/atoms/Prefetch/AbstractPrefetch.cjs +7 -6
  57. package/atoms/Prefetch/AbstractPrefetch.cjs.map +7 -0
  58. package/atoms/Prefetch/AbstractPrefetch.d.ts +12 -35
  59. package/atoms/Prefetch/AbstractPrefetch.js +52 -1
  60. package/atoms/Prefetch/AbstractPrefetch.js.map +7 -0
  61. package/atoms/Prefetch/PrefetchWhenOver.cjs +6 -8
  62. package/atoms/Prefetch/PrefetchWhenOver.cjs.map +7 -0
  63. package/atoms/Prefetch/PrefetchWhenOver.d.ts +8 -14
  64. package/atoms/Prefetch/PrefetchWhenOver.js +14 -1
  65. package/atoms/Prefetch/PrefetchWhenOver.js.map +7 -0
  66. package/atoms/Prefetch/PrefetchWhenVisible.cjs +6 -8
  67. package/atoms/Prefetch/PrefetchWhenVisible.cjs.map +7 -0
  68. package/atoms/Prefetch/PrefetchWhenVisible.d.ts +10 -14
  69. package/atoms/Prefetch/PrefetchWhenVisible.js +15 -1
  70. package/atoms/Prefetch/PrefetchWhenVisible.js.map +7 -0
  71. package/atoms/Prefetch/index.cjs +6 -16
  72. package/atoms/Prefetch/index.cjs.map +7 -0
  73. package/atoms/Prefetch/index.d.ts +3 -3
  74. package/atoms/Prefetch/index.js +4 -1
  75. package/atoms/Prefetch/index.js.map +7 -0
  76. package/atoms/ScrollAnimation/AbstractScrollAnimation.cjs +18 -14
  77. package/atoms/ScrollAnimation/AbstractScrollAnimation.cjs.map +7 -0
  78. package/atoms/ScrollAnimation/AbstractScrollAnimation.d.ts +19 -89
  79. package/atoms/ScrollAnimation/AbstractScrollAnimation.js +62 -1
  80. package/atoms/ScrollAnimation/AbstractScrollAnimation.js.map +7 -0
  81. package/atoms/ScrollAnimation/ScrollAnimation.cjs +6 -14
  82. package/atoms/ScrollAnimation/ScrollAnimation.cjs.map +7 -0
  83. package/atoms/ScrollAnimation/ScrollAnimation.d.ts +13 -51
  84. package/atoms/ScrollAnimation/ScrollAnimation.js +16 -1
  85. package/atoms/ScrollAnimation/ScrollAnimation.js.map +7 -0
  86. package/atoms/ScrollAnimation/ScrollAnimationChild.cjs +31 -10
  87. package/atoms/ScrollAnimation/ScrollAnimationChild.cjs.map +7 -0
  88. package/atoms/ScrollAnimation/ScrollAnimationChild.d.ts +19 -6
  89. package/atoms/ScrollAnimation/ScrollAnimationChild.js +45 -1
  90. package/atoms/ScrollAnimation/ScrollAnimationChild.js.map +7 -0
  91. package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.cjs +7 -9
  92. package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.cjs.map +7 -0
  93. package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.d.ts +8 -2
  94. package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.js +12 -1
  95. package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.js.map +7 -0
  96. package/atoms/ScrollAnimation/ScrollAnimationParent.cjs +9 -8
  97. package/atoms/ScrollAnimation/ScrollAnimationParent.cjs.map +7 -0
  98. package/atoms/ScrollAnimation/ScrollAnimationParent.d.ts +14 -26
  99. package/atoms/ScrollAnimation/ScrollAnimationParent.js +22 -1
  100. package/atoms/ScrollAnimation/ScrollAnimationParent.js.map +7 -0
  101. package/atoms/ScrollAnimation/ScrollAnimationWithEase.cjs +7 -9
  102. package/atoms/ScrollAnimation/ScrollAnimationWithEase.cjs.map +7 -0
  103. package/atoms/ScrollAnimation/ScrollAnimationWithEase.d.ts +15 -2
  104. package/atoms/ScrollAnimation/ScrollAnimationWithEase.js +12 -1
  105. package/atoms/ScrollAnimation/ScrollAnimationWithEase.js.map +7 -0
  106. package/atoms/ScrollAnimation/animationScrollWithEase.cjs +9 -5
  107. package/atoms/ScrollAnimation/animationScrollWithEase.cjs.map +7 -0
  108. package/atoms/ScrollAnimation/animationScrollWithEase.d.ts +10 -8
  109. package/atoms/ScrollAnimation/animationScrollWithEase.js +31 -1
  110. package/atoms/ScrollAnimation/animationScrollWithEase.js.map +7 -0
  111. package/atoms/ScrollAnimation/index.cjs +10 -24
  112. package/atoms/ScrollAnimation/index.cjs.map +7 -0
  113. package/atoms/ScrollAnimation/index.d.ts +7 -7
  114. package/atoms/ScrollAnimation/index.js +8 -1
  115. package/atoms/ScrollAnimation/index.js.map +7 -0
  116. package/atoms/ScrollReveal/ScrollReveal.cjs +6 -3
  117. package/atoms/ScrollReveal/ScrollReveal.cjs.map +7 -0
  118. package/atoms/ScrollReveal/ScrollReveal.d.ts +16 -59
  119. package/atoms/ScrollReveal/ScrollReveal.js +47 -1
  120. package/atoms/ScrollReveal/ScrollReveal.js.map +7 -0
  121. package/atoms/ScrollReveal/index.cjs +4 -12
  122. package/atoms/ScrollReveal/index.cjs.map +7 -0
  123. package/atoms/ScrollReveal/index.d.ts +1 -1
  124. package/atoms/ScrollReveal/index.js +2 -1
  125. package/atoms/ScrollReveal/index.js.map +7 -0
  126. package/atoms/index.cjs +6 -18
  127. package/atoms/index.cjs.map +7 -0
  128. package/atoms/index.d.ts +8 -8
  129. package/atoms/index.js +9 -1
  130. package/atoms/index.js.map +7 -0
  131. package/decorators/index.cjs +4 -12
  132. package/decorators/index.cjs.map +7 -0
  133. package/decorators/index.d.ts +1 -1
  134. package/decorators/index.js +2 -1
  135. package/decorators/index.js.map +7 -0
  136. package/decorators/withTransition.cjs +23 -17
  137. package/decorators/withTransition.cjs.map +7 -0
  138. package/decorators/withTransition.d.ts +21 -33
  139. package/decorators/withTransition.js +50 -1
  140. package/decorators/withTransition.js.map +7 -0
  141. package/index.cjs +2 -1
  142. package/index.cjs.map +7 -0
  143. package/index.d.ts +5 -5
  144. package/index.js +6 -1
  145. package/index.js.map +7 -0
  146. package/molecules/Accordion/Accordion.cjs +8 -10
  147. package/molecules/Accordion/Accordion.cjs.map +7 -0
  148. package/molecules/Accordion/Accordion.d.ts +5 -23
  149. package/molecules/Accordion/Accordion.js +14 -1
  150. package/molecules/Accordion/Accordion.js.map +7 -0
  151. package/molecules/Accordion/AccordionCore.cjs +7 -8
  152. package/molecules/Accordion/AccordionCore.cjs.map +7 -0
  153. package/molecules/Accordion/AccordionCore.d.ts +22 -70
  154. package/molecules/Accordion/AccordionCore.js +27 -1
  155. package/molecules/Accordion/AccordionCore.js.map +7 -0
  156. package/molecules/Accordion/AccordionItem.cjs +39 -23
  157. package/molecules/Accordion/AccordionItem.cjs.map +7 -0
  158. package/molecules/Accordion/AccordionItem.d.ts +24 -94
  159. package/molecules/Accordion/AccordionItem.js +146 -1
  160. package/molecules/Accordion/AccordionItem.js.map +7 -0
  161. package/molecules/Accordion/index.cjs +22 -0
  162. package/molecules/Accordion/index.cjs.map +7 -0
  163. package/molecules/Accordion/index.d.ts +2 -0
  164. package/molecules/Accordion/index.js +3 -0
  165. package/molecules/Accordion/index.js.map +7 -0
  166. package/molecules/Menu/Menu.cjs +7 -10
  167. package/molecules/Menu/Menu.cjs.map +7 -0
  168. package/molecules/Menu/Menu.d.ts +24 -84
  169. package/molecules/Menu/Menu.js +108 -1
  170. package/molecules/Menu/Menu.js.map +7 -0
  171. package/molecules/Menu/MenuBtn.cjs +4 -4
  172. package/molecules/Menu/MenuBtn.cjs.map +7 -0
  173. package/molecules/Menu/MenuBtn.d.ts +7 -9
  174. package/molecules/Menu/MenuBtn.js +22 -1
  175. package/molecules/Menu/MenuBtn.js.map +7 -0
  176. package/molecules/Menu/MenuList.cjs +9 -9
  177. package/molecules/Menu/MenuList.cjs.map +7 -0
  178. package/molecules/Menu/MenuList.d.ts +16 -53
  179. package/molecules/Menu/MenuList.js +104 -1
  180. package/molecules/Menu/MenuList.js.map +7 -0
  181. package/molecules/Menu/index.cjs +6 -16
  182. package/molecules/Menu/index.cjs.map +7 -0
  183. package/molecules/Menu/index.d.ts +3 -3
  184. package/molecules/Menu/index.js +4 -1
  185. package/molecules/Menu/index.js.map +7 -0
  186. package/molecules/Modal/Modal.cjs +35 -13
  187. package/molecules/Modal/Modal.cjs.map +7 -0
  188. package/molecules/Modal/Modal.d.ts +69 -140
  189. package/molecules/Modal/Modal.js +150 -1
  190. package/molecules/Modal/Modal.js.map +7 -0
  191. package/molecules/Modal/ModalWithTransition.cjs +5 -7
  192. package/molecules/Modal/ModalWithTransition.cjs.map +7 -0
  193. package/molecules/Modal/ModalWithTransition.d.ts +6 -22
  194. package/molecules/Modal/ModalWithTransition.js +41 -1
  195. package/molecules/Modal/ModalWithTransition.js.map +7 -0
  196. package/molecules/Modal/index.cjs +22 -0
  197. package/molecules/Modal/index.cjs.map +7 -0
  198. package/molecules/Modal/index.d.ts +2 -0
  199. package/molecules/Modal/index.js +3 -0
  200. package/molecules/Modal/index.js.map +7 -0
  201. package/molecules/Panel/Panel.cjs +38 -26
  202. package/molecules/Panel/Panel.cjs.map +7 -0
  203. package/molecules/Panel/Panel.d.ts +22 -21
  204. package/molecules/Panel/Panel.js +98 -1
  205. package/molecules/Panel/Panel.js.map +7 -0
  206. package/molecules/Panel/index.cjs +21 -0
  207. package/molecules/Panel/index.cjs.map +7 -0
  208. package/molecules/Panel/index.d.ts +1 -0
  209. package/molecules/Panel/index.js +2 -0
  210. package/molecules/Panel/index.js.map +7 -0
  211. package/molecules/Slider/AbstractSliderChild.cjs +8 -9
  212. package/molecules/Slider/AbstractSliderChild.cjs.map +7 -0
  213. package/molecules/Slider/AbstractSliderChild.d.ts +11 -30
  214. package/molecules/Slider/AbstractSliderChild.js +43 -1
  215. package/molecules/Slider/AbstractSliderChild.js.map +7 -0
  216. package/molecules/Slider/Slider.cjs +31 -18
  217. package/molecules/Slider/Slider.cjs.map +7 -0
  218. package/molecules/Slider/Slider.d.ts +40 -157
  219. package/molecules/Slider/Slider.js +271 -1
  220. package/molecules/Slider/Slider.js.map +7 -0
  221. package/molecules/Slider/SliderBtn.cjs +5 -7
  222. package/molecules/Slider/SliderBtn.cjs.map +7 -0
  223. package/molecules/Slider/SliderBtn.d.ts +12 -23
  224. package/molecules/Slider/SliderBtn.js +29 -1
  225. package/molecules/Slider/SliderBtn.js.map +7 -0
  226. package/molecules/Slider/SliderCount.cjs +5 -7
  227. package/molecules/Slider/SliderCount.cjs.map +7 -0
  228. package/molecules/Slider/SliderCount.d.ts +10 -16
  229. package/molecules/Slider/SliderCount.js +14 -1
  230. package/molecules/Slider/SliderCount.js.map +7 -0
  231. package/molecules/Slider/SliderDots.cjs +5 -7
  232. package/molecules/Slider/SliderDots.cjs.map +7 -0
  233. package/molecules/Slider/SliderDots.d.ts +11 -31
  234. package/molecules/Slider/SliderDots.js +24 -1
  235. package/molecules/Slider/SliderDots.js.map +7 -0
  236. package/molecules/Slider/SliderDrag.cjs +3 -2
  237. package/molecules/Slider/SliderDrag.cjs.map +7 -0
  238. package/molecules/Slider/SliderDrag.d.ts +12 -30
  239. package/molecules/Slider/SliderDrag.js +29 -1
  240. package/molecules/Slider/SliderDrag.js.map +7 -0
  241. package/molecules/Slider/SliderItem.cjs +7 -3
  242. package/molecules/Slider/SliderItem.cjs.map +7 -0
  243. package/molecules/Slider/SliderItem.d.ts +21 -33
  244. package/molecules/Slider/SliderItem.js +85 -1
  245. package/molecules/Slider/SliderItem.js.map +7 -0
  246. package/molecules/Slider/SliderProgress.cjs +5 -7
  247. package/molecules/Slider/SliderProgress.cjs.map +7 -0
  248. package/molecules/Slider/SliderProgress.d.ts +10 -25
  249. package/molecules/Slider/SliderProgress.js +21 -1
  250. package/molecules/Slider/SliderProgress.js.map +7 -0
  251. package/molecules/Slider/index.cjs +11 -26
  252. package/molecules/Slider/index.cjs.map +7 -0
  253. package/molecules/Slider/index.d.ts +8 -8
  254. package/molecules/Slider/index.js +9 -1
  255. package/molecules/Slider/index.js.map +7 -0
  256. package/molecules/Sticky/Sticky.cjs +12 -8
  257. package/molecules/Sticky/Sticky.cjs.map +7 -0
  258. package/molecules/Sticky/Sticky.d.ts +30 -68
  259. package/molecules/Sticky/Sticky.js +101 -1
  260. package/molecules/Sticky/Sticky.js.map +7 -0
  261. package/molecules/Sticky/index.cjs +21 -0
  262. package/molecules/Sticky/index.cjs.map +7 -0
  263. package/molecules/Sticky/index.d.ts +1 -0
  264. package/molecules/Sticky/index.js +2 -0
  265. package/molecules/Sticky/index.js.map +7 -0
  266. package/molecules/TableOfContent/TableOfContent.cjs +6 -8
  267. package/molecules/TableOfContent/TableOfContent.cjs.map +7 -0
  268. package/molecules/TableOfContent/TableOfContent.d.ts +19 -41
  269. package/molecules/TableOfContent/TableOfContent.js +37 -1
  270. package/molecules/TableOfContent/TableOfContent.js.map +7 -0
  271. package/molecules/TableOfContent/TableOfContentAnchor.cjs +7 -5
  272. package/molecules/TableOfContent/TableOfContentAnchor.cjs.map +7 -0
  273. package/molecules/TableOfContent/TableOfContentAnchor.d.ts +14 -17
  274. package/molecules/TableOfContent/TableOfContentAnchor.js +35 -1
  275. package/molecules/TableOfContent/TableOfContentAnchor.js.map +7 -0
  276. package/molecules/TableOfContent/index.cjs +5 -14
  277. package/molecules/TableOfContent/index.cjs.map +7 -0
  278. package/molecules/TableOfContent/index.d.ts +2 -2
  279. package/molecules/TableOfContent/index.js +3 -1
  280. package/molecules/TableOfContent/index.js.map +7 -0
  281. package/molecules/Tabs/Tabs.cjs +40 -22
  282. package/molecules/Tabs/Tabs.cjs.map +7 -0
  283. package/molecules/Tabs/Tabs.d.ts +28 -90
  284. package/molecules/Tabs/Tabs.js +115 -1
  285. package/molecules/Tabs/Tabs.js.map +7 -0
  286. package/molecules/Tabs/index.cjs +21 -0
  287. package/molecules/Tabs/index.cjs.map +7 -0
  288. package/molecules/Tabs/index.d.ts +1 -0
  289. package/molecules/Tabs/index.js +2 -0
  290. package/molecules/Tabs/index.js.map +7 -0
  291. package/molecules/index.cjs +8 -24
  292. package/molecules/index.cjs.map +7 -0
  293. package/molecules/index.d.ts +9 -10
  294. package/molecules/index.js +10 -1
  295. package/molecules/index.js.map +7 -0
  296. package/organisms/Frame/Frame.cjs +21 -43
  297. package/organisms/Frame/Frame.cjs.map +7 -0
  298. package/organisms/Frame/Frame.d.ts +21 -98
  299. package/organisms/Frame/Frame.js +155 -1
  300. package/organisms/Frame/Frame.js.map +7 -0
  301. package/organisms/Frame/FrameAnchor.cjs +3 -2
  302. package/organisms/Frame/FrameAnchor.cjs.map +7 -0
  303. package/organisms/Frame/FrameAnchor.d.ts +7 -16
  304. package/organisms/Frame/FrameAnchor.js +13 -1
  305. package/organisms/Frame/FrameAnchor.js.map +7 -0
  306. package/organisms/Frame/FrameForm.cjs +3 -2
  307. package/organisms/Frame/FrameForm.cjs.map +7 -0
  308. package/organisms/Frame/FrameForm.d.ts +10 -16
  309. package/organisms/Frame/FrameForm.js +13 -1
  310. package/organisms/Frame/FrameForm.js.map +7 -0
  311. package/organisms/Frame/FrameTarget.cjs +15 -9
  312. package/organisms/Frame/FrameTarget.cjs.map +7 -0
  313. package/organisms/Frame/FrameTarget.d.ts +17 -26
  314. package/organisms/Frame/FrameTarget.js +70 -1
  315. package/organisms/Frame/FrameTarget.js.map +7 -0
  316. package/organisms/Frame/index.cjs +7 -18
  317. package/organisms/Frame/index.cjs.map +7 -0
  318. package/organisms/Frame/index.d.ts +4 -4
  319. package/organisms/Frame/index.js +5 -1
  320. package/organisms/Frame/index.js.map +7 -0
  321. package/organisms/index.cjs +2 -1
  322. package/organisms/index.cjs.map +7 -0
  323. package/organisms/index.d.ts +1 -1
  324. package/organisms/index.js +2 -1
  325. package/organisms/index.js.map +7 -0
  326. package/package.json +2 -2
  327. package/primitives/Draggable/Draggable.cjs +3 -2
  328. package/primitives/Draggable/Draggable.cjs.map +7 -0
  329. package/primitives/Draggable/Draggable.d.ts +10 -11
  330. package/primitives/Draggable/Draggable.js +25 -1
  331. package/primitives/Draggable/Draggable.js.map +7 -0
  332. package/primitives/Draggable/index.cjs +21 -0
  333. package/primitives/Draggable/index.cjs.map +7 -0
  334. package/primitives/Draggable/index.d.ts +1 -0
  335. package/primitives/Draggable/index.js +2 -0
  336. package/primitives/Draggable/index.js.map +7 -0
  337. package/primitives/Sentinel/Sentinel.cjs +3 -2
  338. package/primitives/Sentinel/Sentinel.cjs.map +7 -0
  339. package/primitives/Sentinel/Sentinel.d.ts +6 -5
  340. package/primitives/Sentinel/Sentinel.js +10 -1
  341. package/primitives/Sentinel/Sentinel.js.map +7 -0
  342. package/primitives/Sentinel/index.cjs +21 -0
  343. package/primitives/Sentinel/index.cjs.map +7 -0
  344. package/primitives/Sentinel/index.d.ts +1 -0
  345. package/primitives/Sentinel/index.js +2 -0
  346. package/primitives/Sentinel/index.js.map +7 -0
  347. package/primitives/Transition/Transition.cjs +13 -3
  348. package/primitives/Transition/Transition.cjs.map +7 -0
  349. package/primitives/Transition/Transition.d.ts +13 -7
  350. package/primitives/Transition/Transition.js +11 -1
  351. package/primitives/Transition/Transition.js.map +7 -0
  352. package/primitives/Transition/index.cjs +21 -0
  353. package/primitives/Transition/index.cjs.map +7 -0
  354. package/primitives/Transition/index.d.ts +1 -0
  355. package/primitives/Transition/index.js +2 -0
  356. package/primitives/Transition/index.js.map +7 -0
  357. package/primitives/index.cjs +6 -16
  358. package/primitives/index.cjs.map +7 -0
  359. package/primitives/index.d.ts +3 -3
  360. package/primitives/index.js +4 -1
  361. package/primitives/index.js.map +7 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/ui/molecules/Slider/SliderProgress.ts"],
4
+ "sourcesContent": ["import type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';\nimport { transform, map, domScheduler } from '@studiometa/js-toolkit/utils';\nimport { AbstractSliderChild } from './AbstractSliderChild.js';\n\nexport interface SliderProgressProps extends BaseProps {\n $refs: {\n progress: HTMLElement;\n };\n}\n\n/**\n * SliderProgress class.\n */\nexport class SliderProgress<T extends BaseProps = BaseProps> extends AbstractSliderChild<\n T & SliderProgressProps\n> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n name: 'SliderProgress',\n refs: ['progress'],\n };\n\n /**\n * Update the progress indicator.\n */\n update(index:number) {\n domScheduler.read(() => {\n const { progress } = this.$refs;\n const x = map(index, 0, this.$parent.indexMax, progress.clientWidth * -1, 0);\n domScheduler.write(() => {\n transform(progress, { x });\n });\n });\n }\n}\n"],
5
+ "mappings": "AACA,SAAS,WAAW,KAAK,oBAAoB;AAC7C,SAAS,2BAA2B;AAW7B,MAAM,uBAAwD,oBAEnE;AAAA,EAIA,OAAO,SAAqB;AAAA,IAC1B,MAAM;AAAA,IACN,MAAM,CAAC,UAAU;AAAA,EACnB;AAAA,EAKA,OAAO,OAAc;AACnB,iBAAa,KAAK,MAAM;AACtB,YAAM,EAAE,SAAS,IAAI,KAAK;AAC1B,YAAM,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,UAAU,SAAS,cAAc,IAAI,CAAC;AAC3E,mBAAa,MAAM,MAAM;AACvB,kBAAU,UAAU,EAAE,EAAE,CAAC;AAAA,MAC3B,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;",
6
+ "names": []
7
+ }
@@ -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,28 +10,19 @@ 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/molecules/Slider/index.js
16
+ // packages/ui/molecules/Slider/index.ts
23
17
  var Slider_exports = {};
24
- __export(Slider_exports, {
25
- AbstractSliderChild: () => import_AbstractSliderChild.default,
26
- Slider: () => import_Slider.default,
27
- SliderBtn: () => import_SliderBtn.default,
28
- SliderCount: () => import_SliderCount.default,
29
- SliderDots: () => import_SliderDots.default,
30
- SliderDrag: () => import_SliderDrag.default,
31
- SliderItem: () => import_SliderItem.default,
32
- SliderProgress: () => import_SliderProgress.default
33
- });
34
18
  module.exports = __toCommonJS(Slider_exports);
35
- var import_AbstractSliderChild = __toESM(require("./AbstractSliderChild.cjs"), 1);
36
- var import_Slider = __toESM(require("./Slider.cjs"), 1);
37
- var import_SliderBtn = __toESM(require("./SliderBtn.cjs"), 1);
38
- var import_SliderCount = __toESM(require("./SliderCount.cjs"), 1);
39
- var import_SliderDrag = __toESM(require("./SliderDrag.cjs"), 1);
40
- var import_SliderItem = __toESM(require("./SliderItem.cjs"), 1);
41
- var import_SliderProgress = __toESM(require("./SliderProgress.cjs"), 1);
42
- var import_SliderDots = __toESM(require("./SliderDots.cjs"), 1);
19
+ __reExport(Slider_exports, require("./AbstractSliderChild.cjs"), module.exports);
20
+ __reExport(Slider_exports, require("./Slider.cjs"), module.exports);
21
+ __reExport(Slider_exports, require("./SliderBtn.cjs"), module.exports);
22
+ __reExport(Slider_exports, require("./SliderCount.cjs"), module.exports);
23
+ __reExport(Slider_exports, require("./SliderDrag.cjs"), module.exports);
24
+ __reExport(Slider_exports, require("./SliderItem.cjs"), module.exports);
25
+ __reExport(Slider_exports, require("./SliderProgress.cjs"), module.exports);
26
+ __reExport(Slider_exports, require("./SliderDots.cjs"), module.exports);
43
27
  if (module.exports.default) module.exports = module.exports.default;
28
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/ui/molecules/Slider/index.ts"],
4
+ "sourcesContent": ["export * from './AbstractSliderChild.js';\nexport * from './Slider.js';\nexport * from './SliderBtn.js';\nexport * from './SliderCount.js';\nexport * from './SliderDrag.js';\nexport * from './SliderItem.js';\nexport * from './SliderProgress.js';\nexport * from './SliderDots.js';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,2BAAc,sCAAd;AACA,2BAAc,yBADd;AAEA,2BAAc,4BAFd;AAGA,2BAAc,8BAHd;AAIA,2BAAc,6BAJd;AAKA,2BAAc,6BALd;AAMA,2BAAc,iCANd;AAOA,2BAAc,6BAPd;",
6
+ "names": []
7
+ }
@@ -1,8 +1,8 @@
1
- export { default as AbstractSliderChild } from "./AbstractSliderChild.js";
2
- export { default as Slider } from "./Slider.js";
3
- export { default as SliderBtn } from "./SliderBtn.js";
4
- export { default as SliderCount } from "./SliderCount.js";
5
- export { default as SliderDrag } from "./SliderDrag.js";
6
- export { default as SliderItem } from "./SliderItem.js";
7
- export { default as SliderProgress } from "./SliderProgress.js";
8
- export { default as SliderDots } from "./SliderDots.js";
1
+ export * from './AbstractSliderChild.js';
2
+ export * from './Slider.js';
3
+ export * from './SliderBtn.js';
4
+ export * from './SliderCount.js';
5
+ export * from './SliderDrag.js';
6
+ export * from './SliderItem.js';
7
+ export * from './SliderProgress.js';
8
+ export * from './SliderDots.js';
@@ -1 +1,9 @@
1
- import{default as t}from"./AbstractSliderChild.js";import{default as a}from"./Slider.js";import{default as l}from"./SliderBtn.js";import{default as s}from"./SliderCount.js";import{default as m}from"./SliderDrag.js";import{default as p}from"./SliderItem.js";import{default as S}from"./SliderProgress.js";import{default as n}from"./SliderDots.js";export{t as AbstractSliderChild,a as Slider,l as SliderBtn,s as SliderCount,n as SliderDots,m as SliderDrag,p as SliderItem,S as SliderProgress};
1
+ export * from "./AbstractSliderChild.js";
2
+ export * from "./Slider.js";
3
+ export * from "./SliderBtn.js";
4
+ export * from "./SliderCount.js";
5
+ export * from "./SliderDrag.js";
6
+ export * from "./SliderItem.js";
7
+ export * from "./SliderProgress.js";
8
+ export * from "./SliderDots.js";
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/ui/molecules/Slider/index.ts"],
4
+ "sourcesContent": ["export * from './AbstractSliderChild.js';\nexport * from './Slider.js';\nexport * from './SliderBtn.js';\nexport * from './SliderCount.js';\nexport * from './SliderDrag.js';\nexport * from './SliderItem.js';\nexport * from './SliderProgress.js';\nexport * from './SliderDots.js';\n"],
5
+ "mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
6
+ "names": []
7
+ }
@@ -21,10 +21,10 @@ var __publicField = (obj, key, value) => {
21
21
  return value;
22
22
  };
23
23
 
24
- // packages/ui/molecules/Sticky/Sticky.js
24
+ // packages/ui/molecules/Sticky/Sticky.ts
25
25
  var Sticky_exports = {};
26
26
  __export(Sticky_exports, {
27
- default: () => Sticky
27
+ Sticky: () => Sticky
28
28
  });
29
29
  module.exports = __toCommonJS(Sticky_exports);
30
30
  var import_js_toolkit = require("@studiometa/js-toolkit");
@@ -80,8 +80,10 @@ var _Sticky = class extends import_js_toolkit.Base {
80
80
  }
81
81
  setSentinelSize() {
82
82
  const { instances } = this;
83
- const index = instances.findIndex((instance) => instance === this);
84
- const height = instances.slice(0, index).filter((instance) => this.closestRelativeElement(instance.$el).contains(this.$el)).reduce((acc, instance) => acc + instance.$el.offsetHeight, 0);
83
+ const index = instances.indexOf(this);
84
+ const height = instances.slice(0, index).filter(
85
+ (instance) => this.closestRelativeElement(instance.$el).contains(this.$el)
86
+ ).reduce((acc, instance) => acc + instance.$el.offsetHeight, 0);
85
87
  this.$refs.sentinelRef.style.height = `${height + 1}px`;
86
88
  this.$el.style.top = `${height}px`;
87
89
  this.$el.style.zIndex = String(this.$options.zIndex - index);
@@ -92,10 +94,11 @@ var _Sticky = class extends import_js_toolkit.Base {
92
94
  return;
93
95
  }
94
96
  const { instances } = this;
95
- index = index ?? instances.findIndex((instance) => instance === this);
96
- this.y = instances.slice(0, index).filter((instance) => instance.isSticky && !instance.isVisible).reduce((y, instance) => {
97
- return y - instance.$refs.inner.offsetHeight;
98
- }, this.isVisible ? 0 : this.$refs.inner.offsetHeight * -1);
97
+ index = index ?? instances.indexOf(this);
98
+ this.y = instances.slice(0, index).filter((instance) => instance.isSticky && !instance.isVisible).reduce(
99
+ (y, instance) => y - instance.$refs.inner.offsetHeight,
100
+ this.isVisible ? 0 : this.$refs.inner.offsetHeight * -1
101
+ );
99
102
  }
100
103
  closestRelativeElement(element) {
101
104
  let parent = element.parentElement;
@@ -123,3 +126,4 @@ __publicField(Sticky, "config", {
123
126
  });
124
127
  __publicField(Sticky, "instances", /* @__PURE__ */ new Set());
125
128
  if (module.exports.default) module.exports = module.exports.default;
129
+ //# sourceMappingURL=Sticky.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/ui/molecules/Sticky/Sticky.ts"],
4
+ "sourcesContent": ["import { Base } from '@studiometa/js-toolkit';\nimport type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';\nimport { Sentinel } from '../../primitives/index.js';\n\n/**\n * @typedef {Object} StickyRefs\n * @property {HTMLElement} inner\n * @property {HTMLElement} sentinelRef\n */\n\n/**\n * @typedef {Object} StickyPrivateInterface\n * @property {StickyRefs} $refs\n * @property {{ zIndex: number, hideWhenUp: boolean, hideWhenDown: boolean }} $options\n * @property {{ Sentinel: Sentinel[] }} $children\n */\n\nexport interface StickyProps extends BaseProps {\n $refs: {\n inner: HTMLElement;\n sentinelRef: HTMLElement;\n };\n $options: {\n zIndex: number;\n hideWhenUp: boolean;\n hideWhenDown: boolean;\n };\n $children: {\n Sentinel: Sentinel[];\n };\n}\n\n/**\n * Sticky class.\n */\nexport class Sticky<T extends BaseProps = BaseProps> extends Base<T & StickyProps> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n name: 'Sticky',\n refs: ['inner', 'sentinelRef'],\n components: {\n Sentinel,\n },\n options: {\n zIndex: {\n type: Number,\n default: 100,\n },\n hideWhenUp: Boolean,\n hideWhenDown: Boolean,\n },\n };\n\n /**\n * Holder for all instances.\n */\n // eslint-disable-next-line no-use-before-define\n static instances: Set<Sticky> = new Set();\n\n /**\n * Is the component sticky?\n */\n isSticky = false;\n\n /**\n * Is the component visible?\n */\n isVisible = true;\n\n /**\n * Set the Y value.\n */\n set y(value: number) {\n this.$refs.inner.style.transform = `translateY(${value}px) translateZ(0px)`;\n }\n\n /**\n * Get instances as array.\n */\n get instances(): Sticky[] {\n return Array.from(Sticky.instances);\n }\n\n /**\n * Mounted hook.\n */\n mounted() {\n Sticky.instances.add(this);\n this.setSentinelSize();\n }\n\n /**\n * Resized hook.\n */\n resized() {\n this.setSentinelSize();\n }\n\n /**\n * Destroyed hook.\n */\n destroyed() {\n Sticky.instances.delete(this);\n }\n\n /**\n * Scrolled hook.\n */\n scrolled(props) {\n if (!this.isSticky || props.y === props.last.y) {\n return;\n }\n\n if (\n (props.direction.y === 'DOWN' && this.$options.hideWhenDown) ||\n (props.direction.y === 'UP' && this.$options.hideWhenUp)\n ) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n /**\n * Listen to the sentinel's `intersected` event to set the `isSticky` value.\n *\n * @param {IntersectionObserverEntry[]} entries\n * @returns {void}\n */\n onSentinelIntersected([entry]: IntersectionObserverEntry[]) {\n this.isSticky = entry.isIntersecting && entry.boundingClientRect.y < 0;\n this.setPosition();\n }\n\n /**\n * Hide the sticky component when another one is sticky.\n */\n hide() {\n if (!this.isVisible) {\n return;\n }\n\n this.isVisible = false;\n this.$el.classList.add('pointer-events-none');\n\n this.instances.forEach((instance, index) => instance.setPosition(index));\n }\n\n /**\n * Show the sticky component when the other one is not sticky anymore.\n */\n show() {\n if (this.isVisible) {\n return;\n }\n\n this.isVisible = true;\n this.$el.classList.remove('pointer-events-none');\n this.instances.forEach((instance, index) => instance.setPosition(index));\n }\n\n /**\n * Set the sentinel height based on the previous instances.\n */\n setSentinelSize() {\n const { instances } = this;\n const index = instances.indexOf(this);\n const height = instances\n .slice(0, index)\n .filter(\n // Test each instance sticky context against the current element\n (instance) => this.closestRelativeElement(instance.$el).contains(this.$el),\n )\n .reduce((acc, instance) => acc + instance.$el.offsetHeight, 0);\n\n this.$refs.sentinelRef.style.height = `${height + 1}px`;\n this.$el.style.top = `${height}px`;\n this.$el.style.zIndex = String(this.$options.zIndex - index);\n }\n\n /**\n * Set the component's position.\n *\n * @param {number} [index] The instance index in all the pages' instances.\n * @returns {void}\n */\n setPosition(index?: number) {\n if (!this.isSticky) {\n this.y = 0;\n return;\n }\n\n const { instances } = this;\n\n // eslint-disable-next-line no-param-reassign\n index = index ?? instances.indexOf(this);\n\n this.y = (instances\n .slice(0, index)\n .filter((instance) => instance.isSticky && !instance.isVisible)\n .reduce<number>(\n (y: number, instance) => y - instance.$refs.inner.offsetHeight,\n this.isVisible ? 0 : this.$refs.inner.offsetHeight * -1,\n )) as number;\n }\n\n /**\n * Find the first parent which has a relative position.\n */\n closestRelativeElement(element:HTMLElement) {\n let parent = element.parentElement;\n\n while (getComputedStyle(parent).position !== 'relative' && parent.parentElement) {\n parent = parent.parentElement;\n }\n\n return parent;\n }\n}\n"],
5
+ "mappings": "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",
6
+ "names": []
7
+ }
@@ -1,3 +1,6 @@
1
+ import { Base } from '@studiometa/js-toolkit';
2
+ import type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';
3
+ import { Sentinel } from '../../primitives/index.js';
1
4
  /**
2
5
  * @typedef {Object} StickyRefs
3
6
  * @property {HTMLElement} inner
@@ -9,80 +12,64 @@
9
12
  * @property {{ zIndex: number, hideWhenUp: boolean, hideWhenDown: boolean }} $options
10
13
  * @property {{ Sentinel: Sentinel[] }} $children
11
14
  */
12
- /**
13
- * @typedef {Sticky & StickyPrivateInterface} StickyInterface
14
- */
15
+ export interface StickyProps extends BaseProps {
16
+ $refs: {
17
+ inner: HTMLElement;
18
+ sentinelRef: HTMLElement;
19
+ };
20
+ $options: {
21
+ zIndex: number;
22
+ hideWhenUp: boolean;
23
+ hideWhenDown: boolean;
24
+ };
25
+ $children: {
26
+ Sentinel: Sentinel[];
27
+ };
28
+ }
15
29
  /**
16
30
  * Sticky class.
17
31
  */
18
- export default class Sticky extends Base {
32
+ export declare class Sticky<T extends BaseProps = BaseProps> extends Base<T & StickyProps> {
19
33
  /**
20
34
  * Config.
21
35
  */
22
- static config: {
23
- name: string;
24
- refs: string[];
25
- components: {
26
- Sentinel: typeof Sentinel;
27
- };
28
- options: {
29
- zIndex: {
30
- type: NumberConstructor;
31
- default: number;
32
- };
33
- hideWhenUp: BooleanConstructor;
34
- hideWhenDown: BooleanConstructor;
35
- };
36
- };
36
+ static config: BaseConfig;
37
37
  /**
38
38
  * Holder for all instances.
39
- * @type {Set<StickyInterface>}
40
39
  */
41
- static instances: Set<StickyInterface>;
40
+ static instances: Set<Sticky>;
42
41
  /**
43
42
  * Is the component sticky?
44
- * @type {boolean}
45
43
  */
46
44
  isSticky: boolean;
47
45
  /**
48
46
  * Is the component visible?
49
- * @type {Boolean}
50
47
  */
51
48
  isVisible: boolean;
52
49
  /**
53
50
  * Set the Y value.
54
- *
55
- * @this {StickyInterface}
56
- * @param {number} value
57
- * @returns {void}
58
51
  */
59
- set y(arg: number);
52
+ set y(value: number);
60
53
  /**
61
54
  * Get instances as array.
62
- * @return {Array<StickyInterface>}
63
55
  */
64
- get instances(): StickyInterface[];
56
+ get instances(): Sticky[];
65
57
  /**
66
58
  * Mounted hook.
67
- * @this {StickyInterface}
68
59
  */
69
- mounted(this: StickyInterface): void;
60
+ mounted(): void;
70
61
  /**
71
62
  * Resized hook.
72
- * @this {StickyInterface}
73
- * @returns {void}
74
63
  */
75
- resized(this: StickyInterface): void;
64
+ resized(): void;
76
65
  /**
77
66
  * Destroyed hook.
78
- * @this {StickyInterface}
79
67
  */
80
- destroyed(this: StickyInterface): void;
68
+ destroyed(): void;
81
69
  /**
82
70
  * Scrolled hook.
83
- * @this {StickyInterface}
84
71
  */
85
- scrolled(this: StickyInterface, props: any): void;
72
+ scrolled(props: any): void;
86
73
  /**
87
74
  * Listen to the sentinel's `intersected` event to set the `isSticky` value.
88
75
  *
@@ -92,50 +79,25 @@ export default class Sticky extends Base {
92
79
  onSentinelIntersected([entry]: IntersectionObserverEntry[]): void;
93
80
  /**
94
81
  * Hide the sticky component when another one is sticky.
95
- * @this {StickyInterface}
96
82
  */
97
- hide(this: StickyInterface): void;
83
+ hide(): void;
98
84
  /**
99
85
  * Show the sticky component when the other one is not sticky anymore.
100
- * @this {StickyInterface}
101
86
  */
102
- show(this: StickyInterface): void;
87
+ show(): void;
103
88
  /**
104
89
  * Set the sentinel height based on the previous instances.
105
- * @this {StickyInterface}
106
90
  */
107
- setSentinelSize(this: StickyInterface): void;
91
+ setSentinelSize(): void;
108
92
  /**
109
93
  * Set the component's position.
110
94
  *
111
- * @this {StickyInterface}
112
95
  * @param {number} [index] The instance index in all the pages' instances.
113
96
  * @returns {void}
114
97
  */
115
- setPosition(this: StickyInterface, index?: number): void;
98
+ setPosition(index?: number): void;
116
99
  /**
117
100
  * Find the first parent which has a relative position.
118
- *
119
- * @param {HTMLElement} element
120
- * @returns {HTMLElement}
121
101
  */
122
102
  closestRelativeElement(element: HTMLElement): HTMLElement;
123
103
  }
124
- export type StickyRefs = {
125
- inner: HTMLElement;
126
- sentinelRef: HTMLElement;
127
- };
128
- export type StickyPrivateInterface = {
129
- $refs: StickyRefs;
130
- $options: {
131
- zIndex: number;
132
- hideWhenUp: boolean;
133
- hideWhenDown: boolean;
134
- };
135
- $children: {
136
- Sentinel: Sentinel[];
137
- };
138
- };
139
- export type StickyInterface = Sticky & StickyPrivateInterface;
140
- import { Base } from "@studiometa/js-toolkit";
141
- import { Sentinel } from "../../primitives/index.js";
@@ -1 +1,101 @@
1
- import{Base as o}from"@studiometa/js-toolkit";import{Sentinel as h}from"../../primitives/index.js";class n extends o{static config={name:"Sticky",refs:["inner","sentinelRef"],components:{Sentinel:h},options:{zIndex:{type:Number,default:100},hideWhenUp:Boolean,hideWhenDown:Boolean}};static instances=new Set;isSticky=!1;isVisible=!0;set y(e){this.$refs.inner.style.transform=`translateY(${e}px) translateZ(0px)`}get instances(){return Array.from(n.instances)}mounted(){n.instances.add(this),this.setSentinelSize()}resized(){this.setSentinelSize()}destroyed(){n.instances.delete(this)}scrolled(e){!this.isSticky||e.y===e.last.y||(e.direction.y==="DOWN"&&this.$options.hideWhenDown||e.direction.y==="UP"&&this.$options.hideWhenUp?this.hide():this.show())}onSentinelIntersected([e]){this.isSticky=e.isIntersecting&&e.boundingClientRect.y<0,this.setPosition()}hide(){!this.isVisible||(this.isVisible=!1,this.$el.classList.add("pointer-events-none"),this.instances.forEach((e,t)=>e.setPosition(t)))}show(){this.isVisible||(this.isVisible=!0,this.$el.classList.remove("pointer-events-none"),this.instances.forEach((e,t)=>e.setPosition(t)))}setSentinelSize(){const{instances:e}=this,t=e.findIndex(s=>s===this),i=e.slice(0,t).filter(s=>this.closestRelativeElement(s.$el).contains(this.$el)).reduce((s,l)=>s+l.$el.offsetHeight,0);this.$refs.sentinelRef.style.height=`${i+1}px`,this.$el.style.top=`${i}px`,this.$el.style.zIndex=String(this.$options.zIndex-t)}setPosition(e){if(!this.isSticky){this.y=0;return}const{instances:t}=this;e=e??t.findIndex(i=>i===this),this.y=t.slice(0,e).filter(i=>i.isSticky&&!i.isVisible).reduce((i,s)=>i-s.$refs.inner.offsetHeight,this.isVisible?0:this.$refs.inner.offsetHeight*-1)}closestRelativeElement(e){let t=e.parentElement;for(;getComputedStyle(t).position!=="relative"&&t.parentElement;)t=t.parentElement;return t}}export{n as default};
1
+ import { Base } from "@studiometa/js-toolkit";
2
+ import { Sentinel } from "../../primitives/index.js";
3
+ class Sticky extends Base {
4
+ static config = {
5
+ name: "Sticky",
6
+ refs: ["inner", "sentinelRef"],
7
+ components: {
8
+ Sentinel
9
+ },
10
+ options: {
11
+ zIndex: {
12
+ type: Number,
13
+ default: 100
14
+ },
15
+ hideWhenUp: Boolean,
16
+ hideWhenDown: Boolean
17
+ }
18
+ };
19
+ static instances = /* @__PURE__ */ new Set();
20
+ isSticky = false;
21
+ isVisible = true;
22
+ set y(value) {
23
+ this.$refs.inner.style.transform = `translateY(${value}px) translateZ(0px)`;
24
+ }
25
+ get instances() {
26
+ return Array.from(Sticky.instances);
27
+ }
28
+ mounted() {
29
+ Sticky.instances.add(this);
30
+ this.setSentinelSize();
31
+ }
32
+ resized() {
33
+ this.setSentinelSize();
34
+ }
35
+ destroyed() {
36
+ Sticky.instances.delete(this);
37
+ }
38
+ scrolled(props) {
39
+ if (!this.isSticky || props.y === props.last.y) {
40
+ return;
41
+ }
42
+ if (props.direction.y === "DOWN" && this.$options.hideWhenDown || props.direction.y === "UP" && this.$options.hideWhenUp) {
43
+ this.hide();
44
+ } else {
45
+ this.show();
46
+ }
47
+ }
48
+ onSentinelIntersected([entry]) {
49
+ this.isSticky = entry.isIntersecting && entry.boundingClientRect.y < 0;
50
+ this.setPosition();
51
+ }
52
+ hide() {
53
+ if (!this.isVisible) {
54
+ return;
55
+ }
56
+ this.isVisible = false;
57
+ this.$el.classList.add("pointer-events-none");
58
+ this.instances.forEach((instance, index) => instance.setPosition(index));
59
+ }
60
+ show() {
61
+ if (this.isVisible) {
62
+ return;
63
+ }
64
+ this.isVisible = true;
65
+ this.$el.classList.remove("pointer-events-none");
66
+ this.instances.forEach((instance, index) => instance.setPosition(index));
67
+ }
68
+ setSentinelSize() {
69
+ const { instances } = this;
70
+ const index = instances.indexOf(this);
71
+ const height = instances.slice(0, index).filter(
72
+ (instance) => this.closestRelativeElement(instance.$el).contains(this.$el)
73
+ ).reduce((acc, instance) => acc + instance.$el.offsetHeight, 0);
74
+ this.$refs.sentinelRef.style.height = `${height + 1}px`;
75
+ this.$el.style.top = `${height}px`;
76
+ this.$el.style.zIndex = String(this.$options.zIndex - index);
77
+ }
78
+ setPosition(index) {
79
+ if (!this.isSticky) {
80
+ this.y = 0;
81
+ return;
82
+ }
83
+ const { instances } = this;
84
+ index = index ?? instances.indexOf(this);
85
+ this.y = instances.slice(0, index).filter((instance) => instance.isSticky && !instance.isVisible).reduce(
86
+ (y, instance) => y - instance.$refs.inner.offsetHeight,
87
+ this.isVisible ? 0 : this.$refs.inner.offsetHeight * -1
88
+ );
89
+ }
90
+ closestRelativeElement(element) {
91
+ let parent = element.parentElement;
92
+ while (getComputedStyle(parent).position !== "relative" && parent.parentElement) {
93
+ parent = parent.parentElement;
94
+ }
95
+ return parent;
96
+ }
97
+ }
98
+ export {
99
+ Sticky
100
+ };
101
+ //# sourceMappingURL=Sticky.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/ui/molecules/Sticky/Sticky.ts"],
4
+ "sourcesContent": ["import { Base } from '@studiometa/js-toolkit';\nimport type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';\nimport { Sentinel } from '../../primitives/index.js';\n\n/**\n * @typedef {Object} StickyRefs\n * @property {HTMLElement} inner\n * @property {HTMLElement} sentinelRef\n */\n\n/**\n * @typedef {Object} StickyPrivateInterface\n * @property {StickyRefs} $refs\n * @property {{ zIndex: number, hideWhenUp: boolean, hideWhenDown: boolean }} $options\n * @property {{ Sentinel: Sentinel[] }} $children\n */\n\nexport interface StickyProps extends BaseProps {\n $refs: {\n inner: HTMLElement;\n sentinelRef: HTMLElement;\n };\n $options: {\n zIndex: number;\n hideWhenUp: boolean;\n hideWhenDown: boolean;\n };\n $children: {\n Sentinel: Sentinel[];\n };\n}\n\n/**\n * Sticky class.\n */\nexport class Sticky<T extends BaseProps = BaseProps> extends Base<T & StickyProps> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n name: 'Sticky',\n refs: ['inner', 'sentinelRef'],\n components: {\n Sentinel,\n },\n options: {\n zIndex: {\n type: Number,\n default: 100,\n },\n hideWhenUp: Boolean,\n hideWhenDown: Boolean,\n },\n };\n\n /**\n * Holder for all instances.\n */\n // eslint-disable-next-line no-use-before-define\n static instances: Set<Sticky> = new Set();\n\n /**\n * Is the component sticky?\n */\n isSticky = false;\n\n /**\n * Is the component visible?\n */\n isVisible = true;\n\n /**\n * Set the Y value.\n */\n set y(value: number) {\n this.$refs.inner.style.transform = `translateY(${value}px) translateZ(0px)`;\n }\n\n /**\n * Get instances as array.\n */\n get instances(): Sticky[] {\n return Array.from(Sticky.instances);\n }\n\n /**\n * Mounted hook.\n */\n mounted() {\n Sticky.instances.add(this);\n this.setSentinelSize();\n }\n\n /**\n * Resized hook.\n */\n resized() {\n this.setSentinelSize();\n }\n\n /**\n * Destroyed hook.\n */\n destroyed() {\n Sticky.instances.delete(this);\n }\n\n /**\n * Scrolled hook.\n */\n scrolled(props) {\n if (!this.isSticky || props.y === props.last.y) {\n return;\n }\n\n if (\n (props.direction.y === 'DOWN' && this.$options.hideWhenDown) ||\n (props.direction.y === 'UP' && this.$options.hideWhenUp)\n ) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n /**\n * Listen to the sentinel's `intersected` event to set the `isSticky` value.\n *\n * @param {IntersectionObserverEntry[]} entries\n * @returns {void}\n */\n onSentinelIntersected([entry]: IntersectionObserverEntry[]) {\n this.isSticky = entry.isIntersecting && entry.boundingClientRect.y < 0;\n this.setPosition();\n }\n\n /**\n * Hide the sticky component when another one is sticky.\n */\n hide() {\n if (!this.isVisible) {\n return;\n }\n\n this.isVisible = false;\n this.$el.classList.add('pointer-events-none');\n\n this.instances.forEach((instance, index) => instance.setPosition(index));\n }\n\n /**\n * Show the sticky component when the other one is not sticky anymore.\n */\n show() {\n if (this.isVisible) {\n return;\n }\n\n this.isVisible = true;\n this.$el.classList.remove('pointer-events-none');\n this.instances.forEach((instance, index) => instance.setPosition(index));\n }\n\n /**\n * Set the sentinel height based on the previous instances.\n */\n setSentinelSize() {\n const { instances } = this;\n const index = instances.indexOf(this);\n const height = instances\n .slice(0, index)\n .filter(\n // Test each instance sticky context against the current element\n (instance) => this.closestRelativeElement(instance.$el).contains(this.$el),\n )\n .reduce((acc, instance) => acc + instance.$el.offsetHeight, 0);\n\n this.$refs.sentinelRef.style.height = `${height + 1}px`;\n this.$el.style.top = `${height}px`;\n this.$el.style.zIndex = String(this.$options.zIndex - index);\n }\n\n /**\n * Set the component's position.\n *\n * @param {number} [index] The instance index in all the pages' instances.\n * @returns {void}\n */\n setPosition(index?: number) {\n if (!this.isSticky) {\n this.y = 0;\n return;\n }\n\n const { instances } = this;\n\n // eslint-disable-next-line no-param-reassign\n index = index ?? instances.indexOf(this);\n\n this.y = (instances\n .slice(0, index)\n .filter((instance) => instance.isSticky && !instance.isVisible)\n .reduce<number>(\n (y: number, instance) => y - instance.$refs.inner.offsetHeight,\n this.isVisible ? 0 : this.$refs.inner.offsetHeight * -1,\n )) as number;\n }\n\n /**\n * Find the first parent which has a relative position.\n */\n closestRelativeElement(element:HTMLElement) {\n let parent = element.parentElement;\n\n while (getComputedStyle(parent).position !== 'relative' && parent.parentElement) {\n parent = parent.parentElement;\n }\n\n return parent;\n }\n}\n"],
5
+ "mappings": "AAAA,SAAS,YAAY;AAErB,SAAS,gBAAgB;AAiClB,MAAM,eAAgD,KAAsB;AAAA,EAIjF,OAAO,SAAqB;AAAA,IAC1B,MAAM;AAAA,IACN,MAAM,CAAC,SAAS,aAAa;AAAA,IAC7B,YAAY;AAAA,MACV;AAAA,IACF;AAAA,IACA,SAAS;AAAA,MACP,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,MACX;AAAA,MACA,YAAY;AAAA,MACZ,cAAc;AAAA,IAChB;AAAA,EACF;AAAA,EAMA,OAAO,YAAyB,oBAAI,IAAI;AAAA,EAKxC,WAAW;AAAA,EAKX,YAAY;AAAA,EAKZ,IAAI,EAAE,OAAe;AACnB,SAAK,MAAM,MAAM,MAAM,YAAY,cAAc;AAAA,EACnD;AAAA,EAKA,IAAI,YAAsB;AACxB,WAAO,MAAM,KAAK,OAAO,SAAS;AAAA,EACpC;AAAA,EAKA,UAAU;AACR,WAAO,UAAU,IAAI,IAAI;AACzB,SAAK,gBAAgB;AAAA,EACvB;AAAA,EAKA,UAAU;AACR,SAAK,gBAAgB;AAAA,EACvB;AAAA,EAKA,YAAY;AACV,WAAO,UAAU,OAAO,IAAI;AAAA,EAC9B;AAAA,EAKA,SAAS,OAAO;AACd,QAAI,CAAC,KAAK,YAAY,MAAM,MAAM,MAAM,KAAK,GAAG;AAC9C;AAAA,IACF;AAEA,QACG,MAAM,UAAU,MAAM,UAAU,KAAK,SAAS,gBAC9C,MAAM,UAAU,MAAM,QAAQ,KAAK,SAAS,YAC7C;AACA,WAAK,KAAK;AAAA,IACZ,OAAO;AACL,WAAK,KAAK;AAAA,IACZ;AAAA,EACF;AAAA,EAQA,sBAAsB,CAAC,KAAK,GAAgC;AAC1D,SAAK,WAAW,MAAM,kBAAkB,MAAM,mBAAmB,IAAI;AACrE,SAAK,YAAY;AAAA,EACnB;AAAA,EAKA,OAAO;AACL,QAAI,CAAC,KAAK,WAAW;AACnB;AAAA,IACF;AAEA,SAAK,YAAY;AACjB,SAAK,IAAI,UAAU,IAAI,qBAAqB;AAE5C,SAAK,UAAU,QAAQ,CAAC,UAAU,UAAU,SAAS,YAAY,KAAK,CAAC;AAAA,EACzE;AAAA,EAKA,OAAO;AACL,QAAI,KAAK,WAAW;AAClB;AAAA,IACF;AAEA,SAAK,YAAY;AACjB,SAAK,IAAI,UAAU,OAAO,qBAAqB;AAC/C,SAAK,UAAU,QAAQ,CAAC,UAAU,UAAU,SAAS,YAAY,KAAK,CAAC;AAAA,EACzE;AAAA,EAKA,kBAAkB;AAChB,UAAM,EAAE,UAAU,IAAI;AACtB,UAAM,QAAQ,UAAU,QAAQ,IAAI;AACpC,UAAM,SAAS,UACZ,MAAM,GAAG,KAAK,EACd;AAAA,MAEC,CAAC,aAAa,KAAK,uBAAuB,SAAS,GAAG,EAAE,SAAS,KAAK,GAAG;AAAA,IAC3E,EACC,OAAO,CAAC,KAAK,aAAa,MAAM,SAAS,IAAI,cAAc,CAAC;AAE/D,SAAK,MAAM,YAAY,MAAM,SAAS,GAAG,SAAS;AAClD,SAAK,IAAI,MAAM,MAAM,GAAG;AACxB,SAAK,IAAI,MAAM,SAAS,OAAO,KAAK,SAAS,SAAS,KAAK;AAAA,EAC7D;AAAA,EAQA,YAAY,OAAgB;AAC1B,QAAI,CAAC,KAAK,UAAU;AAClB,WAAK,IAAI;AACT;AAAA,IACF;AAEA,UAAM,EAAE,UAAU,IAAI;AAGtB,YAAQ,SAAS,UAAU,QAAQ,IAAI;AAEvC,SAAK,IAAK,UACP,MAAM,GAAG,KAAK,EACd,OAAO,CAAC,aAAa,SAAS,YAAY,CAAC,SAAS,SAAS,EAC7D;AAAA,MACC,CAAC,GAAW,aAAa,IAAI,SAAS,MAAM,MAAM;AAAA,MAClD,KAAK,YAAY,IAAI,KAAK,MAAM,MAAM,eAAe;AAAA,IACvD;AAAA,EACJ;AAAA,EAKA,uBAAuB,SAAqB;AAC1C,QAAI,SAAS,QAAQ;AAErB,WAAO,iBAAiB,MAAM,EAAE,aAAa,cAAc,OAAO,eAAe;AAC/E,eAAS,OAAO;AAAA,IAClB;AAEA,WAAO;AAAA,EACT;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,21 @@
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/molecules/Sticky/index.ts
17
+ var Sticky_exports = {};
18
+ module.exports = __toCommonJS(Sticky_exports);
19
+ __reExport(Sticky_exports, require("./Sticky.cjs"), module.exports);
20
+ if (module.exports.default) module.exports = module.exports.default;
21
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/ui/molecules/Sticky/index.ts"],
4
+ "sourcesContent": ["export * from './Sticky.js';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,2BAAc,yBAAd;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ export * from './Sticky.js';
@@ -0,0 +1,2 @@
1
+ export * from "./Sticky.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/ui/molecules/Sticky/index.ts"],
4
+ "sourcesContent": ["export * from './Sticky.js';\n"],
5
+ "mappings": "AAAA,cAAc;",
6
+ "names": []
7
+ }
@@ -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,21 +15,20 @@ 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/molecules/TableOfContent/TableOfContent.js
24
+ // packages/ui/molecules/TableOfContent/TableOfContent.ts
28
25
  var TableOfContent_exports = {};
29
26
  __export(TableOfContent_exports, {
30
- default: () => TableOfContent
27
+ TableOfContent: () => TableOfContent
31
28
  });
32
29
  module.exports = __toCommonJS(TableOfContent_exports);
33
30
  var import_js_toolkit = require("@studiometa/js-toolkit");
34
- var import_TableOfContentAnchor = __toESM(require("./TableOfContentAnchor.cjs"), 1);
31
+ var import_TableOfContentAnchor = require("./TableOfContentAnchor.cjs");
35
32
  var TableOfContent = class extends import_js_toolkit.Base {
36
33
  mounted() {
37
34
  if (this.$options.withTemplate) {
@@ -48,7 +45,7 @@ var TableOfContent = class extends import_js_toolkit.Base {
48
45
  anchor.href = `#${section.id}`;
49
46
  anchor.innerHTML = section.textContent;
50
47
  anchor.dataset.component = "TableOfContentAnchor";
51
- this.$refs.list.appendChild(li);
48
+ this.$refs.list.append(li);
52
49
  });
53
50
  }
54
51
  };
@@ -56,7 +53,7 @@ __publicField(TableOfContent, "config", {
56
53
  name: "TableOfContent",
57
54
  refs: ["itemTemplate", "list"],
58
55
  components: {
59
- TableOfContentAnchor: import_TableOfContentAnchor.default
56
+ TableOfContentAnchor: import_TableOfContentAnchor.TableOfContentAnchor
60
57
  },
61
58
  options: {
62
59
  contentSelector: String,
@@ -64,3 +61,4 @@ __publicField(TableOfContent, "config", {
64
61
  }
65
62
  });
66
63
  if (module.exports.default) module.exports = module.exports.default;
64
+ //# sourceMappingURL=TableOfContent.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/ui/molecules/TableOfContent/TableOfContent.ts"],
4
+ "sourcesContent": ["import { Base } from '@studiometa/js-toolkit';\nimport type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';\nimport { TableOfContentAnchor } from './TableOfContentAnchor.js';\n\nexport interface TableOfContentProps extends BaseProps {\n $refs: {\n itemTemplate: HTMLTemplateElement;\n list: HTMLUListElement;\n };\n $options: {\n contentSelector: string;\n withTemplate: boolean;\n };\n $children: {\n TableOfContentAnchor: TableOfContentAnchor[];\n };\n}\n\n/**\n * TableOfContent class.\n */\nexport class TableOfContent<T extends BaseProps = BaseProps> extends Base<T & TableOfContentProps> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n name: 'TableOfContent',\n refs: ['itemTemplate', 'list'],\n components: {\n TableOfContentAnchor,\n },\n options: {\n contentSelector: String,\n withTemplate: Boolean,\n },\n };\n\n /**\n * Generate anchors on mount and update the component to instantiate the\n * `TableOfContentAnchor` components.\n */\n mounted() {\n if (this.$options.withTemplate) {\n this.generateAnchors();\n this.$update();\n }\n }\n\n /**\n * Generate all anchors.\n *\n * @todo Read anchor template from a ref?\n * @todo Better API to easily override the template function, maybe a `render` function?\n */\n generateAnchors() {\n document.querySelectorAll(this.$options.contentSelector).forEach((section) => {\n const tpl = document.createElement('div');\n tpl.innerHTML = this.$refs.itemTemplate.innerHTML;\n const li = tpl.querySelector('li');\n const anchor = li.querySelector('a');\n anchor.href = `#${section.id}`;\n anchor.innerHTML = section.textContent;\n anchor.dataset.component = 'TableOfContentAnchor';\n this.$refs.list.append(li);\n });\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAqB;AAErB,kCAAqC;AAmB9B,IAAM,iBAAN,cAA8D,uBAA8B;AAAA,EAoBjG,UAAU;AACR,QAAI,KAAK,SAAS,cAAc;AAC9B,WAAK,gBAAgB;AACrB,WAAK,QAAQ;AAAA,IACf;AAAA,EACF;AAAA,EAQA,kBAAkB;AAChB,aAAS,iBAAiB,KAAK,SAAS,eAAe,EAAE,QAAQ,CAAC,YAAY;AAC5E,YAAM,MAAM,SAAS,cAAc,KAAK;AACxC,UAAI,YAAY,KAAK,MAAM,aAAa;AACxC,YAAM,KAAK,IAAI,cAAc,IAAI;AACjC,YAAM,SAAS,GAAG,cAAc,GAAG;AACnC,aAAO,OAAO,IAAI,QAAQ;AAC1B,aAAO,YAAY,QAAQ;AAC3B,aAAO,QAAQ,YAAY;AAC3B,WAAK,MAAM,KAAK,OAAO,EAAE;AAAA,IAC3B,CAAC;AAAA,EACH;AACF;AAzCE,cAJW,gBAIJ,UAAqB;AAAA,EAC1B,MAAM;AAAA,EACN,MAAM,CAAC,gBAAgB,MAAM;AAAA,EAC7B,YAAY;AAAA,IACV;AAAA,EACF;AAAA,EACA,SAAS;AAAA,IACP,iBAAiB;AAAA,IACjB,cAAc;AAAA,EAChB;AACF;",
6
+ "names": []
7
+ }