@stonecrop/utilities 0.4.36 → 0.5.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.
package/dist/index.js CHANGED
@@ -4,6 +4,5 @@ import { defaultKeypressHandlers, useKeyboardNav } from './composables/keyboard'
4
4
  * @param app - Vue app instance
5
5
  * @public
6
6
  */
7
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
8
- function install(app /* options */) { }
7
+ function install(_app /* options */) { }
9
8
  export { defaultKeypressHandlers, install, useKeyboardNav };
@@ -1,4 +1,5 @@
1
- import { type ConfigurableWindow, type MaybeComputedElementRef, type MaybeRefOrGetter } from '@vueuse/core';
1
+ import { type ConfigurableWindow, type MaybeComputedElementRef } from '@vueuse/core';
2
+ import { type MaybeRefOrGetter } from 'vue';
2
3
  export interface UseElementVisibilityOptions extends ConfigurableWindow {
3
4
  scrollTarget?: MaybeRefOrGetter<HTMLElement | undefined | null>;
4
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/composables/visibility/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EAIrB,MAAM,cAAc,CAAA;AAGrB,MAAM,WAAW,2BAA4B,SAAQ,kBAAkB;IACtE,YAAY,CAAC,EAAE,gBAAgB,CAAC,WAAW,GAAG,SAAS,GAAG,IAAI,CAAC,CAAA;CAC/D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,oBAAoB,CACnC,OAAO,EAAE,uBAAuB,EAChC,EAAE,MAAsB,EAAE,YAAY,EAAE,GAAE,2BAAgC,uCAmC1E"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/composables/visibility/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAI5B,MAAM,cAAc,CAAA;AACrB,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,KAAK,CAAA;AAEvD,MAAM,WAAW,2BAA4B,SAAQ,kBAAkB;IACtE,YAAY,CAAC,EAAE,gBAAgB,CAAC,WAAW,GAAG,SAAS,GAAG,IAAI,CAAC,CAAA;CAC/D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,oBAAoB,CACnC,OAAO,EAAE,uBAAuB,EAChC,EAAE,MAAsB,EAAE,YAAY,EAAE,GAAE,2BAAgC,uCAmC1E"}
@@ -6,6 +6,6 @@ export type * from './types';
6
6
  * @param app - Vue app instance
7
7
  * @public
8
8
  */
9
- declare function install(app: App): void;
9
+ declare function install(_app: App): void;
10
10
  export { defaultKeypressHandlers, install, useKeyboardNav };
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzB,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAChF,mBAAmB,SAAS,CAAA;AAE5B;;;;GAIG;AAEH,iBAAS,OAAO,CAAC,GAAG,EAAE,GAAG,QAAkB;AAE3C,OAAO,EAAE,uBAAuB,EAAE,OAAO,EAAE,cAAc,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzB,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAChF,mBAAmB,SAAS,CAAA;AAE5B;;;;GAIG;AACH,iBAAS,OAAO,CAAC,IAAI,EAAE,GAAG,QAAkB;AAE5C,OAAO,EAAE,uBAAuB,EAAE,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -13,7 +13,7 @@ export declare const defaultKeypressHandlers: KeypressHandlers;
13
13
  * @param app - Vue app instance
14
14
  * @public
15
15
  */
16
- export declare function install(app: App): void;
16
+ export declare function install(_app: App): void;
17
17
 
