@dubusoft/toodo-linux-arm64 1.8.1-dev.107 → 1.8.1-dev.109

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.
@@ -1 +0,0 @@
1
- import{i as e,n as t,r as n,s as r,t as i}from"./dist-ZmB2kPfR.js";import{$ as a,m as o,pt as s,y as c}from"./queries-BX_TBXN8.js";import{d as l,h as u,m as d}from"./event-DMqRNLc_.js";var f={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};f.node;var p=t(f),m={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};m.node;var h=t(m),g=r(e(),1);function _(e,t){if(e===null)return;let n=[...e.querySelectorAll(`a[href], button, input, select, textarea, summary, [tabindex]`)].filter(e=>!e.matches(`:disabled, [tabindex='-1']`)&&e.getClientRects().length>0);if(n.length===0)return;let r=n[0],i=n[n.length-1],a=document.activeElement,o=a instanceof Node&&e.contains(a);(t.shiftKey?!o||a===r:!o||a===i)&&(t.preventDefault(),(t.shiftKey?i:r).focus())}var v=n(),y=`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,b=`h-6 rounded-md border border-input bg-background px-1.5 text-xs outline-none max-md:h-11 max-md:px-2.5 max-md:text-sm focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50`;function x({label:e,help:t,children:n}){let r=(0,g.useId)(),i=`${r}-help`;return(0,v.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,v.jsx)(`label`,{htmlFor:r,className:`text-xs text-muted-foreground`,children:e}),n({id:r,describedBy:t?i:void 0}),t&&(0,v.jsx)(`p`,{id:i,className:`text-xs text-muted-foreground`,children:t})]})}function S({selectedId:e,onSelect:t}){let n=a(),r=(0,g.useSyncExternalStore)(d,l),i=r===`unreachable`||r===`retrying`,[o,c]=(0,g.useState)(!1),f=(0,g.useRef)(null),m=()=>{c(!1),f.current?.focus()};return(0,v.jsxs)(`section`,{"aria-labelledby":`workspaces-heading`,className:`flex shrink-0 flex-col gap-2`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,v.jsx)(`h2`,{id:`workspaces-heading`,className:`min-w-0 flex-1 text-xs font-medium uppercase text-muted-foreground`,children:`Workspaces`}),(0,v.jsxs)(s,{size:`xs`,variant:`outline`,"aria-label":`Add workspace`,title:`Add a workspace`,"aria-haspopup":`dialog`,"aria-expanded":o,onClick:e=>{f.current=e.currentTarget,c(!0)},children:[(0,v.jsx)(p,{}),`Add`]})]}),n.isPending&&!i&&(0,v.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading workspaces...`}),(n.isError||n.isPending&&i)&&(0,v.jsxs)(`div`,{role:`alert`,className:`flex flex-col items-start gap-2 text-sm text-destructive`,children:[(0,v.jsxs)(`p`,{children:[`Failed to load workspaces:`,` `,n.error?.message??(u()||`The Toodo server does not answer.`)]}),(0,v.jsx)(s,{size:`xs`,variant:`outline`,onClick:()=>void n.refetch(),children:`Retry now`})]}),n.data?.length===0&&!o&&(0,v.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No workspaces yet.`}),n.data&&n.data.length>0&&(0,v.jsx)(`ul`,{className:`flex flex-col gap-1`,children:n.data.map(n=>(0,v.jsx)(C,{workspace:n,selected:n.id===e,onSelect:t},n.id))}),o&&(0,v.jsx)(T,{onCreated:e=>{m(),t(e.id)},onClose:m})]})}function C({workspace:e,selected:t,onSelect:n}){let r=c(),[a,o]=(0,g.useState)(!1);return(0,v.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,v.jsxs)(`div`,{className:i(`group flex items-center rounded-lg hover:bg-sidebar-accent`,t&&`bg-sidebar-accent`),children:[(0,v.jsxs)(`button`,{type:`button`,"aria-current":t?`true`:void 0,onClick:()=>n(e.id),className:`flex min-w-0 flex-1 flex-col px-2.5 py-1.5 text-left`,children:[(0,v.jsx)(`span`,{className:`truncate text-sm font-medium`,children:e.name}),e.repository&&(0,v.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,title:e.repository,children:e.repository})]}),!a&&(0,v.jsx)(s,{size:`icon-xs`,variant:`ghost`,"aria-label":`Remove ${e.name}`,title:`Move the workspace and its tasks to the archive`,className:`mr-1 shrink-0 opacity-0 group-hover:opacity-100 hover:text-destructive focus-visible:opacity-100 [@media(hover:none)]:opacity-100`,onClick:()=>{r.reset(),o(!0)},children:(0,v.jsx)(h,{})})]}),a&&(0,v.jsxs)(`div`,{role:`group`,"aria-label":`Remove ${e.name}`,className:`flex flex-col gap-1.5 rounded-lg border p-2`,onKeyDown:e=>{e.key===`Escape`&&!r.isPending&&(e.preventDefault(),o(!1))},children:[(0,v.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Remove `,e.name,` and its tasks from Toodo? They move to Settings > Archive, where they can be restored.`]}),r.isError&&(0,v.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r.error.message}),(0,v.jsxs)(`div`,{className:`flex gap-1`,children:[(0,v.jsx)(s,{changesData:!0,size:`xs`,variant:`destructive`,"aria-label":`Confirm remove ${e.name}`,disabled:r.isPending,onClick:()=>r.mutate(e.id),children:r.isPending?`Removing...`:`Remove`}),(0,v.jsx)(s,{size:`xs`,variant:`ghost`,autoFocus:!0,onClick:()=>o(!1),children:`Back`})]})]})]})}function w(e,t=!1){return n=>{n.key===`Escape`&&!t&&!n.defaultPrevented&&(n.preventDefault(),e())}}function T({onCreated:e,onClose:t}){let n=o(),r=(0,g.useRef)(null),a=(0,g.useId)(),[c,l]=(0,g.useState)(``),[u,d]=(0,g.useState)(``),[f,p]=(0,g.useState)(``),m=n.isPending;function b(){m||t()}function S(t){t.preventDefault();let r={name:c.trim(),description:u.trim()||null,repository:f.trim()||null};n.mutate(r,{onSuccess:e})}return(0,v.jsxs)(`div`,{className:`fixed inset-0 z-50`,children:[(0,v.jsx)(`div`,{"aria-hidden":!0,className:`absolute inset-0 bg-black/40 max-md:hidden`,onClick:b}),(0,v.jsx)(`div`,{ref:r,role:`dialog`,"aria-modal":!0,"aria-labelledby":a,onKeyDown:e=>{e.key===`Tab`?_(r.current,e.nativeEvent):w(t,m)(e)},className:i(`relative flex flex-col overflow-hidden bg-background text-foreground`,`max-md:h-full max-md:pt-[env(safe-area-inset-top)] max-md:pb-[env(safe-area-inset-bottom)]`,`md:absolute md:top-1/2 md:left-1/2 md:max-h-[min(40rem,calc(100dvh-4rem))] md:w-[min(36rem,calc(100vw-4rem))] md:-translate-x-1/2 md:-translate-y-1/2 md:rounded-2xl md:border md:shadow-xl`),children:(0,v.jsxs)(`form`,{onSubmit:S,className:`flex min-h-0 flex-1 flex-col`,children:[(0,v.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 px-4 pt-3 pb-2 md:px-6 md:pt-4`,children:[(0,v.jsx)(`h2`,{id:a,className:`min-w-0 flex-1 truncate text-base font-semibold`,children:`New workspace`}),(0,v.jsx)(s,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Close new workspace`,title:`Close (Esc)`,disabled:m,onClick:b,children:(0,v.jsx)(h,{})})]}),(0,v.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto overscroll-contain border-t px-4 py-4 md:px-6`,children:[(0,v.jsx)(x,{label:`Name`,children:({id:e})=>(0,v.jsx)(`input`,{id:e,className:y,value:c,onChange:e=>l(e.target.value),required:!0,autoFocus:!0})}),(0,v.jsx)(x,{label:`Description`,help:`Optional, Markdown.`,children:({id:e,describedBy:t})=>(0,v.jsx)(`textarea`,{id:e,className:i(y,`h-24 py-1.5 max-md:h-32`),"aria-describedby":t,value:u,onChange:e=>d(e.target.value)})}),(0,v.jsx)(x,{label:`Repository`,help:`Optional, e.g. owner/repo or a URL. Toodo only shows it.`,children:({id:e,describedBy:t})=>(0,v.jsx)(`input`,{id:e,className:y,"aria-describedby":t,value:f,onChange:e=>p(e.target.value)})}),n.isError&&(0,v.jsx)(`p`,{role:`alert`,className:`text-xs break-words text-destructive`,children:n.error.message})]}),(0,v.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-t px-4 py-3 md:px-6`,children:[(0,v.jsx)(s,{type:`button`,variant:`ghost`,disabled:m,onClick:b,children:`Cancel`}),(0,v.jsx)(s,{type:`submit`,className:`ml-auto`,changesData:!0,disabled:m||c.trim()===``,children:m?`Adding...`:`Add workspace`})]})]})})]})}export{y as a,p as c,w as i,S as n,_ as o,b as r,h as s,T as t};