@floegence/floe-webapp-core 0.36.1 → 0.36.2

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.
@@ -1,52 +1,52 @@
1
- import { createComponent as s, Portal as De, insert as w, effect as c, setAttribute as X, addEventListener as g, className as a, memo as We, setStyleProperty as I, template as E, use as He, delegateEvents as Oe } from "solid-js/web";
2
- import { createUniqueId as Xe, createSignal as x, onMount as Ye, onCleanup as Y, createEffect as $, Show as b, batch as qe } from "solid-js";
1
+ import { createComponent as s, Portal as Oe, insert as w, effect as u, setAttribute as Y, addEventListener as g, className as a, memo as Xe, setStyleProperty as I, template as E, use as Ye, delegateEvents as qe } from "solid-js/web";
2
+ import { createUniqueId as Te, createSignal as x, onMount as Be, onCleanup as q, createEffect as $, Show as p, batch as Ue } from "solid-js";
3
3
  import { cn as C } from "../../utils/cn.js";
4
- import { useLayout as Te } from "../../context/LayoutContext.js";
4
+ import { useLayout as Ne } from "../../context/LayoutContext.js";
5
5
  import { Button as ze } from "./Button.js";
6
- import { Restore as Be, Maximize as Ue, X as Ne } from "../icons/index.js";
7
- import { startHotInteraction as je } from "../../utils/hotInteraction.js";
8
- import { normalizeFloatingWindowRect as ye, resolveFloatingWindowRect as Ge } from "./floatingWindowGeometry.js";
9
- var Ve = /* @__PURE__ */ E('<h2 class="text-sm font-medium truncate select-none">'), Ze = /* @__PURE__ */ E('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), m = /* @__PURE__ */ E("<div style=touch-action:none>"), Je = /* @__PURE__ */ E('<div data-floe-geometry-surface=floating-window role=dialog tabindex=-1><div data-floe-floating-window-surface=true><div data-floe-floating-window-titlebar=true style=touch-action:none><div class="flex-1 min-w-0"></div><div class="flex items-center gap-0.5 -mr-1"></div></div><div class="flex-1 overflow-auto p-3">');
10
- function lt(i) {
11
- const q = () => i.resizable ?? !0, T = () => i.draggable ?? !0, M = () => i.minSize ?? {
6
+ import { Restore as je, Maximize as Ge, X as Ve } from "../icons/index.js";
7
+ import { startHotInteraction as Ze } from "../../utils/hotInteraction.js";
8
+ import { normalizeFloatingWindowRect as pe, resolveFloatingWindowRect as Je } from "./floatingWindowGeometry.js";
9
+ var Ke = /* @__PURE__ */ E('<h2 class="text-sm font-medium truncate select-none">'), Qe = /* @__PURE__ */ E('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), m = /* @__PURE__ */ E("<div style=touch-action:none>"), et = /* @__PURE__ */ E('<div data-floe-geometry-surface=floating-window role=dialog tabindex=-1><div data-floe-dialog-surface-host=true data-floe-floating-window-surface=true><div data-floe-floating-window-titlebar=true style=touch-action:none><div class="flex-1 min-w-0"></div><div class="flex items-center gap-0.5 -mr-1"></div></div><div class="flex-1 overflow-auto p-3">');
10
+ function dt(i) {
11
+ const T = () => i.resizable ?? !0, B = () => i.draggable ?? !0, M = () => i.minSize ?? {
12
12
  width: 200,
13
13
  height: 150
14
- }, L = () => i.maxSize ?? {
14
+ }, F = () => i.maxSize ?? {
15
15
  width: 1 / 0,
16
16
  height: 1 / 0
17
- }, be = () => i.zIndex ?? 100, pe = Xe(), Se = Te(), p = () => Se.isMobile(), _ = 16, B = () => `floating-window-${pe}-title`, [A, Pe] = x(i.defaultPosition ?? {
17
+ }, be = () => i.zIndex ?? 100, Pe = Te(), Se = Ne(), b = () => Se.isMobile(), L = 16, U = () => `floating-window-${Pe}-title`, [_, Ie] = x(i.defaultPosition ?? {
18
18
  x: 0,
19
19
  y: 0
20
- }), [F, Ie] = x(i.defaultSize ?? {
20
+ }), [A, $e] = x(i.defaultSize ?? {
21
21
  width: 400,
22
22
  height: 300
23
- }), [d, U] = x(!1), [N, j] = x(!1), [G, V] = x(!1), [$e, k] = x(!1), [Re, Ce] = x(null);
24
- let Z = {
23
+ }), [d, N] = x(!1), [j, G] = x(!1), [V, Z] = x(!1), [Re, D] = x(!1), [Ce, Ee] = x(null);
24
+ let J = {
25
25
  x: 0,
26
26
  y: 0
27
- }, J = {
27
+ }, K = {
28
28
  x: 0,
29
29
  y: 0,
30
30
  width: 0,
31
31
  height: 0
32
- }, K = {
32
+ }, Q = {
33
33
  x: 0,
34
34
  y: 0
35
- }, Q = {
35
+ }, ee = {
36
36
  x: 0,
37
37
  y: 0,
38
38
  width: 0,
39
39
  height: 0
40
- }, ee = "se", r, o = null, v = null, S = {
40
+ }, te = "se", r, l = null, v = null, P = {
41
41
  x: 0,
42
42
  y: 0
43
- }, z = null, R = null, te = !1, y = {
43
+ }, y = null, R = null, ne = !1, z = {
44
44
  x: i.defaultPosition?.x ?? 0,
45
45
  y: i.defaultPosition?.y ?? 0,
46
46
  width: i.defaultSize?.width ?? 400,
47
47
  height: i.defaultSize?.height ?? 300
48
48
  };
49
- const Ee = {
49
+ const Me = {
50
50
  n: "ns-resize",
51
51
  s: "ns-resize",
52
52
  e: "ew-resize",
@@ -55,35 +55,45 @@ function lt(i) {
55
55
  nw: "nwse-resize",
56
56
  se: "nwse-resize",
57
57
  sw: "nesw-resize"
58
- }, D = (e, n) => {
58
+ }, k = (e, n) => {
59
59
  if (!e) {
60
60
  R?.(), R = null;
61
61
  return;
62
62
  }
63
- R?.(), R = je({
63
+ R?.(), R = Ze({
64
64
  kind: v === "resize" ? "resize" : "drag",
65
65
  cursor: n,
66
66
  lockUserSelect: !0
67
67
  });
68
- }, ne = (e) => {
69
- y = e, r && (r.style.transform = `translate3d(${e.x}px, ${e.y}px, 0)`, r.style.width = `${e.width}px`, r.style.height = `${e.height}px`);
68
+ }, ie = (e) => {
69
+ z = e, r && (r.style.transform = `translate3d(${e.x}px, ${e.y}px, 0)`, r.style.width = `${e.width}px`, r.style.height = `${e.height}px`);
70
70
  }, W = () => {
71
- const e = A(), n = F();
71
+ const e = _(), n = A();
72
72
  return {
73
73
  x: e.x,
74
74
  y: e.y,
75
75
  width: n.width,
76
76
  height: n.height
77
77
  };
78
- }, P = (e) => {
79
- y = e, Pe({
78
+ }, S = (e) => {
79
+ z = e, Ie({
80
80
  x: e.x,
81
81
  y: e.y
82
- }), Ie({
82
+ }), $e({
83
83
  width: e.width,
84
84
  height: e.height
85
85
  });
86
- }, Me = (e) => !!r && e instanceof Node && r.contains(e), Le = () => {
86
+ }, Fe = () => {
87
+ try {
88
+ r?.focus({
89
+ preventScroll: !0
90
+ });
91
+ } catch {
92
+ }
93
+ }, Le = (e) => {
94
+ const n = e instanceof Element ? e : null;
95
+ return n ? n.closest('button, input, select, textarea, a, [role="button"], [tabindex]:not([tabindex="-1"])') === null : !0;
96
+ }, H = (e) => !!r && e instanceof Node && r.contains(e), _e = () => {
87
97
  if (!r) return null;
88
98
  const e = r.getBoundingClientRect();
89
99
  return {
@@ -92,32 +102,32 @@ function lt(i) {
92
102
  width: e.width,
93
103
  height: e.height
94
104
  };
95
- }, ie = () => {
96
- i.open && (o === null || v === null || typeof window > "u" || ne(Ge({
105
+ }, re = () => {
106
+ i.open && (l === null || v === null || typeof window > "u" || ie(Je({
97
107
  mode: v,
98
- pointer: S,
99
- dragStartPos: Z,
100
- dragStartRect: J,
101
- resizeStartPos: K,
102
- resizeStartRect: Q,
103
- resizeHandle: ee,
108
+ pointer: P,
109
+ dragStartPos: J,
110
+ dragStartRect: K,
111
+ resizeStartPos: Q,
112
+ resizeStartRect: ee,
113
+ resizeHandle: te,
104
114
  minSize: M(),
105
- maxSize: L(),
115
+ maxSize: F(),
106
116
  viewport: {
107
117
  width: window.innerWidth,
108
118
  height: window.innerHeight
109
119
  },
110
- mobile: p(),
111
- mobilePadding: _
120
+ mobile: b(),
121
+ mobilePadding: L
112
122
  })));
113
- }, H = (e) => {
123
+ }, O = (e) => {
114
124
  if (typeof window > "u") return;
115
125
  const n = {
116
126
  width: window.innerWidth,
117
127
  height: window.innerHeight
118
128
  };
119
129
  if (d()) {
120
- P({
130
+ S({
121
131
  x: 0,
122
132
  y: 0,
123
133
  width: n.width,
@@ -125,44 +135,44 @@ function lt(i) {
125
135
  });
126
136
  return;
127
137
  }
128
- P(ye({
138
+ S(pe({
129
139
  rect: W(),
130
140
  minSize: M(),
131
- maxSize: L(),
141
+ maxSize: F(),
132
142
  viewport: n,
133
- mobile: p(),
134
- mobilePadding: _,
143
+ mobile: b(),
144
+ mobilePadding: L,
135
145
  center: e?.center ?? !1
136
146
  }));
137
- }, O = (e, n = !0) => {
138
- z !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(z), z = null), n && ie();
139
- const l = n ? Le() ?? y : null;
147
+ }, X = (e, n = !0) => {
148
+ y !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(y), y = null), n && re();
149
+ const o = n ? _e() ?? z : null;
140
150
  if (e !== void 0)
141
151
  try {
142
- r?.releasePointerCapture(e);
152
+ typeof r?.releasePointerCapture == "function" && r.releasePointerCapture(e);
143
153
  } catch {
144
154
  }
145
- qe(() => {
146
- l && P(l), o = null, v = null, j(!1), V(!1);
147
- }), D(!1, "");
155
+ Ue(() => {
156
+ o && S(o), l = null, v = null, G(!1), Z(!1);
157
+ }), k(!1, "");
148
158
  };
149
- Ye(() => {
150
- i.open || H({
159
+ Be(() => {
160
+ i.open || O({
151
161
  center: !i.defaultPosition
152
162
  });
153
163
  const e = () => {
154
- o === null && H({
164
+ l === null && O({
155
165
  center: !1
156
166
  });
157
167
  };
158
- window.addEventListener("resize", e), Y(() => window.removeEventListener("resize", e));
168
+ window.addEventListener("resize", e), q(() => window.removeEventListener("resize", e));
159
169
  }), $(() => {
160
170
  if (!i.open) return;
161
- p();
162
- const e = !te && !i.defaultPosition, n = () => {
163
- H({
171
+ b();
172
+ const e = !ne && !i.defaultPosition, n = () => {
173
+ O({
164
174
  center: e
165
- }), te = !0;
175
+ }), ne = !0;
166
176
  };
167
177
  if (typeof requestAnimationFrame > "u") {
168
178
  n();
@@ -172,74 +182,76 @@ function lt(i) {
172
182
  }), $(() => {
173
183
  if (!i.open) return;
174
184
  const e = (n) => {
175
- n.key === "Escape" && i.onOpenChange(!1);
185
+ if (n.key !== "Escape") return;
186
+ const o = typeof document < "u" ? document.activeElement : null;
187
+ !H(n.target) && !H(o) || (n.preventDefault(), typeof n.stopImmediatePropagation == "function" ? n.stopImmediatePropagation() : n.stopPropagation(), i.onOpenChange(!1));
176
188
  };
177
- document.addEventListener("keydown", e), Y(() => document.removeEventListener("keydown", e));
189
+ document.addEventListener("keydown", e, !0), q(() => document.removeEventListener("keydown", e, !0));
178
190
  }), $(() => {
179
191
  if (!i.open) {
180
- k(!1), O(o ?? void 0, !1);
192
+ D(!1), X(l ?? void 0, !1);
181
193
  return;
182
194
  }
183
- k(!0);
195
+ D(!0);
184
196
  }), $(() => {
185
197
  if (!i.open) return;
186
- const e = (f) => {
187
- k(Me(f));
188
- }, n = (f) => {
189
- e(f.target);
190
- }, l = (f) => {
191
- e(f.target);
198
+ const e = (h) => {
199
+ D(H(h));
200
+ }, n = (h) => {
201
+ e(h.target);
202
+ }, o = (h) => {
203
+ e(h.target);
192
204
  };
193
- document.addEventListener("pointerdown", n), document.addEventListener("focusin", l), Y(() => {
194
- document.removeEventListener("pointerdown", n), document.removeEventListener("focusin", l);
205
+ document.addEventListener("pointerdown", n), document.addEventListener("focusin", o), q(() => {
206
+ document.removeEventListener("pointerdown", n), document.removeEventListener("focusin", o);
195
207
  });
196
208
  }), $(() => {
197
209
  if (!i.open) return;
198
210
  const e = W();
199
- o === null ? ne(e) : y = e;
211
+ l === null ? ie(e) : z = e;
200
212
  });
201
- const _e = (e) => {
202
- !T() || d() || e.pointerType === "mouse" && e.button !== 0 || e.target?.closest('button, input, select, textarea, a, [role="button"]') || (e.preventDefault(), o = e.pointerId, v = "drag", j(!0), Z = {
213
+ const Ae = (e) => {
214
+ !B() || d() || e.pointerType === "mouse" && e.button !== 0 || e.target?.closest('button, input, select, textarea, a, [role="button"]') || (e.preventDefault(), l = e.pointerId, v = "drag", G(!0), J = {
203
215
  x: e.clientX,
204
216
  y: e.clientY
205
- }, J = {
206
- ...y
207
- }, S = {
217
+ }, K = {
218
+ ...z
219
+ }, P = {
208
220
  x: e.clientX,
209
221
  y: e.clientY
210
- }, D(!0, "grabbing"), r?.setPointerCapture(e.pointerId));
211
- }, u = (e) => (n) => {
212
- !q() || d() || n.pointerType === "mouse" && n.button !== 0 || (n.preventDefault(), n.stopPropagation(), o = n.pointerId, v = "resize", V(!0), ee = e, K = {
222
+ }, k(!0, "grabbing"), typeof r?.setPointerCapture == "function" && r.setPointerCapture(e.pointerId));
223
+ }, c = (e) => (n) => {
224
+ !T() || d() || n.pointerType === "mouse" && n.button !== 0 || (n.preventDefault(), n.stopPropagation(), l = n.pointerId, v = "resize", Z(!0), te = e, Q = {
213
225
  x: n.clientX,
214
226
  y: n.clientY
215
- }, Q = {
216
- ...y
217
- }, S = {
227
+ }, ee = {
228
+ ...z
229
+ }, P = {
218
230
  x: n.clientX,
219
231
  y: n.clientY
220
- }, D(!0, Ee[e]), r?.setPointerCapture(n.pointerId));
221
- }, re = () => {
222
- z = null, ie();
223
- }, Ae = (e) => {
224
- if (!(o === null || e.pointerId !== o) && v !== null && (S = {
232
+ }, k(!0, Me[e]), typeof r?.setPointerCapture == "function" && r.setPointerCapture(n.pointerId));
233
+ }, oe = () => {
234
+ y = null, re();
235
+ }, De = (e) => {
236
+ if (!(l === null || e.pointerId !== l) && v !== null && (P = {
225
237
  x: e.clientX,
226
238
  y: e.clientY
227
- }, z === null)) {
239
+ }, y === null)) {
228
240
  if (typeof requestAnimationFrame > "u") {
229
- re();
241
+ oe();
230
242
  return;
231
243
  }
232
- z = requestAnimationFrame(re);
244
+ y = requestAnimationFrame(oe);
233
245
  }
234
- }, oe = (e) => {
235
- o === null || e.pointerId !== o || (S = {
246
+ }, le = (e) => {
247
+ l === null || e.pointerId !== l || (P = {
236
248
  x: e.clientX,
237
249
  y: e.clientY
238
- }, O(e.pointerId));
239
- }, le = () => {
240
- if (o !== null && O(o, !0), d()) {
241
- const n = Re();
242
- n && P(ye({
250
+ }, X(e.pointerId));
251
+ }, se = () => {
252
+ if (l !== null && X(l, !0), d()) {
253
+ const n = Ce();
254
+ n && S(pe({
243
255
  rect: {
244
256
  x: n.position.x,
245
257
  y: n.position.y,
@@ -247,19 +259,19 @@ function lt(i) {
247
259
  height: n.size.height
248
260
  },
249
261
  minSize: M(),
250
- maxSize: L(),
262
+ maxSize: F(),
251
263
  viewport: {
252
264
  width: window.innerWidth,
253
265
  height: window.innerHeight
254
266
  },
255
- mobile: p(),
256
- mobilePadding: _,
267
+ mobile: b(),
268
+ mobilePadding: L,
257
269
  center: !1
258
- })), U(!1);
270
+ })), N(!1);
259
271
  return;
260
272
  }
261
273
  const e = W();
262
- Ce({
274
+ Ee({
263
275
  position: {
264
276
  x: e.x,
265
277
  y: e.y
@@ -268,15 +280,17 @@ function lt(i) {
268
280
  width: e.width,
269
281
  height: e.height
270
282
  }
271
- }), P({
283
+ }), S({
272
284
  x: 0,
273
285
  y: 0,
274
286
  width: window.innerWidth,
275
287
  height: window.innerHeight
276
- }), U(!0);
277
- }, Fe = () => {
278
- le();
279
- }, h = (e) => C("absolute z-10", {
288
+ }), N(!0);
289
+ }, ke = () => {
290
+ se();
291
+ }, We = (e) => {
292
+ Le(e.target) && Fe();
293
+ }, f = (e) => C("absolute z-10", {
280
294
  n: "cursor-ns-resize top-0 left-2 right-2 h-1",
281
295
  s: "cursor-ns-resize bottom-0 left-2 right-2 h-1",
282
296
  e: "cursor-ew-resize right-0 top-2 bottom-2 w-1",
@@ -286,52 +300,52 @@ function lt(i) {
286
300
  se: "cursor-nwse-resize bottom-0 right-0 w-2 h-2",
287
301
  sw: "cursor-nesw-resize bottom-0 left-0 w-2 h-2"
288
302
  }[e]);
289
- return s(b, {
303
+ return s(p, {
290
304
  get when() {
291
305
  return i.open;
292
306
  },
293
307
  get children() {
294
- return s(De, {
308
+ return s(Oe, {
295
309
  get children() {
296
- var e = Je(), n = e.firstChild, l = n.firstChild, f = l.firstChild, se = f.nextSibling, ke = l.nextSibling;
297
- e.addEventListener("pointercancel", oe), e.$$pointerup = oe, e.$$pointermove = Ae;
298
- var ae = r;
299
- return typeof ae == "function" ? He(ae, e) : r = e, l.$$dblclick = Fe, l.$$pointerdown = _e, w(f, s(b, {
310
+ var e = et(), n = e.firstChild, o = n.firstChild, h = o.firstChild, ae = h.nextSibling, He = o.nextSibling;
311
+ e.$$pointerdown = We, e.addEventListener("pointercancel", le), e.$$pointerup = le, e.$$pointermove = De;
312
+ var de = r;
313
+ return typeof de == "function" ? Ye(de, e) : r = e, o.$$dblclick = ke, o.$$pointerdown = Ae, w(h, s(p, {
300
314
  get when() {
301
315
  return i.title;
302
316
  },
303
317
  get children() {
304
- var t = Ve();
305
- return w(t, () => i.title), c(() => X(t, "id", B())), t;
318
+ var t = Ke();
319
+ return w(t, () => i.title), u(() => Y(t, "id", U())), t;
306
320
  }
307
- })), w(se, s(ze, {
321
+ })), w(ae, s(ze, {
308
322
  variant: "ghost",
309
323
  size: "icon",
310
324
  class: "h-6 w-6",
311
325
  onClick: (t) => {
312
- t.stopPropagation(), le();
326
+ t.stopPropagation(), se();
313
327
  },
314
328
  get "aria-label"() {
315
329
  return d() ? "Restore" : "Maximize";
316
330
  },
317
331
  get children() {
318
- return s(b, {
332
+ return s(p, {
319
333
  get when() {
320
334
  return d();
321
335
  },
322
336
  get fallback() {
323
- return s(Ue, {
337
+ return s(Ge, {
324
338
  class: "w-3 h-3"
325
339
  });
326
340
  },
327
341
  get children() {
328
- return s(Be, {
342
+ return s(je, {
329
343
  class: "w-3 h-3"
330
344
  });
331
345
  }
332
346
  });
333
347
  }
334
- }), null), w(se, s(ze, {
348
+ }), null), w(ae, s(ze, {
335
349
  variant: "ghost-destructive",
336
350
  size: "icon",
337
351
  class: "h-6 w-6",
@@ -340,59 +354,59 @@ function lt(i) {
340
354
  },
341
355
  "aria-label": "Close",
342
356
  get children() {
343
- return s(Ne, {
357
+ return s(Ve, {
344
358
  class: "w-3.5 h-3.5"
345
359
  });
346
360
  }
347
- }), null), w(ke, () => i.children), w(n, s(b, {
361
+ }), null), w(He, () => i.children), w(n, s(p, {
348
362
  get when() {
349
363
  return i.footer;
350
364
  },
351
365
  get children() {
352
- var t = Ze();
366
+ var t = Qe();
353
367
  return w(t, () => i.footer), t;
354
368
  }
355
- }), null), w(n, s(b, {
369
+ }), null), w(n, s(p, {
356
370
  get when() {
357
- return We(() => !!q())() && !d();
371
+ return Xe(() => !!T())() && !d();
358
372
  },
359
373
  get children() {
360
374
  return [(() => {
361
375
  var t = m();
362
- return g(t, "pointerdown", u("n"), !0), c(() => a(t, h("n"))), t;
376
+ return g(t, "pointerdown", c("n"), !0), u(() => a(t, f("n"))), t;
363
377
  })(), (() => {
364
378
  var t = m();
365
- return g(t, "pointerdown", u("s"), !0), c(() => a(t, h("s"))), t;
366
- })(), s(b, {
379
+ return g(t, "pointerdown", c("s"), !0), u(() => a(t, f("s"))), t;
380
+ })(), s(p, {
367
381
  get when() {
368
- return !p();
382
+ return !b();
369
383
  },
370
384
  get children() {
371
385
  return [(() => {
372
386
  var t = m();
373
- return g(t, "pointerdown", u("e"), !0), c(() => a(t, h("e"))), t;
387
+ return g(t, "pointerdown", c("e"), !0), u(() => a(t, f("e"))), t;
374
388
  })(), (() => {
375
389
  var t = m();
376
- return g(t, "pointerdown", u("w"), !0), c(() => a(t, h("w"))), t;
390
+ return g(t, "pointerdown", c("w"), !0), u(() => a(t, f("w"))), t;
377
391
  })(), (() => {
378
392
  var t = m();
379
- return g(t, "pointerdown", u("ne"), !0), c(() => a(t, h("ne"))), t;
393
+ return g(t, "pointerdown", c("ne"), !0), u(() => a(t, f("ne"))), t;
380
394
  })(), (() => {
381
395
  var t = m();
382
- return g(t, "pointerdown", u("nw"), !0), c(() => a(t, h("nw"))), t;
396
+ return g(t, "pointerdown", c("nw"), !0), u(() => a(t, f("nw"))), t;
383
397
  })(), (() => {
384
398
  var t = m();
385
- return g(t, "pointerdown", u("se"), !0), c(() => a(t, h("se"))), t;
399
+ return g(t, "pointerdown", c("se"), !0), u(() => a(t, f("se"))), t;
386
400
  })(), (() => {
387
401
  var t = m();
388
- return g(t, "pointerdown", u("sw"), !0), c(() => a(t, h("sw"))), t;
402
+ return g(t, "pointerdown", c("sw"), !0), u(() => a(t, f("sw"))), t;
389
403
  })()];
390
404
  }
391
405
  })];
392
406
  }
393
- }), null), c((t) => {
394
- var de = C("fixed left-0 top-0 z-[100] flex flex-col", (N() || G()) && "select-none"), ce = `${F().width}px`, ue = `${F().height}px`, he = `translate3d(${A().x}px, ${A().y}px, 0)`, fe = be(), we = N() ? "transform" : G() ? "transform, width, height" : void 0, ge = i.title ? B() : void 0, me = $e() ? "active" : "inactive", ve = C("relative flex h-full w-full flex-col overflow-hidden", "text-card-foreground rounded-md", "border", "animate-in fade-in duration-150", d() && "rounded-none", i.class), xe = C("flex items-center justify-between h-9 px-3", "border-b", d() ? "rounded-none" : "rounded-t-md", T() && !d() && "cursor-move");
395
- return de !== t.e && a(e, t.e = de), ce !== t.t && I(e, "width", t.t = ce), ue !== t.a && I(e, "height", t.a = ue), he !== t.o && I(e, "transform", t.o = he), fe !== t.i && I(e, "z-index", t.i = fe), we !== t.n && I(e, "will-change", t.n = we), ge !== t.s && X(e, "aria-labelledby", t.s = ge), me !== t.h && X(n, "data-floe-floating-window-state", t.h = me), ve !== t.r && a(n, t.r = ve), xe !== t.d && a(l, t.d = xe), t;
407
+ }), null), u((t) => {
408
+ var ue = C("fixed left-0 top-0 z-[100] flex flex-col", (j() || V()) && "select-none"), ce = `${A().width}px`, fe = `${A().height}px`, he = `translate3d(${_().x}px, ${_().y}px, 0)`, we = be(), ge = j() ? "transform" : V() ? "transform, width, height" : void 0, me = i.title ? U() : void 0, ve = Re() ? "active" : "inactive", xe = C("relative flex h-full w-full flex-col overflow-hidden", "text-card-foreground rounded-md", "border", "animate-in fade-in duration-150", d() && "rounded-none", i.class), ye = C("flex items-center justify-between h-9 px-3", "border-b", d() ? "rounded-none" : "rounded-t-md", B() && !d() && "cursor-move");
409
+ return ue !== t.e && a(e, t.e = ue), ce !== t.t && I(e, "width", t.t = ce), fe !== t.a && I(e, "height", t.a = fe), he !== t.o && I(e, "transform", t.o = he), we !== t.i && I(e, "z-index", t.i = we), ge !== t.n && I(e, "will-change", t.n = ge), me !== t.s && Y(e, "aria-labelledby", t.s = me), ve !== t.h && Y(n, "data-floe-floating-window-state", t.h = ve), xe !== t.r && a(n, t.r = xe), ye !== t.d && a(o, t.d = ye), t;
396
410
  }, {
397
411
  e: void 0,
398
412
  t: void 0,
@@ -410,7 +424,7 @@ function lt(i) {
410
424
  }
411
425
  });
412
426
  }
413
- Oe(["pointermove", "pointerup", "pointerdown", "dblclick"]);
427
+ qe(["pointermove", "pointerup", "pointerdown", "dblclick"]);
414
428
  export {
415
- lt as FloatingWindow
429
+ dt as FloatingWindow
416
430
  };
@@ -0,0 +1,14 @@
1
+ export declare const DIALOG_SURFACE_HOST_ATTR = "data-floe-dialog-surface-host";
2
+ export declare const DIALOG_SURFACE_BOUNDARY_ATTR = "data-floe-dialog-surface-boundary";
3
+ export type DialogSurfaceInteractionSnapshot = Readonly<{
4
+ target: Element | null;
5
+ activeElement: Element | null;
6
+ recordedAt: number;
7
+ }>;
8
+ export type ResolvedDialogSurfaceHost = Readonly<{
9
+ host: HTMLElement | null;
10
+ mode: 'global' | 'surface';
11
+ }>;
12
+ export declare function ensureDialogSurfaceInteractionTracking(): void;
13
+ export declare function resolveDialogSurfaceHost(): ResolvedDialogSurfaceHost;
14
+ export declare function __resetDialogSurfaceScopeForTests(): void;
@@ -0,0 +1,45 @@
1
+ const a = "data-floe-dialog-surface-host", m = "data-floe-dialog-surface-boundary";
2
+ let o = null, t = null;
3
+ function d(e) {
4
+ return typeof Element < "u" && e instanceof Element ? e : typeof Node < "u" && e instanceof Node ? e.parentElement : null;
5
+ }
6
+ function f(e) {
7
+ const n = e?.activeElement;
8
+ return n instanceof Element ? n : null;
9
+ }
10
+ function i(e) {
11
+ const n = typeof document < "u" ? document : null;
12
+ o = {
13
+ target: d(e),
14
+ activeElement: f(n),
15
+ recordedAt: Date.now()
16
+ };
17
+ }
18
+ function r(e) {
19
+ i(e.target);
20
+ }
21
+ function u(e) {
22
+ i(e.target);
23
+ }
24
+ function l() {
25
+ typeof document > "u" || t !== document && (t && (t.removeEventListener("pointerdown", r, !0), t.removeEventListener("focusin", u, !0)), document.addEventListener("pointerdown", r, !0), document.addEventListener("focusin", u, !0), t = document);
26
+ }
27
+ function s() {
28
+ return !o || Date.now() - o.recordedAt > 1600 ? null : o;
29
+ }
30
+ function c(e) {
31
+ const n = e?.closest(`[${a}="true"]`);
32
+ return n instanceof HTMLElement && n.isConnected ? n : null;
33
+ }
34
+ function E() {
35
+ l();
36
+ const e = s(), n = c(e?.target ?? null) ?? c(e?.activeElement ?? null);
37
+ return n ? { host: n, mode: "surface" } : { host: null, mode: "global" };
38
+ }
39
+ typeof document < "u" && l();
40
+ export {
41
+ m as DIALOG_SURFACE_BOUNDARY_ATTR,
42
+ a as DIALOG_SURFACE_HOST_ATTR,
43
+ l as ensureDialogSurfaceInteractionTracking,
44
+ E as resolveDialogSurfaceHost
45
+ };