@hachej/boring-workspace 0.1.49 → 0.1.51
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/{FileTree-GeEPOsUU.js → FileTree-BeCvmmxS.js} +8 -8
- package/dist/{MarkdownEditor-PL9esiiq.js → MarkdownEditor-DjdBgjHU.js} +1 -1
- package/dist/{WorkspaceLoadingState-Bi_qd29T.js → WorkspaceLoadingState-BfrLCML3.js} +31 -31
- package/dist/{WorkspaceProvider-CbvaXxgT.js → WorkspaceProvider-BvLlkZR_.js} +2706 -2454
- package/dist/app-front.js +55 -55
- package/dist/testing.js +1 -1
- package/dist/workspace.js +182 -183
- package/package.json +4 -4
- package/dist/CodeEditor-DQqOn4xz.js +0 -266
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hachej/boring-workspace",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.51",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Workspace UI, plugin, and bridge package for composing chat, files, catalogs, editors, and app-specific panes.",
|
|
@@ -135,9 +135,9 @@
|
|
|
135
135
|
"tailwind-merge": "^2.0.0",
|
|
136
136
|
"zod": "^3.23.0",
|
|
137
137
|
"zustand": "^5.0.0",
|
|
138
|
-
"@hachej/boring-
|
|
139
|
-
"@hachej/boring-
|
|
140
|
-
"@hachej/boring-ui-plugin-cli": "0.1.
|
|
138
|
+
"@hachej/boring-agent": "0.1.51",
|
|
139
|
+
"@hachej/boring-ui-kit": "0.1.51",
|
|
140
|
+
"@hachej/boring-ui-plugin-cli": "0.1.51"
|
|
141
141
|
},
|
|
142
142
|
"devDependencies": {
|
|
143
143
|
"@tailwindcss/postcss": "^4.0.0",
|
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
import { jsxs as j, jsx as f } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as c, useMemo as K, useEffect as l } from "react";
|
|
3
|
-
import { Compartment as s, EditorState as y } from "@codemirror/state";
|
|
4
|
-
import { EditorView as u, lineNumbers as N, drawSelection as T, highlightActiveLine as A, keymap as U } from "@codemirror/view";
|
|
5
|
-
import { history as W, defaultKeymap as z, historyKeymap as G } from "@codemirror/commands";
|
|
6
|
-
import { javascript as O } from "@codemirror/lang-javascript";
|
|
7
|
-
import { python as I } from "@codemirror/lang-python";
|
|
8
|
-
import { json as q } from "@codemirror/lang-json";
|
|
9
|
-
import { yaml as P } from "@codemirror/lang-yaml";
|
|
10
|
-
import { markdown as V } from "@codemirror/lang-markdown";
|
|
11
|
-
import { sql as J } from "@codemirror/lang-sql";
|
|
12
|
-
import { syntaxHighlighting as H, HighlightStyle as Q, bracketMatching as X, indentOnInput as Y, foldGutter as Z, foldKeymap as $, defaultHighlightStyle as ee } from "@codemirror/language";
|
|
13
|
-
import { highlightSelectionMatches as re, searchKeymap as te } from "@codemirror/search";
|
|
14
|
-
import { Button as oe } from "@hachej/boring-ui-kit";
|
|
15
|
-
import { tags as e } from "@lezer/highlight";
|
|
16
|
-
import { c as R } from "./utils-B6yFEsav.js";
|
|
17
|
-
const ce = Q.define([
|
|
18
|
-
{ tag: e.keyword, color: "oklch(0.7 0.15 300)" },
|
|
19
|
-
{ tag: [e.name, e.deleted, e.character, e.macroName], color: "var(--foreground)" },
|
|
20
|
-
{ tag: [e.function(e.variableName), e.labelName], color: "oklch(0.75 0.15 210)" },
|
|
21
|
-
{ tag: [e.color, e.constant(e.name), e.standard(e.name)], color: "oklch(0.75 0.12 60)" },
|
|
22
|
-
{ tag: [e.definition(e.name), e.separator], color: "var(--foreground)" },
|
|
23
|
-
{ tag: [e.typeName, e.className, e.number, e.changed, e.annotation, e.modifier, e.self, e.namespace], color: "oklch(0.75 0.12 60)" },
|
|
24
|
-
{ tag: [e.operator, e.operatorKeyword, e.url, e.escape, e.regexp, e.link, e.special(e.string)], color: "oklch(0.7 0.12 180)" },
|
|
25
|
-
{ tag: [e.meta, e.comment], color: "var(--muted-foreground)" },
|
|
26
|
-
{ tag: e.strong, fontWeight: "bold" },
|
|
27
|
-
{ tag: e.emphasis, fontStyle: "italic" },
|
|
28
|
-
{ tag: e.strikethrough, textDecoration: "line-through" },
|
|
29
|
-
{ tag: e.link, color: "oklch(0.7 0.12 180)", textDecoration: "underline" },
|
|
30
|
-
{ tag: e.heading, fontWeight: "bold", color: "oklch(0.75 0.15 210)" },
|
|
31
|
-
{ tag: [e.atom, e.bool, e.special(e.variableName)], color: "oklch(0.75 0.12 60)" },
|
|
32
|
-
{ tag: [e.processingInstruction, e.string, e.inserted], color: "oklch(0.75 0.12 140)" },
|
|
33
|
-
{ tag: e.invalid, color: "var(--destructive)" }
|
|
34
|
-
]);
|
|
35
|
-
function D(o) {
|
|
36
|
-
return [u.theme(
|
|
37
|
-
{
|
|
38
|
-
"&": {
|
|
39
|
-
backgroundColor: "transparent",
|
|
40
|
-
color: "var(--foreground)",
|
|
41
|
-
height: "100%"
|
|
42
|
-
},
|
|
43
|
-
".cm-content": {
|
|
44
|
-
caretColor: "var(--foreground)",
|
|
45
|
-
fontFamily: "var(--font-mono, ui-monospace, monospace)"
|
|
46
|
-
},
|
|
47
|
-
".cm-gutters": {
|
|
48
|
-
backgroundColor: "transparent",
|
|
49
|
-
color: "oklch(from var(--muted-foreground) l c h / 0.55)",
|
|
50
|
-
borderRight: "none",
|
|
51
|
-
paddingRight: "12px"
|
|
52
|
-
},
|
|
53
|
-
".cm-lineNumbers .cm-gutterElement": {
|
|
54
|
-
padding: "0 6px 0 12px",
|
|
55
|
-
fontVariantNumeric: "tabular-nums",
|
|
56
|
-
fontSize: "12px"
|
|
57
|
-
},
|
|
58
|
-
".cm-activeLineGutter": {
|
|
59
|
-
backgroundColor: "oklch(from var(--accent) l c h / 0.05)",
|
|
60
|
-
color: "var(--foreground)"
|
|
61
|
-
},
|
|
62
|
-
".cm-activeLine": {
|
|
63
|
-
backgroundColor: "oklch(from var(--accent) l c h / 0.04)"
|
|
64
|
-
},
|
|
65
|
-
"&.cm-focused .cm-cursor": {
|
|
66
|
-
borderLeftColor: "var(--accent)"
|
|
67
|
-
},
|
|
68
|
-
".cm-selectionBackground, &.cm-focused .cm-selectionBackground": {
|
|
69
|
-
backgroundColor: "oklch(from var(--accent) l c h / 0.16)"
|
|
70
|
-
},
|
|
71
|
-
".cm-panels": {
|
|
72
|
-
backgroundColor: "var(--muted)",
|
|
73
|
-
color: "var(--foreground)"
|
|
74
|
-
},
|
|
75
|
-
".cm-panels.cm-panels-top": {
|
|
76
|
-
borderBottom: "1px solid var(--border)"
|
|
77
|
-
},
|
|
78
|
-
".cm-panels.cm-panels-bottom": {
|
|
79
|
-
borderTop: "1px solid var(--border)"
|
|
80
|
-
},
|
|
81
|
-
".cm-searchMatch": {
|
|
82
|
-
backgroundColor: "oklch(0.8 0.15 80 / 0.3)",
|
|
83
|
-
outline: "1px solid oklch(0.8 0.15 80 / 0.5)"
|
|
84
|
-
},
|
|
85
|
-
".cm-searchMatch.cm-searchMatch-selected": {
|
|
86
|
-
backgroundColor: "oklch(0.7 0.15 80 / 0.5)"
|
|
87
|
-
},
|
|
88
|
-
".cm-tooltip": {
|
|
89
|
-
backgroundColor: "var(--popover)",
|
|
90
|
-
color: "var(--popover-foreground)",
|
|
91
|
-
border: "1px solid var(--border)",
|
|
92
|
-
borderRadius: "var(--radius-sm, 4px)"
|
|
93
|
-
},
|
|
94
|
-
".cm-tooltip-autocomplete": {
|
|
95
|
-
"& > ul > li[aria-selected]": {
|
|
96
|
-
backgroundColor: "var(--accent)",
|
|
97
|
-
color: "var(--accent-foreground)"
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
".cm-foldPlaceholder": {
|
|
101
|
-
backgroundColor: "var(--muted)",
|
|
102
|
-
border: "1px solid var(--border)",
|
|
103
|
-
color: "var(--muted-foreground)"
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
{ dark: (o == null ? void 0 : o.dark) ?? !1 }
|
|
107
|
-
), H(ce)];
|
|
108
|
-
}
|
|
109
|
-
const ne = 1e6, ae = 1e7;
|
|
110
|
-
function M(o) {
|
|
111
|
-
switch (o) {
|
|
112
|
-
case "javascript":
|
|
113
|
-
case "js":
|
|
114
|
-
case "jsx":
|
|
115
|
-
return O({ jsx: !0 });
|
|
116
|
-
case "typescript":
|
|
117
|
-
case "ts":
|
|
118
|
-
case "tsx":
|
|
119
|
-
return O({ jsx: !0, typescript: !0 });
|
|
120
|
-
case "python":
|
|
121
|
-
case "py":
|
|
122
|
-
return I();
|
|
123
|
-
case "json":
|
|
124
|
-
return q();
|
|
125
|
-
case "yaml":
|
|
126
|
-
case "yml":
|
|
127
|
-
return P();
|
|
128
|
-
case "markdown":
|
|
129
|
-
case "md":
|
|
130
|
-
return V();
|
|
131
|
-
case "sql":
|
|
132
|
-
return J();
|
|
133
|
-
default:
|
|
134
|
-
return null;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
function le({
|
|
138
|
-
content: o,
|
|
139
|
-
onChange: p,
|
|
140
|
-
language: g = "typescript",
|
|
141
|
-
readOnly: _ = !1,
|
|
142
|
-
lineNumbers: h = !0,
|
|
143
|
-
wordWrap: v = !1,
|
|
144
|
-
className: w
|
|
145
|
-
}) {
|
|
146
|
-
const d = c(null), n = c(null), m = c(p);
|
|
147
|
-
m.current = p;
|
|
148
|
-
const b = c(!1), k = c(new s()), C = c(new s()), L = c(new s()), E = c(new s()), S = c(new s()), i = o.length >= ne, B = o.length >= ae, x = _ || i, F = K(() => {
|
|
149
|
-
const r = [
|
|
150
|
-
C.current.of(y.readOnly.of(x)),
|
|
151
|
-
L.current.of(h ? N() : []),
|
|
152
|
-
E.current.of(v ? u.lineWrapping : []),
|
|
153
|
-
T(),
|
|
154
|
-
A(),
|
|
155
|
-
X(),
|
|
156
|
-
Y(),
|
|
157
|
-
W(),
|
|
158
|
-
re(),
|
|
159
|
-
Z(),
|
|
160
|
-
U.of([...z, ...G, ...$, ...te]),
|
|
161
|
-
S.current.of(D()),
|
|
162
|
-
H(ee, { fallback: !0 })
|
|
163
|
-
];
|
|
164
|
-
if (i)
|
|
165
|
-
r.push(k.current.of([]));
|
|
166
|
-
else {
|
|
167
|
-
const t = M(g);
|
|
168
|
-
r.push(k.current.of(t ?? []));
|
|
169
|
-
}
|
|
170
|
-
return r.push(
|
|
171
|
-
u.updateListener.of((t) => {
|
|
172
|
-
var a;
|
|
173
|
-
t.docChanged && !b.current && ((a = m.current) == null || a.call(m, t.state.doc.toString()));
|
|
174
|
-
})
|
|
175
|
-
), r;
|
|
176
|
-
}, []);
|
|
177
|
-
return l(() => {
|
|
178
|
-
if (!d.current) return;
|
|
179
|
-
const r = y.create({ doc: o, extensions: F }), t = new u({ state: r, parent: d.current });
|
|
180
|
-
return n.current = t, () => {
|
|
181
|
-
t.destroy(), n.current = null;
|
|
182
|
-
};
|
|
183
|
-
}, []), l(() => {
|
|
184
|
-
const r = n.current;
|
|
185
|
-
if (!r) return;
|
|
186
|
-
const t = r.state.doc.toString();
|
|
187
|
-
t !== o && (b.current = !0, r.dispatch({
|
|
188
|
-
changes: { from: 0, to: t.length, insert: o }
|
|
189
|
-
}), b.current = !1);
|
|
190
|
-
}, [o]), l(() => {
|
|
191
|
-
const r = n.current;
|
|
192
|
-
r && r.dispatch({
|
|
193
|
-
effects: C.current.reconfigure(
|
|
194
|
-
y.readOnly.of(x)
|
|
195
|
-
)
|
|
196
|
-
});
|
|
197
|
-
}, [x]), l(() => {
|
|
198
|
-
const r = n.current;
|
|
199
|
-
r && r.dispatch({
|
|
200
|
-
effects: L.current.reconfigure(
|
|
201
|
-
h ? N() : []
|
|
202
|
-
)
|
|
203
|
-
});
|
|
204
|
-
}, [h]), l(() => {
|
|
205
|
-
const r = n.current;
|
|
206
|
-
r && r.dispatch({
|
|
207
|
-
effects: E.current.reconfigure(
|
|
208
|
-
v ? u.lineWrapping : []
|
|
209
|
-
)
|
|
210
|
-
});
|
|
211
|
-
}, [v]), l(() => {
|
|
212
|
-
const r = n.current;
|
|
213
|
-
if (!r || i) return;
|
|
214
|
-
const t = M(g);
|
|
215
|
-
r.dispatch({
|
|
216
|
-
effects: k.current.reconfigure(t ?? [])
|
|
217
|
-
});
|
|
218
|
-
}, [g, i]), l(() => {
|
|
219
|
-
const r = new MutationObserver(() => {
|
|
220
|
-
const t = n.current;
|
|
221
|
-
if (!t) return;
|
|
222
|
-
const a = document.documentElement.getAttribute("data-theme") === "dark";
|
|
223
|
-
t.dispatch({
|
|
224
|
-
effects: S.current.reconfigure(D({ dark: a }))
|
|
225
|
-
});
|
|
226
|
-
});
|
|
227
|
-
return r.observe(document.documentElement, {
|
|
228
|
-
attributes: !0,
|
|
229
|
-
attributeFilter: ["data-theme"]
|
|
230
|
-
}), () => r.disconnect();
|
|
231
|
-
}, []), i ? /* @__PURE__ */ j("div", { className: R("flex h-full flex-col", w), children: [
|
|
232
|
-
/* @__PURE__ */ j("div", { className: "flex items-center gap-2 border-b border-border bg-muted/50 px-3 py-2 text-sm text-muted-foreground", children: [
|
|
233
|
-
/* @__PURE__ */ f("span", { children: "Large file — editing disabled" }),
|
|
234
|
-
B && /* @__PURE__ */ f(
|
|
235
|
-
oe,
|
|
236
|
-
{
|
|
237
|
-
type: "button",
|
|
238
|
-
variant: "outline",
|
|
239
|
-
size: "xs",
|
|
240
|
-
className: "ml-auto",
|
|
241
|
-
onClick: () => {
|
|
242
|
-
const r = new Blob([o], { type: "text/plain" }), t = URL.createObjectURL(r), a = document.createElement("a");
|
|
243
|
-
a.href = t, a.download = "file.txt", a.click(), URL.revokeObjectURL(t);
|
|
244
|
-
},
|
|
245
|
-
children: "Download"
|
|
246
|
-
}
|
|
247
|
-
)
|
|
248
|
-
] }),
|
|
249
|
-
/* @__PURE__ */ f("div", { ref: d, className: "flex-1 overflow-hidden" })
|
|
250
|
-
] }) : /* @__PURE__ */ f(
|
|
251
|
-
"div",
|
|
252
|
-
{
|
|
253
|
-
ref: d,
|
|
254
|
-
className: R("h-full overflow-hidden", w)
|
|
255
|
-
}
|
|
256
|
-
);
|
|
257
|
-
}
|
|
258
|
-
const Le = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
259
|
-
__proto__: null,
|
|
260
|
-
CodeEditor: le
|
|
261
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
262
|
-
export {
|
|
263
|
-
le as C,
|
|
264
|
-
Le as a,
|
|
265
|
-
D as c
|
|
266
|
-
};
|