@floegence/floe-webapp-core 0.78.10 → 0.79.1

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,20 +1,21 @@
1
- import { createComponent as l, Portal as Qe, spread as Se, mergeProps as Pe, memo as D, insert as c, effect as f, setAttribute as Ze, addEventListener as b, className as w, template as s, use as Ie, delegateEvents as Je } from "solid-js/web";
2
- import { createSignal as g, createUniqueId as Ke, onCleanup as F, onMount as et, createEffect as p, untrack as W, Show as z, batch as te } from "solid-js";
3
- import { useMediaQuery as tt } from "../../hooks/useMediaQuery.js";
1
+ import { createComponent as l, Portal as Je, spread as Se, mergeProps as Pe, memo as D, insert as c, effect as f, setAttribute as Ke, addEventListener as b, className as w, template as s, use as Ie, delegateEvents as et } from "solid-js/web";
2
+ import { createSignal as g, createUniqueId as tt, onCleanup as F, onMount as nt, createEffect as p, untrack as W, Show as z, batch as te } from "solid-js";
4
3
  import { cn as q } from "../../utils/cn.js";
5
- import { useOptionalLayout as nt } from "../../context/LayoutContext.js";
4
+ import { useOptionalLayout as it } from "../../context/LayoutContext.js";
5
+ import { useResolvedFloeConfig as ot } from "../../context/FloeConfigContext.js";
6
+ import { useMediaQuery as rt } from "../../hooks/useMediaQuery.js";
6
7
  import { Button as Re } from "./Button.js";
7
- import { Restore as it, Maximize as ot, X as rt } from "../icons/index.js";
8
- import { startHotInteraction as lt } from "../../utils/hotInteraction.js";
9
- import { startPointerSession as at } from "./pointerSession.js";
10
- import { resolveFloatingWindowViewport as ne, normalizeFloatingWindowRect as st, resolveFloatingWindowRect as dt } from "./floatingWindowGeometry.js";
11
- import { observeViewport as ut } from "../../viewport.js";
12
- import { createFloatingPresence as ct } from "./floatingPresence.js";
8
+ import { Restore as lt, Maximize as at, X as st } from "../icons/index.js";
9
+ import { startHotInteraction as dt } from "../../utils/hotInteraction.js";
10
+ import { startPointerSession as ut } from "./pointerSession.js";
11
+ import { resolveFloatingWindowViewport as ne, normalizeFloatingWindowRect as ct, resolveFloatingWindowRect as ft } from "./floatingWindowGeometry.js";
12
+ import { observeViewport as ht } from "../../viewport.js";
13
+ import { createFloatingPresence as wt } from "./floatingPresence.js";
13
14
  import { LOCAL_INTERACTION_SURFACE_ATTR as Ae } from "./localInteractionSurface.js";
