elements-kit 0.1.0 → 0.3.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.
Files changed (111) hide show
  1. package/dist/attributes.d.mts +1 -1
  2. package/dist/benchmark.CX_oY03V-COK1VBpH.mjs +5176 -0
  3. package/dist/custom-elements.d.mts +1 -1
  4. package/dist/{element-w1GCIMVp.mjs → element-BjpyY6qv.mjs} +17 -35
  5. package/dist/for.d.mts +1 -1
  6. package/dist/for.mjs +2 -2
  7. package/dist/{infer-DuFY-y2b.d.mts → infer-BUUWMoG9.d.mts} +3 -3
  8. package/dist/integrations/react.d.mts +1 -1
  9. package/dist/integrations/react.mjs +2 -2
  10. package/dist/jsx-runtime/index.d.mts +1 -1
  11. package/dist/jsx-runtime/index.mjs +1 -1
  12. package/dist/render.mjs +1 -1
  13. package/dist/{scope-DM2gzOkb.mjs → scope-CwVlgN8b.mjs} +1 -1
  14. package/dist/signals/index.d.mts +1 -1
  15. package/dist/signals/index.mjs +2 -2
  16. package/dist/{slot-CKtUoy2X.mjs → slot-BnzxFBfO.mjs} +1 -1
  17. package/dist/slot.d.mts +1 -1
  18. package/dist/slot.mjs +1 -1
  19. package/dist/{test.BmQO5GaM-BeO5pvCo.mjs → test.BmQO5GaM-C8YqghE0.mjs} +9 -5156
  20. package/dist/utilities/_observe.mjs +1 -1
  21. package/dist/utilities/active-element.d.mts +1 -1
  22. package/dist/utilities/active-element.mjs +1 -1
  23. package/dist/utilities/active-element.test.mjs +2 -1
  24. package/dist/utilities/async.d.mts +1 -1
  25. package/dist/utilities/async.mjs +1 -1
  26. package/dist/utilities/async.test.mjs +3 -2
  27. package/dist/utilities/context.d.mts +78 -0
  28. package/dist/utilities/context.mjs +115 -0
  29. package/dist/utilities/context.test.d.mts +1 -0
  30. package/dist/utilities/context.test.mjs +171 -0
  31. package/dist/utilities/debounced.d.mts +1 -1
  32. package/dist/utilities/debounced.mjs +1 -1
  33. package/dist/utilities/debounced.test.mjs +3 -2
  34. package/dist/utilities/dom-lifecycle.bench.d.mts +1 -0
  35. package/dist/utilities/dom-lifecycle.bench.mjs +90 -0
  36. package/dist/utilities/dom-lifecycle.d.mts +88 -0
  37. package/dist/utilities/dom-lifecycle.mjs +113 -0
  38. package/dist/utilities/dom-lifecycle.test.d.mts +1 -0
  39. package/dist/utilities/dom-lifecycle.test.mjs +227 -0
  40. package/dist/utilities/element-rect.d.mts +1 -1
  41. package/dist/utilities/element-rect.mjs +1 -1
  42. package/dist/utilities/element-rect.test.mjs +3 -2
  43. package/dist/utilities/element-scroll.d.mts +1 -1
  44. package/dist/utilities/element-scroll.test.mjs +3 -2
  45. package/dist/utilities/event-driven.d.mts +1 -1
  46. package/dist/utilities/event-driven.mjs +1 -1
  47. package/dist/utilities/event-listener.d.mts +1 -1
  48. package/dist/utilities/event-listener.mjs +1 -1
  49. package/dist/utilities/event-listener.test.mjs +3 -2
  50. package/dist/utilities/focus-within.d.mts +1 -1
  51. package/dist/utilities/focus-within.mjs +1 -1
  52. package/dist/utilities/focus-within.test.mjs +3 -2
  53. package/dist/utilities/hover.d.mts +1 -1
  54. package/dist/utilities/hover.mjs +1 -1
  55. package/dist/utilities/hover.test.mjs +3 -2
  56. package/dist/utilities/intersection-observer.test.mjs +3 -2
  57. package/dist/utilities/interval.d.mts +1 -1
  58. package/dist/utilities/interval.mjs +1 -1
  59. package/dist/utilities/interval.test.mjs +3 -2
  60. package/dist/utilities/location.d.mts +1 -1
  61. package/dist/utilities/location.mjs +1 -1
  62. package/dist/utilities/location.test.mjs +2 -1
  63. package/dist/utilities/long-press.test.mjs +3 -2
  64. package/dist/utilities/media-devices.d.mts +1 -1
  65. package/dist/utilities/media-devices.mjs +1 -1
  66. package/dist/utilities/media-devices.test.mjs +3 -2
  67. package/dist/utilities/media-player.d.mts +1 -1
  68. package/dist/utilities/media-player.test.mjs +3 -2
  69. package/dist/utilities/media-query.d.mts +1 -1
  70. package/dist/utilities/media-query.mjs +1 -1
  71. package/dist/utilities/mutation-observer.test.mjs +3 -2
  72. package/dist/utilities/network.d.mts +1 -1
  73. package/dist/utilities/network.mjs +1 -1
  74. package/dist/utilities/network.test.mjs +2 -1
  75. package/dist/utilities/on-click-outside.test.mjs +3 -2
  76. package/dist/utilities/orientation.d.mts +1 -1
  77. package/dist/utilities/orientation.mjs +1 -1
  78. package/dist/utilities/previous.d.mts +1 -1
  79. package/dist/utilities/previous.mjs +1 -1
  80. package/dist/utilities/previous.test.mjs +3 -2
  81. package/dist/utilities/promise.d.mts +1 -1
  82. package/dist/utilities/promise.mjs +1 -1
  83. package/dist/utilities/promise.test.mjs +3 -2
  84. package/dist/utilities/retry.mjs +1 -1
  85. package/dist/utilities/retry.test.mjs +3 -2
  86. package/dist/utilities/routing.d.mts +1 -1
  87. package/dist/utilities/routing.mjs +1 -1
  88. package/dist/utilities/routing.test.mjs +2 -1
  89. package/dist/utilities/search-params.d.mts +1 -1
  90. package/dist/utilities/search-params.test.mjs +3 -2
  91. package/dist/utilities/ssr.test.mjs +2 -1
  92. package/dist/utilities/storage.d.mts +1 -1
  93. package/dist/utilities/storage.test.mjs +3 -2
  94. package/dist/utilities/throttled.d.mts +1 -1
  95. package/dist/utilities/throttled.mjs +1 -1
  96. package/dist/utilities/throttled.test.mjs +3 -2
  97. package/dist/utilities/timeout.d.mts +1 -1
  98. package/dist/utilities/timeout.mjs +1 -1
  99. package/dist/utilities/timeout.test.mjs +3 -2
  100. package/dist/utilities/window-focus.d.mts +1 -1
  101. package/dist/utilities/window-focus.mjs +1 -1
  102. package/dist/utilities/window-size.d.mts +1 -1
  103. package/dist/utilities/window-size.mjs +1 -1
  104. package/dist/utilities/window-size.test.mjs +2 -1
  105. package/package.json +13 -2
  106. /package/dist/{attributes-DILeh3-s.d.mts → attributes-3r7Diua4.d.mts} +0 -0
  107. /package/dist/{custom-elements-D5_NMNyD.d.mts → custom-elements-CBuenqVD.d.mts} +0 -0
  108. /package/dist/{lib-D6duEs38.mjs → lib-CVfOddra.mjs} +0 -0
  109. /package/dist/{magic-string.es-cTgJnTCj.mjs → magic-string.es-CXefOmkB.mjs} +0 -0
  110. /package/dist/{polyfill-B1lNNcum.mjs → polyfill-CdZVCxdo.mjs} +0 -0
  111. /package/dist/{slot-D5iBUSAm.d.mts → slot-CfafCBOW.d.mts} +0 -0
