katanakit-js 2.2.1 → 2.12.9

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 (148) hide show
  1. package/README.md +72 -437
  2. package/dist/adapters/astro/astro.service.d.ts +103 -15
  3. package/dist/adapters/astro/astro.service.d.ts.map +1 -1
  4. package/dist/adapters/astro/astro.service.js +145 -75
  5. package/dist/adapters/astro/astro.service.js.map +1 -1
  6. package/dist/adapters/astro/index.d.ts +1 -1
  7. package/dist/adapters/astro/index.d.ts.map +1 -1
  8. package/dist/adapters/astro/index.js +1 -1
  9. package/dist/adapters/astro/index.js.map +1 -1
  10. package/dist/adapters/astro/rss.service.d.ts +85 -105
  11. package/dist/adapters/astro/rss.service.d.ts.map +1 -1
  12. package/dist/adapters/astro/rss.service.js +172 -168
  13. package/dist/adapters/astro/rss.service.js.map +1 -1
  14. package/dist/adapters/astro/seo.service.d.ts +10 -0
  15. package/dist/adapters/astro/seo.service.d.ts.map +1 -0
  16. package/dist/adapters/astro/seo.service.js +3 -0
  17. package/dist/adapters/astro/seo.service.js.map +1 -0
  18. package/dist/adapters/express/app.d.ts +30 -1
  19. package/dist/adapters/express/app.d.ts.map +1 -1
  20. package/dist/adapters/express/app.js +31 -3
  21. package/dist/adapters/express/app.js.map +1 -1
  22. package/dist/adapters/express/index.d.ts +2 -2
  23. package/dist/adapters/express/index.d.ts.map +1 -1
  24. package/dist/adapters/express/index.js +2 -2
  25. package/dist/adapters/express/index.js.map +1 -1
  26. package/dist/adapters/express/main.js +2 -2
  27. package/dist/adapters/express/main.js.map +1 -1
  28. package/dist/adapters/express/products.controller.d.ts +67 -8
  29. package/dist/adapters/express/products.controller.d.ts.map +1 -1
  30. package/dist/adapters/express/products.controller.js +105 -49
  31. package/dist/adapters/express/products.controller.js.map +1 -1
  32. package/dist/adapters/express/server.d.ts +37 -13
  33. package/dist/adapters/express/server.d.ts.map +1 -1
  34. package/dist/adapters/express/server.js +118 -53
  35. package/dist/adapters/express/server.js.map +1 -1
  36. package/dist/adapters/nuxt/nuxt.service.d.ts +8 -6
  37. package/dist/adapters/nuxt/nuxt.service.d.ts.map +1 -1
  38. package/dist/adapters/nuxt/nuxt.service.js +34 -10
  39. package/dist/adapters/nuxt/nuxt.service.js.map +1 -1
  40. package/dist/adapters/vue/vue.service.d.ts +5 -2
  41. package/dist/adapters/vue/vue.service.d.ts.map +1 -1
  42. package/dist/adapters/vue/vue.service.js +41 -7
  43. package/dist/adapters/vue/vue.service.js.map +1 -1
  44. package/dist/config/index.d.ts +2 -1
  45. package/dist/config/index.d.ts.map +1 -1
  46. package/dist/config/index.js +1 -1
  47. package/dist/config/index.js.map +1 -1
  48. package/dist/config/seo-meta.types.d.ts +177 -0
  49. package/dist/config/seo-meta.types.d.ts.map +1 -0
  50. package/dist/config/seo-meta.types.js +11 -0
  51. package/dist/config/seo-meta.types.js.map +1 -0
  52. package/dist/config/seo.service.d.ts +41 -58
  53. package/dist/config/seo.service.d.ts.map +1 -1
  54. package/dist/config/seo.service.js +468 -136
  55. package/dist/config/seo.service.js.map +1 -1
  56. package/dist/config/site.config.d.ts +10 -50
  57. package/dist/config/site.config.d.ts.map +1 -1
  58. package/dist/config/site.config.js +8 -36
  59. package/dist/config/site.config.js.map +1 -1
  60. package/dist/core/index.d.ts +1 -3
  61. package/dist/core/index.d.ts.map +1 -1
  62. package/dist/core/index.js +1 -3
  63. package/dist/core/index.js.map +1 -1
  64. package/dist/core/services/dates.service.d.ts +149 -22
  65. package/dist/core/services/dates.service.d.ts.map +1 -1
  66. package/dist/core/services/dates.service.js +201 -54
  67. package/dist/core/services/dates.service.js.map +1 -1
  68. package/dist/core/services/error.service.d.ts +32 -20
  69. package/dist/core/services/error.service.d.ts.map +1 -1
  70. package/dist/core/services/error.service.js +44 -32
  71. package/dist/core/services/error.service.js.map +1 -1
  72. package/dist/core/services/formatter.service.d.ts +245 -35
  73. package/dist/core/services/formatter.service.d.ts.map +1 -1
  74. package/dist/core/services/formatter.service.js +281 -57
  75. package/dist/core/services/formatter.service.js.map +1 -1
  76. package/dist/core/services/generator.service.d.ts +115 -26
  77. package/dist/core/services/generator.service.d.ts.map +1 -1
  78. package/dist/core/services/generator.service.js +191 -56
  79. package/dist/core/services/generator.service.js.map +1 -1
  80. package/dist/core/services/geometry.service.d.ts +369 -39
  81. package/dist/core/services/geometry.service.d.ts.map +1 -1
  82. package/dist/core/services/geometry.service.js +424 -66
  83. package/dist/core/services/geometry.service.js.map +1 -1
  84. package/dist/core/services/http.service.d.ts +244 -21
  85. package/dist/core/services/http.service.d.ts.map +1 -1
  86. package/dist/core/services/http.service.js +419 -98
  87. package/dist/core/services/http.service.js.map +1 -1
  88. package/dist/core/services/logger.service.d.ts +95 -29
  89. package/dist/core/services/logger.service.d.ts.map +1 -1
  90. package/dist/core/services/logger.service.js +167 -41
  91. package/dist/core/services/logger.service.js.map +1 -1
  92. package/dist/core/services/reactive.service.d.ts +146 -19
  93. package/dist/core/services/reactive.service.d.ts.map +1 -1
  94. package/dist/core/services/reactive.service.js +278 -137
  95. package/dist/core/services/reactive.service.js.map +1 -1
  96. package/dist/core/services/timing.service.d.ts +142 -20
  97. package/dist/core/services/timing.service.d.ts.map +1 -1
  98. package/dist/core/services/timing.service.js +324 -185
  99. package/dist/core/services/timing.service.js.map +1 -1
  100. package/dist/core/services/utils.service.d.ts +228 -43
  101. package/dist/core/services/utils.service.d.ts.map +1 -1
  102. package/dist/core/services/utils.service.js +305 -125
  103. package/dist/core/services/utils.service.js.map +1 -1
  104. package/dist/infrastructure/dom/dom.service.d.ts +307 -44
  105. package/dist/infrastructure/dom/dom.service.d.ts.map +1 -1
  106. package/dist/infrastructure/dom/dom.service.js +408 -129
  107. package/dist/infrastructure/dom/dom.service.js.map +1 -1
  108. package/dist/infrastructure/index.d.ts +0 -3
  109. package/dist/infrastructure/index.d.ts.map +1 -1
  110. package/dist/infrastructure/index.js +0 -3
  111. package/dist/infrastructure/index.js.map +1 -1
  112. package/dist/infrastructure/observer/observer.service.d.ts +124 -31
  113. package/dist/infrastructure/observer/observer.service.d.ts.map +1 -1
  114. package/dist/infrastructure/observer/observer.service.js +227 -131
  115. package/dist/infrastructure/observer/observer.service.js.map +1 -1
  116. package/dist/infrastructure/sensors/sensors.service.d.ts +154 -22
  117. package/dist/infrastructure/sensors/sensors.service.d.ts.map +1 -1
  118. package/dist/infrastructure/sensors/sensors.service.js +264 -112
  119. package/dist/infrastructure/sensors/sensors.service.js.map +1 -1
  120. package/dist/infrastructure/storage/storage.service.d.ts +123 -45
  121. package/dist/infrastructure/storage/storage.service.d.ts.map +1 -1
  122. package/dist/infrastructure/storage/storage.service.js +236 -66
  123. package/dist/infrastructure/storage/storage.service.js.map +1 -1
  124. package/dist/infrastructure/theme/theme.service.d.ts +93 -29
  125. package/dist/infrastructure/theme/theme.service.d.ts.map +1 -1
  126. package/dist/infrastructure/theme/theme.service.js +198 -96
  127. package/dist/infrastructure/theme/theme.service.js.map +1 -1
  128. package/dist/infrastructure/viewport/viewport.service.d.ts +233 -35
  129. package/dist/infrastructure/viewport/viewport.service.d.ts.map +1 -1
  130. package/dist/infrastructure/viewport/viewport.service.js +358 -139
  131. package/dist/infrastructure/viewport/viewport.service.js.map +1 -1
  132. package/dist/infrastructure/worker/worker.service.d.ts +84 -38
  133. package/dist/infrastructure/worker/worker.service.d.ts.map +1 -1
  134. package/dist/infrastructure/worker/worker.service.js +234 -133
  135. package/dist/infrastructure/worker/worker.service.js.map +1 -1
  136. package/dist/prisma/index.d.ts +2 -0
  137. package/dist/prisma/index.d.ts.map +1 -0
  138. package/dist/prisma/index.js +2 -0
  139. package/dist/prisma/index.js.map +1 -0
  140. package/dist/prisma/schema.json +11 -33
  141. package/dist/prisma/use-prisma.d.ts +68 -0
  142. package/dist/prisma/use-prisma.d.ts.map +1 -0
  143. package/dist/prisma/use-prisma.js +82 -0
  144. package/dist/prisma/use-prisma.js.map +1 -0
  145. package/dist/types/index.d.ts +20 -12
  146. package/dist/types/index.d.ts.map +1 -1
  147. package/package.json +124 -125
  148. package/CHANGELOG.md +0 -101
