@hortonstudio/main 1.2.11 → 1.2.13

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 (489) hide show
  1. package/index.js +23 -10
  2. package/package.json +17 -6
  3. package/.claude/settings.local.json +0 -21
  4. package/animations/hero.js +0 -599
  5. package/animations/text.js +0 -369
  6. package/animations/transition.js +0 -57
  7. package/attributes-master/.changeset/README.md +0 -8
  8. package/attributes-master/.changeset/config.json +0 -11
  9. package/attributes-master/.gitattributes +0 -2
  10. package/attributes-master/.github/ISSUE_TEMPLATE/bug_report.md +0 -42
  11. package/attributes-master/.github/ISSUE_TEMPLATE/feature_request.md +0 -22
  12. package/attributes-master/.github/workflows/ci.yml +0 -66
  13. package/attributes-master/.github/workflows/release.yml +0 -40
  14. package/attributes-master/.prettierignore +0 -3
  15. package/attributes-master/.prettierrc +0 -8
  16. package/attributes-master/.vscode/extensions.json +0 -3
  17. package/attributes-master/.vscode/settings.json +0 -7
  18. package/attributes-master/CONTRIBUTING.md +0 -72
  19. package/attributes-master/LICENSE.md +0 -201
  20. package/attributes-master/README.md +0 -31
  21. package/attributes-master/eslint.config.js +0 -3
  22. package/attributes-master/package.json +0 -34
  23. package/attributes-master/packages/accordion/CHANGELOG.md +0 -89
  24. package/attributes-master/packages/accordion/README.md +0 -31
  25. package/attributes-master/packages/accordion/package.json +0 -25
  26. package/attributes-master/packages/accordion/src/actions/a11y.ts +0 -39
  27. package/attributes-master/packages/accordion/src/actions/classes.ts +0 -27
  28. package/attributes-master/packages/accordion/src/actions/content.ts +0 -42
  29. package/attributes-master/packages/accordion/src/actions/list.ts +0 -36
  30. package/attributes-master/packages/accordion/src/actions/query.ts +0 -27
  31. package/attributes-master/packages/accordion/src/actions/settings.ts +0 -61
  32. package/attributes-master/packages/accordion/src/factory.ts +0 -145
  33. package/attributes-master/packages/accordion/src/index.ts +0 -3
  34. package/attributes-master/packages/accordion/src/init.ts +0 -37
  35. package/attributes-master/packages/accordion/src/utils/constants.ts +0 -62
  36. package/attributes-master/packages/accordion/src/utils/helpers.ts +0 -5
  37. package/attributes-master/packages/accordion/src/utils/selectors.ts +0 -12
  38. package/attributes-master/packages/accordion/src/utils/types.ts +0 -23
  39. package/attributes-master/packages/accordion/tsconfig.json +0 -3
  40. package/attributes-master/packages/attributes/CHANGELOG.md +0 -564
  41. package/attributes-master/packages/attributes/README.md +0 -66
  42. package/attributes-master/packages/attributes/bin/build.ts +0 -107
  43. package/attributes-master/packages/attributes/bin/live-reload.js +0 -1
  44. package/attributes-master/packages/attributes/package.json +0 -77
  45. package/attributes-master/packages/attributes/playwright.config.ts +0 -89
  46. package/attributes-master/packages/attributes/src/attributes.ts +0 -153
  47. package/attributes-master/packages/attributes/src/load.ts +0 -125
  48. package/attributes-master/packages/attributes/tests/accordion.spec.ts +0 -137
  49. package/attributes-master/packages/attributes/tests/codehighlight.spec.ts +0 -23
  50. package/attributes-master/packages/attributes/tests/combobox.spec.ts +0 -321
  51. package/attributes-master/packages/attributes/tests/copyclip.spec.ts +0 -19
  52. package/attributes-master/packages/attributes/tests/displayvalues.spec.ts +0 -48
  53. package/attributes-master/packages/attributes/tests/favcustom.spec.ts +0 -23
  54. package/attributes-master/packages/attributes/tests/inject.spec.ts +0 -40
  55. package/attributes-master/packages/attributes/tests/inputactive.spec.ts +0 -77
  56. package/attributes-master/packages/attributes/tests/inputcounter.spec.ts +0 -83
  57. package/attributes-master/packages/attributes/tests/list.spec.ts +0 -800
  58. package/attributes-master/packages/attributes/tests/mirrorclick.spec.ts +0 -22
  59. package/attributes-master/packages/attributes/tests/mirrorinput.spec.ts +0 -37
  60. package/attributes-master/packages/attributes/tests/modal.spec.ts +0 -34
  61. package/attributes-master/packages/attributes/tests/numbercount.spec.ts +0 -40
  62. package/attributes-master/packages/attributes/tests/readtime.spec.ts +0 -19
  63. package/attributes-master/packages/attributes/tests/selectcustom.spec.ts +0 -51
  64. package/attributes-master/packages/attributes/tests/socialshare.spec.ts +0 -54
  65. package/attributes-master/packages/attributes/tests/starrating.spec.ts +0 -79
  66. package/attributes-master/packages/attributes/tests/toc.spec.ts +0 -38
  67. package/attributes-master/packages/attributes/tests/utils/index.ts +0 -16
  68. package/attributes-master/packages/attributes/tsconfig.json +0 -6
  69. package/attributes-master/packages/autovideo/CHANGELOG.md +0 -182
  70. package/attributes-master/packages/autovideo/README.md +0 -31
  71. package/attributes-master/packages/autovideo/package.json +0 -22
  72. package/attributes-master/packages/autovideo/src/index.ts +0 -3
  73. package/attributes-master/packages/autovideo/src/init.ts +0 -52
  74. package/attributes-master/packages/autovideo/src/types.ts +0 -5
  75. package/attributes-master/packages/autovideo/src/utils/constants.ts +0 -4
  76. package/attributes-master/packages/autovideo/tsconfig.json +0 -3
  77. package/attributes-master/packages/codehighlight/CHANGELOG.md +0 -185
  78. package/attributes-master/packages/codehighlight/README.md +0 -27
  79. package/attributes-master/packages/codehighlight/package.json +0 -23
  80. package/attributes-master/packages/codehighlight/src/actions/import.ts +0 -50
  81. package/attributes-master/packages/codehighlight/src/index.ts +0 -3
  82. package/attributes-master/packages/codehighlight/src/init.ts +0 -53
  83. package/attributes-master/packages/codehighlight/src/utils/constants.ts +0 -24
  84. package/attributes-master/packages/codehighlight/src/utils/selectors.ts +0 -5
  85. package/attributes-master/packages/codehighlight/src/utils/themes.ts +0 -202
  86. package/attributes-master/packages/codehighlight/tsconfig.json +0 -3
  87. package/attributes-master/packages/combobox/CHANGELOG.md +0 -99
  88. package/attributes-master/packages/combobox/README.md +0 -27
  89. package/attributes-master/packages/combobox/package.json +0 -23
  90. package/attributes-master/packages/combobox/src/actions/a11y.ts +0 -29
  91. package/attributes-master/packages/combobox/src/actions/body/index.ts +0 -12
  92. package/attributes-master/packages/combobox/src/actions/clearDropdown/index.ts +0 -37
  93. package/attributes-master/packages/combobox/src/actions/dropdownList/index.ts +0 -220
  94. package/attributes-master/packages/combobox/src/actions/dropdownToggle/index.ts +0 -34
  95. package/attributes-master/packages/combobox/src/actions/events.ts +0 -75
  96. package/attributes-master/packages/combobox/src/actions/input/index.ts +0 -235
  97. package/attributes-master/packages/combobox/src/actions/observe.ts +0 -158
  98. package/attributes-master/packages/combobox/src/actions/populate.ts +0 -97
  99. package/attributes-master/packages/combobox/src/actions/selectElement/index.ts +0 -23
  100. package/attributes-master/packages/combobox/src/actions/settings.ts +0 -134
  101. package/attributes-master/packages/combobox/src/actions/state.ts +0 -34
  102. package/attributes-master/packages/combobox/src/index.ts +0 -3
  103. package/attributes-master/packages/combobox/src/init.ts +0 -52
  104. package/attributes-master/packages/combobox/src/utils/constants.ts +0 -48
  105. package/attributes-master/packages/combobox/src/utils/dropdowns.ts +0 -120
  106. package/attributes-master/packages/combobox/src/utils/index.ts +0 -1
  107. package/attributes-master/packages/combobox/src/utils/selectors.ts +0 -9
  108. package/attributes-master/packages/combobox/src/utils/types.ts +0 -14
  109. package/attributes-master/packages/combobox/tsconfig.json +0 -3
  110. package/attributes-master/packages/copyclip/CHANGELOG.md +0 -213
  111. package/attributes-master/packages/copyclip/README.md +0 -27
  112. package/attributes-master/packages/copyclip/package.json +0 -23
  113. package/attributes-master/packages/copyclip/src/factory.ts +0 -67
  114. package/attributes-master/packages/copyclip/src/index.ts +0 -3
  115. package/attributes-master/packages/copyclip/src/init.ts +0 -68
  116. package/attributes-master/packages/copyclip/src/utils/constants.ts +0 -40
  117. package/attributes-master/packages/copyclip/src/utils/selectors.ts +0 -9
  118. package/attributes-master/packages/copyclip/tsconfig.json +0 -3
  119. package/attributes-master/packages/displayvalues/CHANGELOG.md +0 -164
  120. package/attributes-master/packages/displayvalues/README.md +0 -27
  121. package/attributes-master/packages/displayvalues/package.json +0 -22
  122. package/attributes-master/packages/displayvalues/src/actions/collect.ts +0 -17
  123. package/attributes-master/packages/displayvalues/src/actions/events.ts +0 -22
  124. package/attributes-master/packages/displayvalues/src/actions/sync.ts +0 -23
  125. package/attributes-master/packages/displayvalues/src/index.ts +0 -3
  126. package/attributes-master/packages/displayvalues/src/init.ts +0 -31
  127. package/attributes-master/packages/displayvalues/src/utils/constants.ts +0 -20
  128. package/attributes-master/packages/displayvalues/src/utils/selectors.ts +0 -9
  129. package/attributes-master/packages/displayvalues/src/utils/stores.ts +0 -3
  130. package/attributes-master/packages/displayvalues/tsconfig.json +0 -3
  131. package/attributes-master/packages/docs/CHANGELOG.md +0 -108
  132. package/attributes-master/packages/docs/README.md +0 -3
  133. package/attributes-master/packages/docs/bin/build.js +0 -92
  134. package/attributes-master/packages/docs/bin/live-reload.js +0 -1
  135. package/attributes-master/packages/docs/package.json +0 -40
  136. package/attributes-master/packages/docs/src/copy.ts +0 -260
  137. package/attributes-master/packages/docs/src/x-ray.ts +0 -377
  138. package/attributes-master/packages/docs/tsconfig.json +0 -3
  139. package/attributes-master/packages/favcustom/CHANGELOG.md +0 -194
  140. package/attributes-master/packages/favcustom/README.md +0 -27
  141. package/attributes-master/packages/favcustom/package.json +0 -22
  142. package/attributes-master/packages/favcustom/src/index.ts +0 -3
  143. package/attributes-master/packages/favcustom/src/init.ts +0 -30
  144. package/attributes-master/packages/favcustom/src/utils/constants.ts +0 -10
  145. package/attributes-master/packages/favcustom/src/utils/selectors.ts +0 -5
  146. package/attributes-master/packages/favcustom/tsconfig.json +0 -3
  147. package/attributes-master/packages/formsubmit/CHANGELOG.md +0 -161
  148. package/attributes-master/packages/formsubmit/README.md +0 -51
  149. package/attributes-master/packages/formsubmit/package.json +0 -22
  150. package/attributes-master/packages/formsubmit/src/actions/redirect.ts +0 -9
  151. package/attributes-master/packages/formsubmit/src/actions/reset.ts +0 -49
  152. package/attributes-master/packages/formsubmit/src/actions/submit.ts +0 -34
  153. package/attributes-master/packages/formsubmit/src/components/Form.ts +0 -231
  154. package/attributes-master/packages/formsubmit/src/factory.ts +0 -62
  155. package/attributes-master/packages/formsubmit/src/index.ts +0 -3
  156. package/attributes-master/packages/formsubmit/src/init.ts +0 -24
  157. package/attributes-master/packages/formsubmit/src/utils/attributes.ts +0 -19
  158. package/attributes-master/packages/formsubmit/src/utils/constants.ts +0 -89
  159. package/attributes-master/packages/formsubmit/src/utils/dom.ts +0 -76
  160. package/attributes-master/packages/formsubmit/src/utils/selectors.ts +0 -9
  161. package/attributes-master/packages/formsubmit/src/utils/types.ts +0 -7
  162. package/attributes-master/packages/formsubmit/tsconfig.json +0 -3
  163. package/attributes-master/packages/inject/CHANGELOG.md +0 -117
  164. package/attributes-master/packages/inject/README.md +0 -60
  165. package/attributes-master/packages/inject/package.json +0 -22
  166. package/attributes-master/packages/inject/src/actions/collect.ts +0 -125
  167. package/attributes-master/packages/inject/src/actions/css.ts +0 -27
  168. package/attributes-master/packages/inject/src/actions/prefetch.ts +0 -44
  169. package/attributes-master/packages/inject/src/factory.ts +0 -123
  170. package/attributes-master/packages/inject/src/index.ts +0 -3
  171. package/attributes-master/packages/inject/src/init.ts +0 -22
  172. package/attributes-master/packages/inject/src/utils/constants.ts +0 -89
  173. package/attributes-master/packages/inject/src/utils/helpers.ts +0 -36
  174. package/attributes-master/packages/inject/src/utils/selectors.ts +0 -9
  175. package/attributes-master/packages/inject/src/utils/types.ts +0 -16
  176. package/attributes-master/packages/inject/tsconfig.json +0 -3
  177. package/attributes-master/packages/inputactive/CHANGELOG.md +0 -58
  178. package/attributes-master/packages/inputactive/README.md +0 -25
  179. package/attributes-master/packages/inputactive/package.json +0 -22
  180. package/attributes-master/packages/inputactive/src/actions/classes.ts +0 -43
  181. package/attributes-master/packages/inputactive/src/factory.ts +0 -24
  182. package/attributes-master/packages/inputactive/src/index.ts +0 -3
  183. package/attributes-master/packages/inputactive/src/init.ts +0 -18
  184. package/attributes-master/packages/inputactive/src/utils/constants.ts +0 -13
  185. package/attributes-master/packages/inputactive/src/utils/selectors.ts +0 -5
  186. package/attributes-master/packages/inputactive/tsconfig.json +0 -3
  187. package/attributes-master/packages/inputcounter/CHANGELOG.md +0 -110
  188. package/attributes-master/packages/inputcounter/README.md +0 -25
  189. package/attributes-master/packages/inputcounter/package.json +0 -22
  190. package/attributes-master/packages/inputcounter/src/actions/a11y.ts +0 -23
  191. package/attributes-master/packages/inputcounter/src/actions/buttons.ts +0 -61
  192. package/attributes-master/packages/inputcounter/src/actions/input.ts +0 -31
  193. package/attributes-master/packages/inputcounter/src/actions/style.ts +0 -12
  194. package/attributes-master/packages/inputcounter/src/factory.ts +0 -51
  195. package/attributes-master/packages/inputcounter/src/index.ts +0 -3
  196. package/attributes-master/packages/inputcounter/src/init.ts +0 -22
  197. package/attributes-master/packages/inputcounter/src/utils/constants.ts +0 -59
  198. package/attributes-master/packages/inputcounter/src/utils/selectors.ts +0 -9
  199. package/attributes-master/packages/inputcounter/tsconfig.json +0 -3
  200. package/attributes-master/packages/list/CHANGELOG.md +0 -185
  201. package/attributes-master/packages/list/README.md +0 -331
  202. package/attributes-master/packages/list/package.json +0 -37
  203. package/attributes-master/packages/list/src/combine/index.ts +0 -38
  204. package/attributes-master/packages/list/src/components/List.ts +0 -861
  205. package/attributes-master/packages/list/src/components/ListItem.ts +0 -229
  206. package/attributes-master/packages/list/src/components/index.ts +0 -2
  207. package/attributes-master/packages/list/src/factory.ts +0 -130
  208. package/attributes-master/packages/list/src/filter/dynamic/conditions.ts +0 -639
  209. package/attributes-master/packages/list/src/filter/dynamic/groups.ts +0 -221
  210. package/attributes-master/packages/list/src/filter/dynamic/index.ts +0 -119
  211. package/attributes-master/packages/list/src/filter/dynamic/utils.ts +0 -44
  212. package/attributes-master/packages/list/src/filter/elements.ts +0 -93
  213. package/attributes-master/packages/list/src/filter/filter.ts +0 -118
  214. package/attributes-master/packages/list/src/filter/filter.worker.ts +0 -152
  215. package/attributes-master/packages/list/src/filter/index.ts +0 -94
  216. package/attributes-master/packages/list/src/filter/standard/conditions.ts +0 -123
  217. package/attributes-master/packages/list/src/filter/standard/facets.ts +0 -253
  218. package/attributes-master/packages/list/src/filter/standard/index.ts +0 -176
  219. package/attributes-master/packages/list/src/filter/standard/query.ts +0 -111
  220. package/attributes-master/packages/list/src/filter/tags.ts +0 -314
  221. package/attributes-master/packages/list/src/filter/types.ts +0 -62
  222. package/attributes-master/packages/list/src/filter/utils.ts +0 -126
  223. package/attributes-master/packages/list/src/index.ts +0 -4
  224. package/attributes-master/packages/list/src/init.ts +0 -38
  225. package/attributes-master/packages/list/src/load/all.ts +0 -27
  226. package/attributes-master/packages/list/src/load/elements.ts +0 -39
  227. package/attributes-master/packages/list/src/load/index.ts +0 -63
  228. package/attributes-master/packages/list/src/load/infinite.ts +0 -79
  229. package/attributes-master/packages/list/src/load/load.ts +0 -191
  230. package/attributes-master/packages/list/src/load/more.ts +0 -97
  231. package/attributes-master/packages/list/src/load/pagination.ts +0 -402
  232. package/attributes-master/packages/list/src/nest/index.ts +0 -198
  233. package/attributes-master/packages/list/src/prevnext/index.ts +0 -98
  234. package/attributes-master/packages/list/src/select/index.ts +0 -56
  235. package/attributes-master/packages/list/src/slider/index.ts +0 -62
  236. package/attributes-master/packages/list/src/sort/buttons.ts +0 -96
  237. package/attributes-master/packages/list/src/sort/dropdown.ts +0 -179
  238. package/attributes-master/packages/list/src/sort/index.ts +0 -81
  239. package/attributes-master/packages/list/src/sort/query.ts +0 -63
  240. package/attributes-master/packages/list/src/sort/select.ts +0 -67
  241. package/attributes-master/packages/list/src/sort/sort.ts +0 -79
  242. package/attributes-master/packages/list/src/sort/types.ts +0 -28
  243. package/attributes-master/packages/list/src/static/index.ts +0 -73
  244. package/attributes-master/packages/list/src/tabs/index.ts +0 -97
  245. package/attributes-master/packages/list/src/utils/constants.ts +0 -728
  246. package/attributes-master/packages/list/src/utils/dom.ts +0 -108
  247. package/attributes-master/packages/list/src/utils/pagination.ts +0 -14
  248. package/attributes-master/packages/list/src/utils/selectors.ts +0 -18
  249. package/attributes-master/packages/list/src/utils/store.ts +0 -5
  250. package/attributes-master/packages/list/tsconfig.json +0 -3
  251. package/attributes-master/packages/mirrorclick/CHANGELOG.md +0 -171
  252. package/attributes-master/packages/mirrorclick/README.md +0 -25
  253. package/attributes-master/packages/mirrorclick/package.json +0 -22
  254. package/attributes-master/packages/mirrorclick/src/index.ts +0 -3
  255. package/attributes-master/packages/mirrorclick/src/init.ts +0 -35
  256. package/attributes-master/packages/mirrorclick/src/utils/constants.ts +0 -20
  257. package/attributes-master/packages/mirrorclick/src/utils/selectors.ts +0 -9
  258. package/attributes-master/packages/mirrorclick/tsconfig.json +0 -3
  259. package/attributes-master/packages/mirrorinput/CHANGELOG.md +0 -172
  260. package/attributes-master/packages/mirrorinput/README.md +0 -25
  261. package/attributes-master/packages/mirrorinput/package.json +0 -22
  262. package/attributes-master/packages/mirrorinput/src/index.ts +0 -3
  263. package/attributes-master/packages/mirrorinput/src/init.ts +0 -48
  264. package/attributes-master/packages/mirrorinput/src/utils/constants.ts +0 -15
  265. package/attributes-master/packages/mirrorinput/src/utils/selectors.ts +0 -9
  266. package/attributes-master/packages/mirrorinput/tsconfig.json +0 -3
  267. package/attributes-master/packages/modal/CHANGELOG.md +0 -94
  268. package/attributes-master/packages/modal/README.md +0 -29
  269. package/attributes-master/packages/modal/package.json +0 -23
  270. package/attributes-master/packages/modal/src/actions/a11y.ts +0 -46
  271. package/attributes-master/packages/modal/src/actions/modal.ts +0 -164
  272. package/attributes-master/packages/modal/src/actions/settings.ts +0 -21
  273. package/attributes-master/packages/modal/src/factory.ts +0 -26
  274. package/attributes-master/packages/modal/src/index.ts +0 -3
  275. package/attributes-master/packages/modal/src/init.ts +0 -22
  276. package/attributes-master/packages/modal/src/utils/constants.ts +0 -54
  277. package/attributes-master/packages/modal/src/utils/selectors.ts +0 -9
  278. package/attributes-master/packages/modal/src/utils/types.ts +0 -12
  279. package/attributes-master/packages/modal/tsconfig.json +0 -3
  280. package/attributes-master/packages/numbercount/CHANGELOG.md +0 -90
  281. package/attributes-master/packages/numbercount/README.md +0 -27
  282. package/attributes-master/packages/numbercount/package.json +0 -23
  283. package/attributes-master/packages/numbercount/src/actions/a11y.ts +0 -26
  284. package/attributes-master/packages/numbercount/src/actions/animate.ts +0 -43
  285. package/attributes-master/packages/numbercount/src/actions/observe.ts +0 -44
  286. package/attributes-master/packages/numbercount/src/factory.ts +0 -31
  287. package/attributes-master/packages/numbercount/src/index.ts +0 -3
  288. package/attributes-master/packages/numbercount/src/init.ts +0 -22
  289. package/attributes-master/packages/numbercount/src/utils/constants.ts +0 -40
  290. package/attributes-master/packages/numbercount/src/utils/helpers.ts +0 -31
  291. package/attributes-master/packages/numbercount/src/utils/selectors.ts +0 -9
  292. package/attributes-master/packages/numbercount/tsconfig.json +0 -3
  293. package/attributes-master/packages/queryparam/CHANGELOG.md +0 -118
  294. package/attributes-master/packages/queryparam/README.md +0 -25
  295. package/attributes-master/packages/queryparam/package.json +0 -22
  296. package/attributes-master/packages/queryparam/src/factory.ts +0 -51
  297. package/attributes-master/packages/queryparam/src/index.ts +0 -3
  298. package/attributes-master/packages/queryparam/src/init.ts +0 -40
  299. package/attributes-master/packages/queryparam/src/utils/constants.ts +0 -18
  300. package/attributes-master/packages/queryparam/src/utils/selectors.ts +0 -5
  301. package/attributes-master/packages/queryparam/tsconfig.json +0 -3
  302. package/attributes-master/packages/rangeslider/CHANGELOG.md +0 -236
  303. package/attributes-master/packages/rangeslider/README.md +0 -95
  304. package/attributes-master/packages/rangeslider/package.json +0 -23
  305. package/attributes-master/packages/rangeslider/src/actions/a11y.ts +0 -21
  306. package/attributes-master/packages/rangeslider/src/actions/events.ts +0 -9
  307. package/attributes-master/packages/rangeslider/src/actions/settings.ts +0 -97
  308. package/attributes-master/packages/rangeslider/src/actions/styles.ts +0 -10
  309. package/attributes-master/packages/rangeslider/src/actions/values.ts +0 -47
  310. package/attributes-master/packages/rangeslider/src/components/Fill.ts +0 -70
  311. package/attributes-master/packages/rangeslider/src/components/Handle.ts +0 -281
  312. package/attributes-master/packages/rangeslider/src/factory.ts +0 -100
  313. package/attributes-master/packages/rangeslider/src/index.ts +0 -3
  314. package/attributes-master/packages/rangeslider/src/init.ts +0 -194
  315. package/attributes-master/packages/rangeslider/src/utils/constants.ts +0 -87
  316. package/attributes-master/packages/rangeslider/src/utils/selectors.ts +0 -9
  317. package/attributes-master/packages/rangeslider/src/utils/types.ts +0 -6
  318. package/attributes-master/packages/rangeslider/tsconfig.json +0 -3
  319. package/attributes-master/packages/readtime/CHANGELOG.md +0 -108
  320. package/attributes-master/packages/readtime/README.md +0 -25
  321. package/attributes-master/packages/readtime/package.json +0 -22
  322. package/attributes-master/packages/readtime/src/factory.ts +0 -21
  323. package/attributes-master/packages/readtime/src/index.ts +0 -3
  324. package/attributes-master/packages/readtime/src/init.ts +0 -19
  325. package/attributes-master/packages/readtime/src/utils/constants.ts +0 -33
  326. package/attributes-master/packages/readtime/src/utils/selectors.ts +0 -9
  327. package/attributes-master/packages/readtime/tsconfig.json +0 -3
  328. package/attributes-master/packages/removequery/CHANGELOG.md +0 -8
  329. package/attributes-master/packages/removequery/README.md +0 -25
  330. package/attributes-master/packages/removequery/package.json +0 -22
  331. package/attributes-master/packages/removequery/src/index.ts +0 -3
  332. package/attributes-master/packages/removequery/src/init.ts +0 -18
  333. package/attributes-master/packages/removequery/src/utils/constants.ts +0 -5
  334. package/attributes-master/packages/removequery/tsconfig.json +0 -3
  335. package/attributes-master/packages/scrolldisable/CHANGELOG.md +0 -164
  336. package/attributes-master/packages/scrolldisable/README.md +0 -29
  337. package/attributes-master/packages/scrolldisable/package.json +0 -27
  338. package/attributes-master/packages/scrolldisable/src/click.ts +0 -40
  339. package/attributes-master/packages/scrolldisable/src/display.ts +0 -117
  340. package/attributes-master/packages/scrolldisable/src/index.ts +0 -3
  341. package/attributes-master/packages/scrolldisable/src/init.ts +0 -36
  342. package/attributes-master/packages/scrolldisable/src/scroll.ts +0 -63
  343. package/attributes-master/packages/scrolldisable/src/utils/constants.ts +0 -56
  344. package/attributes-master/packages/scrolldisable/src/utils/selectors.ts +0 -6
  345. package/attributes-master/packages/scrolldisable/tsconfig.json +0 -3
  346. package/attributes-master/packages/selectcustom/CHANGELOG.md +0 -242
  347. package/attributes-master/packages/selectcustom/README.md +0 -25
  348. package/attributes-master/packages/selectcustom/package.json +0 -23
  349. package/attributes-master/packages/selectcustom/src/actions/a11y.ts +0 -29
  350. package/attributes-master/packages/selectcustom/src/actions/events.ts +0 -159
  351. package/attributes-master/packages/selectcustom/src/actions/observe.ts +0 -83
  352. package/attributes-master/packages/selectcustom/src/actions/populate.ts +0 -67
  353. package/attributes-master/packages/selectcustom/src/actions/settings.ts +0 -68
  354. package/attributes-master/packages/selectcustom/src/actions/state.ts +0 -41
  355. package/attributes-master/packages/selectcustom/src/index.ts +0 -3
  356. package/attributes-master/packages/selectcustom/src/init.ts +0 -51
  357. package/attributes-master/packages/selectcustom/src/utils/constants.ts +0 -34
  358. package/attributes-master/packages/selectcustom/src/utils/selectors.ts +0 -9
  359. package/attributes-master/packages/selectcustom/src/utils/types.ts +0 -14
  360. package/attributes-master/packages/selectcustom/tsconfig.json +0 -3
  361. package/attributes-master/packages/sliderdots/CHANGELOG.md +0 -220
  362. package/attributes-master/packages/sliderdots/README.md +0 -27
  363. package/attributes-master/packages/sliderdots/package.json +0 -22
  364. package/attributes-master/packages/sliderdots/src/actions/events.ts +0 -26
  365. package/attributes-master/packages/sliderdots/src/actions/observe.ts +0 -40
  366. package/attributes-master/packages/sliderdots/src/actions/populate.ts +0 -46
  367. package/attributes-master/packages/sliderdots/src/actions/sync.ts +0 -28
  368. package/attributes-master/packages/sliderdots/src/actions/wait.ts +0 -28
  369. package/attributes-master/packages/sliderdots/src/factory.ts +0 -57
  370. package/attributes-master/packages/sliderdots/src/index.ts +0 -3
  371. package/attributes-master/packages/sliderdots/src/init.ts +0 -30
  372. package/attributes-master/packages/sliderdots/src/utils/constants.ts +0 -33
  373. package/attributes-master/packages/sliderdots/src/utils/selectors.ts +0 -9
  374. package/attributes-master/packages/sliderdots/src/utils/types.ts +0 -7
  375. package/attributes-master/packages/sliderdots/tsconfig.json +0 -3
  376. package/attributes-master/packages/smartlightbox/CHANGELOG.md +0 -203
  377. package/attributes-master/packages/smartlightbox/README.md +0 -25
  378. package/attributes-master/packages/smartlightbox/package.json +0 -22
  379. package/attributes-master/packages/smartlightbox/src/actions/collect.ts +0 -15
  380. package/attributes-master/packages/smartlightbox/src/actions/move.ts +0 -25
  381. package/attributes-master/packages/smartlightbox/src/index.ts +0 -3
  382. package/attributes-master/packages/smartlightbox/src/init.ts +0 -61
  383. package/attributes-master/packages/smartlightbox/src/utils/constants.ts +0 -31
  384. package/attributes-master/packages/smartlightbox/src/utils/selectors.ts +0 -9
  385. package/attributes-master/packages/smartlightbox/tsconfig.json +0 -3
  386. package/attributes-master/packages/socialshare/CHANGELOG.md +0 -170
  387. package/attributes-master/packages/socialshare/README.md +0 -25
  388. package/attributes-master/packages/socialshare/package.json +0 -25
  389. package/attributes-master/packages/socialshare/src/actions/collect.ts +0 -93
  390. package/attributes-master/packages/socialshare/src/actions/share.ts +0 -91
  391. package/attributes-master/packages/socialshare/src/actions/trigger.ts +0 -46
  392. package/attributes-master/packages/socialshare/src/factory.ts +0 -149
  393. package/attributes-master/packages/socialshare/src/index.ts +0 -3
  394. package/attributes-master/packages/socialshare/src/init.ts +0 -35
  395. package/attributes-master/packages/socialshare/src/utils/constants.ts +0 -94
  396. package/attributes-master/packages/socialshare/src/utils/dom.ts +0 -8
  397. package/attributes-master/packages/socialshare/src/utils/selectors.ts +0 -6
  398. package/attributes-master/packages/socialshare/src/utils/stores.ts +0 -10
  399. package/attributes-master/packages/socialshare/src/utils/types.ts +0 -34
  400. package/attributes-master/packages/socialshare/tsconfig.json +0 -3
  401. package/attributes-master/packages/starrating/CHANGELOG.md +0 -70
  402. package/attributes-master/packages/starrating/README.md +0 -25
  403. package/attributes-master/packages/starrating/package.json +0 -22
  404. package/attributes-master/packages/starrating/src/actions/classes.ts +0 -41
  405. package/attributes-master/packages/starrating/src/actions/events.ts +0 -80
  406. package/attributes-master/packages/starrating/src/factory.ts +0 -24
  407. package/attributes-master/packages/starrating/src/index.ts +0 -3
  408. package/attributes-master/packages/starrating/src/init.ts +0 -24
  409. package/attributes-master/packages/starrating/src/utils/constants.ts +0 -20
  410. package/attributes-master/packages/starrating/src/utils/helpers.ts +0 -63
  411. package/attributes-master/packages/starrating/src/utils/selectors.ts +0 -9
  412. package/attributes-master/packages/starrating/tsconfig.json +0 -3
  413. package/attributes-master/packages/template/README.md +0 -25
  414. package/attributes-master/packages/template/package.json +0 -22
  415. package/attributes-master/packages/template/src/actions/console.ts +0 -4
  416. package/attributes-master/packages/template/src/index.ts +0 -3
  417. package/attributes-master/packages/template/src/init.ts +0 -14
  418. package/attributes-master/packages/template/src/utils/constants.ts +0 -18
  419. package/attributes-master/packages/template/src/utils/selectors.ts +0 -5
  420. package/attributes-master/packages/template/tsconfig.json +0 -3
  421. package/attributes-master/packages/toc/CHANGELOG.md +0 -192
  422. package/attributes-master/packages/toc/README.md +0 -25
  423. package/attributes-master/packages/toc/package.json +0 -23
  424. package/attributes-master/packages/toc/src/actions/collect.ts +0 -136
  425. package/attributes-master/packages/toc/src/actions/create.ts +0 -44
  426. package/attributes-master/packages/toc/src/actions/events.ts +0 -29
  427. package/attributes-master/packages/toc/src/actions/observe.ts +0 -31
  428. package/attributes-master/packages/toc/src/actions/populate.ts +0 -68
  429. package/attributes-master/packages/toc/src/actions/prepare.ts +0 -25
  430. package/attributes-master/packages/toc/src/actions/scroll.ts +0 -33
  431. package/attributes-master/packages/toc/src/components/TOCItem.ts +0 -88
  432. package/attributes-master/packages/toc/src/factory.ts +0 -47
  433. package/attributes-master/packages/toc/src/index.ts +0 -3
  434. package/attributes-master/packages/toc/src/init.ts +0 -37
  435. package/attributes-master/packages/toc/src/utils/constants.ts +0 -55
  436. package/attributes-master/packages/toc/src/utils/helpers.ts +0 -23
  437. package/attributes-master/packages/toc/src/utils/selectors.ts +0 -6
  438. package/attributes-master/packages/toc/src/utils/types.ts +0 -21
  439. package/attributes-master/packages/toc/tsconfig.json +0 -3
  440. package/attributes-master/packages/utils/CHANGELOG.md +0 -43
  441. package/attributes-master/packages/utils/package.json +0 -27
  442. package/attributes-master/packages/utils/src/animations/factory.ts +0 -100
  443. package/attributes-master/packages/utils/src/animations/index.ts +0 -73
  444. package/attributes-master/packages/utils/src/animations/types.ts +0 -37
  445. package/attributes-master/packages/utils/src/components/Interaction.ts +0 -79
  446. package/attributes-master/packages/utils/src/components/Renderer.ts +0 -59
  447. package/attributes-master/packages/utils/src/components/index.ts +0 -2
  448. package/attributes-master/packages/utils/src/constants/a11y.ts +0 -50
  449. package/attributes-master/packages/utils/src/constants/attributes.ts +0 -57
  450. package/attributes-master/packages/utils/src/constants/index.ts +0 -5
  451. package/attributes-master/packages/utils/src/constants/keyboard.ts +0 -10
  452. package/attributes-master/packages/utils/src/constants/webflow.ts +0 -74
  453. package/attributes-master/packages/utils/src/helpers/dates.ts +0 -17
  454. package/attributes-master/packages/utils/src/helpers/dom.ts +0 -82
  455. package/attributes-master/packages/utils/src/helpers/events.ts +0 -59
  456. package/attributes-master/packages/utils/src/helpers/fetch.ts +0 -217
  457. package/attributes-master/packages/utils/src/helpers/forms.ts +0 -238
  458. package/attributes-master/packages/utils/src/helpers/guards.ts +0 -138
  459. package/attributes-master/packages/utils/src/helpers/index.ts +0 -11
  460. package/attributes-master/packages/utils/src/helpers/numbers.ts +0 -86
  461. package/attributes-master/packages/utils/src/helpers/selectors.ts +0 -249
  462. package/attributes-master/packages/utils/src/helpers/strings.ts +0 -19
  463. package/attributes-master/packages/utils/src/helpers/wait.ts +0 -36
  464. package/attributes-master/packages/utils/src/helpers/webflow.ts +0 -117
  465. package/attributes-master/packages/utils/src/index.ts +0 -5
  466. package/attributes-master/packages/utils/src/types/core.ts +0 -100
  467. package/attributes-master/packages/utils/src/types/dom.ts +0 -31
  468. package/attributes-master/packages/utils/src/types/index.ts +0 -4
  469. package/attributes-master/packages/utils/src/types/utils.ts +0 -20
  470. package/attributes-master/packages/utils/src/types/webflow.ts +0 -147
  471. package/attributes-master/packages/utils/tsconfig.json +0 -3
  472. package/attributes-master/packages/videohls/CHANGELOG.md +0 -76
  473. package/attributes-master/packages/videohls/README.md +0 -27
  474. package/attributes-master/packages/videohls/package.json +0 -26
  475. package/attributes-master/packages/videohls/src/actions/list.ts +0 -23
  476. package/attributes-master/packages/videohls/src/actions/video.ts +0 -44
  477. package/attributes-master/packages/videohls/src/index.ts +0 -3
  478. package/attributes-master/packages/videohls/src/init.ts +0 -28
  479. package/attributes-master/packages/videohls/src/utils/constants.ts +0 -12
  480. package/attributes-master/packages/videohls/src/utils/selectors.ts +0 -5
  481. package/attributes-master/packages/videohls/src/utils/stores.ts +0 -3
  482. package/attributes-master/packages/videohls/tsconfig.json +0 -3
  483. package/attributes-master/pnpm-lock.yaml +0 -3317
  484. package/attributes-master/pnpm-workspace.yaml +0 -3
  485. package/attributes-master/tsconfig.json +0 -6
  486. package/autoInit/smooth-scroll.js +0 -89
  487. package/utils/navbar.js +0 -214
  488. package/utils/scroll-progress.js +0 -29
  489. package/utils/toc.js +0 -77
