@floegence/floe-webapp-core 0.101.30 → 0.101.34
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/ActivityBar.js +83 -78
- package/dist/components/layout/barReorder.d.ts +1 -1
- package/dist/components/layout/barReorder.js +105 -90
- package/dist/components/ui/Dialog.js +84 -83
- package/dist/components/ui/Dropdown.js +103 -103
- package/dist/components/ui/Tooltip.d.ts +3 -0
- package/dist/components/ui/Tooltip.js +77 -38
- package/dist/components/ui/dialogSurfaceScope.js +68 -67
- package/dist/components/workbench/WorkbenchFilterBar.js +135 -135
- package/dist/hooks/useOverlayMask.js +81 -80
- package/dist/utils/domScope.d.ts +6 -0
- package/dist/utils/domScope.js +30 -0
- package/package.json +1 -1
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { createComponent as r, use as
|
|
2
|
-
import { createSignal as
|
|
1
|
+
import { createComponent as r, use as K, setAttribute as f, style as ne, Portal as ae, spread as M, mergeProps as j, memo as x, insert as s, effect as D, className as N, template as m } from "solid-js/web";
|
|
2
|
+
import { createSignal as P, onMount as le, onCleanup as T, createUniqueId as ie, createEffect as E, createMemo as U, Show as u, untrack as V } from "solid-js";
|
|
3
3
|
import { cn as g } from "../../utils/cn.js";
|
|
4
|
+
import { composedClosest as de } from "../../utils/domScope.js";
|
|
4
5
|
import { Button as H } from "./Button.js";
|
|
5
|
-
import { X as
|
|
6
|
-
import { useResolvedFloeConfig as
|
|
6
|
+
import { X as se } from "../icons/index.js";
|
|
7
|
+
import { useResolvedFloeConfig as ce } from "../../context/FloeConfigContext.js";
|
|
7
8
|
import { useOverlayMask as fe } from "../../hooks/useOverlayMask.js";
|
|
8
|
-
import { resolveSurfacePortalHost as
|
|
9
|
-
import { LOCAL_INTERACTION_SURFACE_ATTR as
|
|
9
|
+
import { resolveSurfacePortalHost as ue, DIALOG_SURFACE_BOUNDARY_ATTR as F, SURFACE_PORTAL_LAYER_ATTR as ge, DIALOG_SURFACE_HOST_ATTR as me, isSurfacePortalMode as z, projectSurfacePortalRect as he, resolveSurfacePortalBoundaryRect as ve, resolveSurfacePortalMount as be } from "./dialogSurfaceScope.js";
|
|
10
|
+
import { LOCAL_INTERACTION_SURFACE_ATTR as we } from "./localInteractionSurface.js";
|
|
10
11
|
import { createFloatingPresence as ye } from "./floatingPresence.js";
|
|
11
|
-
import { observeDialogHeight as
|
|
12
|
-
import { useDialogPlacement as
|
|
13
|
-
import { observeViewport as
|
|
12
|
+
import { observeDialogHeight as pe } from "./dialogHeightMotion.js";
|
|
13
|
+
import { useDialogPlacement as xe } from "./DialogPlacementContext.js";
|
|
14
|
+
import { observeViewport as $e, viewportStyle as Ce } from "../../viewport.js";
|
|
14
15
|
import { resolveFloatingBoundary as Ae } from "./surfaceFloatingBoundary.js";
|
|
15
|
-
var
|
|
16
|
-
const
|
|
16
|
+
var _e = /* @__PURE__ */ m("<span aria-hidden=true>"), ke = /* @__PURE__ */ m('<h2 class="text-[length:var(--floe-type-heading-sm)] font-semibold leading-[var(--floe-line-heading)] tracking-[var(--floe-tracking-tight)] text-[var(--floe-ink)]">'), Se = /* @__PURE__ */ m('<div data-floe-dialog-header class="flex shrink-0 items-start justify-between gap-[var(--floe-gap-control)] px-[var(--floe-pad-group)] py-[var(--floe-pad-control)] border-b border-[var(--floe-line)]"><div>'), Oe = /* @__PURE__ */ m('<p class="mb-3 shrink-0 text-[length:var(--floe-type-body)] leading-[var(--floe-line-body)] text-[var(--floe-ink-soft)] last:mb-0">'), Re = /* @__PURE__ */ m('<div data-floe-dialog-footer class="flex shrink-0 items-center justify-end gap-[var(--floe-gap-control)] px-[var(--floe-pad-group)] py-[var(--floe-pad-control)] border-t border-[var(--floe-line)]">'), De = /* @__PURE__ */ m("<div><div></div><div><div data-floe-surface=floating><div data-floe-dialog-body>"), Pe = /* @__PURE__ */ m("<h2 class=sr-only>");
|
|
17
|
+
const Te = {
|
|
17
18
|
display: "none"
|
|
18
19
|
};
|
|
19
|
-
function
|
|
20
|
+
function Fe(e) {
|
|
20
21
|
if (typeof queueMicrotask == "function") {
|
|
21
22
|
queueMicrotask(e);
|
|
22
23
|
return;
|
|
@@ -29,61 +30,61 @@ function Z(e) {
|
|
|
29
30
|
function Be(e) {
|
|
30
31
|
return typeof window < "u" && typeof window.requestAnimationFrame == "function" ? window.requestAnimationFrame(e) : window.setTimeout(() => e(Date.now()), 16);
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
+
function Ie(e) {
|
|
33
34
|
if (typeof window < "u" && typeof window.cancelAnimationFrame == "function") {
|
|
34
35
|
window.cancelAnimationFrame(e);
|
|
35
36
|
return;
|
|
36
37
|
}
|
|
37
38
|
window.clearTimeout(e);
|
|
38
39
|
}
|
|
39
|
-
function
|
|
40
|
-
const $ =
|
|
41
|
-
le(() =>
|
|
42
|
-
const
|
|
43
|
-
let
|
|
44
|
-
const [
|
|
45
|
-
open: () => e.open && !!
|
|
46
|
-
element: () =>
|
|
47
|
-
}), v = () => i.mounted() && !!
|
|
48
|
-
|
|
49
|
-
const t =
|
|
50
|
-
!t || l !== "open" || !v() ||
|
|
40
|
+
function Me(e) {
|
|
41
|
+
const $ = xe(), [n, W] = P();
|
|
42
|
+
le(() => T($e(window, W)));
|
|
43
|
+
const c = ie(), B = () => `dialog-${c}-title`, L = () => `dialog-${c}-description`;
|
|
44
|
+
let C;
|
|
45
|
+
const [k, Y] = P(null), [G, X] = P(0), [J, Q] = P(0), A = () => e.presentation === "side-drawer", h = () => e.presentation === "bottom-drawer", i = ye({
|
|
46
|
+
open: () => e.open && !!k() && G() > 0,
|
|
47
|
+
element: () => C
|
|
48
|
+
}), v = () => i.mounted() && !!k() && G() > 0;
|
|
49
|
+
E(() => {
|
|
50
|
+
const t = C, l = i.state();
|
|
51
|
+
!t || l !== "open" || !v() || T(pe(t, {
|
|
51
52
|
isSettled: () => i.state() === "open"
|
|
52
53
|
}));
|
|
53
|
-
}),
|
|
54
|
+
}), E(() => e.onPresenceChange?.(v())), T(() => e.onPresenceChange?.(!1));
|
|
54
55
|
const ee = (t) => {
|
|
55
|
-
Y(t),
|
|
56
|
-
V(
|
|
56
|
+
Y(t), Fe(() => {
|
|
57
|
+
V(k) === t && X((l) => l + 1);
|
|
57
58
|
});
|
|
58
|
-
},
|
|
59
|
-
owner:
|
|
59
|
+
}, S = U(() => v() ? ue({
|
|
60
|
+
owner: k()
|
|
60
61
|
}) : {
|
|
61
62
|
host: null,
|
|
62
63
|
boundaryHost: null,
|
|
63
64
|
mountHost: null,
|
|
64
65
|
mode: "global"
|
|
65
|
-
}),
|
|
66
|
-
return
|
|
67
|
-
const t =
|
|
66
|
+
}), O = () => `dialog-boundary-${c}`, a = () => $.mode() === "auto" && z(S()), te = () => a() ? be(S()) : void 0, q = () => e.globalZIndex ?? $.globalZIndex(), I = (t) => he(Ae(t, void 0, V(n)?.safeArea) ?? ve(t), t), oe = () => I(S()), R = U(() => (J(), n(), oe())), re = (t) => !!de(t, `[${F}="${O()}"]`);
|
|
67
|
+
return E(() => {
|
|
68
|
+
const t = S();
|
|
68
69
|
if (!v() || !a() || typeof window > "u")
|
|
69
70
|
return;
|
|
70
71
|
let l = !1, b = null, d = Z(I(t));
|
|
71
|
-
const
|
|
72
|
+
const w = () => {
|
|
72
73
|
if (l || !z(t))
|
|
73
74
|
return;
|
|
74
75
|
const o = Z(I(t));
|
|
75
|
-
o !== d && (d = o, Q((
|
|
76
|
-
},
|
|
76
|
+
o !== d && (d = o, Q((y) => y + 1));
|
|
77
|
+
}, _ = () => {
|
|
77
78
|
l || (b = Be(() => {
|
|
78
|
-
|
|
79
|
+
w(), _();
|
|
79
80
|
}));
|
|
80
81
|
};
|
|
81
|
-
|
|
82
|
-
l = !0, b !== null &&
|
|
82
|
+
_(), T(() => {
|
|
83
|
+
l = !0, b !== null && Ie(b);
|
|
83
84
|
});
|
|
84
85
|
}), fe({
|
|
85
86
|
open: v,
|
|
86
|
-
root: () =>
|
|
87
|
+
root: () => C,
|
|
87
88
|
containsTarget: re,
|
|
88
89
|
onClose: () => e.onOpenChange(!1),
|
|
89
90
|
lockBodyScroll: () => !a(),
|
|
@@ -96,8 +97,8 @@ function Ie(e) {
|
|
|
96
97
|
blockTouchMove: () => a() ? "none" : "outside",
|
|
97
98
|
restoreFocus: !0
|
|
98
99
|
}), [(() => {
|
|
99
|
-
var t =
|
|
100
|
-
return
|
|
100
|
+
var t = _e();
|
|
101
|
+
return K(ee, t), f(t, "data-floe-dialog-owner-anchor", c), ne(t, Te), t;
|
|
101
102
|
})(), r(u, {
|
|
102
103
|
get when() {
|
|
103
104
|
return v();
|
|
@@ -108,8 +109,8 @@ function Ie(e) {
|
|
|
108
109
|
return te();
|
|
109
110
|
},
|
|
110
111
|
get children() {
|
|
111
|
-
var t =
|
|
112
|
-
|
|
112
|
+
var t = De(), l = t.firstChild, b = l.nextSibling, d = b.firstChild, w = d.firstChild;
|
|
113
|
+
f(t, "data-floe-dialog-overlay-root", c), M(t, j({
|
|
113
114
|
get "data-floe-dialog-mode"() {
|
|
114
115
|
return a() ? "surface" : "global";
|
|
115
116
|
},
|
|
@@ -123,22 +124,22 @@ function Ie(e) {
|
|
|
123
124
|
return i.exiting() ? "true" : void 0;
|
|
124
125
|
}
|
|
125
126
|
}, {
|
|
126
|
-
[
|
|
127
|
+
[we]: "true"
|
|
127
128
|
}, () => ({
|
|
128
|
-
[
|
|
129
|
-
[
|
|
129
|
+
[ge]: "true",
|
|
130
|
+
[F]: O()
|
|
130
131
|
}), {
|
|
131
132
|
get class() {
|
|
132
|
-
return g(a() ? g("absolute z-20 box-border", !
|
|
133
|
+
return g(a() ? g("absolute z-20 box-border", !A() && "p-3") : g("fixed box-border p-4", q() === void 0 && "z-50"), h() && "floe-bottom-drawer-overlay", A() && "floe-side-drawer-overlay", i.exiting() && !h() && "pointer-events-none");
|
|
133
134
|
},
|
|
134
135
|
get style() {
|
|
135
136
|
return x(() => !!a())() ? {
|
|
136
|
-
left: `${
|
|
137
|
-
top: `${
|
|
138
|
-
width: `${
|
|
139
|
-
height: `${
|
|
137
|
+
left: `${R().left}px`,
|
|
138
|
+
top: `${R().top}px`,
|
|
139
|
+
width: `${R().width}px`,
|
|
140
|
+
height: `${R().height}px`
|
|
140
141
|
} : {
|
|
141
|
-
...n() ?
|
|
142
|
+
...n() ? Ce(n()) : {
|
|
142
143
|
inset: "0"
|
|
143
144
|
},
|
|
144
145
|
"--floe-dialog-safe-top": `${(n()?.safeArea.top ?? 0) / (n()?.fixedScale ?? 1)}px`,
|
|
@@ -149,11 +150,11 @@ function Ie(e) {
|
|
|
149
150
|
"padding-right": "max(var(--floe-dialog-gap-x, 1rem), var(--floe-dialog-safe-right))",
|
|
150
151
|
"padding-bottom": "max(var(--floe-dialog-gap-y, 1rem), var(--floe-dialog-safe-bottom))",
|
|
151
152
|
"padding-left": "max(var(--floe-dialog-gap-x, 1rem), var(--floe-dialog-safe-left))",
|
|
152
|
-
"z-index":
|
|
153
|
+
"z-index": q()
|
|
153
154
|
};
|
|
154
155
|
}
|
|
155
|
-
}), !1, !0),
|
|
156
|
-
[
|
|
156
|
+
}), !1, !0), f(l, "data-floe-dialog-backdrop", c), M(l, j(() => ({
|
|
157
|
+
[F]: O()
|
|
157
158
|
}), {
|
|
158
159
|
get "data-floating-presence"() {
|
|
159
160
|
return i.state();
|
|
@@ -165,17 +166,17 @@ function Ie(e) {
|
|
|
165
166
|
!i.exiting() && e.closeOnBackdropClick !== !1 && e.onOpenChange(!1);
|
|
166
167
|
}
|
|
167
168
|
}), !1, !1);
|
|
168
|
-
var
|
|
169
|
-
return typeof
|
|
169
|
+
var _ = C;
|
|
170
|
+
return typeof _ == "function" ? K(_, d) : C = d, f(d, "data-floe-dialog-panel", c), M(d, j({
|
|
170
171
|
get "data-floe-drawer-side"() {
|
|
171
|
-
return x(() => !!
|
|
172
|
+
return x(() => !!A())() ? e.drawerSide ?? "right" : void 0;
|
|
172
173
|
}
|
|
173
174
|
}, () => ({
|
|
174
|
-
[
|
|
175
|
-
[
|
|
175
|
+
[F]: O(),
|
|
176
|
+
[me]: "true"
|
|
176
177
|
}), {
|
|
177
178
|
get class() {
|
|
178
|
-
return g(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-popover text-popover-foreground rounded-panel shadow-[var(--floe-elevation-float-strong)]", "border border-[var(--floe-line)]", "floe-floating-presence", h() ? "floe-bottom-drawer-panel" :
|
|
179
|
+
return g(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-popover text-popover-foreground rounded-panel shadow-[var(--floe-elevation-float-strong)]", "border border-[var(--floe-line)]", "floe-floating-presence", h() ? "floe-bottom-drawer-panel" : A() ? "floe-side-drawer-panel" : "floe-floating-dialog-panel", "pointer-events-auto flex flex-col", e.class);
|
|
179
180
|
},
|
|
180
181
|
style: {
|
|
181
182
|
"max-height": "100%",
|
|
@@ -193,7 +194,7 @@ function Ie(e) {
|
|
|
193
194
|
return a() ? void 0 : "true";
|
|
194
195
|
},
|
|
195
196
|
get "aria-labelledby"() {
|
|
196
|
-
return x(() => !!e.title)() ?
|
|
197
|
+
return x(() => !!e.title)() ? B() : void 0;
|
|
197
198
|
},
|
|
198
199
|
get "aria-describedby"() {
|
|
199
200
|
return x(() => !!e.bodyDescription)() ? L() : void 0;
|
|
@@ -210,8 +211,8 @@ function Ie(e) {
|
|
|
210
211
|
return e.title;
|
|
211
212
|
},
|
|
212
213
|
get children() {
|
|
213
|
-
var o =
|
|
214
|
-
return s(o, () => e.title),
|
|
214
|
+
var o = Pe();
|
|
215
|
+
return s(o, () => e.title), D(() => f(o, "id", B())), o;
|
|
215
216
|
}
|
|
216
217
|
}), x(() => e.header)];
|
|
217
218
|
},
|
|
@@ -221,14 +222,14 @@ function Ie(e) {
|
|
|
221
222
|
return e.title;
|
|
222
223
|
},
|
|
223
224
|
get children() {
|
|
224
|
-
var o =
|
|
225
|
-
return s(
|
|
225
|
+
var o = Se(), y = o.firstChild;
|
|
226
|
+
return s(y, r(u, {
|
|
226
227
|
get when() {
|
|
227
228
|
return e.title;
|
|
228
229
|
},
|
|
229
230
|
get children() {
|
|
230
|
-
var p =
|
|
231
|
-
return s(p, () => e.title),
|
|
231
|
+
var p = ke();
|
|
232
|
+
return s(p, () => e.title), D(() => f(p, "id", B())), p;
|
|
232
233
|
}
|
|
233
234
|
})), s(o, r(H, {
|
|
234
235
|
variant: "ghost-destructive",
|
|
@@ -239,7 +240,7 @@ function Ie(e) {
|
|
|
239
240
|
return e.closeLabel ?? "Close";
|
|
240
241
|
},
|
|
241
242
|
get children() {
|
|
242
|
-
return r(
|
|
243
|
+
return r(se, {
|
|
243
244
|
class: "w-3.5 h-3.5"
|
|
244
245
|
});
|
|
245
246
|
}
|
|
@@ -247,25 +248,25 @@ function Ie(e) {
|
|
|
247
248
|
}
|
|
248
249
|
});
|
|
249
250
|
}
|
|
250
|
-
}),
|
|
251
|
+
}), w), s(w, r(u, {
|
|
251
252
|
get when() {
|
|
252
253
|
return e.bodyDescription;
|
|
253
254
|
},
|
|
254
255
|
get children() {
|
|
255
|
-
var o =
|
|
256
|
-
return s(o, () => e.bodyDescription),
|
|
256
|
+
var o = Oe();
|
|
257
|
+
return s(o, () => e.bodyDescription), D(() => f(o, "id", L())), o;
|
|
257
258
|
}
|
|
258
|
-
}), null), s(
|
|
259
|
+
}), null), s(w, () => e.children, null), s(d, r(u, {
|
|
259
260
|
get when() {
|
|
260
261
|
return e.footer;
|
|
261
262
|
},
|
|
262
263
|
get children() {
|
|
263
|
-
var o =
|
|
264
|
+
var o = Re();
|
|
264
265
|
return s(o, () => e.footer), o;
|
|
265
266
|
}
|
|
266
|
-
}), null),
|
|
267
|
-
var
|
|
268
|
-
return
|
|
267
|
+
}), null), D((o) => {
|
|
268
|
+
var y = g("pointer-events-none relative z-[1] flex h-full w-full", A() ? e.drawerSide === "left" ? "items-stretch justify-start" : "items-stretch justify-end" : h() ? "items-end justify-center" : "items-center justify-center"), p = g("min-h-0 flex-1 overflow-auto overscroll-contain px-[var(--floe-pad-group)] py-[var(--floe-pad-group)] [&.overflow-auto]:[scrollbar-gutter:stable]", e.contentClass);
|
|
269
|
+
return y !== o.e && N(b, o.e = y), p !== o.t && N(w, o.t = p), o;
|
|
269
270
|
}, {
|
|
270
271
|
e: void 0,
|
|
271
272
|
t: void 0
|
|
@@ -275,9 +276,9 @@ function Ie(e) {
|
|
|
275
276
|
}
|
|
276
277
|
})];
|
|
277
278
|
}
|
|
278
|
-
function
|
|
279
|
-
const $ =
|
|
280
|
-
return r(
|
|
279
|
+
function Qe(e) {
|
|
280
|
+
const $ = ce();
|
|
281
|
+
return r(Me, {
|
|
281
282
|
get open() {
|
|
282
283
|
return e.open;
|
|
283
284
|
},
|
|
@@ -324,6 +325,6 @@ function Xe(e) {
|
|
|
324
325
|
});
|
|
325
326
|
}
|
|
326
327
|
export {
|
|
327
|
-
|
|
328
|
-
|
|
328
|
+
Qe as ConfirmDialog,
|
|
329
|
+
Me as Dialog
|
|
329
330
|
};
|