@hortonstudio/main 1.2.4 → 1.2.6

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 (481) hide show
  1. package/attributes-master/.changeset/README.md +8 -0
  2. package/attributes-master/.changeset/config.json +11 -0
  3. package/attributes-master/.gitattributes +2 -0
  4. package/attributes-master/.github/ISSUE_TEMPLATE/bug_report.md +42 -0
  5. package/attributes-master/.github/ISSUE_TEMPLATE/feature_request.md +22 -0
  6. package/attributes-master/.github/workflows/ci.yml +66 -0
  7. package/attributes-master/.github/workflows/release.yml +40 -0
  8. package/attributes-master/.prettierignore +3 -0
  9. package/attributes-master/.prettierrc +8 -0
  10. package/attributes-master/.vscode/extensions.json +3 -0
  11. package/attributes-master/.vscode/settings.json +7 -0
  12. package/attributes-master/CONTRIBUTING.md +72 -0
  13. package/attributes-master/LICENSE.md +201 -0
  14. package/attributes-master/README.md +31 -0
  15. package/attributes-master/eslint.config.js +3 -0
  16. package/attributes-master/package.json +34 -0
  17. package/attributes-master/packages/accordion/CHANGELOG.md +89 -0
  18. package/attributes-master/packages/accordion/README.md +31 -0
  19. package/attributes-master/packages/accordion/package.json +25 -0
  20. package/attributes-master/packages/accordion/src/actions/a11y.ts +39 -0
  21. package/attributes-master/packages/accordion/src/actions/classes.ts +27 -0
  22. package/attributes-master/packages/accordion/src/actions/content.ts +42 -0
  23. package/attributes-master/packages/accordion/src/actions/list.ts +36 -0
  24. package/attributes-master/packages/accordion/src/actions/query.ts +27 -0
  25. package/attributes-master/packages/accordion/src/actions/settings.ts +61 -0
  26. package/attributes-master/packages/accordion/src/factory.ts +145 -0
  27. package/attributes-master/packages/accordion/src/index.ts +3 -0
  28. package/attributes-master/packages/accordion/src/init.ts +37 -0
  29. package/attributes-master/packages/accordion/src/utils/constants.ts +62 -0
  30. package/attributes-master/packages/accordion/src/utils/helpers.ts +5 -0
  31. package/attributes-master/packages/accordion/src/utils/selectors.ts +12 -0
  32. package/attributes-master/packages/accordion/src/utils/types.ts +23 -0
  33. package/attributes-master/packages/accordion/tsconfig.json +3 -0
  34. package/attributes-master/packages/attributes/CHANGELOG.md +564 -0
  35. package/attributes-master/packages/attributes/README.md +66 -0
  36. package/attributes-master/packages/attributes/bin/build.ts +107 -0
  37. package/attributes-master/packages/attributes/bin/live-reload.js +1 -0
  38. package/attributes-master/packages/attributes/package.json +77 -0
  39. package/attributes-master/packages/attributes/playwright.config.ts +89 -0
  40. package/attributes-master/packages/attributes/src/attributes.ts +153 -0
  41. package/attributes-master/packages/attributes/src/load.ts +125 -0
  42. package/attributes-master/packages/attributes/tests/accordion.spec.ts +137 -0
  43. package/attributes-master/packages/attributes/tests/codehighlight.spec.ts +23 -0
  44. package/attributes-master/packages/attributes/tests/combobox.spec.ts +321 -0
  45. package/attributes-master/packages/attributes/tests/copyclip.spec.ts +19 -0
  46. package/attributes-master/packages/attributes/tests/displayvalues.spec.ts +48 -0
  47. package/attributes-master/packages/attributes/tests/favcustom.spec.ts +23 -0
  48. package/attributes-master/packages/attributes/tests/inject.spec.ts +40 -0
  49. package/attributes-master/packages/attributes/tests/inputactive.spec.ts +77 -0
  50. package/attributes-master/packages/attributes/tests/inputcounter.spec.ts +83 -0
  51. package/attributes-master/packages/attributes/tests/list.spec.ts +800 -0
  52. package/attributes-master/packages/attributes/tests/mirrorclick.spec.ts +22 -0
  53. package/attributes-master/packages/attributes/tests/mirrorinput.spec.ts +37 -0
  54. package/attributes-master/packages/attributes/tests/modal.spec.ts +34 -0
  55. package/attributes-master/packages/attributes/tests/numbercount.spec.ts +40 -0
  56. package/attributes-master/packages/attributes/tests/readtime.spec.ts +19 -0
  57. package/attributes-master/packages/attributes/tests/selectcustom.spec.ts +51 -0
  58. package/attributes-master/packages/attributes/tests/socialshare.spec.ts +54 -0
  59. package/attributes-master/packages/attributes/tests/starrating.spec.ts +79 -0
  60. package/attributes-master/packages/attributes/tests/toc.spec.ts +38 -0
  61. package/attributes-master/packages/attributes/tests/utils/index.ts +16 -0
  62. package/attributes-master/packages/attributes/tsconfig.json +6 -0
  63. package/attributes-master/packages/autovideo/CHANGELOG.md +182 -0
  64. package/attributes-master/packages/autovideo/README.md +31 -0
  65. package/attributes-master/packages/autovideo/package.json +22 -0
  66. package/attributes-master/packages/autovideo/src/index.ts +3 -0
  67. package/attributes-master/packages/autovideo/src/init.ts +52 -0
  68. package/attributes-master/packages/autovideo/src/types.ts +5 -0
  69. package/attributes-master/packages/autovideo/src/utils/constants.ts +4 -0
  70. package/attributes-master/packages/autovideo/tsconfig.json +3 -0
  71. package/attributes-master/packages/codehighlight/CHANGELOG.md +185 -0
  72. package/attributes-master/packages/codehighlight/README.md +27 -0
  73. package/attributes-master/packages/codehighlight/package.json +23 -0
  74. package/attributes-master/packages/codehighlight/src/actions/import.ts +50 -0
  75. package/attributes-master/packages/codehighlight/src/index.ts +3 -0
  76. package/attributes-master/packages/codehighlight/src/init.ts +53 -0
  77. package/attributes-master/packages/codehighlight/src/utils/constants.ts +24 -0
  78. package/attributes-master/packages/codehighlight/src/utils/selectors.ts +5 -0
  79. package/attributes-master/packages/codehighlight/src/utils/themes.ts +202 -0
  80. package/attributes-master/packages/codehighlight/tsconfig.json +3 -0
  81. package/attributes-master/packages/combobox/CHANGELOG.md +99 -0
  82. package/attributes-master/packages/combobox/README.md +27 -0
  83. package/attributes-master/packages/combobox/package.json +23 -0
  84. package/attributes-master/packages/combobox/src/actions/a11y.ts +29 -0
  85. package/attributes-master/packages/combobox/src/actions/body/index.ts +12 -0
  86. package/attributes-master/packages/combobox/src/actions/clearDropdown/index.ts +37 -0
  87. package/attributes-master/packages/combobox/src/actions/dropdownList/index.ts +220 -0
  88. package/attributes-master/packages/combobox/src/actions/dropdownToggle/index.ts +34 -0
  89. package/attributes-master/packages/combobox/src/actions/events.ts +75 -0
  90. package/attributes-master/packages/combobox/src/actions/input/index.ts +235 -0
  91. package/attributes-master/packages/combobox/src/actions/observe.ts +158 -0
  92. package/attributes-master/packages/combobox/src/actions/populate.ts +97 -0
  93. package/attributes-master/packages/combobox/src/actions/selectElement/index.ts +23 -0
  94. package/attributes-master/packages/combobox/src/actions/settings.ts +134 -0
  95. package/attributes-master/packages/combobox/src/actions/state.ts +34 -0
  96. package/attributes-master/packages/combobox/src/index.ts +3 -0
  97. package/attributes-master/packages/combobox/src/init.ts +52 -0
  98. package/attributes-master/packages/combobox/src/utils/constants.ts +48 -0
  99. package/attributes-master/packages/combobox/src/utils/dropdowns.ts +120 -0
  100. package/attributes-master/packages/combobox/src/utils/index.ts +1 -0
  101. package/attributes-master/packages/combobox/src/utils/selectors.ts +9 -0
  102. package/attributes-master/packages/combobox/src/utils/types.ts +14 -0
  103. package/attributes-master/packages/combobox/tsconfig.json +3 -0
  104. package/attributes-master/packages/copyclip/CHANGELOG.md +213 -0
  105. package/attributes-master/packages/copyclip/README.md +27 -0
  106. package/attributes-master/packages/copyclip/package.json +23 -0
  107. package/attributes-master/packages/copyclip/src/factory.ts +67 -0
  108. package/attributes-master/packages/copyclip/src/index.ts +3 -0
  109. package/attributes-master/packages/copyclip/src/init.ts +68 -0
  110. package/attributes-master/packages/copyclip/src/utils/constants.ts +40 -0
  111. package/attributes-master/packages/copyclip/src/utils/selectors.ts +9 -0
  112. package/attributes-master/packages/copyclip/tsconfig.json +3 -0
  113. package/attributes-master/packages/displayvalues/CHANGELOG.md +164 -0
  114. package/attributes-master/packages/displayvalues/README.md +27 -0
  115. package/attributes-master/packages/displayvalues/package.json +22 -0
  116. package/attributes-master/packages/displayvalues/src/actions/collect.ts +17 -0
  117. package/attributes-master/packages/displayvalues/src/actions/events.ts +22 -0
  118. package/attributes-master/packages/displayvalues/src/actions/sync.ts +23 -0
  119. package/attributes-master/packages/displayvalues/src/index.ts +3 -0
  120. package/attributes-master/packages/displayvalues/src/init.ts +31 -0
  121. package/attributes-master/packages/displayvalues/src/utils/constants.ts +20 -0
  122. package/attributes-master/packages/displayvalues/src/utils/selectors.ts +9 -0
  123. package/attributes-master/packages/displayvalues/src/utils/stores.ts +3 -0
  124. package/attributes-master/packages/displayvalues/tsconfig.json +3 -0
  125. package/attributes-master/packages/docs/CHANGELOG.md +108 -0
  126. package/attributes-master/packages/docs/README.md +3 -0
  127. package/attributes-master/packages/docs/bin/build.js +92 -0
  128. package/attributes-master/packages/docs/bin/live-reload.js +1 -0
  129. package/attributes-master/packages/docs/package.json +40 -0
  130. package/attributes-master/packages/docs/src/copy.ts +260 -0
  131. package/attributes-master/packages/docs/src/x-ray.ts +377 -0
  132. package/attributes-master/packages/docs/tsconfig.json +3 -0
  133. package/attributes-master/packages/favcustom/CHANGELOG.md +194 -0
  134. package/attributes-master/packages/favcustom/README.md +27 -0
  135. package/attributes-master/packages/favcustom/package.json +22 -0
  136. package/attributes-master/packages/favcustom/src/index.ts +3 -0
  137. package/attributes-master/packages/favcustom/src/init.ts +30 -0
  138. package/attributes-master/packages/favcustom/src/utils/constants.ts +10 -0
  139. package/attributes-master/packages/favcustom/src/utils/selectors.ts +5 -0
  140. package/attributes-master/packages/favcustom/tsconfig.json +3 -0
  141. package/attributes-master/packages/formsubmit/CHANGELOG.md +161 -0
  142. package/attributes-master/packages/formsubmit/README.md +51 -0
  143. package/attributes-master/packages/formsubmit/package.json +22 -0
  144. package/attributes-master/packages/formsubmit/src/actions/redirect.ts +9 -0
  145. package/attributes-master/packages/formsubmit/src/actions/reset.ts +49 -0
  146. package/attributes-master/packages/formsubmit/src/actions/submit.ts +34 -0
  147. package/attributes-master/packages/formsubmit/src/components/Form.ts +231 -0
  148. package/attributes-master/packages/formsubmit/src/factory.ts +62 -0
  149. package/attributes-master/packages/formsubmit/src/index.ts +3 -0
  150. package/attributes-master/packages/formsubmit/src/init.ts +24 -0
  151. package/attributes-master/packages/formsubmit/src/utils/attributes.ts +19 -0
  152. package/attributes-master/packages/formsubmit/src/utils/constants.ts +89 -0
  153. package/attributes-master/packages/formsubmit/src/utils/dom.ts +76 -0
  154. package/attributes-master/packages/formsubmit/src/utils/selectors.ts +9 -0
  155. package/attributes-master/packages/formsubmit/src/utils/types.ts +7 -0
  156. package/attributes-master/packages/formsubmit/tsconfig.json +3 -0
  157. package/attributes-master/packages/inject/CHANGELOG.md +117 -0
  158. package/attributes-master/packages/inject/README.md +60 -0
  159. package/attributes-master/packages/inject/package.json +22 -0
  160. package/attributes-master/packages/inject/src/actions/collect.ts +125 -0
  161. package/attributes-master/packages/inject/src/actions/css.ts +27 -0
  162. package/attributes-master/packages/inject/src/actions/prefetch.ts +44 -0
  163. package/attributes-master/packages/inject/src/factory.ts +123 -0
  164. package/attributes-master/packages/inject/src/index.ts +3 -0
  165. package/attributes-master/packages/inject/src/init.ts +22 -0
  166. package/attributes-master/packages/inject/src/utils/constants.ts +89 -0
  167. package/attributes-master/packages/inject/src/utils/helpers.ts +36 -0
  168. package/attributes-master/packages/inject/src/utils/selectors.ts +9 -0
  169. package/attributes-master/packages/inject/src/utils/types.ts +16 -0
  170. package/attributes-master/packages/inject/tsconfig.json +3 -0
  171. package/attributes-master/packages/inputactive/CHANGELOG.md +58 -0
  172. package/attributes-master/packages/inputactive/README.md +25 -0
  173. package/attributes-master/packages/inputactive/package.json +22 -0
  174. package/attributes-master/packages/inputactive/src/actions/classes.ts +43 -0
  175. package/attributes-master/packages/inputactive/src/factory.ts +24 -0
  176. package/attributes-master/packages/inputactive/src/index.ts +3 -0
  177. package/attributes-master/packages/inputactive/src/init.ts +18 -0
  178. package/attributes-master/packages/inputactive/src/utils/constants.ts +13 -0
  179. package/attributes-master/packages/inputactive/src/utils/selectors.ts +5 -0
  180. package/attributes-master/packages/inputactive/tsconfig.json +3 -0
  181. package/attributes-master/packages/inputcounter/CHANGELOG.md +110 -0
  182. package/attributes-master/packages/inputcounter/README.md +25 -0
  183. package/attributes-master/packages/inputcounter/package.json +22 -0
  184. package/attributes-master/packages/inputcounter/src/actions/a11y.ts +23 -0
  185. package/attributes-master/packages/inputcounter/src/actions/buttons.ts +61 -0
  186. package/attributes-master/packages/inputcounter/src/actions/input.ts +31 -0
  187. package/attributes-master/packages/inputcounter/src/actions/style.ts +12 -0
  188. package/attributes-master/packages/inputcounter/src/factory.ts +51 -0
  189. package/attributes-master/packages/inputcounter/src/index.ts +3 -0
  190. package/attributes-master/packages/inputcounter/src/init.ts +22 -0
  191. package/attributes-master/packages/inputcounter/src/utils/constants.ts +59 -0
  192. package/attributes-master/packages/inputcounter/src/utils/selectors.ts +9 -0
  193. package/attributes-master/packages/inputcounter/tsconfig.json +3 -0
  194. package/attributes-master/packages/list/CHANGELOG.md +185 -0
  195. package/attributes-master/packages/list/README.md +331 -0
  196. package/attributes-master/packages/list/package.json +37 -0
  197. package/attributes-master/packages/list/src/combine/index.ts +38 -0
  198. package/attributes-master/packages/list/src/components/List.ts +861 -0
  199. package/attributes-master/packages/list/src/components/ListItem.ts +229 -0
  200. package/attributes-master/packages/list/src/components/index.ts +2 -0
  201. package/attributes-master/packages/list/src/factory.ts +130 -0
  202. package/attributes-master/packages/list/src/filter/dynamic/conditions.ts +639 -0
  203. package/attributes-master/packages/list/src/filter/dynamic/groups.ts +221 -0
  204. package/attributes-master/packages/list/src/filter/dynamic/index.ts +119 -0
  205. package/attributes-master/packages/list/src/filter/dynamic/utils.ts +44 -0
  206. package/attributes-master/packages/list/src/filter/elements.ts +93 -0
  207. package/attributes-master/packages/list/src/filter/filter.ts +118 -0
  208. package/attributes-master/packages/list/src/filter/filter.worker.ts +152 -0
  209. package/attributes-master/packages/list/src/filter/index.ts +94 -0
  210. package/attributes-master/packages/list/src/filter/standard/conditions.ts +123 -0
  211. package/attributes-master/packages/list/src/filter/standard/facets.ts +253 -0
  212. package/attributes-master/packages/list/src/filter/standard/index.ts +176 -0
  213. package/attributes-master/packages/list/src/filter/standard/query.ts +111 -0
  214. package/attributes-master/packages/list/src/filter/tags.ts +314 -0
  215. package/attributes-master/packages/list/src/filter/types.ts +62 -0
  216. package/attributes-master/packages/list/src/filter/utils.ts +126 -0
  217. package/attributes-master/packages/list/src/index.ts +4 -0
  218. package/attributes-master/packages/list/src/init.ts +38 -0
  219. package/attributes-master/packages/list/src/load/all.ts +27 -0
  220. package/attributes-master/packages/list/src/load/elements.ts +39 -0
  221. package/attributes-master/packages/list/src/load/index.ts +63 -0
  222. package/attributes-master/packages/list/src/load/infinite.ts +79 -0
  223. package/attributes-master/packages/list/src/load/load.ts +191 -0
  224. package/attributes-master/packages/list/src/load/more.ts +97 -0
  225. package/attributes-master/packages/list/src/load/pagination.ts +402 -0
  226. package/attributes-master/packages/list/src/nest/index.ts +198 -0
  227. package/attributes-master/packages/list/src/prevnext/index.ts +98 -0
  228. package/attributes-master/packages/list/src/select/index.ts +56 -0
  229. package/attributes-master/packages/list/src/slider/index.ts +62 -0
  230. package/attributes-master/packages/list/src/sort/buttons.ts +96 -0
  231. package/attributes-master/packages/list/src/sort/dropdown.ts +179 -0
  232. package/attributes-master/packages/list/src/sort/index.ts +81 -0
  233. package/attributes-master/packages/list/src/sort/query.ts +63 -0
  234. package/attributes-master/packages/list/src/sort/select.ts +67 -0
  235. package/attributes-master/packages/list/src/sort/sort.ts +79 -0
  236. package/attributes-master/packages/list/src/sort/types.ts +28 -0
  237. package/attributes-master/packages/list/src/static/index.ts +73 -0
  238. package/attributes-master/packages/list/src/tabs/index.ts +97 -0
  239. package/attributes-master/packages/list/src/utils/constants.ts +728 -0
  240. package/attributes-master/packages/list/src/utils/dom.ts +108 -0
  241. package/attributes-master/packages/list/src/utils/pagination.ts +14 -0
  242. package/attributes-master/packages/list/src/utils/selectors.ts +18 -0
  243. package/attributes-master/packages/list/src/utils/store.ts +5 -0
  244. package/attributes-master/packages/list/tsconfig.json +3 -0
  245. package/attributes-master/packages/mirrorclick/CHANGELOG.md +171 -0
  246. package/attributes-master/packages/mirrorclick/README.md +25 -0
  247. package/attributes-master/packages/mirrorclick/package.json +22 -0
  248. package/attributes-master/packages/mirrorclick/src/index.ts +3 -0
  249. package/attributes-master/packages/mirrorclick/src/init.ts +35 -0
  250. package/attributes-master/packages/mirrorclick/src/utils/constants.ts +20 -0
  251. package/attributes-master/packages/mirrorclick/src/utils/selectors.ts +9 -0
  252. package/attributes-master/packages/mirrorclick/tsconfig.json +3 -0
  253. package/attributes-master/packages/mirrorinput/CHANGELOG.md +172 -0
  254. package/attributes-master/packages/mirrorinput/README.md +25 -0
  255. package/attributes-master/packages/mirrorinput/package.json +22 -0
  256. package/attributes-master/packages/mirrorinput/src/index.ts +3 -0
  257. package/attributes-master/packages/mirrorinput/src/init.ts +48 -0
  258. package/attributes-master/packages/mirrorinput/src/utils/constants.ts +15 -0
  259. package/attributes-master/packages/mirrorinput/src/utils/selectors.ts +9 -0
  260. package/attributes-master/packages/mirrorinput/tsconfig.json +3 -0
  261. package/attributes-master/packages/modal/CHANGELOG.md +94 -0
  262. package/attributes-master/packages/modal/README.md +29 -0
  263. package/attributes-master/packages/modal/package.json +23 -0
  264. package/attributes-master/packages/modal/src/actions/a11y.ts +46 -0
  265. package/attributes-master/packages/modal/src/actions/modal.ts +164 -0
  266. package/attributes-master/packages/modal/src/actions/settings.ts +21 -0
  267. package/attributes-master/packages/modal/src/factory.ts +26 -0
  268. package/attributes-master/packages/modal/src/index.ts +3 -0
  269. package/attributes-master/packages/modal/src/init.ts +22 -0
  270. package/attributes-master/packages/modal/src/utils/constants.ts +54 -0
  271. package/attributes-master/packages/modal/src/utils/selectors.ts +9 -0
  272. package/attributes-master/packages/modal/src/utils/types.ts +12 -0
  273. package/attributes-master/packages/modal/tsconfig.json +3 -0
  274. package/attributes-master/packages/numbercount/CHANGELOG.md +90 -0
  275. package/attributes-master/packages/numbercount/README.md +27 -0
  276. package/attributes-master/packages/numbercount/package.json +23 -0
  277. package/attributes-master/packages/numbercount/src/actions/a11y.ts +26 -0
  278. package/attributes-master/packages/numbercount/src/actions/animate.ts +43 -0
  279. package/attributes-master/packages/numbercount/src/actions/observe.ts +44 -0
  280. package/attributes-master/packages/numbercount/src/factory.ts +31 -0
  281. package/attributes-master/packages/numbercount/src/index.ts +3 -0
  282. package/attributes-master/packages/numbercount/src/init.ts +22 -0
  283. package/attributes-master/packages/numbercount/src/utils/constants.ts +40 -0
  284. package/attributes-master/packages/numbercount/src/utils/helpers.ts +31 -0
  285. package/attributes-master/packages/numbercount/src/utils/selectors.ts +9 -0
  286. package/attributes-master/packages/numbercount/tsconfig.json +3 -0
  287. package/attributes-master/packages/queryparam/CHANGELOG.md +118 -0
  288. package/attributes-master/packages/queryparam/README.md +25 -0
  289. package/attributes-master/packages/queryparam/package.json +22 -0
  290. package/attributes-master/packages/queryparam/src/factory.ts +51 -0
  291. package/attributes-master/packages/queryparam/src/index.ts +3 -0
  292. package/attributes-master/packages/queryparam/src/init.ts +40 -0
  293. package/attributes-master/packages/queryparam/src/utils/constants.ts +18 -0
  294. package/attributes-master/packages/queryparam/src/utils/selectors.ts +5 -0
  295. package/attributes-master/packages/queryparam/tsconfig.json +3 -0
  296. package/attributes-master/packages/rangeslider/CHANGELOG.md +236 -0
  297. package/attributes-master/packages/rangeslider/README.md +95 -0
  298. package/attributes-master/packages/rangeslider/package.json +23 -0
  299. package/attributes-master/packages/rangeslider/src/actions/a11y.ts +21 -0
  300. package/attributes-master/packages/rangeslider/src/actions/events.ts +9 -0
  301. package/attributes-master/packages/rangeslider/src/actions/settings.ts +97 -0
  302. package/attributes-master/packages/rangeslider/src/actions/styles.ts +10 -0
  303. package/attributes-master/packages/rangeslider/src/actions/values.ts +47 -0
  304. package/attributes-master/packages/rangeslider/src/components/Fill.ts +70 -0
  305. package/attributes-master/packages/rangeslider/src/components/Handle.ts +281 -0
  306. package/attributes-master/packages/rangeslider/src/factory.ts +100 -0
  307. package/attributes-master/packages/rangeslider/src/index.ts +3 -0
  308. package/attributes-master/packages/rangeslider/src/init.ts +194 -0
  309. package/attributes-master/packages/rangeslider/src/utils/constants.ts +87 -0
  310. package/attributes-master/packages/rangeslider/src/utils/selectors.ts +9 -0
  311. package/attributes-master/packages/rangeslider/src/utils/types.ts +6 -0
  312. package/attributes-master/packages/rangeslider/tsconfig.json +3 -0
  313. package/attributes-master/packages/readtime/CHANGELOG.md +108 -0
  314. package/attributes-master/packages/readtime/README.md +25 -0
  315. package/attributes-master/packages/readtime/package.json +22 -0
  316. package/attributes-master/packages/readtime/src/factory.ts +21 -0
  317. package/attributes-master/packages/readtime/src/index.ts +3 -0
  318. package/attributes-master/packages/readtime/src/init.ts +19 -0
  319. package/attributes-master/packages/readtime/src/utils/constants.ts +33 -0
  320. package/attributes-master/packages/readtime/src/utils/selectors.ts +9 -0
  321. package/attributes-master/packages/readtime/tsconfig.json +3 -0
  322. package/attributes-master/packages/removequery/CHANGELOG.md +8 -0
  323. package/attributes-master/packages/removequery/README.md +25 -0
  324. package/attributes-master/packages/removequery/package.json +22 -0
  325. package/attributes-master/packages/removequery/src/index.ts +3 -0
  326. package/attributes-master/packages/removequery/src/init.ts +18 -0
  327. package/attributes-master/packages/removequery/src/utils/constants.ts +5 -0
  328. package/attributes-master/packages/removequery/tsconfig.json +3 -0
  329. package/attributes-master/packages/scrolldisable/CHANGELOG.md +164 -0
  330. package/attributes-master/packages/scrolldisable/README.md +29 -0
  331. package/attributes-master/packages/scrolldisable/package.json +27 -0
  332. package/attributes-master/packages/scrolldisable/src/click.ts +40 -0
  333. package/attributes-master/packages/scrolldisable/src/display.ts +117 -0
  334. package/attributes-master/packages/scrolldisable/src/index.ts +3 -0
  335. package/attributes-master/packages/scrolldisable/src/init.ts +36 -0
  336. package/attributes-master/packages/scrolldisable/src/scroll.ts +63 -0
  337. package/attributes-master/packages/scrolldisable/src/utils/constants.ts +56 -0
  338. package/attributes-master/packages/scrolldisable/src/utils/selectors.ts +6 -0
  339. package/attributes-master/packages/scrolldisable/tsconfig.json +3 -0
  340. package/attributes-master/packages/selectcustom/CHANGELOG.md +242 -0
  341. package/attributes-master/packages/selectcustom/README.md +25 -0
  342. package/attributes-master/packages/selectcustom/package.json +23 -0
  343. package/attributes-master/packages/selectcustom/src/actions/a11y.ts +29 -0
  344. package/attributes-master/packages/selectcustom/src/actions/events.ts +159 -0
  345. package/attributes-master/packages/selectcustom/src/actions/observe.ts +83 -0
  346. package/attributes-master/packages/selectcustom/src/actions/populate.ts +67 -0
  347. package/attributes-master/packages/selectcustom/src/actions/settings.ts +68 -0
  348. package/attributes-master/packages/selectcustom/src/actions/state.ts +41 -0
  349. package/attributes-master/packages/selectcustom/src/index.ts +3 -0
  350. package/attributes-master/packages/selectcustom/src/init.ts +51 -0
  351. package/attributes-master/packages/selectcustom/src/utils/constants.ts +34 -0
  352. package/attributes-master/packages/selectcustom/src/utils/selectors.ts +9 -0
  353. package/attributes-master/packages/selectcustom/src/utils/types.ts +14 -0
  354. package/attributes-master/packages/selectcustom/tsconfig.json +3 -0
  355. package/attributes-master/packages/sliderdots/CHANGELOG.md +220 -0
  356. package/attributes-master/packages/sliderdots/README.md +27 -0
  357. package/attributes-master/packages/sliderdots/package.json +22 -0
  358. package/attributes-master/packages/sliderdots/src/actions/events.ts +26 -0
  359. package/attributes-master/packages/sliderdots/src/actions/observe.ts +40 -0
  360. package/attributes-master/packages/sliderdots/src/actions/populate.ts +46 -0
  361. package/attributes-master/packages/sliderdots/src/actions/sync.ts +28 -0
  362. package/attributes-master/packages/sliderdots/src/actions/wait.ts +28 -0
  363. package/attributes-master/packages/sliderdots/src/factory.ts +57 -0
  364. package/attributes-master/packages/sliderdots/src/index.ts +3 -0
  365. package/attributes-master/packages/sliderdots/src/init.ts +30 -0
  366. package/attributes-master/packages/sliderdots/src/utils/constants.ts +33 -0
  367. package/attributes-master/packages/sliderdots/src/utils/selectors.ts +9 -0
  368. package/attributes-master/packages/sliderdots/src/utils/types.ts +7 -0
  369. package/attributes-master/packages/sliderdots/tsconfig.json +3 -0
  370. package/attributes-master/packages/smartlightbox/CHANGELOG.md +203 -0
  371. package/attributes-master/packages/smartlightbox/README.md +25 -0
  372. package/attributes-master/packages/smartlightbox/package.json +22 -0
  373. package/attributes-master/packages/smartlightbox/src/actions/collect.ts +15 -0
  374. package/attributes-master/packages/smartlightbox/src/actions/move.ts +25 -0
  375. package/attributes-master/packages/smartlightbox/src/index.ts +3 -0
  376. package/attributes-master/packages/smartlightbox/src/init.ts +61 -0
  377. package/attributes-master/packages/smartlightbox/src/utils/constants.ts +31 -0
  378. package/attributes-master/packages/smartlightbox/src/utils/selectors.ts +9 -0
  379. package/attributes-master/packages/smartlightbox/tsconfig.json +3 -0
  380. package/attributes-master/packages/socialshare/CHANGELOG.md +170 -0
  381. package/attributes-master/packages/socialshare/README.md +25 -0
  382. package/attributes-master/packages/socialshare/package.json +25 -0
  383. package/attributes-master/packages/socialshare/src/actions/collect.ts +93 -0
  384. package/attributes-master/packages/socialshare/src/actions/share.ts +91 -0
  385. package/attributes-master/packages/socialshare/src/actions/trigger.ts +46 -0
  386. package/attributes-master/packages/socialshare/src/factory.ts +149 -0
  387. package/attributes-master/packages/socialshare/src/index.ts +3 -0
  388. package/attributes-master/packages/socialshare/src/init.ts +35 -0
  389. package/attributes-master/packages/socialshare/src/utils/constants.ts +94 -0
  390. package/attributes-master/packages/socialshare/src/utils/dom.ts +8 -0
  391. package/attributes-master/packages/socialshare/src/utils/selectors.ts +6 -0
  392. package/attributes-master/packages/socialshare/src/utils/stores.ts +10 -0
  393. package/attributes-master/packages/socialshare/src/utils/types.ts +34 -0
  394. package/attributes-master/packages/socialshare/tsconfig.json +3 -0
  395. package/attributes-master/packages/starrating/CHANGELOG.md +70 -0
  396. package/attributes-master/packages/starrating/README.md +25 -0
  397. package/attributes-master/packages/starrating/package.json +22 -0
  398. package/attributes-master/packages/starrating/src/actions/classes.ts +41 -0
  399. package/attributes-master/packages/starrating/src/actions/events.ts +80 -0
  400. package/attributes-master/packages/starrating/src/factory.ts +24 -0
  401. package/attributes-master/packages/starrating/src/index.ts +3 -0
  402. package/attributes-master/packages/starrating/src/init.ts +24 -0
  403. package/attributes-master/packages/starrating/src/utils/constants.ts +20 -0
  404. package/attributes-master/packages/starrating/src/utils/helpers.ts +63 -0
  405. package/attributes-master/packages/starrating/src/utils/selectors.ts +9 -0
  406. package/attributes-master/packages/starrating/tsconfig.json +3 -0
  407. package/attributes-master/packages/template/README.md +25 -0
  408. package/attributes-master/packages/template/package.json +22 -0
  409. package/attributes-master/packages/template/src/actions/console.ts +4 -0
  410. package/attributes-master/packages/template/src/index.ts +3 -0
  411. package/attributes-master/packages/template/src/init.ts +14 -0
  412. package/attributes-master/packages/template/src/utils/constants.ts +18 -0
  413. package/attributes-master/packages/template/src/utils/selectors.ts +5 -0
  414. package/attributes-master/packages/template/tsconfig.json +3 -0
  415. package/attributes-master/packages/toc/CHANGELOG.md +192 -0
  416. package/attributes-master/packages/toc/README.md +25 -0
  417. package/attributes-master/packages/toc/package.json +23 -0
  418. package/attributes-master/packages/toc/src/actions/collect.ts +136 -0
  419. package/attributes-master/packages/toc/src/actions/create.ts +44 -0
  420. package/attributes-master/packages/toc/src/actions/events.ts +29 -0
  421. package/attributes-master/packages/toc/src/actions/observe.ts +31 -0
  422. package/attributes-master/packages/toc/src/actions/populate.ts +68 -0
  423. package/attributes-master/packages/toc/src/actions/prepare.ts +25 -0
  424. package/attributes-master/packages/toc/src/actions/scroll.ts +33 -0
  425. package/attributes-master/packages/toc/src/components/TOCItem.ts +88 -0
  426. package/attributes-master/packages/toc/src/factory.ts +47 -0
  427. package/attributes-master/packages/toc/src/index.ts +3 -0
  428. package/attributes-master/packages/toc/src/init.ts +37 -0
  429. package/attributes-master/packages/toc/src/utils/constants.ts +55 -0
  430. package/attributes-master/packages/toc/src/utils/helpers.ts +23 -0
  431. package/attributes-master/packages/toc/src/utils/selectors.ts +6 -0
  432. package/attributes-master/packages/toc/src/utils/types.ts +21 -0
  433. package/attributes-master/packages/toc/tsconfig.json +3 -0
  434. package/attributes-master/packages/utils/CHANGELOG.md +43 -0
  435. package/attributes-master/packages/utils/package.json +27 -0
  436. package/attributes-master/packages/utils/src/animations/factory.ts +100 -0
  437. package/attributes-master/packages/utils/src/animations/index.ts +73 -0
  438. package/attributes-master/packages/utils/src/animations/types.ts +37 -0
  439. package/attributes-master/packages/utils/src/components/Interaction.ts +79 -0
  440. package/attributes-master/packages/utils/src/components/Renderer.ts +59 -0
  441. package/attributes-master/packages/utils/src/components/index.ts +2 -0
  442. package/attributes-master/packages/utils/src/constants/a11y.ts +50 -0
  443. package/attributes-master/packages/utils/src/constants/attributes.ts +57 -0
  444. package/attributes-master/packages/utils/src/constants/index.ts +5 -0
  445. package/attributes-master/packages/utils/src/constants/keyboard.ts +10 -0
  446. package/attributes-master/packages/utils/src/constants/webflow.ts +74 -0
  447. package/attributes-master/packages/utils/src/helpers/dates.ts +17 -0
  448. package/attributes-master/packages/utils/src/helpers/dom.ts +82 -0
  449. package/attributes-master/packages/utils/src/helpers/events.ts +59 -0
  450. package/attributes-master/packages/utils/src/helpers/fetch.ts +217 -0
  451. package/attributes-master/packages/utils/src/helpers/forms.ts +238 -0
  452. package/attributes-master/packages/utils/src/helpers/guards.ts +138 -0
  453. package/attributes-master/packages/utils/src/helpers/index.ts +11 -0
  454. package/attributes-master/packages/utils/src/helpers/numbers.ts +86 -0
  455. package/attributes-master/packages/utils/src/helpers/selectors.ts +249 -0
  456. package/attributes-master/packages/utils/src/helpers/strings.ts +19 -0
  457. package/attributes-master/packages/utils/src/helpers/wait.ts +36 -0
  458. package/attributes-master/packages/utils/src/helpers/webflow.ts +117 -0
  459. package/attributes-master/packages/utils/src/index.ts +5 -0
  460. package/attributes-master/packages/utils/src/types/core.ts +100 -0
  461. package/attributes-master/packages/utils/src/types/dom.ts +31 -0
  462. package/attributes-master/packages/utils/src/types/index.ts +4 -0
  463. package/attributes-master/packages/utils/src/types/utils.ts +20 -0
  464. package/attributes-master/packages/utils/src/types/webflow.ts +147 -0
  465. package/attributes-master/packages/utils/tsconfig.json +3 -0
  466. package/attributes-master/packages/videohls/CHANGELOG.md +76 -0
  467. package/attributes-master/packages/videohls/README.md +27 -0
  468. package/attributes-master/packages/videohls/package.json +26 -0
  469. package/attributes-master/packages/videohls/src/actions/list.ts +23 -0
  470. package/attributes-master/packages/videohls/src/actions/video.ts +44 -0
  471. package/attributes-master/packages/videohls/src/index.ts +3 -0
  472. package/attributes-master/packages/videohls/src/init.ts +28 -0
  473. package/attributes-master/packages/videohls/src/utils/constants.ts +12 -0
  474. package/attributes-master/packages/videohls/src/utils/selectors.ts +5 -0
  475. package/attributes-master/packages/videohls/src/utils/stores.ts +3 -0
  476. package/attributes-master/packages/videohls/tsconfig.json +3 -0
  477. package/attributes-master/pnpm-lock.yaml +3317 -0
  478. package/attributes-master/pnpm-workspace.yaml +3 -0
  479. package/attributes-master/tsconfig.json +6 -0
  480. package/index.js +173 -257
  481. package/package.json +1 -1
