@floegence/floe-webapp-core 0.1.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/app/FloeApp.d.ts +37 -0
- package/dist/app/FloeProvider.d.ts +17 -0
- package/dist/app/index.d.ts +2 -0
- package/dist/components/deck/DeckCell.d.ts +17 -0
- package/dist/components/deck/DeckGrid.d.ts +14 -0
- package/dist/components/deck/DeckTopBar.d.ts +9 -0
- package/dist/components/deck/DropZonePreview.d.ts +10 -0
- package/dist/components/deck/LayoutSelector.d.ts +7 -0
- package/dist/components/deck/WidgetFrame.d.ts +14 -0
- package/dist/components/deck/WidgetPalette.d.ts +7 -0
- package/dist/components/deck/WidgetResizeHandle.d.ts +9 -0
- package/dist/components/deck/WidgetTypeSwitcher.d.ts +9 -0
- package/dist/components/deck/index.d.ts +9 -0
- package/dist/components/icons/index.d.ts +29 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/launchpad/Launchpad.d.ts +15 -0
- package/dist/components/launchpad/LaunchpadGrid.d.ts +8 -0
- package/dist/components/launchpad/LaunchpadItem.d.ts +18 -0
- package/dist/components/launchpad/LaunchpadPagination.d.ts +6 -0
- package/dist/components/launchpad/LaunchpadSearch.d.ts +6 -0
- package/dist/components/launchpad/index.d.ts +10 -0
- package/dist/components/layout/ActivityBar.d.ts +24 -0
- package/dist/components/layout/BottomBar.d.ts +27 -0
- package/dist/components/layout/MobileTabBar.d.ts +19 -0
- package/dist/components/layout/Panel.d.ts +27 -0
- package/dist/components/layout/ResizeHandle.d.ts +9 -0
- package/dist/components/layout/Shell.d.ts +23 -0
- package/dist/components/layout/Sidebar.d.ts +33 -0
- package/dist/components/layout/TopBar.d.ts +11 -0
- package/dist/components/layout/index.d.ts +9 -0
- package/dist/components/loading/LoadingOverlay.d.ts +10 -0
- package/dist/components/loading/Skeleton.d.ts +21 -0
- package/dist/components/loading/SnakeLoader.d.ts +9 -0
- package/dist/components/loading/index.d.ts +3 -0
- package/dist/components/ui/Button.d.ts +12 -0
- package/dist/components/ui/Card.d.ts +79 -0
- package/dist/components/ui/CommandPalette.d.ts +4 -0
- package/dist/components/ui/Dialog.d.ts +29 -0
- package/dist/components/ui/Dropdown.d.ts +35 -0
- package/dist/components/ui/FloatingWindow.d.ts +45 -0
- package/dist/components/ui/Input.d.ts +16 -0
- package/dist/components/ui/Tooltip.d.ts +12 -0
- package/dist/components/ui/index.d.ts +8 -0
- package/dist/context/CommandContext.d.ts +30 -0
- package/dist/context/ComponentRegistry.d.ts +90 -0
- package/dist/context/DeckContext.d.ts +88 -0
- package/dist/context/FloeConfigContext.d.ts +133 -0
- package/dist/context/LayoutContext.d.ts +20 -0
- package/dist/context/NotificationContext.d.ts +32 -0
- package/dist/context/ThemeContext.d.ts +12 -0
- package/dist/context/WidgetRegistry.d.ts +37 -0
- package/dist/context/createSimpleContext.d.ts +15 -0
- package/dist/context/index.d.ts +9 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/useDebounce.d.ts +5 -0
- package/dist/hooks/useDeckDrag.d.ts +6 -0
- package/dist/hooks/useKeybind.d.ts +4 -0
- package/dist/hooks/useMediaQuery.d.ts +5 -0
- package/dist/hooks/usePersisted.d.ts +5 -0
- package/dist/hooks/useResizeObserver.d.ts +9 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +226 -0
- package/dist/index10.js +92 -0
- package/dist/index11.js +101 -0
- package/dist/index12.js +113 -0
- package/dist/index13.js +82 -0
- package/dist/index14.js +123 -0
- package/dist/index15.js +106 -0
- package/dist/index16.js +131 -0
- package/dist/index17.js +152 -0
- package/dist/index18.js +41 -0
- package/dist/index19.js +61 -0
- package/dist/index2.js +215 -0
- package/dist/index20.js +79 -0
- package/dist/index21.js +162 -0
- package/dist/index22.js +293 -0
- package/dist/index23.js +136 -0
- package/dist/index24.js +45 -0
- package/dist/index25.js +146 -0
- package/dist/index26.js +258 -0
- package/dist/index27.js +92 -0
- package/dist/index28.js +42 -0
- package/dist/index29.js +71 -0
- package/dist/index3.js +94 -0
- package/dist/index30.js +280 -0
- package/dist/index31.js +154 -0
- package/dist/index32.js +31 -0
- package/dist/index33.js +50 -0
- package/dist/index34.js +15 -0
- package/dist/index35.js +32 -0
- package/dist/index36.js +51 -0
- package/dist/index37.js +41 -0
- package/dist/index38.js +28 -0
- package/dist/index39.js +176 -0
- package/dist/index4.js +55 -0
- package/dist/index40.js +43 -0
- package/dist/index41.js +69 -0
- package/dist/index42.js +99 -0
- package/dist/index43.js +120 -0
- package/dist/index44.js +141 -0
- package/dist/index45.js +42 -0
- package/dist/index46.js +386 -0
- package/dist/index47.js +16 -0
- package/dist/index48.js +13 -0
- package/dist/index49.js +19 -0
- package/dist/index5.js +48 -0
- package/dist/index50.js +13 -0
- package/dist/index51.js +11 -0
- package/dist/index52.js +59 -0
- package/dist/index53.js +8 -0
- package/dist/index54.js +6 -0
- package/dist/index55.js +48 -0
- package/dist/index56.js +29 -0
- package/dist/index57.js +35 -0
- package/dist/index58.js +94 -0
- package/dist/index59.js +25 -0
- package/dist/index6.js +73 -0
- package/dist/index60.js +49 -0
- package/dist/index61.js +17 -0
- package/dist/index62.js +38 -0
- package/dist/index63.js +67 -0
- package/dist/index64.js +87 -0
- package/dist/index65.js +17 -0
- package/dist/index66.js +2266 -0
- package/dist/index7.js +112 -0
- package/dist/index8.js +66 -0
- package/dist/index9.js +33 -0
- package/dist/styles/build.d.ts +1 -0
- package/dist/styles/themes/index.d.ts +9 -0
- package/dist/styles.css +1 -0
- package/dist/styles.js +1 -0
- package/dist/utils/animations.d.ts +222 -0
- package/dist/utils/bodyStyleLock.d.ts +9 -0
- package/dist/utils/cn.d.ts +5 -0
- package/dist/utils/defer.d.ts +5 -0
- package/dist/utils/gridCollision.d.ts +31 -0
- package/dist/utils/gridLayout.d.ts +38 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/keybind.d.ts +22 -0
- package/dist/utils/persist.d.ts +17 -0
- package/dist/widgets/MetricsWidget.d.ts +5 -0
- package/dist/widgets/SidebarWidget.d.ts +11 -0
- package/dist/widgets/TerminalWidget.d.ts +5 -0
- package/dist/widgets/index.d.ts +3 -0
- package/package.json +40 -0
package/dist/index22.js
ADDED
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { delegateEvents as ve, createComponent as l, Portal as ze, template as D, insert as f, effect as s, setAttribute as oe, addEventListener as m, className as a, memo as be, setStyleProperty as E, use as ye } from "solid-js/web";
|
|
2
|
+
import { createUniqueId as pe, createSignal as M, onMount as Se, createEffect as le, onCleanup as Me, Show as W } from "solid-js";
|
|
3
|
+
import { cn as q } from "./index53.js";
|
|
4
|
+
import { Button as se } from "./index19.js";
|
|
5
|
+
import { Restore as $e, Maximize as Pe, X as Ie } from "./index30.js";
|
|
6
|
+
import { lockBodyStyle as Ce } from "./index57.js";
|
|
7
|
+
var _e = /* @__PURE__ */ D('<h2 class="text-sm font-medium truncate select-none">'), Ee = /* @__PURE__ */ D('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), x = /* @__PURE__ */ D("<div style=touch-action:none>"), We = /* @__PURE__ */ D('<div role=dialog aria-modal=true><div style=touch-action:none><div class="flex-1 min-w-0"></div><div class="flex items-center gap-0.5 -mr-1"></div></div><div class="flex-1 overflow-auto p-3">');
|
|
8
|
+
function Fe(i) {
|
|
9
|
+
const T = () => i.resizable ?? !0, U = () => i.draggable ?? !0, H = () => i.minSize ?? {
|
|
10
|
+
width: 200,
|
|
11
|
+
height: 150
|
|
12
|
+
}, X = () => i.maxSize ?? {
|
|
13
|
+
width: 1 / 0,
|
|
14
|
+
height: 1 / 0
|
|
15
|
+
}, ae = () => i.zIndex ?? 100, de = pe(), j = () => `floating-window-${de}-title`, [$, P] = M(i.defaultPosition ?? {
|
|
16
|
+
x: 0,
|
|
17
|
+
y: 0
|
|
18
|
+
}), [y, A] = M(i.defaultSize ?? {
|
|
19
|
+
width: 400,
|
|
20
|
+
height: 300
|
|
21
|
+
}), [d, G] = M(!1), [ue, N] = M(!1), [ce, Z] = M(!1), [he, we] = M(null);
|
|
22
|
+
let F = {
|
|
23
|
+
x: 0,
|
|
24
|
+
y: 0
|
|
25
|
+
}, L = {
|
|
26
|
+
x: 0,
|
|
27
|
+
y: 0
|
|
28
|
+
}, O = {
|
|
29
|
+
x: 0,
|
|
30
|
+
y: 0
|
|
31
|
+
}, v = {
|
|
32
|
+
width: 0,
|
|
33
|
+
height: 0
|
|
34
|
+
}, I = {
|
|
35
|
+
x: 0,
|
|
36
|
+
y: 0
|
|
37
|
+
}, C = "se", r, u = null, c = null, _ = {
|
|
38
|
+
x: 0,
|
|
39
|
+
y: 0
|
|
40
|
+
}, p = null, h = null;
|
|
41
|
+
const ge = {
|
|
42
|
+
n: "ns-resize",
|
|
43
|
+
s: "ns-resize",
|
|
44
|
+
e: "ew-resize",
|
|
45
|
+
w: "ew-resize",
|
|
46
|
+
ne: "nesw-resize",
|
|
47
|
+
nw: "nwse-resize",
|
|
48
|
+
se: "nwse-resize",
|
|
49
|
+
sw: "nesw-resize"
|
|
50
|
+
}, R = (t, n) => {
|
|
51
|
+
if (!t) {
|
|
52
|
+
h == null || h(), h = null;
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
h == null || h(), h = Ce({
|
|
56
|
+
cursor: n,
|
|
57
|
+
"user-select": "none"
|
|
58
|
+
});
|
|
59
|
+
}, B = (t) => {
|
|
60
|
+
if (p !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(p), p = null), t !== void 0)
|
|
61
|
+
try {
|
|
62
|
+
r == null || r.releasePointerCapture(t);
|
|
63
|
+
} catch {
|
|
64
|
+
}
|
|
65
|
+
u = null, c = null, N(!1), Z(!1), R(!1, "");
|
|
66
|
+
};
|
|
67
|
+
Se(() => {
|
|
68
|
+
if (!i.defaultPosition) {
|
|
69
|
+
const t = window.innerWidth, n = window.innerHeight, o = y();
|
|
70
|
+
P({
|
|
71
|
+
x: Math.max(0, (t - o.width) / 2),
|
|
72
|
+
y: Math.max(0, (n - o.height) / 2)
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}), le(() => {
|
|
76
|
+
if (!i.open) return;
|
|
77
|
+
const t = (n) => {
|
|
78
|
+
n.key === "Escape" && i.onOpenChange(!1);
|
|
79
|
+
};
|
|
80
|
+
document.addEventListener("keydown", t), Me(() => document.removeEventListener("keydown", t));
|
|
81
|
+
}), le(() => {
|
|
82
|
+
i.open || B(u ?? void 0);
|
|
83
|
+
});
|
|
84
|
+
const fe = (t) => {
|
|
85
|
+
if (!U() || d() || t.pointerType === "mouse" && t.button !== 0) return;
|
|
86
|
+
const n = t.target;
|
|
87
|
+
n != null && n.closest('button, input, select, textarea, a, [role="button"]') || (t.preventDefault(), u = t.pointerId, c = "drag", N(!0), F = {
|
|
88
|
+
x: t.clientX,
|
|
89
|
+
y: t.clientY
|
|
90
|
+
}, L = {
|
|
91
|
+
...$()
|
|
92
|
+
}, _ = {
|
|
93
|
+
x: t.clientX,
|
|
94
|
+
y: t.clientY
|
|
95
|
+
}, R(!0, "grabbing"), r == null || r.setPointerCapture(t.pointerId));
|
|
96
|
+
}, w = (t) => (n) => {
|
|
97
|
+
!T() || d() || n.pointerType === "mouse" && n.button !== 0 || (n.preventDefault(), n.stopPropagation(), u = n.pointerId, c = "resize", Z(!0), C = t, O = {
|
|
98
|
+
x: n.clientX,
|
|
99
|
+
y: n.clientY
|
|
100
|
+
}, v = {
|
|
101
|
+
...y()
|
|
102
|
+
}, I = {
|
|
103
|
+
...$()
|
|
104
|
+
}, _ = {
|
|
105
|
+
x: n.clientX,
|
|
106
|
+
y: n.clientY
|
|
107
|
+
}, R(!0, ge[t]), r == null || r.setPointerCapture(n.pointerId));
|
|
108
|
+
}, J = () => {
|
|
109
|
+
if (p = null, !i.open || u === null || c === null) return;
|
|
110
|
+
const t = _.x - (c === "drag" ? F.x : O.x), n = _.y - (c === "drag" ? F.y : O.y);
|
|
111
|
+
if (c === "drag") {
|
|
112
|
+
const e = y(), Y = Math.max(0, Math.min(window.innerWidth - e.width, L.x + t)), k = Math.max(0, Math.min(window.innerHeight - e.height, L.y + n));
|
|
113
|
+
P({
|
|
114
|
+
x: Y,
|
|
115
|
+
y: k
|
|
116
|
+
});
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
let o = v.width, z = v.height, S = I.x, b = I.y;
|
|
120
|
+
if (C.includes("e") && (o = Math.max(H().width, Math.min(X().width, v.width + t))), C.includes("w")) {
|
|
121
|
+
const e = v.width - t;
|
|
122
|
+
e >= H().width && e <= X().width && (o = e, S = I.x + t);
|
|
123
|
+
}
|
|
124
|
+
if (C.includes("s") && (z = Math.max(H().height, Math.min(X().height, v.height + n))), C.includes("n")) {
|
|
125
|
+
const e = v.height - n;
|
|
126
|
+
e >= H().height && e <= X().height && (z = e, b = I.y + n);
|
|
127
|
+
}
|
|
128
|
+
S = Math.max(0, Math.min(window.innerWidth - o, S)), b = Math.max(0, Math.min(window.innerHeight - z, b)), A({
|
|
129
|
+
width: o,
|
|
130
|
+
height: z
|
|
131
|
+
}), P({
|
|
132
|
+
x: S,
|
|
133
|
+
y: b
|
|
134
|
+
});
|
|
135
|
+
}, me = (t) => {
|
|
136
|
+
if (!(u === null || t.pointerId !== u) && c !== null && (_ = {
|
|
137
|
+
x: t.clientX,
|
|
138
|
+
y: t.clientY
|
|
139
|
+
}, p === null)) {
|
|
140
|
+
if (typeof requestAnimationFrame > "u") {
|
|
141
|
+
J();
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
p = requestAnimationFrame(J);
|
|
145
|
+
}
|
|
146
|
+
}, K = (t) => {
|
|
147
|
+
u === null || t.pointerId !== u || B(t.pointerId);
|
|
148
|
+
}, Q = () => {
|
|
149
|
+
if (d()) {
|
|
150
|
+
const t = he();
|
|
151
|
+
t && (P(t.position), A(t.size)), G(!1);
|
|
152
|
+
} else
|
|
153
|
+
we({
|
|
154
|
+
position: $(),
|
|
155
|
+
size: y()
|
|
156
|
+
}), P({
|
|
157
|
+
x: 0,
|
|
158
|
+
y: 0
|
|
159
|
+
}), A({
|
|
160
|
+
width: window.innerWidth,
|
|
161
|
+
height: window.innerHeight
|
|
162
|
+
}), G(!0);
|
|
163
|
+
}, xe = () => {
|
|
164
|
+
Q();
|
|
165
|
+
}, g = (t) => q("absolute z-10", {
|
|
166
|
+
n: "cursor-ns-resize top-0 left-2 right-2 h-1",
|
|
167
|
+
s: "cursor-ns-resize bottom-0 left-2 right-2 h-1",
|
|
168
|
+
e: "cursor-ew-resize right-0 top-2 bottom-2 w-1",
|
|
169
|
+
w: "cursor-ew-resize left-0 top-2 bottom-2 w-1",
|
|
170
|
+
ne: "cursor-nesw-resize top-0 right-0 w-2 h-2",
|
|
171
|
+
nw: "cursor-nwse-resize top-0 left-0 w-2 h-2",
|
|
172
|
+
se: "cursor-nwse-resize bottom-0 right-0 w-2 h-2",
|
|
173
|
+
sw: "cursor-nesw-resize bottom-0 left-0 w-2 h-2"
|
|
174
|
+
}[t]);
|
|
175
|
+
return l(W, {
|
|
176
|
+
get when() {
|
|
177
|
+
return i.open;
|
|
178
|
+
},
|
|
179
|
+
get children() {
|
|
180
|
+
return l(ze, {
|
|
181
|
+
get children() {
|
|
182
|
+
var t = We(), n = t.firstChild, o = n.firstChild, z = o.nextSibling, S = n.nextSibling;
|
|
183
|
+
t.addEventListener("pointercancel", K), t.$$pointerup = K, t.$$pointermove = me;
|
|
184
|
+
var b = r;
|
|
185
|
+
return typeof b == "function" ? ye(b, t) : r = t, n.$$dblclick = xe, n.$$pointerdown = fe, f(o, l(W, {
|
|
186
|
+
get when() {
|
|
187
|
+
return i.title;
|
|
188
|
+
},
|
|
189
|
+
get children() {
|
|
190
|
+
var e = _e();
|
|
191
|
+
return f(e, () => i.title), s(() => oe(e, "id", j())), e;
|
|
192
|
+
}
|
|
193
|
+
})), f(z, l(se, {
|
|
194
|
+
variant: "ghost",
|
|
195
|
+
size: "icon",
|
|
196
|
+
class: "h-6 w-6",
|
|
197
|
+
onClick: (e) => {
|
|
198
|
+
e.stopPropagation(), Q();
|
|
199
|
+
},
|
|
200
|
+
get "aria-label"() {
|
|
201
|
+
return d() ? "Restore" : "Maximize";
|
|
202
|
+
},
|
|
203
|
+
get children() {
|
|
204
|
+
return l(W, {
|
|
205
|
+
get when() {
|
|
206
|
+
return d();
|
|
207
|
+
},
|
|
208
|
+
get fallback() {
|
|
209
|
+
return l(Pe, {
|
|
210
|
+
class: "w-3 h-3"
|
|
211
|
+
});
|
|
212
|
+
},
|
|
213
|
+
get children() {
|
|
214
|
+
return l($e, {
|
|
215
|
+
class: "w-3 h-3"
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
}), null), f(z, l(se, {
|
|
221
|
+
variant: "ghost",
|
|
222
|
+
size: "icon",
|
|
223
|
+
class: "h-6 w-6 hover:bg-error hover:text-error-foreground",
|
|
224
|
+
onClick: (e) => {
|
|
225
|
+
e.stopPropagation(), i.onOpenChange(!1);
|
|
226
|
+
},
|
|
227
|
+
"aria-label": "Close",
|
|
228
|
+
get children() {
|
|
229
|
+
return l(Ie, {
|
|
230
|
+
class: "w-3.5 h-3.5"
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
}), null), f(S, () => i.children), f(t, l(W, {
|
|
234
|
+
get when() {
|
|
235
|
+
return i.footer;
|
|
236
|
+
},
|
|
237
|
+
get children() {
|
|
238
|
+
var e = Ee();
|
|
239
|
+
return f(e, () => i.footer), e;
|
|
240
|
+
}
|
|
241
|
+
}), null), f(t, l(W, {
|
|
242
|
+
get when() {
|
|
243
|
+
return be(() => !!T())() && !d();
|
|
244
|
+
},
|
|
245
|
+
get children() {
|
|
246
|
+
return [(() => {
|
|
247
|
+
var e = x();
|
|
248
|
+
return m(e, "pointerdown", w("n"), !0), s(() => a(e, g("n"))), e;
|
|
249
|
+
})(), (() => {
|
|
250
|
+
var e = x();
|
|
251
|
+
return m(e, "pointerdown", w("s"), !0), s(() => a(e, g("s"))), e;
|
|
252
|
+
})(), (() => {
|
|
253
|
+
var e = x();
|
|
254
|
+
return m(e, "pointerdown", w("e"), !0), s(() => a(e, g("e"))), e;
|
|
255
|
+
})(), (() => {
|
|
256
|
+
var e = x();
|
|
257
|
+
return m(e, "pointerdown", w("w"), !0), s(() => a(e, g("w"))), e;
|
|
258
|
+
})(), (() => {
|
|
259
|
+
var e = x();
|
|
260
|
+
return m(e, "pointerdown", w("ne"), !0), s(() => a(e, g("ne"))), e;
|
|
261
|
+
})(), (() => {
|
|
262
|
+
var e = x();
|
|
263
|
+
return m(e, "pointerdown", w("nw"), !0), s(() => a(e, g("nw"))), e;
|
|
264
|
+
})(), (() => {
|
|
265
|
+
var e = x();
|
|
266
|
+
return m(e, "pointerdown", w("se"), !0), s(() => a(e, g("se"))), e;
|
|
267
|
+
})(), (() => {
|
|
268
|
+
var e = x();
|
|
269
|
+
return m(e, "pointerdown", w("sw"), !0), s(() => a(e, g("sw"))), e;
|
|
270
|
+
})()];
|
|
271
|
+
}
|
|
272
|
+
}), null), s((e) => {
|
|
273
|
+
var Y = q("fixed bg-card text-card-foreground rounded-md shadow-xl", "border border-border", "flex flex-col", "animate-in fade-in zoom-in-95", d() && "rounded-none", (ue() || ce()) && "select-none", i.class), k = `${$().x}px`, V = `${$().y}px`, ee = `${y().width}px`, te = `${y().height}px`, ne = ae(), ie = i.title ? j() : void 0, re = q("flex items-center justify-between h-9 px-3", "border-b border-border", "bg-muted/50", d() ? "rounded-none" : "rounded-t-md", U() && !d() && "cursor-move");
|
|
274
|
+
return Y !== e.e && a(t, e.e = Y), k !== e.t && E(t, "left", e.t = k), V !== e.a && E(t, "top", e.a = V), ee !== e.o && E(t, "width", e.o = ee), te !== e.i && E(t, "height", e.i = te), ne !== e.n && E(t, "z-index", e.n = ne), ie !== e.s && oe(t, "aria-labelledby", e.s = ie), re !== e.h && a(n, e.h = re), e;
|
|
275
|
+
}, {
|
|
276
|
+
e: void 0,
|
|
277
|
+
t: void 0,
|
|
278
|
+
a: void 0,
|
|
279
|
+
o: void 0,
|
|
280
|
+
i: void 0,
|
|
281
|
+
n: void 0,
|
|
282
|
+
s: void 0,
|
|
283
|
+
h: void 0
|
|
284
|
+
}), t;
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
ve(["pointermove", "pointerup", "pointerdown", "dblclick"]);
|
|
291
|
+
export {
|
|
292
|
+
Fe as FloatingWindow
|
|
293
|
+
};
|
package/dist/index23.js
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { delegateEvents as k, template as f, insert as s, createComponent as d, effect as b, className as g, use as x } from "solid-js/web";
|
|
2
|
+
import { createSignal as _, createEffect as p, onCleanup as C, Show as h, For as S } from "solid-js";
|
|
3
|
+
import { cn as v } from "./index53.js";
|
|
4
|
+
import { deferNonBlocking as E } from "./index54.js";
|
|
5
|
+
import { ChevronDown as L, Check as j } from "./index30.js";
|
|
6
|
+
var D = /* @__PURE__ */ f("<div role=menu>"), O = /* @__PURE__ */ f("<div><div class=cursor-pointer>"), N = /* @__PURE__ */ f('<div class="my-1 h-px bg-border"role=separator>'), R = /* @__PURE__ */ f('<button type=button role=menuitem><span class="w-3.5 h-3.5 flex items-center justify-center"></span><span class="flex-1 text-left">'), z = /* @__PURE__ */ f('<span class="w-3.5 h-3.5 flex items-center justify-center">'), B = /* @__PURE__ */ f("<button type=button><span>");
|
|
7
|
+
function F(e) {
|
|
8
|
+
const [o, c] = _(!1);
|
|
9
|
+
let t, r;
|
|
10
|
+
p(() => {
|
|
11
|
+
if (!o()) return;
|
|
12
|
+
const l = (a) => {
|
|
13
|
+
t && !t.contains(a.target) && r && !r.contains(a.target) && c(!1);
|
|
14
|
+
}, i = (a) => {
|
|
15
|
+
a.key === "Escape" && c(!1);
|
|
16
|
+
};
|
|
17
|
+
document.addEventListener("mousedown", l), document.addEventListener("keydown", i), C(() => {
|
|
18
|
+
document.removeEventListener("mousedown", l), document.removeEventListener("keydown", i);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
const n = {
|
|
22
|
+
start: "left-0",
|
|
23
|
+
center: "left-1/2 -translate-x-1/2",
|
|
24
|
+
end: "right-0"
|
|
25
|
+
};
|
|
26
|
+
return (() => {
|
|
27
|
+
var l = O(), i = l.firstChild;
|
|
28
|
+
i.$$click = () => c((u) => !u);
|
|
29
|
+
var a = t;
|
|
30
|
+
return typeof a == "function" ? x(a, i) : t = i, s(i, () => e.trigger), s(l, d(h, {
|
|
31
|
+
get when() {
|
|
32
|
+
return o();
|
|
33
|
+
},
|
|
34
|
+
get children() {
|
|
35
|
+
var u = D(), w = r;
|
|
36
|
+
return typeof w == "function" ? x(w, u) : r = u, s(u, d(S, {
|
|
37
|
+
get each() {
|
|
38
|
+
return e.items;
|
|
39
|
+
},
|
|
40
|
+
children: (m) => d(h, {
|
|
41
|
+
get when() {
|
|
42
|
+
return !m.separator;
|
|
43
|
+
},
|
|
44
|
+
get fallback() {
|
|
45
|
+
return N();
|
|
46
|
+
},
|
|
47
|
+
get children() {
|
|
48
|
+
return d(I, {
|
|
49
|
+
item: m,
|
|
50
|
+
get selected() {
|
|
51
|
+
return e.value === m.id;
|
|
52
|
+
},
|
|
53
|
+
onSelect: () => {
|
|
54
|
+
if (!m.disabled) {
|
|
55
|
+
const y = m.id, $ = e.onSelect;
|
|
56
|
+
c(!1), E(() => $(y));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
})), b(() => g(u, v("absolute z-50 mt-1 min-w-36 py-0.5", "bg-popover text-popover-foreground", "rounded border border-border shadow-md", "animate-in fade-in slide-in-from-top-2", n[e.align ?? "start"]))), u;
|
|
63
|
+
}
|
|
64
|
+
}), null), b(() => g(l, v("relative inline-block", e.class))), l;
|
|
65
|
+
})();
|
|
66
|
+
}
|
|
67
|
+
function I(e) {
|
|
68
|
+
return (() => {
|
|
69
|
+
var o = R(), c = o.firstChild, t = c.nextSibling;
|
|
70
|
+
return o.$$click = () => e.onSelect(), s(c, d(h, {
|
|
71
|
+
get when() {
|
|
72
|
+
return e.selected;
|
|
73
|
+
},
|
|
74
|
+
get children() {
|
|
75
|
+
return d(j, {
|
|
76
|
+
class: "w-3 h-3"
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
})), s(o, d(h, {
|
|
80
|
+
get when() {
|
|
81
|
+
return e.item.icon;
|
|
82
|
+
},
|
|
83
|
+
keyed: !0,
|
|
84
|
+
children: (r) => (() => {
|
|
85
|
+
var n = z();
|
|
86
|
+
return s(n, r), n;
|
|
87
|
+
})()
|
|
88
|
+
}), t), s(t, () => e.item.label), b((r) => {
|
|
89
|
+
var n = v("w-full flex items-center gap-1.5 px-2 py-1 text-xs", "transition-colors duration-75", "focus:outline-none focus:bg-accent", e.item.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-accent cursor-pointer"), l = e.item.disabled;
|
|
90
|
+
return n !== r.e && g(o, r.e = n), l !== r.t && (o.disabled = r.t = l), r;
|
|
91
|
+
}, {
|
|
92
|
+
e: void 0,
|
|
93
|
+
t: void 0
|
|
94
|
+
}), o;
|
|
95
|
+
})();
|
|
96
|
+
}
|
|
97
|
+
function J(e) {
|
|
98
|
+
const o = () => e.options.find((t) => t.value === e.value), c = () => e.options.map((t) => ({
|
|
99
|
+
id: t.value,
|
|
100
|
+
label: t.label
|
|
101
|
+
}));
|
|
102
|
+
return d(F, {
|
|
103
|
+
get trigger() {
|
|
104
|
+
return (() => {
|
|
105
|
+
var t = B(), r = t.firstChild;
|
|
106
|
+
return s(r, () => {
|
|
107
|
+
var n;
|
|
108
|
+
return ((n = o()) == null ? void 0 : n.label) ?? e.placeholder ?? "Select...";
|
|
109
|
+
}), s(t, d(L, {
|
|
110
|
+
class: "w-3.5 h-3.5 text-muted-foreground"
|
|
111
|
+
}), null), b((n) => {
|
|
112
|
+
var l = v("flex items-center justify-between gap-2 h-8 px-2.5 w-full cursor-pointer", "rounded border border-input bg-background text-xs shadow-sm", "transition-colors duration-100", "focus:outline-none focus:ring-1 focus:ring-ring", "disabled:cursor-not-allowed disabled:opacity-50", e.class), i = e.disabled, a = v(!o() && "text-muted-foreground");
|
|
113
|
+
return l !== n.e && g(t, n.e = l), i !== n.t && (t.disabled = n.t = i), a !== n.a && g(r, n.a = a), n;
|
|
114
|
+
}, {
|
|
115
|
+
e: void 0,
|
|
116
|
+
t: void 0,
|
|
117
|
+
a: void 0
|
|
118
|
+
}), t;
|
|
119
|
+
})();
|
|
120
|
+
},
|
|
121
|
+
get items() {
|
|
122
|
+
return c();
|
|
123
|
+
},
|
|
124
|
+
get value() {
|
|
125
|
+
return e.value;
|
|
126
|
+
},
|
|
127
|
+
get onSelect() {
|
|
128
|
+
return e.onChange;
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
k(["click"]);
|
|
133
|
+
export {
|
|
134
|
+
F as Dropdown,
|
|
135
|
+
J as Select
|
|
136
|
+
};
|
package/dist/index24.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { delegateEvents as x, template as b, insert as n, createComponent as g, effect as y, className as u } from "solid-js/web";
|
|
2
|
+
import { createSignal as w, Show as $ } from "solid-js";
|
|
3
|
+
import { cn as m } from "./index53.js";
|
|
4
|
+
var S = /* @__PURE__ */ b("<div role=tooltip><div>"), E = /* @__PURE__ */ b('<div class="relative inline-block">');
|
|
5
|
+
function C(e) {
|
|
6
|
+
const [c, a] = w(!1);
|
|
7
|
+
let l;
|
|
8
|
+
const s = () => {
|
|
9
|
+
l = setTimeout(() => a(!0), e.delay ?? 300);
|
|
10
|
+
}, i = () => {
|
|
11
|
+
l && clearTimeout(l), a(!1);
|
|
12
|
+
}, v = {
|
|
13
|
+
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
14
|
+
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
15
|
+
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
16
|
+
right: "left-full top-1/2 -translate-y-1/2 ml-2"
|
|
17
|
+
}, h = {
|
|
18
|
+
top: "top-full left-1/2 -translate-x-1/2 border-t-popover border-x-transparent border-b-transparent",
|
|
19
|
+
bottom: "bottom-full left-1/2 -translate-x-1/2 border-b-popover border-x-transparent border-t-transparent",
|
|
20
|
+
left: "left-full top-1/2 -translate-y-1/2 border-l-popover border-y-transparent border-r-transparent",
|
|
21
|
+
right: "right-full top-1/2 -translate-y-1/2 border-r-popover border-y-transparent border-l-transparent"
|
|
22
|
+
};
|
|
23
|
+
return (() => {
|
|
24
|
+
var t = E();
|
|
25
|
+
return t.$$focusout = i, t.$$focusin = s, t.addEventListener("mouseleave", i), t.addEventListener("mouseenter", s), n(t, () => e.children, null), n(t, g($, {
|
|
26
|
+
get when() {
|
|
27
|
+
return c();
|
|
28
|
+
},
|
|
29
|
+
get children() {
|
|
30
|
+
var o = S(), d = o.firstChild;
|
|
31
|
+
return n(o, () => e.content, d), y((r) => {
|
|
32
|
+
var p = m("absolute z-50 px-2 py-1", "bg-popover text-popover-foreground text-xs rounded shadow-md", "whitespace-nowrap", "animate-in fade-in zoom-in-95", v[e.placement ?? "top"], e.class), f = m("absolute w-0 h-0 border-4", h[e.placement ?? "top"]);
|
|
33
|
+
return p !== r.e && u(o, r.e = p), f !== r.t && u(d, r.t = f), r;
|
|
34
|
+
}, {
|
|
35
|
+
e: void 0,
|
|
36
|
+
t: void 0
|
|
37
|
+
}), o;
|
|
38
|
+
}
|
|
39
|
+
}), null), t;
|
|
40
|
+
})();
|
|
41
|
+
}
|
|
42
|
+
x(["focusin", "focusout"]);
|
|
43
|
+
export {
|
|
44
|
+
C as Tooltip
|
|
45
|
+
};
|
package/dist/index25.js
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { delegateEvents as M, createComponent as i, Portal as O, template as c, insert as l, use as L, Dynamic as z, effect as y, className as C, setAttribute as F } from "solid-js/web";
|
|
2
|
+
import { createSignal as I, createEffect as w, onCleanup as S, createMemo as K, Show as g, For as D } from "solid-js";
|
|
3
|
+
import { cn as E } from "./index53.js";
|
|
4
|
+
import { useCommand as R } from "./index42.js";
|
|
5
|
+
import { Search as j } from "./index30.js";
|
|
6
|
+
import { lockBodyStyle as B } from "./index57.js";
|
|
7
|
+
import { useResolvedFloeConfig as N } from "./index39.js";
|
|
8
|
+
var T = /* @__PURE__ */ c('<div class="fixed inset-0 z-50 bg-background/60 backdrop-blur-sm animate-in fade-in">'), U = /* @__PURE__ */ c('<div><div class="flex items-center gap-3 px-4 pt-1 border-b border-border"><input type=text><kbd class="text-xs text-muted-foreground px-1.5 py-0.5 rounded bg-muted font-mono"></kbd></div><div class="max-h-80 overflow-y-auto py-2">'), q = /* @__PURE__ */ c('<div class="px-4 py-8 text-center text-sm text-muted-foreground">'), G = /* @__PURE__ */ c('<div><div class="px-4 py-1 text-xs font-semibold text-muted-foreground uppercase tracking-wider">'), H = /* @__PURE__ */ c('<span class="w-5 h-5 flex items-center justify-center text-muted-foreground">'), J = /* @__PURE__ */ c('<span class="ml-2 text-muted-foreground text-xs">'), Q = /* @__PURE__ */ c('<kbd class="text-xs text-muted-foreground px-1.5 py-0.5 rounded bg-muted font-mono">'), V = /* @__PURE__ */ c('<button type=button><div class="flex-1 text-left"><span>');
|
|
9
|
+
function ne() {
|
|
10
|
+
const t = R(), $ = N();
|
|
11
|
+
let x;
|
|
12
|
+
const [k, f] = I(0);
|
|
13
|
+
w(() => {
|
|
14
|
+
t.isOpen() && x && (x.focus(), f(0));
|
|
15
|
+
}), w(() => {
|
|
16
|
+
t.search(), f(0);
|
|
17
|
+
}), w(() => {
|
|
18
|
+
if (!t.isOpen()) return;
|
|
19
|
+
const n = (o) => {
|
|
20
|
+
const e = t.filteredCommands();
|
|
21
|
+
switch (o.key) {
|
|
22
|
+
case "Escape":
|
|
23
|
+
o.preventDefault(), t.close();
|
|
24
|
+
break;
|
|
25
|
+
case "ArrowDown":
|
|
26
|
+
o.preventDefault(), f((a) => Math.min(a + 1, e.length - 1));
|
|
27
|
+
break;
|
|
28
|
+
case "ArrowUp":
|
|
29
|
+
o.preventDefault(), f((a) => Math.max(a - 1, 0));
|
|
30
|
+
break;
|
|
31
|
+
case "Enter":
|
|
32
|
+
o.preventDefault(), e[k()] && t.execute(e[k()].id);
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
window.addEventListener("keydown", n), S(() => window.removeEventListener("keydown", n));
|
|
37
|
+
}), w(() => {
|
|
38
|
+
if (!t.isOpen()) return;
|
|
39
|
+
const n = B({
|
|
40
|
+
overflow: "hidden"
|
|
41
|
+
});
|
|
42
|
+
S(n);
|
|
43
|
+
});
|
|
44
|
+
const P = K(() => {
|
|
45
|
+
const n = t.filteredCommands(), o = /* @__PURE__ */ new Map();
|
|
46
|
+
return n.forEach((e, a) => {
|
|
47
|
+
const h = e.category ?? "Commands", p = o.get(h);
|
|
48
|
+
p ? p.push({
|
|
49
|
+
cmd: e,
|
|
50
|
+
index: a
|
|
51
|
+
}) : o.set(h, [{
|
|
52
|
+
cmd: e,
|
|
53
|
+
index: a
|
|
54
|
+
}]);
|
|
55
|
+
}), Array.from(o.entries());
|
|
56
|
+
});
|
|
57
|
+
return i(g, {
|
|
58
|
+
get when() {
|
|
59
|
+
return t.isOpen();
|
|
60
|
+
},
|
|
61
|
+
get children() {
|
|
62
|
+
return i(O, {
|
|
63
|
+
get children() {
|
|
64
|
+
return [(() => {
|
|
65
|
+
var n = T();
|
|
66
|
+
return n.$$click = () => t.close(), n;
|
|
67
|
+
})(), (() => {
|
|
68
|
+
var n = U(), o = n.firstChild, e = o.firstChild, a = e.nextSibling, h = o.nextSibling;
|
|
69
|
+
l(o, i(j, {
|
|
70
|
+
class: "w-5 h-5 text-muted-foreground flex-shrink-0"
|
|
71
|
+
}), e), e.$$input = (r) => t.setSearch(r.currentTarget.value);
|
|
72
|
+
var p = x;
|
|
73
|
+
return typeof p == "function" ? L(p, e) : x = e, l(a, () => $.config.strings.commandPalette.esc), l(h, i(g, {
|
|
74
|
+
get when() {
|
|
75
|
+
return t.filteredCommands().length > 0;
|
|
76
|
+
},
|
|
77
|
+
get fallback() {
|
|
78
|
+
return (() => {
|
|
79
|
+
var r = q();
|
|
80
|
+
return l(r, () => $.config.strings.commandPalette.empty), r;
|
|
81
|
+
})();
|
|
82
|
+
},
|
|
83
|
+
get children() {
|
|
84
|
+
return i(D, {
|
|
85
|
+
get each() {
|
|
86
|
+
return P();
|
|
87
|
+
},
|
|
88
|
+
children: ([r, v]) => (() => {
|
|
89
|
+
var m = G(), b = m.firstChild;
|
|
90
|
+
return l(b, r), l(m, i(D, {
|
|
91
|
+
each: v,
|
|
92
|
+
children: (d) => (() => {
|
|
93
|
+
var u = V(), _ = u.firstChild, A = _.firstChild;
|
|
94
|
+
return u.addEventListener("mouseenter", () => f(d.index)), u.$$click = () => t.execute(d.cmd.id), l(u, i(g, {
|
|
95
|
+
get when() {
|
|
96
|
+
return d.cmd.icon;
|
|
97
|
+
},
|
|
98
|
+
get children() {
|
|
99
|
+
var s = H();
|
|
100
|
+
return l(s, i(z, {
|
|
101
|
+
get component() {
|
|
102
|
+
return d.cmd.icon;
|
|
103
|
+
},
|
|
104
|
+
class: "w-5 h-5"
|
|
105
|
+
})), s;
|
|
106
|
+
}
|
|
107
|
+
}), _), l(A, () => d.cmd.title), l(_, i(g, {
|
|
108
|
+
get when() {
|
|
109
|
+
return d.cmd.description;
|
|
110
|
+
},
|
|
111
|
+
get children() {
|
|
112
|
+
var s = J();
|
|
113
|
+
return l(s, () => d.cmd.description), s;
|
|
114
|
+
}
|
|
115
|
+
}), null), l(u, i(g, {
|
|
116
|
+
get when() {
|
|
117
|
+
return d.cmd.keybind;
|
|
118
|
+
},
|
|
119
|
+
get children() {
|
|
120
|
+
var s = Q();
|
|
121
|
+
return l(s, () => t.getKeybindDisplay(d.cmd.keybind)), s;
|
|
122
|
+
}
|
|
123
|
+
}), null), y(() => C(u, E("w-full flex items-center gap-3 px-4 py-2 text-sm", "transition-colors duration-75", "focus:outline-none", k() === d.index ? "bg-accent text-accent-foreground" : "hover:bg-accent/50"))), u;
|
|
124
|
+
})()
|
|
125
|
+
}), null), m;
|
|
126
|
+
})()
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
})), y((r) => {
|
|
130
|
+
var v = E("fixed left-1/2 top-[20%] z-50 -translate-x-1/2", "w-full max-w-xl", "bg-popover text-popover-foreground rounded-lg shadow-2xl", "border border-border", "animate-in fade-in slide-in-from-top-4", "overflow-hidden"), m = $.config.strings.commandPalette.placeholder, b = E("flex-1 h-12 bg-transparent text-sm", "placeholder:text-muted-foreground", "focus:outline-none");
|
|
131
|
+
return v !== r.e && C(n, r.e = v), m !== r.t && F(e, "placeholder", r.t = m), b !== r.a && C(e, r.a = b), r;
|
|
132
|
+
}, {
|
|
133
|
+
e: void 0,
|
|
134
|
+
t: void 0,
|
|
135
|
+
a: void 0
|
|
136
|
+
}), y(() => e.value = t.search()), n;
|
|
137
|
+
})()];
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
M(["click", "input"]);
|
|
144
|
+
export {
|
|
145
|
+
ne as CommandPalette
|
|
146
|
+
};
|