@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.
- package/dist/components/deck/DeckCell.js +4 -4
- package/dist/components/ui/Dialog.js +115 -87
- package/dist/components/ui/FloatingWindow.js +158 -144
- package/dist/components/ui/dialogSurfaceScope.d.ts +14 -0
- package/dist/components/ui/dialogSurfaceScope.js +45 -0
- package/dist/components/workbench/WorkbenchCanvas.js +54 -60
- package/dist/components/workbench/WorkbenchCanvasField.d.ts +25 -0
- package/dist/components/workbench/WorkbenchCanvasField.js +145 -0
- package/dist/components/workbench/WorkbenchWidget.d.ts +10 -2
- package/dist/components/workbench/WorkbenchWidget.js +74 -74
- package/dist/hooks/useOverlayMask.d.ts +11 -9
- package/dist/hooks/useOverlayMask.js +54 -52
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -6,9 +6,9 @@ import { useWidgetRegistry as R } from "../../context/WidgetRegistry.js";
|
|
|
6
6
|
import { WidgetStateProvider as k } from "../../context/WidgetStateContext.js";
|
|
7
7
|
import { positionToGridArea as $ } from "../../utils/gridLayout.js";
|
|
8
8
|
import { WidgetFrame as M } from "./WidgetFrame.js";
|
|
9
|
-
var _ = /* @__PURE__ */ l("<div>"), A = /* @__PURE__ */ l('<div class="h-full flex items-center justify-center text-muted-foreground text-xs"><span>Widget: ');
|
|
9
|
+
var _ = /* @__PURE__ */ l("<div data-floe-dialog-surface-host=true>"), A = /* @__PURE__ */ l('<div class="h-full flex items-center justify-center text-muted-foreground text-xs"><span>Widget: ');
|
|
10
10
|
function q(e) {
|
|
11
|
-
const i = z(), g = R(),
|
|
11
|
+
const i = z(), g = R(), f = () => i.editMode(), o = () => e.widget.type, a = d(() => g.getWidget(o())), m = d(() => $(e.position)), w = () => i.getWidgetState(e.widget.id), h = (t, r) => {
|
|
12
12
|
i.updateWidgetState(e.widget.id, t, r);
|
|
13
13
|
}, s = () => a()?.component, v = d(() => {
|
|
14
14
|
if (!e.isDragging || !e.pixelOffset) return {};
|
|
@@ -66,7 +66,7 @@ function q(e) {
|
|
|
66
66
|
return e.widget.config;
|
|
67
67
|
},
|
|
68
68
|
get isEditMode() {
|
|
69
|
-
return
|
|
69
|
+
return f();
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
72
|
}
|
|
@@ -86,7 +86,7 @@ function q(e) {
|
|
|
86
86
|
"select-none",
|
|
87
87
|
e.isDragging && "cursor-grabbing"
|
|
88
88
|
), y = {
|
|
89
|
-
"grid-area":
|
|
89
|
+
"grid-area": m(),
|
|
90
90
|
...v()
|
|
91
91
|
};
|
|
92
92
|
return c !== r.e && W(t, r.e = c), r.t = S(t, y, r.t), r;
|
|
@@ -1,98 +1,127 @@
|
|
|
1
|
-
import { createComponent as n, Portal as
|
|
2
|
-
import { createUniqueId as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { X as
|
|
6
|
-
import { useResolvedFloeConfig as
|
|
7
|
-
import { useOverlayMask as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { createComponent as n, Portal as z, setAttribute as c, spread as O, mergeProps as B, memo as D, insert as a, effect as x, className as A, template as s, use as E } from "solid-js/web";
|
|
2
|
+
import { createUniqueId as M, createMemo as R, Show as f } from "solid-js";
|
|
3
|
+
import { cn as C } from "../../utils/cn.js";
|
|
4
|
+
import { Button as $ } from "./Button.js";
|
|
5
|
+
import { X as F } from "../icons/index.js";
|
|
6
|
+
import { useResolvedFloeConfig as N } from "../../context/FloeConfigContext.js";
|
|
7
|
+
import { useOverlayMask as j } from "../../hooks/useOverlayMask.js";
|
|
8
|
+
import { resolveDialogSurfaceHost as H, DIALOG_SURFACE_BOUNDARY_ATTR as m } from "./dialogSurfaceScope.js";
|
|
9
|
+
var U = /* @__PURE__ */ s('<h2 class="text-sm font-semibold">'), P = /* @__PURE__ */ s('<p class="mt-0.5 text-xs text-muted-foreground">'), W = /* @__PURE__ */ s('<div class="flex items-start justify-between p-3 border-b border-border"><div>'), q = /* @__PURE__ */ s('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), G = /* @__PURE__ */ s('<div><div></div><div class="relative z-[1] flex h-full w-full items-center justify-center"><div><div class="flex-1 overflow-auto overscroll-contain p-3">'), L = /* @__PURE__ */ s("<div>");
|
|
10
|
+
function X(e) {
|
|
11
|
+
const i = M(), _ = () => `dialog-${i}-title`, w = () => `dialog-${i}-description`;
|
|
12
|
+
let h;
|
|
13
|
+
const v = R(() => e.open ? H() : {
|
|
14
|
+
host: null,
|
|
15
|
+
mode: "global"
|
|
16
|
+
}), g = () => `dialog-boundary-${i}`, o = () => v().mode === "surface" && !!v().host?.isConnected, I = () => v().host ?? void 0, S = (t) => typeof Element < "u" && t instanceof Element ? !!t.closest(`[${m}="${g()}"]`) : typeof Node < "u" && t instanceof Node ? !!t.parentElement?.closest(`[${m}="${g()}"]`) : !1;
|
|
17
|
+
return j({
|
|
13
18
|
open: () => e.open,
|
|
14
|
-
root: () =>
|
|
19
|
+
root: () => h,
|
|
20
|
+
containsTarget: (t) => o() && S(t),
|
|
15
21
|
onClose: () => e.onOpenChange(!1),
|
|
16
|
-
lockBodyScroll: !
|
|
22
|
+
lockBodyScroll: () => !o(),
|
|
17
23
|
trapFocus: !0,
|
|
18
|
-
closeOnEscape: !0,
|
|
24
|
+
closeOnEscape: () => o() ? "inside" : !0,
|
|
19
25
|
blockHotkeys: !0,
|
|
20
26
|
// Block scroll bleed outside the dialog while keeping the dialog content scrollable.
|
|
21
|
-
blockWheel: "outside",
|
|
22
|
-
blockTouchMove: "outside",
|
|
27
|
+
blockWheel: () => o() ? "none" : "outside",
|
|
28
|
+
blockTouchMove: () => o() ? "none" : "outside",
|
|
23
29
|
restoreFocus: !0
|
|
24
|
-
}), n(
|
|
30
|
+
}), n(f, {
|
|
25
31
|
get when() {
|
|
26
32
|
return e.open;
|
|
27
33
|
},
|
|
28
34
|
get children() {
|
|
29
|
-
return n(
|
|
35
|
+
return n(z, {
|
|
36
|
+
get mount() {
|
|
37
|
+
return I();
|
|
38
|
+
},
|
|
30
39
|
get children() {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
40
|
+
var t = G(), b = t.firstChild, T = b.nextSibling, d = T.firstChild, y = d.firstChild;
|
|
41
|
+
c(t, "data-floe-dialog-overlay-root", i), c(b, "data-floe-dialog-backdrop", i), O(b, B(() => ({
|
|
42
|
+
[m]: g()
|
|
43
|
+
}), {
|
|
44
|
+
get class() {
|
|
45
|
+
return C("absolute inset-0 cursor-pointer animate-in fade-in", o() ? "bg-background/72 backdrop-blur-[2px]" : "bg-background/80 backdrop-blur-sm");
|
|
46
|
+
},
|
|
47
|
+
onClick: () => e.onOpenChange(!1)
|
|
48
|
+
}), !1, !1);
|
|
49
|
+
var k = h;
|
|
50
|
+
return typeof k == "function" ? E(k, d) : h = d, c(d, "data-floe-dialog-panel", i), O(d, B(() => ({
|
|
51
|
+
[m]: g()
|
|
52
|
+
}), {
|
|
53
|
+
get class() {
|
|
54
|
+
return C(o() ? "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", "animate-in fade-in zoom-in-95", "flex flex-col", e.class);
|
|
55
|
+
},
|
|
56
|
+
role: "dialog",
|
|
57
|
+
get "aria-modal"() {
|
|
58
|
+
return o() ? void 0 : "true";
|
|
59
|
+
},
|
|
60
|
+
get "aria-labelledby"() {
|
|
61
|
+
return D(() => !!e.title)() ? _() : void 0;
|
|
62
|
+
},
|
|
63
|
+
get "aria-describedby"() {
|
|
64
|
+
return D(() => !!e.description)() ? w() : void 0;
|
|
65
|
+
},
|
|
66
|
+
tabIndex: -1
|
|
67
|
+
}), !1, !0), a(d, n(f, {
|
|
68
|
+
get when() {
|
|
69
|
+
return e.title || e.description;
|
|
70
|
+
},
|
|
71
|
+
get children() {
|
|
72
|
+
var r = W(), u = r.firstChild;
|
|
73
|
+
return a(u, n(f, {
|
|
74
|
+
get when() {
|
|
75
|
+
return e.title;
|
|
76
|
+
},
|
|
77
|
+
get children() {
|
|
78
|
+
var l = U();
|
|
79
|
+
return a(l, () => e.title), x(() => c(l, "id", _())), l;
|
|
80
|
+
}
|
|
81
|
+
}), null), a(u, n(f, {
|
|
82
|
+
get when() {
|
|
83
|
+
return e.description;
|
|
84
|
+
},
|
|
85
|
+
get children() {
|
|
86
|
+
var l = P();
|
|
87
|
+
return a(l, () => e.description), x(() => c(l, "id", w())), l;
|
|
88
|
+
}
|
|
89
|
+
}), null), a(r, n($, {
|
|
90
|
+
variant: "ghost-destructive",
|
|
91
|
+
size: "icon",
|
|
92
|
+
class: "h-6 w-6 -mr-1",
|
|
93
|
+
onClick: () => e.onOpenChange(!1),
|
|
94
|
+
"aria-label": "Close",
|
|
95
|
+
get children() {
|
|
96
|
+
return n(F, {
|
|
97
|
+
class: "w-3.5 h-3.5"
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}), null), r;
|
|
101
|
+
}
|
|
102
|
+
}), y), a(y, () => e.children), a(d, n(f, {
|
|
103
|
+
get when() {
|
|
104
|
+
return e.footer;
|
|
105
|
+
},
|
|
106
|
+
get children() {
|
|
107
|
+
var r = q();
|
|
108
|
+
return a(r, () => e.footer), r;
|
|
109
|
+
}
|
|
110
|
+
}), null), x((r) => {
|
|
111
|
+
var u = o() ? "surface" : "global", l = C(o() ? "absolute inset-0 z-20 p-3" : "fixed inset-0 z-50 p-4");
|
|
112
|
+
return u !== r.e && c(t, "data-floe-dialog-mode", r.e = u), l !== r.t && A(t, r.t = l), r;
|
|
113
|
+
}, {
|
|
114
|
+
e: void 0,
|
|
115
|
+
t: void 0
|
|
116
|
+
}), t;
|
|
88
117
|
}
|
|
89
118
|
});
|
|
90
119
|
}
|
|
91
120
|
});
|
|
92
121
|
}
|
|
93
|
-
function
|
|
94
|
-
const
|
|
95
|
-
return n(
|
|
122
|
+
function te(e) {
|
|
123
|
+
const i = N();
|
|
124
|
+
return n(X, {
|
|
96
125
|
get open() {
|
|
97
126
|
return e.open;
|
|
98
127
|
},
|
|
@@ -106,16 +135,16 @@ function W(e) {
|
|
|
106
135
|
return e.description;
|
|
107
136
|
},
|
|
108
137
|
get footer() {
|
|
109
|
-
return [n(
|
|
138
|
+
return [n($, {
|
|
110
139
|
variant: "ghost",
|
|
111
140
|
onClick: () => e.onOpenChange(!1),
|
|
112
141
|
get disabled() {
|
|
113
142
|
return e.loading;
|
|
114
143
|
},
|
|
115
144
|
get children() {
|
|
116
|
-
return e.cancelText ??
|
|
145
|
+
return e.cancelText ?? i.config.strings.confirmDialog.cancel;
|
|
117
146
|
}
|
|
118
|
-
}), n(
|
|
147
|
+
}), n($, {
|
|
119
148
|
get variant() {
|
|
120
149
|
return e.variant === "destructive" ? "destructive" : "primary";
|
|
121
150
|
},
|
|
@@ -126,17 +155,16 @@ function W(e) {
|
|
|
126
155
|
return e.loading;
|
|
127
156
|
},
|
|
128
157
|
get children() {
|
|
129
|
-
return e.confirmText ??
|
|
158
|
+
return e.confirmText ?? i.config.strings.confirmDialog.confirm;
|
|
130
159
|
}
|
|
131
160
|
})];
|
|
132
161
|
},
|
|
133
162
|
get children() {
|
|
134
|
-
return e.children ??
|
|
163
|
+
return e.children ?? L();
|
|
135
164
|
}
|
|
136
165
|
});
|
|
137
166
|
}
|
|
138
|
-
w(["click"]);
|
|
139
167
|
export {
|
|
140
|
-
|
|
141
|
-
|
|
168
|
+
te as ConfirmDialog,
|
|
169
|
+
X as Dialog
|
|
142
170
|
};
|