@@ -1,2 +1,2 @@
1
- import { n as defineElement, t as CustomElementRegistry } from "./custom-elements-D5_NMNyD.mjs";
1
+ import { n as defineElement, t as CustomElementRegistry } from "./custom-elements-CBuenqVD.mjs";
2
2
  export { CustomElementRegistry, defineElement };
@@ -1,38 +1,20 @@
1
- import { c as effectScope, g as untracked, p as onCleanup, s as effect } from "./lib-D6duEs38.mjs";
2
- import "./polyfill-B1lNNcum.mjs";
1
+ import { c as effectScope, g as untracked, p as onCleanup, s as effect } from "./lib-CVfOddra.mjs";
2
+ import "./polyfill-CdZVCxdo.mjs";
3
3
  import { isReactive, resolveProps } from "./signals/index.mjs";
4
4
  import { on } from "./utilities/event-listener.mjs";
5
- import { i as resolveNode$1, n as Slot, r as Slots, t as SLOTS } from "./slot-CKtUoy2X.mjs";
6
- //#region \0rolldown/runtime.js
7
- var __defProp = Object.defineProperty;
8
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
9
- var __getOwnPropNames = Object.getOwnPropertyNames;
10
- var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __exportAll = (all, no_symbols) => {
12
- let target = {};
13
- for (var name in all) __defProp(target, name, {
14
- get: all[name],
15
- enumerable: true
16
- });
17
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
18
- return target;
19
- };
20
- var __copyProps = (to, from, except, desc) => {
21
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
22
- key = keys[i];
23
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
24
- get: ((k) => from[k]).bind(null, key),
25
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
26
- });
27
- }
28
- return to;
29
- };
30
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
31
- //#endregion
5
+ import { i as resolveNode$1, n as Slot, r as Slots, t as SLOTS } from "./slot-BnzxFBfO.mjs";
6
+ import { ChildProperties, Properties, SVGNamespace } from "dom-expressions/src/constants.js";
32
7
  //#region src/jsx-runtime/constants.ts
