@floegence/floe-webapp-core 0.78.10 → 0.79.1
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/layout/Shell.d.ts +2 -0
- package/dist/components/layout/Shell.js +262 -195
- package/dist/components/notes/notesOverlayHelpers.d.ts +0 -1
- package/dist/components/notes/notesOverlayHelpers.js +26 -27
- package/dist/components/notes/useNotesOverlayModel.js +196 -201
- package/dist/components/ui/Dialog.d.ts +2 -0
- package/dist/components/ui/Dialog.js +78 -74
- package/dist/components/ui/FloatingWindow.js +86 -85
- package/dist/context/LayoutContext.d.ts +2 -0
- package/dist/context/LayoutContext.js +43 -30
- package/dist/context/index.d.ts +1 -1
- package/dist/floe.css +10 -0
- package/dist/full.js +333 -328
- package/dist/hooks/createAdaptiveSidebar.d.ts +12 -0
- package/dist/hooks/createAdaptiveSidebar.js +12 -0
- package/dist/hooks/createRetainedContent.d.ts +7 -0
- package/dist/hooks/createRetainedContent.js +15 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useMediaQuery.d.ts +2 -4
- package/dist/hooks/useMediaQuery.js +12 -11
- package/dist/index.js +100 -95
- package/dist/styles.css +1 -1
- package/dist/widgets/TerminalWidget.js +71 -72
- package/package.json +1 -1
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { insert as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import {
|
|
4
|
-
import { MobileKeyboard as
|
|
5
|
-
import { useMediaQuery as re } from "../hooks/useMediaQuery.js";
|
|
1
|
+
import { insert as o, createComponent as d, memo as D, effect as h, className as R, spread as Q, mergeProps as F, setStyleProperty as U, template as v, use as W, delegateEvents as X } from "solid-js/web";
|
|
2
|
+
import { createSignal as k, createMemo as C, createEffect as N, Show as P, For as Y } from "solid-js";
|
|
3
|
+
import { useMobileLayout as Z } from "../context/LayoutContext.js";
|
|
4
|
+
import { MobileKeyboard as ee } from "../components/ui/MobileKeyboard.js";
|
|
6
5
|
import { cn as q } from "../utils/cn.js";
|
|
7
|
-
import { floeTouchSurfaceAttrs as
|
|
8
|
-
import { normalizeTerminalWorkspaceProfile as
|
|
9
|
-
import { createTerminalSessionState as
|
|
10
|
-
import { runTerminalMockCommand as
|
|
11
|
-
var
|
|
12
|
-
function
|
|
13
|
-
return (
|
|
6
|
+
import { floeTouchSurfaceAttrs as te, preventTouchSurfacePointerDown as re } from "../utils/touchSurfaceGuard.js";
|
|
7
|
+
import { normalizeTerminalWorkspaceProfile as ne } from "../terminal/workspaceProfile.js";
|
|
8
|
+
import { createTerminalSessionState as ie, getTerminalPromptPreview as oe, getTerminalSessionSuggestions as le, applyTerminalSessionSuggestion as se, setTerminalSessionInputValue as ae, dispatchTerminalSessionKey as ue, submitTerminalSession as de } from "../terminal/sessionModel.js";
|
|
9
|
+
import { runTerminalMockCommand as ce } from "../terminal/mockRuntime.js";
|
|
10
|
+
var me = /* @__PURE__ */ v('<button type=button class="rounded-full px-2.5 py-1 text-[10px] font-semibold uppercase tracking-[0.16em] transition-colors"style="background:color-mix(in srgb, var(--terminal-foreground) 8%, transparent);color:color-mix(in srgb, var(--terminal-foreground) 82%, transparent)">'), pe = /* @__PURE__ */ v('<form class=flex-1><input type=text class="w-full bg-transparent text-terminal-foreground outline-none">'), fe = /* @__PURE__ */ v('<div><div class="flex h-full min-h-0 flex-col"><div class="flex items-center justify-between border-b px-3 py-2 text-[11px]"style="border-color:color-mix(in srgb, var(--terminal-foreground) 10%, transparent);color:color-mix(in srgb, var(--terminal-foreground) 72%, transparent)"><div class="flex items-center gap-2"><div class="flex items-center gap-1.5"><span class="h-2 w-2 rounded-full bg-rose-400/80"></span><span class="h-2 w-2 rounded-full bg-amber-300/80"></span><span class="h-2 w-2 rounded-full bg-emerald-400/80"></span></div><span>Terminal Session</span></div></div><div class="flex-1 overflow-y-auto px-3 py-3 transition-[padding] duration-200"><div class="mt-2 rounded-xl px-3 py-2"style="background:color-mix(in srgb, var(--terminal-foreground) 5%, transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--terminal-foreground) 8%, transparent)"><div class="flex items-start gap-2"><span class="pt-0.5 text-emerald-300">$'), ge = /* @__PURE__ */ v("<div>"), be = /* @__PURE__ */ v('<button><span class="whitespace-pre-wrap break-all text-terminal-foreground"><span class="mx-[1px] inline-block min-w-[0.65ch] rounded-[2px] bg-terminal-foreground text-terminal-background">');
|
|
11
|
+
function Ce(n = {}) {
|
|
12
|
+
return (l) => d(ve, F(l, n));
|
|
14
13
|
}
|
|
15
|
-
function
|
|
16
|
-
const
|
|
14
|
+
function ve(n) {
|
|
15
|
+
const l = Z(), [M, y] = k([{
|
|
17
16
|
id: 1,
|
|
18
17
|
type: "output",
|
|
19
18
|
content: "Welcome to Floe Terminal"
|
|
@@ -21,51 +20,51 @@ function ye(n) {
|
|
|
21
20
|
id: 2,
|
|
22
21
|
type: "output",
|
|
23
22
|
content: 'Type "help" for available commands'
|
|
24
|
-
}]), [c,
|
|
25
|
-
let
|
|
26
|
-
const
|
|
27
|
-
profile:
|
|
23
|
+
}]), [c, $] = k(ie()), [x, m] = k(!1);
|
|
24
|
+
let w, p, f = 3;
|
|
25
|
+
const E = () => c().editor.value, S = C(() => ne(n.profile)), H = () => n.runtime ?? ce, T = C(() => oe(c().editor)), I = C(() => le(c(), {
|
|
26
|
+
profile: S(),
|
|
28
27
|
providers: n.suggestionProviders
|
|
29
28
|
})), j = (e) => {
|
|
30
|
-
|
|
29
|
+
$((s) => ae(s, e));
|
|
31
30
|
}, z = (e) => {
|
|
32
31
|
e.preventDefault(), J();
|
|
33
32
|
}, A = () => {
|
|
34
33
|
if (!n.isEditMode) {
|
|
35
|
-
if (
|
|
34
|
+
if (l()) {
|
|
36
35
|
m(!0);
|
|
37
36
|
return;
|
|
38
37
|
}
|
|
39
|
-
|
|
38
|
+
w?.focus();
|
|
40
39
|
}
|
|
41
|
-
},
|
|
42
|
-
e.length &&
|
|
43
|
-
}, B = (e,
|
|
40
|
+
}, _ = (e) => {
|
|
41
|
+
e.length && y((s) => [...s, ...e]);
|
|
42
|
+
}, B = (e, s) => {
|
|
44
43
|
const g = {
|
|
45
44
|
id: f++,
|
|
46
45
|
type: "input",
|
|
47
46
|
content: `$ ${e}`
|
|
48
|
-
},
|
|
47
|
+
}, a = s.lines.map((b) => ({
|
|
49
48
|
id: f++,
|
|
50
49
|
type: b.type,
|
|
51
50
|
content: b.content
|
|
52
51
|
}));
|
|
53
|
-
if (
|
|
54
|
-
|
|
52
|
+
if (s.clear) {
|
|
53
|
+
y([]);
|
|
55
54
|
return;
|
|
56
55
|
}
|
|
57
|
-
|
|
56
|
+
_([g, ...a]);
|
|
58
57
|
}, G = (e) => {
|
|
59
58
|
if (e.type !== "none") {
|
|
60
59
|
if (e.type === "submit") {
|
|
61
|
-
B(e.command,
|
|
62
|
-
profile:
|
|
60
|
+
B(e.command, H()(e.command, {
|
|
61
|
+
profile: S(),
|
|
63
62
|
resolveNow: n.resolveNow
|
|
64
63
|
}));
|
|
65
64
|
return;
|
|
66
65
|
}
|
|
67
66
|
if (e.type === "interrupt") {
|
|
68
|
-
e.command ?
|
|
67
|
+
e.command ? _([{
|
|
69
68
|
id: f++,
|
|
70
69
|
type: "input",
|
|
71
70
|
content: `$ ${e.command}`
|
|
@@ -73,85 +72,85 @@ function ye(n) {
|
|
|
73
72
|
id: f++,
|
|
74
73
|
type: "error",
|
|
75
74
|
content: "^C"
|
|
76
|
-
}]) :
|
|
75
|
+
}]) : _([{
|
|
77
76
|
id: f++,
|
|
78
77
|
type: "error",
|
|
79
78
|
content: "^C"
|
|
80
79
|
}]);
|
|
81
80
|
return;
|
|
82
81
|
}
|
|
83
|
-
|
|
82
|
+
y([]);
|
|
84
83
|
}
|
|
85
|
-
},
|
|
86
|
-
|
|
84
|
+
}, K = (e) => {
|
|
85
|
+
$(e.state), G(e.effect);
|
|
87
86
|
}, J = () => {
|
|
88
|
-
|
|
87
|
+
K(de(c()));
|
|
89
88
|
}, O = (e) => {
|
|
90
|
-
!e || n.isEditMode ||
|
|
91
|
-
profile:
|
|
89
|
+
!e || n.isEditMode || K(ue(c(), e, {
|
|
90
|
+
profile: S(),
|
|
92
91
|
providers: n.suggestionProviders
|
|
93
92
|
}));
|
|
94
93
|
};
|
|
95
94
|
return N(() => {
|
|
96
|
-
|
|
95
|
+
M(), E(), x(), p && (p.scrollTop = p.scrollHeight);
|
|
97
96
|
}), N(() => {
|
|
98
|
-
(!
|
|
97
|
+
(!l() || n.isEditMode) && m(!1);
|
|
99
98
|
}), (() => {
|
|
100
|
-
var e =
|
|
99
|
+
var e = fe(), s = e.firstChild, g = s.firstChild;
|
|
101
100
|
g.firstChild;
|
|
102
|
-
var
|
|
103
|
-
|
|
101
|
+
var a = g.nextSibling, b = a.firstChild, L = b.firstChild;
|
|
102
|
+
L.firstChild, e.$$click = A, o(g, d(P, {
|
|
104
103
|
get when() {
|
|
105
|
-
return
|
|
104
|
+
return D(() => !!l())() && !n.isEditMode;
|
|
106
105
|
},
|
|
107
106
|
get children() {
|
|
108
|
-
var t =
|
|
107
|
+
var t = me();
|
|
109
108
|
return t.$$click = (r) => {
|
|
110
|
-
r.stopPropagation(), m((
|
|
111
|
-
},
|
|
109
|
+
r.stopPropagation(), m((i) => !i);
|
|
110
|
+
}, o(t, () => x() ? "Hide Keys" : "Show Keys"), t;
|
|
112
111
|
}
|
|
113
112
|
}), null);
|
|
114
|
-
var
|
|
115
|
-
return typeof
|
|
113
|
+
var V = p;
|
|
114
|
+
return typeof V == "function" ? W(V, a) : p = a, o(a, d(Y, {
|
|
116
115
|
get each() {
|
|
117
|
-
return
|
|
116
|
+
return M();
|
|
118
117
|
},
|
|
119
118
|
children: (t) => (() => {
|
|
120
|
-
var r =
|
|
121
|
-
return
|
|
119
|
+
var r = ge();
|
|
120
|
+
return o(r, () => t.content), h(() => R(r, q("whitespace-pre-wrap break-all leading-6", t.type === "error" && "text-rose-300", t.type === "input" && "text-emerald-300"))), r;
|
|
122
121
|
})()
|
|
123
|
-
}), b),
|
|
122
|
+
}), b), o(L, d(P, {
|
|
124
123
|
get when() {
|
|
125
|
-
return !
|
|
124
|
+
return !l();
|
|
126
125
|
},
|
|
127
126
|
get fallback() {
|
|
128
127
|
return (() => {
|
|
129
|
-
var t =
|
|
130
|
-
return
|
|
128
|
+
var t = be(), r = t.firstChild, i = r.firstChild;
|
|
129
|
+
return Q(t, F(te, {
|
|
131
130
|
type: "button",
|
|
132
131
|
class: "min-h-[1.5rem] flex-1 bg-transparent text-left outline-none",
|
|
133
132
|
"aria-label": "Terminal input surface",
|
|
134
133
|
onPointerDown: (u) => {
|
|
135
|
-
|
|
134
|
+
re(u), u.stopPropagation();
|
|
136
135
|
},
|
|
137
136
|
onClick: (u) => {
|
|
138
137
|
u.stopPropagation(), m(!0);
|
|
139
138
|
}
|
|
140
|
-
}), !1, !0),
|
|
139
|
+
}), !1, !0), o(r, () => T().before, i), o(i, () => T().cursor), o(r, () => T().after, null), t;
|
|
141
140
|
})();
|
|
142
141
|
},
|
|
143
142
|
get children() {
|
|
144
|
-
var t =
|
|
143
|
+
var t = pe(), r = t.firstChild;
|
|
145
144
|
t.addEventListener("submit", z), r.$$input = (u) => j(u.currentTarget.value);
|
|
146
|
-
var
|
|
147
|
-
return typeof
|
|
145
|
+
var i = w;
|
|
146
|
+
return typeof i == "function" ? W(i, r) : w = r, h(() => r.disabled = n.isEditMode), h(() => r.value = E()), t;
|
|
148
147
|
}
|
|
149
|
-
}), null),
|
|
148
|
+
}), null), o(e, d(P, {
|
|
150
149
|
get when() {
|
|
151
|
-
return
|
|
150
|
+
return D(() => !!l())() && !n.isEditMode;
|
|
152
151
|
},
|
|
153
152
|
get children() {
|
|
154
|
-
return d(
|
|
153
|
+
return d(ee, {
|
|
155
154
|
get visible() {
|
|
156
155
|
return x();
|
|
157
156
|
},
|
|
@@ -159,24 +158,24 @@ function ye(n) {
|
|
|
159
158
|
return n.quickInserts;
|
|
160
159
|
},
|
|
161
160
|
get suggestions() {
|
|
162
|
-
return
|
|
161
|
+
return I();
|
|
163
162
|
},
|
|
164
163
|
onKey: O,
|
|
165
164
|
onDismiss: () => m(!1),
|
|
166
|
-
onSuggestionSelect: (t) =>
|
|
165
|
+
onSuggestionSelect: (t) => $((r) => se(r, t))
|
|
167
166
|
});
|
|
168
167
|
}
|
|
169
|
-
}), null),
|
|
170
|
-
var r = q("relative h-full overflow-hidden rounded-[inherit] bg-terminal-background text-terminal-foreground font-mono text-xs", n.isEditMode && "pointer-events-none"),
|
|
171
|
-
return r !== t.e &&
|
|
168
|
+
}), null), h((t) => {
|
|
169
|
+
var r = q("relative h-full overflow-hidden rounded-[inherit] bg-terminal-background text-terminal-foreground font-mono text-xs", n.isEditMode && "pointer-events-none"), i = l() && x() ? `calc(${I().length > 0 ? "16.5rem" : "15rem"} + env(safe-area-inset-bottom))` : void 0;
|
|
170
|
+
return r !== t.e && R(e, t.e = r), i !== t.t && U(a, "padding-bottom", t.t = i), t;
|
|
172
171
|
}, {
|
|
173
172
|
e: void 0,
|
|
174
173
|
t: void 0
|
|
175
174
|
}), e;
|
|
176
175
|
})();
|
|
177
176
|
}
|
|
178
|
-
|
|
177
|
+
X(["click", "input"]);
|
|
179
178
|
export {
|
|
180
|
-
|
|
181
|
-
|
|
179
|
+
ve as TerminalWidget,
|
|
180
|
+
Ce as createTerminalWidget
|
|
182
181
|
};
|