@floegence/floe-webapp-core 0.78.10 → 0.79.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.
@@ -1,19 +1,18 @@
1
- import { insert as i, createComponent as d, memo as L, effect as y, className as W, spread as U, mergeProps as H, setStyleProperty as X, template as v, use as F, delegateEvents as Y } from "solid-js/web";
2
- import { createSignal as C, createMemo as P, createEffect as N, Show as M, For as Z } from "solid-js";
3
- import { useResolvedFloeConfig as ee } from "../context/FloeConfigContext.js";
4
- import { MobileKeyboard as te } from "../components/ui/MobileKeyboard.js";
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 ne, preventTouchSurfacePointerDown as oe } from "../utils/touchSurfaceGuard.js";
8
- import { normalizeTerminalWorkspaceProfile as ie } from "../terminal/workspaceProfile.js";
9
- import { createTerminalSessionState as le, getTerminalPromptPreview as se, getTerminalSessionSuggestions as ae, applyTerminalSessionSuggestion as ue, setTerminalSessionInputValue as de, dispatchTerminalSessionKey as ce, submitTerminalSession as me } from "../terminal/sessionModel.js";
10
- import { runTerminalMockCommand as pe } from "../terminal/mockRuntime.js";
11
- var fe = /* @__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)">'), ge = /* @__PURE__ */ v('<form class=flex-1><input type=text class="w-full bg-transparent text-terminal-foreground outline-none">'), be = /* @__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">$'), ve = /* @__PURE__ */ v("<div>"), xe = /* @__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">');
12
- function Ee(n = {}) {
13
- return (h) => d(ye, H(h, n));
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 ye(n) {
16
- const h = ee(), a = re(h.config.layout.mobileQuery), [E, $] = C([{
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, w] = C(le()), [x, m] = C(!1);
25
- let S, p, f = 3;
26
- const I = () => c().editor.value, T = P(() => ie(n.profile)), Q = () => n.runtime ?? pe, _ = P(() => se(c().editor)), K = P(() => ae(c(), {
27
- profile: T(),
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
- w((l) => de(l, e));
29
+ $((s) => ae(s, e));
31
30
  }, z = (e) => {
32
31
  e.preventDefault(), J();
33
32
  }, A = () => {
34
33
  if (!n.isEditMode) {
35
- if (a()) {
34
+ if (l()) {
36
35
  m(!0);
37
36
  return;
38
37
  }
39
- S?.focus();
38
+ w?.focus();
40
39
  }
41
- }, k = (e) => {
42
- e.length && $((l) => [...l, ...e]);
43
- }, B = (e, l) => {
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
- }, s = l.lines.map((b) => ({
47
+ }, a = s.lines.map((b) => ({
49
48
  id: f++,
50
49
  type: b.type,
51
50
  content: b.content
52
51
  }));
53
- if (l.clear) {
54
- $([]);
52
+ if (s.clear) {
53
+ y([]);
55
54
  return;
56
55
  }
57
- k([g, ...s]);
56
+ _([g, ...a]);
58
57
  }, G = (e) => {
59
58
  if (e.type !== "none") {
60
59
  if (e.type === "submit") {
61
- B(e.command, Q()(e.command, {
62
- profile: T(),
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 ? k([{
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
- }]) : k([{
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
- }, R = (e) => {
86
- w(e.state), G(e.effect);
84
+ }, K = (e) => {
85
+ $(e.state), G(e.effect);
87
86
  }, J = () => {
88
- R(me(c()));
87
+ K(de(c()));
89
88
  }, O = (e) => {
90
- !e || n.isEditMode || R(ce(c(), e, {
91
- profile: T(),
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
- E(), I(), x(), p && (p.scrollTop = p.scrollHeight);
95
+ M(), E(), x(), p && (p.scrollTop = p.scrollHeight);
97
96
  }), N(() => {
98
- (!a() || n.isEditMode) && m(!1);
97
+ (!l() || n.isEditMode) && m(!1);
99
98
  }), (() => {
100
- var e = be(), l = e.firstChild, g = l.firstChild;
99
+ var e = fe(), s = e.firstChild, g = s.firstChild;
101
100
  g.firstChild;
102
- var s = g.nextSibling, b = s.firstChild, V = b.firstChild;
103
- V.firstChild, e.$$click = A, i(g, d(M, {
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 L(() => !!a())() && !n.isEditMode;
104
+ return D(() => !!l())() && !n.isEditMode;
106
105
  },
107
106
  get children() {
108
- var t = fe();
107
+ var t = me();
109
108
  return t.$$click = (r) => {
110
- r.stopPropagation(), m((o) => !o);
111
- }, i(t, () => x() ? "Hide Keys" : "Show Keys"), t;
109
+ r.stopPropagation(), m((i) => !i);
110
+ }, o(t, () => x() ? "Hide Keys" : "Show Keys"), t;
112
111
  }
113
112
  }), null);
114
- var D = p;
115
- return typeof D == "function" ? F(D, s) : p = s, i(s, d(Z, {
113
+ var V = p;
114
+ return typeof V == "function" ? W(V, a) : p = a, o(a, d(Y, {
116
115
  get each() {
117
- return E();
116
+ return M();
118
117
  },
119
118
  children: (t) => (() => {
120
- var r = ve();
121
- return i(r, () => t.content), y(() => W(r, q("whitespace-pre-wrap break-all leading-6", t.type === "error" && "text-rose-300", t.type === "input" && "text-emerald-300"))), r;
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), i(V, d(M, {
122
+ }), b), o(L, d(P, {
124
123
  get when() {
125
- return !a();
124
+ return !l();
126
125
  },
127
126
  get fallback() {
128
127
  return (() => {
129
- var t = xe(), r = t.firstChild, o = r.firstChild;
130
- return U(t, H(ne, {
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
- oe(u), u.stopPropagation();
134
+ re(u), u.stopPropagation();
136
135
  },
137
136
  onClick: (u) => {
138
137
  u.stopPropagation(), m(!0);
139
138
  }
140
- }), !1, !0), i(r, () => _().before, o), i(o, () => _().cursor), i(r, () => _().after, null), t;
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 = ge(), r = t.firstChild;
143
+ var t = pe(), r = t.firstChild;
145
144
  t.addEventListener("submit", z), r.$$input = (u) => j(u.currentTarget.value);
146
- var o = S;
147
- return typeof o == "function" ? F(o, r) : S = r, y(() => r.disabled = n.isEditMode), y(() => r.value = I()), t;
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), i(e, d(M, {
148
+ }), null), o(e, d(P, {
150
149
  get when() {
151
- return L(() => !!a())() && !n.isEditMode;
150
+ return D(() => !!l())() && !n.isEditMode;
152
151
  },
153
152
  get children() {
154
- return d(te, {
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 K();
161
+ return I();
163
162
  },
164
163
  onKey: O,
165
164
  onDismiss: () => m(!1),
166
- onSuggestionSelect: (t) => w((r) => ue(r, t))
165
+ onSuggestionSelect: (t) => $((r) => se(r, t))
167
166
  });
168
167
  }
169
- }), null), y((t) => {
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"), o = a() && x() ? `calc(${K().length > 0 ? "16.5rem" : "15rem"} + env(safe-area-inset-bottom))` : void 0;
171
- return r !== t.e && W(e, t.e = r), o !== t.t && X(s, "padding-bottom", t.t = o), t;
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
- Y(["click", "input"]);
177
+ X(["click", "input"]);
179
178
  export {
180
- ye as TerminalWidget,
181
- Ee as createTerminalWidget
179
+ ve as TerminalWidget,
180
+ Ce as createTerminalWidget
182
181
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floegence/floe-webapp-core",
3
- "version": "0.78.10",
3
+ "version": "0.79.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",