@@ -0,0 +1,220 @@
1
+ # @finsweet/attributes-sliderdots
2
+
3
+ ## 1.8.7
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [2af0bad]
8
+ - @finsweet/attributes-utils@0.1.0
9
+
10
+ ## 1.8.6
11
+
12
+ ### Patch Changes
13
+
14
+ - 378d74d: fix: unify public API under FinsweetAttributes and remove finsweetAttributes
15
+ - Updated dependencies [378d74d]
16
+ - @finsweet/attributes-utils@0.0.6
17
+
18
+ ## 1.8.5
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies [01973d8]
23
+ - @finsweet/attributes-utils@0.0.5
24
+
25
+ ## 1.8.4
26
+
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies [deef758]
30
+ - @finsweet/attributes-utils@0.0.4
31
+
32
+ ## 1.8.3
33
+
34
+ ### Patch Changes
35
+
36
+ - Updated dependencies [d21cbca]
37
+ - @finsweet/attributes-utils@0.0.3
38
+
39
+ ## 1.8.2
40
+
41
+ ### Patch Changes
42
+
43
+ - c7b544d: chore: updated dependencies
44
+ - Updated dependencies [c7b544d]
45
+ - @finsweet/attributes-utils@0.0.2
46
+
47
+ ## 1.8.1
48
+
49
+ ### Patch Changes
50
+
51
+ - b56e5e5: rename fsAttribute in places of usage to finsweetAttribute
52
+ - Updated dependencies [b56e5e5]
53
+ - @finsweet/attributes-utils@0.0.1
54
+
55
+ ## 1.8.0
56
+
57
+ ### Minor Changes
58
+
59
+ - e4b3b680: Created new `window.fsAttributes.destroy()` method to support SPA environments.
60
+ This new method allows users to destroy all Attributes instances, cleaning up event listeners, observers, states, global variables, etc.
61
+
62
+ Websites that use a client-side router that simulates an SPA environment like [barba.js](https://barba.js.org/) or [Swup](https://swup.js.org/) can now properly init and destroy Attributes.
63
+ After destroying, Attributes can be manually re-initted by calling `window.fsAttribute[ATTRIBUTE_KEY].init()`.
64
+
65
+ Updated changesets system, now all updates will be correctly reflected in [the official updates page](https://www.finsweet.com/attributes/updates).
66
+
67
+ ## 1.7.1
68
+
69
+ ### Patch Changes
70
+
71
+ - Updated dependencies [4792998a]
72
+ - @global/constants@1.2.0
73
+ - @global/factory@1.1.5
74
+
75
+ ## 1.7.0
76
+
77
+ ### Minor Changes
78
+
79
+ - 07f32375: Created `fs-cmsattribute` Attribute
80
+
81
+ ### Patch Changes
82
+
83
+ - Updated dependencies [07f32375]
84
+ - @global/constants@1.1.0
85
+ - @global/factory@1.1.4
86
+
87
+ ## 1.6.6
88
+
89
+ ### Patch Changes
90
+
91
+ - dd4d7f61: `sliderdots`: removed cmsslider promise timeout
92
+
93
+ ## 1.6.5
94
+
95
+ ### Patch Changes
96
+
97
+ - Updated dependencies [7542dcdb]
98
+ - @global/constants@1.0.2
99
+ - @global/factory@1.1.3
100
+
101
+ ## 1.6.4
102
+
103
+ ### Patch Changes
104
+
105
+ - Updated dependencies [bdd1a78]
106
+ - @global/constants@1.0.1
107
+ - @global/factory@1.1.2
108
+
109
+ ## 1.6.3
110
+
111
+ ### Patch Changes
112
+
113
+ - Updated dependencies [13c3e23]
114
+ - @global/factory@1.1.1
115
+ - @finsweet/attributes-cmsslider@1.5.3
116
+
117
+ ## 1.6.2
118
+
119
+ ### Patch Changes
120
+
121
+ - Updated dependencies [627bf25]
122
+ - @global/factory@1.1.0
123
+ - @finsweet/attributes-cmsslider@1.5.2
124
+
125
+ ## 1.6.1
126
+
127
+ ### Patch Changes
128
+
129
+ - Selector for slider and slider-nav updated in Schema.
130
+
131
+ ## 1.6.0
132
+
133
+ ### Minor Changes
134
+
135
+ - Added support wizard and publishing new schema version
136
+
137
+ ## 1.5.0
138
+
139
+ ### Minor Changes
140
+
141
+ - Added support to use the native `Slider Nav` element as the container of the custom slider dots.
142
+ The user can now completely skip adding the `fs-sliderdots-element="slider-nav"` attribute to any element.
143
+ When this is the case, the library will use the native `Slider Nav` as a fallback.
144
+
145
+ ## 1.4.1
146
+
147
+ ### Patch Changes
148
+
149
+ - Added support for using `cmsslider` + `sliderdots` together.
150
+ If both attributes are detected, now `sliderdots` will wait until `cmsslider` has finished populating all Slides before creating the Custom Slider Dots.
151
+
152
+ ## 1.4.0
153
+
154
+ ### Minor Changes
155
+
156
+ Included a new `window.fsAttributes.push()` method in the developer API that provides a standarized way to safely access any Attribute internals once it has fully loaded.
157
+ It can be used like:
158
+
159
+ ```html
160
+ <script>
161
+ window.fsAttributes = window.fsAttributes || [];
162
+ window.fsAttributes.push([
163
+ 'sliderdots',
164
+ (sliders) => {
165
+ console.log('Attribute has successfully loaded!');
166
+ console.log(sliders);
167
+ },
168
+ ]);
169
+ </script>
170
+ ```
171
+
172
+ ## 1.3.0
173
+
174
+ ### Minor Changes
175
+
176
+ - Added support to apply `fs-sliderdots-remove="true"` to the `fs-sliderdots-element="slider-nav"` element.
177
+ If applied, all existing content inside the custom slider nav will be removed before appending the custom dots.
178
+ - Released `v1.3.0-beta.0`.
179
+
180
+ ## 1.2.0
181
+
182
+ ### Minor Changes
183
+
184
+ - Created `changesets.json` API.
185
+
186
+ ## 1.1.2
187
+
188
+ ### Patch Changes
189
+
190
+ - Added `initAttributes` call to make sure `window.fsAttributes` exists.
191
+
192
+ ## 1.1.1
193
+
194
+ ### Patch Changes
195
+
196
+ - Updated `examples.json`.
197
+
198
+ ## 1.1.0
199
+
200
+ ### Minor Changes
201
+
202
+ - Added `fs-sliderdots-element="slider-nav"` functionality. Now all dots will become custom dots that are synced with the original dots.
203
+
204
+ ## 1.0.2
205
+
206
+ ### Patch Changes
207
+
208
+ - Renamed the property in `window.fsAttributes` to the original Attribute key name.
209
+
210
+ ## 1.0.1
211
+
212
+ ### Patch Changes
213
+
214
+ - Implemented the `generateSelectors` util.
215
+
216
+ ## 1.0.0
217
+
218
+ ### Major Changes
219
+
220
+ - Created the attribute package.
@@ -0,0 +1,27 @@
1
+ # `sliderdots` Attribute
2
+
3
+ Populate the Webflow slider dots with content. Add images, text, or any type of element inside native Webflow slider navigation.
4
+
5
+ ## Getting Started
6
+
7
+ Please follow the documentation at [finsweet.com/attributes](https://www.finsweet.com/attributes) to learn how to use Attributes in your Webflow projects.
8
+
9
+ ## Accessing the API
10
+
11
+ To learn how to access the API, please check the general [API Reference](../attributes/README.md#api-reference) documentation:
12
+
13
+ ```javascript
14
+ window.FinsweetAttributes ||= [];
15
+ window.FinsweetAttributes.push([
16
+ 'sliderdots',
17
+ (sliderElements) => {
18
+ // Your code goes here.
19
+ },
20
+ ]);
21
+ ```
22
+
23
+ The `result` object contains the slider elements that have been populated with custom dots.
24
+
25
+ ## License
26
+
27
+ [Apache 2.0](../../LICENSE.md)
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@finsweet/attributes-sliderdots",
3
+ "version": "1.8.7",
4
+ "description": "Create custom Slider Dots for a Slider.",
5
+ "private": true,
6
+ "type": "module",
7
+ "types": "src/index.ts",
8
+ "scripts": {
9
+ "lint": "eslint ./src && prettier --check ./src",
10
+ "lint:fix": "eslint ./src --fix && prettier --write ./src",
11
+ "check": "tsc --noEmit"
12
+ },
13
+ "exports": {
14
+ ".": {
15
+ "types": "./src/index.ts",
16
+ "import": "./src/index.ts"
17
+ }
18
+ },
19
+ "dependencies": {
20
+ "@finsweet/attributes-utils": "workspace:*"
21
+ }
22
+ }
@@ -0,0 +1,26 @@
1
+ import { addListener, isElement, simulateEvent } from '@finsweet/attributes-utils';
2
+
3
+ import { getElementSelector } from '../utils/selectors';
4
+ import type { DotsRelationship } from '../utils/types';
5
+
6
+ /**
7
+ * Listens for click events in the custom slider nav.
8
+ * @param customSliderNav The `Custom Slider Nav`.
9
+ * @param dotsRelationship A {@link DotsRelationship} array.
10
+ *
11
+ * @returns A callback to remove the event listener.
12
+ */
13
+ export const listenClickEvents = (customSliderNav: HTMLElement, dotsRelationship: DotsRelationship) => {
14
+ const clickCleanup = addListener(customSliderNav, 'click', ({ target }) => {
15
+ if (!isElement(target)) return;
16
+
17
+ const customDotTarget = target.closest(getElementSelector('content'));
18
+ if (!customDotTarget) return;
19
+
20
+ const { dot } = dotsRelationship.find(({ customDot }) => customDot === customDotTarget) || {};
21
+
22
+ if (dot) simulateEvent(dot, 'click');
23
+ });
24
+
25
+ return clickCleanup;
26
+ };
@@ -0,0 +1,40 @@
1
+ import { isHTMLElement, type SliderNavElement } from '@finsweet/attributes-utils';
2
+
3
+ import type { DotsRelationship } from '../utils/types';
4
+ import { syncDotsProperties } from './sync';
5
+
6
+ /**
7
+ * Replicates all actions between the original `Slider Dots` and the `Custom Slider Dots`.
8
+ * @param sliderNav The original `Slider Nav`.
9
+ * @param dotsRelationship A {@link DotsRelationship} array.
10
+ * @param activeCSSClass The CSS class used for the `active` state.
11
+ *
12
+ * @returns The MutationObserver.
13
+ */
14
+ export const observeSliderNav = (
15
+ sliderNav: SliderNavElement,
16
+ dotsRelationship: DotsRelationship,
17
+ activeCSSClass: string
18
+ ) => {
19
+ const callback: MutationCallback = (mutations) => {
20
+ for (const { target } of mutations) {
21
+ if (!isHTMLElement(target)) continue;
22
+
23
+ const relationshipData = dotsRelationship.find(({ dot }) => dot === target);
24
+ if (!relationshipData) continue;
25
+
26
+ syncDotsProperties(relationshipData, activeCSSClass);
27
+ }
28
+ };
29
+
30
+ const options: MutationObserverInit = {
31
+ subtree: true,
32
+ attributes: true,
33
+ attributeFilter: ['class'],
34
+ };
35
+
36
+ const observer = new MutationObserver(callback);
37
+ observer.observe(sliderNav, options);
38
+
39
+ return observer;
40
+ };
@@ -0,0 +1,46 @@
1
+ import {
2
+ cloneNode,
3
+ type SlideElement,
4
+ SLIDER_CSS_CLASSES,
5
+ type SliderDotElement,
6
+ type SliderElement,
7
+ } from '@finsweet/attributes-utils';
8
+
9
+ import { hasAttributeValue, queryElement } from '../utils/selectors';
10
+ import type { DotsRelationship } from '../utils/types';
11
+
12
+ const { slide: slideCSSClass, sliderDot: sliderDotCSSClass } = SLIDER_CSS_CLASSES;
13
+
14
+ /**
15
+ * Populates all the custom slider dots.
16
+ * @param slider The `SliderElement`.
17
+ * @param customSliderNav The custom Slider nav element.
18
+ *
19
+ * @returns A {@link DotsRelationship} array.
20
+ */
21
+ export const populateSliderDots = (slider: SliderElement, customSliderNav: HTMLElement): DotsRelationship => {
22
+ const dotsRelationship: DotsRelationship = [];
23
+
24
+ const slides = slider.querySelectorAll<SlideElement>(`.${slideCSSClass}`);
25
+ const dots = slider.querySelectorAll<SliderDotElement>(`.${sliderDotCSSClass}`);
26
+
27
+ slides.forEach((slide, index) => {
28
+ const dot = dots[index];
29
+ if (!dot) return;
30
+
31
+ dot.style.display = 'none';
32
+
33
+ const customDotElement = queryElement<HTMLElement>('content', { scope: slide });
34
+ if (!customDotElement) return;
35
+
36
+ const mustRemove = hasAttributeValue(customDotElement, 'remove', 'true');
37
+
38
+ const customDot = mustRemove ? customDotElement : cloneNode(customDotElement);
39
+
40
+ customSliderNav.appendChild(customDot);
41
+
42
+ dotsRelationship.push({ dot, customDot });
43
+ });
44
+
45
+ return dotsRelationship;
46
+ };
@@ -0,0 +1,28 @@
1
+ import {
2
+ ARIA_LABEL_KEY,
3
+ ARIA_PRESSED_KEY,
4
+ ARIA_ROLE_KEY,
5
+ SLIDER_CSS_CLASSES,
6
+ TABINDEX_KEY,
7
+ } from '@finsweet/attributes-utils';
8
+
9
+ import type { DotsRelationship } from '../utils/types';
10
+
11
+ /**
12
+ * Syncronizes the properties from the original `Slider Dot` with the `Custom Slider Dot`.
13
+ * @param dot The original `Slider Dot`.
14
+ * @param customDot The `Custom Slider Dot`.
15
+ * @param activeCSSClass The CSS class used for the `active` state.
16
+ */
17
+ export const syncDotsProperties = ({ dot, customDot }: DotsRelationship[number], activeCSSClass: string) => {
18
+ const isActive = dot.classList.contains(SLIDER_CSS_CLASSES.activeSliderDot);
19
+
20
+ customDot.classList[isActive ? 'add' : 'remove'](activeCSSClass);
21
+
22
+ for (const attributeKey of [ARIA_LABEL_KEY, ARIA_PRESSED_KEY, ARIA_ROLE_KEY, TABINDEX_KEY]) {
23
+ const value = dot.getAttribute(attributeKey);
24
+
25
+ if (value) customDot.setAttribute(attributeKey, value);
26
+ else customDot.removeAttribute(attributeKey);
27
+ }
28
+ };
@@ -0,0 +1,28 @@
1
+ import { isElement, SLIDER_CSS_CLASSES, type SliderNavElement } from '@finsweet/attributes-utils';
2
+
3
+ /**
4
+ * Returns a Promise that resolves when all slider dots have been initially populated.
5
+ * Helpful when waiting for `cmsslider` to be ready before initing `sliderdots`.
6
+ * It has a maximum timeout of 500ms.
7
+ *
8
+ * @param sliderNav The original `Slider Nav`.
9
+ */
10
+ export const waitSliderReady = (sliderNav: SliderNavElement) => {
11
+ return new Promise((resolve) => {
12
+ const callback: MutationCallback = (mutations) => {
13
+ for (const { addedNodes } of mutations) {
14
+ for (const addedNode of addedNodes) {
15
+ const isSliderDot = isElement(addedNode) && addedNode.closest(`.${SLIDER_CSS_CLASSES.sliderDot}`);
16
+ if (!isSliderDot) continue;
17
+
18
+ resolve(undefined);
19
+ observer.disconnect();
20
+ return;
21
+ }
22
+ }
23
+ };
24
+
25
+ const observer = new MutationObserver(callback);
26
+ observer.observe(sliderNav, { childList: true });
27
+ });
28
+ };
@@ -0,0 +1,57 @@
1
+ import {
2
+ SLIDER_CSS_CLASSES,
3
+ type SliderElement,
4
+ type SliderNavElement,
5
+ waitAttributeLoaded,
6
+ } from '@finsweet/attributes-utils';
7
+
8
+ import { listenClickEvents } from './actions/events';
9
+ import { observeSliderNav } from './actions/observe';
10
+ import { populateSliderDots } from './actions/populate';
11
+ import { syncDotsProperties } from './actions/sync';
12
+ import { waitSliderReady } from './actions/wait';
13
+ import { getAttribute, getInstance, hasAttributeValue, queryElement } from './utils/selectors';
14
+
15
+ /**
16
+ * Generates the custom slider dots and inits syncing.
17
+ * @param slider The `SliderElement`.
18
+ */
19
+ export const createSliderDots = async (slider: SliderElement) => {
20
+ // Get slider elements
21
+ const instance = getInstance(slider);
22
+
23
+ const sliderNav = slider.querySelector<SliderNavElement>(`.${SLIDER_CSS_CLASSES.sliderNav}`);
24
+ const customSliderNav = queryElement<HTMLElement>('slider-nav', { instance }) || sliderNav;
25
+
26
+ if (!sliderNav || !customSliderNav) return;
27
+
28
+ // Make sure CMSSlider has finished (if existing on the page)
29
+ const listSliderAttribute = window.FinsweetAttributes.process.has('list');
30
+ if (listSliderAttribute) {
31
+ await Promise.all([waitAttributeLoaded('list'), waitSliderReady(sliderNav)]);
32
+ }
33
+
34
+ // Get props
35
+
36
+ const activeCustomDotCSSClass = getAttribute(slider, 'active');
37
+
38
+ // Clear the custom slider nav content
39
+ const clearCustomSliderContent = hasAttributeValue(customSliderNav, 'remove', 'true');
40
+ if (clearCustomSliderContent) customSliderNav.innerHTML = '';
41
+
42
+ // Populate the dots
43
+ const dotsRelationship = populateSliderDots(slider, customSliderNav);
44
+
45
+ // Init sync
46
+ for (const relationshipData of dotsRelationship) {
47
+ syncDotsProperties(relationshipData, activeCustomDotCSSClass);
48
+ }
49
+
50
+ const observer = observeSliderNav(sliderNav, dotsRelationship, activeCustomDotCSSClass);
51
+ const removeClickListener = listenClickEvents(customSliderNav, dotsRelationship);
52
+
53
+ return () => {
54
+ observer.disconnect();
55
+ removeClickListener();
56
+ };
57
+ };
@@ -0,0 +1,3 @@
1
+ export { version } from '../package.json';
2
+ export { init } from './init';
3
+ export { ELEMENTS, SETTINGS } from './utils/constants';
@@ -0,0 +1,30 @@
1
+ import {
2
+ type FinsweetAttributeInit,
3
+ isNotEmpty,
4
+ SLIDER_CSS_CLASSES,
5
+ type SliderElement,
6
+ waitWebflowReady,
7
+ } from '@finsweet/attributes-utils';
8
+
9
+ import { createSliderDots } from './factory';
10
+ import { getElementSelector } from './utils/selectors';
11
+
12
+ /**
13
+ * Inits the custom slider dots.
14
+ */
15
+ export const init: FinsweetAttributeInit = async () => {
16
+ await waitWebflowReady();
17
+
18
+ const sliders = [
19
+ ...document.querySelectorAll<SliderElement>(`.${SLIDER_CSS_CLASSES.slider}${getElementSelector('slider')}`),
20
+ ];
21
+
22
+ const cleanups = (await Promise.all(sliders.map(createSliderDots))).filter(isNotEmpty);
23
+
24
+ return {
25
+ result: sliders,
26
+ destroy() {
27
+ for (const cleanup of cleanups) cleanup();
28
+ },
29
+ };
30
+ };
@@ -0,0 +1,33 @@
1
+ import { type AttributeElements, type AttributeSettings, SLIDER_DOTS_ATTRIBUTE } from '@finsweet/attributes-utils';
2
+
3
+ export const ELEMENTS = [
4
+ /**
5
+ * Defines a slider to instantiate.
6
+ */
7
+ 'slider',
8
+
9
+ /**
10
+ * Defines the content to be added to the slider dot.
11
+ */
12
+ 'content',
13
+
14
+ /**
15
+ * Defines a custom Slide Nav.
16
+ */
17
+ 'slider-nav',
18
+ ] as const satisfies AttributeElements;
19
+
20
+ export const SETTINGS = {
21
+ /**
22
+ * Defines the `active` CSS class.
23
+ */
24
+ active: { key: 'active', defaultValue: `is-${SLIDER_DOTS_ATTRIBUTE}-active` },
25
+
26
+ /**
27
+ * Defines if the content should be removed or just duplicated.
28
+ */
29
+ remove: {
30
+ key: 'remove',
31
+ values: ['true'],
32
+ },
33
+ } as const satisfies AttributeSettings;
@@ -0,0 +1,9 @@
1
+ import { generateSelectors, SLIDER_DOTS_ATTRIBUTE } from '@finsweet/attributes-utils';
2
+
3
+ import { ELEMENTS, SETTINGS } from './constants';
4
+
5
+ export const { getInstance, queryElement, getAttribute, hasAttributeValue, getElementSelector } = generateSelectors(
6
+ SLIDER_DOTS_ATTRIBUTE,
7
+ ELEMENTS,
8
+ SETTINGS
9
+ );
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Defines the relationship between an original Slider Dot and its relative Custom Slider Dot.
3
+ */
4
+ export type DotsRelationship = Array<{
5
+ dot: HTMLElement;
6
+ customDot: HTMLElement;
7
+ }>;
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "../../tsconfig.json"
3
+ }