18
18
  /**
19
19
  * Keyboard navigation options
package/dist/utilities.js CHANGED
@@ -1,6 +1,6 @@
1
- import { watch as R, getCurrentScope as K, onScopeDispose as V, computed as w, shallowRef as M, toValue as C, watchEffect as j, unref as B, getCurrentInstance as q, onMounted as N, ref as F, onBeforeUnmount as G } from "vue";
2
- function k(e) {
3
- return K() ? (V(e), !0) : !1;
1
+ import { watch as T, getCurrentScope as V, onScopeDispose as _, computed as w, shallowRef as M, toValue as C, watchEffect as j, unref as B, getCurrentInstance as q, onMounted as F, ref as K, onBeforeUnmount as G } from "vue";
2
+ function k(e, t) {
3
+ return V() ? (_(e, t), !0) : !1;
4
4
  }
5
5
  const z = typeof window < "u" && typeof document < "u";
6
6
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
@@ -10,52 +10,36 @@ function S(e) {
10
10
  return Array.isArray(e) ? e : [e];
11
11
  }
12
12
  function Z(e, t, n) {
13
- return R(
14
- e,
15
- t,
16
- {
17
- ...n,
18
- immediate: !0
19
- }
20
- );
13
+ return T(e, t, {
14
+ ...n,
15
+ immediate: !0
16
+ });
21
17
  }
22
- const h = z ? window : void 0;
23
- function E(e) {
18
+ const E = z ? window : void 0;
19
+ function $(e) {
24
20
  var t;
25
21
  const n = C(e);
26
- return (t = n?.$el) != null ? t : n;
22
+ return (t = n?.$el) !== null && t !== void 0 ? t : n;
27
23
  }
28
24
  function y(...e) {
29
25
  const t = [], n = () => {
30
26
  t.forEach((o) => o()), t.length = 0;
31
- }, l = (o, r, i, a) => (o.addEventListener(r, i, a), () => o.removeEventListener(r, i, a)), c = w(() => {
32
- const o = S(C(e[0])).filter((r) => r != null);
33
- return o.every((r) => typeof r != "string") ? o : void 0;
34
- }), u = Z(
35
- () => {
36
- var o, r;
37
- return [
38
- (r = (o = c.value) == null ? void 0 : o.map((i) => E(i))) != null ? r : [h].filter((i) => i != null),
39
- S(C(c.value ? e[1] : e[0])),
40
- S(B(c.value ? e[2] : e[1])),
41
- // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
42
- C(c.value ? e[3] : e[2])
43
- ];
44
- },
45
- ([o, r, i, a]) => {
46
- if (n(), !o?.length || !r?.length || !i?.length)
47
- return;
48
- const p = X(a) ? { ...a } : a;
49
- t.push(
50
- ...o.flatMap(
51
- (f) => r.flatMap(
52
- (d) => i.map((m) => l(f, d, m, p))
53
- )
54
- )
55
- );
56
- },
57
- { flush: "post" }
58
- ), s = () => {
27
+ }, l = (o, i, r, a) => (o.addEventListener(i, r, a), () => o.removeEventListener(i, r, a)), c = w(() => {
28
+ const o = S(C(e[0])).filter((i) => i != null);
29
+ return o.every((i) => typeof i != "string") ? o : void 0;
30
+ }), u = Z(() => {
31
+ var o, i;
32
+ return [
33
+ (o = (i = c.value) === null || i === void 0 ? void 0 : i.map((r) => $(r))) !== null && o !== void 0 ? o : [E].filter((r) => r != null),
34
+ S(C(c.value ? e[1] : e[0])),
35
+ S(B(c.value ? e[2] : e[1])),
36
+ C(c.value ? e[3] : e[2])
37
+ ];
38
+ }, ([o, i, r, a]) => {
39
+ if (n(), !o?.length || !i?.length || !r?.length) return;
40
+ const f = X(a) ? { ...a } : a;
41
+ t.push(...o.flatMap((d) => i.flatMap((p) => r.map((h) => l(d, p, h, f)))));
42
+ }, { flush: "post" }), s = () => {
59
43
  u(), n();
60
44
  };
61
45
  return k(n), s;
@@ -63,7 +47,7 @@ function y(...e) {
63
47
  // @__NO_SIDE_EFFECTS__
64
48
  function ee() {
65
49
  const e = M(!1), t = q();
66
- return t && N(() => {
50
+ return t && F(() => {
67
51
  e.value = !0;
68
52
  }, t), e;
69
53
  }
@@ -73,113 +57,86 @@ function te(e) {
73
57
  return w(() => (t.value, !!e()));
74
58
  }
75
59
  function ne(e, t, n = {}) {
76
- const { window: l = h, ...c } = n;
60
+ const { window: l = E, ...c } = n;
77
61
  let u;
78
62
  const s = /* @__PURE__ */ te(() => l && "MutationObserver" in l), o = () => {
79
63
  u && (u.disconnect(), u = void 0);
80
- }, r = w(() => {
81
- const f = C(e), d = S(f).map(E).filter(J);
82
- return new Set(d);
83
- }), i = R(
84
- () => r.value,
85
- (f) => {
86
- o(), s.value && f.size && (u = new MutationObserver(t), f.forEach((d) => u.observe(d, c)));
87
- },
88
- { immediate: !0, flush: "post" }
89
- ), a = () => u?.takeRecords(), p = () => {
64
+ }, i = T(w(() => {
65
+ const f = S(C(e)).map($).filter(J);
66
+ return new Set(f);
67
+ }), (f) => {
68
+ o(), s.value && f.size && (u = new MutationObserver(t), f.forEach((d) => u.observe(d, c)));
69
+ }, {
70
+ immediate: !0,
71
+ flush: "post"
72
+ }), r = () => u?.takeRecords(), a = () => {
90
73
  i(), o();
91
74
  };