14
- import { resolveFloatingBoundary as ft } from "./surfaceFloatingBoundary.js";
15
- import { SURFACE_PORTAL_LAYER_ATTR as ht, resolveSurfacePortalHost as wt, SURFACE_FLOATING_LAYER_ATTR as gt } from "./dialogSurfaceScope.js";
16
- var mt = /* @__PURE__ */ s("<span hidden>"), vt = /* @__PURE__ */ s('<h2 class="text-xs leading-none font-medium truncate select-none">'), xt = /* @__PURE__ */ s('<div data-floe-floating-window-header-actions=true class="flex shrink-0 cursor-default items-center gap-1"><span aria-hidden=true class="mx-2 h-4 w-px shrink-0 bg-border">'), yt = /* @__PURE__ */ s('<div data-floe-floating-window-footer=true class="flex items-center justify-end gap-2 p-3 border-t border-border">'), bt = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=n style=touch-action:none>"), pt = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=s style=touch-action:none>"), zt = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=e style=touch-action:none>"), $t = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=w style=touch-action:none>"), _t = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=ne style=touch-action:none>"), St = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=nw style=touch-action:none>"), Pt = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=se style=touch-action:none>"), It = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=sw style=touch-action:none>"), Rt = /* @__PURE__ */ s('<div data-floe-geometry-surface=floating-window><div data-floe-dialog-surface-host=true><div data-floe-floating-window-titlebar=true style=touch-action:none><div class="flex-1 min-w-0 px-2"></div><div class="flex h-full shrink-0 items-stretch"></div></div><div data-floe-floating-window-content=true class="min-h-0 flex-1 overflow-auto overscroll-contain p-3">');
17
- function Ht(n) {
15
+ import { resolveFloatingBoundary as gt } from "./surfaceFloatingBoundary.js";
16
+ import { SURFACE_PORTAL_LAYER_ATTR as mt, resolveSurfacePortalHost as vt, SURFACE_FLOATING_LAYER_ATTR as xt } from "./dialogSurfaceScope.js";
17
+ var yt = /* @__PURE__ */ s("<span hidden>"), bt = /* @__PURE__ */ s('<h2 class="text-xs leading-none font-medium truncate select-none">'), pt = /* @__PURE__ */ s('<div data-floe-floating-window-header-actions=true class="flex shrink-0 cursor-default items-center gap-1"><span aria-hidden=true class="mx-2 h-4 w-px shrink-0 bg-border">'), zt = /* @__PURE__ */ s('<div data-floe-floating-window-footer=true class="flex items-center justify-end gap-2 p-3 border-t border-border">'), $t = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=n style=touch-action:none>"), _t = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=s style=touch-action:none>"), St = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=e style=touch-action:none>"), Pt = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=w style=touch-action:none>"), It = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=ne style=touch-action:none>"), Rt = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=nw style=touch-action:none>"), At = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=se style=touch-action:none>"), Ct = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=sw style=touch-action:none>"), Et = /* @__PURE__ */ s('<div data-floe-geometry-surface=floating-window><div data-floe-dialog-surface-host=true><div data-floe-floating-window-titlebar=true style=touch-action:none><div class="flex-1 min-w-0 px-2"></div><div class="flex h-full shrink-0 items-stretch"></div></div><div data-floe-floating-window-content=true class="min-h-0 flex-1 overflow-auto overscroll-contain p-3">');
18
+ function jt(n) {
18
19
  const ie = () => n.resizable ?? !0, Y = () => n.maximizable ?? !0, oe = () => n.draggable ?? !0, re = () => n.minSize ?? {
19
20
  width: 200,
20
21
  height: 150
@@ -23,7 +24,7 @@ function Ht(n) {
23
24
  height: 1 / 0
24
25
  };
25
26
  let N;
26
- const [k, Ee] = g(), [A, Ce] = g({
27
+ const [k, Ce] = g(), [A, Ee] = g({
27
28
  x: 0,
28
29
  y: 0,
29
30
  width: 0,
@@ -33,13 +34,13 @@ function Ht(n) {
33
34
  }), [X, Fe] = g(!0), h = () => !!(n.compactBelow && A().width < n.compactBelow), S = () => n.viewportInsets, P = () => k()?.fixedScale ?? 1, H = (e) => ({
34
35
  x: (e.x + (k()?.fixedOffset.left ?? 0)) / P(),
35
36
  y: (e.y + (k()?.fixedOffset.top ?? 0)) / P()
36
- }), ke = () => n.zIndex ?? 100, Le = Ke(), L = nt()?.isMobile ?? tt("(max-width: 767px)"), ae = 16, se = () => `floating-window-${Le}-title`, [U, Me] = g(n.defaultPosition ?? {
37
+ }), ke = () => n.zIndex ?? 100, Le = tt(), Me = it(), Te = ot(), L = Me?.isMobile ?? rt(() => Te.config.layout.mobileQuery), ae = 16, se = () => `floating-window-${Le}-title`, [U, Oe] = g(n.defaultPosition ?? {
37
38
  x: 0,
38
39
  y: 0
39
- }), [V, Te] = g(n.defaultSize ?? {
40
+ }), [V, Be] = g(n.defaultSize ?? {
40
41
  width: 400,
41
42
  height: 300
42
- }), [d, de] = g(!1), [M, ue] = g(!1), [T, ce] = g(!1), [Oe, j] = g(!1), I = ct({
43
+ }), [d, de] = g(!1), [M, ue] = g(!1), [T, ce] = g(!1), [De, j] = g(!1), I = wt({
43
44
  open: () => n.open
44
45
  });
45
46
  let fe = {
@@ -58,7 +59,7 @@ function Ht(n) {
58
59
  y: 0,
59
60
  width: 0,
60
61
  height: 0
61
- }, me = "se", a, u = null, O, m = null, E = {
62
+ }, me = "se", a, u = null, O, m = null, C = {
62
63
  x: 0,
63
64
  y: 0
64
65
  }, R = null, B = null, G = !1, $ = {
@@ -78,7 +79,7 @@ function Ht(n) {
78
79
  x: t.width > e.width ? (e.x - t.x) / (t.width - e.width) : _?.x ?? 0.5,
79
80
  y: t.height > e.height ? (e.y - t.y) / (t.height - e.height) : _?.y ?? 0.5
80
81
  };
81
- }, Be = {
82
+ }, We = {
82
83
  n: "ns-resize",
83
84
  s: "ns-resize",
84
85
  e: "ew-resize",
@@ -92,7 +93,7 @@ function Ht(n) {
92
93
  B?.(), B = null;
93
94
  return;
94
95
  }
95
- B?.(), B = lt({
96
+ B?.(), B = dt({
96
97
  kind: m === "resize" ? "resize" : "drag",
97
98
  cursor: t,
98
99
  lockUserSelect: !0
@@ -101,7 +102,7 @@ function Ht(n) {
101
102
  if ($ = e, !a) return;
102
103
  const t = H(e);
103
104
  a.style.transform = `translate3d(${t.x}px, ${t.y}px, 0)`, a.style.width = `${e.width / P()}px`, a.style.height = `${e.height / P()}px`;
104
- }, De = () => {
105
+ }, qe = () => {
105
106
  const e = U(), t = V();
106
107
  return {
107
108
  x: e.x,
@@ -110,27 +111,27 @@ function Ht(n) {
110
111
  height: t.height
111
112
  };
112
113
  }, Z = (e) => {
113
- $ = e, Me((t) => t.x === e.x && t.y === e.y ? t : {
114
+ $ = e, Oe((t) => t.x === e.x && t.y === e.y ? t : {
114
115
  x: e.x,
115
116
  y: e.y
116
- }), Te((t) => t.width === e.width && t.height === e.height ? t : {
117
+ }), Be((t) => t.width === e.width && t.height === e.height ? t : {
117
118
  width: e.width,
118
119
  height: e.height
119
120
  });
120
- }, We = () => {
121
+ }, Ye = () => {
121
122
  try {
122
123
  a?.focus({
123
124
  preventScroll: !0
124
125
  });
125
126
  } catch {
126
127
  }
127
- }, qe = (e) => {
128
+ }, Ne = (e) => {
128
129
  const t = e instanceof Element ? e : null;
129
130
  return t ? t.closest('button, input, select, textarea, a, [role="button"], [tabindex]:not([tabindex="-1"])') === null : !0;
130
- }, J = (e) => !!a && e instanceof Node && a.contains(e), Ye = (e) => {
131
- const o = (e instanceof Element ? e : null)?.closest('[role="menu"]')?.closest(`[${gt}="true"]`);
131
+ }, J = (e) => !!a && e instanceof Node && a.contains(e), Xe = (e) => {
132
+ const o = (e instanceof Element ? e : null)?.closest('[role="menu"]')?.closest(`[${xt}="true"]`);
132
133
  return !!(o && a?.contains(o));
133
- }, Ne = () => {
134
+ }, He = () => {
134
135
  if (!a) return null;
135
136
  const e = a.getBoundingClientRect();
136
137
  return {
@@ -140,9 +141,9 @@ function Ht(n) {
140
141
  height: e.height
141
142
  };
142
143
  }, ye = () => {
143
- n.open && (u === null || m === null || typeof window > "u" || xe(dt({
144
+ n.open && (u === null || m === null || typeof window > "u" || xe(ft({
144
145
  mode: m,
145
- pointer: E,
146
+ pointer: C,
146
147
  dragStartPos: fe,
147
148
  dragStartRect: he,
148
149
  resizeStartPos: we,
@@ -155,14 +156,14 @@ function Ht(n) {
155
156
  mobile: L(),
156
157
  mobilePadding: ae
157
158
  })));
158
- }, C = (e) => {
159
+ }, E = (e) => {
159
160
  if (typeof window > "u") return;
160
161
  const t = A();
161
162
  if (d() || h()) {
162
163
  Z(ne(t, S()));
163
164
  return;
164
165
  }
165
- let r = st({
166
+ let r = ct({
166
167
  rect: v,
167
168
  minSize: re(),
168
169
  maxSize: le(),
@@ -189,7 +190,7 @@ function Ht(n) {
189
190
  }
190
191
  }, be = (e) => {
191
192
  R !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(R), R = null), e && ye();
192
- const t = e ? Ne() ?? $ : null;
193
+ const t = e ? He() ?? $ : null;
193
194
  te(() => {
194
195
  if (t) {
195
196
  Z(t);
@@ -206,16 +207,16 @@ function Ht(n) {
206
207
  commit: e
207
208
  }) : be(e);
208
209
  };
209
- F(() => K(!1)), et(() => {
210
+ F(() => K(!1)), nt(() => {
210
211
  const e = () => {
211
212
  const t = k(), r = n.boundary === void 0 ? {
212
213
  boundaryHost: null,
213
214
  mode: "global"
214
- } : wt({
215
+ } : vt({
215
216
  owner: N
216
- }), o = ft(r, n.boundary, t?.safeArea);
217
+ }), o = gt(r, n.boundary, t?.safeArea);
217
218
  te(() => {
218
- Fe(!!(o && o.width > 16 && o.height > 16)), Ce(o ? {
219
+ Fe(!!(o && o.width > 16 && o.height > 16)), Ee(o ? {
219
220
  x: o.left,
220
221
  y: o.top,
221
222
  width: o.width,
@@ -228,9 +229,9 @@ function Ht(n) {
228
229
  });
229
230
  });
230
231
  };
231
- F(ut(window, (t) => {
232
+ F(ht(window, (t) => {
232
233
  te(() => {
233
- Ee(t), W(e);
234
+ Ce(t), W(e);
234
235
  });
235
236
  })), p(() => {
236
237
  if (!n.open || n.boundary === void 0) return;
@@ -239,14 +240,14 @@ function Ht(n) {
239
240
  W(e), t = requestAnimationFrame(r);
240
241
  };
241
242
  r(), F(() => cancelAnimationFrame(t));
242
- }), n.open || C({
243
+ }), n.open || E({
243
244
  center: !n.defaultPosition
244
245
  });
245
246
  }), p(() => {
246
247
  if (!n.open) return;
247
248
  L();
248
249
  const e = !G && !n.defaultPosition, t = () => {
249
- C({
250
+ E({
250
251
  center: e
251
252
  }), G = !0;
252
253
  };
@@ -256,12 +257,12 @@ function Ht(n) {
256
257
  }
257
258
  requestAnimationFrame(t);
258
259
  }), p(() => {
259
- S(), A(), h(), !(!n.open || !G || u !== null) && W(() => C({
260
+ S(), A(), h(), !(!n.open || !G || u !== null) && W(() => E({
260
261
  center: !1
261
262
  }));
262
263
  }), p(() => {
263
264
  Y() || !d() || W(() => {
264
- de(!1), C({
265
+ de(!1), E({
265
266
  center: !1
266
267
  });
267
268
  });
@@ -270,7 +271,7 @@ function Ht(n) {
270
271
  const e = (t) => {
271
272
  if (t.key !== "Escape") return;
272
273
  const r = typeof document < "u" ? document.activeElement : null;
273
- !J(t.target) && !J(r) || Ye(t.target) || (t.preventDefault(), typeof t.stopImmediatePropagation == "function" ? t.stopImmediatePropagation() : t.stopPropagation(), n.onOpenChange(!1));
274
+ !J(t.target) && !J(r) || Xe(t.target) || (t.preventDefault(), typeof t.stopImmediatePropagation == "function" ? t.stopImmediatePropagation() : t.stopPropagation(), n.onOpenChange(!1));
274
275
  };
275
276
  document.addEventListener("keydown", e, !0), F(() => document.removeEventListener("keydown", e, !0));
276
277
  }), p(() => {
@@ -293,16 +294,16 @@ function Ht(n) {
293
294
  });
294
295
  }), p(() => {
295
296
  if (!n.open) return;
296
- const e = De();
297
+ const e = qe();
297
298
  u === null ? xe(e) : $ = e;
298
299
  });
299
- const Xe = (e) => {
300
+ const Ue = (e) => {
300
301
  !oe() || d() || h() || u !== null || e.pointerType === "mouse" && e.button !== 0 || e.target?.closest('button, input, select, textarea, a, [role="button"], [data-floe-floating-window-header-actions]') || (e.preventDefault(), u = e.pointerId, m = "drag", ue(!0), fe = {
301
302
  x: e.clientX,
302
303
  y: e.clientY
303
304
  }, he = {
304
305
  ...$
305
- }, E = {
306
+ }, C = {
306
307
  x: e.clientX,
307
308
  y: e.clientY
308
309
  }, Q(!0, "grabbing"), ze(e));
@@ -312,14 +313,14 @@ function Ht(n) {
312
313
  y: t.clientY
313
314
  }, ge = {
314
315
  ...$
315
- }, E = {
316
+ }, C = {
316
317
  x: t.clientX,
317
318
  y: t.clientY
318
- }, Q(!0, Be[e]), ze(t));
319
+ }, Q(!0, We[e]), ze(t));
319
320
  }, pe = () => {
320
321
  R = null, ye();
321
- }, He = (e) => {
322
- if (!(u === null || e.pointerId !== u) && m !== null && (E = {
322
+ }, Ve = (e) => {
323
+ if (!(u === null || e.pointerId !== u) && m !== null && (C = {
323
324
  x: e.clientX,
324
325
  y: e.clientY
325
326
  }, R === null)) {
@@ -330,27 +331,27 @@ function Ht(n) {
330
331
  R = requestAnimationFrame(pe);
331
332
  }
332
333
  }, ze = (e) => {
333
- O = at({
334
+ O = ut({
334
335
  pointerEvent: e,
335
336
  captureEl: a,
336
- onMove: He,
337
+ onMove: Ve,
337
338
  onEnd: ({
338
339
  commit: t,
339
340
  reason: r,
340
341
  snapshot: o
341
342
  }) => {
342
- E = {
343
+ C = {
343
344
  x: o.latestClientX,
344
345
  y: o.latestClientY
345
346
  }, be(t || r === "pointer_cancel");
346
347
  }
347
348
  });
348
349
  }, $e = () => {
349
- !Y() || h() || (u !== null && K(!0), de(!d()), C());
350
- }, Ue = (e) => {
350
+ !Y() || h() || (u !== null && K(!0), de(!d()), E());
351
+ }, je = (e) => {
351
352
  e.target?.closest("button, [data-floe-floating-window-header-actions]") || $e();
352
- }, Ve = (e) => {
353
- qe(e.target) && We();
353
+ }, Ge = (e) => {
354
+ Ne(e.target) && Ye();
354
355
  }, y = (e) => q("absolute z-10", {
355
356
  n: "cursor-ns-resize top-0 left-2 right-2 h-1",
356
357
  s: "cursor-ns-resize bottom-0 left-2 right-2 h-1",
@@ -362,16 +363,16 @@ function Ht(n) {
362
363
  sw: "cursor-nesw-resize bottom-0 left-0 w-2 h-2"
363
364
  }[e]);
364
365
  return [(() => {
365
- var e = mt(), t = N;
366
+ var e = yt(), t = N;
366
367
  return typeof t == "function" ? Ie(t, e) : N = e, e;
367
368
  })(), l(z, {
368
369
  get when() {
369
370
  return I.mounted();
370
371
  },
371
372
  get children() {
372
- return l(Qe, {
373
+ return l(Je, {
373
374
  get children() {
374
- var e = Rt(), t = e.firstChild, r = t.firstChild, o = r.firstChild, ee = o.nextSibling, je = r.nextSibling, _e = a;
375
+ var e = Et(), t = e.firstChild, r = t.firstChild, o = r.firstChild, ee = o.nextSibling, Qe = r.nextSibling, _e = a;
375
376
  return typeof _e == "function" ? Ie(_e, e) : a = e, Se(e, Pe({
376
377
  get "data-floating-presence"() {
377
378
  return I.state();
@@ -406,9 +407,9 @@ function Ht(n) {
406
407
  return D(() => !!n.title)() ? se() : void 0;
407
408
  },
408
409
  tabIndex: -1,
409
- onPointerDown: Ve
410
+ onPointerDown: Ge
410
411
  }), !1, !0), Se(t, Pe({
411
- [ht]: "true"
412
+ [mt]: "true"
412
413
  }, {
413
414
  "data-floe-floating-window-surface": "true",
414
415
  "data-floe-surface": "floating",
@@ -416,7 +417,7 @@ function Ht(n) {
416
417
  return M() || T() ? "true" : void 0;
417
418
  },
418
419
  get "data-floe-floating-window-state"() {
419
- return Oe() ? "active" : "inactive";
420
+ return De() ? "active" : "inactive";
420
421
  }
421
422
  }, {
422
423
  [Ae]: "true"
@@ -432,21 +433,21 @@ function Ht(n) {
432
433
  get "data-floating-presence"() {
433
434
  return I.state();
434
435
  }
435
- }), !1, !0), r.$$dblclick = Ue, r.$$pointerdown = Xe, c(o, l(z, {
436
+ }), !1, !0), r.$$dblclick = je, r.$$pointerdown = Ue, c(o, l(z, {
436
437
  get when() {
437
438
  return n.title;
438
439
  },
439
440
  get children() {
440
- var i = vt();
441
- return c(i, () => n.title), f(() => Ze(i, "id", se())), i;
441
+ var i = bt();
442
+ return c(i, () => n.title), f(() => Ke(i, "id", se())), i;
442
443
  }
443
444
  })), c(r, l(z, {
444
445
  get when() {
445
446
  return n.headerActions;
446
447
  },
447
448
  get children() {
448
- var i = xt(), Ge = i.firstChild;
449
- return c(i, () => n.headerActions, Ge), i;
449
+ var i = pt(), Ze = i.firstChild;
450
+ return c(i, () => n.headerActions, Ze), i;
450
451
  }
451
452
  }), ee), c(ee, l(z, {
452
453
  get when() {
@@ -470,12 +471,12 @@ function Ht(n) {
470
471
  return d();
471
472
  },
472
473
  get fallback() {
473
- return l(ot, {
474
+ return l(at, {
474
475
  class: "w-3 h-3"
475
476
  });
476
477
  },
477
478
  get children() {
478
- return l(it, {
479
+ return l(lt, {
479
480
  class: "w-3 h-3"
480
481
  });
481
482
  }
@@ -495,16 +496,16 @@ function Ht(n) {
495
496
  return n.labels?.close ?? "Close";
496
497
  },
497
498
  get children() {
498
- return l(rt, {
499
+ return l(st, {
499
500
  class: "w-3.5 h-3.5"
500
501
  });
501
502
  }
502
- }), null), c(je, () => n.children), c(t, l(z, {
503
+ }), null), c(Qe, () => n.children), c(t, l(z, {
503
504
  get when() {
504
505
  return n.footer;
505
506
  },
506
507
  get children() {
507
- var i = yt();
508
+ var i = zt();
508
509
  return c(i, () => n.footer), i;
509
510
  }
510
511
  }), null), c(t, l(z, {
@@ -513,10 +514,10 @@ function Ht(n) {
513
514
  },
514
515
  get children() {
515
516
  return [(() => {
516
- var i = bt();
517
+ var i = $t();
517
518
  return b(i, "pointerdown", x("n"), !0), f(() => w(i, y("n"))), i;
518
519
  })(), (() => {
519
- var i = pt();
520
+ var i = _t();
520
521
  return b(i, "pointerdown", x("s"), !0), f(() => w(i, y("s"))), i;
521
522
  })(), l(z, {
522
523
  get when() {
@@ -524,22 +525,22 @@ function Ht(n) {
524
525
  },
525
526
  get children() {
526
527
  return [(() => {
527
- var i = zt();
528
+ var i = St();
528
529
  return b(i, "pointerdown", x("e"), !0), f(() => w(i, y("e"))), i;
529
530
  })(), (() => {
530
- var i = $t();
531
+ var i = Pt();
531
532
  return b(i, "pointerdown", x("w"), !0), f(() => w(i, y("w"))), i;
532
533
  })(), (() => {
533
- var i = _t();
534
+ var i = It();
534
535
  return b(i, "pointerdown", x("ne"), !0), f(() => w(i, y("ne"))), i;
535
536
  })(), (() => {
536
- var i = St();
537
+ var i = Rt();
537
538
  return b(i, "pointerdown", x("nw"), !0), f(() => w(i, y("nw"))), i;
538
539
  })(), (() => {
539
- var i = Pt();
540
+ var i = At();
540
541
  return b(i, "pointerdown", x("se"), !0), f(() => w(i, y("se"))), i;
541
542
  })(), (() => {
542
- var i = It();
543
+ var i = Ct();
543
544
  return b(i, "pointerdown", x("sw"), !0), f(() => w(i, y("sw"))), i;
544
545
  })()];
545
546
  }
@@ -551,7 +552,7 @@ function Ht(n) {
551
552
  }
552
553
  })];
553
554
  }
554
- Je(["pointerdown", "dblclick"]);
555
+ et(["pointerdown", "dblclick"]);
555
556
  export {
556
- Ht as FloatingWindow
557
+ jt as FloatingWindow
557
558
  };
@@ -26,3 +26,5 @@ export declare const LayoutProvider: (props: {
26
26
  children: import("solid-js").JSX.Element;
27
27
  }) => import("solid-js").JSX.Element, useLayout: () => LayoutContextValue, useOptionalLayout: () => LayoutContextValue | undefined;
28
28
  export declare function createLayoutService(): LayoutContextValue;
29
+ /** Standalone surfaces honor the same configuration without requiring a Shell. */
30
+ export declare function useMobileLayout(): Accessor<boolean>;
@@ -1,32 +1,40 @@
1
- import { createEffect as f } from "solid-js";
2
- import { createStore as c, produce as r } from "solid-js/store";
3
- import { createSimpleContext as u } from "./createSimpleContext.js";
4
- import { useResolvedFloeConfig as v } from "./FloeConfigContext.js";
1
+ import { createEffect as p, onCleanup as y } from "solid-js";
2
+ import { createStore as u, produce as r } from "solid-js/store";
3
+ import { createSimpleContext as g } from "./createSimpleContext.js";
4
+ import { useResolvedFloeConfig as h } from "./FloeConfigContext.js";
5
+ import { useMediaQuery as M } from "../hooks/useMediaQuery.js";
5
6
  const {
6
- Provider: x,
7
- use: C,
8
- useOptional: A
9
- } = u({
7
+ Provider: V,
8
+ use: O,
9
+ useOptional: T
10
+ } = g({
10
11
  name: "Layout",
11
- init: g
12
+ init: w
12
13
  });
13
- function g() {
14
- const n = v(), i = () => n.config.layout, p = () => typeof window > "u" ? !1 : window.matchMedia(i().mobileQuery).matches, s = n.persist.load(i().storageKey, {}), h = {
14
+ function w() {
15
+ const n = h(), i = () => n.config.layout, f = () => typeof window > "u" ? !1 : window.matchMedia(i().mobileQuery).matches, d = n.persist.load(i().storageKey, {}), v = {
15
16
  sidebar: {
16
- width: s.sidebar?.width ?? i().sidebar.defaultWidth,
17
- activeTab: (i().sidebar.persistActiveTab !== !1 ? s.sidebar?.activeTab : void 0) ?? i().sidebar.defaultActiveTab,
18
- collapsed: s.sidebar?.collapsed ?? i().sidebar.defaultCollapsed
17
+ width: d.sidebar?.width ?? i().sidebar.defaultWidth,
18
+ activeTab: (i().sidebar.persistActiveTab !== !1 ? d.sidebar?.activeTab : void 0) ?? i().sidebar.defaultActiveTab,
19
+ collapsed: d.sidebar?.collapsed ?? i().sidebar.defaultCollapsed
19
20
  },
20
21
  terminal: {
21
- opened: s.terminal?.opened ?? i().terminal.defaultOpened,
22
- height: s.terminal?.height ?? i().terminal.defaultHeight
22
+ opened: d.terminal?.opened ?? i().terminal.defaultOpened,
23
+ height: d.terminal?.height ?? i().terminal.defaultHeight
23
24
  },
24
- isMobile: p()
25
- }, [a, o] = c(h), [l, b] = c({
25
+ isMobile: f()
26
+ }, [a, o] = u(v), [l, b] = u({
26
27
  motion: "animated",
27
28
  revision: 0
28
- }), m = (e) => Math.max(i().sidebar.clamp.min, Math.min(i().sidebar.clamp.max, e));
29
- return f(() => {
29
+ }), c = (e) => Math.max(i().sidebar.clamp.min, Math.min(i().sidebar.clamp.max, e));
30
+ return p(() => {
31
+ const e = i().mobileQuery;
32
+ if (typeof window > "u") return;
33
+ const t = window.matchMedia(e);
34
+ o("isMobile", t.matches);
35
+ const s = (m) => o("isMobile", m.matches);
36
+ t.addEventListener("change", s), y(() => t.removeEventListener("change", s));
37
+ }), p(() => {
30
38
  const e = {
31
39
  sidebar: {
32
40
  width: a.sidebar.width,
@@ -48,16 +56,16 @@ function g() {
48
56
  sidebarCollapsed: () => a.sidebar.collapsed,
49
57
  sidebarVisibilityMotion: () => l.motion,
50
58
  sidebarVisibilityMotionRevision: () => l.revision,
51
- clampSidebarWidth: m,
59
+ clampSidebarWidth: c,
52
60
  // Sidebar actions
53
61
  setSidebarWidth: (e) => o(r((t) => {
54
- t.sidebar.width = m(e);
62
+ t.sidebar.width = c(e);
55
63
  })),
56
64
  setSidebarActiveTab: (e, t) => {
57
- o(r((d) => {
58
- d.sidebar.activeTab = e, t?.openSidebar !== !1 && (d.sidebar.collapsed = !1);
59
- })), t?.visibilityMotion === "instant" && b(r((d) => {
60
- d.motion = "instant", d.revision += 1;
65
+ o(r((s) => {
66
+ s.sidebar.activeTab = e, t?.openSidebar !== !1 && (s.sidebar.collapsed = !1);
67
+ })), t?.visibilityMotion === "instant" && b(r((s) => {
68
+ s.motion = "instant", s.revision += 1;
61
69
  }));
62
70
  },
63
71
  setSidebarCollapsed: (e) => o(r((t) => {
@@ -84,9 +92,14 @@ function g() {
84
92
  setIsMobile: (e) => o("isMobile", e)
85
93
  };
86
94
  }
95
+ function Q() {
96
+ const n = T(), i = h();
97
+ return n?.isMobile ?? M(() => i.config.layout.mobileQuery);
98
+ }
87
99
  export {
88
- x as LayoutProvider,
89
- g as createLayoutService,
90
- C as useLayout,
91
- A as useOptionalLayout
100
+ V as LayoutProvider,
101
+ w as createLayoutService,
102
+ O as useLayout,
103
+ Q as useMobileLayout,
104
+ T as useOptionalLayout
92
105
  };
@@ -1,7 +1,7 @@
1
1
  export { createSimpleContext } from './createSimpleContext';
2
2
  export { FloeConfigProvider, useFloeConfig, useResolvedFloeConfig, DEFAULT_FLOE_CONFIG, type FloeConfig, type FloeConfigValue, type DeepPartial, type FloeStorageAdapter, type PersistApi, } from './FloeConfigContext';
3
3
  export { ThemeProvider, useTheme, createThemeService, type ThemeContextValue } from './ThemeContext';
4
- export { LayoutProvider, useLayout, createLayoutService, type LayoutContextValue } from './LayoutContext';
4
+ export { LayoutProvider, useLayout, useMobileLayout, createLayoutService, type LayoutContextValue } from './LayoutContext';
5
5
  export { CommandProvider, useCommand, createCommandService, type Command, type CommandContextValue } from './CommandContext';
6
6
  export { NotificationProvider, useNotification, createNotificationService, NotificationContainer, type Notification, type NotificationType, type NotificationContextValue, } from './NotificationContext';
7
7
  export { ComponentRegistryProvider, useComponentRegistry, useOptionalComponentRegistry, hasComponentRegistryContext, useComponentContextFactory, createComponentRegistry, type FloeComponent, type ComponentContext, type CommandContribution, type StatusBarContribution, type ComponentRegistryValue, } from './ComponentRegistry';
package/dist/floe.css CHANGED
@@ -476,6 +476,16 @@
476
476
  --floe-floating-origin: right center;
477
477
  }
478
478
 
479
+ .floe-side-drawer-panel[data-floe-drawer-side='left'] {
480
+ border-top-left-radius: 0;
481
+ border-bottom-left-radius: 0;
482
+ border-top-right-radius: var(--radius);
483
+ border-bottom-right-radius: var(--radius);
484
+ --floe-floating-enter-x: max(-8rem, -18vw);
485
+ --floe-floating-exit-x: max(-6rem, -14vw);
486
+ --floe-floating-origin: left center;
487
+ }
488
+
479
489
  .floe-bottom-drawer-overlay {
480
490
  --floe-dialog-gap-y: 1.25rem;
481
491
  --floe-dialog-gap-x: 1.5rem;