coldwired 0.18.0

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.
@@ -0,0 +1,72 @@
1
+ import { _ as invariant, h as isValidActionName } from "./actions-k0j8z15o.mjs";
2
+ import { z as parseHTMLFragment } from "./utils-C2S0wWJJ.mjs";
3
+ //#region src/turbo-stream.ts
4
+ async function renderTurboStream(actions, stream) {
5
+ actions.applyActions([...parseHTMLFragment(stream, actions.element.ownerDocument).children].map(parseTurboStream));
6
+ await actions.ready();
7
+ }
8
+ function parseTurboStream(stream) {
9
+ invariant(stream.tagName == "TURBO-STREAM", "[turbo-stream] element must be a <turbo-stream>");
10
+ const action = parseActionName(stream);
11
+ if (action == "refresh") return {
12
+ action,
13
+ targets: ""
14
+ };
15
+ const delay = parseDelay(stream);
16
+ const pin = parsePin(stream);
17
+ const targets = parseTargets(stream);
18
+ const fragment = parseTemplate(stream);
19
+ switch (action) {
20
+ case "after":
21
+ case "before":
22
+ case "update":
23
+ case "replace":
24
+ case "append":
25
+ case "prepend":
26
+ invariant(fragment, "[turbo-stream] template is required");
27
+ return {
28
+ action,
29
+ delay,
30
+ pin,
31
+ targets,
32
+ fragment
33
+ };
34
+ default: return {
35
+ action,
36
+ delay,
37
+ pin,
38
+ targets
39
+ };
40
+ }
41
+ }
42
+ function parseActionName(stream) {
43
+ const actionName = stream.getAttribute("action");
44
+ invariant(isValidActionName(actionName), `[actions] action "${actionName}" is not supported`);
45
+ return actionName;
46
+ }
47
+ function parsePin(stream) {
48
+ const pin = stream.getAttribute("pin");
49
+ if (pin == "" || pin == "true") return true;
50
+ else if (pin == "last") return "last";
51
+ }
52
+ function parseDelay(stream) {
53
+ const delay = stream.getAttribute("delay");
54
+ if (delay) return parseInt(delay);
55
+ }
56
+ function parseTargets(stream) {
57
+ const target = stream.getAttribute("target");
58
+ const targets = stream.getAttribute("targets");
59
+ invariant(targets || target, "[turbo-stream] \"target\" or \"targets\" attributes are required");
60
+ if (targets) return targets;
61
+ return `#${target}`;
62
+ }
63
+ function parseTemplate(stream) {
64
+ const templateElement = stream.firstElementChild;
65
+ if (!templateElement) return;
66
+ invariant(templateElement instanceof HTMLTemplateElement, "[turbo-stream] first child element must be a <template> element");
67
+ const templateContent = templateElement.content;
68
+ templateContent.normalize();
69
+ return templateContent;
70
+ }
71
+ //#endregion
72
+ export { parseTurboStream, renderTurboStream };
@@ -0,0 +1,350 @@
1
+ //#region node_modules/just-debounce-it/index.mjs
2
+ var functionDebounce = debounce$1;
3
+ function debounce$1(fn, wait, callFirst) {
4
+ var timeout = null;
5
+ var debouncedFn = null;
6
+ var clear = function() {
7
+ if (timeout) {
8
+ clearTimeout(timeout);
9
+ debouncedFn = null;
10
+ timeout = null;
11
+ }
12
+ };
13
+ var flush = function() {
14
+ var call = debouncedFn;
15
+ clear();
16
+ if (call) call();
17
+ };
18
+ var debounceWrapper = function() {
19
+ if (!wait) return fn.apply(this, arguments);
20
+ var context = this;
21
+ var args = arguments;
22
+ var callNow = callFirst && !timeout;
23
+ clear();
24
+ debouncedFn = function() {
25
+ fn.apply(context, args);
26
+ };
27
+ timeout = setTimeout(function() {
28
+ timeout = null;
29
+ if (!callNow) {
30
+ var call = debouncedFn;
31
+ debouncedFn = null;
32
+ return call();
33
+ }
34
+ }, wait);
35
+ if (callNow) return debouncedFn();
36
+ };
37
+ debounceWrapper.cancel = clear;
38
+ debounceWrapper.flush = flush;
39
+ return debounceWrapper;
40
+ }
41
+ //#endregion
42
+ //#region node_modules/just-throttle/index.mjs
43
+ var functionThrottle = throttle$1;
44
+ function throttle$1(fn, interval, options) {
45
+ var timeoutId = null;
46
+ var throttledFn = null;
47
+ var leading = options && options.leading;
48
+ var trailing = options && options.trailing;
49
+ if (leading == null) leading = true;
50
+ if (trailing == null) trailing = !leading;
51
+ if (leading == true) trailing = false;
52
+ var cancel = function() {
53
+ if (timeoutId) {
54
+ clearTimeout(timeoutId);
55
+ timeoutId = null;
56
+ }
57
+ };
58
+ var flush = function() {
59
+ var call = throttledFn;
60
+ cancel();
61
+ if (call) call();
62
+ };
63
+ var throttleWrapper = function() {
64
+ var callNow = leading && !timeoutId;
65
+ var context = this;
66
+ var args = arguments;
67
+ throttledFn = function() {
68
+ return fn.apply(context, args);
69
+ };
70
+ if (!timeoutId) timeoutId = setTimeout(function() {
71
+ timeoutId = null;
72
+ if (trailing) return throttledFn();
73
+ }, interval);
74
+ if (callNow) {
75
+ callNow = false;
76
+ return throttledFn();
77
+ }
78
+ };
79
+ throttleWrapper.cancel = cancel;
80
+ throttleWrapper.flush = flush;
81
+ return throttleWrapper;
82
+ }
83
+ //#endregion
84
+ //#region src/utils.ts
85
+ function expandURL(locatable) {
86
+ return new URL(locatable.toString(), document.baseURI);
87
+ }
88
+ function relativeURL(url) {
89
+ return `${url.pathname}${url.search}`;
90
+ }
91
+ function dispatch(eventName, { target, cancelable, detail } = {}) {
92
+ const event = new CustomEvent(eventName, {
93
+ cancelable,
94
+ bubbles: true,
95
+ detail
96
+ });
97
+ if (target && target.isConnected) target.dispatchEvent(event);
98
+ else document.documentElement.dispatchEvent(event);
99
+ return event;
100
+ }
101
+ const DEFAULT_INTERVAL = 500;
102
+ function debounce(target, callback, interval) {
103
+ let fn = debounced.get(target);
104
+ if (!fn) {
105
+ if (interval != 0) {
106
+ fn = functionDebounce(callback, interval ?? DEFAULT_INTERVAL);
107
+ debounced.set(target, fn);
108
+ }
109
+ }
110
+ (fn ?? callback)();
111
+ }
112
+ const debounced = /* @__PURE__ */ new WeakMap();
113
+ function cancelDebounce(target) {
114
+ debounced.get(target)?.cancel();
115
+ }
116
+ function throttle(target, callback, interval) {
117
+ let fn = throttled.get(target);
118
+ if (!fn) {
119
+ if (interval != 0) {
120
+ fn = functionThrottle(callback, interval ?? DEFAULT_INTERVAL);
121
+ throttled.set(target, fn);
122
+ }
123
+ }
124
+ (fn ?? callback)();
125
+ }
126
+ const throttled = /* @__PURE__ */ new WeakMap();
127
+ function cancelThrottle(target) {
128
+ throttled.get(target)?.cancel();
129
+ }
130
+ function parseIntWithDefault(value, defaultValue = 0) {
131
+ return value ? parseInt(value) : defaultValue;
132
+ }
133
+ function isElement(node) {
134
+ return isNode(node) && node.nodeType == Node.ELEMENT_NODE;
135
+ }
136
+ function isHTMLElement(node) {
137
+ return isElement(node) && "style" in node;
138
+ }
139
+ function isButtonElement(node) {
140
+ return isElement(node) && node.tagName == "BUTTON";
141
+ }
142
+ function isAnchorElement(node) {
143
+ return isElement(node) && node.tagName == "A";
144
+ }
145
+ function isLinkElement(node) {
146
+ return isElement(node) && node.tagName == "LINK";
147
+ }
148
+ function isFormElement(node) {
149
+ return isElement(node) && node.tagName == "FORM";
150
+ }
151
+ function isSubmitterElement(node) {
152
+ return isButtonElement(node) || isInputElement(node);
153
+ }
154
+ function isInputElement(node) {
155
+ return isElement(node) && node.tagName == "INPUT";
156
+ }
157
+ function isFormInputElement(node) {
158
+ return isElement(node) && [
159
+ "INPUT",
160
+ "TEXTAREA",
161
+ "SELECT"
162
+ ].includes(node.tagName);
163
+ }
164
+ function isTextAreaElement(node) {
165
+ return isElement(node) && node.tagName == "TEXTAREA";
166
+ }
167
+ function isSelectElement(node) {
168
+ return isElement(node) && node.tagName == "SELECT";
169
+ }
170
+ function isFormOptionElement(node) {
171
+ return isElement(node) && node.tagName == "OPTION";
172
+ }
173
+ function isDateInputElement(node) {
174
+ return isInputElement(node) && isDateType(node.type);
175
+ }
176
+ function isNumberInputElement(node) {
177
+ return isInputElement(node) && node.type == "number";
178
+ }
179
+ function isCheckboxInputElement(node) {
180
+ return isInputElement(node) && node.type == "checkbox";
181
+ }
182
+ function isRadioInputElement(node) {
183
+ return isInputElement(node) && node.type == "radio";
184
+ }
185
+ function isRangeInputElement(node) {
186
+ return isInputElement(node) && node.type == "range";
187
+ }
188
+ function isColorInputElement(node) {
189
+ return isInputElement(node) && node.type == "color";
190
+ }
191
+ function isFileInputElement(node) {
192
+ return isInputElement(node) && node.type == "file";
193
+ }
194
+ function isHiddenInputElement(node) {
195
+ return isInputElement(node) && node.type == "hidden";
196
+ }
197
+ function isTextInputElement(node) {
198
+ return isTextAreaElement(node) || isInputElement(node) && isTextType(node.type);
199
+ }
200
+ function isInputableElement(node) {
201
+ return isTextAreaElement(node) || isInputElement(node) && isInputableType(node.type);
202
+ }
203
+ function isChangeableElement(node) {
204
+ return isSelectElement(node) || isInputElement(node) && isChangeableType(node.type);
205
+ }
206
+ function isElementOrText(node) {
207
+ return isNode(node) && (node.nodeType == Node.TEXT_NODE || node.nodeType == Node.ELEMENT_NODE);
208
+ }
209
+ function isNode(node) {
210
+ return !!node && "nodeType" in node;
211
+ }
212
+ function isFocused(element) {
213
+ return element.ownerDocument.activeElement == element;
214
+ }
215
+ function focusElement(element) {
216
+ if ("focus" in element && typeof element.focus == "function") {
217
+ element.focus();
218
+ if (isInputableElement(element)) try {
219
+ element.setSelectionRange(element.value.length, element.value.length);
220
+ } catch {}
221
+ }
222
+ }
223
+ function focusNextElement(element, options) {
224
+ const activeElement = element.ownerDocument.activeElement;
225
+ if (activeElement && (element == activeElement || element.contains(activeElement))) {
226
+ const nextFocusedElement = getNextFocusableElement(element, activeElement, options);
227
+ if (nextFocusedElement) focusElement(nextFocusedElement);
228
+ }
229
+ }
230
+ function parseHTMLDocument(html) {
231
+ return new DOMParser().parseFromString(html, "text/html");
232
+ }
233
+ function parseHTMLFragment(html, ownerDocument) {
234
+ const template = ownerDocument.createElement("template");
235
+ template.innerHTML = html;
236
+ const fragment = template.content;
237
+ fragment.normalize();
238
+ return fragment;
239
+ }
240
+ function domReady() {
241
+ return new Promise((resolve) => {
242
+ if (document.readyState == "loading") document.addEventListener("DOMContentLoaded", () => resolve(), { once: true });
243
+ else resolve();
244
+ });
245
+ }
246
+ function nextAnimationFrame() {
247
+ return new Promise((resolve) => requestAnimationFrame(() => resolve()));
248
+ }
249
+ var AbortError = class extends Error {};
250
+ function wait(delay, signal) {
251
+ return new Promise((resolve, reject) => {
252
+ const timer = setTimeout(resolve, delay);
253
+ signal?.addEventListener("abort", () => {
254
+ clearTimeout(timer);
255
+ reject(new AbortError("Aborted"));
256
+ }, { once: true });
257
+ });
258
+ }
259
+ function groupBy(array, predicat) {
260
+ return array.reduce((map, entry) => {
261
+ const key = predicat(entry);
262
+ const entries = map.get(key);
263
+ if (!entries) map.set(key, [entry]);
264
+ else entries.push(entry);
265
+ return map;
266
+ }, /* @__PURE__ */ new Map());
267
+ }
268
+ function partition(array, predicat) {
269
+ return array.reduce((parts, entry) => {
270
+ if (predicat(entry)) parts[0].push(entry);
271
+ else parts[1].push(entry);
272
+ return parts;
273
+ }, [[], []]);
274
+ }
275
+ function getNextFocusableElement(element, activeElement, options) {
276
+ const focusDirectionAttribute = options?.focusDirectionAttribute;
277
+ const focusGroupAttribute = options?.focusGroupAttribute;
278
+ const focusDirection = focusDirectionAttribute ? element.closest(`[${focusDirectionAttribute}]`)?.getAttribute(focusDirectionAttribute) : "prev";
279
+ const focusGroupElement = focusGroupAttribute ? element.closest(`[${focusGroupAttribute}]`) : null;
280
+ return (focusGroupElement ? getNextFocusableElementInGroup(focusGroupElement, element, activeElement, focusDirection == "next" ? "next" : "prev") : null) || getNextFocusableElementInGroup(element.ownerDocument.body, element, activeElement, focusDirection == "next" ? "next" : "prev");
281
+ }
282
+ function getNextFocusableElementInGroup(focusGroupElement, element, activeElement, direction = "prev") {
283
+ const focusable = getKeyboardFocusableElements(focusGroupElement, element, activeElement);
284
+ const index = focusable.indexOf(activeElement);
285
+ if (focusable.length < 2) return null;
286
+ const lastIndex = focusable.length - 1;
287
+ const prevIndex = index != 0 ? index - 1 : index + 1;
288
+ const nextIndex = index != lastIndex ? index + 1 : index - 1;
289
+ if (direction == "prev") return focusable.at(prevIndex) ?? focusable.at(nextIndex) ?? null;
290
+ return focusable.at(nextIndex) ?? focusable.at(prevIndex) ?? null;
291
+ }
292
+ function getKeyboardFocusableElements(element, elementToRemove, activeElement) {
293
+ return [...element.querySelectorAll("a[href], button:not(:disabled), input:not(:disabled), textarea:not(:disabled), select:not(:disabled), details, [tabindex]:not([tabindex=\"-1\"])")].filter((element) => element == activeElement || !element.closest("[aria-hidden], [hidden]") && !elementToRemove.contains(element));
294
+ }
295
+ const TEXT_TYPES = [
296
+ "text",
297
+ "search",
298
+ "url",
299
+ "tel",
300
+ "password",
301
+ "email"
302
+ ];
303
+ function isTextType(type) {
304
+ return TEXT_TYPES.includes(type);
305
+ }
306
+ const DATE_TYPES = [
307
+ "date",
308
+ "datetime-local",
309
+ "month",
310
+ "week",
311
+ "time"
312
+ ];
313
+ function isDateType(type) {
314
+ return DATE_TYPES.includes(type);
315
+ }
316
+ const INPUTABLE_TYPES = [
317
+ ...TEXT_TYPES,
318
+ ...DATE_TYPES,
319
+ "number"
320
+ ];
321
+ function isInputableType(type) {
322
+ return INPUTABLE_TYPES.includes(type);
323
+ }
324
+ const CHANGEABLE_TYPES = [
325
+ "checkbox",
326
+ "radio",
327
+ "range",
328
+ "file",
329
+ "color"
330
+ ];
331
+ function isChangeableType(type) {
332
+ return CHANGEABLE_TYPES.includes(type);
333
+ }
334
+ function matchInputElement(node, matcher, options) {
335
+ if (isFormInputElement(node) && !options?.disabled && node.disabled) return;
336
+ if (isInputableElement(node)) if (matcher.text && isTextInputElement(node)) matcher.text(node);
337
+ else if (matcher.date && isDateInputElement(node)) matcher.date(node);
338
+ else if (matcher.number && isNumberInputElement(node)) matcher.number(node);
339
+ else matcher.inputable?.(node);
340
+ else if (isChangeableElement(node)) if (matcher.select && isSelectElement(node)) matcher.select(node);
341
+ else if (matcher.checkbox && isCheckboxInputElement(node)) matcher.checkbox(node);
342
+ else if (matcher.radio && isRadioInputElement(node)) matcher.radio(node);
343
+ else if (matcher.range && isRangeInputElement(node)) matcher.range(node);
344
+ else if (matcher.file && isFileInputElement(node)) matcher.file(node);
345
+ else if (matcher.color && isColorInputElement(node)) matcher.color(node);
346
+ else matcher.changeable?.(node);
347
+ else if (isHiddenInputElement(node)) matcher.hidden?.(node);
348
+ }
349
+ //#endregion
350
+ export { isRadioInputElement as A, parseIntWithDefault as B, isFormOptionElement as C, isInputableElement as D, isInputElement as E, isTextInputElement as F, relativeURL as H, matchInputElement as I, nextAnimationFrame as L, isSelectElement as M, isSubmitterElement as N, isLinkElement as O, isTextAreaElement as P, parseHTMLDocument as R, isFormInputElement as S, isHiddenInputElement as T, throttle as U, partition as V, wait as W, isElement as _, dispatch as a, isFocused as b, focusElement as c, isAnchorElement as d, isButtonElement as f, isDateInputElement as g, isColorInputElement as h, debounce as i, isRangeInputElement as j, isNumberInputElement as k, focusNextElement as l, isCheckboxInputElement as m, cancelDebounce as n, domReady as o, isChangeableElement as p, cancelThrottle as r, expandURL as s, AbortError as t, groupBy as u, isElementOrText as v, isHTMLElement as w, isFormElement as x, isFileInputElement as y, parseHTMLFragment as z };
@@ -0,0 +1,80 @@
1
+ //#region src/utils.d.ts
2
+ type Locatable = URL | string;
3
+ declare function expandURL(locatable: Locatable): URL;
4
+ declare function relativeURL(url: URL): string;
5
+ type DispatchOptions<T> = {
6
+ target: EventTarget & {
7
+ isConnected?: boolean;
8
+ };
9
+ cancelable: boolean;
10
+ detail: T;
11
+ };
12
+ declare function dispatch<T>(eventName: string, {
13
+ target,
14
+ cancelable,
15
+ detail
16
+ }?: Partial<DispatchOptions<T>>): CustomEvent<T>;
17
+ declare function debounce(target: Element, callback: () => void, interval?: number): void;
18
+ declare function cancelDebounce(target: Element): void;
19
+ declare function throttle(target: Element, callback: () => void, interval?: number): void;
20
+ declare function cancelThrottle(target: Element): void;
21
+ declare function parseIntWithDefault(value: string | null, defaultValue?: number): number;
22
+ type HTMLSubmitterElement = HTMLInputElement | HTMLButtonElement;
23
+ declare function isElement(node: unknown): node is Element;
24
+ declare function isHTMLElement(node: unknown): node is HTMLElement;
25
+ declare function isButtonElement(node: unknown): node is HTMLButtonElement;
26
+ declare function isAnchorElement(node: unknown): node is HTMLAnchorElement;
27
+ declare function isLinkElement(node: unknown): node is HTMLLinkElement;
28
+ declare function isFormElement(node: unknown): node is HTMLFormElement;
29
+ declare function isSubmitterElement(node: unknown): node is HTMLSubmitterElement;
30
+ declare function isInputElement(node: unknown): node is HTMLInputElement;
31
+ declare function isFormInputElement(node: unknown): node is HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;
32
+ declare function isTextAreaElement(node: unknown): node is HTMLTextAreaElement;
33
+ declare function isSelectElement(node: unknown): node is HTMLSelectElement;
34
+ declare function isFormOptionElement(node: unknown): node is HTMLOptionElement;
35
+ declare function isDateInputElement(node: unknown): node is HTMLInputElement;
36
+ declare function isNumberInputElement(node: unknown): node is HTMLInputElement;
37
+ declare function isCheckboxInputElement(node: unknown): node is HTMLInputElement;
38
+ declare function isRadioInputElement(node: unknown): node is HTMLInputElement;
39
+ declare function isRangeInputElement(node: unknown): node is HTMLInputElement;
40
+ declare function isColorInputElement(node: unknown): node is HTMLInputElement;
41
+ declare function isFileInputElement(node: unknown): node is HTMLInputElement;
42
+ declare function isHiddenInputElement(node: unknown): node is HTMLInputElement;
43
+ declare function isTextInputElement(node: unknown): node is HTMLInputElement | HTMLTextAreaElement;
44
+ declare function isInputableElement(node: unknown): node is HTMLInputElement | HTMLTextAreaElement;
45
+ declare function isChangeableElement(node: unknown): node is HTMLInputElement | HTMLSelectElement;
46
+ declare function isElementOrText(node: unknown): node is Element | Text;
47
+ declare function isFocused(element: Element): boolean;
48
+ declare function focusElement(element: Element): void;
49
+ type FocusNextOptions = {
50
+ focusGroupAttribute?: string;
51
+ focusDirectionAttribute?: string;
52
+ };
53
+ declare function focusNextElement(element: Element, options?: FocusNextOptions): void;
54
+ declare function parseHTMLDocument(html: string): Document;
55
+ declare function parseHTMLFragment(html: string, ownerDocument: Document): DocumentFragment;
56
+ declare function domReady(): Promise<void>;
57
+ declare function nextAnimationFrame(): Promise<void>;
58
+ declare class AbortError extends Error {}
59
+ declare function wait(delay: number, signal?: AbortSignal): Promise<void>;
60
+ declare function groupBy<T, K>(array: T[], predicat: (entry: T) => K): Map<K, T[]>;
61
+ declare function partition<T>(array: T[], predicat: (entry: T) => boolean): [yes: T[], no: T[]];
62
+ type InputMatcher<T extends HTMLElement = HTMLInputElement> = (element: T) => void;
63
+ declare function matchInputElement(node: unknown, matcher: {
64
+ inputable?: InputMatcher<HTMLInputElement | HTMLTextAreaElement>;
65
+ changeable?: InputMatcher<HTMLInputElement | HTMLSelectElement>;
66
+ text?: InputMatcher<HTMLInputElement | HTMLTextAreaElement>;
67
+ select?: InputMatcher<HTMLSelectElement>;
68
+ date?: InputMatcher;
69
+ number?: InputMatcher;
70
+ checkbox?: InputMatcher;
71
+ radio?: InputMatcher;
72
+ range?: InputMatcher;
73
+ file?: InputMatcher;
74
+ color?: InputMatcher;
75
+ hidden?: InputMatcher;
76
+ }, options?: {
77
+ disabled?: boolean;
78
+ }): void;
79
+ //#endregion
80
+ export { AbortError, DispatchOptions, FocusNextOptions, HTMLSubmitterElement, Locatable, cancelDebounce, cancelThrottle, debounce, dispatch, domReady, expandURL, focusElement, focusNextElement, groupBy, isAnchorElement, isButtonElement, isChangeableElement, isCheckboxInputElement, isColorInputElement, isDateInputElement, isElement, isElementOrText, isFileInputElement, isFocused, isFormElement, isFormInputElement, isFormOptionElement, isHTMLElement, isHiddenInputElement, isInputElement, isInputableElement, isLinkElement, isNumberInputElement, isRadioInputElement, isRangeInputElement, isSelectElement, isSubmitterElement, isTextAreaElement, isTextInputElement, matchInputElement, nextAnimationFrame, parseHTMLDocument, parseHTMLFragment, parseIntWithDefault, partition, relativeURL, throttle, wait };
package/dist/utils.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import { A as isRadioInputElement, B as parseIntWithDefault, C as isFormOptionElement, D as isInputableElement, E as isInputElement, F as isTextInputElement, H as relativeURL, I as matchInputElement, L as nextAnimationFrame, M as isSelectElement, N as isSubmitterElement, O as isLinkElement, P as isTextAreaElement, R as parseHTMLDocument, S as isFormInputElement, T as isHiddenInputElement, U as throttle, V as partition, W as wait, _ as isElement, a as dispatch, b as isFocused, c as focusElement, d as isAnchorElement, f as isButtonElement, g as isDateInputElement, h as isColorInputElement, i as debounce, j as isRangeInputElement, k as isNumberInputElement, l as focusNextElement, m as isCheckboxInputElement, n as cancelDebounce, o as domReady, p as isChangeableElement, r as cancelThrottle, s as expandURL, t as AbortError, u as groupBy, v as isElementOrText, w as isHTMLElement, x as isFormElement, y as isFileInputElement, z as parseHTMLFragment } from "./utils-C2S0wWJJ.mjs";
2
+ export { AbortError, cancelDebounce, cancelThrottle, debounce, dispatch, domReady, expandURL, focusElement, focusNextElement, groupBy, isAnchorElement, isButtonElement, isChangeableElement, isCheckboxInputElement, isColorInputElement, isDateInputElement, isElement, isElementOrText, isFileInputElement, isFocused, isFormElement, isFormInputElement, isFormOptionElement, isHTMLElement, isHiddenInputElement, isInputElement, isInputableElement, isLinkElement, isNumberInputElement, isRadioInputElement, isRangeInputElement, isSelectElement, isSubmitterElement, isTextAreaElement, isTextInputElement, matchInputElement, nextAnimationFrame, parseHTMLDocument, parseHTMLFragment, parseIntWithDefault, partition, relativeURL, throttle, wait };
package/package.json ADDED
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "coldwired",
3
+ "version": "0.18.0",
4
+ "description": "DOM manipulation actions based on morphdom",
5
+ "homepage": "https://github.com/tchak/coldwired#readme",
6
+ "bugs": {
7
+ "url": "https://github.com/tchak/coldwired/issues"
8
+ },
9
+ "license": "MIT",
10
+ "author": "Paul Chavard <pro@paul.chavard.net>",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/tchak/coldwired.git"
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "type": "module",
19
+ "exports": {
20
+ "./actions": "./dist/actions.mjs",
21
+ "./react": "./dist/react.mjs",
22
+ "./turbo-stream": "./dist/turbo-stream.mjs",
23
+ "./utils": "./dist/utils.mjs",
24
+ "./package.json": "./package.json"
25
+ },
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "scripts": {
30
+ "build": "vp pack",
31
+ "dev": "vp pack --watch",
32
+ "test": "vp test",
33
+ "check": "vp check",
34
+ "prepublishOnly": "vp run build"
35
+ },
36
+ "dependencies": {
37
+ "html-entities": "^2.6.0",
38
+ "morphdom": "^2.7.8",
39
+ "react": "^19.2.4",
40
+ "react-dom": "^19.2.4"
41
+ },
42
+ "devDependencies": {
43
+ "@arethetypeswrong/core": "^0.18.2",
44
+ "@testing-library/dom": "^10.4.1",
45
+ "@types/node": "^25.5.0",
46
+ "@types/react": "^19.2.14",
47
+ "@types/react-dom": "^19.2.3",
48
+ "@typescript/native-preview": "7.0.0-dev.20260328.1",
49
+ "bumpp": "^11.0.1",
50
+ "just-debounce-it": "^3.2.0",
51
+ "just-throttle": "^4.2.0",
52
+ "playwright": "^1.59.1",
53
+ "publint": "^0.3.18",
54
+ "react-aria-components": "^1.16.0",
55
+ "react-error-boundary": "^6.1.1",
56
+ "tiny-invariant": "^1.3.3",
57
+ "typescript": "^6.0.2",
58
+ "vite-plus": "^0.1.14",
59
+ "zod": "^4.3.6"
60
+ },
61
+ "overrides": {
62
+ "vite": "npm:@voidzero-dev/vite-plus-core@latest",
63
+ "vitest": "npm:@voidzero-dev/vite-plus-test@latest"
64
+ },
65
+ "packageManager": "bun@1.3.11",
66
+ "inlinedDependencies": {
67
+ "just-debounce-it": "3.2.0",
68
+ "just-throttle": "4.2.0",
69
+ "react-error-boundary": "6.1.1",
70
+ "tiny-invariant": "1.3.3"
71
+ }
72
+ }