@karmaniverous/jeeves-server 3.0.1 → 3.1.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/.tsbuildinfo +1 -1
- package/CHANGELOG.md +47 -19
- package/client/src/components/SearchModal.tsx +533 -222
- package/client/src/components/TabBar.tsx +1 -1
- package/client/src/hooks/useFileData.ts +3 -1
- package/client/src/lib/api.ts +1 -0
- package/dist/client/assets/{CodeEditor-0XHVI8Nu.js → CodeEditor-BKFEoNHo.js} +1 -1
- package/dist/client/assets/{CodeViewer-CykMVsfX.js → CodeViewer-ykQDxC2m.js} +1 -1
- package/dist/client/assets/index-Bk4tUE4j.js +62 -0
- package/dist/client/assets/index-D-RC7ZS6.css +1 -0
- package/dist/client/index.html +2 -2
- package/dist/src/routes/api/search.js +23 -1
- package/dist/src/routes/api/status.js +7 -1
- package/dist/src/routes/api/status.test.js +1 -1
- package/dist/src/services/eventLog.js +8 -0
- package/guides/api-integration.md +1 -1
- package/guides/deployment.md +1 -1
- package/guides/event-gateway.md +11 -0
- package/package.json +1 -1
- package/src/routes/api/search.ts +22 -1
- package/src/routes/api/status.test.ts +1 -1
- package/src/routes/api/status.ts +52 -41
- package/src/services/eventLog.ts +9 -0
- package/dist/client/assets/index-DbMebkkd.css +0 -1
- package/dist/client/assets/index-LjwgzZ7F.js +0 -62
|
@@ -30,7 +30,7 @@ export function TabBar({
|
|
|
30
30
|
}: TabBarProps) {
|
|
31
31
|
if (!file && !loading) return null;
|
|
32
32
|
|
|
33
|
-
const renderable = file ? isRenderable(file) : isRenderableExt(reqPath);
|
|
33
|
+
const renderable = (fileRendered ? isRenderable(fileRendered) : false) || (file ? isRenderable(file) : isRenderableExt(reqPath));
|
|
34
34
|
const activeTab = renderable ? viewTab : 'raw';
|
|
35
35
|
|
|
36
36
|
return (
|
|
@@ -56,9 +56,11 @@ export function useFileData(reqPath: string, searchParams: URLSearchParams) {
|
|
|
56
56
|
}
|
|
57
57
|
}, []);
|
|
58
58
|
|
|
59
|
+
// Only reload data when the path changes, not when tab params change
|
|
59
60
|
useEffect(() => {
|
|
60
61
|
void loadData(reqPath, searchParams);
|
|
61
|
-
|
|
62
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
63
|
+
}, [loadData, reqPath]);
|
|
62
64
|
|
|
63
65
|
const handleSave = async (content: string) => {
|
|
64
66
|
await saveFile(reqPath, content);
|
package/client/src/lib/api.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,u as L,l as M,g as B,j as e}from"./index-
|
|
1
|
+
import{r as t,u as L,l as M,g as B,j as e}from"./index-Bk4tUE4j.js";function J({content:i,fileName:h,onSave:c,onCancel:b}){const n=t.useRef(null),r=t.useRef(null),[d,l]=t.useState(!1),[u,f]=t.useState(!1),[y,v]=t.useState(!0),[C]=L(),x=t.useRef(i),m=t.useCallback(async()=>{if(!r.current)return;const s=r.current.state.doc.toString();f(!0);try{await c(s),x.current=s,l(!1)}finally{f(!1)}},[c]);return t.useEffect(()=>{if(!n.current)return;let s=!1;return(async()=>{const{EditorView:o,EditorState:j,basicSetup:w,keymap:S,oneDark:N}=await M();if(s)return;const E=h.split(".").pop()??"",p=await B(E);if(s)return;const a=[w,S.of([{key:"Mod-s",run:()=>(m(),!0)}]),o.updateListener.of(g=>{if(g.docChanged){const F=g.state.doc.toString();l(F!==x.current)}}),o.theme({"&":{fontSize:"14px",height:"100%"},".cm-scroller":{overflow:"auto"},".cm-content":{fontFamily:"'JetBrains Mono', 'Fira Code', 'Consolas', monospace"},".cm-gutters":{fontFamily:"'JetBrains Mono', 'Fira Code', 'Consolas', monospace"}})];C==="dark"&&a.push(N),p&&a.push(p);const k=j.create({doc:i,extensions:a}),R=new o({state:k,parent:n.current});r.current=R,v(!1)})(),()=>{s=!0,r.current&&(r.current.destroy(),r.current=null)}},[]),e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border bg-muted/50",children:[e.jsx("span",{className:"text-sm font-medium text-foreground",children:"Editing"}),d&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-amber-500/20 text-amber-600 dark:text-amber-400 rounded",children:"unsaved"}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{onClick:b,className:"px-3 py-1 text-sm rounded border border-border text-muted-foreground hover:bg-accent transition-colors",children:"Cancel"}),e.jsx("button",{onClick:m,disabled:u||!d,className:"px-3 py-1 text-sm rounded bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:u?"Saving…":"Save"}),e.jsx("span",{className:"text-xs text-muted-foreground hidden sm:inline",children:"Ctrl+S"})]}),e.jsx("div",{ref:n,className:"flex-1 overflow-hidden",children:y&&e.jsx("div",{className:"flex items-center justify-center h-32 text-muted-foreground",children:"Loading editor…"})})]})}export{J as CodeEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as b,r as t,u as j,l as E,g as k,j as e,C as N}from"./index-
|
|
1
|
+
import{c as b,r as t,u as j,l as E,g as k,j as e,C as N}from"./index-Bk4tUE4j.js";const R=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],S=b("copy",R);function M({content:o,fileName:i}){const s=t.useRef(null),r=t.useRef(null),[f,x]=t.useState(!0),[h,d]=t.useState(!1),[l]=j(),m=async()=>{await navigator.clipboard.writeText(o),d(!0),setTimeout(()=>d(!1),1500)};return t.useEffect(()=>{if(!s.current)return;let n=!1;return(async()=>{const{EditorView:a,EditorState:u,basicSetup:g,oneDark:y}=await E();if(n)return;const w=i.split(".").pop()??"",p=await k(w);if(n)return;const c=[g,u.readOnly.of(!0),a.editable.of(!1),a.theme({"&":{fontSize:"14px"},".cm-scroller":{overflow:"auto"},".cm-content":{fontFamily:"'JetBrains Mono', 'Fira Code', 'Consolas', monospace"},".cm-gutters":{fontFamily:"'JetBrains Mono', 'Fira Code', 'Consolas', monospace"},".cm-cursor":{display:"none"}})];l==="dark"&&c.push(y),p&&c.push(p);const v=u.create({doc:o,extensions:c}),C=new a({state:v,parent:s.current});r.current=C,x(!1)})(),()=>{n=!0,r.current&&(r.current.destroy(),r.current=null)}},[o,i,l]),e.jsxs("div",{className:"relative group rounded-lg border border-border overflow-hidden",children:[e.jsx("div",{className:"absolute top-2 right-2 z-10",children:e.jsx("button",{onClick:()=>{m()},className:"p-1.5 rounded bg-accent hover:bg-accent/80 text-muted-foreground hover:text-foreground opacity-0 group-hover:opacity-100 transition-all",title:"Copy to clipboard",children:h?e.jsx(N,{className:"h-3.5 w-3.5 text-green-400"}):e.jsx(S,{className:"h-3.5 w-3.5"})})}),e.jsx("div",{ref:s,children:f&&e.jsx("pre",{className:"p-4 text-sm text-muted-foreground bg-muted",children:e.jsxs("code",{children:[o.slice(0,200),"…"]})})})]})}export{M as CodeViewer};
|