@floegence/floe-webapp-core 0.1.2 → 0.1.7
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/Breadcrumb.d.ts +7 -0
- package/dist/components/file-browser/DirectoryTree.d.ts +7 -0
- package/dist/components/file-browser/FileBrowser.d.ts +35 -0
- package/dist/components/file-browser/FileBrowserContext.d.ts +18 -0
- package/dist/components/file-browser/FileBrowserToolbar.d.ts +8 -0
- package/dist/components/file-browser/FileContextMenu.d.ts +15 -0
- package/dist/components/file-browser/FileGridView.d.ts +7 -0
- package/dist/components/file-browser/FileIcons.d.ts +14 -0
- package/dist/components/file-browser/FileListView.d.ts +7 -0
- package/dist/components/file-browser/index.d.ts +10 -0
- package/dist/components/file-browser/types.d.ts +104 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/layout/Sidebar.d.ts +18 -0
- package/dist/components/layout/index.d.ts +1 -1
- package/dist/components/layout/mobileTabs.d.ts +30 -0
- package/dist/context/ComponentRegistry.d.ts +3 -2
- package/dist/index.js +249 -220
- package/dist/index10.js +2 -2
- package/dist/index11.js +4 -4
- package/dist/index12.js +2 -2
- package/dist/index13.js +4 -4
- package/dist/index14.js +4 -4
- package/dist/index15.js +4 -4
- package/dist/index16.js +3 -3
- package/dist/index17.js +5 -5
- package/dist/index18.js +2 -2
- package/dist/index19.js +1 -1
- package/dist/index2.js +89 -70
- package/dist/index20.js +1 -1
- package/dist/index21.js +3 -3
- package/dist/index22.js +2 -2
- package/dist/index23.js +2 -2
- package/dist/index24.js +1 -1
- package/dist/index25.js +4 -4
- package/dist/index26.js +1 -1
- package/dist/index27.js +1 -1
- package/dist/index28.js +1 -1
- package/dist/index29.js +1 -1
- package/dist/index3.js +1 -1
- package/dist/index36.js +138 -42
- package/dist/index37.js +102 -32
- package/dist/index38.js +90 -23
- package/dist/index39.js +107 -170
- package/dist/index4.js +48 -34
- package/dist/index40.js +86 -40
- package/dist/index41.js +176 -64
- package/dist/index42.js +64 -94
- package/dist/index43.js +64 -110
- package/dist/index44.js +39 -138
- package/dist/index45.js +44 -35
- package/dist/index46.js +34 -379
- package/dist/index47.js +25 -13
- package/dist/index48.js +173 -10
- package/dist/index49.js +40 -16
- package/dist/index5.js +3 -3
- package/dist/index50.js +65 -9
- package/dist/index51.js +96 -8
- package/dist/index52.js +113 -52
- package/dist/index53.js +138 -5
- package/dist/index54.js +39 -3
- package/dist/index55.js +382 -44
- package/dist/index56.js +13 -26
- package/dist/index57.js +10 -32
- package/dist/index58.js +17 -92
- package/dist/index59.js +10 -22
- package/dist/index6.js +2 -2
- package/dist/index60.js +8 -46
- package/dist/index61.js +56 -14
- package/dist/index62.js +5 -35
- package/dist/index63.js +3 -64
- package/dist/index64.js +45 -84
- package/dist/index65.js +25 -13
- package/dist/index66.js +27 -2258
- package/dist/index67.js +94 -0
- package/dist/index68.js +25 -0
- package/dist/index69.js +49 -0
- package/dist/index7.js +1 -1
- package/dist/index70.js +17 -0
- package/dist/index71.js +38 -0
- package/dist/index72.js +67 -0
- package/dist/index73.js +87 -0
- package/dist/index74.js +17 -0
- package/dist/index75.js +2266 -0
- package/dist/index76.js +10 -0
- package/dist/index8.js +2 -2
- package/dist/index9.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index67.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/index68.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/index69.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/index7.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { delegateEvents as A, template as f, insert as o, createComponent as c, effect as w, className as m, Dynamic as C, memo as S, setAttribute as k, use as _ } from "solid-js/web";
|
|
2
2
|
import { createSignal as $, onMount as I, onCleanup as L, Show as h, For as F } from "solid-js";
|
|
3
|
-
import { cn as v } from "./
|
|
3
|
+
import { cn as v } from "./index62.js";
|
|
4
4
|
var W = /* @__PURE__ */ f('<div class="absolute left-0 top-0 bottom-0 w-8 bg-gradient-to-r from-background to-transparent z-10 pointer-events-none">'), M = /* @__PURE__ */ f('<div class="absolute right-0 top-0 bottom-0 w-8 bg-gradient-to-l from-background to-transparent z-10 pointer-events-none">'), R = /* @__PURE__ */ f('<nav><div class="relative h-14"><div class="h-full flex items-center overflow-x-auto scrollbar-hide snap-x snap-mandatory"style=-webkit-overflow-scrolling:touch>'), j = /* @__PURE__ */ f("<span>"), q = /* @__PURE__ */ f('<div class="absolute bottom-0 left-1/2 -translate-x-1/2 w-8 h-0.5 bg-primary rounded-t">'), z = /* @__PURE__ */ f("<button type=button role=tab><div></div><span>");
|
|
5
5
|
function N(e) {
|
|
6
6
|
let n;
|
package/dist/index70.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/index71.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 "./index62.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/index72.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 "./index62.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/index73.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 "./index62.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/index74.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
|
+
};
|