@splendidlabz/utils 1.11.2 → 1.11.3

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 (305) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/package.json +2 -2
  3. package/src/lib/objects/omit-empty.js +1 -1
  4. package/src/lib/strings/markdown.spec.js +73 -0
  5. package/src/node/context.js +0 -0
  6. package/src/node/file-cache.js +1 -1
  7. package/src/node/pkce.js +1 -1
  8. package/tsup.config.mjs +19 -1
  9. package/dist/cjs/dom/accessibility.cjs +0 -51
  10. package/dist/cjs/dom/actions/index.cjs +0 -25
  11. package/dist/cjs/dom/actions/masonry.cjs +0 -61
  12. package/dist/cjs/dom/actions/prefer-horizontal-scroll.cjs +0 -113
  13. package/dist/cjs/dom/actions/sticky.cjs +0 -93
  14. package/dist/cjs/dom/bounding-box.cjs +0 -68
  15. package/dist/cjs/dom/clipboard.cjs +0 -35
  16. package/dist/cjs/dom/cookie.cjs +0 -55
  17. package/dist/cjs/dom/css-vars.cjs +0 -47
  18. package/dist/cjs/dom/events.cjs +0 -57
  19. package/dist/cjs/dom/focusable.cjs +0 -141
  20. package/dist/cjs/dom/font-size.cjs +0 -68
  21. package/dist/cjs/dom/get-element.cjs +0 -96
  22. package/dist/cjs/dom/hash.cjs +0 -33
  23. package/dist/cjs/dom/index.cjs +0 -65
  24. package/dist/cjs/dom/keyboard.cjs +0 -49
  25. package/dist/cjs/dom/local-store.cjs +0 -77
  26. package/dist/cjs/dom/media.cjs +0 -57
  27. package/dist/cjs/dom/observers/index.cjs +0 -27
  28. package/dist/cjs/dom/observers/intersection-observer.cjs +0 -59
  29. package/dist/cjs/dom/observers/mutation-observer.cjs +0 -63
  30. package/dist/cjs/dom/observers/observer.cjs +0 -38
  31. package/dist/cjs/dom/observers/resize-observer.cjs +0 -52
  32. package/dist/cjs/dom/observers/scroll-observer.cjs +0 -118
  33. package/dist/cjs/dom/pkce.cjs +0 -43
  34. package/dist/cjs/dom/query-params.cjs +0 -36
  35. package/dist/cjs/dom/random-string.cjs +0 -36
  36. package/dist/cjs/dom/sanitize.cjs +0 -41
  37. package/dist/cjs/dom/session-store.cjs +0 -47
  38. package/dist/cjs/dom/spam-prevention.cjs +0 -48
  39. package/dist/cjs/dom/trap-focus.cjs +0 -75
  40. package/dist/cjs/dom/ui/aria-current.cjs +0 -41
  41. package/dist/cjs/dom/ui/inconsistent-button-fix.cjs +0 -33
  42. package/dist/cjs/dom/ui/index.cjs +0 -27
  43. package/dist/cjs/dom/ui/scroll-container.cjs +0 -45
  44. package/dist/cjs/dom/ui/traverse-and-scramble.cjs +0 -48
  45. package/dist/cjs/lib/arrays/index.cjs +0 -31
  46. package/dist/cjs/lib/arrays/item-position.cjs +0 -40
  47. package/dist/cjs/lib/arrays/join.cjs +0 -35
  48. package/dist/cjs/lib/arrays/shuffle.cjs +0 -40
  49. package/dist/cjs/lib/arrays/sort.cjs +0 -59
  50. package/dist/cjs/lib/arrays/split-array.cjs +0 -39
  51. package/dist/cjs/lib/arrays/unique.cjs +0 -29
  52. package/dist/cjs/lib/auth/index.cjs +0 -21
  53. package/dist/cjs/lib/auth/route-manager.cjs +0 -49
  54. package/dist/cjs/lib/checks.cjs +0 -61
  55. package/dist/cjs/lib/date/days.cjs +0 -35
  56. package/dist/cjs/lib/date/index.cjs +0 -25
  57. package/dist/cjs/lib/date/months.cjs +0 -100
  58. package/dist/cjs/lib/date/time.cjs +0 -105
  59. package/dist/cjs/lib/form/form-data.cjs +0 -81
  60. package/dist/cjs/lib/form/index.cjs +0 -23
  61. package/dist/cjs/lib/form/sanitize.cjs +0 -59
  62. package/dist/cjs/lib/functions/callback.cjs +0 -29
  63. package/dist/cjs/lib/functions/debounce.cjs +0 -41
  64. package/dist/cjs/lib/functions/env.cjs +0 -30
  65. package/dist/cjs/lib/functions/functional.cjs +0 -80
  66. package/dist/cjs/lib/functions/index.cjs +0 -29
  67. package/dist/cjs/lib/functions/throttle.cjs +0 -36
  68. package/dist/cjs/lib/functions/timeout.cjs +0 -39
  69. package/dist/cjs/lib/hash.cjs +0 -41
  70. package/dist/cjs/lib/index.cjs +0 -47
  71. package/dist/cjs/lib/numbers/index.cjs +0 -36
  72. package/dist/cjs/lib/numbers/math.cjs +0 -34
  73. package/dist/cjs/lib/objects/camelcase-keys.cjs +0 -39
  74. package/dist/cjs/lib/objects/empty.cjs +0 -37
  75. package/dist/cjs/lib/objects/equal.cjs +0 -45
  76. package/dist/cjs/lib/objects/extend.cjs +0 -36
  77. package/dist/cjs/lib/objects/flatten.cjs +0 -40
  78. package/dist/cjs/lib/objects/index.cjs +0 -45
  79. package/dist/cjs/lib/objects/json.cjs +0 -33
  80. package/dist/cjs/lib/objects/loop.cjs +0 -38
  81. package/dist/cjs/lib/objects/mix/mix.cjs +0 -113
  82. package/dist/cjs/lib/objects/nested-property.cjs +0 -43
  83. package/dist/cjs/lib/objects/normalize-object.cjs +0 -32
  84. package/dist/cjs/lib/objects/omit-empty.cjs +0 -38
  85. package/dist/cjs/lib/objects/size.cjs +0 -61
  86. package/dist/cjs/lib/objects/split.cjs +0 -37
  87. package/dist/cjs/lib/promises/index.cjs +0 -21
  88. package/dist/cjs/lib/promises/reject.cjs +0 -50
  89. package/dist/cjs/lib/sse.cjs +0 -74
  90. package/dist/cjs/lib/strings/convert-case/convert-case.cjs +0 -94
  91. package/dist/cjs/lib/strings/index.cjs +0 -29
  92. package/dist/cjs/lib/strings/markdown.cjs +0 -74
  93. package/dist/cjs/lib/strings/name.cjs +0 -44
  94. package/dist/cjs/lib/strings/pluralize.cjs +0 -38
  95. package/dist/cjs/lib/strings/query-string.cjs +0 -41
  96. package/dist/cjs/lib/style/index.cjs +0 -35
  97. package/dist/cjs/lib/symbols/index.cjs +0 -21
  98. package/dist/cjs/lib/symbols/symbols.cjs +0 -36
  99. package/dist/cjs/node/dirname.cjs +0 -47
  100. package/dist/cjs/node/file-cache.cjs +0 -158
  101. package/dist/cjs/node/file.cjs +0 -48
  102. package/dist/cjs/node/hash.cjs +0 -40
  103. package/dist/cjs/node/index.cjs +0 -33
  104. package/dist/cjs/node/pkce.cjs +0 -52
  105. package/dist/cjs/node/random-string.cjs +0 -41
  106. package/dist/cjs/node/sanitize.cjs +0 -41
  107. package/dist/cjs/node/uuid.cjs +0 -40
  108. package/dist/esm/dom/accessibility.js +0 -26
  109. package/dist/esm/dom/actions/index.js +0 -3
  110. package/dist/esm/dom/actions/masonry.js +0 -38
  111. package/dist/esm/dom/actions/prefer-horizontal-scroll.js +0 -90
  112. package/dist/esm/dom/actions/sticky.js +0 -70
  113. package/dist/esm/dom/bounding-box.js +0 -44
  114. package/dist/esm/dom/clipboard.js +0 -12
  115. package/dist/esm/dom/cookie.js +0 -31
  116. package/dist/esm/dom/css-vars.js +0 -21
  117. package/dist/esm/dom/events.js +0 -31
  118. package/dist/esm/dom/focusable.js +0 -117
  119. package/dist/esm/dom/font-size.js +0 -40
  120. package/dist/esm/dom/get-element.js +0 -66
  121. package/dist/esm/dom/hash.js +0 -10
  122. package/dist/esm/dom/index.js +0 -23
  123. package/dist/esm/dom/keyboard.js +0 -22
  124. package/dist/esm/dom/local-store.js +0 -54
  125. package/dist/esm/dom/media.js +0 -32
  126. package/dist/esm/dom/observers/index.js +0 -4
  127. package/dist/esm/dom/observers/intersection-observer.js +0 -36
  128. package/dist/esm/dom/observers/mutation-observer.js +0 -40
  129. package/dist/esm/dom/observers/observer.js +0 -15
  130. package/dist/esm/dom/observers/resize-observer.js +0 -29
  131. package/dist/esm/dom/observers/scroll-observer.js +0 -95
  132. package/dist/esm/dom/pkce.js +0 -20
  133. package/dist/esm/dom/query-params.js +0 -13
  134. package/dist/esm/dom/random-string.js +0 -12
  135. package/dist/esm/dom/sanitize.js +0 -8
  136. package/dist/esm/dom/session-store.js +0 -24
  137. package/dist/esm/dom/spam-prevention.js +0 -25
  138. package/dist/esm/dom/trap-focus.js +0 -51
  139. package/dist/esm/dom/ui/aria-current.js +0 -17
  140. package/dist/esm/dom/ui/inconsistent-button-fix.js +0 -10
  141. package/dist/esm/dom/ui/index.js +0 -4
  142. package/dist/esm/dom/ui/scroll-container.js +0 -22
  143. package/dist/esm/dom/ui/traverse-and-scramble.js +0 -25
  144. package/dist/esm/lib/arrays/index.js +0 -6
  145. package/dist/esm/lib/arrays/item-position.js +0 -15
  146. package/dist/esm/lib/arrays/join.js +0 -12
  147. package/dist/esm/lib/arrays/shuffle.js +0 -17
  148. package/dist/esm/lib/arrays/sort.js +0 -36
  149. package/dist/esm/lib/arrays/split-array.js +0 -16
  150. package/dist/esm/lib/arrays/unique.js +0 -6
  151. package/dist/esm/lib/auth/index.js +0 -1
  152. package/dist/esm/lib/auth/route-manager.js +0 -25
  153. package/dist/esm/lib/checks.js +0 -34
  154. package/dist/esm/lib/date/days.js +0 -12
  155. package/dist/esm/lib/date/index.js +0 -3
  156. package/dist/esm/lib/date/months.js +0 -77
  157. package/dist/esm/lib/date/time.js +0 -75
  158. package/dist/esm/lib/form/form-data.js +0 -57
  159. package/dist/esm/lib/form/index.js +0 -2
  160. package/dist/esm/lib/form/sanitize.js +0 -34
  161. package/dist/esm/lib/functions/callback.js +0 -6
  162. package/dist/esm/lib/functions/debounce.js +0 -18
  163. package/dist/esm/lib/functions/env.js +0 -7
  164. package/dist/esm/lib/functions/functional.js +0 -52
  165. package/dist/esm/lib/functions/index.js +0 -5
  166. package/dist/esm/lib/functions/throttle.js +0 -13
  167. package/dist/esm/lib/functions/timeout.js +0 -14
  168. package/dist/esm/lib/hash.js +0 -18
  169. package/dist/esm/lib/index.js +0 -14
  170. package/dist/esm/lib/numbers/index.js +0 -11
  171. package/dist/esm/lib/numbers/math.js +0 -10
  172. package/dist/esm/lib/objects/camelcase-keys.js +0 -16
  173. package/dist/esm/lib/objects/empty.js +0 -13
  174. package/dist/esm/lib/objects/equal.js +0 -11
  175. package/dist/esm/lib/objects/extend.js +0 -13
  176. package/dist/esm/lib/objects/flatten.js +0 -17
  177. package/dist/esm/lib/objects/index.js +0 -13
  178. package/dist/esm/lib/objects/json.js +0 -10
  179. package/dist/esm/lib/objects/loop.js +0 -14
  180. package/dist/esm/lib/objects/mix/mix.js +0 -88
  181. package/dist/esm/lib/objects/nested-property.js +0 -18
  182. package/dist/esm/lib/objects/normalize-object.js +0 -9
  183. package/dist/esm/lib/objects/omit-empty.js +0 -15
  184. package/dist/esm/lib/objects/size.js +0 -38
  185. package/dist/esm/lib/objects/split.js +0 -14
  186. package/dist/esm/lib/promises/index.js +0 -1
  187. package/dist/esm/lib/promises/reject.js +0 -17
  188. package/dist/esm/lib/sse.js +0 -50
  189. package/dist/esm/lib/strings/convert-case/convert-case.js +0 -64
  190. package/dist/esm/lib/strings/index.js +0 -5
  191. package/dist/esm/lib/strings/markdown.js +0 -40
  192. package/dist/esm/lib/strings/name.js +0 -21
  193. package/dist/esm/lib/strings/pluralize.js +0 -5
  194. package/dist/esm/lib/strings/query-string.js +0 -16
  195. package/dist/esm/lib/style/index.js +0 -12
  196. package/dist/esm/lib/symbols/index.js +0 -1
  197. package/dist/esm/lib/symbols/symbols.js +0 -12
  198. package/dist/esm/node/dirname.js +0 -13
  199. package/dist/esm/node/file-cache.js +0 -121
  200. package/dist/esm/node/file.js +0 -14
  201. package/dist/esm/node/hash.js +0 -7
  202. package/dist/esm/node/index.js +0 -7
  203. package/dist/esm/node/pkce.js +0 -19
  204. package/dist/esm/node/random-string.js +0 -8
  205. package/dist/esm/node/sanitize.js +0 -8
  206. package/dist/esm/node/uuid.js +0 -7
  207. package/dist/types/dom/accessibility.d.cts +0 -30
  208. package/dist/types/dom/actions/index.d.cts +0 -3
  209. package/dist/types/dom/actions/masonry.d.cts +0 -5
  210. package/dist/types/dom/actions/prefer-horizontal-scroll.d.cts +0 -5
  211. package/dist/types/dom/actions/sticky.d.cts +0 -5
  212. package/dist/types/dom/bounding-box.d.cts +0 -41
  213. package/dist/types/dom/clipboard.d.cts +0 -7
  214. package/dist/types/dom/cookie.d.cts +0 -7
  215. package/dist/types/dom/css-vars.d.cts +0 -6
  216. package/dist/types/dom/events.d.cts +0 -92
  217. package/dist/types/dom/focusable.d.cts +0 -78
  218. package/dist/types/dom/font-size.d.cts +0 -8
  219. package/dist/types/dom/get-element.d.cts +0 -102
  220. package/dist/types/dom/hash.d.cts +0 -3
  221. package/dist/types/dom/index.d.cts +0 -31
  222. package/dist/types/dom/keyboard.d.cts +0 -32
  223. package/dist/types/dom/local-store.d.cts +0 -31
  224. package/dist/types/dom/media.d.cts +0 -5
  225. package/dist/types/dom/observers/index.d.cts +0 -4
  226. package/dist/types/dom/observers/intersection-observer.d.cts +0 -10
  227. package/dist/types/dom/observers/mutation-observer.d.cts +0 -9
  228. package/dist/types/dom/observers/observer.d.cts +0 -3
  229. package/dist/types/dom/observers/resize-observer.d.cts +0 -40
  230. package/dist/types/dom/observers/scroll-observer.d.cts +0 -40
  231. package/dist/types/dom/pkce.d.cts +0 -8
  232. package/dist/types/dom/query-params.d.cts +0 -6
  233. package/dist/types/dom/random-string.d.cts +0 -9
  234. package/dist/types/dom/sanitize.d.cts +0 -10
  235. package/dist/types/dom/session-store.d.cts +0 -7
  236. package/dist/types/dom/spam-prevention.d.cts +0 -14
  237. package/dist/types/dom/trap-focus.d.cts +0 -32
  238. package/dist/types/dom/ui/aria-current.d.cts +0 -7
  239. package/dist/types/dom/ui/inconsistent-button-fix.d.cts +0 -14
  240. package/dist/types/dom/ui/index.d.cts +0 -4
  241. package/dist/types/dom/ui/scroll-container.d.cts +0 -3
  242. package/dist/types/dom/ui/traverse-and-scramble.d.cts +0 -21
  243. package/dist/types/lib/arrays/index.d.cts +0 -6
  244. package/dist/types/lib/arrays/item-position.d.cts +0 -16
  245. package/dist/types/lib/arrays/join.d.cts +0 -15
  246. package/dist/types/lib/arrays/shuffle.d.cts +0 -3
  247. package/dist/types/lib/arrays/sort.d.cts +0 -32
  248. package/dist/types/lib/arrays/split-array.d.cts +0 -6
  249. package/dist/types/lib/arrays/unique.d.cts +0 -3
  250. package/dist/types/lib/auth/index.d.cts +0 -1
  251. package/dist/types/lib/auth/route-manager.d.cts +0 -28
  252. package/dist/types/lib/checks.d.cts +0 -33
  253. package/dist/types/lib/date/days.d.cts +0 -7
  254. package/dist/types/lib/date/index.d.cts +0 -3
  255. package/dist/types/lib/date/months.d.cts +0 -11
  256. package/dist/types/lib/date/time.d.cts +0 -21
  257. package/dist/types/lib/form/form-data.d.cts +0 -9
  258. package/dist/types/lib/form/index.d.cts +0 -2
  259. package/dist/types/lib/form/sanitize.d.cts +0 -60
  260. package/dist/types/lib/functions/callback.d.cts +0 -8
  261. package/dist/types/lib/functions/debounce.d.cts +0 -3
  262. package/dist/types/lib/functions/env.d.cts +0 -3
  263. package/dist/types/lib/functions/functional.d.cts +0 -72
  264. package/dist/types/lib/functions/index.d.cts +0 -5
  265. package/dist/types/lib/functions/throttle.d.cts +0 -3
  266. package/dist/types/lib/functions/timeout.d.cts +0 -5
  267. package/dist/types/lib/hash.d.cts +0 -3
  268. package/dist/types/lib/index.d.cts +0 -43
  269. package/dist/types/lib/numbers/index.d.cts +0 -5
  270. package/dist/types/lib/numbers/math.d.cts +0 -4
  271. package/dist/types/lib/objects/camelcase-keys.d.cts +0 -3
  272. package/dist/types/lib/objects/empty.d.cts +0 -4
  273. package/dist/types/lib/objects/equal.d.cts +0 -4
  274. package/dist/types/lib/objects/extend.d.cts +0 -6
  275. package/dist/types/lib/objects/flatten.d.cts +0 -6
  276. package/dist/types/lib/objects/index.d.cts +0 -13
  277. package/dist/types/lib/objects/json.d.cts +0 -3
  278. package/dist/types/lib/objects/loop.d.cts +0 -4
  279. package/dist/types/lib/objects/mix/mix.d.cts +0 -44
  280. package/dist/types/lib/objects/nested-property.d.cts +0 -24
  281. package/dist/types/lib/objects/normalize-object.d.cts +0 -3
  282. package/dist/types/lib/objects/omit-empty.d.cts +0 -3
  283. package/dist/types/lib/objects/size.d.cts +0 -3
  284. package/dist/types/lib/objects/split.d.cts +0 -14
  285. package/dist/types/lib/promises/index.d.cts +0 -1
  286. package/dist/types/lib/promises/reject.d.cts +0 -5
  287. package/dist/types/lib/sse.d.cts +0 -18
  288. package/dist/types/lib/strings/convert-case/convert-case.d.cts +0 -10
  289. package/dist/types/lib/strings/index.d.cts +0 -5
  290. package/dist/types/lib/strings/markdown.d.cts +0 -25
  291. package/dist/types/lib/strings/name.d.cts +0 -7
  292. package/dist/types/lib/strings/pluralize.d.cts +0 -3
  293. package/dist/types/lib/strings/query-string.d.cts +0 -10
  294. package/dist/types/lib/style/index.d.cts +0 -3
  295. package/dist/types/lib/symbols/index.d.cts +0 -1
  296. package/dist/types/lib/symbols/symbols.d.cts +0 -4
  297. package/dist/types/node/dirname.d.cts +0 -9
  298. package/dist/types/node/file-cache.d.cts +0 -56
  299. package/dist/types/node/file.d.cts +0 -4
  300. package/dist/types/node/hash.d.cts +0 -3
  301. package/dist/types/node/index.d.cts +0 -7
  302. package/dist/types/node/pkce.d.cts +0 -8
  303. package/dist/types/node/random-string.d.cts +0 -3
  304. package/dist/types/node/sanitize.d.cts +0 -10
  305. package/dist/types/node/uuid.d.cts +0 -3