33
- var constants_exports = /* @__PURE__ */ __exportAll({ ReservedNameSpaces: () => ReservedNameSpaces });
34
- import * as import_dom_expressions_src_constants_js from "dom-expressions/src/constants.js";
35
- __reExport(constants_exports, import_dom_expressions_src_constants_js);
8
+ /**
9
+ * IDL properties that take precedence over the default `setAttribute` path.
10
+ *
11
+ * Extends dom-expressions' base set with `defaultValue` — without it, JSX
12
+ * `<input defaultValue="x" />` falls through to `setAttribute("defaultValue",
13
+ * "x")` and creates a useless `defaultvalue` HTML attribute (native
14
+ * `HTMLInputElement` has no such content attribute; its `defaultValue` IDL
15
+ * property reflects the `value` content attribute instead).
16
+ */
17
+ const Properties$1 = new Set([...Properties, "defaultValue"]);
36
18
  const ReservedNameSpaces = new Set([
37
19
  "class",
38
20
  "on",
@@ -174,7 +156,7 @@ function setProp(node, key, value) {
174
156
  }
175
157
  return;
176
158
  }
177
- const svgNs = constants_exports.SVGNamespace[ns];
159
+ const svgNs = SVGNamespace[ns];
178
160
  if (svgNs) {
179
161
  node.setAttributeNS(svgNs, key, String(value ?? ""));
180
162
  return;
@@ -188,11 +170,11 @@ function setProp(node, key, value) {
188
170
  applyStyle(node, value);
189
171
  return;
190
172
  }
191
- if (constants_exports.ChildProperties.has(key)) {
173
+ if (ChildProperties.has(key)) {
192
174
  node[key] = value ?? "";
193
175
  return;
194
176
  }
195
- if (!(node instanceof SVGElement) && constants_exports.Properties.has(key)) {
177
+ if (!(node instanceof SVGElement) && Properties$1.has(key)) {
196
178
  node[key] = value;
197
179
  return;
198
180
  }
package/dist/for.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as Props, s as Require } from "./infer-DuFY-y2b.mjs";
1
+ import { i as Props, s as Require } from "./infer-BUUWMoG9.mjs";
2
2
 
3
3
  //#region src/for.d.ts
4
4
  type KeyFn<T> = (item: T, index: number) => string | number;
package/dist/for.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { n as disposeElement } from "./element-w1GCIMVp.mjs";
2
- import { c as effectScope, g as untracked, h as trigger, m as signal, p as onCleanup, s as effect } from "./lib-D6duEs38.mjs";
1
+ import { c as effectScope, g as untracked, h as trigger, m as signal, p as onCleanup, s as effect } from "./lib-CVfOddra.mjs";
3
2
  import "./signals/index.mjs";
3
+ import { n as disposeElement } from "./element-BjpyY6qv.mjs";
4
4
  //#region src/for.ts
5
5
  /**
6
6
  * Keyed list renderer. See {@link ForProps} for prop details.
@@ -1,6 +1,6 @@
1
- import { n as AttrChangeHandler, t as ATTRIBUTES } from "./attributes-DILeh3-s.mjs";
2
- import { t as CustomElementRegistry } from "./custom-elements-D5_NMNyD.mjs";
3
- import { a as PrimitiveNodeType, i as Slots, n as Slot, t as SLOTS } from "./slot-D5iBUSAm.mjs";
1
+ import { n as AttrChangeHandler, t as ATTRIBUTES } from "./attributes-3r7Diua4.mjs";
2
+ import { t as CustomElementRegistry } from "./custom-elements-CBuenqVD.mjs";
3
+ import { a as PrimitiveNodeType, i as Slots, n as Slot, t as SLOTS } from "./slot-CfafCBOW.mjs";
4
4
  import { JSX } from "dom-expressions/src/jsx-h";
5
5
 
6
6
  //#region src/jsx-runtime/element.d.ts
@@ -1,4 +1,4 @@
1
- import { y as Computed } from "../infer-DuFY-y2b.mjs";
1
+ import { y as Computed } from "../infer-BUUWMoG9.mjs";
2
2
 
3
3
  //#region src/integrations/react.d.ts
4
4
  /**
@@ -1,6 +1,6 @@
1
- import { m as signal, s as effect } from "../lib-D6duEs38.mjs";
1
+ import { m as signal, s as effect } from "../lib-CVfOddra.mjs";
2
2
  import "../signals/index.mjs";
3
- import { t as scope } from "../scope-DM2gzOkb.mjs";
3
+ import { t as scope } from "../scope-CwVlgN8b.mjs";
4
4
  import { useEffect, useMemo, useRef, useSyncExternalStore } from "react";
5
5
  //#region src/integrations/react.ts
6
6
  /**
@@ -1,2 +1,2 @@
1
- import { U as createElement, _ as SlotProps, a as RawProps, b as MaybeReactive, c as ResolveProps, d as ComponentClass, f as ComponentFn, g as JSX, h as Attrs, i as Props, l as Child, m as PropsTarget, n as ElementProps, o as ReactiveProps, p as ComponentInstance, r as MaybeReactiveProps, s as Require, t as ComponentProps, u as Component, v as Fragment } from "../infer-DuFY-y2b.mjs";
1
+ import { U as createElement, _ as SlotProps, a as RawProps, b as MaybeReactive, c as ResolveProps, d as ComponentClass, f as ComponentFn, g as JSX, h as Attrs, i as Props, l as Child, m as PropsTarget, n as ElementProps, o as ReactiveProps, p as ComponentInstance, r as MaybeReactiveProps, s as Require, t as ComponentProps, u as Component, v as Fragment } from "../infer-BUUWMoG9.mjs";
2
2
  export { Attrs, Child, Component, ComponentClass, ComponentFn, ComponentInstance, ComponentProps, ElementProps, Fragment, JSX, MaybeReactive, MaybeReactiveProps, Props, PropsTarget, RawProps, ReactiveProps, Require, ResolveProps, SlotProps, createElement as h, createElement as jsx, createElement as jsxDEV, createElement as jsxs };
@@ -1,4 +1,4 @@
1
- import { r as mountChild, t as createElement } from "../element-w1GCIMVp.mjs";
1
+ import { r as mountChild, t as createElement } from "../element-BjpyY6qv.mjs";
2
2
  //#region src/jsx-runtime/fragment.ts
3
3
  /**
4
4
  * Used by the JSX transform for `<>...</>` fragments.
package/dist/render.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as scope } from "./scope-DM2gzOkb.mjs";
1
+ import { t as scope } from "./scope-CwVlgN8b.mjs";
2
2
  //#region src/render.ts
3
3
  /**
4
4
  * Mount a node into `target` with a scoped lifetime.
@@ -1,4 +1,4 @@
1
- import { c as effectScope, g as untracked } from "./lib-D6duEs38.mjs";
1
+ import { c as effectScope, g as untracked } from "./lib-CVfOddra.mjs";
2
2
  //#region src/signals/scope.ts
3
3
  /**
4
4
  * Run `setup` inside a fresh `effectScope`. Returns `[result, stop]`.
@@ -1,2 +1,2 @@
1
- import { A as SIGNAL, B as signal, C as isReactive, D as COMPUTED, E as resolveProps, F as isComputed, H as untracked, I as isEffect, L as isEffectScope, M as computed, N as effect, O as EFFECT, P as effectScope, R as isSignal, S as Updater, T as resolve, V as trigger, b as MaybeReactive, j as batch, k as EFFECT_SCOPE, w as reactive, x as Signal, y as Computed, z as onCleanup } from "../infer-DuFY-y2b.mjs";
1
+ import { A as SIGNAL, B as signal, C as isReactive, D as COMPUTED, E as resolveProps, F as isComputed, H as untracked, I as isEffect, L as isEffectScope, M as computed, N as effect, O as EFFECT, P as effectScope, R as isSignal, S as Updater, T as resolve, V as trigger, b as MaybeReactive, j as batch, k as EFFECT_SCOPE, w as reactive, x as Signal, y as Computed, z as onCleanup } from "../infer-BUUWMoG9.mjs";
2
2
  export { COMPUTED, Computed, EFFECT, EFFECT_SCOPE, MaybeReactive, SIGNAL, Signal, Updater, batch, computed, effect, effectScope, isComputed, isEffect, isEffectScope, isReactive, isSignal, onCleanup, reactive, resolve, resolveProps, signal, trigger, untracked };
@@ -1,5 +1,5 @@
1
- import { a as batch, c as effectScope, d as isEffectScope, f as isSignal, g as untracked, h as trigger, i as SIGNAL, l as isComputed, m as signal, n as EFFECT, o as computed, p as onCleanup, r as EFFECT_SCOPE, s as effect, t as COMPUTED, u as isEffect } from "../lib-D6duEs38.mjs";
2
- import "../polyfill-B1lNNcum.mjs";
1
+ import { a as batch, c as effectScope, d as isEffectScope, f as isSignal, g as untracked, h as trigger, i as SIGNAL, l as isComputed, m as signal, n as EFFECT, o as computed, p as onCleanup, r as EFFECT_SCOPE, s as effect, t as COMPUTED, u as isEffect } from "../lib-CVfOddra.mjs";
2
+ import "../polyfill-CdZVCxdo.mjs";
3
3
  //#region src/signals/index.ts
4
4
  /**
5
5
  * Type-guard: `true` when `value` is a reactive source (`signal` or `computed`),
@@ -1,4 +1,4 @@
1
- import "./polyfill-B1lNNcum.mjs";
1
+ import "./polyfill-CdZVCxdo.mjs";
2
2
  //#region src/lib.ts
3
3
  var UnsupportedChildError = class extends Error {
4
4
  constructor(value) {
package/dist/slot.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { i as Slots, n as Slot, r as SlotInstance, t as SLOTS } from "./slot-D5iBUSAm.mjs";
1
+ import { i as Slots, n as Slot, r as SlotInstance, t as SLOTS } from "./slot-CfafCBOW.mjs";
2
2
  export { SLOTS, Slot, SlotInstance, Slots };
package/dist/slot.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { n as Slot, r as Slots, t as SLOTS } from "./slot-CKtUoy2X.mjs";
1
+ import { n as Slot, r as Slots, t as SLOTS } from "./slot-BnzxFBfO.mjs";
2
2
  export { SLOTS, Slot, Slots };