92
- return k(p), {
75
+ return k(a), {
93
76
  isSupported: s,
94
- stop: p,
95
- takeRecords: a
77
+ stop: a,
78
+ takeRecords: r
96
79
  };
97
80
  }
98
81
  function oe(e, t, n = {}) {
99
- const {
100
- window: l = h,
101
- document: c = l?.document,
102
- flush: u = "sync"
103
- } = n;
104
- if (!l || !c)
105
- return Y;
82
+ const { window: l = E, document: c = l?.document, flush: u = "sync" } = n;
83
+ if (!l || !c) return Y;
106
84
  let s;
107
85
  const o = (a) => {
108
86
  s?.(), s = a;
109
- }, r = j(() => {
110
- const a = E(e);
87
+ }, i = j(() => {
88
+ const a = $(e);
111
89
  if (a) {
112
- const { stop: p } = ne(
113
- c,
114
- (f) => {
115
- f.map((m) => [...m.removedNodes]).flat().some((m) => m === a || m.contains(a)) && t(f);
116
- },
117
- {
118
- window: l,
119
- childList: !0,
120
- subtree: !0
121
- }
122
- );
123
- o(p);
90
+ const { stop: f } = ne(c, (d) => {
91
+ d.map((p) => [...p.removedNodes]).flat().some((p) => p === a || p.contains(a)) && t(d);
92
+ }, {
93
+ window: l,
94
+ childList: !0,
95
+ subtree: !0
96
+ });
97
+ o(f);
124
98
  }
125
- }, { flush: u }), i = () => {
126
- r(), o();
99
+ }, { flush: u }), r = () => {
100
+ i(), o();
127
101
  };
128
- return k(i), i;
102
+ return k(r), r;
129
103
  }
130
104
  // @__NO_SIDE_EFFECTS__