@@ -1,133 +1,412 @@
1
1
  // ============================================================
2
- // DOM facade (Singleton) over `document`, with SSR-safe guards.
2
+ // DOM facade — standalone functions with SSR-safe guards.
3
3
  // ============================================================
4
- export class DomService {
5
- static instance;
6
- constructor() { }
7
- static getInstance() {
8
- if (!DomService.instance) {
9
- DomService.instance = new DomService();
10
- }
11
- return DomService.instance;
12
- }
13
- useIsBrowser = () => typeof window !== "undefined" && typeof document !== "undefined";
14
- useGetRoot = () => {
15
- if (!this.useIsBrowser())
16
- return null;
17
- return document.documentElement;
18
- };
19
- useGetBody = () => {
20
- if (!this.useIsBrowser())
21
- return null;
22
- return document.body;
23
- };
24
- RESOLVE = (target) => {
25
- return typeof target === "string" ? this.useQuerySelector(target) : target;
26
- };
27
- useGetElementById = (id) => {
28
- if (!this.useIsBrowser())
29
- return null;
30
- return document.getElementById(id);
31
- };
32
- useGetElementByClass = (className) => {
33
- if (!this.useIsBrowser())
34
- return null;
35
- const formattedSelector = className.startsWith(".") ? className : `.${className}`;
36
- return document.querySelector(formattedSelector);
37
- };
38
- useQuerySelector = (selector) => {
39
- if (!this.useIsBrowser())
40
- return null;
41
- return document.querySelector(selector);
42
- };
43
- useQuerySelectorAll = (selector) => {
44
- if (!this.useIsBrowser())
45
- return [];
46
- return Array.from(document.querySelectorAll(selector));
47
- };
48
- useAddClass = (target, className) => {
49
- this.RESOLVE(target)?.classList.add(className);
50
- };
51
- useRemoveClass = (target, className) => {
52
- const el = this.RESOLVE(target);
53
- if (!el)
54
- return;
55
- if (Array.isArray(className)) {
56
- el.classList.remove(...className);
57
- }
58
- else {
59
- el.classList.remove(className);
60
- }
61
- };
62
- useToggleClass = (target, className, force) => {
63
- return this.RESOLVE(target)?.classList.toggle(className, force);
64
- };
65
- useHasClass = (target, className) => {
66
- return this.RESOLVE(target)?.classList.contains(className) ?? false;
67
- };
68
- useGetAttribute = (target, attr) => {
69
- return this.RESOLVE(target)?.getAttribute(attr) ?? null;
70
- };
71
- useSetAttribute = (target, attr, value) => {
72
- // Block event-handler attributes to prevent XSS.
73
- if (/^on/i.test(attr)) {
74
- throw new Error(`[DomService] Attribute "${attr}" is not allowed. Use useOn() for events.`);
75
- }
76
- this.RESOLVE(target)?.setAttribute(attr, value);
77
- };
78
- useRemoveAttribute = (target, attr) => {
79
- this.RESOLVE(target)?.removeAttribute(attr);
80
- };
81
- useGetDataAttribute = (target, key) => {
82
- return this.RESOLVE(target)?.dataset[key];
83
- };
84
- useSetDataAttribute = (target, key, value) => {
85
- const el = this.RESOLVE(target);
86
- if (el)
87
- el.dataset[key] = value;
88
- };
89
- useOn = (target, event, callback, options) => {
90
- if (!this.useIsBrowser())
91
- return null;
92
- const el = typeof target === "string" ? this.useQuerySelector(target) : target;
93
- if (!el)
94
- return null;
95
- const handler = callback;
96
- el.addEventListener(event, handler, options);
97
- return () => el.removeEventListener(event, handler, options);
98
- };
99
- useCreateElement = (tagName, options) => {
100
- if (!this.useIsBrowser()) {
101
- throw new Error("Cannot create elements in non-browser environment");
102
- }
103
- return document.createElement(tagName, options);
104
- };
105
- /**
106
- * Sets innerHTML on the target element.
107
- * WARNING: this is an XSS sink. Only pass trusted HTML. For user-supplied
108
- * content, use `useSetText` (textContent) instead, or sanitize with DOMPurify.
109
- */
110
- useSetHtml = (target, html) => {
111
- const el = this.RESOLVE(target);
112
- if (el)
113
- el.innerHTML = html ?? "";
114
- };
115
- useSetText = (target, text) => {
116
- const el = this.RESOLVE(target);
117
- if (el)
118
- el.textContent = text;
119
- };
120
- useAppend = (target, child) => {
121
- const parent = this.RESOLVE(target);
122
- const childEl = this.RESOLVE(child);
123
- if (parent && childEl)
124
- parent.appendChild(childEl);
125
- };
126
- useRemove = (target) => {
127
- this.RESOLVE(target)?.remove();
128
- };
4
+ /**
5
+ * Resolves a target to an Element, accepting either a string selector or an element reference.
6
+ *
7
+ * @param target - A CSS selector string or an Element instance.
8
+ * @returns The resolved Element, or `null` if not found.
9
+ */
10
+ function resolve(target) {
11
+ return typeof target === "string" ? useQuerySelector(target) : target;
129
12
  }
130
- // Singleton instance and destructured exports.
131
- export const DOM_SERVICE = DomService.getInstance();
132
- export const { useIsBrowser, useGetRoot, useGetBody, useGetElementById, useGetElementByClass, useQuerySelector, useQuerySelectorAll, useAddClass, useRemoveClass, useToggleClass, useHasClass, useGetAttribute, useSetAttribute, useRemoveAttribute, useGetDataAttribute, useSetDataAttribute, useOn, useCreateElement, useSetHtml, useSetText, useAppend, useRemove, } = DOM_SERVICE;
13
+ /**
14
+ * Checks whether the code is running in a browser environment.
15
+ *
16
+ * @returns `true` if both `window` and `document` are defined.
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * if (useIsBrowser()) {
21
+ * // safe to access DOM APIs
22
+ * }
23
+ * ```
24
+ */
25
+ export const useIsBrowser = () => typeof window !== "undefined" && typeof document !== "undefined";
26
+ /**
27
+ * Returns the root `<html>` element, or `null` outside a browser.
28
+ *
29
+ * @returns The `document.documentElement` element.
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * const root = useGetRoot();
34
+ * root?.setAttribute("lang", "en");
35
+ * ```
36
+ */
37
+ export const useGetRoot = () => {
38
+ if (!useIsBrowser())
39
+ return null;
40
+ return document.documentElement;
41
+ };
42
+ /**
43
+ * Returns the `<body>` element, or `null` outside a browser.
44
+ *
45
+ * @returns The `document.body` element cast as `HTMLBodyElement`.
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * const body = useGetBody();
50
+ * body?.classList.add("loaded");
51
+ * ```
52
+ */
53
+ export const useGetBody = () => {
54
+ if (!useIsBrowser())
55
+ return null;
56
+ return document.body;
57
+ };
58
+ /**
59
+ * Finds an element by its `id` attribute.
60
+ *
61
+ * @typeParam T - The expected HTMLElement subtype.
62
+ * @param id - The element id (without `#`).
63
+ * @returns The matching element, or `null`.
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * const btn = useGetElementById<HTMLButtonElement>("submit-btn");
68
+ * ```
69
+ */
70
+ export const useGetElementById = (id) => {
71
+ if (!useIsBrowser())
72
+ return null;
73
+ return document.getElementById(id);
74
+ };
75
+ /**
76
+ * Finds the first element matching a class name.
77
+ *
78
+ * @typeParam T - The expected HTMLElement subtype.
79
+ * @param className - A class name, with or without a leading `.`.
80
+ * @returns The matching element, or `null`.
81
+ *
82
+ * @example
83
+ * ```ts
84
+ * const card = useGetElementByClass(".card");
85
+ * const card2 = useGetElementByClass("card"); // equivalent
86
+ * ```
87
+ */
88
+ export const useGetElementByClass = (className) => {
89
+ if (!useIsBrowser())
90
+ return null;
91
+ const formattedSelector = className.startsWith(".") ? className : `.${className}`;
92
+ return document.querySelector(formattedSelector);
93
+ };
94
+ /**
95
+ * Returns the first element matching a CSS selector.
96
+ *
97
+ * @typeParam E - The expected Element subtype.
98
+ * @param selector - A CSS selector string.
99
+ * @returns The matching element, or `null`.
100
+ *
101
+ * @example
102
+ * ```ts
103
+ * const el = useQuerySelector<HTMLElement>(".my-class");
104
+ * ```
105
+ */
106
+ export const useQuerySelector = (selector) => {
107
+ if (!useIsBrowser())
108
+ return null;
109
+ return document.querySelector(selector);
110
+ };
111
+ /**
112
+ * Returns all elements matching a CSS selector.
113
+ *
114
+ * @typeParam E - The expected Element subtype.
115
+ * @param selector - A CSS selector string.
116
+ * @returns An array of matching elements.
117
+ *
118
+ * @example
119
+ * ```ts
120
+ * const items = useQuerySelectorAll<HTMLLIElement>("li.item");
121
+ * items.forEach(el => console.log(el.textContent));
122
+ * ```
123
+ */
124
+ export const useQuerySelectorAll = (selector) => {
125
+ if (!useIsBrowser())
126
+ return [];
127
+ return Array.from(document.querySelectorAll(selector));
128
+ };
129
+ /**
130
+ * Adds one or more CSS classes to the target element.
131
+ *
132
+ * @param target - A CSS selector string or an Element instance.
133
+ * @param className - The class name to add.
134
+ *
135
+ * @example
136
+ * ```ts
137
+ * useAddClass("#header", "sticky");
138
+ * useAddClass(myElement, "visible");
139
+ * ```
140
+ */
141
+ export const useAddClass = (target, className) => {
142
+ resolve(target)?.classList.add(className);
143
+ };
144
+ /**
145
+ * Removes CSS class(es) from the target element.
146
+ *
147
+ * @param target - A CSS selector string or an Element instance.
148
+ * @param className - A single class name or an array of class names to remove.
149
+ *
150
+ * @example
151
+ * ```ts
152
+ * useRemoveClass("#header", "sticky");
153
+ * useRemoveClass(myElement, ["visible", "active"]);
154
+ * ```
155
+ */
156
+ export const useRemoveClass = (target, className) => {
157
+ const el = resolve(target);
158
+ if (!el)
159
+ return;
160
+ if (Array.isArray(className)) {
161
+ el.classList.remove(...className);
162
+ }
163
+ else {
164
+ el.classList.remove(className);
165
+ }
166
+ };
167
+ /**
168
+ * Toggles a CSS class on the target element.
169
+ *
170
+ * @param target - A CSS selector string or an Element instance.
171
+ * @param className - The class name to toggle.
172
+ * @param force - If provided, forces the class on (`true`) or off (`false`).
173
+ * @returns `true` if the class is now present, `false` if removed, or `undefined` if element not found.
174
+ *
175
+ * @example
176
+ * ```ts
177
+ * useToggleClass(".sidebar", "open");
178
+ * useToggleClass(".sidebar", "hidden", false);
179
+ * ```
180
+ */
181
+ export const useToggleClass = (target, className, force) => {
182
+ return resolve(target)?.classList.toggle(className, force);
183
+ };
184
+ /**
185
+ * Checks whether the target element has a given CSS class.
186
+ *
187
+ * @param target - A CSS selector string or an Element instance.
188
+ * @param className - The class name to check.
189
+ * @returns `true` if the class exists, `false` otherwise.
190
+ *
191
+ * @example
192
+ * ```ts
193
+ * if (useHasClass(".btn", "disabled")) {
194
+ * // button is disabled
195
+ * }
196
+ * ```
197
+ */
198
+ export const useHasClass = (target, className) => {
199
+ return resolve(target)?.classList.contains(className) ?? false;
200
+ };
201
+ /**
202
+ * Gets the value of an attribute from the target element.
203
+ *
204
+ * @param target - A CSS selector string or an Element instance.
205
+ * @param attr - The attribute name.
206
+ * @returns The attribute value, or `null` if not present or element not found.
207
+ *
208
+ * @example
209
+ * ```ts
210
+ * const href = useGetAttribute("a.link", "href");
211
+ * ```
212
+ */
213
+ export const useGetAttribute = (target, attr) => {
214
+ return resolve(target)?.getAttribute(attr) ?? null;
215
+ };
216
+ /**
217
+ * Sets an attribute on the target element with XSS protection.
218
+ * Blocks event-handler attributes (`on*`) and `javascript:` URLs.
219
+ *
220
+ * @param target - A CSS selector string or an Element instance.
221
+ * @param attr - The attribute name.
222
+ * @param value - The value to set.
223
+ * @throws {Error} If the attribute is an event handler or contains a `javascript:` URL.
224
+ *
225
+ * @example
226
+ * ```ts
227
+ * useSetAttribute("img.hero", "src", "/photo.jpg");
228
+ * useSetAttribute("a.link", "href", "https://example.com");
229
+ * ```
230
+ */
231
+ export const useSetAttribute = (target, attr, value) => {
232
+ // Block event-handler attributes to prevent XSS.
233
+ if (/^on/i.test(attr)) {
234
+ throw new Error(`[DomService] Attribute "${attr}" is not allowed. Use useOn() for events.`);
235
+ }
236
+ const normalizedAttr = attr.toLowerCase();
237
+ const urlLikeAttrs = new Set(["href", "src", "xlink:href", "action", "formaction"]);
238
+ if (urlLikeAttrs.has(normalizedAttr) && /^\s*javascript:/i.test(value)) {
239
+ throw new Error(`[DomService] javascript: URLs are not allowed in attribute "${attr}".`);
240
+ }
241
+ if (normalizedAttr === "srcdoc" && /(?:javascript:|<script\b)/i.test(value)) {
242
+ throw new Error(`[DomService] Potentially unsafe srcdoc value is not allowed.`);
243
+ }
244
+ resolve(target)?.setAttribute(attr, value);
245
+ };
246
+ /**
247
+ * Removes an attribute from the target element.
248
+ *
249
+ * @param target - A CSS selector string or an Element instance.
250
+ * @param attr - The attribute name to remove.
251
+ *
252
+ * @example
253
+ * ```ts
254
+ * useRemoveAttribute("input", "disabled");
255
+ * ```
256
+ */
257
+ export const useRemoveAttribute = (target, attr) => {
258
+ resolve(target)?.removeAttribute(attr);
259
+ };
260
+ /**
261
+ * Gets a `data-*` attribute value from the target element.
262
+ *
263
+ * @param target - A CSS selector string or an HTMLElement instance.
264
+ * @param key - The data key (without the `data-` prefix).
265
+ * @returns The data attribute value, or `undefined`.
266
+ *
267
+ * @example
268
+ * ```ts
269
+ * const id = useGetDataAttribute("tr.row", "userId");
270
+ * ```
271
+ */
272
+ export const useGetDataAttribute = (target, key) => {
273
+ return resolve(target)?.dataset[key];
274
+ };
275
+ /**
276
+ * Sets a `data-*` attribute on the target element.
277
+ *
278
+ * @param target - A CSS selector string or an HTMLElement instance.
279
+ * @param key - The data key (without the `data-` prefix).
280
+ * @param value - The value to set.
281
+ *
282
+ * @example
283
+ * ```ts
284
+ * useSetDataAttribute("tr.row", "status", "active");
285
+ * ```
286
+ */
287
+ export const useSetDataAttribute = (target, key, value) => {
288
+ const el = resolve(target);
289
+ if (el)
290
+ el.dataset[key] = value;
291
+ };
292
+ /**
293
+ * Attaches an event listener to the target element and returns a cleanup function.
294
+ *
295
+ * @typeParam K - The event type key from `HTMLElementEventMap`.
296
+ * @param target - An EventTarget instance or a CSS selector string.
297
+ * @param event - The event name to listen for.
298
+ * @param callback - The event handler.
299
+ * @param options - Optional `addEventListener` options.
300
+ * @returns A function that removes the listener, or `null` if not in a browser.
301
+ *
302
+ * @example
303
+ * ```ts
304
+ * const off = useOn("#btn", "click", (e) => console.log("clicked", e));
305
+ * // later:
306
+ * off?.();
307
+ * ```
308
+ */
309
+ export const useOn = (target, event, callback, options) => {
310
+ if (!useIsBrowser())
311
+ return null;
312
+ const el = typeof target === "string" ? useQuerySelector(target) : target;
313
+ if (!el)
314
+ return null;
315
+ const handler = callback;
316
+ el.addEventListener(event, handler, options);
317
+ return () => el.removeEventListener(event, handler, options);
318
+ };
319
+ /**
320
+ * Creates a new HTML element.
321
+ *
322
+ * @typeParam T - The tag name from `HTMLElementTagNameMap`.
323
+ * @param tagName - The tag name to create.
324
+ * @param options - Optional element creation options.
325
+ * @returns The newly created element.
326
+ * @throws {Error} If called outside a browser environment.
327
+ *
328
+ * @example
329
+ * ```ts
330
+ * const div = useCreateElement("div");
331
+ * const input = useCreateElement("input", { is: "custom-input" });
332
+ * ```
333
+ */
334
+ export const useCreateElement = (tagName, options) => {
335
+ if (!useIsBrowser()) {
336
+ throw new Error("Cannot create elements in non-browser environment");
337
+ }
338
+ return document.createElement(tagName, options);
339
+ };
340
+ /**
341
+ * Sets `innerHTML` on the target element.
342
+ *
343
+ * **XSS risk:** this is an HTML injection sink. Never pass unsanitized
344
+ * user input. Prefer {@link useSetText} for plain text, or sanitize with
345
+ * a trusted library (e.g. DOMPurify) before calling this function.
346
+ *
347
+ * @param target - A CSS selector string or an Element instance.
348
+ * @param html - The HTML string to set.
349
+ *
350
+ * @example
351
+ * ```ts
352
+ * // Safe — trusted static markup
353
+ * useSetHtml("#banner", "<strong>Hello</strong>");
354
+ *
355
+ * // Unsafe — do NOT do this with user content
356
+ * // useSetHtml("#out", userInput);
357
+ * ```
358
+ */
359
+ export const useSetHtml = (target, html) => {
360
+ const el = resolve(target);
361
+ if (el)
362
+ el.innerHTML = html ?? "";
363
+ };
364
+ /**
365
+ * Sets the `textContent` of the target element (safe for user input).
366
+ *
367
+ * @param target - A CSS selector string or an Element instance.
368
+ * @param text - The plain text to set.
369
+ *
370
+ * @example
371
+ * ```ts
372
+ * useSetText("#greeting", "Hello, world!");
373
+ * ```
374
+ */
375
+ export const useSetText = (target, text) => {
376
+ const el = resolve(target);
377
+ if (el)
378
+ el.textContent = text;
379
+ };
380
+ /**
381
+ * Appends a child element to the target parent.
382
+ *
383
+ * @param target - A CSS selector string or an Element instance (the parent).
384
+ * @param child - A CSS selector string or an Element instance (the child).
385
+ *
386
+ * @example
387
+ * ```ts
388
+ * const item = useCreateElement("li");
389
+ * useSetText(item, "New item");
390
+ * useAppend("ul.list", item);
391
+ * ```
392
+ */
393
+ export const useAppend = (target, child) => {
394
+ const parent = resolve(target);
395
+ const childEl = resolve(child);
396
+ if (parent && childEl)
397
+ parent.appendChild(childEl);
398
+ };
399
+ /**
400
+ * Removes the target element from the DOM.
401
+ *
402
+ * @param target - A CSS selector string or an Element instance.
403
+ *
404
+ * @example
405
+ * ```ts
406
+ * useRemove(".modal-overlay");
407
+ * ```
408
+ */
409
+ export const useRemove = (target) => {
410
+ resolve(target)?.remove();
411
+ };
133
412
  //# sourceMappingURL=dom.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dom.service.js","sourceRoot":"","sources":["../../../src/infrastructure/dom/dom.service.ts"],"names":[],"mappings":"AAEA,+DAA+D;AAC/D,gEAAgE;AAChE,+DAA+D;AAC/D,MAAM,OAAO,UAAU;IACd,MAAM,CAAC,QAAQ,CAAa;IAEpC,gBAAuB,CAAC;IAEjB,MAAM,CAAC,WAAW;QACxB,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;YAC1B,UAAU,CAAC,QAAQ,GAAG,IAAI,UAAU,EAAE,CAAC;QACxC,CAAC;QACD,OAAO,UAAU,CAAC,QAAQ,CAAC;IAC5B,CAAC;IAEM,YAAY,GAAG,GAAY,EAAE,CACnC,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW,CAAC;IAE3D,UAAU,GAAG,GAAuB,EAAE;QAC5C,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YAAE,OAAO,IAAI,CAAC;QACtC,OAAO,QAAQ,CAAC,eAAe,CAAC;IACjC,CAAC,CAAC;IAEK,UAAU,GAAG,GAA2B,EAAE;QAChD,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YAAE,OAAO,IAAI,CAAC;QACtC,OAAO,QAAQ,CAAC,IAA8B,CAAC;IAChD,CAAC,CAAC;IAEM,OAAO,GAAG,CAAkC,MAAkB,EAAY,EAAE;QACnF,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAI,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAC/E,CAAC,CAAC;IAEK,iBAAiB,GAAG,CAAsC,EAAU,EAAY,EAAE;QACxF,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YAAE,OAAO,IAAI,CAAC;QACtC,OAAO,QAAQ,CAAC,cAAc,CAAC,EAAE,CAA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AAC;AACpD,CAAC,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAwB,EAAQ,EAAE;IAC3D,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;AAC3B,CAAC,CAAC"}
@@ -2,10 +2,7 @@ export * from "./dom/dom.service.js";
2
2
  export * from "./observer/observer.service.js";
3
3
  export * from "./sensors/sensors.service.js";
4
4
  export * from "./storage/storage.service.js";
5
- export { default as StorageService } from "./storage/storage.service.js";
6
5
  export * from "./theme/theme.service.js";
7
6
  export * from "./viewport/viewport.service.js";
8
- export { default as ViewportService } from "./viewport/viewport.service.js";
9
7
  export * from "./worker/worker.service.js";
10
- export { default as WorkerService } from "./worker/worker.service.js";
11
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/infrastructure/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACzE,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAC5E,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/infrastructure/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC"}
@@ -2,10 +2,7 @@ export * from "./dom/dom.service.js";
2
2
  export * from "./observer/observer.service.js";
3
3
  export * from "./sensors/sensors.service.js";
4
4
  export * from "./storage/storage.service.js";
5
- export { default as StorageService } from "./storage/storage.service.js";
6
5
  export * from "./theme/theme.service.js";
7
6
  export * from "./viewport/viewport.service.js";
8
- export { default as ViewportService } from "./viewport/viewport.service.js";
9
7
  export * from "./worker/worker.service.js";
10
- export { default as WorkerService } from "./worker/worker.service.js";
11
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/infrastructure/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACzE,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAC5E,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/infrastructure/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC"}