@@ -1,41 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var sanitize_exports = {};
29
- __export(sanitize_exports, {
30
- sanitize: () => sanitize
31
- });
32
- module.exports = __toCommonJS(sanitize_exports);
33
- var import_sanitize_html = __toESM(require("sanitize-html"), 1);
34
- var import_sanitize = require("../lib/form/sanitize.js");
35
- function sanitize(value, options = {}) {
36
- return (0, import_sanitize.sanitize)(value, { sanitizer: import_sanitize_html.default, ...options });
37
- }
38
- // Annotate the CommonJS export names for ESM import in node:
39
- 0 && (module.exports = {
40
- sanitize
41
- });
@@ -1,40 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var uuid_exports = {};
29
- __export(uuid_exports, {
30
- uuid: () => uuid
31
- });
32
- module.exports = __toCommonJS(uuid_exports);
33
- var import_crypto = __toESM(require("crypto"), 1);
34
- function uuid() {
35
- return import_crypto.default.randomUUID();
36
- }
37
- // Annotate the CommonJS export names for ESM import in node:
38
- 0 && (module.exports = {
39
- uuid
40
- });
@@ -1,26 +0,0 @@
1
- function hasAccessibleName(label, labelledBy) {
2
- if (label || labelledBy) return true;
3
- return false;
4
- }
5
- function checkForAccessibleName({
6
- name,
7
- ariaLabel,
8
- ariaLabelledBy,
9
- severity = "warn"
10
- } = {}) {
11
- if (ariaLabel || ariaLabelledBy) return true;
12
- const message = `${name} is missing an accessible name. Please provide an accessible name with 'aria-label' or 'aria-labelledby'.`;
13
- if (severity === "warn") console.warn(message);
14
- if (severity === "error") console.error(message);
15
- return false;
16
- }
17
- function isInvalidAriaPopup(value) {
18
- const allowedPopoupValues = ["dialog", "menu", "listbox", "grid", "tree"];
19
- if (!allowedPopoupValues.includes(value)) return true;
20
- return false;
21
- }
22
- export {
23
- checkForAccessibleName,
24
- hasAccessibleName,
25
- isInvalidAriaPopup
26
- };
@@ -1,3 +0,0 @@
1
- export * from "./masonry.js";
2
- export * from "./prefer-horizontal-scroll.js";
3
- export * from "./sticky.js";
@@ -1,38 +0,0 @@
1
- import { getChildrenElements } from "../get-element.js";
2
- import { mediaLoaded } from "../media.js";
3
- import { resizeObserver } from "../observers/resize-observer.js";
4
- async function masonry(node) {
5
- if (nativeMasonrySupport(node)) return;
6
- const colGap = parseFloat(getComputedStyle(node).columnGap);
7
- const items = getChildrenElements(node);
8
- node.style.setProperty("row-gap", "1px", "important");
9
- node.style.gridAutoRows = "0px";
10
- node.updateMasonryLayout = (_) => layout({ colGap, items });
11
- try {
12
- await mediaLoaded(node);
13
- } catch (e) {
14
- }
15
- layout({ colGap, items });
16
- const obs = resizeObserver(node, {
17
- async callback(opts) {
18
- layout({ colGap, items });
19
- }
20
- });
21
- async function layout({ colGap: colGap2, items: items2 }) {
22
- items2.forEach((item) => {
23
- const ib = item.getBoundingClientRect();
24
- item.style.gridRowEnd = `span ${Math.round(ib.height + colGap2)}`;
25
- });
26
- }
27
- return {
28
- destroy() {
29
- obs.disconnect();
30
- }
31
- };
32
- }
33
- function nativeMasonrySupport(node) {
34
- return getComputedStyle(node).gridTemplateRows === "masonry";
35
- }
36
- export {
37
- masonry
38
- };
@@ -1,90 +0,0 @@
1
- import { omitEmpty } from "../../lib/objects/omit-empty.js";
2
- import { getCSSVar, setCSSVar } from "../css-vars.js";
3
- import { addListeners, removeListeners } from "../events.js";
4
- const DEFAULT_OPTIONS = {
5
- scrollSnapDelay: 1e3
6
- };
7
- function preferHorizontalScroll(node, props = {}) {
8
- if (!node.classList.contains("scrollable-prefer-horizontal")) return;
9
- const state = {
10
- origSnapType: null,
11
- currentSnapType: null,
12
- snapTimeoutID: null
13
- };
14
- const options = {
15
- ...DEFAULT_OPTIONS,
16
- ...omitEmpty({
17
- scrollSnapDelay: getCSSVar(node, "--scroll-snap-delay")
18
- }),
19
- ...omitEmpty(props)
20
- };
21
- const listeners = [
22
- {
23
- event: "wheel",
24
- node,
25
- handler: handleWheel
26
- },
27
- {
28
- event: "pointerenter",
29
- node,
30
- handler: handlePointerEnter
31
- },
32
- {
33
- event: "pointerleave",
34
- node,
35
- handler: handlePointerLeave
36
- }
37
- ];
38
- addListeners(listeners);
39
- function handleWheel(event) {
40
- const direction = event.deltaY > 0 ? "down" : "up";
41
- const updatedDelta = event.deltaY;
42
- if (isTrackpad(event)) return false;
43
- setCSSVar(node, "--snap-type", "none");
44
- const scrolledAmount = node.scrollLeft;
45
- const scrollWidth = node.scrollWidth;
46
- const clientWidth = node.clientWidth;
47
- const scrollableAmount = scrollWidth - clientWidth;
48
- if (direction === "down" && scrolledAmount < scrollableAmount) {
49
- node.scrollLeft += updatedDelta;
50
- event.preventDefault();
51
- }
52
- if (direction === "up" && scrolledAmount > 0) {
53
- node.scrollLeft += updatedDelta;
54
- event.preventDefault();
55
- }
56
- const { snapTimeoutID } = state;
57
- if (snapTimeoutID) clearTimeout(snapTimeoutID);
58
- state.snapTimeoutID = setTimeout((_) => {
59
- restoreHijackedState(node, state);
60
- }, options.scrollSnapDelay);
61
- }
62
- function handlePointerEnter(event) {
63
- state.origSnapType = getCSSVar(node, "--snap-type") || "proximity";
64
- }
65
- function handlePointerLeave(event) {
66
- restoreHijackedState(node, state);
67
- }
68
- return {
69
- destroy() {
70
- removeListeners(listeners);
71
- }
72
- };
73
- }
74
- function restoreHijackedState(node, state) {
75
- const scrollLeft = node.scrollLeft;
76
- setCSSVar(node, "--snap-type", state.origSnapType);
77
- const finalScrollLeft = node.scrollLeft;
78
- setCSSVar(node, "--snap-type", "none");
79
- node.scrollTo({ left: scrollLeft, behavior: "instant" });
80
- node.scrollTo({ left: finalScrollLeft, behavior: "smooth" });
81
- setTimeout((_) => {
82
- setCSSVar(node, "--snap-type", state.origSnapType);
83
- }, 250);
84
- }
85
- function isTrackpad(event) {
86
- if (event.wheelDeltaY === event.deltaY * -3) return true;
87
- }
88
- export {
89
- preferHorizontalScroll
90
- };
@@ -1,70 +0,0 @@
1
- import { boundingBoxRelativeToAncestor } from "../bounding-box.js";
2
- import { resizeObserver } from "../observers/resize-observer.js";
3
- import { findScrollContainer } from "../ui/scroll-container.js";
4
- function sticky(node, props = {}) {
5
- const scrollContainer = findScrollContainer(node);
6
- let stickyTBLR = getComputedTBLR(node);
7
- const obs = resizeObserver(node, {
8
- callback: ({ entry }) => {
9
- stickyTBLR = getComputedTBLR(node);
10
- isSticking();
11
- scrollContainer === document.documentElement ? window.addEventListener("scroll", scrollEventListener) : scrollContainer.addEventListener("scroll", scrollEventListener);
12
- }
13
- });
14
- function scrollEventListener(event) {
15
- isSticking();
16
- }
17
- function isSticking() {
18
- const { top, bottom, left, right } = stickyTBLR;
19
- const relativeRect = boundingBoxRelativeToAncestor({
20
- element: node,
21
- ancestorElement: scrollContainer
22
- });
23
- if (!isNaN(top)) {
24
- if (relativeRect.top - top <= 1) {
25
- node.classList.add("sticking");
26
- } else {
27
- node.classList.remove("sticking");
28
- }
29
- }
30
- if (!isNaN(bottom)) {
31
- if (relativeRect.bottom + bottom >= -1) {
32
- node.classList.add("sticking");
33
- } else {
34
- node.classList.remove("sticking");
35
- }
36
- }
37
- if (!isNaN(left)) {
38
- if (relativeRect.left - left <= 1) {
39
- node.classList.add("sticking");
40
- } else {
41
- node.classList.remove("sticking");
42
- }
43
- }
44
- if (!isNaN(right)) {
45
- if (relativeRect.right + right >= -1) {
46
- node.classList.add("sticking");
47
- } else {
48
- node.classList.remove("sticking");
49
- }
50
- }
51
- }
52
- return {
53
- destroy() {
54
- obs.disconnect();
55
- scrollContainer.removeEventListener("scroll", scrollEventListener);
56
- }
57
- };
58
- }
59
- function getComputedTBLR(element) {
60
- const style = getComputedStyle(element);
61
- return {
62
- top: parseFloat(style.top),
63
- bottom: parseFloat(style.bottom),
64
- left: parseFloat(style.left),
65
- right: parseFloat(style.right)
66
- };
67
- }
68
- export {
69
- sticky
70
- };
@@ -1,44 +0,0 @@
1
- function boundingBox(element, { containsPadding = true } = {}) {
2
- const box = element.getBoundingClientRect();
3
- const ret = {};
4
- for (const prop in box) ret[prop] = box[prop];
5
- if (!containsPadding) {
6
- const style = getComputedStyle(element);
7
- const paddingTop = parseFloat(style.paddingTop);
8
- const paddingRight = parseFloat(style.paddingRight);
9
- const paddingBottom = parseFloat(style.paddingBottom);
10
- const paddingLeft = parseFloat(style.paddingLeft);
11
- ret.x = ret.x + paddingLeft;
12
- ret.y = ret.y + paddingTop;
13
- ret.width = ret.width - paddingLeft - paddingRight;
14
- ret.height = ret.height - paddingTop - paddingBottom;
15
- ret.top = ret.top + paddingTop;
16
- ret.bottom = ret.bottom - paddingBottom;
17
- ret.right = ret.right - paddingRight;
18
- ret.left = ret.left + paddingLeft;
19
- }
20
- ret.xCenter = (ret.left + ret.right) / 2;
21
- ret.yCenter = (ret.top + ret.bottom) / 2;
22
- return ret;
23
- }
24
- function boundingBoxRelativeToAncestor({ element, ancestorElement }) {
25
- ancestorElement = ancestorElement || element.parentElement;
26
- const box = boundingBox(element);
27
- const ancestorBox = boundingBox(ancestorElement, {
28
- containsPadding: false
29
- });
30
- return {
31
- top: box.top - ancestorBox.top,
32
- right: box.right - ancestorBox.right,
33
- bottom: box.bottom - ancestorBox.bottom,
34
- left: box.left - ancestorBox.left,
35
- width: box.width,
36
- height: box.height,
37
- xCenter: (box.left + box.right) / 2 - ancestorBox.left,
38
- yCenter: (box.top + box.bottom) / 2 - ancestorBox.top
39
- };
40
- }
41
- export {
42
- boundingBox,
43
- boundingBoxRelativeToAncestor
44
- };
@@ -1,12 +0,0 @@
1
- function copyRichText(element) {
2
- const range = document.createRange();
3
- range.selectNode(element);
4
- const selection = window.getSelection();
5
- selection.removeAllRanges();
6
- selection.addRange(range);
7
- document.execCommand("copy");
8
- selection.removeAllRanges();
9
- }
10
- export {
11
- copyRichText
12
- };
@@ -1,31 +0,0 @@
1
- const cookies = {
2
- get(name) {
3
- return getCookie(name);
4
- },
5
- set(name, value, days) {
6
- setCookie(name, value, days);
7
- }
8
- };
9
- function getCookie(name) {
10
- const match = document.cookie.match(new RegExp("(^| )" + name + "=([^;]+)"));
11
- if (!match) return null;
12
- const decoded = decodeURIComponent(match[2]);
13
- try {
14
- return JSON.parse(decoded);
15
- } catch (e) {
16
- return decoded;
17
- }
18
- }
19
- function setCookie(name, value, days) {
20
- let expires = "";
21
- if (days) {
22
- const date = /* @__PURE__ */ new Date();
23
- date.setTime(date.getTime() + days * 24 * 60 * 60 * 1e3);
24
- expires = "; expires=" + date.toUTCString();
25
- }
26
- document.cookie = name + "=" + (value || "") + expires + "; path=/";
27
- }
28
- export {
29
- cookies,
30
- getCookie
31
- };
@@ -1,21 +0,0 @@
1
- import { getElement } from "./get-element.js";
2
- function getCSSValue(element, prop) {
3
- return getCSSVar(element, prop);
4
- }
5
- function setCSSValue(element, prop, value) {
6
- setCSSVar(element, prop, value);
7
- }
8
- function getCSSVar(element, prop) {
9
- element = getElement(element);
10
- return getComputedStyle(element).getPropertyValue(prop);
11
- }
12
- function setCSSVar(element, prop, value) {
13
- element = getElement(element);
14
- element.style.setProperty(prop, value);
15
- }
16
- export {
17
- getCSSValue,
18
- getCSSVar,
19
- setCSSValue,
20
- setCSSVar
21
- };
@@ -1,31 +0,0 @@
1
- function addListeners(listeners) {
2
- listeners.forEach(({ node, event, handler }) => {
3
- node.addEventListener(event, handler);
4
- });
5
- }
6
- function removeListeners(listeners) {
7
- listeners.forEach(({ node, event, handler }) => {
8
- node.removeEventListener(event, handler);
9
- });
10
- }
11
- function dispatchEvent(node, eventName, detail, options = {}) {
12
- node.dispatchEvent(
13
- new CustomEvent(eventName, {
14
- ...options,
15
- detail
16
- })
17
- );
18
- }
19
- function updateEvent(event, updates) {
20
- const { type, ...rest } = event;
21
- return new CustomEvent(event.type, {
22
- ...rest,
23
- ...updates
24
- });
25
- }
26
- export {
27
- addListeners,
28
- dispatchEvent,
29
- removeListeners,
30
- updateEvent
31
- };
@@ -1,117 +0,0 @@
1
- function getFocusableElements(container = document.body) {
2
- return {
3
- /**
4
- * Gets the number of keyboard focusable elements.
5
- * This is useful for checking if there are any focusable elements
6
- * before attempting to focus them.
7
- *
8
- * @returns {number} The number of keyboard focusable elements
9
- */
10
- get length() {
11
- return this.keyboard.length;
12
- },
13
- /**
14
- * Gets all focusable elements within the container that are visible and enabled.
15
- * This includes elements that can be focused via mouse or programmatically,
16
- * but may not be keyboard focusable.
17
- *
18
- * Elements are considered focusable if they:
19
- * - Are not disabled
20
- * - Are not hidden
21
- * - Are not display:none
22
- *
23
- * @returns {HTMLElement[]} Array of focusable elements that are visible and enabled
24
- */
25
- get all() {
26
- const elements = Array.from(
27
- container.querySelectorAll(
28
- `a,
29
- button,
30
- input,
31
- textarea,
32
- select,
33
- details,
34
- iframe,
35
- embed,
36
- object,
37
- summary,
38
- dialog,
39
- audio[controls],
40
- video[controls],
41
- [contenteditable],
42
- [tabindex]
43
- `
44
- )
45
- );
46
- return elements.filter((el) => {
47
- if (el.hasAttribute("disabled")) return false;
48
- if (el.hasAttribute("hidden")) return false;
49
- if (window.getComputedStyle(el).display === "none") return false;
50
- return true;
51
- });
52
- },
53
- /**
54
- * Gets elements that can be focused via keyboard (tabIndex > -1).
55
- * These are the elements that will be focused when using the Tab key.
56
- *
57
- * @returns {HTMLElement[]} Array of keyboard focusable elements
58
- */
59
- get keyboard() {
60
- return this.all.filter((el) => el instanceof HTMLElement && el.tabIndex > -1);
61
- },
62
- /**
63
- * Alias for keyboard focusable elements.
64
- * This is provided for semantic clarity in certain contexts.
65
- *
66
- * @returns {HTMLElement[]} Array of keyboard focusable elements
67
- */
68
- get keyboardOnly() {
69
- return this.keyboard;
70
- },
71
- /**
72
- * Gets the first keyboard focusable element.
73
- * This is useful for setting initial focus when opening a modal or dialog.
74
- *
75
- * @returns {HTMLElement|null} The first focusable element or null if none exist
76
- */
77
- get first() {
78
- return this.keyboard[0] || null;
79
- },
80
- /**
81
- * Gets the last keyboard focusable element.
82
- * This is useful for focus trapping when using Shift+Tab.
83
- *
84
- * @returns {HTMLElement|null} The last focusable element or null if none exist
85
- */
86
- get last() {
87
- return this.keyboard[this.length - 1] || null;
88
- },
89
- /**
90
- * Gets the next focusable element after the given index.
91
- * This is useful for implementing custom tab order or focus management.
92
- *
93
- * @param {number} index - The current element's index in the keyboard focusable array
94
- * @returns {HTMLElement|null} The next focusable element or null if none exists
95
- */
96
- next(index) {
97
- return this.keyboard[index + 1] || null;
98
- },
99
- /**
100
- * Gets the previous focusable element before the given index.
101
- * This is useful for implementing custom tab order or focus management.
102
- *
103
- * @param {number} index - The current element's index in the keyboard focusable array
104
- * @returns {HTMLElement|null} The previous focusable element or null if none exists
105
- */
106
- prev(index) {
107
- return this.keyboard[index - 1] || null;
108
- }
109
- };
110
- }
111
- function Focusable(container = document.body) {
112
- return getFocusableElements(container);
113
- }
114
- export {
115
- Focusable,
116
- getFocusableElements
117
- };
@@ -1,40 +0,0 @@
1
- import { splitUnit } from "../lib/numbers/index.js";
2
- function getUnit(value) {
3
- const [, unit] = splitUnit(value);
4
- return unit;
5
- }
6
- function rem(multiple = 1) {
7
- const value = parseFloat(getComputedStyle(document.body)["font-size"]);
8
- return Math.round(value * multiple);
9
- }
10
- function em(element = document.body, multiple = 1) {
11
- const value = parseFloat(getComputedStyle(element)["font-size"]);
12
- return Math.round(value * multiple);
13
- }
14
- function rlh(multiple = 1) {
15
- const lineHeight = parseFloat(getComputedStyle(document.body)["line-height"]);
16
- return Math.round(lineHeight * multiple);
17
- }
18
- function lh(element = document.body, multiple = 1) {
19
- const lineHeight = getComputedStyle(element)["line-height"];
20
- const value = parseFloat(lineHeight);
21
- return Math.round(value * multiple);
22
- }
23
- function toPx(value, element = null) {
24
- const [numeric, unit] = splitUnit(value);
25
- let finalValue = 0;
26
- if (unit === "rem") finalValue = rem(numeric);
27
- if (unit === "em") finalValue = em(element, numeric);
28
- if (unit === "lh") finalValue = lh(element, numeric);
29
- if (unit === "px") finalValue = numeric;
30
- if (!unit) finalValue = numeric;
31
- return finalValue;
32
- }
33
- export {
34
- em,
35
- getUnit,
36
- lh,
37
- rem,
38
- rlh,
39
- toPx
40
- };
@@ -1,66 +0,0 @@
1
- const astroNodes = ["ASTRO-SLOT", "ASTRO-ISLAND"];
2
- function getNodeType(node) {
3
- if (node instanceof Element) return "element";
4
- if (node instanceof NodeList) return "nodelist";
5
- if (Array.isArray(node)) return "array";
6
- }
7
- function getElement(selector) {
8
- if (!selector) return;
9
- if (selector instanceof Element) return selector;
10
- return document.querySelector(selector);
11
- }
12
- function getChildrenElements(node) {
13
- let children = node.children;
14
- if (children[0]?.nodeName === "ASTRO-SLOT") children = children[0].children;
15
- return Array.from(children);
16
- }
17
- function getParentElement(element) {
18
- const parent = element.parentElement;
19
- if (astroNodes.includes(parent.nodeName)) return getParentElement(parent);
20
- return parent;
21
- }
22
- function getSiblingElements(element) {
23
- return Array.from(element.parentElement.children).filter(
24
- (child) => child !== element
25
- );
26
- }
27
- function getSelfIndex(element) {
28
- return Array.from(element.parentElement.children).indexOf(element);
29
- }
30
- function isAncestor(ancestor, element, { searchLevels = 0 } = {}) {
31
- if (ancestor === element) return true;
32
- let parent = element.parentElement;
33
- if (searchLevels === 0) {
34
- while (parent) {
35
- if (ancestor === parent) return true;
36
- parent = parent.parentElement;
37
- }
38
- } else {
39
- for (let i = 0; i < searchLevels; i++) {
40
- if (ancestor === parent) return true;
41
- parent = parent.parentElement;
42
- }
43
- }
44
- return false;
45
- }
46
- function getAncestorWithSiblings(element, { limit = false } = {}) {
47
- const ancestor = element.parentElement;
48
- const siblings = getSiblingElements(ancestor);
49
- if (siblings.length) return siblings;
50
- if (!ancestor) return null;
51
- if (limit === false) return getAncestorWithSiblings(ancestor);
52
- if (typeof limit === "number" && limit > 0) {
53
- return getAncestorWithSiblings(ancestor, { limit: limit - 1 });
54
- }
55
- if (limit === 0) return null;
56
- }
57
- export {
58
- getAncestorWithSiblings,
59
- getChildrenElements,
60
- getElement,
61
- getNodeType,
62
- getParentElement,
63
- getSelfIndex,
64
- getSiblingElements,
65
- isAncestor
66
- };