@floegence/floe-webapp-core 0.78.10 → 0.79.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/components/layout/Shell.d.ts +2 -0
- package/dist/components/layout/Shell.js +268 -207
- package/dist/components/notes/notesOverlayHelpers.d.ts +0 -1
- package/dist/components/notes/notesOverlayHelpers.js +26 -27
- package/dist/components/notes/useNotesOverlayModel.js +196 -201
- package/dist/components/ui/Dialog.d.ts +2 -0
- package/dist/components/ui/Dialog.js +78 -74
- package/dist/components/ui/FloatingWindow.js +86 -85
- package/dist/context/LayoutContext.d.ts +2 -0
- package/dist/context/LayoutContext.js +43 -30
- package/dist/context/index.d.ts +1 -1
- package/dist/floe.css +10 -0
- package/dist/full.js +331 -328
- package/dist/hooks/createAdaptiveSidebar.d.ts +12 -0
- package/dist/hooks/createAdaptiveSidebar.js +12 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useMediaQuery.d.ts +2 -4
- package/dist/hooks/useMediaQuery.js +12 -11
- package/dist/index.js +102 -99
- package/dist/styles.css +1 -1
- package/dist/widgets/TerminalWidget.js +71 -72
- package/package.json +1 -1
|
@@ -18,6 +18,8 @@ export interface DialogProps {
|
|
|
18
18
|
class?: string;
|
|
19
19
|
/** Drawers retain the same modal, visible-viewport and surface-placement contract. */
|
|
20
20
|
presentation?: 'dialog' | 'bottom-drawer' | 'side-drawer';
|
|
21
|
+
/** Opening edge for a side drawer. Defaults to right. */
|
|
22
|
+
drawerSide?: 'left' | 'right';
|
|
21
23
|
/** Undefined uses the default header; null leaves only the accessible title. */
|
|
22
24
|
header?: JSX.Element;
|
|
23
25
|
contentClass?: string;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { createComponent as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { cn as
|
|
1
|
+
import { createComponent as o, use as G, setAttribute as u, style as ne, Portal as ae, spread as I, mergeProps as M, memo as x, insert as l, effect as D, className as q, template as h } from "solid-js/web";
|
|
2
|
+
import { createSignal as P, onMount as ie, onCleanup as E, createUniqueId as le, createEffect as K, createMemo as U, Show as g, untrack as V } from "solid-js";
|
|
3
|
+
import { cn as m } from "../../utils/cn.js";
|
|
4
4
|
import { Button as j } from "./Button.js";
|
|
5
5
|
import { X as de } from "../icons/index.js";
|
|
6
6
|
import { useResolvedFloeConfig as se } from "../../context/FloeConfigContext.js";
|
|
7
7
|
import { useOverlayMask as ce } from "../../hooks/useOverlayMask.js";
|
|
8
|
-
import { resolveSurfacePortalHost as fe, DIALOG_SURFACE_BOUNDARY_ATTR as
|
|
8
|
+
import { resolveSurfacePortalHost as fe, DIALOG_SURFACE_BOUNDARY_ATTR as k, SURFACE_PORTAL_LAYER_ATTR as ue, DIALOG_SURFACE_HOST_ATTR as ge, isSurfacePortalMode as z, projectSurfacePortalRect as me, resolveSurfacePortalBoundaryRect as he, resolveSurfacePortalMount as be } from "./dialogSurfaceScope.js";
|
|
9
9
|
import { LOCAL_INTERACTION_SURFACE_ATTR as ve } from "./localInteractionSurface.js";
|
|
10
10
|
import { createFloatingPresence as we } from "./floatingPresence.js";
|
|
11
11
|
import { useDialogPlacement as ye } from "./DialogPlacementContext.js";
|
|
12
12
|
import { observeViewport as xe, viewportStyle as pe } from "../../viewport.js";
|
|
13
13
|
import { resolveFloatingBoundary as $e } from "./surfaceFloatingBoundary.js";
|
|
14
|
-
var Ae = /* @__PURE__ */
|
|
14
|
+
var Ae = /* @__PURE__ */ h("<span aria-hidden=true>"), Ce = /* @__PURE__ */ h('<h2 class="text-sm font-semibold">'), _e = /* @__PURE__ */ h('<div data-floe-dialog-header class="flex shrink-0 items-start justify-between p-3 border-b border-border"><div>'), ke = /* @__PURE__ */ h('<p class="mb-3 shrink-0 text-[length:var(--floe-type-body)] leading-[var(--floe-line-body)] text-muted-foreground last:mb-0">'), Se = /* @__PURE__ */ h('<div data-floe-dialog-footer class="flex shrink-0 items-center justify-end gap-2 p-3 border-t border-border">'), Oe = /* @__PURE__ */ h("<div><div></div><div><div data-floe-surface=floating><div data-floe-dialog-body>"), Re = /* @__PURE__ */ h("<h2 class=sr-only>");
|
|
15
15
|
const De = {
|
|
16
16
|
display: "none"
|
|
17
17
|
};
|
|
@@ -36,51 +36,51 @@ function Be(e) {
|
|
|
36
36
|
window.clearTimeout(e);
|
|
37
37
|
}
|
|
38
38
|
function Fe(e) {
|
|
39
|
-
const
|
|
39
|
+
const p = ye(), [n, W] = P();
|
|
40
40
|
ie(() => E(xe(window, W)));
|
|
41
|
-
const c = le(),
|
|
42
|
-
let
|
|
43
|
-
const [
|
|
44
|
-
open: () => e.open && !!
|
|
41
|
+
const c = le(), T = () => `dialog-${c}-title`, H = () => `dialog-${c}-description`;
|
|
42
|
+
let B;
|
|
43
|
+
const [S, Y] = P(null), [L, X] = P(0), [J, Q] = P(0), $ = () => e.presentation === "side-drawer", f = () => e.presentation === "bottom-drawer", s = we({
|
|
44
|
+
open: () => e.open && !!S() && L() > 0,
|
|
45
45
|
get exitDurationMs() {
|
|
46
46
|
return f() ? 180 : 160;
|
|
47
47
|
}
|
|
48
|
-
}),
|
|
49
|
-
K(() => e.onPresenceChange?.(
|
|
48
|
+
}), A = () => s.mounted() && !!S() && L() > 0;
|
|
49
|
+
K(() => e.onPresenceChange?.(A())), E(() => e.onPresenceChange?.(!1));
|
|
50
50
|
const ee = (t) => {
|
|
51
51
|
Y(t), Pe(() => {
|
|
52
|
-
V(
|
|
52
|
+
V(S) === t && X((d) => d + 1);
|
|
53
53
|
});
|
|
54
|
-
}, O = U(() =>
|
|
55
|
-
owner:
|
|
54
|
+
}, O = U(() => A() ? fe({
|
|
55
|
+
owner: S()
|
|
56
56
|
}) : {
|
|
57
57
|
host: null,
|
|
58
58
|
boundaryHost: null,
|
|
59
59
|
mountHost: null,
|
|
60
60
|
mode: "global"
|
|
61
|
-
}),
|
|
61
|
+
}), C = () => `dialog-boundary-${c}`, a = () => p.mode() === "auto" && z(O()), te = () => a() ? be(O()) : void 0, N = () => e.globalZIndex ?? p.globalZIndex(), F = (t) => me($e(t, void 0, V(n)?.safeArea) ?? he(t), t), re = () => F(O()), R = U(() => (J(), n(), re())), oe = (t) => typeof Element < "u" && t instanceof Element ? !!t.closest(`[${k}="${C()}"]`) : typeof Node < "u" && t instanceof Node ? !!t.parentElement?.closest(`[${k}="${C()}"]`) : !1;
|
|
62
62
|
return K(() => {
|
|
63
63
|
const t = O();
|
|
64
|
-
if (!
|
|
64
|
+
if (!A() || !a() || typeof window > "u")
|
|
65
65
|
return;
|
|
66
|
-
let d = !1,
|
|
67
|
-
const
|
|
66
|
+
let d = !1, b = null, i = Z(F(t));
|
|
67
|
+
const v = () => {
|
|
68
68
|
if (d || !z(t))
|
|
69
69
|
return;
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
},
|
|
73
|
-
d || (
|
|
74
|
-
|
|
70
|
+
const r = Z(F(t));
|
|
71
|
+
r !== i && (i = r, Q((w) => w + 1));
|
|
72
|
+
}, _ = () => {
|
|
73
|
+
d || (b = Te(() => {
|
|
74
|
+
v(), _();
|
|
75
75
|
}));
|
|
76
76
|
};
|
|
77
|
-
|
|
78
|
-
d = !0,
|
|
77
|
+
_(), E(() => {
|
|
78
|
+
d = !0, b !== null && Be(b);
|
|
79
79
|
});
|
|
80
80
|
}), ce({
|
|
81
|
-
open:
|
|
82
|
-
root: () =>
|
|
83
|
-
containsTarget:
|
|
81
|
+
open: A,
|
|
82
|
+
root: () => B,
|
|
83
|
+
containsTarget: oe,
|
|
84
84
|
onClose: () => e.onOpenChange(!1),
|
|
85
85
|
lockBodyScroll: () => !a(),
|
|
86
86
|
trapFocus: !0,
|
|
@@ -94,17 +94,17 @@ function Fe(e) {
|
|
|
94
94
|
}), [(() => {
|
|
95
95
|
var t = Ae();
|
|
96
96
|
return G(ee, t), u(t, "data-floe-dialog-owner-anchor", c), ne(t, De), t;
|
|
97
|
-
})(),
|
|
97
|
+
})(), o(g, {
|
|
98
98
|
get when() {
|
|
99
|
-
return
|
|
99
|
+
return A();
|
|
100
100
|
},
|
|
101
101
|
get children() {
|
|
102
|
-
return
|
|
102
|
+
return o(ae, {
|
|
103
103
|
get mount() {
|
|
104
104
|
return te();
|
|
105
105
|
},
|
|
106
106
|
get children() {
|
|
107
|
-
var t =
|
|
107
|
+
var t = Oe(), d = t.firstChild, b = d.nextSibling, i = b.firstChild, v = i.firstChild;
|
|
108
108
|
u(t, "data-floe-dialog-overlay-root", c), I(t, M({
|
|
109
109
|
get "data-floe-dialog-mode"() {
|
|
110
110
|
return a() ? "surface" : "global";
|
|
@@ -122,13 +122,13 @@ function Fe(e) {
|
|
|
122
122
|
[ve]: "true"
|
|
123
123
|
}, () => ({
|
|
124
124
|
[ue]: "true",
|
|
125
|
-
[
|
|
125
|
+
[k]: C()
|
|
126
126
|
}), {
|
|
127
127
|
get class() {
|
|
128
|
-
return
|
|
128
|
+
return m(a() ? m("absolute z-20 box-border", !$() && "p-3") : m("fixed box-border p-4", N() === void 0 && "z-50"), f() && "floe-bottom-drawer-overlay", $() && "floe-side-drawer-overlay", s.exiting() && !f() && "pointer-events-none");
|
|
129
129
|
},
|
|
130
130
|
get style() {
|
|
131
|
-
return
|
|
131
|
+
return x(() => !!a())() ? {
|
|
132
132
|
left: `${R().left}px`,
|
|
133
133
|
top: `${R().top}px`,
|
|
134
134
|
width: `${R().width}px`,
|
|
@@ -149,25 +149,29 @@ function Fe(e) {
|
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
151
|
}), !1, !0), u(d, "data-floe-dialog-backdrop", c), I(d, M(() => ({
|
|
152
|
-
[
|
|
152
|
+
[k]: C()
|
|
153
153
|
}), {
|
|
154
154
|
get "data-floating-presence"() {
|
|
155
155
|
return s.state();
|
|
156
156
|
},
|
|
157
157
|
get class() {
|
|
158
|
-
return
|
|
158
|
+
return m("absolute inset-0 floe-floating-presence floe-floating-backdrop", e.closeOnBackdropClick === !1 ? "cursor-default" : "cursor-pointer", f() ? "floe-bottom-drawer-backdrop" : a() ? "bg-background/72 backdrop-blur-[2px]" : "bg-background/80 backdrop-blur-sm");
|
|
159
159
|
},
|
|
160
160
|
onClick: () => {
|
|
161
161
|
!s.exiting() && e.closeOnBackdropClick !== !1 && e.onOpenChange(!1);
|
|
162
162
|
}
|
|
163
163
|
}), !1, !1);
|
|
164
|
-
var
|
|
165
|
-
return typeof
|
|
166
|
-
|
|
164
|
+
var _ = B;
|
|
165
|
+
return typeof _ == "function" ? G(_, i) : B = i, u(i, "data-floe-dialog-panel", c), I(i, M({
|
|
166
|
+
get "data-floe-drawer-side"() {
|
|
167
|
+
return x(() => !!$())() ? e.drawerSide ?? "right" : void 0;
|
|
168
|
+
}
|
|
169
|
+
}, () => ({
|
|
170
|
+
[k]: C(),
|
|
167
171
|
[ge]: "true"
|
|
168
172
|
}), {
|
|
169
173
|
get class() {
|
|
170
|
-
return
|
|
174
|
+
return m(a() ? "flex max-h-[calc(100%-1rem)] w-[min(32rem,calc(100%-1rem))] max-w-[calc(100%-1rem)] flex-col" : "w-full max-w-md", "bg-card text-card-foreground rounded-md shadow-lg", "border border-border", "floe-floating-presence", f() ? "floe-bottom-drawer-panel" : $() ? "floe-side-drawer-panel" : "floe-floating-dialog-panel", "pointer-events-auto flex flex-col", e.class);
|
|
171
175
|
},
|
|
172
176
|
style: {
|
|
173
177
|
"max-height": "100%",
|
|
@@ -178,51 +182,51 @@ function Fe(e) {
|
|
|
178
182
|
return s.state();
|
|
179
183
|
},
|
|
180
184
|
get inert() {
|
|
181
|
-
return
|
|
185
|
+
return x(() => !!f())() && s.exiting();
|
|
182
186
|
},
|
|
183
187
|
role: "dialog",
|
|
184
188
|
get "aria-modal"() {
|
|
185
189
|
return a() ? void 0 : "true";
|
|
186
190
|
},
|
|
187
191
|
get "aria-labelledby"() {
|
|
188
|
-
return
|
|
192
|
+
return x(() => !!e.title)() ? T() : void 0;
|
|
189
193
|
},
|
|
190
194
|
get "aria-describedby"() {
|
|
191
|
-
return
|
|
195
|
+
return x(() => !!e.bodyDescription)() ? H() : void 0;
|
|
192
196
|
},
|
|
193
|
-
onKeyDown: (
|
|
197
|
+
onKeyDown: (r) => e.onKeyDown?.(r),
|
|
194
198
|
tabIndex: -1
|
|
195
|
-
}), !1, !0), l(i,
|
|
199
|
+
}), !1, !0), l(i, o(g, {
|
|
196
200
|
get when() {
|
|
197
201
|
return e.header === void 0;
|
|
198
202
|
},
|
|
199
203
|
get fallback() {
|
|
200
|
-
return [
|
|
204
|
+
return [o(g, {
|
|
201
205
|
get when() {
|
|
202
206
|
return e.title;
|
|
203
207
|
},
|
|
204
208
|
get children() {
|
|
205
|
-
var
|
|
206
|
-
return l(
|
|
209
|
+
var r = Re();
|
|
210
|
+
return l(r, () => e.title), D(() => u(r, "id", T())), r;
|
|
207
211
|
}
|
|
208
|
-
}),
|
|
212
|
+
}), x(() => e.header)];
|
|
209
213
|
},
|
|
210
214
|
get children() {
|
|
211
|
-
return
|
|
215
|
+
return o(g, {
|
|
212
216
|
get when() {
|
|
213
217
|
return e.title;
|
|
214
218
|
},
|
|
215
219
|
get children() {
|
|
216
|
-
var
|
|
217
|
-
return l(
|
|
220
|
+
var r = _e(), w = r.firstChild;
|
|
221
|
+
return l(w, o(g, {
|
|
218
222
|
get when() {
|
|
219
223
|
return e.title;
|
|
220
224
|
},
|
|
221
225
|
get children() {
|
|
222
|
-
var
|
|
223
|
-
return l(
|
|
226
|
+
var y = Ce();
|
|
227
|
+
return l(y, () => e.title), D(() => u(y, "id", T())), y;
|
|
224
228
|
}
|
|
225
|
-
})), l(
|
|
229
|
+
})), l(r, o(j, {
|
|
226
230
|
variant: "ghost-destructive",
|
|
227
231
|
size: "icon",
|
|
228
232
|
class: "-my-2 -mr-2 h-[46px] w-[46px] shrink-0 sm:my-0 sm:-mr-1 sm:h-6 sm:w-6",
|
|
@@ -231,33 +235,33 @@ function Fe(e) {
|
|
|
231
235
|
return e.closeLabel ?? "Close";
|
|
232
236
|
},
|
|
233
237
|
get children() {
|
|
234
|
-
return
|
|
238
|
+
return o(de, {
|
|
235
239
|
class: "w-3.5 h-3.5"
|
|
236
240
|
});
|
|
237
241
|
}
|
|
238
|
-
}), null),
|
|
242
|
+
}), null), r;
|
|
239
243
|
}
|
|
240
244
|
});
|
|
241
245
|
}
|
|
242
|
-
}),
|
|
246
|
+
}), v), l(v, o(g, {
|
|
243
247
|
get when() {
|
|
244
248
|
return e.bodyDescription;
|
|
245
249
|
},
|
|
246
250
|
get children() {
|
|
247
|
-
var
|
|
248
|
-
return l(
|
|
251
|
+
var r = ke();
|
|
252
|
+
return l(r, () => e.bodyDescription), D(() => u(r, "id", H())), r;
|
|
249
253
|
}
|
|
250
|
-
}), null), l(
|
|
254
|
+
}), null), l(v, () => e.children, null), l(i, o(g, {
|
|
251
255
|
get when() {
|
|
252
256
|
return e.footer;
|
|
253
257
|
},
|
|
254
258
|
get children() {
|
|
255
|
-
var
|
|
256
|
-
return l(
|
|
259
|
+
var r = Se();
|
|
260
|
+
return l(r, () => e.footer), r;
|
|
257
261
|
}
|
|
258
|
-
}), null),
|
|
259
|
-
var
|
|
260
|
-
return
|
|
262
|
+
}), null), D((r) => {
|
|
263
|
+
var w = m("pointer-events-none relative z-[1] flex h-full w-full", $() ? e.drawerSide === "left" ? "items-stretch justify-start" : "items-stretch justify-end" : f() ? "items-end justify-center" : "items-center justify-center"), y = m("min-h-0 flex-1 overflow-auto overscroll-contain p-3", e.contentClass);
|
|
264
|
+
return w !== r.e && q(b, r.e = w), y !== r.t && q(v, r.t = y), r;
|
|
261
265
|
}, {
|
|
262
266
|
e: void 0,
|
|
263
267
|
t: void 0
|
|
@@ -268,8 +272,8 @@ function Fe(e) {
|
|
|
268
272
|
})];
|
|
269
273
|
}
|
|
270
274
|
function We(e) {
|
|
271
|
-
const
|
|
272
|
-
return
|
|
275
|
+
const p = se();
|
|
276
|
+
return o(Fe, {
|
|
273
277
|
get open() {
|
|
274
278
|
return e.open;
|
|
275
279
|
},
|
|
@@ -286,16 +290,16 @@ function We(e) {
|
|
|
286
290
|
return e.globalZIndex;
|
|
287
291
|
},
|
|
288
292
|
get footer() {
|
|
289
|
-
return [
|
|
293
|
+
return [o(j, {
|
|
290
294
|
variant: "ghost",
|
|
291
295
|
onClick: () => e.onOpenChange(!1),
|
|
292
296
|
get disabled() {
|
|
293
297
|
return e.loading;
|
|
294
298
|
},
|
|
295
299
|
get children() {
|
|
296
|
-
return e.cancelText ??
|
|
300
|
+
return e.cancelText ?? p.config.strings.confirmDialog.cancel;
|
|
297
301
|
}
|
|
298
|
-
}),
|
|
302
|
+
}), o(j, {
|
|
299
303
|
get variant() {
|
|
300
304
|
return e.variant === "destructive" ? "destructive" : "primary";
|
|
301
305
|
},
|
|
@@ -306,7 +310,7 @@ function We(e) {
|
|
|
306
310
|
return e.loading;
|
|
307
311
|
},
|
|
308
312
|
get children() {
|
|
309
|
-
return e.confirmText ??
|
|
313
|
+
return e.confirmText ?? p.config.strings.confirmDialog.confirm;
|
|
310
314
|
}
|
|
311
315
|
})];
|
|
312
316
|
},
|