@@ -1,221 +0,0 @@
1
- import { addListener, cloneNode } from '@finsweet/attributes-utils';
2
- import { effect, type ShallowRef, shallowRef, watch } from '@vue/reactivity';
3
-
4
- import type { List } from '../../components';
5
- import { getAttribute, queryElement } from '../../utils/selectors';
6
- import type { FilterMatch } from '../types';
7
- import { type Condition, initCondition, initConditionAdd, initConditionsMatch } from './conditions';
8
- import { getFilterMatchValue } from './utils';
9
-
10
- export type ConditionGroup = {
11
- id: string;
12
- element: HTMLElement;
13
- conditions: ShallowRef<Condition[]>;
14
- cleanup: () => void;
15
- };
16
-
17
- /**
18
- * Inits the condition groups match for a dynamic filters setup.
19
- * @param list
20
- * @param element
21
- * @param conditionGroups
22
- * @returns A cleanup function
23
- */
24
- export const initConditionGroupsMatch = (
25
- list: List,
26
- element: HTMLSelectElement,
27
- conditionGroups: ShallowRef<ConditionGroup[]>
28
- ) => {
29
- // TODO: support fs-list-filteron
30
- const inputCleanup = addListener(element, 'change', () => {
31
- list.filters.value.groupsMatch = getFilterMatchValue(element);
32
- });
33
-
34
- const disabledClass = getAttribute(element, 'dynamicdisabledclass');
35
-
36
- const runner = effect(() => {
37
- const disabled = conditionGroups.value.length <= 1;
38
-
39
- element.setAttribute('aria-disabled', disabled ? 'true' : 'false');
40
- element.classList.toggle(disabledClass, disabled);
41
- });
42
-
43
- return () => {
44
- inputCleanup();
45
- runner.effect.stop();
46
- };
47
- };
48
-
49
- /**
50
- * Inits the button to add a new condition group.
51
- * @param list
52
- * @param element
53
- * @param conditionGroupTemplate
54
- * @param conditionGroupsWrapper
55
- * @param conditionGroups
56
- * @returns A cleanup function
57
- */
58
- export const initConditionGroupsAdd = (
59
- list: List,
60
- element: HTMLElement,
61
- conditionGroupTemplate: HTMLElement,
62
- conditionGroupsWrapper: HTMLElement,
63
- conditionGroups: ShallowRef<ConditionGroup[]>
64
- ) => {
65
- const clickCleanup = addListener(element, 'click', () => {
66
- const clone = cloneNode(conditionGroupTemplate);
67
-
68
- const conditionGroup = initConditionGroup(list, clone, conditionGroups);
69
- if (!conditionGroup) return;
70
-
71
- const previousConditionGroup = conditionGroups.value[conditionGroups.value.length - 2];
72
-
73
- if (previousConditionGroup) {
74
- previousConditionGroup.element.after(conditionGroup.element);
75
- } else {
76
- conditionGroupsWrapper.append(conditionGroup.element);
77
- }
78
- });
79
-
80
- return clickCleanup;
81
- };
82
-
83
- /**
84
- * Inits the button to remove a condition group.
85
- * @param element
86
- * @param conditionGroup
87
- * @param conditionGroups
88
- * @returns A cleanup function
89
- */
90
- const initConditionGroupRemove = (
91
- element: HTMLElement,
92
- conditionGroup: ConditionGroup,
93
- conditionGroups: ShallowRef<ConditionGroup[]>
94
- ) => {
95
- const clickCleanup = addListener(element, 'click', () => {
96
- if (conditionGroups.value.length <= 1) return;
97
-
98
- conditionGroup.cleanup();
99
- });
100
-
101
- const disabledClass = getAttribute(element, 'dynamicdisabledclass');
102
-
103
- const runner = effect(() => {
104
- const disabled = conditionGroups.value.length <= 1;
105
-
106
- element.setAttribute('aria-disabled', disabled ? 'true' : 'false');
107
- element.classList.toggle(disabledClass, disabled);
108
- });
109
-
110
- return () => {
111
- clickCleanup();
112
- runner.effect.stop();
113
- };
114
- };
115
-
116
- /**
117
- * @returns The condition group with the given ID, or undefined if not found.
118
- * @param list
119
- * @param conditionGroup
120
- */
121
- export const getFiltersGroup = (list: List, conditionGroup: ConditionGroup) => {
122
- return list.filters.value.groups.find((group) => group.id === conditionGroup.id);
123
- };
124
-
125
- /**
126
- * Inits a condition group for a dynamic filters setup.
127
- * @param list
128
- * @param element
129
- * @param conditionGroups
130
- * @returns The condition group instance
131
- */
132
- export const initConditionGroup = (
133
- list: List,
134
- element: HTMLElement,
135
- conditionGroups: ShallowRef<ConditionGroup[]>
136
- ): ConditionGroup | undefined => {
137
- const conditionElement = queryElement('condition', { scope: element });
138
- if (!conditionElement) return;
139
-
140
- const conditionTemplate = cloneNode(conditionElement);
141
-
142
- // Store the condition group
143
- const id = crypto.randomUUID();
144
- const cleanups = new Set<() => void>();
145
-
146
- const conditionGroup: ConditionGroup = {
147
- id,
148
- element,
149
- conditions: shallowRef<Condition[]>([]),
150
-
151
- cleanup: () => {
152
- for (const condition of conditionGroup.conditions.value) {
153
- condition.cleanup();
154
- }
155
-
156
- for (const cleanup of cleanups) {
157
- cleanup();
158
- }
159
-
160
- cleanups.clear();
161
- element.remove();
162
-
163
- conditionGroups.value = conditionGroups.value.filter((group) => group.id !== id);
164
-
165
- const conditionGroupIndex = list.filters.value.groups.findIndex((group) => group.id === id);
166
- if (conditionGroupIndex === -1) return;
167
-
168
- list.filters.value.groups.splice(conditionGroupIndex, 1);
169
- },
170
- };
171
-
172
- // Handle condition matching
173
- let conditionsMatch: FilterMatch = 'and';
174
-
175
- const conditionsMatchSelect = queryElement<HTMLSelectElement>('condition-match', { scope: element });
176
- if (conditionsMatchSelect) {
177
- conditionsMatch = getFilterMatchValue(conditionsMatchSelect);
178
-
179
- const cleanup = initConditionsMatch(list, conditionsMatchSelect, conditionGroup);
180
- cleanups.add(cleanup);
181
- }
182
-
183
- // Store the group
184
- conditionGroups.value = [...conditionGroups.value, conditionGroup];
185
-
186
- list.filters.value.groups.push({
187
- id,
188
- conditionsMatch,
189
- conditions: [],
190
- });
191
-
192
- // Handle adding conditions to the group
193
- const conditionAddButton = queryElement('condition-add', { scope: element });
194
- if (conditionAddButton) {
195
- const cleanup = initConditionAdd(list, conditionAddButton, conditionTemplate, conditionGroup);
196
- cleanups.add(cleanup);
197
- }
198
-
199
- // Handle removing the group
200
- const conditionGroupRemoveButton = queryElement('condition-group-remove', { scope: element });
201
- if (conditionGroupRemoveButton) {
202
- const cleanup = initConditionGroupRemove(conditionGroupRemoveButton, conditionGroup, conditionGroups);
203
- cleanups.add(cleanup);
204
- }
205
-
206
- // Init default condition
207
- initCondition(list, conditionElement, conditionGroup);
208
-
209
- const autoCleanup = watch(
210
- () => getFiltersGroup(list, conditionGroup),
211
- (filtersGroup) => {
212
- if (!filtersGroup) {
213
- conditionGroup.cleanup();
214
- }
215
- }
216
- );
217
-
218
- cleanups.add(autoCleanup);
219
-
220
- return conditionGroup;
221
- };
@@ -1,119 +0,0 @@
1
- import { addListener, cloneNode } from '@finsweet/attributes-utils';
2
- import { shallowRef } from '@vue/reactivity';
3
-
4
- import type { List } from '../../components/List';
5
- import { getElementSelector, queryElement } from '../../utils/selectors';
6
- import { handleFiltersForm } from '../elements';
7
- import type { FilterMatch } from '../types';
8
- import { type ConditionGroup, initConditionGroup, initConditionGroupsAdd, initConditionGroupsMatch } from './groups';
9
- import { getFilterMatchValue } from './utils';
10
-
11
- /**
12
- * Inits dynamic filters for a list.
13
- * @param list
14
- * @param form
15
- * @returns A cleanup function
16
- */
17
- export const initDynamicFilters = (list: List, form: HTMLFormElement) => {
18
- const conditionGroupElement = queryElement('condition-group', { scope: form });
19
- if (!conditionGroupElement) return;
20
-
21
- const conditionGroupsWrapper = conditionGroupElement.parentElement;
22
- if (!conditionGroupsWrapper) return;
23
-
24
- const conditionGroupTemplate = cloneNode(conditionGroupElement);
25
- const conditionGroups = shallowRef<ConditionGroup[]>([]);
26
-
27
- const cleanups = new Set<() => void>();
28
-
29
- // Handle submissions
30
- const formElementCleanup = handleFiltersForm(form);
31
- cleanups.add(formElementCleanup);
32
-
33
- // Handle adding condition groups
34
- const conditionGroupAddButton =
35
- queryElement('condition-group-add', { scope: form }) || queryElement('condition-groups-add', { scope: form });
36
-
37
- if (conditionGroupAddButton) {
38
- const cleanup = initConditionGroupsAdd(
39
- list,
40
- conditionGroupAddButton,
41
- conditionGroupTemplate,
42
- conditionGroupsWrapper,
43
- conditionGroups
44
- );
45
-
46
- cleanups.add(cleanup);
47
- }
48
-
49
- // Handle condition groups matching
50
- let groupsMatch: FilterMatch = 'and';
51
-
52
- const conditionGroupMatchSelect =
53
- queryElement<HTMLSelectElement>('condition-group-match', { scope: form }) ||
54
- queryElement<HTMLSelectElement>('condition-groups-match', { scope: form });
55
-
56
- if (conditionGroupMatchSelect) {
57
- groupsMatch = getFilterMatchValue(conditionGroupMatchSelect);
58
-
59
- const cleanup = initConditionGroupsMatch(list, conditionGroupMatchSelect, conditionGroups);
60
- cleanups.add(cleanup);
61
- }
62
-
63
- list.filters.value.groupsMatch = groupsMatch;
64
-
65
- // Handle global clear buttons
66
- const clearCleanup = handleClearButtons(list);
67
- cleanups.add(clearCleanup);
68
-
69
- // Init default condition group
70
- initConditionGroup(list, conditionGroupElement, conditionGroups);
71
-
72
- return () => {
73
- for (const conditionGroup of conditionGroups.value) {
74
- conditionGroup.cleanup();
75
- }
76
-
77
- for (const cleanup of cleanups) {
78
- cleanup();
79
- }
80
-
81
- cleanups.clear();
82
- };
83
- };
84
-
85
- /**
86
- * Handles the clear buttons.
87
- * @param list
88
- * @returns A cleanup function.
89
- */
90
- const handleClearButtons = (list: List) => {
91
- return addListener(window, 'click', (e) => {
92
- const { target } = e;
93
-
94
- if (!(target instanceof Element)) return;
95
-
96
- const { instance, filters } = list;
97
-
98
- const clearElementSelector = getElementSelector('clear', { instance });
99
- const clearElement = target?.closest(clearElementSelector);
100
- if (!clearElement) return;
101
-
102
- list.settingFilters = true;
103
-
104
- // Remove all groups and conditions except the first one
105
- filters.value.groups.splice(1);
106
-
107
- const firstGroup = filters.value.groups[0];
108
- if (!firstGroup) return;
109
-
110
- firstGroup.conditions.splice(1);
111
-
112
- const firstCondition = firstGroup.conditions[0];
113
- if (!firstCondition) return;
114
-
115
- firstCondition.value = Array.isArray(firstCondition.value) ? [] : '';
116
-
117
- list.settingFilters = false;
118
- });
119
- };
@@ -1,44 +0,0 @@
1
- import { SETTINGS } from '../../utils/constants';
2
- import type { FilterMatch, FilterOperator } from '../types';
3
-
4
- const FIELD_REGEX = /\[field=(?:"([^"]*)"|([^\]]+))\]/;
5
- const OPERATOR_REGEX = new RegExp(`^(${SETTINGS.operator.values.join('|')})`);
6
- const FIELD_MATCH_VALUES = SETTINGS.fieldmatch.values.join('|');
7
- const FIELD_MATCH_REGEX = new RegExp(`\\[fieldmatch=(${FIELD_MATCH_VALUES}|"(${FIELD_MATCH_VALUES})")\\]`);
8
-
9
- /**
10
- * @returns The filter match value of a given select element.
11
- * @param selectElement
12
- */
13
- export const getFilterMatchValue = (selectElement: HTMLSelectElement): FilterMatch =>
14
- selectElement.value === 'or' ? 'or' : 'and';
15
-
16
- /**
17
- * Parses the operator and field match value from a condition operator selection.
18
- * @param value
19
- * @returns The operator, field key, field match, and filter match, if found.
20
- */
21
- export const parseOperatorValue = (
22
- value: string
23
- ): { op?: FilterOperator; fieldKey?: string; fieldMatch?: FilterMatch } => {
24
- let op: FilterOperator | undefined;
25
- let fieldKey: string | undefined;
26
- let fieldMatch: FilterMatch | undefined;
27
-
28
- const opMatch = value.match(OPERATOR_REGEX);
29
- if (opMatch) {
30
- op = opMatch[1] as FilterOperator;
31
- }
32
-
33
- const fieldKeyMatch = value.match(FIELD_REGEX);
34
- if (fieldKeyMatch) {
35
- fieldKey = fieldKeyMatch[1] || fieldKeyMatch[2];
36
- }
37
-
38
- const fieldMatchMatch = value.match(FIELD_MATCH_REGEX);
39
- if (fieldMatchMatch) {
40
- fieldMatch = (fieldMatchMatch[2] || fieldMatchMatch[1]) as FilterMatch;
41
- }
42
-
43
- return { op, fieldKey, fieldMatch };
44
- };
@@ -1,93 +0,0 @@
1
- import {
2
- addListener,
3
- type FormField,
4
- getFormFieldWrapper,
5
- getRadioGroupInputs,
6
- isFormField,
7
- } from '@finsweet/attributes-utils';
8
- import { effect } from '@vue/reactivity';
9
-
10
- import type { List } from '../components';
11
- import { getAttribute, hasAttributeValue } from '../utils/selectors';
12
-
13
- /**
14
- * Handles the filter-specific elements like the list element, empty element, and results count element.
15
- * @param list
16
- * @returns A cleanup function.
17
- */
18
- export const handleFilterElements = (list: List) => {
19
- const elementsRunner = effect(() => {
20
- const filteredItems = list.hooks.filter.result.value;
21
-
22
- // Results count
23
- if (list.resultsCountElement) {
24
- list.resultsCountElement.textContent = `${filteredItems.length}`;
25
- }
26
- });
27
-
28
- return () => elementsRunner.effect.stop();
29
- };
30
-
31
- /**
32
- * Handles submit events for filters form.
33
- * Handles the active class for form fields.
34
- * @param form
35
- * @returns A cleanup function.
36
- */
37
- export const handleFiltersForm = (form: HTMLFormElement) => {
38
- const allowSubmit = hasAttributeValue(form, 'allowsubmit', 'true');
39
-
40
- const submitCleanup = addListener(form, 'submit', (e) => {
41
- if (!allowSubmit) {
42
- e.preventDefault();
43
- e.stopPropagation();
44
- }
45
- });
46
-
47
- const changeCleanup = addListener(form, 'change', (e) => {
48
- const { target } = e;
49
-
50
- if (!isFormField(target)) return;
51
-
52
- setActiveClass(target);
53
- });
54
-
55
- return () => {
56
- submitCleanup();
57
- changeCleanup();
58
- };
59
- };
60
-
61
- /**
62
- * Sets the active class to a form field.
63
- * @param formField
64
- */
65
- const setActiveClass = (formField: FormField) => {
66
- const activeClass = getAttribute(formField, 'activeclass');
67
-
68
- switch (formField.type) {
69
- case 'checkbox': {
70
- const { checked } = formField as HTMLInputElement;
71
- const target = getFormFieldWrapper(formField);
72
-
73
- target.classList.toggle(activeClass, checked);
74
- break;
75
- }
76
-
77
- case 'radio': {
78
- const groupRadios = getRadioGroupInputs(formField);
79
-
80
- for (const radio of groupRadios) {
81
- const target = getFormFieldWrapper(radio);
82
-
83
- target.classList.toggle(activeClass, radio.checked);
84
- }
85
-
86
- break;
87
- }
88
-
89
- default: {
90
- formField.classList.toggle(activeClass, !!formField.value);
91
- }
92
- }
93
- };
@@ -1,118 +0,0 @@
1
- import { toRaw } from '@vue/reactivity';
2
-
3
- import type { ListItem } from '../components/ListItem';
4
- // @ts-expect-error - FilterWorker is not recognized by TypeScript
5
- import FilterWorker from './filter.worker.js';
6
- import type { Filters, FilterTask, FilterTaskData, FilterTaskItem, FilterTaskResult } from './types';
7
-
8
- const WORKER_POOL_SIZE = navigator.hardwareConcurrency || 4;
9
-
10
- const workers: Worker[] = Array.from({ length: WORKER_POOL_SIZE }, () => new FilterWorker());
11
- const freeWorkers = workers.slice();
12
- const taskQueue: FilterTask[] = [];
13
-
14
- /**
15
- * Processes a filter task using a worker.
16
- * Once finished, it will process the next task in the queue.
17
- * @param worker
18
- * @param task
19
- */
20
- const processFilterTask = (worker: FilterWorker, task: FilterTask) => {
21
- const controller = new AbortController();
22
- const { signal } = controller;
23
-
24
- const conclude = () => {
25
- controller.abort();
26
-
27
- const nextTask = taskQueue.shift();
28
- if (nextTask) {
29
- processFilterTask(worker, nextTask);
30
- } else {
31
- freeWorkers.push(worker);
32
- }
33
- };
34
-
35
- worker.addEventListener(
36
- 'message',
37
- (event: MessageEvent<FilterTaskResult>) => {
38
- task.resolve(event.data);
39
- conclude();
40
- },
41
- { signal, once: true }
42
- );
43
-
44
- worker.addEventListener(
45
- 'error',
46
- (error: string | Event) => {
47
- task.reject(error);
48
- conclude();
49
- },
50
- { signal, once: true }
51
- );
52
-
53
- worker.postMessage(task.data);
54
- };
55
-
56
- /**
57
- * Queues a filter task to be processed.
58
- * @param task
59
- */
60
- const queueFilterTask = (task: FilterTask) => {
61
- const worker = freeWorkers.pop();
62
- if (worker) {
63
- processFilterTask(worker, task);
64
- } else {
65
- taskQueue.push(task);
66
- }
67
- };
68
-
69
- /**
70
- * Runs a filter task.
71
- * @param data
72
- * @returns A promise that resolves with the filtered items.
73
- */
74
- const runFilterTask = (data: FilterTaskData) => {
75
- return new Promise<FilterTaskResult>((resolve, reject) => {
76
- queueFilterTask({ data, resolve, reject });
77
- });
78
- };
79
-
80
- /**
81
- * Filters the provided items based on the provided filters.
82
- * @param filters
83
- * @param items
84
- * @param highlight
85
- * @returns The filtered items.
86
- */
87
- export const filterItems = async (filters: Filters, items: ListItem[], highlight?: boolean) => {
88
- const itemsMap = new Map<string, ListItem>();
89
- const itemsData = items.map<FilterTaskItem>((item) => {
90
- itemsMap.set(item.id, item);
91
-
92
- const { id, fields } = item;
93
-
94
- return { id, fields, matchedFields: {} };
95
- });
96
-
97
- const filteredItems = await runFilterTask({ items: itemsData, filters: toRaw(filters) });
98
-
99
- const result = filteredItems.map(({ id, matchedFields }) => {
100
- const item = itemsMap.get(id)!;
101
-
102
- itemsMap.delete(id);
103
-
104
- // Highlight the matched fields
105
- if (highlight) {
106
- item.highlight(matchedFields);
107
- }
108
-
109
- return item;
110
- });
111
-
112
- // Reset the highlight for the remaining items
113
- if (highlight) {
114
- itemsMap.forEach((item) => item.highlight({}));
115
- }
116
-
117
- return result;
118
- };