@floegence/floe-webapp-core 0.36.11 → 0.36.13
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/file-browser/FileContextMenu.js +263 -225
- package/dist/components/ui/Dialog.js +44 -44
- package/dist/components/ui/Dropdown.js +207 -169
- package/dist/components/ui/dialogSurfaceScope.d.ts +26 -1
- package/dist/components/ui/dialogSurfaceScope.js +81 -28
- package/dist/components/ui/menuUtils.d.ts +21 -2
- package/dist/components/ui/menuUtils.js +73 -43
- package/dist/components/ui/surfacePortalScope.d.ts +1 -0
- package/dist/components/workbench/WorkbenchContextMenu.js +32 -27
- package/dist/components/workbench/WorkbenchSurface.d.ts +3 -0
- package/dist/components/workbench/WorkbenchSurface.js +46 -35
- package/dist/components/workbench/index.d.ts +1 -1
- package/dist/components/workbench/useWorkbenchModel.d.ts +6 -0
- package/dist/components/workbench/useWorkbenchModel.js +187 -159
- package/dist/components/workbench/workbenchContextMenuDismiss.d.ts +5 -0
- package/dist/components/workbench/workbenchContextMenuDismiss.js +29 -0
- package/dist/components/workbench/workbenchHelpers.d.ts +17 -0
- package/dist/components/workbench/workbenchHelpers.js +105 -76
- package/dist/workbench.js +18 -16
- package/package.json +1 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { createComponent as n, Portal as
|
|
2
|
-
import { createUniqueId as
|
|
1
|
+
import { createComponent as n, Portal as B, setAttribute as u, spread as b, mergeProps as v, memo as T, insert as l, effect as A, template as c, use as D } from "solid-js/web";
|
|
2
|
+
import { createUniqueId as E, createMemo as M, Show as s } from "solid-js";
|
|
3
3
|
import { cn as x } from "../../utils/cn.js";
|
|
4
|
-
import { Button as
|
|
5
|
-
import { X as
|
|
6
|
-
import { useResolvedFloeConfig as
|
|
7
|
-
import { useOverlayMask as
|
|
8
|
-
import {
|
|
9
|
-
import { LOCAL_INTERACTION_SURFACE_ATTR as
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
const o =
|
|
4
|
+
import { Button as C } from "./Button.js";
|
|
5
|
+
import { X as p } from "../icons/index.js";
|
|
6
|
+
import { useResolvedFloeConfig as z } from "../../context/FloeConfigContext.js";
|
|
7
|
+
import { useOverlayMask as F } from "../../hooks/useOverlayMask.js";
|
|
8
|
+
import { resolveSurfacePortalHost as N, DIALOG_SURFACE_BOUNDARY_ATTR as g, isSurfacePortalMode as P, resolveSurfacePortalMount as U } from "./dialogSurfaceScope.js";
|
|
9
|
+
import { LOCAL_INTERACTION_SURFACE_ATTR as j } from "./localInteractionSurface.js";
|
|
10
|
+
var H = /* @__PURE__ */ c('<h2 class="text-sm font-semibold">'), L = /* @__PURE__ */ c('<p class="mt-0.5 text-xs text-muted-foreground">'), W = /* @__PURE__ */ c('<div class="flex items-start justify-between p-3 border-b border-border"><div>'), q = /* @__PURE__ */ c('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), G = /* @__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">'), X = /* @__PURE__ */ c("<div>");
|
|
11
|
+
function Y(e) {
|
|
12
|
+
const o = E(), $ = () => `dialog-${o}-title`, _ = () => `dialog-${o}-description`;
|
|
13
13
|
let m;
|
|
14
|
-
const
|
|
14
|
+
const w = M(() => e.open ? N() : {
|
|
15
15
|
host: null,
|
|
16
16
|
mode: "global"
|
|
17
|
-
}), f = () => `dialog-boundary-${o}`, t = () =>
|
|
18
|
-
return
|
|
17
|
+
}), f = () => `dialog-boundary-${o}`, t = () => P(w()), I = () => U(w()), S = (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 F({
|
|
19
19
|
open: () => e.open,
|
|
20
20
|
root: () => m,
|
|
21
|
-
containsTarget: (r) => t() &&
|
|
21
|
+
containsTarget: (r) => t() && S(r),
|
|
22
22
|
onClose: () => e.onOpenChange(!1),
|
|
23
23
|
lockBodyScroll: () => !t(),
|
|
24
24
|
trapFocus: !0,
|
|
@@ -28,28 +28,28 @@ function G(e) {
|
|
|
28
28
|
blockWheel: () => t() ? "none" : "outside",
|
|
29
29
|
blockTouchMove: () => t() ? "none" : "outside",
|
|
30
30
|
restoreFocus: !0
|
|
31
|
-
}), n(
|
|
31
|
+
}), n(s, {
|
|
32
32
|
get when() {
|
|
33
33
|
return e.open;
|
|
34
34
|
},
|
|
35
35
|
get children() {
|
|
36
|
-
return n(
|
|
36
|
+
return n(B, {
|
|
37
37
|
get mount() {
|
|
38
38
|
return I();
|
|
39
39
|
},
|
|
40
40
|
get children() {
|
|
41
|
-
var r =
|
|
42
|
-
|
|
41
|
+
var r = G(), h = r.firstChild, R = h.nextSibling, i = R.firstChild, y = i.firstChild;
|
|
42
|
+
u(r, "data-floe-dialog-overlay-root", o), b(r, v({
|
|
43
43
|
get "data-floe-dialog-mode"() {
|
|
44
44
|
return t() ? "surface" : "global";
|
|
45
45
|
}
|
|
46
46
|
}, () => ({
|
|
47
|
-
[
|
|
47
|
+
[j]: t() ? "true" : void 0
|
|
48
48
|
}), {
|
|
49
49
|
get class() {
|
|
50
50
|
return x(t() ? "absolute inset-0 z-20 p-3" : "fixed inset-0 z-50 p-4");
|
|
51
51
|
}
|
|
52
|
-
}), !1, !0),
|
|
52
|
+
}), !1, !0), u(h, "data-floe-dialog-backdrop", o), b(h, v(() => ({
|
|
53
53
|
[g]: f()
|
|
54
54
|
}), {
|
|
55
55
|
get class() {
|
|
@@ -58,7 +58,7 @@ function G(e) {
|
|
|
58
58
|
onClick: () => e.onOpenChange(!1)
|
|
59
59
|
}), !1, !1);
|
|
60
60
|
var k = m;
|
|
61
|
-
return typeof k == "function" ?
|
|
61
|
+
return typeof k == "function" ? D(k, i) : m = i, u(i, "data-floe-dialog-panel", o), b(i, v(() => ({
|
|
62
62
|
[g]: f()
|
|
63
63
|
}), {
|
|
64
64
|
get class() {
|
|
@@ -69,53 +69,53 @@ function G(e) {
|
|
|
69
69
|
return t() ? void 0 : "true";
|
|
70
70
|
},
|
|
71
71
|
get "aria-labelledby"() {
|
|
72
|
-
return T(() => !!e.title)() ?
|
|
72
|
+
return T(() => !!e.title)() ? $() : void 0;
|
|
73
73
|
},
|
|
74
74
|
get "aria-describedby"() {
|
|
75
|
-
return T(() => !!e.description)() ?
|
|
75
|
+
return T(() => !!e.description)() ? _() : void 0;
|
|
76
76
|
},
|
|
77
77
|
tabIndex: -1
|
|
78
|
-
}), !1, !0), l(i, n(
|
|
78
|
+
}), !1, !0), l(i, n(s, {
|
|
79
79
|
get when() {
|
|
80
80
|
return e.title || e.description;
|
|
81
81
|
},
|
|
82
82
|
get children() {
|
|
83
|
-
var d =
|
|
84
|
-
return l(O, n(
|
|
83
|
+
var d = W(), O = d.firstChild;
|
|
84
|
+
return l(O, n(s, {
|
|
85
85
|
get when() {
|
|
86
86
|
return e.title;
|
|
87
87
|
},
|
|
88
88
|
get children() {
|
|
89
|
-
var a =
|
|
90
|
-
return l(a, () => e.title), A(() =>
|
|
89
|
+
var a = H();
|
|
90
|
+
return l(a, () => e.title), A(() => u(a, "id", $())), a;
|
|
91
91
|
}
|
|
92
|
-
}), null), l(O, n(
|
|
92
|
+
}), null), l(O, n(s, {
|
|
93
93
|
get when() {
|
|
94
94
|
return e.description;
|
|
95
95
|
},
|
|
96
96
|
get children() {
|
|
97
|
-
var a =
|
|
98
|
-
return l(a, () => e.description), A(() =>
|
|
97
|
+
var a = L();
|
|
98
|
+
return l(a, () => e.description), A(() => u(a, "id", _())), a;
|
|
99
99
|
}
|
|
100
|
-
}), null), l(d, n(
|
|
100
|
+
}), null), l(d, n(C, {
|
|
101
101
|
variant: "ghost-destructive",
|
|
102
102
|
size: "icon",
|
|
103
103
|
class: "h-6 w-6 -mr-1",
|
|
104
104
|
onClick: () => e.onOpenChange(!1),
|
|
105
105
|
"aria-label": "Close",
|
|
106
106
|
get children() {
|
|
107
|
-
return n(
|
|
107
|
+
return n(p, {
|
|
108
108
|
class: "w-3.5 h-3.5"
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
111
|
}), null), d;
|
|
112
112
|
}
|
|
113
|
-
}), y), l(y, () => e.children), l(i, n(
|
|
113
|
+
}), y), l(y, () => e.children), l(i, n(s, {
|
|
114
114
|
get when() {
|
|
115
115
|
return e.footer;
|
|
116
116
|
},
|
|
117
117
|
get children() {
|
|
118
|
-
var d =
|
|
118
|
+
var d = q();
|
|
119
119
|
return l(d, () => e.footer), d;
|
|
120
120
|
}
|
|
121
121
|
}), null), r;
|
|
@@ -124,9 +124,9 @@ function G(e) {
|
|
|
124
124
|
}
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
|
-
function
|
|
128
|
-
const o =
|
|
129
|
-
return n(
|
|
127
|
+
function oe(e) {
|
|
128
|
+
const o = z();
|
|
129
|
+
return n(Y, {
|
|
130
130
|
get open() {
|
|
131
131
|
return e.open;
|
|
132
132
|
},
|
|
@@ -140,7 +140,7 @@ function re(e) {
|
|
|
140
140
|
return e.description;
|
|
141
141
|
},
|
|
142
142
|
get footer() {
|
|
143
|
-
return [n(
|
|
143
|
+
return [n(C, {
|
|
144
144
|
variant: "ghost",
|
|
145
145
|
onClick: () => e.onOpenChange(!1),
|
|
146
146
|
get disabled() {
|
|
@@ -149,7 +149,7 @@ function re(e) {
|
|
|
149
149
|
get children() {
|
|
150
150
|
return e.cancelText ?? o.config.strings.confirmDialog.cancel;
|
|
151
151
|
}
|
|
152
|
-
}), n(
|
|
152
|
+
}), n(C, {
|
|
153
153
|
get variant() {
|
|
154
154
|
return e.variant === "destructive" ? "destructive" : "primary";
|
|
155
155
|
},
|
|
@@ -165,11 +165,11 @@ function re(e) {
|
|
|
165
165
|
})];
|
|
166
166
|
},
|
|
167
167
|
get children() {
|
|
168
|
-
return e.children ??
|
|
168
|
+
return e.children ?? X();
|
|
169
169
|
}
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
172
|
export {
|
|
173
|
-
|
|
174
|
-
|
|
173
|
+
oe as ConfirmDialog,
|
|
174
|
+
Y as Dialog
|
|
175
175
|
};
|