@dubusoft/toodo-linux-arm64 1.11.1-dev.193 → 1.11.1-dev.194
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/bin/toodo +0 -0
- package/bin/toodo-server +0 -0
- package/package.json +1 -1
- package/web/assets/Item-lIxHjWj_.js +2 -0
- package/web/assets/{LayoutChangeSnapshot-Bqg4192Z.js → LayoutChangeSnapshot-D3xatAtC.js} +1 -1
- package/web/assets/{MenuBottomSheet-BJroUUHj.js → MenuBottomSheet-c34lL1NX.js} +1 -1
- package/web/assets/{MenuBottomSheetActionList-CBSD5g2j.js → MenuBottomSheetActionList-vpV_l1kc.js} +1 -1
- package/web/assets/{Selector-DLgfOtoe.js → Selector-C5qvx4hg.js} +2 -2
- package/web/assets/{SwipeActionsLayer-Ckqx5mxc.js → SwipeActionsLayer-DoZybr_Y.js} +1 -1
- package/web/assets/{button-HISRpujD.js → button-BGH43TyY.js} +1 -1
- package/web/assets/{details-sheet-xeOYGWN1.js → details-sheet-CocFq_H_.js} +1 -1
- package/web/assets/focusOutline.stylex-tP8rBkq-.js +1 -0
- package/web/assets/{focusReturn-DgQoALUE.js → focusReturn-CZYsdEBO.js} +1 -1
- package/web/assets/index-Cbw2q6IR.js +69 -0
- package/web/assets/{index-CP08_gh8.css → index-DCOB-S8R.css} +1 -1
- package/web/assets/{inputHold-CZa_Ny55.js → inputHold-Vm2aa67t.js} +1 -1
- package/web/assets/{markdown-CF5mtzHh.js → markdown-Bm09hfWj.js} +1 -1
- package/web/assets/{offline-screen-BFZbD4uz.js → offline-screen-hN5S_H90.js} +1 -1
- package/web/assets/{padding.stylex-DG4aFJ6m.js → padding.stylex-B1SBwjoO.js} +1 -1
- package/web/assets/{primaryClick-88oQu3_u.js → primaryClick-BsGCoCcT.js} +1 -1
- package/web/assets/{queries-BIWwhSPP.js → queries-D7Y7ESQJ.js} +1 -1
- package/web/assets/{reducedMotion-DCkUC6gt.js → reducedMotion-DHbcKoD2.js} +1 -1
- package/web/assets/{resolveSnapPoint-CBS37OcT.js → resolveSnapPoint-Bn5gTeO7.js} +1 -1
- package/web/assets/review-Bjc8qkoS.js +1 -0
- package/web/assets/{server-access-BHLPABjm.js → server-access-iPbJHIgj.js} +1 -1
- package/web/assets/{task-details-BOmp_J1t.js → task-details-BK0aw1hF.js} +2 -2
- package/web/assets/{task-graph-DmsWWo8o.js → task-graph-CXE_z0tI.js} +3 -3
- package/web/assets/{useLayerDismissal-D77qBJbE.js → useLayerDismissal-BVKANkUt.js} +1 -1
- package/web/assets/{useLinkComponent-DLC334Kf.js → useLinkComponent-BjJ-sXiE.js} +3 -3
- package/web/assets/useTooltip-wT5GvIfc.js +1 -0
- package/web/index.html +17 -17
- package/web/sw.js +2 -2
- package/web/version.json +1 -1
- package/web/assets/Item-BoYwvmT7.js +0 -2
- package/web/assets/Tooltip-D2N09Hzl.js +0 -1
- package/web/assets/focusOutline.stylex-ZXdUNMFw.js +0 -1
- package/web/assets/index-Dyu1QOHD.js +0 -69
- package/web/assets/review-CvfkC7xA.js +0 -1
- package/web/assets/useTooltip-Dd70k22y.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{n as t,t as n}from"./jsx-runtime-C3cWAN_r.js";import{t as r,u as i}from"./Selector-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{n as t,t as n}from"./jsx-runtime-C3cWAN_r.js";import{t as r,u as i}from"./Selector-C5qvx4hg.js";import{t as a}from"./button-BGH43TyY.js";import{a as o,i as s,n as c,o as l,r as u}from"./index-Cbw2q6IR.js";import{d,r as f,s as p,u as m}from"./session-sBDFnC3r.js";var h=e(t(),1),g=n();function _({children:e}){let t=(0,h.useSyncExternalStore)(d,p),[n,r]=(0,h.useState)(!1);return(0,h.useEffect)(()=>{if(t)return;let e=!0;return f().catch(e=>console.warn(`toodo: could not ask the server about Cloudflare Access`,e)).finally(()=>{e&&r(!0)}),()=>{e=!1,r(!1)}},[t]),t?e:n?(0,g.jsx)(b,{}):null}var v=[{value:`full`,label:`Full access`},{value:`read`,label:`Read-only`}],y=u.map(({label:e,days:t})=>({value:t===null?`never`:String(t),label:e}));function b(){let[e,t]=(0,h.useState)(``),[n,u]=(0,h.useState)(()=>o(navigator.userAgent)),[d,f]=(0,h.useState)(c.scope),[p,_]=(0,h.useState)(String(c.expiresInDays)),[b,x]=(0,h.useState)(null),[S,C]=(0,h.useState)(!1),[w,T]=(0,h.useState)(!1),E=(0,h.useRef)(null),D=(0,h.useId)(),O=`${D}-help`,k=`${D}-rejected`;async function A(t){t.preventDefault(),T(!0),x(null),C(!1);try{let t=p===`never`?null:Number(p);m(await l(e.trim(),n.trim(),{scope:d,expiresInDays:t}))}catch(e){e instanceof s?(C(!0),E.current?.focus(),E.current?.select()):e instanceof TypeError?x(`Could not reach the server: ${String(e)}`):x(e instanceof Error?e.message:String(e))}finally{T(!1)}}return(0,g.jsx)(`main`,{className:`flex min-h-svh flex-col items-center justify-center gap-4 p-6`,children:(0,g.jsxs)(`form`,{onSubmit:A,"aria-label":`Server access`,className:`flex w-full max-w-sm flex-col gap-3 rounded-lg border p-5`,children:[(0,g.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Toodo server`}),(0,g.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Sign in with the server's access token. This browser then gets a token of its own, which you can revoke under Devices.`}),(0,g.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,g.jsx)(i,{ref:E,label:`Access token`,type:`password`,autoComplete:`current-password`,value:e,onChange:e=>{t(e),C(!1)},status:S?{type:`error`}:void 0,"aria-describedby":S?`${k} ${O}`:O}),S&&(0,g.jsxs)(`p`,{id:k,role:`alert`,className:`text-xs text-destructive`,children:[`The server did not accept this token. Paste the whole contents of`,` `,(0,g.jsx)(`code`,{className:`text-xs`,children:`web-token`}),` again; a device token stops working once it is revoked.`]}),(0,g.jsxs)(`p`,{id:O,className:`text-xs text-muted-foreground`,children:[`Copy it from `,(0,g.jsx)(`code`,{className:`text-xs`,children:`web-token`}),` in the server's data directory.`]})]}),(0,g.jsx)(i,{label:`Device name`,description:`Signing in again under a device's name replaces that device, so give each browser its own name.`,value:n,onChange:e=>u(e.slice(0,80))}),(0,g.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,g.jsx)(r,{label:`Access`,options:v,value:d,onChange:e=>f(e)}),(0,g.jsx)(r,{label:`Token expires after`,options:y,value:p,onChange:_})]}),(0,g.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Applies when you sign in with `,(0,g.jsx)(`code`,{className:`text-xs`,children:`web-token`}),`. When the token expires, sign in again.`]}),b&&(0,g.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:b}),(0,g.jsx)(a,{type:`submit`,variant:`primary`,label:w?`Checking...`:`Continue`,isDisabled:w||!e.trim()||!n.trim()})]})})}export{_ as ServerAccess};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{n as t,t as n}from"./jsx-runtime-C3cWAN_r.js";import{n as r,t as i}from"./button-HISRpujD.js";import{t as a}from"./details-sheet-xeOYGWN1.js";import{F as o,Ft as s,H as c,I as l,Lt as u,Rt as d,U as f,W as p,Wt as m,at as h,ct as g,dt as _,ft as v,it as y,lt as b,mt as x,ot as S,pt as C,st as w,zt as T}from"./index-Dyu1QOHD.js";import{t as E,u as D}from"./Selector-DLgfOtoe.js";import{N as O,Nt as ee,Ot as k,Pt as A,dt as j,f as M,jt as N,m as P,nt as te,o as ne,p as re,qt as F,st as ie,v as I,z as L}from"./queries-BIWwhSPP.js";import{t as R}from"./opener-DWhHPoCL.js";import{t as z}from"./createLucideIcon-DtNDbJdC.js";var B={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};B.node;var V=z(B),H={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};H.node;var U=z(H),W={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};W.node;var G=z(W),K=e(t(),1),q=n();function J({onClose:e,children:t}){let n=(0,K.useRef)(null),[r,o]=(0,K.useState)(!1);function s(){n.current?.querySelector(`form[data-dirty]`)?o(!0):e()}return(0,K.useEffect)(()=>{function e(e){e.key!==`Escape`||e.defaultPrevented||document.querySelector(`[aria-haspopup='menu'][aria-expanded='true']`)||(r?o(!1):e.target instanceof HTMLElement&&e.target.closest(`input, textarea, select, [role=combobox], [role=listbox]`)||s())}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)}),(0,q.jsx)(a,{ref:n,width:`min(480px, max(360px, 40vw), calc(100vw - 32px))`,onClose:s,banner:r&&(0,q.jsxs)(`div`,{role:`group`,"aria-label":`Unsaved changes`,className:`flex shrink-0 flex-wrap items-center gap-2 border-b bg-muted px-4 py-2 text-xs`,children:[(0,q.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Discard your unsaved changes?`}),(0,q.jsx)(i,{size:`sm`,variant:`secondary`,label:`Keep editing`,autoFocus:!0,onClick:()=>o(!1)}),(0,q.jsx)(i,{size:`sm`,variant:`destructive`,label:`Discard changes`,onClick:e})]}),children:t})}function Y(e){switch(e.status){case`in_progress`:return`Started`;case`in_review`:return`In review`;case`done`:return`Completed`;case`planned`:return e.reopened?`Reopened`:`Paused`}}function ae({task:e}){let t=e.timeline.filter(e=>e.reason!==null);return t.length===0?null:(0,q.jsx)(`ol`,{"aria-label":`Reasons of #${e.id}`,className:`mt-1 flex flex-col gap-0.5`,children:t.map((e,t)=>(0,q.jsxs)(`li`,{className:`flex min-w-0 items-baseline gap-2 max-md:flex-wrap max-md:gap-y-0`,children:[(0,q.jsx)(k,{className:`shrink-0 text-muted-foreground`,at:e.at}),(0,q.jsx)(`span`,{className:`shrink-0 font-medium`,children:Y(e)}),(0,q.jsx)(`span`,{className:`min-w-0 whitespace-pre-line break-words-keep max-md:basis-full`,children:e.reason})]},t))})}var oe={lane:`Lane`,discord:`Discord`,pr:`PR`};function se({value:e}){if(/^https?:\/\//i.test(e)){let t=t=>{t.preventDefault(),R(e).catch(t=>console.error(`Failed to open ${e}`,t))};return(0,q.jsx)(`a`,{href:e,onClick:t,onAuxClick:t,className:`min-w-0 break-all text-primary underline underline-offset-2 hover:no-underline`,children:e})}let t=e.indexOf(`:`),n=t>0?oe[e.slice(0,t)]:void 0;return n===void 0?(0,q.jsx)(`code`,{className:`min-w-0 break-all`,children:e}):(0,q.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-1`,children:[(0,q.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:n}),(0,q.jsx)(`code`,{className:`min-w-0 break-all`,children:e.slice(t+1)})]})}function ce({task:e}){return e.refs.length===0?null:(0,q.jsx)(w,{label:`Refs`,children:(0,q.jsx)(`ul`,{"aria-label":`Refs of #${e.id}`,className:`flex flex-col gap-0.5`,children:e.refs.map(e=>(0,q.jsx)(`li`,{className:`flex min-w-0`,children:(0,q.jsx)(se,{value:e})},e))})})}function le({task:e,detailed:t}){let n=A(e.milestones);return n.length===0?null:t?(0,q.jsxs)(w,{label:`Timeline`,children:[(0,q.jsx)(`dl`,{"aria-label":`Timeline of #${e.id}`,className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5`,children:n.map(({label:e,at:t})=>(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,q.jsx)(`dd`,{children:(0,q.jsx)(k,{at:t})})]},e))}),(0,q.jsx)(ae,{task:e})]}):(0,q.jsx)(`p`,{"aria-label":`Timeline of #${e.id}`,className:`flex flex-wrap gap-x-2 text-xs text-muted-foreground`,children:n.map(({label:e,at:t})=>(0,q.jsx)(k,{at:t,prefix:`${e} `},e))})}function ue({task:e,tasks:t,context:n,navigation:a}){let o=te(),s=ne(),c=L(),l=(o.data??[]).flatMap(({taskId:t,relatedId:n})=>t===e.id?[n]:n===e.id?[t]:[]).filter(e=>n.byId.has(e)),u=t.filter(t=>t.id!==e.id&&!l.includes(t.id)),d=[...new Set([e.workspaceId,...u.map(e=>e.workspaceId)])].map(e=>({workspaceId:e,tasks:u.filter(t=>t.workspaceId===e)})).filter(e=>e.tasks.length>0),f=C(),p=s.isPending||c.isPending||f,m=s.error??c.error;if(l.length===0&&d.length===0)return null;let h=d.length>0&&(0,q.jsx)(E,{label:`Add related task to #${e.id}`,isLabelHidden:!0,size:`sm`,width:192,placeholder:`Add related task...`,value:``,isDisabled:p,options:d.map(e=>({type:`section`,title:n.workspaceName(e.workspaceId),options:e.tasks.map(e=>({value:String(e.id),label:`#${e.id} ${e.title}`}))})),onChange:t=>{t&&s.mutate({taskId:e.id,relatedId:Number(t)})}}),g=m&&(0,q.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:m.message});return l.length===0?(0,q.jsxs)(`div`,{className:`flex flex-col gap-1 text-xs`,children:[h,g]}):(0,q.jsxs)(w,{label:`Related`,children:[(0,q.jsxs)(`ul`,{"aria-label":`Related tasks of #${e.id}`,className:`flex flex-wrap items-center gap-1 max-md:gap-2`,children:[l.map(t=>{let o=n.byId.get(t),s=v(t,e.workspaceId,n);return(0,q.jsxs)(`li`,{className:`inline-flex min-w-0 items-center max-md:gap-2`,children:[(0,q.jsx)(i,{size:`sm`,variant:`secondary`,label:o===void 0?s:`${s} ${o.title}`,"aria-label":`Open related task ${s}`,tooltip:o?.title,className:`min-w-0 max-w-56 tabular-nums`,isDisabled:a===void 0||!a.canOpen(t),onClick:()=>a?.open(t)}),(0,q.jsx)(r,{size:`sm`,variant:`ghost`,label:`Remove related task #${t} from #${e.id}`,tooltip:`Remove related task`,icon:(0,q.jsx)(T,{}),isDisabled:p,onClick:()=>c.mutate({taskId:e.id,relatedId:t})})]},t)}),h]}),g]})}function de({task:e}){let t=ie();return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(i,{size:`sm`,variant:e.autopilot?`primary`:`secondary`,changesData:!0,"aria-pressed":e.autopilot,"aria-label":`Autopilot of #${e.id}`,label:e.autopilot?`Autopilot on`:`Autopilot off`,icon:(0,q.jsx)(m,{"aria-hidden":!0}),tooltip:e.autopilot?`Marked for autopilot: an executor may take it up on its own once it is ready. Click to clear.`:`Not marked for autopilot. Click to let an executor take it up on its own once it is ready.`,isDisabled:t.isPending,onClick:()=>t.mutate({status:null,id:e.id,taskType:e.taskType,title:e.title,description:e.description,estimate:e.estimate,dueDate:e.dueDate,autopilot:!e.autopilot,criteria:null}),className:`shrink-0`}),t.error&&(0,q.jsx)(`span`,{role:`alert`,className:`text-xs text-destructive`,children:t.error.message})]})}function fe({task:e}){let t=j(),n=O(),r=C(),i=t.data??[];return i.length<2?null:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`inline-flex`,title:`Move the task to another workspace; its history, notes, criteria, refs, and links stay`,children:(0,q.jsx)(E,{label:`Workspace of #${e.id}`,isLabelHidden:!0,size:`sm`,width:160,value:String(e.workspaceId),isDisabled:n.isPending||r,options:i.map(e=>({value:String(e.id),label:e.name})),onChange:t=>n.mutate({id:e.id,workspaceId:Number(t)})})}),n.error&&(0,q.jsx)(`span`,{role:`alert`,className:`text-xs text-destructive`,children:n.error.message})]})}function pe({task:e}){return(0,q.jsxs)(q.Fragment,{children:[(e.estimate!==null||e.dueDate!==null)&&(0,q.jsxs)(`p`,{"aria-label":`Plan of #${e.id}`,className:`flex flex-wrap gap-x-2 text-xs text-muted-foreground`,children:[e.estimate!==null&&(0,q.jsxs)(`span`,{children:[`Estimate `,s(e.estimate)]}),e.dueDate!==null&&(0,q.jsx)(g,{task:e})]}),(0,q.jsx)(_,{task:e}),(0,q.jsx)(ce,{task:e})]})}var me={progress:`Progress`,blocker:`Blocker`,decision:`Decision`},he={progress:`neutral`,blocker:`warning`,decision:`info`};function X({kind:e}){return(0,q.jsx)(u,{"data-note-kind":e,className:`shrink-0`,variant:he[e],label:me[e]})}function Z({task:e,detailed:t}){let n=e.notes;if(n.length===0)return null;if(!t){let t=n[n.length-1];return(0,q.jsxs)(`p`,{"aria-label":`Latest note of #${e.id}`,className:`flex min-w-0 items-center gap-1.5 text-xs`,title:N(t.at),children:[(0,q.jsx)(X,{kind:t.kind}),(0,q.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:p(t.body)}),n.length>1&&(0,q.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`+${n.length-1} more`})]})}return(0,q.jsx)(w,{label:`Notes (${n.length})`,children:(0,q.jsx)(`ol`,{"aria-label":`Notes of #${e.id}`,className:`flex flex-col gap-2`,children:n.map((e,t)=>(0,q.jsxs)(`li`,{className:`flex flex-col gap-0.5`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,q.jsx)(X,{kind:e.kind}),(0,q.jsx)(k,{className:`text-muted-foreground`,at:e.at})]}),(0,q.jsx)(K.Suspense,{fallback:(0,q.jsx)(`p`,{className:`whitespace-pre-line break-words-keep`,children:e.body}),children:(0,q.jsx)(b,{source:e.body})})]},t))})})}var ge={pending:`Pending`,met:`Met`,failed:`Failed`},_e={pending:F.neutral,met:F.success,failed:F.danger},Q={user:`you`,agent:`an agent`,toodo:`Toodo`};function $({state:e}){let t=e===`met`?V:e===`failed`?U:G;return(0,q.jsx)(`span`,{role:`img`,"aria-label":ge[e],className:x(`flex size-4 shrink-0 items-center justify-center`,_e[e]),children:(0,q.jsx)(t,{"aria-hidden":!0,className:`size-3.5`})})}function ve(e){if(e.checkedBy===null)return null;let t=e.checkedAt===null?``:` ${ee(e.checkedAt)}`;return`Checked by ${Q[e.checkedBy]}${t}`}function ye({task:e,detailed:t}){let n=e.criteria;if(n.length===0)return null;let r=(0,q.jsx)(`ul`,{"aria-label":`Criteria of #${e.id}`,className:`flex flex-col gap-0.5`,children:n.map(n=>(0,q.jsx)(be,{task:e,criterion:n,detailed:t},n.id))});if(!t)return r;let i=n.filter(e=>e.state===`met`).length;return(0,q.jsx)(w,{label:`Criteria (${i} of ${n.length} met)`,children:r})}function be({task:e,criterion:t,detailed:n}){let r=P(),a=C(),[s,p]=(0,K.useState)(!1),[m,h]=(0,K.useState)(``),g=t.kind===`manual`&&e.status!==`done`,_=ve(t),v=l(t.kind)?t.target:null;function y(){p(!1),h(``)}let b=f(m.trim()!==``,y,r.isPending);function S(n){s?y():n?(r.reset(),p(!0)):r.mutate({taskId:e.id,criterionId:t.id,met:!1,evidence:null})}function w(n){n.preventDefault(),r.mutate({taskId:e.id,criterionId:t.id,met:!0,evidence:m.trim()||null},{onSuccess:y})}return(0,q.jsxs)(`li`,{"data-criterion-state":t.state,className:`flex min-w-0 flex-col gap-0.5 text-xs`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,title:n?void 0:[_,t.evidence,v].filter(Boolean).join(`
|
|
2
|
-
`)||void 0,children:[
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{n as t,t as n}from"./jsx-runtime-C3cWAN_r.js";import{n as r,t as i}from"./button-BGH43TyY.js";import{t as a}from"./details-sheet-CocFq_H_.js";import{Bt as o,F as s,Ft as c,Gt as l,H as u,I as d,Lt as f,U as p,W as m,at as h,ct as g,dt as _,ft as v,it as y,lt as b,mt as x,ot as S,pt as C,st as w,zt as T}from"./index-Cbw2q6IR.js";import{t as E,u as D}from"./Selector-C5qvx4hg.js";import{Ft as O,H as ee,I as k,Lt as A,Mt as j,Rt as M,Zt as N,dt as P,g as te,h as ne,ht as re,m as F,ot as ie,s as I,x as L}from"./queries-D7Y7ESQJ.js";import{t as R}from"./opener-DWhHPoCL.js";import{t as z}from"./createLucideIcon-DtNDbJdC.js";var B={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};B.node;var V=z(B),H={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};H.node;var U=z(H),W={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};W.node;var G=z(W),K=e(t(),1),q=n();function J({onClose:e,children:t}){let n=(0,K.useRef)(null),[r,o]=(0,K.useState)(!1);function s(){n.current?.querySelector(`form[data-dirty]`)?o(!0):e()}return(0,K.useEffect)(()=>{function e(e){e.key!==`Escape`||e.defaultPrevented||document.querySelector(`[aria-haspopup='menu'][aria-expanded='true']`)||(r?o(!1):e.target instanceof HTMLElement&&e.target.closest(`input, textarea, select, [role=combobox], [role=listbox]`)||s())}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)}),(0,q.jsx)(a,{ref:n,width:`min(480px, max(360px, 40vw), calc(100vw - 32px))`,onClose:s,banner:r&&(0,q.jsxs)(`div`,{role:`group`,"aria-label":`Unsaved changes`,className:`flex shrink-0 flex-wrap items-center gap-2 border-b bg-muted px-4 py-2 text-xs`,children:[(0,q.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Discard your unsaved changes?`}),(0,q.jsx)(i,{size:`sm`,variant:`secondary`,label:`Keep editing`,autoFocus:!0,onClick:()=>o(!1)}),(0,q.jsx)(i,{size:`sm`,variant:`destructive`,label:`Discard changes`,onClick:e})]}),children:t})}function Y(e){switch(e.status){case`in_progress`:return`Started`;case`in_review`:return`In review`;case`done`:return`Completed`;case`planned`:return e.reopened?`Reopened`:`Paused`}}function ae({task:e}){let t=e.timeline.filter(e=>e.reason!==null);return t.length===0?null:(0,q.jsx)(`ol`,{"aria-label":`Reasons of #${e.id}`,className:`mt-1 flex flex-col gap-0.5`,children:t.map((e,t)=>(0,q.jsxs)(`li`,{className:`flex min-w-0 items-baseline gap-2 max-md:flex-wrap max-md:gap-y-0`,children:[(0,q.jsx)(j,{className:`shrink-0 text-muted-foreground`,at:e.at}),(0,q.jsx)(`span`,{className:`shrink-0 font-medium`,children:Y(e)}),(0,q.jsx)(`span`,{className:`min-w-0 whitespace-pre-line break-words-keep max-md:basis-full`,children:e.reason})]},t))})}var oe={lane:`Lane`,discord:`Discord`,pr:`PR`};function se({value:e}){if(/^https?:\/\//i.test(e)){let t=t=>{t.preventDefault(),R(e).catch(t=>console.error(`Failed to open ${e}`,t))};return(0,q.jsx)(`a`,{href:e,onClick:t,onAuxClick:t,className:`min-w-0 break-all text-primary underline underline-offset-2 hover:no-underline`,children:e})}let t=e.indexOf(`:`),n=t>0?oe[e.slice(0,t)]:void 0;return n===void 0?(0,q.jsx)(`code`,{className:`min-w-0 break-all`,children:e}):(0,q.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-1`,children:[(0,q.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:n}),(0,q.jsx)(`code`,{className:`min-w-0 break-all`,children:e.slice(t+1)})]})}function ce({task:e}){return e.refs.length===0?null:(0,q.jsx)(w,{label:`Refs`,children:(0,q.jsx)(`ul`,{"aria-label":`Refs of #${e.id}`,className:`flex flex-col gap-0.5`,children:e.refs.map(e=>(0,q.jsx)(`li`,{className:`flex min-w-0`,children:(0,q.jsx)(se,{value:e})},e))})})}function le({task:e,detailed:t}){let n=M(e.milestones);return n.length===0?null:t?(0,q.jsxs)(w,{label:`Timeline`,children:[(0,q.jsx)(`dl`,{"aria-label":`Timeline of #${e.id}`,className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5`,children:n.map(({label:e,at:t})=>(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,q.jsx)(`dd`,{children:(0,q.jsx)(j,{at:t})})]},e))}),(0,q.jsx)(ae,{task:e})]}):(0,q.jsx)(`p`,{"aria-label":`Timeline of #${e.id}`,className:`flex flex-wrap gap-x-2 text-xs text-muted-foreground`,children:n.map(({label:e,at:t})=>(0,q.jsx)(j,{at:t,prefix:`${e} `},e))})}function ue({task:e,tasks:t,context:n,navigation:a}){let s=ie(),c=I(),l=ee(),u=(s.data??[]).flatMap(({taskId:t,relatedId:n})=>t===e.id?[n]:n===e.id?[t]:[]).filter(e=>n.byId.has(e)),d=t.filter(t=>t.id!==e.id&&!u.includes(t.id)),f=[...new Set([e.workspaceId,...d.map(e=>e.workspaceId)])].map(e=>({workspaceId:e,tasks:d.filter(t=>t.workspaceId===e)})).filter(e=>e.tasks.length>0),p=C(),m=c.isPending||l.isPending||p,h=c.error??l.error;if(u.length===0&&f.length===0)return null;let g=f.length>0&&(0,q.jsx)(E,{label:`Add related task to #${e.id}`,isLabelHidden:!0,size:`sm`,width:192,placeholder:`Add related task...`,value:``,isDisabled:m,options:f.map(e=>({type:`section`,title:n.workspaceName(e.workspaceId),options:e.tasks.map(e=>({value:String(e.id),label:`#${e.id} ${e.title}`}))})),onChange:t=>{t&&c.mutate({taskId:e.id,relatedId:Number(t)})}}),_=h&&(0,q.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:h.message});return u.length===0?(0,q.jsxs)(`div`,{className:`flex flex-col gap-1 text-xs`,children:[g,_]}):(0,q.jsxs)(w,{label:`Related`,children:[(0,q.jsxs)(`ul`,{"aria-label":`Related tasks of #${e.id}`,className:`flex flex-wrap items-center gap-1 max-md:gap-2`,children:[u.map(t=>{let s=n.byId.get(t),c=v(t,e.workspaceId,n);return(0,q.jsxs)(`li`,{className:`inline-flex min-w-0 items-center max-md:gap-2`,children:[(0,q.jsx)(i,{size:`sm`,variant:`secondary`,label:s===void 0?c:`${c} ${s.title}`,"aria-label":`Open related task ${c}`,tooltip:s?.title,className:`min-w-0 max-w-56 tabular-nums`,isDisabled:a===void 0||!a.canOpen(t),onClick:()=>a?.open(t)}),(0,q.jsx)(r,{size:`sm`,variant:`ghost`,label:`Remove related task #${t} from #${e.id}`,tooltip:`Remove related task`,icon:(0,q.jsx)(o,{}),isDisabled:m,onClick:()=>l.mutate({taskId:e.id,relatedId:t})})]},t)}),g]}),_]})}function de({task:e}){let t=P();return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(i,{size:`sm`,variant:e.autopilot?`primary`:`secondary`,changesData:!0,"aria-pressed":e.autopilot,"aria-label":`Autopilot of #${e.id}`,label:e.autopilot?`Autopilot on`:`Autopilot off`,icon:(0,q.jsx)(l,{"aria-hidden":!0}),tooltip:e.autopilot?`Marked for autopilot: an executor may take it up on its own once it is ready. Click to clear.`:`Not marked for autopilot. Click to let an executor take it up on its own once it is ready.`,isDisabled:t.isPending,onClick:()=>t.mutate({status:null,id:e.id,taskType:e.taskType,title:e.title,description:e.description,estimate:e.estimate,dueDate:e.dueDate,autopilot:!e.autopilot,criteria:null}),className:`shrink-0`}),t.error&&(0,q.jsx)(`span`,{role:`alert`,className:`text-xs text-destructive`,children:t.error.message})]})}function fe({task:e}){let t=re(),n=k(),r=C(),i=t.data??[];return i.length<2?null:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`inline-flex`,title:`Move the task to another workspace; its history, notes, criteria, refs, and links stay`,children:(0,q.jsx)(E,{label:`Workspace of #${e.id}`,isLabelHidden:!0,size:`sm`,width:160,value:String(e.workspaceId),isDisabled:n.isPending||r,options:i.map(e=>({value:String(e.id),label:e.name})),onChange:t=>n.mutate({id:e.id,workspaceId:Number(t)})})}),n.error&&(0,q.jsx)(`span`,{role:`alert`,className:`text-xs text-destructive`,children:n.error.message})]})}function pe({task:e}){return(0,q.jsxs)(q.Fragment,{children:[(e.estimate!==null||e.dueDate!==null)&&(0,q.jsxs)(`p`,{"aria-label":`Plan of #${e.id}`,className:`flex flex-wrap gap-x-2 text-xs text-muted-foreground`,children:[e.estimate!==null&&(0,q.jsxs)(`span`,{children:[`Estimate `,c(e.estimate)]}),e.dueDate!==null&&(0,q.jsx)(g,{task:e})]}),(0,q.jsx)(_,{task:e}),(0,q.jsx)(ce,{task:e})]})}var me={progress:`Progress`,blocker:`Blocker`,decision:`Decision`},he={progress:`neutral`,blocker:`warning`,decision:`info`};function X({kind:e}){return(0,q.jsx)(f,{"data-note-kind":e,className:`shrink-0`,variant:he[e],label:me[e]})}function Z({task:e,detailed:t}){let n=e.notes;if(n.length===0)return null;if(!t){let t=n[n.length-1];return(0,q.jsxs)(`p`,{"aria-label":`Latest note of #${e.id}`,className:`flex min-w-0 items-center gap-1.5 text-xs`,title:O(t.at),children:[(0,q.jsx)(X,{kind:t.kind}),(0,q.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:m(t.body)}),n.length>1&&(0,q.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`+${n.length-1} more`})]})}return(0,q.jsx)(w,{label:`Notes (${n.length})`,children:(0,q.jsx)(`ol`,{"aria-label":`Notes of #${e.id}`,className:`flex flex-col gap-2`,children:n.map((e,t)=>(0,q.jsxs)(`li`,{className:`flex flex-col gap-0.5`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,q.jsx)(X,{kind:e.kind}),(0,q.jsx)(j,{className:`text-muted-foreground`,at:e.at})]}),(0,q.jsx)(K.Suspense,{fallback:(0,q.jsx)(`p`,{className:`whitespace-pre-line break-words-keep`,children:e.body}),children:(0,q.jsx)(b,{source:e.body})})]},t))})})}var ge={pending:`Pending`,met:`Met`,failed:`Failed`},_e={pending:N.neutral,met:N.success,failed:N.danger},Q={user:`you`,agent:`an agent`,toodo:`Toodo`};function $({state:e}){let t=e===`met`?V:e===`failed`?U:G;return(0,q.jsx)(`span`,{role:`img`,"aria-label":ge[e],className:x(`flex size-4 shrink-0 items-center justify-center`,_e[e]),children:(0,q.jsx)(t,{"aria-hidden":!0,className:`size-3.5`})})}function ve(e){if(e.checkedBy===null)return null;let t=e.checkedAt===null?``:` ${A(e.checkedAt)}`;return`Checked by ${Q[e.checkedBy]}${t}`}function ye({task:e,detailed:t}){let n=e.criteria;if(n.length===0)return null;let r=(0,q.jsx)(`ul`,{"aria-label":`Criteria of #${e.id}`,className:`flex flex-col gap-0.5`,children:n.map(n=>(0,q.jsx)(be,{task:e,criterion:n,detailed:t},n.id))});if(!t)return r;let i=n.filter(e=>e.state===`met`).length;return(0,q.jsx)(w,{label:`Criteria (${i} of ${n.length} met)`,children:r})}function be({task:e,criterion:t,detailed:n}){let r=te(),a=C(),[o,c]=(0,K.useState)(!1),[l,m]=(0,K.useState)(``),h=t.kind===`manual`&&e.status!==`done`,g=ve(t),_=d(t.kind)?t.target:null;function v(){c(!1),m(``)}let y=p(l.trim()!==``,v,r.isPending);function b(n){o?v():n?(r.reset(),c(!0)):r.mutate({taskId:e.id,criterionId:t.id,met:!1,evidence:null})}function S(n){n.preventDefault(),r.mutate({taskId:e.id,criterionId:t.id,met:!0,evidence:l.trim()||null},{onSuccess:v})}return(0,q.jsxs)(`li`,{"data-criterion-state":t.state,className:`flex min-w-0 flex-col gap-0.5 text-xs`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,title:n?void 0:[g,t.evidence,_].filter(Boolean).join(`
|
|
2
|
+
`)||void 0,children:[h?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(T,{size:`sm`,className:`shrink-0`,label:`Check criterion ${t.id} of #${e.id}`,isLabelHidden:!0,value:t.state===`met`||o,isDisabled:r.isPending||a,onChange:b}),t.state===`failed`&&(0,q.jsx)($,{state:`failed`})]}):(0,q.jsx)($,{state:t.state}),(0,q.jsx)(`span`,{className:x(`min-w-0`,n?`break-words-keep`:`truncate`,t.state===`failed`&&N.danger),children:t.text}),t.kind!==`manual`&&(0,q.jsx)(f,{className:`shrink-0`,label:s[t.kind]}),!n&&t.evidence&&(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground`,children:t.evidence})]}),n&&_&&(0,q.jsx)(`code`,{className:`ml-5.5 break-all text-muted-foreground`,children:_}),n&&(t.evidence||g)&&(0,q.jsxs)(`p`,{className:`ml-5.5 whitespace-pre-line break-words-keep text-muted-foreground`,children:[t.evidence,t.evidence&&g&&` · `,t.checkedBy!==null&&(0,q.jsxs)(q.Fragment,{children:[`Checked by `,Q[t.checkedBy],t.checkedAt!==null&&(0,q.jsxs)(q.Fragment,{children:[` `,(0,q.jsx)(j,{at:t.checkedAt})]})]})]}),o&&(0,q.jsxs)(`form`,{onSubmit:S,className:`ml-5.5 flex flex-wrap items-center gap-1`,onKeyDown:y.onKeyDown,children:[(0,q.jsx)(D,{size:`sm`,containerClassName:`flex-1 basis-48`,label:`Evidence for criterion ${t.id}`,isLabelHidden:!0,placeholder:`Evidence (optional), e.g. a link or what you checked`,value:l,onChange:m,hasAutoFocus:!0}),y.asking?(0,q.jsx)(u,{label:`Discard evidence for criterion ${t.id}`,question:`Discard the evidence?`,onKeep:y.keep,onDiscard:y.discard}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(i,{type:`submit`,size:`sm`,variant:`primary`,label:r.isPending?`Saving...`:`Save`,isDisabled:r.isPending}),(0,q.jsx)(i,{type:`button`,size:`sm`,variant:`ghost`,label:`Cancel`,onClick:y.request})]})]}),r.isError&&(0,q.jsx)(`p`,{role:`alert`,className:`ml-5.5 text-destructive`,children:r.error.message})]})}function xe({task:e,onCreated:t,onCancel:n}){let r=F(),a=L(),[o,s]=(0,K.useState)(`#${e.id} ${e.title}`),[c,l]=(0,K.useState)(`1`);return(0,q.jsxs)(`form`,{"aria-label":`New thread for #${e.id}`,className:`flex flex-col gap-2 rounded-md border p-2`,onSubmit:n=>{n.preventDefault(),a.mutate({channelId:Number(c),title:o.trim(),taskId:e.id},{onSuccess:e=>t(e.id)})},children:[(0,q.jsx)(D,{label:`Thread title`,size:`sm`,value:o,onChange:s,hasAutoFocus:!0}),(0,q.jsx)(E,{label:`Channel`,size:`sm`,value:c,onChange:l,options:(r.data??[]).map(e=>({value:String(e.id),label:`#${e.name}`}))}),a.isError&&(0,q.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:a.error.message}),(0,q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,q.jsx)(i,{type:`submit`,size:`sm`,label:`Start thread`,changesData:!0,isDisabled:a.isPending||o.trim()===``}),(0,q.jsx)(i,{variant:`ghost`,size:`sm`,label:`Cancel`,onClick:n})]})]})}function Se({task:e}){let t=ne({taskId:e.id,archived:!0}),n=F(),[r,a]=(0,K.useState)(null),[o,s]=(0,K.useState)(!1),c=t.data??[],l=e=>n.data?.find(t=>t.id===e)?.name??String(e);return(0,q.jsxs)(w,{label:`Threads (${c.length})`,children:[(0,q.jsx)(`ul`,{"aria-label":`Threads of #${e.id}`,className:`flex flex-col gap-1`,children:c.map(e=>{let t=r===e.id;return(0,q.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,q.jsx)(`button`,{type:`button`,"aria-expanded":t,className:x(`min-w-0 truncate text-left text-sm hover:underline`,t&&`font-semibold`),onClick:()=>a(t?null:e.id),children:e.title}),(0,q.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`#${l(e.channelId)}`}),(0,q.jsx)(S,{status:e.status}),e.unread>0&&e.status!==`archived`&&(0,q.jsx)(`span`,{className:`shrink-0 font-medium text-destructive`,children:`${e.unread} unread`}),t&&(0,q.jsx)(`span`,{className:`ml-auto flex shrink-0`,children:(0,q.jsx)(h,{thread:e})})]}),t&&(0,q.jsx)(`div`,{className:`flex h-80 flex-col overflow-hidden rounded-md border`,children:(0,q.jsx)(y,{place:{thread:e.id},label:e.title,open:e.status===`open`},e.id)})]},e.id)})}),o?(0,q.jsx)(xe,{task:e,onCancel:()=>s(!1),onCreated:e=>{s(!1),a(e)}}):(0,q.jsx)(`div`,{children:(0,q.jsx)(i,{variant:`ghost`,size:`sm`,label:`Start a thread`,onClick:()=>s(!0)})})]})}export{de as AutopilotToggle,ue as RelatedTasks,ye as TaskCriteria,J as TaskDetailsSheet,Z as TaskNotes,pe as TaskPlan,Se as TaskThreads,le as TaskTimeline,fe as TaskWorkspace};
|