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