@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/index52.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { createEffect as M, onCleanup as q } from "solid-js";
|
|
2
|
+
import { useDeck as x } from "./index46.js";
|
|
3
|
+
import { applyDragDelta as H } from "./index60.js";
|
|
4
|
+
import { DECK_GRID_CONFIG as R } from "./index10.js";
|
|
5
|
+
import { lockBodyStyle as S } from "./index57.js";
|
|
6
|
+
function N() {
|
|
7
|
+
const l = x();
|
|
8
|
+
let r = null, d = 0, s = 0, m = 0, f = 0, o = null, u = null, a = null, e = null;
|
|
9
|
+
const h = (t) => {
|
|
10
|
+
if (!t) {
|
|
11
|
+
e == null || e(), e = null;
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
e == null || e(), e = S({ cursor: "grabbing", "user-select": "none" });
|
|
15
|
+
}, E = () => {
|
|
16
|
+
r !== null && (o !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(o), o = null), r = null, u = null, a = null, h(!1), l.endDrag(!0));
|
|
17
|
+
}, w = (t) => {
|
|
18
|
+
const c = t.target;
|
|
19
|
+
if (c.closest('button, input, select, textarea, [role="button"], a')) return;
|
|
20
|
+
const i = c.closest("[data-widget-drag-handle]");
|
|
21
|
+
if (!i || t.pointerType === "mouse" && t.button !== 0) return;
|
|
22
|
+
const n = i.dataset.widgetDragHandle;
|
|
23
|
+
n && (t.preventDefault(), t.stopPropagation(), r = t.pointerId, d = t.clientX, s = t.clientY, m = d, f = s, u = n, a = i, h(!0), l.startDrag(n, d, s), i.setPointerCapture(t.pointerId));
|
|
24
|
+
}, I = (t) => {
|
|
25
|
+
if (!(r !== t.pointerId || !u) && (m = t.clientX, f = t.clientY, o === null)) {
|
|
26
|
+
if (typeof requestAnimationFrame > "u") {
|
|
27
|
+
P();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
o = requestAnimationFrame(() => {
|
|
31
|
+
o = null, r !== null && P();
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}, P = () => {
|
|
35
|
+
if (!u) return;
|
|
36
|
+
const t = m - d, c = f - s, g = document.querySelector(".deck-grid");
|
|
37
|
+
if (!g) return;
|
|
38
|
+
const i = g.getBoundingClientRect(), { cols: n, rowHeight: L, gap: v } = R, C = v * (n - 1), b = (i.width - C - v * 2) / n, F = L + v, X = Math.round(t / b), Y = Math.round(c / F), D = l.activeLayout(), y = D == null ? void 0 : D.widgets.find((G) => G.id === u);
|
|
39
|
+
if (!y) return;
|
|
40
|
+
const A = H(y.position, X, Y, n);
|
|
41
|
+
l.updateDrag(A, { x: t, y: c });
|
|
42
|
+
}, p = (t) => {
|
|
43
|
+
if (r === t.pointerId) {
|
|
44
|
+
try {
|
|
45
|
+
a == null || a.releasePointerCapture(t.pointerId);
|
|
46
|
+
} catch {
|
|
47
|
+
}
|
|
48
|
+
E();
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
M(() => {
|
|
52
|
+
l.editMode() && (typeof document > "u" || (document.addEventListener("pointerdown", w, !0), document.addEventListener("pointermove", I, !0), document.addEventListener("pointerup", p, !0), document.addEventListener("pointercancel", p, !0), q(() => {
|
|
53
|
+
E(), document.removeEventListener("pointerdown", w, !0), document.removeEventListener("pointermove", I, !0), document.removeEventListener("pointerup", p, !0), document.removeEventListener("pointercancel", p, !0);
|
|
54
|
+
})));
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
N as useDeckDrag
|
|
59
|
+
};
|
package/dist/index53.js
ADDED
package/dist/index54.js
ADDED
package/dist/index55.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const r = "floe-", i = /* @__PURE__ */ new Map();
|
|
2
|
+
function f(o, e, n = 300) {
|
|
3
|
+
if (typeof window > "u") return;
|
|
4
|
+
const t = r + o, c = i.get(t);
|
|
5
|
+
c && clearTimeout(c), i.set(
|
|
6
|
+
t,
|
|
7
|
+
setTimeout(() => {
|
|
8
|
+
try {
|
|
9
|
+
localStorage.setItem(t, JSON.stringify(e)), i.delete(t);
|
|
10
|
+
} catch (s) {
|
|
11
|
+
console.warn(`Failed to save ${t}:`, s);
|
|
12
|
+
}
|
|
13
|
+
}, n)
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
function l(o, e) {
|
|
17
|
+
if (typeof window > "u") return e;
|
|
18
|
+
const n = r + o;
|
|
19
|
+
try {
|
|
20
|
+
const t = localStorage.getItem(n);
|
|
21
|
+
return t === null ? e : JSON.parse(t);
|
|
22
|
+
} catch {
|
|
23
|
+
return e;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function a(o, e) {
|
|
27
|
+
if (typeof window > "u") return;
|
|
28
|
+
const n = r + o;
|
|
29
|
+
try {
|
|
30
|
+
localStorage.setItem(n, JSON.stringify(e));
|
|
31
|
+
} catch (t) {
|
|
32
|
+
console.warn(`Failed to save ${n}:`, t);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function u(o) {
|
|
36
|
+
typeof window > "u" || localStorage.removeItem(r + o);
|
|
37
|
+
}
|
|
38
|
+
function d() {
|
|
39
|
+
if (typeof window > "u") return;
|
|
40
|
+
Object.keys(localStorage).filter((e) => e.startsWith(r)).forEach((e) => localStorage.removeItem(e));
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
d as clearAll,
|
|
44
|
+
f as debouncedSave,
|
|
45
|
+
l as load,
|
|
46
|
+
u as remove,
|
|
47
|
+
a as save
|
|
48
|
+
};
|
package/dist/index56.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const r = typeof navigator < "u" && /Mac|iPhone|iPad|iPod/.test(navigator.userAgent);
|
|
2
|
+
function o(s) {
|
|
3
|
+
const t = s.toLowerCase().split("+"), e = t.pop() || "";
|
|
4
|
+
return {
|
|
5
|
+
mod: t.includes("mod"),
|
|
6
|
+
ctrl: t.includes("ctrl"),
|
|
7
|
+
alt: t.includes("alt"),
|
|
8
|
+
shift: t.includes("shift"),
|
|
9
|
+
key: e
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function c(s, t) {
|
|
13
|
+
const e = typeof t == "string" ? o(t) : t, i = r ? s.metaKey : s.ctrlKey, n = s.key.toLowerCase();
|
|
14
|
+
return e.mod && !i || !e.mod && e.ctrl && !s.ctrlKey || e.alt && !s.altKey || e.shift && !s.shiftKey ? !1 : n === e.key;
|
|
15
|
+
}
|
|
16
|
+
function l(s) {
|
|
17
|
+
const t = o(s), e = [];
|
|
18
|
+
t.mod && e.push(r ? "⌘" : "Ctrl"), t.ctrl && !t.mod && e.push(r ? "⌃" : "Ctrl"), t.alt && e.push(r ? "⌥" : "Alt"), t.shift && e.push(r ? "⇧" : "Shift");
|
|
19
|
+
const i = t.key.length === 1 ? t.key.toUpperCase() : a(t.key);
|
|
20
|
+
return e.push(i), e.join(r ? "" : "+");
|
|
21
|
+
}
|
|
22
|
+
function a(s) {
|
|
23
|
+
return s.charAt(0).toUpperCase() + s.slice(1);
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
l as formatKeybind,
|
|
27
|
+
c as matchKeybind,
|
|
28
|
+
o as parseKeybind
|
|
29
|
+
};
|
package/dist/index57.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const i = /* @__PURE__ */ new Map();
|
|
2
|
+
function f() {
|
|
3
|
+
return typeof document > "u" ? null : document.body;
|
|
4
|
+
}
|
|
5
|
+
function u(c, n) {
|
|
6
|
+
const s = f();
|
|
7
|
+
if (!s) return;
|
|
8
|
+
const l = n.stack[n.stack.length - 1], r = l ? l.value : n.initial;
|
|
9
|
+
r ? s.style.setProperty(c, r) : s.style.removeProperty(c);
|
|
10
|
+
}
|
|
11
|
+
function a(c) {
|
|
12
|
+
const n = f();
|
|
13
|
+
if (!n) return () => {
|
|
14
|
+
};
|
|
15
|
+
const s = Symbol("body-style-lock"), l = Object.keys(c);
|
|
16
|
+
for (const t of l) {
|
|
17
|
+
const e = c[t];
|
|
18
|
+
if (e === void 0) continue;
|
|
19
|
+
let o = i.get(t);
|
|
20
|
+
o || (o = { initial: n.style.getPropertyValue(t), stack: [] }, i.set(t, o)), o.stack.push({ id: s, value: e }), u(t, o);
|
|
21
|
+
}
|
|
22
|
+
let r = !1;
|
|
23
|
+
return () => {
|
|
24
|
+
if (!r) {
|
|
25
|
+
r = !0;
|
|
26
|
+
for (const t of l) {
|
|
27
|
+
const e = i.get(t);
|
|
28
|
+
e && (e.stack = e.stack.filter((o) => o.id !== s), e.stack.length === 0 ? (u(t, e), i.delete(t)) : u(t, e));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
a as lockBodyStyle
|
|
35
|
+
};
|
package/dist/index58.js
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
const i = {
|
|
2
|
+
default: { stiffness: 300, damping: 30 },
|
|
3
|
+
gentle: { stiffness: 150, damping: 20 },
|
|
4
|
+
snappy: { stiffness: 500, damping: 25 },
|
|
5
|
+
bouncy: { stiffness: 400, damping: 10 }
|
|
6
|
+
}, t = {
|
|
7
|
+
instant: 0,
|
|
8
|
+
fast: 0.1,
|
|
9
|
+
normal: 0.2,
|
|
10
|
+
slow: 0.3,
|
|
11
|
+
slower: 0.5
|
|
12
|
+
}, a = {
|
|
13
|
+
easeOut: [0.33, 1, 0.68, 1],
|
|
14
|
+
easeIn: [0.32, 0, 0.67, 0],
|
|
15
|
+
easeInOut: [0.65, 0, 0.35, 1],
|
|
16
|
+
spring: [0.175, 0.885, 0.32, 1.275]
|
|
17
|
+
}, n = {
|
|
18
|
+
initial: { opacity: 0 },
|
|
19
|
+
animate: { opacity: 1 },
|
|
20
|
+
exit: { opacity: 0 },
|
|
21
|
+
transition: { duration: t.normal }
|
|
22
|
+
}, e = {
|
|
23
|
+
initial: { x: -20, opacity: 0 },
|
|
24
|
+
animate: { x: 0, opacity: 1 },
|
|
25
|
+
exit: { x: -20, opacity: 0 },
|
|
26
|
+
transition: { duration: t.normal, ease: a.easeOut }
|
|
27
|
+
}, s = {
|
|
28
|
+
initial: { x: 20, opacity: 0 },
|
|
29
|
+
animate: { x: 0, opacity: 1 },
|
|
30
|
+
exit: { x: 20, opacity: 0 },
|
|
31
|
+
transition: { duration: t.normal, ease: a.easeOut }
|
|
32
|
+
}, o = {
|
|
33
|
+
initial: { y: -20, opacity: 0 },
|
|
34
|
+
animate: { y: 0, opacity: 1 },
|
|
35
|
+
exit: { y: -20, opacity: 0 },
|
|
36
|
+
transition: { duration: t.normal, ease: a.easeOut }
|
|
37
|
+
}, c = {
|
|
38
|
+
initial: { y: 20, opacity: 0 },
|
|
39
|
+
animate: { y: 0, opacity: 1 },
|
|
40
|
+
exit: { y: 20, opacity: 0 },
|
|
41
|
+
transition: { duration: t.normal, ease: a.easeOut }
|
|
42
|
+
}, r = {
|
|
43
|
+
initial: { scale: 0.95, opacity: 0 },
|
|
44
|
+
animate: { scale: 1, opacity: 1 },
|
|
45
|
+
exit: { scale: 0.95, opacity: 0 },
|
|
46
|
+
transition: { duration: t.fast, ease: a.easeOut }
|
|
47
|
+
}, p = {
|
|
48
|
+
initial: { scale: 0.9, opacity: 0 },
|
|
49
|
+
animate: { scale: 1, opacity: 1 },
|
|
50
|
+
exit: { scale: 0.9, opacity: 0 },
|
|
51
|
+
transition: { type: "spring", ...i.bouncy }
|
|
52
|
+
}, l = {
|
|
53
|
+
open: {
|
|
54
|
+
width: 300,
|
|
55
|
+
transition: { duration: t.normal, ease: a.easeOut }
|
|
56
|
+
},
|
|
57
|
+
collapsed: {
|
|
58
|
+
width: 48,
|
|
59
|
+
transition: { duration: t.normal, ease: a.easeOut }
|
|
60
|
+
},
|
|
61
|
+
closed: {
|
|
62
|
+
width: 0,
|
|
63
|
+
transition: { duration: t.normal, ease: a.easeOut }
|
|
64
|
+
}
|
|
65
|
+
}, y = {
|
|
66
|
+
transition: { duration: t.fast, ease: a.easeOut }
|
|
67
|
+
}, d = {
|
|
68
|
+
animate: {
|
|
69
|
+
transition: {
|
|
70
|
+
staggerChildren: 0.05
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}, m = {
|
|
74
|
+
initial: { opacity: 0, y: 10 },
|
|
75
|
+
animate: { opacity: 1, y: 0 },
|
|
76
|
+
exit: { opacity: 0, y: -10 },
|
|
77
|
+
transition: { duration: t.fast }
|
|
78
|
+
};
|
|
79
|
+
export {
|
|
80
|
+
t as duration,
|
|
81
|
+
a as easing,
|
|
82
|
+
n as fadeIn,
|
|
83
|
+
d as listContainer,
|
|
84
|
+
m as listItem,
|
|
85
|
+
y as panelResize,
|
|
86
|
+
p as popIn,
|
|
87
|
+
r as scaleIn,
|
|
88
|
+
l as sidebarVariants,
|
|
89
|
+
c as slideInFromBottom,
|
|
90
|
+
e as slideInFromLeft,
|
|
91
|
+
s as slideInFromRight,
|
|
92
|
+
o as slideInFromTop,
|
|
93
|
+
i as springConfig
|
|
94
|
+
};
|
package/dist/index59.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
function e(o, n) {
|
|
2
|
+
return !(o.col + o.colSpan <= n.col || o.col >= n.col + n.colSpan || o.row + o.rowSpan <= n.row || o.row >= n.row + n.rowSpan);
|
|
3
|
+
}
|
|
4
|
+
function s(o, n, t) {
|
|
5
|
+
return n.some((c) => t && c.id === t ? !1 : e(o, c.position));
|
|
6
|
+
}
|
|
7
|
+
function w(o, n, t, c = 24) {
|
|
8
|
+
for (let r = 0; r < 100; r++)
|
|
9
|
+
for (let a = 0; a <= c - n; a++) {
|
|
10
|
+
const i = { col: a, row: r, colSpan: n, rowSpan: t };
|
|
11
|
+
if (!s(i, o))
|
|
12
|
+
return i;
|
|
13
|
+
}
|
|
14
|
+
return { col: 0, row: Math.max(0, ...o.map((r) => r.position.row + r.position.rowSpan)), colSpan: n, rowSpan: t };
|
|
15
|
+
}
|
|
16
|
+
function f(o, n = 4, t = 4, c = 24) {
|
|
17
|
+
const l = Math.max(0, Math.min(c - 1, o.col)), r = Math.max(0, o.row), a = Math.max(n, Math.min(c - l, o.colSpan)), i = Math.max(t, o.rowSpan);
|
|
18
|
+
return { col: l, row: r, colSpan: a, rowSpan: i };
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
e as checkCollision,
|
|
22
|
+
f as constrainPosition,
|
|
23
|
+
w as findFreePosition,
|
|
24
|
+
s as hasCollision
|
|
25
|
+
};
|
package/dist/index6.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { delegateEvents as f, template as i, insert as l, effect as u, className as a, createComponent as c } from "solid-js/web";
|
|
2
|
+
import { Show as s } from "solid-js";
|
|
3
|
+
import { cn as m } from "./index53.js";
|
|
4
|
+
import { useResolvedFloeConfig as b } from "./index39.js";
|
|
5
|
+
var h = /* @__PURE__ */ i("<footer>"), g = /* @__PURE__ */ i('<span class="w-2.5 h-2.5">'), $ = /* @__PURE__ */ i("<button type=button>"), d = /* @__PURE__ */ i("<span>");
|
|
6
|
+
function C(e) {
|
|
7
|
+
return (() => {
|
|
8
|
+
var r = h();
|
|
9
|
+
return l(r, () => e.children), u(() => a(r, m("h-5 shrink-0 flex items-center justify-between px-1.5", "bg-background border-t border-border", "text-[10px] text-muted-foreground font-mono", e.class))), r;
|
|
10
|
+
})();
|
|
11
|
+
}
|
|
12
|
+
function v(e) {
|
|
13
|
+
const r = () => m("flex items-center gap-1 px-1 py-0.5 rounded-sm", e.onClick && "hover:bg-muted/80 cursor-pointer", "transition-colors duration-75", e.class);
|
|
14
|
+
return c(s, {
|
|
15
|
+
get when() {
|
|
16
|
+
return e.onClick;
|
|
17
|
+
},
|
|
18
|
+
get fallback() {
|
|
19
|
+
return (() => {
|
|
20
|
+
var t = d();
|
|
21
|
+
return l(t, c(s, {
|
|
22
|
+
get when() {
|
|
23
|
+
return e.icon;
|
|
24
|
+
},
|
|
25
|
+
get children() {
|
|
26
|
+
var n = g();
|
|
27
|
+
return l(n, () => e.icon), n;
|
|
28
|
+
}
|
|
29
|
+
}), null), l(t, () => e.children, null), u(() => a(t, r())), t;
|
|
30
|
+
})();
|
|
31
|
+
},
|
|
32
|
+
get children() {
|
|
33
|
+
var t = $();
|
|
34
|
+
return t.$$click = () => {
|
|
35
|
+
var n;
|
|
36
|
+
return (n = e.onClick) == null ? void 0 : n.call(e);
|
|
37
|
+
}, l(t, c(s, {
|
|
38
|
+
get when() {
|
|
39
|
+
return e.icon;
|
|
40
|
+
},
|
|
41
|
+
get children() {
|
|
42
|
+
var n = g();
|
|
43
|
+
return l(n, () => e.icon), n;
|
|
44
|
+
}
|
|
45
|
+
}), null), l(t, () => e.children, null), u(() => a(t, r())), t;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function B(e) {
|
|
50
|
+
const r = b(), t = {
|
|
51
|
+
connected: "bg-success",
|
|
52
|
+
disconnected: "bg-muted-foreground",
|
|
53
|
+
connecting: "bg-warning animate-pulse",
|
|
54
|
+
error: "bg-error"
|
|
55
|
+
}, n = () => r.config.strings.statusIndicator;
|
|
56
|
+
return c(v, {
|
|
57
|
+
get children() {
|
|
58
|
+
return [(() => {
|
|
59
|
+
var o = d();
|
|
60
|
+
return u(() => a(o, m("w-1.5 h-1.5 rounded-full", t[e.status]))), o;
|
|
61
|
+
})(), (() => {
|
|
62
|
+
var o = d();
|
|
63
|
+
return l(o, () => e.label ?? n()[e.status]), o;
|
|
64
|
+
})()];
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
f(["click"]);
|
|
69
|
+
export {
|
|
70
|
+
C as BottomBar,
|
|
71
|
+
v as BottomBarItem,
|
|
72
|
+
B as StatusIndicator
|
|
73
|
+
};
|
package/dist/index60.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
function d(t) {
|
|
2
|
+
const n = t.row + 1, o = t.col + 1, c = n + t.rowSpan, a = o + t.colSpan;
|
|
3
|
+
return `${n} / ${o} / ${c} / ${a}`;
|
|
4
|
+
}
|
|
5
|
+
function f(t, n, o, c, a, l = 24) {
|
|
6
|
+
const i = Math.round((t - o.left) / c), e = Math.round((n - o.top) / a);
|
|
7
|
+
return {
|
|
8
|
+
col: Math.max(0, Math.min(l - 1, i)),
|
|
9
|
+
row: Math.max(0, e)
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function p(t, n = 4, o = 24) {
|
|
13
|
+
const c = n * (o - 1);
|
|
14
|
+
return { cellWidth: (t.width - c) / o, cellHeight: 40 };
|
|
15
|
+
}
|
|
16
|
+
function x(t, n, o, c) {
|
|
17
|
+
return {
|
|
18
|
+
colDelta: Math.round(t / o),
|
|
19
|
+
rowDelta: Math.round(n / c)
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function m(t, n, o, c = 24) {
|
|
23
|
+
const a = Math.max(0, Math.min(c - t.colSpan, t.col + n)), l = Math.max(0, t.row + o);
|
|
24
|
+
return {
|
|
25
|
+
...t,
|
|
26
|
+
col: a,
|
|
27
|
+
row: l
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function S(t, n, o, c, a = 4, l = 4, i = 24) {
|
|
31
|
+
let { col: e, row: u, colSpan: r, rowSpan: h } = t;
|
|
32
|
+
if (n.includes("e") && (r = Math.max(a, Math.min(i - e, r + o))), n.includes("w")) {
|
|
33
|
+
const s = Math.max(0, e + o), M = e - s, w = r + M;
|
|
34
|
+
w >= a && (e = s, r = w);
|
|
35
|
+
}
|
|
36
|
+
if (n.includes("s") && (h = Math.max(l, h + c)), n.includes("n")) {
|
|
37
|
+
const s = Math.max(0, u + c), M = u - s, w = h + M;
|
|
38
|
+
w >= l && (u = s, h = w);
|
|
39
|
+
}
|
|
40
|
+
return { col: e, row: u, colSpan: r, rowSpan: h };
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
m as applyDragDelta,
|
|
44
|
+
S as applyResizeDelta,
|
|
45
|
+
p as getGridCellSize,
|
|
46
|
+
x as pixelDeltaToGridDelta,
|
|
47
|
+
d as positionToGridArea,
|
|
48
|
+
f as snapToGrid
|
|
49
|
+
};
|
package/dist/index61.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const d = [
|
|
2
|
+
{ name: "light", displayName: "Light", type: "light" },
|
|
3
|
+
{ name: "dark", displayName: "Dark", type: "dark" }
|
|
4
|
+
];
|
|
5
|
+
function o() {
|
|
6
|
+
return typeof window > "u" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
7
|
+
}
|
|
8
|
+
function i(t) {
|
|
9
|
+
if (typeof document > "u") return;
|
|
10
|
+
const e = document.documentElement, n = t === "system" ? o() : t;
|
|
11
|
+
e.classList.remove("light", "dark"), e.classList.add(n), e.style.colorScheme = n;
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
i as applyTheme,
|
|
15
|
+
d as builtInThemes,
|
|
16
|
+
o as getSystemTheme
|
|
17
|
+
};
|
package/dist/index62.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { template as i, insert as r, effect as n, className as o, createComponent as a } from "solid-js/web";
|
|
2
|
+
import { cn as d } from "./index53.js";
|
|
3
|
+
import { Files as c, Search as f, Settings as u, Terminal as x } from "./index30.js";
|
|
4
|
+
var m = /* @__PURE__ */ i('<div><div class="p-3 text-sm text-muted-foreground">Sidebar content for: '), h = /* @__PURE__ */ i('<div><div class="h-full flex flex-col items-center justify-center text-muted-foreground"><span class=text-xs>Files Widget</span><span class="text-xs text-muted-foreground/60">Connect to file explorer'), p = /* @__PURE__ */ i('<div><div class="h-full flex flex-col items-center justify-center text-muted-foreground"><span class=text-xs>Search Widget</span><span class="text-xs text-muted-foreground/60">Connect to search'), g = /* @__PURE__ */ i('<div><div class="h-full flex flex-col items-center justify-center text-muted-foreground"><span class=text-xs>Settings Widget</span><span class="text-xs text-muted-foreground/60">Connect to settings'), v = /* @__PURE__ */ i('<div><div class="h-full flex flex-col items-center justify-center text-muted-foreground"><span class=text-xs>Showcase Widget</span><span class="text-xs text-muted-foreground/60">Connect to showcase');
|
|
5
|
+
function S(s) {
|
|
6
|
+
return (() => {
|
|
7
|
+
var e = m(), t = e.firstChild;
|
|
8
|
+
return t.firstChild, r(t, () => s.widgetId, null), n(() => o(e, d("h-full overflow-auto", s.isEditMode && "pointer-events-none"))), e;
|
|
9
|
+
})();
|
|
10
|
+
}
|
|
11
|
+
const b = (s) => (() => {
|
|
12
|
+
var e = h(), t = e.firstChild, l = t.firstChild;
|
|
13
|
+
return r(t, a(c, {
|
|
14
|
+
class: "w-8 h-8 mb-2"
|
|
15
|
+
}), l), n(() => o(e, d("h-full", s.isEditMode && "pointer-events-none"))), e;
|
|
16
|
+
})(), w = (s) => (() => {
|
|
17
|
+
var e = p(), t = e.firstChild, l = t.firstChild;
|
|
18
|
+
return r(t, a(f, {
|
|
19
|
+
class: "w-8 h-8 mb-2"
|
|
20
|
+
}), l), n(() => o(e, d("h-full", s.isEditMode && "pointer-events-none"))), e;
|
|
21
|
+
})(), W = (s) => (() => {
|
|
22
|
+
var e = g(), t = e.firstChild, l = t.firstChild;
|
|
23
|
+
return r(t, a(u, {
|
|
24
|
+
class: "w-8 h-8 mb-2"
|
|
25
|
+
}), l), n(() => o(e, d("h-full", s.isEditMode && "pointer-events-none"))), e;
|
|
26
|
+
})(), E = (s) => (() => {
|
|
27
|
+
var e = v(), t = e.firstChild, l = t.firstChild;
|
|
28
|
+
return r(t, a(x, {
|
|
29
|
+
class: "w-8 h-8 mb-2"
|
|
30
|
+
}), l), n(() => o(e, d("h-full", s.isEditMode && "pointer-events-none"))), e;
|
|
31
|
+
})();
|
|
32
|
+
export {
|
|
33
|
+
b as FilesSidebarWidget,
|
|
34
|
+
w as SearchSidebarWidget,
|
|
35
|
+
W as SettingsSidebarWidget,
|
|
36
|
+
E as ShowcaseSidebarWidget,
|
|
37
|
+
S as SidebarWidget
|
|
38
|
+
};
|
package/dist/index63.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { template as x, insert as r, createComponent as s, effect as f, className as M } from "solid-js/web";
|
|
2
|
+
import { createSignal as u, onMount as p, onCleanup as w } from "solid-js";
|
|
3
|
+
import { cn as v } from "./index53.js";
|
|
4
|
+
var _ = /* @__PURE__ */ x('<div><div class="grid grid-cols-2 gap-3 h-full">'), $ = /* @__PURE__ */ x('<div class="bg-muted/30 rounded-md p-2 flex flex-col justify-center"><div class="text-xs text-muted-foreground mb-1"></div><div class="flex items-baseline gap-1"><span></span><span class="text-xs text-muted-foreground">');
|
|
5
|
+
function N(t) {
|
|
6
|
+
const [l, o] = u(Math.random() * 100), [i, a] = u(Math.random() * 100), [m, h] = u(Math.random() * 1e3), [C, b] = u(Math.random() * 500);
|
|
7
|
+
let c;
|
|
8
|
+
p(() => {
|
|
9
|
+
t.isEditMode || (c = window.setInterval(() => {
|
|
10
|
+
o((e) => Math.max(0, Math.min(100, e + (Math.random() - 0.5) * 10))), a((e) => Math.max(0, Math.min(100, e + (Math.random() - 0.5) * 5))), h(Math.random() * 1e3), b(Math.random() * 500);
|
|
11
|
+
}, 2e3));
|
|
12
|
+
}), w(() => {
|
|
13
|
+
c && clearInterval(c);
|
|
14
|
+
});
|
|
15
|
+
const g = (e, n) => e >= n.danger ? "text-destructive" : e >= n.warning ? "text-yellow-500" : "text-green-500";
|
|
16
|
+
return (() => {
|
|
17
|
+
var e = _(), n = e.firstChild;
|
|
18
|
+
return r(n, s(d, {
|
|
19
|
+
label: "CPU",
|
|
20
|
+
get value() {
|
|
21
|
+
return l().toFixed(1);
|
|
22
|
+
},
|
|
23
|
+
unit: "%",
|
|
24
|
+
get colorClass() {
|
|
25
|
+
return g(l(), {
|
|
26
|
+
warning: 60,
|
|
27
|
+
danger: 80
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}), null), r(n, s(d, {
|
|
31
|
+
label: "Memory",
|
|
32
|
+
get value() {
|
|
33
|
+
return i().toFixed(1);
|
|
34
|
+
},
|
|
35
|
+
unit: "%",
|
|
36
|
+
get colorClass() {
|
|
37
|
+
return g(i(), {
|
|
38
|
+
warning: 70,
|
|
39
|
+
danger: 90
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}), null), r(n, s(d, {
|
|
43
|
+
label: "Network In",
|
|
44
|
+
get value() {
|
|
45
|
+
return m().toFixed(0);
|
|
46
|
+
},
|
|
47
|
+
unit: "KB/s",
|
|
48
|
+
colorClass: "text-blue-500"
|
|
49
|
+
}), null), r(n, s(d, {
|
|
50
|
+
label: "Network Out",
|
|
51
|
+
get value() {
|
|
52
|
+
return C().toFixed(0);
|
|
53
|
+
},
|
|
54
|
+
unit: "KB/s",
|
|
55
|
+
colorClass: "text-purple-500"
|
|
56
|
+
}), null), f(() => M(e, v("h-full p-3", t.isEditMode && "pointer-events-none"))), e;
|
|
57
|
+
})();
|
|
58
|
+
}
|
|
59
|
+
function d(t) {
|
|
60
|
+
return (() => {
|
|
61
|
+
var l = $(), o = l.firstChild, i = o.nextSibling, a = i.firstChild, m = a.nextSibling;
|
|
62
|
+
return r(o, () => t.label), r(a, () => t.value), r(m, () => t.unit), f(() => M(a, v("text-lg font-semibold tabular-nums", t.colorClass))), l;
|
|
63
|
+
})();
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
N as MetricsWidget
|
|
67
|
+
};
|
package/dist/index64.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { delegateEvents as E, template as b, insert as $, createComponent as S, effect as u, className as x, use as T } from "solid-js/web";
|
|
2
|
+
import { createSignal as y, For as k } from "solid-js";
|
|
3
|
+
import { cn as g } from "./index53.js";
|
|
4
|
+
var z = /* @__PURE__ */ b('<div><div class="flex-1 overflow-y-auto p-2"><div class="flex items-center"><span class=text-green-400>$ </span><form class=flex-1><input type=text class="w-full bg-transparent outline-none text-zinc-100">'), I = /* @__PURE__ */ b("<div>");
|
|
5
|
+
function F(p) {
|
|
6
|
+
const [_, d] = y([{
|
|
7
|
+
id: 1,
|
|
8
|
+
type: "output",
|
|
9
|
+
content: "Welcome to Floe Terminal"
|
|
10
|
+
}, {
|
|
11
|
+
id: 2,
|
|
12
|
+
type: "output",
|
|
13
|
+
content: 'Type "help" for available commands'
|
|
14
|
+
}, {
|
|
15
|
+
id: 3,
|
|
16
|
+
type: "input",
|
|
17
|
+
content: "$ "
|
|
18
|
+
}]), [f, c] = y("");
|
|
19
|
+
let r, i = 4;
|
|
20
|
+
const w = (l) => {
|
|
21
|
+
l.preventDefault();
|
|
22
|
+
const e = f().trim();
|
|
23
|
+
if (!e) return;
|
|
24
|
+
const n = [{
|
|
25
|
+
id: i++,
|
|
26
|
+
type: "input",
|
|
27
|
+
content: `$ ${e}`
|
|
28
|
+
}];
|
|
29
|
+
if (e === "help")
|
|
30
|
+
n.push({
|
|
31
|
+
id: i++,
|
|
32
|
+
type: "output",
|
|
33
|
+
content: "Available commands: help, clear, date, echo <text>"
|
|
34
|
+
});
|
|
35
|
+
else if (e === "clear") {
|
|
36
|
+
d([{
|
|
37
|
+
id: i++,
|
|
38
|
+
type: "input",
|
|
39
|
+
content: "$ "
|
|
40
|
+
}]), c("");
|
|
41
|
+
return;
|
|
42
|
+
} else e === "date" ? n.push({
|
|
43
|
+
id: i++,
|
|
44
|
+
type: "output",
|
|
45
|
+
content: (/* @__PURE__ */ new Date()).toString()
|
|
46
|
+
}) : e.startsWith("echo ") ? n.push({
|
|
47
|
+
id: i++,
|
|
48
|
+
type: "output",
|
|
49
|
+
content: e.slice(5)
|
|
50
|
+
}) : n.push({
|
|
51
|
+
id: i++,
|
|
52
|
+
type: "error",
|
|
53
|
+
content: `Command not found: ${e}`
|
|
54
|
+
});
|
|
55
|
+
n.push({
|
|
56
|
+
id: i++,
|
|
57
|
+
type: "input",
|
|
58
|
+
content: "$ "
|
|
59
|
+
}), d((a) => [...a.slice(0, -1), ...n]), c("");
|
|
60
|
+
}, C = () => {
|
|
61
|
+
r == null || r.focus();
|
|
62
|
+
};
|
|
63
|
+
return (() => {
|
|
64
|
+
var l = z(), e = l.firstChild, n = e.firstChild, a = n.firstChild, m = a.nextSibling, s = m.firstChild;
|
|
65
|
+
l.$$click = C, $(e, S(k, {
|
|
66
|
+
get each() {
|
|
67
|
+
return _().slice(0, -1);
|
|
68
|
+
},
|
|
69
|
+
children: (t) => (() => {
|
|
70
|
+
var o = I();
|
|
71
|
+
return $(o, () => t.content), u(() => x(o, g("whitespace-pre-wrap break-all", t.type === "error" && "text-red-400", t.type === "input" && "text-green-400"))), o;
|
|
72
|
+
})()
|
|
73
|
+
}), n), m.addEventListener("submit", w), s.$$input = (t) => c(t.currentTarget.value);
|
|
74
|
+
var v = r;
|
|
75
|
+
return typeof v == "function" ? T(v, s) : r = s, u((t) => {
|
|
76
|
+
var o = g("h-full bg-zinc-900 text-zinc-100 font-mono text-xs overflow-hidden flex flex-col", p.isEditMode && "pointer-events-none"), h = p.isEditMode;
|
|
77
|
+
return o !== t.e && x(l, t.e = o), h !== t.t && (s.disabled = t.t = h), t;
|
|
78
|
+
}, {
|
|
79
|
+
e: void 0,
|
|
80
|
+
t: void 0
|
|
81
|
+
}), u(() => s.value = f()), l;
|
|
82
|
+
})();
|
|
83
|
+
}
|
|
84
|
+
E(["click", "input"]);
|
|
85
|
+
export {
|
|
86
|
+
F as TerminalWidget
|
|
87
|
+
};
|
package/dist/index65.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
function a(r) {
|
|
2
|
+
var n, f, t = "";
|
|
3
|
+
if (typeof r == "string" || typeof r == "number") t += r;
|
|
4
|
+
else if (typeof r == "object") if (Array.isArray(r)) {
|
|
5
|
+
var o = r.length;
|
|
6
|
+
for (n = 0; n < o; n++) r[n] && (f = a(r[n])) && (t && (t += " "), t += f);
|
|
7
|
+
} else for (f in r) r[f] && (t && (t += " "), t += f);
|
|
8
|
+
return t;
|
|
9
|
+
}
|
|
10
|
+
function i() {
|
|
11
|
+
for (var r, n, f = 0, t = "", o = arguments.length; f < o; f++) (r = arguments[f]) && (n = a(r)) && (t && (t += " "), t += n);
|
|
12
|
+
return t;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
i as clsx,
|
|
16
|
+
i as default
|
|
17
|
+
};
|