@floegence/floe-webapp-core 0.50.2 → 0.50.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,13 @@ export interface DialogProps {
5
5
  /** Dialog title - can be a string or JSX element for custom headers */
6
6
  title?: string | JSX.Element;
7
7
  description?: string;
8
+ /** Localized accessible name for the close button. */
9
+ closeLabel?: string;
10
+ /** Whether clicking the backdrop requests dismissal. Defaults to true. */
11
+ closeOnBackdropClick?: boolean;
12
+ /** Bubble lets nested inputs consume Escape before the dialog handles it. */
13
+ escapeKeyPhase?: 'capture' | 'bubble';
14
+ onKeyDown?: JSX.EventHandler<HTMLDivElement, KeyboardEvent>;
8
15
  children: JSX.Element;
9
16
  footer?: JSX.Element;
10
17
  class?: string;
@@ -1,16 +1,16 @@
1
- import { createComponent as r, use as E, setAttribute as f, style as Y, Portal as X, spread as k, mergeProps as P, memo as S, insert as a, effect as N, template as u } from "solid-js/web";
2
- import { createUniqueId as J, createSignal as I, createMemo as H, createEffect as Q, onCleanup as ee, Show as b, untrack as te } from "solid-js";
3
- import { cn as A } from "../../utils/cn.js";
4
- import { Button as B } from "./Button.js";
1
+ import { createComponent as o, use as E, setAttribute as f, style as Y, Portal as X, spread as P, mergeProps as R, memo as B, insert as a, effect as N, template as s } from "solid-js/web";
2
+ import { createUniqueId as J, createSignal as S, createMemo as H, createEffect as Q, onCleanup as ee, Show as b, untrack as te } from "solid-js";
3
+ import { cn as O } from "../../utils/cn.js";
4
+ import { Button as D } from "./Button.js";
5
5
  import { X as ne } from "../icons/index.js";
6
6
  import { useResolvedFloeConfig as re } from "../../context/FloeConfigContext.js";
7
7
  import { useOverlayMask as oe } from "../../hooks/useOverlayMask.js";
8
- import { resolveSurfacePortalHost as ie, DIALOG_SURFACE_BOUNDARY_ATTR as O, isSurfacePortalMode as j, projectSurfacePortalRect as le, resolveSurfacePortalBoundaryRect as ae, resolveSurfacePortalMount as de } from "./dialogSurfaceScope.js";
9
- import { LOCAL_INTERACTION_SURFACE_ATTR as ce } from "./localInteractionSurface.js";
10
- import { createFloatingPresence as ue } from "./floatingPresence.js";
11
- import { useDialogPlacement as se } from "./DialogPlacementContext.js";
12
- var fe = /* @__PURE__ */ u("<span aria-hidden=true>"), ge = /* @__PURE__ */ u('<h2 class="text-sm font-semibold">'), me = /* @__PURE__ */ u('<p class="mt-0.5 text-xs text-muted-foreground">'), he = /* @__PURE__ */ u('<div class="flex items-start justify-between p-3 border-b border-border"><div>'), be = /* @__PURE__ */ u('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), ve = /* @__PURE__ */ u('<div><div></div><div class="pointer-events-none relative z-[1] flex h-full w-full items-center justify-center"><div><div class="flex-1 overflow-auto overscroll-contain p-3">'), we = /* @__PURE__ */ u("<div>");
13
- const ye = {
8
+ import { resolveSurfacePortalHost as ie, DIALOG_SURFACE_BOUNDARY_ATTR as k, isSurfacePortalMode as j, projectSurfacePortalRect as le, resolveSurfacePortalBoundaryRect as ae, resolveSurfacePortalMount as ce } from "./dialogSurfaceScope.js";
9
+ import { LOCAL_INTERACTION_SURFACE_ATTR as de } from "./localInteractionSurface.js";
10
+ import { createFloatingPresence as se } from "./floatingPresence.js";
11
+ import { useDialogPlacement as ue } from "./DialogPlacementContext.js";
12
+ var fe = /* @__PURE__ */ s("<span aria-hidden=true>"), ge = /* @__PURE__ */ s('<h2 class="text-sm font-semibold">'), me = /* @__PURE__ */ s('<p class="mt-0.5 text-xs text-muted-foreground">'), he = /* @__PURE__ */ s('<div class="flex items-start justify-between p-3 border-b border-border"><div>'), be = /* @__PURE__ */ s('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), we = /* @__PURE__ */ s('<div><div></div><div class="pointer-events-none relative z-[1] flex h-full w-full items-center justify-center"><div><div class="flex-1 overflow-auto overscroll-contain p-3">'), ye = /* @__PURE__ */ s("<div>");
13
+ const ve = {
14
14
  display: "none"
15
15
  };
16
16
  function xe(e) {
@@ -33,50 +33,51 @@ function $e(e) {
33
33
  }
34
34
  window.clearTimeout(e);
35
35
  }
36
- function _e(e) {
37
- const g = se(), d = J(), F = () => `dialog-${d}-title`, D = () => `dialog-${d}-description`;
38
- let v;
39
- const [w, G] = I(null), [M, z] = I(0), [L, Z] = I(0), s = ue({
40
- open: () => e.open && !!w() && M() > 0,
36
+ function Ce(e) {
37
+ const g = ue(), c = J(), I = () => `dialog-${c}-title`, F = () => `dialog-${c}-description`;
38
+ let w;
39
+ const [y, G] = S(null), [M, K] = S(0), [L, z] = S(0), u = se({
40
+ open: () => e.open && !!y() && M() > 0,
41
41
  exitDurationMs: 120
42
- }), y = () => s.mounted() && !!w() && M() > 0, U = (t) => {
42
+ }), v = () => u.mounted() && !!y() && M() > 0, Z = (t) => {
43
43
  G(t), xe(() => {
44
- te(w) === t && z((i) => i + 1);
44
+ te(y) === t && K((l) => l + 1);
45
45
  });
46
- }, x = H(() => y() ? ie({
47
- owner: w()
46
+ }, x = H(() => v() ? ie({
47
+ owner: y()
48
48
  }) : {
49
49
  host: null,
50
50
  boundaryHost: null,
51
51
  mountHost: null,
52
52
  mode: "global"
53
- }), p = () => `dialog-boundary-${d}`, n = () => g.mode() === "auto" && j(x()), V = () => n() ? de(x()) : void 0, T = () => e.globalZIndex ?? g.globalZIndex(), R = (t) => le(ae(t), t), K = () => R(x()), $ = H(() => (L(), K())), W = (t) => typeof Element < "u" && t instanceof Element ? !!t.closest(`[${O}="${p()}"]`) : typeof Node < "u" && t instanceof Node ? !!t.parentElement?.closest(`[${O}="${p()}"]`) : !1;
53
+ }), p = () => `dialog-boundary-${c}`, n = () => g.mode() === "auto" && j(x()), U = () => n() ? ce(x()) : void 0, T = () => e.globalZIndex ?? g.globalZIndex(), A = (t) => le(ae(t), t), V = () => A(x()), $ = H(() => (L(), V())), W = (t) => typeof Element < "u" && t instanceof Element ? !!t.closest(`[${k}="${p()}"]`) : typeof Node < "u" && t instanceof Node ? !!t.parentElement?.closest(`[${k}="${p()}"]`) : !1;
54
54
  return Q(() => {
55
55
  const t = x();
56
- if (!y() || !n() || typeof window > "u")
56
+ if (!v() || !n() || typeof window > "u")
57
57
  return;
58
- let i = !1, m = null, o = q(R(t));
59
- const _ = () => {
60
- if (i || !j(t))
58
+ let l = !1, m = null, i = q(A(t));
59
+ const C = () => {
60
+ if (l || !j(t))
61
61
  return;
62
- const l = q(R(t));
63
- l !== o && (o = l, Z((C) => C + 1));
62
+ const r = q(A(t));
63
+ r !== i && (i = r, z((_) => _ + 1));
64
64
  }, h = () => {
65
- i || (m = pe(() => {
66
- _(), h();
65
+ l || (m = pe(() => {
66
+ C(), h();
67
67
  }));
68
68
  };
69
69
  h(), ee(() => {
70
- i = !0, m !== null && $e(m);
70
+ l = !0, m !== null && $e(m);
71
71
  });
72
72
  }), oe({
73
- open: y,
74
- root: () => v,
75
- containsTarget: (t) => n() ? W(t) : typeof Node < "u" && t instanceof Node ? !!v?.contains(t) : !1,
73
+ open: v,
74
+ root: () => w,
75
+ containsTarget: (t) => n() ? W(t) : typeof Node < "u" && t instanceof Node ? !!w?.contains(t) : !1,
76
76
  onClose: () => e.onOpenChange(!1),
77
77
  lockBodyScroll: () => !n(),
78
78
  trapFocus: !0,
79
79
  closeOnEscape: () => n() ? "inside" : !0,
80
+ escapeKeyPhase: () => e.escapeKeyPhase ?? "capture",
80
81
  blockHotkeys: !0,
81
82
  // Block scroll bleed outside the dialog while keeping the dialog content scrollable.
82
83
  blockWheel: () => n() ? "none" : "outside",
@@ -84,36 +85,36 @@ function _e(e) {
84
85
  restoreFocus: !0
85
86
  }), [(() => {
86
87
  var t = fe();
87
- return E(U, t), f(t, "data-floe-dialog-owner-anchor", d), Y(t, ye), t;
88
- })(), r(b, {
88
+ return E(Z, t), f(t, "data-floe-dialog-owner-anchor", c), Y(t, ve), t;
89
+ })(), o(b, {
89
90
  get when() {
90
- return y();
91
+ return v();
91
92
  },
92
93
  get children() {
93
- return r(X, {
94
+ return o(X, {
94
95
  get mount() {
95
- return V();
96
+ return U();
96
97
  },
97
98
  get children() {
98
- var t = ve(), i = t.firstChild, m = i.nextSibling, o = m.firstChild, _ = o.firstChild;
99
- f(t, "data-floe-dialog-overlay-root", d), k(t, P({
99
+ var t = we(), l = t.firstChild, m = l.nextSibling, i = m.firstChild, C = i.firstChild;
100
+ f(t, "data-floe-dialog-overlay-root", c), P(t, R({
100
101
  get "data-floe-dialog-mode"() {
101
102
  return n() ? "surface" : "global";
102
103
  },
103
104
  get "data-floating-presence"() {
104
- return s.state();
105
+ return u.state();
105
106
  },
106
107
  get "aria-hidden"() {
107
- return s.exiting() ? "true" : void 0;
108
+ return u.exiting() ? "true" : void 0;
108
109
  }
109
110
  }, () => ({
110
- [ce]: n() ? "true" : void 0
111
+ [de]: n() ? "true" : void 0
111
112
  }), {
112
113
  get class() {
113
- return A(n() ? "absolute z-20 box-border p-3" : A("fixed inset-0 box-border p-4", T() === void 0 && "z-50"), s.exiting() && "pointer-events-none");
114
+ return O(n() ? "absolute z-20 box-border p-3" : O("fixed inset-0 box-border p-4", T() === void 0 && "z-50"), u.exiting() && "pointer-events-none");
114
115
  },
115
116
  get style() {
116
- return S(() => !!n())() ? {
117
+ return B(() => !!n())() ? {
117
118
  left: `${$().left}px`,
118
119
  top: `${$().top}px`,
119
120
  width: `${$().width}px`,
@@ -122,80 +123,85 @@ function _e(e) {
122
123
  "z-index": T()
123
124
  };
124
125
  }
125
- }), !1, !0), f(i, "data-floe-dialog-backdrop", d), k(i, P(() => ({
126
- [O]: p()
126
+ }), !1, !0), f(l, "data-floe-dialog-backdrop", c), P(l, R(() => ({
127
+ [k]: p()
127
128
  }), {
128
129
  get "data-floating-presence"() {
129
- return s.state();
130
+ return u.state();
130
131
  },
131
132
  get class() {
132
- return A("absolute inset-0 cursor-pointer floe-floating-presence floe-floating-backdrop", n() ? "bg-background/72 backdrop-blur-[2px]" : "bg-background/80 backdrop-blur-sm");
133
+ return O("absolute inset-0 floe-floating-presence floe-floating-backdrop", e.closeOnBackdropClick === !1 ? "cursor-default" : "cursor-pointer", n() ? "bg-background/72 backdrop-blur-[2px]" : "bg-background/80 backdrop-blur-sm");
133
134
  },
134
- onClick: () => e.onOpenChange(!1)
135
+ onClick: () => {
136
+ e.closeOnBackdropClick !== !1 && e.onOpenChange(!1);
137
+ }
135
138
  }), !1, !1);
136
- var h = v;
137
- return typeof h == "function" ? E(h, o) : v = o, f(o, "data-floe-dialog-panel", d), k(o, P(() => ({
138
- [O]: p()
139
+ var h = w;
140
+ return typeof h == "function" ? E(h, i) : w = i, f(i, "data-floe-dialog-panel", c), P(i, R(() => ({
141
+ [k]: p()
139
142
  }), {
140
143
  get class() {
141
- return A(n() ? "flex max-h-[calc(100%-1rem)] w-[min(32rem,calc(100%-1rem))] max-w-[calc(100%-1rem)] flex-col" : "w-full max-w-md max-h-[85vh]", "bg-card text-card-foreground rounded-md shadow-lg", "border border-border", "floe-floating-presence floe-floating-dialog-panel", "pointer-events-auto flex flex-col", e.class);
144
+ return O(n() ? "flex max-h-[calc(100%-1rem)] w-[min(32rem,calc(100%-1rem))] max-w-[calc(100%-1rem)] flex-col" : "w-full max-w-md max-h-[85vh]", "bg-card text-card-foreground rounded-md shadow-lg", "border border-border", "floe-floating-presence floe-floating-dialog-panel", "pointer-events-auto flex flex-col", e.class);
142
145
  },
143
146
  get "data-floating-presence"() {
144
- return s.state();
147
+ return u.state();
145
148
  },
146
149
  role: "dialog",
147
150
  get "aria-modal"() {
148
151
  return n() ? void 0 : "true";
149
152
  },
150
153
  get "aria-labelledby"() {
151
- return S(() => !!e.title)() ? F() : void 0;
154
+ return B(() => !!e.title)() ? I() : void 0;
152
155
  },
153
156
  get "aria-describedby"() {
154
- return S(() => !!e.description)() ? D() : void 0;
157
+ return B(() => !!e.description)() ? F() : void 0;
155
158
  },
159
+ onKeyDown: (r) => e.onKeyDown?.(r),
156
160
  tabIndex: -1
157
- }), !1, !0), a(o, r(b, {
161
+ }), !1, !0), a(i, o(b, {
158
162
  get when() {
159
163
  return e.title || e.description;
160
164
  },
161
165
  get children() {
162
- var l = he(), C = l.firstChild;
163
- return a(C, r(b, {
166
+ var r = he(), _ = r.firstChild;
167
+ return a(_, o(b, {
164
168
  get when() {
165
169
  return e.title;
166
170
  },
167
171
  get children() {
168
- var c = ge();
169
- return a(c, () => e.title), N(() => f(c, "id", F())), c;
172
+ var d = ge();
173
+ return a(d, () => e.title), N(() => f(d, "id", I())), d;
170
174
  }
171
- }), null), a(C, r(b, {
175
+ }), null), a(_, o(b, {
172
176
  get when() {
173
177
  return e.description;
174
178
  },
175
179
  get children() {
176
- var c = me();
177
- return a(c, () => e.description), N(() => f(c, "id", D())), c;
180
+ var d = me();
181
+ return a(d, () => e.description), N(() => f(d, "id", F())), d;
178
182
  }
179
- }), null), a(l, r(B, {
183
+ }), null), a(r, o(D, {
180
184
  variant: "ghost-destructive",
181
185
  size: "icon",
182
186
  class: "-my-2 -mr-2 h-[46px] w-[46px] shrink-0 sm:my-0 sm:-mr-1 sm:h-6 sm:w-6",
183
187
  onClick: () => e.onOpenChange(!1),
184
- "aria-label": "Close",
188
+ get "aria-label"() {
189
+ return e.closeLabel ?? "Close";
190
+ },
185
191
  get children() {
186
- return r(ne, {
192
+ return o(ne, {
187
193
  class: "w-3.5 h-3.5"
188
194
  });
189
195
  }
190
- }), null), l;
196
+ }), null), r;
191
197
  }
192
- }), _), a(_, () => e.children), a(o, r(b, {
198
+ }), C), a(C, () => e.children), a(i, o(b, {
193
199
  get when() {
194
200
  return e.footer;
195
201
  },
196
202
  get children() {
197
- var l = be();
198
- return a(l, () => e.footer), l;
203
+ var r = be();
204
+ return a(r, () => e.footer), r;
199
205
  }
200
206
  }), null), t;
201
207
  }
@@ -205,7 +211,7 @@ function _e(e) {
205
211
  }
206
212
  function Te(e) {
207
213
  const g = re();
208
- return r(_e, {
214
+ return o(Ce, {
209
215
  get open() {
210
216
  return e.open;
211
217
  },
@@ -222,7 +228,7 @@ function Te(e) {
222
228
  return e.globalZIndex;
223
229
  },
224
230
  get footer() {
225
- return [r(B, {
231
+ return [o(D, {
226
232
  variant: "ghost",
227
233
  onClick: () => e.onOpenChange(!1),
228
234
  get disabled() {
@@ -231,7 +237,7 @@ function Te(e) {
231
237
  get children() {
232
238
  return e.cancelText ?? g.config.strings.confirmDialog.cancel;
233
239
  }
234
- }), r(B, {
240
+ }), o(D, {
235
241
  get variant() {
236
242
  return e.variant === "destructive" ? "destructive" : "primary";
237
243
  },
@@ -247,11 +253,11 @@ function Te(e) {
247
253
  })];
248
254
  },
249
255
  get children() {
250
- return e.children ?? we();
256
+ return e.children ?? ye();
251
257
  }
252
258
  });
253
259
  }
254
260
  export {
255
261
  Te as ConfirmDialog,
256
- _e as Dialog
262
+ Ce as Dialog
257
263
  };
@@ -20,6 +20,8 @@ export interface UseOverlayMaskOptions {
20
20
  trapFocus?: MaybeAccessor<boolean | undefined>;
21
21
  /** Close on Escape and never leak to underlying window handlers (default: always). */
22
22
  closeOnEscape?: MaybeAccessor<boolean | OverlayEscapeCloseMode | undefined>;
23
+ /** Opt into bubbling so nested controls can consume Escape; capture preserves existing callers. */
24
+ escapeKeyPhase?: MaybeAccessor<'capture' | 'bubble' | undefined>;
23
25
  /** Stop bubbling keydown events to window-level hotkeys (default: true). */
24
26
  blockHotkeys?: MaybeAccessor<boolean | undefined>;
25
27
  /**
@@ -1,53 +1,56 @@
1
- import { createEffect as K, onCleanup as I } from "solid-js";
2
- import { lockBodyStyle as N } from "../utils/bodyStyleLock.js";
3
- import { deferAfterPaint as B } from "../utils/defer.js";
4
- import { getFocusableElements as q, getFirstFocusableElement as j } from "../utils/focus.js";
5
- import { matchKeybind as x } from "../utils/keybind.js";
6
- function M(e) {
1
+ import { createEffect as N, onCleanup as q } from "solid-js";
2
+ import { lockBodyStyle as j } from "../utils/bodyStyleLock.js";
3
+ import { deferAfterPaint as M } from "../utils/defer.js";
4
+ import { getFocusableElements as x, getFirstFocusableElement as z } from "../utils/focus.js";
5
+ import { matchKeybind as R } from "../utils/keybind.js";
6
+ function C(e) {
7
7
  return typeof Node < "u" && e instanceof Node;
8
8
  }
9
9
  function h(e, o, r) {
10
- return r ? r(o) : !e || !M(o) ? !1 : e.contains(o);
10
+ return r ? r(o) : !e || !C(o) ? !1 : e.contains(o);
11
11
  }
12
- function F(e, o, r, s) {
12
+ function O(e, o, r, s) {
13
13
  return r === "none" ? !1 : r === "all" ? !0 : !h(e, o, s);
14
14
  }
15
- function z(e) {
15
+ function V(e) {
16
16
  return typeof e == "function" ? e() ?? [] : e ?? [];
17
17
  }
18
18
  function c(e, o) {
19
19
  return typeof e == "function" ? e() ?? o : e ?? o;
20
20
  }
21
- function R(e, o) {
22
- for (const r of z(o)) {
21
+ function G(e, o) {
22
+ for (const r of V(o)) {
23
23
  const s = r.trim();
24
- if (s && x(e, s))
24
+ if (s && R(e, s))
25
25
  return !0;
26
26
  }
27
27
  return !1;
28
28
  }
29
- function Y(e) {
29
+ function _(e) {
30
30
  const o = () => c(e.lockBodyScroll, !0), r = () => c(e.trapFocus, !0), s = () => {
31
- const a = c(e.closeOnEscape, !0);
31
+ const a = c(
32
+ e.closeOnEscape,
33
+ !0
34
+ );
32
35
  return a === !1 ? "none" : a === "inside" ? "inside" : a === "none" ? "none" : "always";
33
- }, O = () => c(e.blockHotkeys, !0), C = () => c(e.restoreFocus, !0), D = () => c(e.blockWheel, "none"), S = () => c(e.blockTouchMove, "none"), H = () => c(e.autoFocus, !0);
34
- K(() => {
36
+ }, P = () => c(e.blockHotkeys, !0), D = () => c(e.restoreFocus, !0), S = () => c(e.blockWheel, "none"), H = () => c(e.blockTouchMove, "none"), K = () => c(e.autoFocus, !0);
37
+ N(() => {
35
38
  if (!e.open() || typeof document > "u") return;
36
- const a = o(), p = r(), l = s(), P = O(), W = C(), d = D(), m = S(), v = H(), y = document.activeElement instanceof HTMLElement ? document.activeElement : null, A = a ? N({ overflow: "hidden" }) : null;
37
- B(() => {
39
+ const a = o(), E = r(), l = s(), f = c(e.escapeKeyPhase, "capture"), W = P(), A = D(), m = S(), v = H(), y = K(), p = document.activeElement instanceof HTMLElement ? document.activeElement : null, I = a ? j({ overflow: "hidden" }) : null;
40
+ M(() => {
38
41
  const t = e.root();
39
- if (!t || v === !1) return;
40
- const n = typeof v == "object" ? v.selector : void 0, f = (n ? t.querySelector(n) : null) ?? t.querySelector("[data-floe-autofocus]") ?? j(t) ?? t;
42
+ if (!t || y === !1) return;
43
+ const n = typeof y == "object" ? y.selector : void 0, i = (n ? t.querySelector(n) : null) ?? t.querySelector("[data-floe-autofocus]") ?? z(t) ?? t;
41
44
  try {
42
- f.focus();
45
+ i.focus();
43
46
  } catch {
44
47
  }
45
48
  });
46
- const E = (t) => {
49
+ const k = (t) => {
47
50
  if (t.key !== "Tab") return;
48
51
  const n = e.root();
49
52
  if (!n) return;
50
- const u = q(n);
53
+ const u = x(n);
51
54
  if (!u.length) {
52
55
  t.preventDefault();
53
56
  try {
@@ -56,25 +59,29 @@ function Y(e) {
56
59
  }
57
60
  return;
58
61
  }
59
- const f = u[0], T = u[u.length - 1], i = document.activeElement instanceof HTMLElement ? document.activeElement : null;
62
+ const i = u[0], F = u[u.length - 1], d = document.activeElement instanceof HTMLElement ? document.activeElement : null;
60
63
  if (t.shiftKey) {
61
- if (i === f || !i || !n.contains(i)) {
64
+ if (d === i || !d || !n.contains(d)) {
62
65
  t.preventDefault();
63
66
  try {
64
- T.focus();
67
+ F.focus();
65
68
  } catch {
66
69
  }
67
70
  }
68
- } else if (i === T) {
71
+ } else if (d === F) {
69
72
  t.preventDefault();
70
73
  try {
71
- f.focus();
74
+ i.focus();
72
75
  } catch {
73
76
  }
74
77
  }
75
- }, k = (t) => {
76
- if (t.key !== "Escape" || l === "none") return;
77
- const n = e.root(), u = h(n, M(t.target) ? t.target : document.activeElement, e.containsTarget);
78
+ }, b = (t) => {
79
+ if (t.key !== "Escape" || f === "bubble" && (t.defaultPrevented || t.isComposing) || l === "none") return;
80
+ const n = e.root(), u = h(
81
+ n,
82
+ C(t.target) ? t.target : document.activeElement,
83
+ e.containsTarget
84
+ );
78
85
  if (l === "inside") {
79
86
  if (u) {
80
87
  t.preventDefault(), t.stopImmediatePropagation(), e.onClose?.();
@@ -84,25 +91,38 @@ function Y(e) {
84
91
  return;
85
92
  }
86
93
  t.preventDefault(), t.stopImmediatePropagation(), e.onClose?.();
87
- }, b = (t) => {
94
+ }, g = (t) => {
88
95
  const n = e.root();
89
- n && P && h(n, t.target, e.containsTarget) && (R(t, e.allowHotkeys) || t.stopPropagation());
96
+ n && W && h(n, t.target, e.containsTarget) && (G(t, e.allowHotkeys) || t.stopPropagation());
90
97
  }, w = (t) => {
91
98
  const n = e.root();
92
- F(n, t.target, d, e.containsTarget) && t.cancelable && t.preventDefault();
93
- }, g = (t) => {
94
- t.stopPropagation();
99
+ O(n, t.target, m, e.containsTarget) && t.cancelable && t.preventDefault();
95
100
  }, L = (t) => {
101
+ t.stopPropagation();
102
+ }, T = (t) => {
96
103
  const n = e.root();
97
- F(n, t.target, m, e.containsTarget) && t.cancelable && t.preventDefault();
104
+ O(n, t.target, v, e.containsTarget) && t.cancelable && t.preventDefault();
98
105
  };
99
- p && document.addEventListener("keydown", E, !0), l !== "none" && window.addEventListener("keydown", k, !0), document.addEventListener("keydown", b), d !== "none" && (document.addEventListener("wheel", w, { capture: !0, passive: !1 }), document.addEventListener("wheel", g)), m !== "none" && document.addEventListener("touchmove", L, { capture: !0, passive: !1 }), I(() => {
100
- p && document.removeEventListener("keydown", E, !0), l !== "none" && window.removeEventListener("keydown", k, !0), document.removeEventListener("keydown", b), d !== "none" && (document.removeEventListener("wheel", w, !0), document.removeEventListener("wheel", g)), m !== "none" && document.removeEventListener("touchmove", L, !0), A?.(), W && y && y.isConnected && B(() => {
106
+ E && document.addEventListener("keydown", k, !0);
107
+ const B = f === "capture" ? window : document;
108
+ l !== "none" && B.addEventListener(
109
+ "keydown",
110
+ b,
111
+ f === "capture"
112
+ ), document.addEventListener("keydown", g), m !== "none" && (document.addEventListener("wheel", w, { capture: !0, passive: !1 }), document.addEventListener("wheel", L)), v !== "none" && document.addEventListener("touchmove", T, {
113
+ capture: !0,
114
+ passive: !1
115
+ }), q(() => {
116
+ E && document.removeEventListener("keydown", k, !0), l !== "none" && B.removeEventListener(
117
+ "keydown",
118
+ b,
119
+ f === "capture"
120
+ ), document.removeEventListener("keydown", g), m !== "none" && (document.removeEventListener("wheel", w, !0), document.removeEventListener("wheel", L)), v !== "none" && document.removeEventListener("touchmove", T, !0), I?.(), A && p && p.isConnected && M(() => {
101
121
  if (typeof document > "u") return;
102
122
  const t = document.activeElement;
103
123
  if (!(t && t !== document.body && t !== document.documentElement))
104
124
  try {
105
- y.focus();
125
+ p.focus();
106
126
  } catch {
107
127
  }
108
128
  });
@@ -110,5 +130,5 @@ function Y(e) {
110
130
  });
111
131
  }
112
132
  export {
113
- Y as useOverlayMask
133
+ _ as useOverlayMask
114
134
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floegence/floe-webapp-core",
3
- "version": "0.50.2",
3
+ "version": "0.50.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",