@leanspec/ui 0.2.6-dev.20251125092039 → 0.2.6-dev.20251125092944
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/.next/standalone/packages/ui/.next/BUILD_ID +1 -1
- package/.next/standalone/packages/ui/.next/build-manifest.json +2 -2
- package/.next/standalone/packages/ui/.next/prerender-manifest.json +3 -3
- package/.next/standalone/packages/ui/.next/server/app/_global-error.html +2 -2
- package/.next/standalone/packages/ui/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/packages/ui/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/packages/ui/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/packages/ui/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/packages/ui/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/packages/ui/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/ui/.next/server/app/_not-found.html +2 -2
- package/.next/standalone/packages/ui/.next/server/app/_not-found.rsc +15 -15
- package/.next/standalone/packages/ui/.next/server/app/_not-found.segments/_full.segment.rsc +15 -15
- package/.next/standalone/packages/ui/.next/server/app/_not-found.segments/_index.segment.rsc +10 -10
- package/.next/standalone/packages/ui/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
- package/.next/standalone/packages/ui/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/.next/standalone/packages/ui/.next/server/app/_not-found.segments/_tree.segment.rsc +4 -4
- package/.next/standalone/packages/ui/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/ui/.next/server/app/projects/[projectId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/ui/.next/server/app/projects/[projectId]/specs/[specId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/ui/.next/server/app/projects/[projectId]/specs/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/ui/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/ui/.next/server/app/projects.html +2 -2
- package/.next/standalone/packages/ui/.next/server/app/projects.rsc +9 -9
- package/.next/standalone/packages/ui/.next/server/app/projects.segments/_full.segment.rsc +9 -9
- package/.next/standalone/packages/ui/.next/server/app/projects.segments/_index.segment.rsc +8 -8
- package/.next/standalone/packages/ui/.next/server/app/projects.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/packages/ui/.next/server/app/projects.segments/projects/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/packages/ui/.next/server/app/projects.segments/projects.segment.rsc +1 -1
- package/.next/standalone/packages/ui/.next/server/app/specs/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/ui/.next/server/app/specs/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/ui/.next/server/app/stats/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/ui/.next/server/chunks/ssr/[root-of-the-server]__73f60f12._.js +1 -1
- package/.next/standalone/packages/ui/.next/server/chunks/ssr/[root-of-the-server]__a7ae8552._.js +1 -1
- package/.next/standalone/packages/ui/.next/server/pages/404.html +2 -2
- package/.next/standalone/packages/ui/.next/server/pages/500.html +2 -2
- package/.next/standalone/packages/ui/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/packages/ui/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/packages/ui/.next/static/chunks/7e0dbfe036ccd85d.js +1 -0
- package/.next/standalone/packages/ui/leanspec.db +0 -0
- package/.next/standalone/packages/ui/package.json +1 -1
- package/.next/standalone/packages/ui/src/contexts/project-context.tsx +14 -14
- package/.next/standalone/packages/ui/tsconfig.tsbuildinfo +1 -1
- package/.next/static/chunks/7e0dbfe036ccd85d.js +1 -0
- package/package.json +1 -1
- package/.next/standalone/packages/ui/.next/static/chunks/220ba5cb8fe4dd69.js +0 -1
- package/.next/static/chunks/220ba5cb8fe4dd69.js +0 -1
- /package/.next/standalone/packages/ui/.next/static/{XaKCij6ONZQYRwoNl_cx7 → iWGI_kVMs-xybaG9ZCyWK}/_buildManifest.js +0 -0
- /package/.next/standalone/packages/ui/.next/static/{XaKCij6ONZQYRwoNl_cx7 → iWGI_kVMs-xybaG9ZCyWK}/_clientMiddlewareManifest.json +0 -0
- /package/.next/standalone/packages/ui/.next/static/{XaKCij6ONZQYRwoNl_cx7 → iWGI_kVMs-xybaG9ZCyWK}/_ssgManifest.js +0 -0
- /package/.next/static/{XaKCij6ONZQYRwoNl_cx7 → iWGI_kVMs-xybaG9ZCyWK}/_buildManifest.js +0 -0
- /package/.next/static/{XaKCij6ONZQYRwoNl_cx7 → iWGI_kVMs-xybaG9ZCyWK}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{XaKCij6ONZQYRwoNl_cx7 → iWGI_kVMs-xybaG9ZCyWK}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,20648,e=>{"use strict";var t=e.i(90022),r=e.i(31231);let a=(0,r.createContext)(null);function o(){let e=(0,r.useContext)(a);if(!e)throw Error("useProject must be used within ProjectProvider");return e}function s({children:e,initialProjectId:o}){let[s,l]=(0,r.useState)("single-project"),[i,c]=(0,r.useState)(null),[n,d]=(0,r.useState)([]),[h,u]=(0,r.useState)([]),[p,f]=(0,r.useState)([]),[m,j]=(0,r.useState)(!0),[x,g]=(0,r.useState)(null),y=(0,r.useCallback)(async()=>{try{j(!0),g(null);let e=await fetch("/api/projects");if(!e.ok)throw Error("Failed to fetch projects");let t=await e.json();if(l(t.mode||"single-project"),d(t.projects||[]),u(t.recentProjects||[]),f(t.favoriteProjects||[]),!i&&t.projects.length>0){let e=o?t.projects.find(e=>e.id===o):t.recentProjects?.[0]||t.projects[0];e&&c(e)}}catch(e){console.error("Error fetching projects:",e),g(e instanceof Error?e.message:"Failed to load projects")}finally{j(!1)}},[i,o]),v=(0,r.useCallback)(async e=>{try{let t=await fetch(`/api/projects/${e}`);if(!t.ok)throw Error("Failed to fetch project");let r=await t.json();c(r.project),await y()}catch(e){throw console.error("Error switching project:",e),g(e instanceof Error?e.message:"Failed to switch project"),e}},[y]),w=(0,r.useCallback)(async(e,t)=>{try{let r=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e,...t})});if(!r.ok){let e=await r.json();throw Error(e.details||"Failed to add project")}let a=await r.json();return await y(),a.project}catch(e){throw console.error("Error adding project:",e),g(e instanceof Error?e.message:"Failed to add project"),e}},[y]),b=(0,r.useCallback)(async e=>{try{if(!(await fetch(`/api/projects/${e}`,{method:"DELETE"})).ok)throw Error("Failed to remove project");if(i?.id===e){let t=n.find(t=>t.id!==e);c(t||null)}await y()}catch(e){throw console.error("Error removing project:",e),g(e instanceof Error?e.message:"Failed to remove project"),e}},[i,n,y]),k=(0,r.useCallback)(async e=>{try{if(!(await fetch(`/api/projects/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({favorite:!0})})).ok)throw Error("Failed to toggle favorite");await y()}catch(e){throw console.error("Error toggling favorite:",e),g(e instanceof Error?e.message:"Failed to toggle favorite"),e}},[y]),N=(0,r.useCallback)(async(e,t)=>{try{if(!(await fetch(`/api/projects/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).ok)throw Error("Failed to update project");await y()}catch(e){throw console.error("Error updating project:",e),g(e instanceof Error?e.message:"Failed to update project"),e}},[y]);return(0,r.useEffect)(()=>{y()},[y]),(0,t.jsx)(a.Provider,{value:{mode:s,currentProject:i,projects:n,recentProjects:h,favoriteProjects:p,isLoading:m,error:x,switchProject:v,addProject:w,removeProject:b,toggleFavorite:k,updateProject:N,refreshProjects:y},children:e})}e.s(["ProjectProvider",()=>s,"useProject",()=>o])},87949,e=>{"use strict";let t=(0,e.i(22436).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",()=>t],87949)},52186,23882,28964,61877,e=>{"use strict";var t=e.i(22436);let r=(0,t.default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",()=>r],52186);let a=(0,t.default)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);e.s(["FolderOpen",()=>a],23882);let o=(0,t.default)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);e.s(["Star",()=>o],28964);var s=e.i(90022),l=e.i(31231),i=e.i(30827),c=e.i(20648),n=e.i(35893),d=e.i(21079);let h=(0,t.default)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);var u=e.i(87949);let p=(0,t.default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);var f=e.i(97332),m=e.i(25761),j=e.i(32137);function x({onSelect:e,onCancel:t,initialPath:r,actionLabel:a="Select This Folder",isLoading:o}){let[i,c]=(0,l.useState)(r||""),[d,x]=(0,l.useState)([]),[g,y]=(0,l.useState)(!1),[v,w]=(0,l.useState)(null),b=(0,l.useRef)(null),k=o||g;(0,l.useEffect)(()=>{N(i)},[i]),(0,l.useEffect)(()=>{b.current&&(b.current.scrollLeft=b.current.scrollWidth)},[i]);let N=async e=>{try{y(!0),w(null);let t=await fetch("/api/local-projects/list-directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})});if(!t.ok)throw Error("Failed to list directory");let r=await t.json();x(r.items),e||c(r.path)}catch(e){w(e instanceof Error?e.message:String(e))}finally{y(!1)}},C=e=>{c(e)},E=d.find(e=>".."===e.name),S=d.filter(e=>".."!==e.name),P=(e=>{if(!e)return[];let t=e.includes("\\")?"\\":"/",r=e.split(t).filter(Boolean),a=e.startsWith("/");return r.map((e,o)=>{let s=r.slice(0,o+1).join(t);return a&&(s="/"+s),{name:e,path:s}})})(i);return(0,s.jsxs)("div",{className:"flex flex-col h-[400px] gap-4 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center border rounded-md p-1 gap-1 bg-muted/30",children:[(0,s.jsx)(n.Button,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",disabled:!E||k,onClick:()=>E&&C(E.path),title:"Go to parent directory",children:(0,s.jsx)(p,{className:"h-4 w-4"})}),(0,s.jsx)("div",{className:"w-px h-5 bg-border mx-1"}),(0,s.jsxs)("div",{ref:b,className:"flex-1 overflow-x-auto whitespace-nowrap flex items-center scrollbar-hide px-1 min-w-0",children:[(0,s.jsx)("button",{onClick:()=>C("/"),className:"hover:bg-accent p-1 rounded-sm transition-colors shrink-0",title:"Go to root",children:(0,s.jsx)(f.Home,{className:"h-4 w-4 text-muted-foreground"})}),P.map((e,t)=>(0,s.jsxs)("div",{className:"flex items-center shrink-0",children:[(0,s.jsx)(m.ChevronRight,{className:"h-3 w-3 text-muted-foreground mx-0.5 shrink-0"}),(0,s.jsx)("button",{onClick:()=>C(e.path),className:(0,j.cn)("px-1.5 py-0.5 rounded-sm transition-colors text-sm hover:bg-accent hover:text-accent-foreground",t===P.length-1?"font-medium text-foreground":"text-muted-foreground"),children:e.name})]},e.path))]})]}),(0,s.jsxs)("div",{className:"flex-1 border rounded-md overflow-hidden relative bg-background min-h-0",children:[k&&(0,s.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center z-10",children:(0,s.jsx)(u.Loader2,{className:"h-6 w-6 animate-spin"})}),v?(0,s.jsxs)("div",{className:"p-4 text-destructive text-sm text-center",children:[v,(0,s.jsx)(n.Button,{variant:"link",onClick:()=>N(i),className:"block mx-auto mt-2",children:"Retry"})]}):(0,s.jsx)("div",{className:"h-full overflow-auto",children:(0,s.jsx)("div",{className:"p-1",children:0!==S.length||k?S.map(e=>(0,s.jsxs)("button",{onClick:()=>C(e.path),className:"flex items-center gap-3 w-full px-3 py-2 text-sm rounded-sm hover:bg-accent hover:text-accent-foreground text-left group transition-colors",children:[(0,s.jsx)(h,{className:"h-4 w-4 text-blue-500 fill-blue-500/20 group-hover:fill-blue-500/30 transition-colors shrink-0"}),(0,s.jsx)("span",{className:"truncate",children:e.name})]},e.path)):(0,s.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"Empty directory"})})})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,s.jsx)(n.Button,{variant:"outline",onClick:t,disabled:k,children:"Cancel"}),(0,s.jsx)(n.Button,{onClick:()=>e(i),disabled:k||!i,children:a})]})]})}var g=e.i(39779),y=e.i(95403);function v({open:e,onOpenChange:t}){let{addProject:r,switchProject:o}=(0,c.useProject)(),[h,u]=(0,l.useState)(""),[p,f]=(0,l.useState)(!1),[m,j]=(0,l.useState)("picker"),v=(0,i.useRouter)();(0,l.useEffect)(()=>{e&&(j("picker"),u(""))},[e]);let w=async e=>{try{f(!0);let a=await r(e);await o(a.id),y.toast.success("Project added successfully"),t(!1),v.push("/")}catch(t){let e=t instanceof Error?t.message:"Failed to add project";y.toast.error(e)}finally{f(!1)}};return(0,s.jsx)(g.Dialog,{open:e,onOpenChange:t,children:(0,s.jsxs)(g.DialogContent,{className:"sm:max-w-[600px]",children:[(0,s.jsxs)(g.DialogHeader,{children:[(0,s.jsx)(g.DialogTitle,{children:"Add Project"}),(0,s.jsx)(g.DialogDescription,{children:"picker"===m?"Browse and select the project directory.":"Enter the absolute path to your local project directory."})]}),"picker"===m?(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(x,{onSelect:w,onCancel:()=>t(!1),initialPath:h,actionLabel:p?"Adding...":"Add Project",isLoading:p}),(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsx)(n.Button,{variant:"link",size:"sm",onClick:()=>j("manual"),className:"text-muted-foreground",children:"Enter path manually"})})]}):(0,s.jsxs)("form",{onSubmit:e=>{e.preventDefault(),h&&w(h)},children:[(0,s.jsx)("div",{className:"grid gap-4 py-4",children:(0,s.jsxs)("div",{className:"grid gap-2",children:[(0,s.jsx)("label",{htmlFor:"path",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Project Path"}),(0,s.jsx)("div",{className:"flex gap-2",children:(0,s.jsx)(d.Input,{id:"path",value:h,onChange:e=>u(e.target.value),placeholder:"/path/to/your/project",className:"flex-1",disabled:p})}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Select the root directory of your project."})]})}),(0,s.jsxs)(g.DialogFooter,{className:"flex-col sm:flex-row gap-2",children:[(0,s.jsx)("div",{className:"flex-1 flex justify-start",children:(0,s.jsxs)(n.Button,{type:"button",variant:"ghost",size:"sm",onClick:()=>j("picker"),children:[(0,s.jsx)(a,{className:"h-4 w-4 mr-2"}),"Browse folders"]})}),(0,s.jsx)(n.Button,{type:"button",variant:"outline",onClick:()=>t(!1),disabled:p,children:"Cancel"}),(0,s.jsx)(n.Button,{type:"submit",disabled:p||!h,children:p?"Adding...":"Add Project"})]})]})]})})}e.s(["CreateProjectDialog",()=>v],61877)}]);
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,20648,e=>{"use strict";var t=e.i(90022),r=e.i(31231);let a=(0,r.createContext)(null);function s(){let e=(0,r.useContext)(a);if(!e)throw Error("useProject must be used within ProjectProvider");return e}function o({children:e,initialProjectId:s}){let[o,l]=(0,r.useState)("single-project"),[i,c]=(0,r.useState)(null),[n,d]=(0,r.useState)([]),[h,u]=(0,r.useState)([]),[p,m]=(0,r.useState)([]),[j,f]=(0,r.useState)(!0),[x,g]=(0,r.useState)(null),y=(0,r.useCallback)(async()=>{try{f(!0),g(null);let e=await fetch("/api/projects");if(!e.ok)throw Error("Failed to fetch projects");let t=await e.json();if(l(t.mode||"single-project"),d(t.projects||[]),u(t.recentProjects||[]),m(t.favoriteProjects||[]),!i&&t.projects.length>0){let e=s?t.projects.find(e=>e.id===s):t.recentProjects[0]||t.projects[0];e&&c(e)}}catch(e){console.error("Error fetching projects:",e),g(e.message||"Failed to load projects")}finally{f(!1)}},[i,s]),v=(0,r.useCallback)(async e=>{try{let t=await fetch(`/api/projects/${e}`);if(!t.ok)throw Error("Failed to fetch project");let r=await t.json();c(r.project),await y()}catch(e){throw console.error("Error switching project:",e),g(e.message||"Failed to switch project"),e}},[y]),w=(0,r.useCallback)(async(e,t)=>{try{let r=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e,...t})});if(!r.ok){let e=await r.json();throw Error(e.details||"Failed to add project")}let a=await r.json();return await y(),a.project}catch(e){throw console.error("Error adding project:",e),g(e.message||"Failed to add project"),e}},[y]),b=(0,r.useCallback)(async e=>{try{if(!(await fetch(`/api/projects/${e}`,{method:"DELETE"})).ok)throw Error("Failed to remove project");if(i?.id===e){let t=n.find(t=>t.id!==e);c(t||null)}await y()}catch(e){throw console.error("Error removing project:",e),g(e.message||"Failed to remove project"),e}},[i,n,y]),k=(0,r.useCallback)(async e=>{try{if(!(await fetch(`/api/projects/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({favorite:!0})})).ok)throw Error("Failed to toggle favorite");await y()}catch(e){throw console.error("Error toggling favorite:",e),g(e.message||"Failed to toggle favorite"),e}},[y]),N=(0,r.useCallback)(async(e,t)=>{try{if(!(await fetch(`/api/projects/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).ok)throw Error("Failed to update project");await y()}catch(e){throw console.error("Error updating project:",e),g(e.message||"Failed to update project"),e}},[y]);return(0,r.useEffect)(()=>{y()},[]),(0,t.jsx)(a.Provider,{value:{mode:o,currentProject:i,projects:n,recentProjects:h,favoriteProjects:p,isLoading:j,error:x,switchProject:v,addProject:w,removeProject:b,toggleFavorite:k,updateProject:N,refreshProjects:y},children:e})}e.s(["ProjectProvider",()=>o,"useProject",()=>s])},87949,e=>{"use strict";let t=(0,e.i(22436).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",()=>t],87949)},52186,23882,28964,61877,e=>{"use strict";var t=e.i(22436);let r=(0,t.default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",()=>r],52186);let a=(0,t.default)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);e.s(["FolderOpen",()=>a],23882);let s=(0,t.default)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);e.s(["Star",()=>s],28964);var o=e.i(90022),l=e.i(31231),i=e.i(30827),c=e.i(20648),n=e.i(35893),d=e.i(21079);let h=(0,t.default)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);var u=e.i(87949);let p=(0,t.default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);var m=e.i(97332),j=e.i(25761),f=e.i(32137);function x({onSelect:e,onCancel:t,initialPath:r,actionLabel:a="Select This Folder",isLoading:s}){let[i,c]=(0,l.useState)(r||""),[d,x]=(0,l.useState)([]),[g,y]=(0,l.useState)(!1),[v,w]=(0,l.useState)(null),b=(0,l.useRef)(null),k=s||g;(0,l.useEffect)(()=>{N(i)},[i]),(0,l.useEffect)(()=>{b.current&&(b.current.scrollLeft=b.current.scrollWidth)},[i]);let N=async e=>{try{y(!0),w(null);let t=await fetch("/api/local-projects/list-directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})});if(!t.ok)throw Error("Failed to list directory");let r=await t.json();x(r.items),e||c(r.path)}catch(e){w(e instanceof Error?e.message:String(e))}finally{y(!1)}},C=e=>{c(e)},S=d.find(e=>".."===e.name),E=d.filter(e=>".."!==e.name),P=(e=>{if(!e)return[];let t=e.includes("\\")?"\\":"/",r=e.split(t).filter(Boolean),a=e.startsWith("/");return r.map((e,s)=>{let o=r.slice(0,s+1).join(t);return a&&(o="/"+o),{name:e,path:o}})})(i);return(0,o.jsxs)("div",{className:"flex flex-col h-[400px] gap-4 min-w-0",children:[(0,o.jsxs)("div",{className:"flex items-center border rounded-md p-1 gap-1 bg-muted/30",children:[(0,o.jsx)(n.Button,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",disabled:!S||k,onClick:()=>S&&C(S.path),title:"Go to parent directory",children:(0,o.jsx)(p,{className:"h-4 w-4"})}),(0,o.jsx)("div",{className:"w-px h-5 bg-border mx-1"}),(0,o.jsxs)("div",{ref:b,className:"flex-1 overflow-x-auto whitespace-nowrap flex items-center scrollbar-hide px-1 min-w-0",children:[(0,o.jsx)("button",{onClick:()=>C("/"),className:"hover:bg-accent p-1 rounded-sm transition-colors shrink-0",title:"Go to root",children:(0,o.jsx)(m.Home,{className:"h-4 w-4 text-muted-foreground"})}),P.map((e,t)=>(0,o.jsxs)("div",{className:"flex items-center shrink-0",children:[(0,o.jsx)(j.ChevronRight,{className:"h-3 w-3 text-muted-foreground mx-0.5 shrink-0"}),(0,o.jsx)("button",{onClick:()=>C(e.path),className:(0,f.cn)("px-1.5 py-0.5 rounded-sm transition-colors text-sm hover:bg-accent hover:text-accent-foreground",t===P.length-1?"font-medium text-foreground":"text-muted-foreground"),children:e.name})]},e.path))]})]}),(0,o.jsxs)("div",{className:"flex-1 border rounded-md overflow-hidden relative bg-background min-h-0",children:[k&&(0,o.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center z-10",children:(0,o.jsx)(u.Loader2,{className:"h-6 w-6 animate-spin"})}),v?(0,o.jsxs)("div",{className:"p-4 text-destructive text-sm text-center",children:[v,(0,o.jsx)(n.Button,{variant:"link",onClick:()=>N(i),className:"block mx-auto mt-2",children:"Retry"})]}):(0,o.jsx)("div",{className:"h-full overflow-auto",children:(0,o.jsx)("div",{className:"p-1",children:0!==E.length||k?E.map(e=>(0,o.jsxs)("button",{onClick:()=>C(e.path),className:"flex items-center gap-3 w-full px-3 py-2 text-sm rounded-sm hover:bg-accent hover:text-accent-foreground text-left group transition-colors",children:[(0,o.jsx)(h,{className:"h-4 w-4 text-blue-500 fill-blue-500/20 group-hover:fill-blue-500/30 transition-colors shrink-0"}),(0,o.jsx)("span",{className:"truncate",children:e.name})]},e.path)):(0,o.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"Empty directory"})})})]}),(0,o.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,o.jsx)(n.Button,{variant:"outline",onClick:t,disabled:k,children:"Cancel"}),(0,o.jsx)(n.Button,{onClick:()=>e(i),disabled:k||!i,children:a})]})]})}var g=e.i(39779),y=e.i(95403);function v({open:e,onOpenChange:t}){let{addProject:r,switchProject:s}=(0,c.useProject)(),[h,u]=(0,l.useState)(""),[p,m]=(0,l.useState)(!1),[j,f]=(0,l.useState)("picker"),v=(0,i.useRouter)();(0,l.useEffect)(()=>{e&&(f("picker"),u(""))},[e]);let w=async e=>{try{m(!0);let a=await r(e);await s(a.id),y.toast.success("Project added successfully"),t(!1),v.push("/")}catch(t){let e=t instanceof Error?t.message:"Failed to add project";y.toast.error(e)}finally{m(!1)}};return(0,o.jsx)(g.Dialog,{open:e,onOpenChange:t,children:(0,o.jsxs)(g.DialogContent,{className:"sm:max-w-[600px]",children:[(0,o.jsxs)(g.DialogHeader,{children:[(0,o.jsx)(g.DialogTitle,{children:"Add Project"}),(0,o.jsx)(g.DialogDescription,{children:"picker"===j?"Browse and select the project directory.":"Enter the absolute path to your local project directory."})]}),"picker"===j?(0,o.jsxs)("div",{className:"space-y-2",children:[(0,o.jsx)(x,{onSelect:w,onCancel:()=>t(!1),initialPath:h,actionLabel:p?"Adding...":"Add Project",isLoading:p}),(0,o.jsx)("div",{className:"flex justify-center",children:(0,o.jsx)(n.Button,{variant:"link",size:"sm",onClick:()=>f("manual"),className:"text-muted-foreground",children:"Enter path manually"})})]}):(0,o.jsxs)("form",{onSubmit:e=>{e.preventDefault(),h&&w(h)},children:[(0,o.jsx)("div",{className:"grid gap-4 py-4",children:(0,o.jsxs)("div",{className:"grid gap-2",children:[(0,o.jsx)("label",{htmlFor:"path",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Project Path"}),(0,o.jsx)("div",{className:"flex gap-2",children:(0,o.jsx)(d.Input,{id:"path",value:h,onChange:e=>u(e.target.value),placeholder:"/path/to/your/project",className:"flex-1",disabled:p})}),(0,o.jsx)("p",{className:"text-xs text-muted-foreground",children:"Select the root directory of your project."})]})}),(0,o.jsxs)(g.DialogFooter,{className:"flex-col sm:flex-row gap-2",children:[(0,o.jsx)("div",{className:"flex-1 flex justify-start",children:(0,o.jsxs)(n.Button,{type:"button",variant:"ghost",size:"sm",onClick:()=>f("picker"),children:[(0,o.jsx)(a,{className:"h-4 w-4 mr-2"}),"Browse folders"]})}),(0,o.jsx)(n.Button,{type:"button",variant:"outline",onClick:()=>t(!1),disabled:p,children:"Cancel"}),(0,o.jsx)(n.Button,{type:"submit",disabled:p||!h,children:p?"Adding...":"Add Project"})]})]})]})})}e.s(["CreateProjectDialog",()=>v],61877)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,20648,e=>{"use strict";var t=e.i(90022),r=e.i(31231);let a=(0,r.createContext)(null);function s(){let e=(0,r.useContext)(a);if(!e)throw Error("useProject must be used within ProjectProvider");return e}function o({children:e,initialProjectId:s}){let[o,l]=(0,r.useState)("single-project"),[i,c]=(0,r.useState)(null),[n,d]=(0,r.useState)([]),[h,u]=(0,r.useState)([]),[p,m]=(0,r.useState)([]),[j,f]=(0,r.useState)(!0),[x,g]=(0,r.useState)(null),y=(0,r.useCallback)(async()=>{try{f(!0),g(null);let e=await fetch("/api/projects");if(!e.ok)throw Error("Failed to fetch projects");let t=await e.json();if(l(t.mode||"single-project"),d(t.projects||[]),u(t.recentProjects||[]),m(t.favoriteProjects||[]),!i&&t.projects.length>0){let e=s?t.projects.find(e=>e.id===s):t.recentProjects[0]||t.projects[0];e&&c(e)}}catch(e){console.error("Error fetching projects:",e),g(e.message||"Failed to load projects")}finally{f(!1)}},[i,s]),v=(0,r.useCallback)(async e=>{try{let t=await fetch(`/api/projects/${e}`);if(!t.ok)throw Error("Failed to fetch project");let r=await t.json();c(r.project),await y()}catch(e){throw console.error("Error switching project:",e),g(e.message||"Failed to switch project"),e}},[y]),w=(0,r.useCallback)(async(e,t)=>{try{let r=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e,...t})});if(!r.ok){let e=await r.json();throw Error(e.details||"Failed to add project")}let a=await r.json();return await y(),a.project}catch(e){throw console.error("Error adding project:",e),g(e.message||"Failed to add project"),e}},[y]),b=(0,r.useCallback)(async e=>{try{if(!(await fetch(`/api/projects/${e}`,{method:"DELETE"})).ok)throw Error("Failed to remove project");if(i?.id===e){let t=n.find(t=>t.id!==e);c(t||null)}await y()}catch(e){throw console.error("Error removing project:",e),g(e.message||"Failed to remove project"),e}},[i,n,y]),k=(0,r.useCallback)(async e=>{try{if(!(await fetch(`/api/projects/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({favorite:!0})})).ok)throw Error("Failed to toggle favorite");await y()}catch(e){throw console.error("Error toggling favorite:",e),g(e.message||"Failed to toggle favorite"),e}},[y]),N=(0,r.useCallback)(async(e,t)=>{try{if(!(await fetch(`/api/projects/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).ok)throw Error("Failed to update project");await y()}catch(e){throw console.error("Error updating project:",e),g(e.message||"Failed to update project"),e}},[y]);return(0,r.useEffect)(()=>{y()},[]),(0,t.jsx)(a.Provider,{value:{mode:o,currentProject:i,projects:n,recentProjects:h,favoriteProjects:p,isLoading:j,error:x,switchProject:v,addProject:w,removeProject:b,toggleFavorite:k,updateProject:N,refreshProjects:y},children:e})}e.s(["ProjectProvider",()=>o,"useProject",()=>s])},87949,e=>{"use strict";let t=(0,e.i(22436).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",()=>t],87949)},52186,23882,28964,61877,e=>{"use strict";var t=e.i(22436);let r=(0,t.default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",()=>r],52186);let a=(0,t.default)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);e.s(["FolderOpen",()=>a],23882);let s=(0,t.default)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);e.s(["Star",()=>s],28964);var o=e.i(90022),l=e.i(31231),i=e.i(30827),c=e.i(20648),n=e.i(35893),d=e.i(21079);let h=(0,t.default)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);var u=e.i(87949);let p=(0,t.default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);var m=e.i(97332),j=e.i(25761),f=e.i(32137);function x({onSelect:e,onCancel:t,initialPath:r,actionLabel:a="Select This Folder",isLoading:s}){let[i,c]=(0,l.useState)(r||""),[d,x]=(0,l.useState)([]),[g,y]=(0,l.useState)(!1),[v,w]=(0,l.useState)(null),b=(0,l.useRef)(null),k=s||g;(0,l.useEffect)(()=>{N(i)},[i]),(0,l.useEffect)(()=>{b.current&&(b.current.scrollLeft=b.current.scrollWidth)},[i]);let N=async e=>{try{y(!0),w(null);let t=await fetch("/api/local-projects/list-directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})});if(!t.ok)throw Error("Failed to list directory");let r=await t.json();x(r.items),e||c(r.path)}catch(e){w(e instanceof Error?e.message:String(e))}finally{y(!1)}},C=e=>{c(e)},S=d.find(e=>".."===e.name),E=d.filter(e=>".."!==e.name),P=(e=>{if(!e)return[];let t=e.includes("\\")?"\\":"/",r=e.split(t).filter(Boolean),a=e.startsWith("/");return r.map((e,s)=>{let o=r.slice(0,s+1).join(t);return a&&(o="/"+o),{name:e,path:o}})})(i);return(0,o.jsxs)("div",{className:"flex flex-col h-[400px] gap-4 min-w-0",children:[(0,o.jsxs)("div",{className:"flex items-center border rounded-md p-1 gap-1 bg-muted/30",children:[(0,o.jsx)(n.Button,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",disabled:!S||k,onClick:()=>S&&C(S.path),title:"Go to parent directory",children:(0,o.jsx)(p,{className:"h-4 w-4"})}),(0,o.jsx)("div",{className:"w-px h-5 bg-border mx-1"}),(0,o.jsxs)("div",{ref:b,className:"flex-1 overflow-x-auto whitespace-nowrap flex items-center scrollbar-hide px-1 min-w-0",children:[(0,o.jsx)("button",{onClick:()=>C("/"),className:"hover:bg-accent p-1 rounded-sm transition-colors shrink-0",title:"Go to root",children:(0,o.jsx)(m.Home,{className:"h-4 w-4 text-muted-foreground"})}),P.map((e,t)=>(0,o.jsxs)("div",{className:"flex items-center shrink-0",children:[(0,o.jsx)(j.ChevronRight,{className:"h-3 w-3 text-muted-foreground mx-0.5 shrink-0"}),(0,o.jsx)("button",{onClick:()=>C(e.path),className:(0,f.cn)("px-1.5 py-0.5 rounded-sm transition-colors text-sm hover:bg-accent hover:text-accent-foreground",t===P.length-1?"font-medium text-foreground":"text-muted-foreground"),children:e.name})]},e.path))]})]}),(0,o.jsxs)("div",{className:"flex-1 border rounded-md overflow-hidden relative bg-background min-h-0",children:[k&&(0,o.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center z-10",children:(0,o.jsx)(u.Loader2,{className:"h-6 w-6 animate-spin"})}),v?(0,o.jsxs)("div",{className:"p-4 text-destructive text-sm text-center",children:[v,(0,o.jsx)(n.Button,{variant:"link",onClick:()=>N(i),className:"block mx-auto mt-2",children:"Retry"})]}):(0,o.jsx)("div",{className:"h-full overflow-auto",children:(0,o.jsx)("div",{className:"p-1",children:0!==E.length||k?E.map(e=>(0,o.jsxs)("button",{onClick:()=>C(e.path),className:"flex items-center gap-3 w-full px-3 py-2 text-sm rounded-sm hover:bg-accent hover:text-accent-foreground text-left group transition-colors",children:[(0,o.jsx)(h,{className:"h-4 w-4 text-blue-500 fill-blue-500/20 group-hover:fill-blue-500/30 transition-colors shrink-0"}),(0,o.jsx)("span",{className:"truncate",children:e.name})]},e.path)):(0,o.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"Empty directory"})})})]}),(0,o.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,o.jsx)(n.Button,{variant:"outline",onClick:t,disabled:k,children:"Cancel"}),(0,o.jsx)(n.Button,{onClick:()=>e(i),disabled:k||!i,children:a})]})]})}var g=e.i(39779),y=e.i(95403);function v({open:e,onOpenChange:t}){let{addProject:r,switchProject:s}=(0,c.useProject)(),[h,u]=(0,l.useState)(""),[p,m]=(0,l.useState)(!1),[j,f]=(0,l.useState)("picker"),v=(0,i.useRouter)();(0,l.useEffect)(()=>{e&&(f("picker"),u(""))},[e]);let w=async e=>{try{m(!0);let a=await r(e);await s(a.id),y.toast.success("Project added successfully"),t(!1),v.push("/")}catch(t){let e=t instanceof Error?t.message:"Failed to add project";y.toast.error(e)}finally{m(!1)}};return(0,o.jsx)(g.Dialog,{open:e,onOpenChange:t,children:(0,o.jsxs)(g.DialogContent,{className:"sm:max-w-[600px]",children:[(0,o.jsxs)(g.DialogHeader,{children:[(0,o.jsx)(g.DialogTitle,{children:"Add Project"}),(0,o.jsx)(g.DialogDescription,{children:"picker"===j?"Browse and select the project directory.":"Enter the absolute path to your local project directory."})]}),"picker"===j?(0,o.jsxs)("div",{className:"space-y-2",children:[(0,o.jsx)(x,{onSelect:w,onCancel:()=>t(!1),initialPath:h,actionLabel:p?"Adding...":"Add Project",isLoading:p}),(0,o.jsx)("div",{className:"flex justify-center",children:(0,o.jsx)(n.Button,{variant:"link",size:"sm",onClick:()=>f("manual"),className:"text-muted-foreground",children:"Enter path manually"})})]}):(0,o.jsxs)("form",{onSubmit:e=>{e.preventDefault(),h&&w(h)},children:[(0,o.jsx)("div",{className:"grid gap-4 py-4",children:(0,o.jsxs)("div",{className:"grid gap-2",children:[(0,o.jsx)("label",{htmlFor:"path",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Project Path"}),(0,o.jsx)("div",{className:"flex gap-2",children:(0,o.jsx)(d.Input,{id:"path",value:h,onChange:e=>u(e.target.value),placeholder:"/path/to/your/project",className:"flex-1",disabled:p})}),(0,o.jsx)("p",{className:"text-xs text-muted-foreground",children:"Select the root directory of your project."})]})}),(0,o.jsxs)(g.DialogFooter,{className:"flex-col sm:flex-row gap-2",children:[(0,o.jsx)("div",{className:"flex-1 flex justify-start",children:(0,o.jsxs)(n.Button,{type:"button",variant:"ghost",size:"sm",onClick:()=>f("picker"),children:[(0,o.jsx)(a,{className:"h-4 w-4 mr-2"}),"Browse folders"]})}),(0,o.jsx)(n.Button,{type:"button",variant:"outline",onClick:()=>t(!1),disabled:p,children:"Cancel"}),(0,o.jsx)(n.Button,{type:"submit",disabled:p||!h,children:p?"Adding...":"Add Project"})]})]})]})})}e.s(["CreateProjectDialog",()=>v],61877)}]);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/.next/static/{XaKCij6ONZQYRwoNl_cx7 → iWGI_kVMs-xybaG9ZCyWK}/_clientMiddlewareManifest.json
RENAMED
|
File without changes
|
|
File without changes
|