ikanban-web 0.2.9 → 0.2.10

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.
@@ -0,0 +1 @@
1
+ import{u as K,a as N,b as q,c as H,d as T,e as V,f as J,g as Q,h as P,s as U,i as W,j as t,k as s,L as X,B as z,l as I,m as Y,n as Z,D as ee,M as A,I as L,S as R,o as O,p as te,t as c,F as re,q as se,r as le,v as ie}from"./index-n2BMSLCz.js";var ne=c("<div>"),oe=c('<div class="mt-6 flex w-full flex-col gap-6"><section class="flex flex-col gap-4"><div class="grid gap-3 lg:grid-cols-2">'),ae=c('<div class="mt-6 rounded-2xl border border-dashed border-border-weak bg-background-base/60 px-6 py-10"><div class="mx-auto flex max-w-md flex-col items-center gap-3 text-center"><div class="flex size-12 items-center justify-center rounded-2xl border border-border-weak bg-background-base/80"></div><div class="flex flex-col gap-1 items-center justify-center"><div class="text-14-medium text-text-strong"></div><div class="text-12-regular text-text-weak">'),ce=c('<div class="mx-auto w-full max-w-7xl px-4 py-6 md:px-6 md:py-8"><div class="flex flex-col gap-4 md:flex-row md:items-start md:justify-between"><div class=min-w-0><div class="flex items-center gap-3"><div class="flex size-10 items-center justify-center rounded-2xl border border-border-weak bg-background-base/80"></div><div><div class="text-18-medium text-text-strong"></div><div class="mt-0.5 text-12-regular text-text-weak"></div></div></div></div><div class="flex items-center gap-2 self-start md:justify-end">'),de=c('<div class="rounded-xl border border-dashed border-border-weak px-3 py-8 text-center text-12-regular text-text-weak">'),ue=c('<section class="rounded-2xl border border-border-weak bg-background-base/80 p-3 md:p-4 min-h-72"><div class="flex items-center justify-between gap-3"><div class="flex items-center gap-2 min-w-0"><div></div><div class="text-14-medium text-text-strong"></div></div><div class="text-12-mono text-text-weak"></div></div><div class="mt-3 flex flex-col gap-2">'),me=c('<span class="min-w-0 flex-1 truncate text-12-regular text-text-weak">'),ge=c('<div class="flex shrink-0 items-center gap-2 text-12-regular text-text-weak"><span>'),fe=c('<div class="overflow-hidden rounded-xl border border-border-weak bg-background-base/70 hover:border-border-strong"><div class="flex items-start justify-between gap-3 px-3 pt-3"><div class="min-w-0 flex-1 pt-1"><div class="truncate text-14-medium leading-tight text-text-strong">');function xe(){const l=K(),j=N(),x=q(),h=H(),v=T(),b=V(),g=J(),i=Q(),C=P(()=>l.data.project.slice().sort((e,r)=>(r.time.updated??r.time.created)-(e.time.updated??e.time.created)).slice(0,5)),n=P(()=>{const e=Date.now(),r={progress:[],idle:[]};for(const a of C()){const[d]=l.child(a.worktree),u=U(d,e);for(const f of u){const y=d.session_status[f.id],B=f.time.updated??f.time.created,_={session:f,projectDirectory:a.worktree,updatedAt:B};if(y?.type==="busy"||y?.type==="retry"){r.progress.push(_);continue}r.idle.push(_)}}for(const a of Object.keys(r))r[a].sort((d,u)=>u.updatedAt-d.updatedAt);return r});W(()=>{for(const e of C())l.child(e.worktree)});const w=P(()=>{const e=g.healthy();return e===!0?"bg-icon-success-base":e===!1?"bg-icon-critical-base":"bg-border-weak-base"});function $(e){j.projects.open(e),g.projects.touch(e),v(`/${O(e)}/session`)}function S(e,r){j.projects.open(e),g.projects.touch(e),v(`/${O(e)}/session/${r}`)}async function D(e,r){const[,a]=l.child(e,{bootstrap:!1});await b.client.session.update({sessionID:r,time:{archived:Date.now()}}),a("session",d=>d.filter(u=>u.id!==r))}async function o(){function e(r){if(Array.isArray(r))for(const a of r)$(a);else r&&$(r)}if(x.openDirectoryPickerDialog&&g.isLocal()){const r=await x.openDirectoryPickerDialog?.({title:i.t("command.project.open"),multiple:!0});e(r)}else h.show(()=>s(te,{multiple:!0,onSelect:e}),()=>e(null))}return(()=>{var e=ce(),r=e.firstChild,a=r.firstChild,d=a.firstChild,u=d.firstChild,f=u.nextSibling,y=f.firstChild,B=y.nextSibling,_=a.nextSibling;return t(u,s(X,{class:"w-6 opacity-90"})),t(y,()=>i.t("home.sessionBoard")),t(B,()=>i.t("home.sessionBoard.description")),t(_,s(z,{icon:"folder-add-left",size:"normal",class:"pl-2 pr-3",onClick:o,get children(){return i.t("command.project.open")}}),null),t(_,s(z,{size:"normal",variant:"ghost",class:"pr-3 text-13-regular text-text-weak",onClick:()=>h.show(()=>s(ee,{})),get children(){return[(()=>{var m=ne();return I(p=>Y(m,{"size-2 rounded-full":!0,[w()]:!0},p)),m})(),Z(()=>g.name)]}}),null),t(e,s(R,{get children(){return[s(A,{get when(){return l.data.project.length>0},get children(){var m=oe(),p=m.firstChild,k=p.firstChild;return t(k,s(E,{get title(){return i.t("home.sessionBoard.progress")},icon:"brain",tone:"progress",get cards(){return n().progress},onOpen:S,onArchive:D,get empty(){return i.t("home.sessionBoard.emptyProgress")}}),null),t(k,s(E,{get title(){return i.t("home.sessionBoard.idle")},icon:"dash",tone:"idle",get cards(){return n().idle},onOpen:S,onArchive:D,get empty(){return i.t("home.sessionBoard.emptyIdle")}}),null),m}}),s(A,{when:!0,get children(){var m=ae(),p=m.firstChild,k=p.firstChild,F=k.nextSibling,M=F.firstChild,G=M.nextSibling;return t(k,s(L,{name:"folder-add-left",size:"large"})),t(M,()=>i.t("home.empty.title")),t(G,()=>i.t("home.empty.description")),t(p,s(z,{class:"mt-1 px-3",onClick:o,get children(){return i.t("command.project.open")}}),null),m}})]}}),null),e})()}function E(l){const j=()=>l.tone==="progress"?"bg-emerald-500/12 text-emerald-300 border-emerald-500/20":"bg-sky-500/12 text-sky-300 border-sky-500/20";return(()=>{var x=ue(),h=x.firstChild,v=h.firstChild,b=v.firstChild,g=b.nextSibling,i=v.nextSibling,C=h.nextSibling;return t(b,s(L,{get name(){return l.icon},size:"small"})),t(g,()=>l.title),t(i,()=>l.cards.length),t(C,s(R,{get children(){return[s(A,{get when(){return l.cards.length>0},get children(){return s(re,{get each(){return l.cards},children:n=>(()=>{var w=fe(),$=w.firstChild,S=$.firstChild,D=S.firstChild;return t(D,()=>n.session.title),t($,s(se,{icon:"archive",variant:"ghost",class:"size-7 rounded-md","aria-label":"Archive session",onClick:o=>{o.preventDefault(),o.stopPropagation(),l.onArchive(n.projectDirectory,n.session.id)}}),null),t(w,s(z,{variant:"ghost",class:"flex h-auto w-full min-w-0 items-center justify-between gap-3 rounded-none border-0 bg-transparent px-3 pb-3 pt-2 text-left",onClick:()=>l.onOpen(n.projectDirectory,n.session.id),get children(){return[(()=>{var o=me();return t(o,()=>n.projectDirectory.replace(/^.*?([^/\\]+(?:[/\\][^/\\]+)?)$/,"$1")),o})(),(()=>{var o=ge(),e=o.firstChild;return t(e,()=>le.fromMillis(n.updatedAt).toRelative()),t(o,s(L,{name:"arrow-right",size:"small",class:"text-icon-weak shrink-0"}),null),o})()]}}),null),w})()})}}),s(A,{when:!0,get children(){var n=de();return t(n,()=>l.empty),n}})]}})),I(()=>ie(b,`size-7 rounded-full border flex items-center justify-center ${j()}`)),x})()}export{xe as default};