131
105
  function le(e = {}) {
132
106
  var t;
133
- const {
134
- window: n = h,
135
- deep: l = !0,
136
- triggerOnRemoval: c = !1
137
- } = e, u = (t = e.document) != null ? t : n?.document, s = () => {
138
- var i;
139
- let a = u?.activeElement;
107
+ const { window: n = E, deep: l = !0, triggerOnRemoval: c = !1 } = e, u = (t = e.document) !== null && t !== void 0 ? t : n?.document, s = () => {
108
+ let r = u?.activeElement;
140
109
  if (l)
141
- for (; a?.shadowRoot; )
142
- a = (i = a?.shadowRoot) == null ? void 0 : i.activeElement;
143
- return a;
144
- }, o = M(), r = () => {
110
+ for (var a; r?.shadowRoot; ) r = r == null || (a = r.shadowRoot) === null || a === void 0 ? void 0 : a.activeElement;
111
+ return r;
112
+ }, o = M(), i = () => {
145
113
  o.value = s();
146
114
  };
147
115
  if (n) {
148
- const i = {
116
+ const r = {
149
117
  capture: !0,
150
118
  passive: !0
151
119
  };
152
- y(
153
- n,
154
- "blur",
155
- (a) => {
156
- a.relatedTarget === null && r();
157
- },
158
- i
159
- ), y(
160
- n,
161
- "focus",
162
- r,
163
- i
164
- );
120
+ y(n, "blur", (a) => {
121
+ a.relatedTarget === null && i();
122
+ }, r), y(n, "focus", i, r);
165
123
  }
166
- return c && oe(o, r, { document: u }), r(), o;
124
+ return c && oe(o, i, { document: u }), i(), o;
167
125
  }
168
- const se = "focusin", re = "focusout", ie = ":focus-within";
126
+ const re = "focusin", se = "focusout", ie = ":focus-within";
169
127
  function ce(e, t = {}) {
170
- const { window: n = h } = t, l = w(() => E(e)), c = M(!1), u = w(() => c.value);
171
- if (!n || !(/* @__PURE__ */ le(t)).value)
172
- return { focused: u };
128
+ const { window: n = E } = t, l = w(() => $(e)), c = M(!1), u = w(() => c.value);
129
+ if (!n || !(/* @__PURE__ */ le(t)).value) return { focused: u };
173
130
  const o = { passive: !0 };
174
- return y(l, se, () => c.value = !0, o), y(l, re, () => {
175
- var r, i, a;
176
- return c.value = (a = (i = (r = l.value) == null ? void 0 : r.matches) == null ? void 0 : i.call(r, ie)) != null ? a : !1;
131
+ return y(l, re, () => c.value = !0, o), y(l, se, () => {
132
+ var i, r, a;
133
+ return c.value = (i = (r = l.value) === null || r === void 0 || (a = r.matches) === null || a === void 0 ? void 0 : a.call(r, ie)) !== null && i !== void 0 ? i : !1;
177
134
  }, o), { focused: u };
178
135
  }
179
- function ae(e, { window: t = h, scrollTarget: n } = {}) {
180
- const l = F(!1), c = () => {
136
+ function ae(e, { window: t = E, scrollTarget: n } = {}) {
137
+ const l = K(!1), c = () => {
181
138
  if (!t) return;
182
- const u = t.document, s = E(e);
139
+ const u = t.document, s = $(e);
183
140
  if (!s)
184
141
  l.value = !1;
185
142
  else {
@@ -187,8 +144,8 @@ function ae(e, { window: t = h, scrollTarget: n } = {}) {
187
144
  l.value = o.top <= (t.innerHeight || u.documentElement.clientHeight) && o.left <= (t.innerWidth || u.documentElement.clientWidth) && o.bottom >= 0 && o.right >= 0;
188
145
  }
189
146
  };
190
- return R(
191
- () => E(e),
147
+ return T(
148
+ () => $(e),
192
149
  () => c(),
193
150
  { immediate: !0, flush: "post" }
194
151
  ), t && y(n || t, "scroll", c, {
@@ -196,10 +153,10 @@ function ae(e, { window: t = h, scrollTarget: n } = {}) {
196
153
  passive: !0
197
154
  }), l;
198
155
  }
199
- const g = (e) => {
156
+ const m = (e) => {
200
157
  let t = ae(e).value;
201
158
  return t = t && e.offsetHeight > 0, t;
202
- }, $ = (e) => e.tabIndex >= 0, P = (e) => {
159
+ }, g = (e) => e.tabIndex >= 0, P = (e) => {
203
160
  const t = e.target;
204
161
  return A(t);
205
162
  }, A = (e) => {
@@ -214,7 +171,7 @@ const g = (e) => {
214
171
  const n = e.previousElementSibling;
215
172
  n && (t = n);
216
173
  }
217
- return t && (!$(t) || !g(t)) ? A(t) : t;
174
+ return t && (!g(t) || !m(t)) ? A(t) : t;
218
175
  }, ue = (e) => {
219
176
  const t = e.target;
220
177
  let n;
@@ -231,7 +188,7 @@ const g = (e) => {
231
188
  c && (n = c);
232
189
  }
233
190
  }
234
- return n && (!$(n) || !g(n)) ? L(n) : n;
191
+ return n && (!g(n) || !m(n)) ? L(n) : n;
235
192
  }, O = (e) => {
236
193
  const t = e.target;
237
194
  return L(t);
@@ -247,7 +204,7 @@ const g = (e) => {
247
204
  const n = e.nextElementSibling;
248
205
  n && (t = n);
249
206
  }
250
- return t && (!$(t) || !g(t)) ? L(t) : t;
207
+ return t && (!g(t) || !m(t)) ? L(t) : t;
251
208
  }, fe = (e) => {
252
209
  const t = e.target;
253
210
  let n;
@@ -264,31 +221,31 @@ const g = (e) => {
264
221
  c && (n = c);
265
222
  }
266
223
  }
267
- return n && (!$(n) || !g(n)) ? A(n) : n;
224
+ return n && (!g(n) || !m(n)) ? A(n) : n;
268
225
  }, U = (e) => {
269
226
  const t = e.target;
270
227
  return x(t);
271
228
  }, x = (e) => {
272
229
  let t;
273
- return e.previousElementSibling ? t = e.previousElementSibling : t = e.parentElement?.previousElementSibling?.lastElementChild, t && (!$(t) || !g(t)) ? x(t) : t;
274
- }, _ = (e) => {
230
+ return e.previousElementSibling ? t = e.previousElementSibling : t = e.parentElement?.previousElementSibling?.lastElementChild, t && (!g(t) || !m(t)) ? x(t) : t;
231
+ }, I = (e) => {
275
232
  const t = e.target;
276
233
  return H(t);
277
234
  }, H = (e) => {
278
235
  let t;
279
- return e.nextElementSibling ? t = e.nextElementSibling : t = e.parentElement?.nextElementSibling?.firstElementChild, t && (!$(t) || !g(t)) ? H(t) : t;
280
- }, I = (e) => {
281
- const l = e.target.parentElement?.firstElementChild;
282
- return l && (!$(l) || !g(l)) ? H(l) : l;
236
+ return e.nextElementSibling ? t = e.nextElementSibling : t = e.parentElement?.nextElementSibling?.firstElementChild, t && (!g(t) || !m(t)) ? H(t) : t;
283
237
  }, W = (e) => {
238
+ const l = e.target.parentElement?.firstElementChild;
239
+ return l && (!g(l) || !m(l)) ? H(l) : l;
240
+ }, N = (e) => {
284
241
  const l = e.target.parentElement?.lastElementChild;
285
- return l && (!$(l) || !g(l)) ? x(l) : l;
286
- }, b = ["alt", "control", "shift", "meta"], pe = {
242
+ return l && (!g(l) || !m(l)) ? x(l) : l;
243
+ }, b = ["alt", "control", "shift", "meta"], de = {
287
244
  ArrowUp: "up",
288
245
  ArrowDown: "down",
289
246
  ArrowLeft: "left",
290
247
  ArrowRight: "right"
291
- }, de = {
248
+ }, pe = {
292
249
  "keydown.up": (e) => {
293
250
  const t = P(e);
294
251
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
@@ -302,7 +259,7 @@ const g = (e) => {
302
259
  e.preventDefault(), e.stopPropagation(), t && t.focus();
303
260
  },
304
261
  "keydown.right": (e) => {
305
- const t = _(e);
262
+ const t = I(e);
306
263
  e.preventDefault(), e.stopPropagation(), t && t.focus();
307
264
  },
308
265
  "keydown.control.up": (e) => {
@@ -314,15 +271,15 @@ const g = (e) => {
314
271
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
315
272
  },
316
273
  "keydown.control.left": (e) => {
317
- const t = I(e);
274
+ const t = W(e);
318
275
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
319
276
  },
320
277
  "keydown.control.right": (e) => {
321
- const t = W(e);
278
+ const t = N(e);
322
279
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
323
280
  },
324
281
  "keydown.end": (e) => {
325
- const t = W(e);
282
+ const t = N(e);
326
283
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
327
284
  },
328
285
  "keydown.enter": (e) => {
@@ -340,11 +297,11 @@ const g = (e) => {
340
297
  }
341
298
  },
342
299
  "keydown.home": (e) => {
343
- const t = I(e);
300
+ const t = W(e);
344
301
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
345
302
  },
346
303
  "keydown.tab": (e) => {
347
- const t = _(e);
304
+ const t = I(e);
348
305
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
349
306
  },
350
307
  "keydown.shift.tab": (e) => {
@@ -358,57 +315,57 @@ function ge(e) {
358
315
  return s.parent && (typeof s.parent == "string" ? o = document.querySelector(s.parent) : s.parent instanceof HTMLElement ? o = s.parent : o = s.parent.value), o;
359
316
  }, n = (s) => {
360
317
  const o = t(s);
361
- let r = [];
318
+ let i = [];
362
319
  if (typeof s.selectors == "string")
363
- r = o ? Array.from(o.querySelectorAll(s.selectors)) : Array.from(document.querySelectorAll(s.selectors));
320
+ i = o ? Array.from(o.querySelectorAll(s.selectors)) : Array.from(document.querySelectorAll(s.selectors));
364
321
  else if (Array.isArray(s.selectors))
365
- for (const i of s.selectors)
366
- i instanceof HTMLElement ? r.push(i) : r.push(i.$el);
322
+ for (const r of s.selectors)
323
+ r instanceof HTMLElement ? i.push(r) : i.push(r.$el);
367
324
  else if (s.selectors instanceof HTMLElement)
368
- r.push(s.selectors);
325
+ i.push(s.selectors);
369
326
  else if (s.selectors?.value)
370
327
  if (Array.isArray(s.selectors.value))
371
- for (const i of s.selectors.value)
372
- i instanceof HTMLElement ? r.push(i) : r.push(i.$el);
328
+ for (const r of s.selectors.value)
329
+ r instanceof HTMLElement ? i.push(r) : i.push(r.$el);
373
330
  else
374
- r.push(s.selectors.value);
375
- return r;
331
+ i.push(s.selectors.value);
332
+ return i;
376
333
  }, l = (s) => {
377
334
  const o = t(s);
378
- let r = [];
379
- return s.selectors ? r = n(s) : o && (r = Array.from(o.children).filter((a) => $(a) && g(a))), r;
335
+ let i = [];
336
+ return s.selectors ? i = n(s) : o && (i = Array.from(o.children).filter((a) => g(a) && m(a))), i;
380
337
  }, c = (s) => (o) => {
381
- const r = pe[o.key] || o.key.toLowerCase();
382
- if (b.includes(r)) return;
383
- const i = s.handlers || de;
384
- for (const a of Object.keys(i)) {
385
- const [p, ...f] = a.split(".");
386
- if (p === "keydown" && f.includes(r)) {
387
- const d = i[a], m = f.filter((v) => b.includes(v)), D = b.some((v) => {
388
- const T = v.charAt(0).toUpperCase() + v.slice(1);
389
- return o.getModifierState(T);
338
+ const i = de[o.key] || o.key.toLowerCase();
339
+ if (b.includes(i)) return;
340
+ const r = s.handlers || pe;
341
+ for (const a of Object.keys(r)) {
342
+ const [f, ...d] = a.split(".");
343
+ if (f === "keydown" && d.includes(i)) {
344
+ const p = r[a], h = d.filter((v) => b.includes(v)), D = b.some((v) => {
345
+ const R = v.charAt(0).toUpperCase() + v.slice(1);
346
+ return o.getModifierState(R);
390
347
  });
391
- if (m.length > 0) {
348
+ if (h.length > 0) {
392
349
  if (D) {
393
350
  for (const v of b)
394
- if (f.includes(v)) {
395
- const T = v.charAt(0).toUpperCase() + v.slice(1);
396
- o.getModifierState(T) && d(o);
351
+ if (d.includes(v)) {
352
+ const R = v.charAt(0).toUpperCase() + v.slice(1);
353
+ o.getModifierState(R) && p(o);
397
354
  }
398
355
  }
399
356
  } else
400
- D || d(o);
357
+ D || p(o);
401
358
  }
402
359
  }
403
360
  }, u = [];
404
- N(() => {
361
+ F(() => {
405
362
  for (const s of e) {
406
- const o = t(s), r = l(s), i = c(s), a = o ? [o] : r;
407
- for (const p of a) {
408
- const { focused: f } = ce(F(p)), d = R(f, (m) => {
409
- m ? p.addEventListener("keydown", i) : p.removeEventListener("keydown", i);
363
+ const o = t(s), i = l(s), r = c(s), a = o ? [o] : i;
364
+ for (const f of a) {
365
+ const { focused: d } = ce(K(f)), p = T(d, (h) => {
366
+ h ? f.addEventListener("keydown", r) : f.removeEventListener("keydown", r);
410
367
  });
411
- u.push(d);
368
+ u.push(p);
412
369
  }
413
370
  }
414
371
  }), G(() => {
@@ -416,11 +373,11 @@ function ge(e) {
416
373
  s();
417
374
  });
418
375
  }
419
- function $e(e) {
376
+ function ve(e) {
420
377
  }
421
378
  export {
422
- de as defaultKeypressHandlers,
423
- $e as install,
379
+ pe as defaultKeypressHandlers,
380
+ ve as install,
424
381
  ge as useKeyboardNav
425
382
  };
426
383
  //# sourceMappingURL=utilities.js.map