@remit/web-client-dist 0.0.429 → 0.0.430
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/assets/BriefPane-CytP3J7O.js +1 -0
- package/assets/{ErrorState-CNHmvGYF.js → ErrorState-B_pp6XjY.js} +1 -1
- package/assets/FlaggedPane-BTGAqs21.js +1 -0
- package/assets/FullCompose-D8BBZrtI.js +1 -0
- package/assets/MailListHeader-BjsRsJYI.js +7 -0
- package/assets/MailShell-CvPQWjl1.js +1 -0
- package/assets/{MailViewChrome-CZb8kPr_.js → MailViewChrome-ZN5UsScT.js} +1 -1
- package/assets/MailboxPane-Bca57rKs.js +1 -0
- package/assets/{NavMenuButton-BIPTnOry.js → NavMenuButton-_aiK1QXb.js} +1 -1
- package/assets/OnboardingWizard-BdBknD3m.js +1 -0
- package/assets/OutboxPane-3nlNVjx6.js +1 -0
- package/assets/_mailboxId-ByYUZV2Y.js +1 -0
- package/assets/_messageId-DLU18Mnl.js +1 -0
- package/assets/_messageId-DzC6VHu2.js +1 -0
- package/assets/_messageId-yJtPeY_Z.js +1 -0
- package/assets/_outboxMessageId-AEnONMiY.js +1 -0
- package/assets/_threadId-BdblixoD.js +1 -0
- package/assets/_threadId-CC5eBVBw.js +1 -0
- package/assets/_threadId-Cb8ALPnU.js +1 -0
- package/assets/accounts-Cji9zFqV.js +1 -0
- package/assets/{advanced-DKEc5X7D.js → advanced-BXCAioJN.js} +2 -2
- package/assets/appearance-Dg7qROVT.js +1 -0
- package/assets/{attachment-file-BrXH3M3V.js → attachment-file-CLrI3kMw.js} +1 -1
- package/assets/{avatar-DtND0ruk.js → avatar-C8lpjlQO.js} +1 -1
- package/assets/{bottom-sheet-Cpg512Z8.js → bottom-sheet-BuEgZWXh.js} +1 -1
- package/assets/brief-06HoE0GS.js +1 -0
- package/assets/{brief-CP_gyoWx.js → brief-Dt7lMB8R.js} +1 -1
- package/assets/{browser-ponyfill-BQQucyWN.js → browser-ponyfill-g58jgFl_.js} +2 -2
- package/assets/{bug-D-5qIgn1.js → bug-CDU4oK_3.js} +1 -1
- package/assets/{circle-check-CyTXHuU4.js → circle-check-BhMyR8BA.js} +1 -1
- package/assets/{circle-check-big-BCgBHZQm.js → circle-check-big-5NMrNFUI.js} +1 -1
- package/assets/{circle-help-lK4oidSt.js → circle-help-BAup3nOG.js} +1 -1
- package/assets/{clock-CpWsGek7.js → clock-DCdX5E4T.js} +1 -1
- package/assets/compose._-_outboxMessageId_-CyN4sUxa.js +1 -0
- package/assets/compose._-_outboxMessageId_-D5_JMiLJ.js +1 -0
- package/assets/compose._-_outboxMessageId_-Db3_5Bzx.js +1 -0
- package/assets/compose._-_outboxMessageId_-YqQysly2.js +1 -0
- package/assets/{confirm-dialog-CSNgGV-I.js → confirm-dialog-BxXd7BDT.js} +1 -1
- package/assets/{download-Yg8MAJuV.js → download-Br1uSntK.js} +1 -1
- package/assets/filters-snY8U8V2.js +1 -0
- package/assets/{flagged-CPZoSWDR.js → flagged-DBt5871J.js} +1 -1
- package/assets/flagged-DErOl3l4.js +1 -0
- package/assets/folders-BzRKidwZ.js +1 -0
- package/assets/{help-copy-o2bu5jXr.js → help-copy-D1mikTkH.js} +1 -1
- package/assets/index--TsBKY5T.js +1 -0
- package/assets/index-BG1B897N.js +1 -0
- package/assets/index-BIcRfpbR.js +1 -0
- package/assets/index-DLU18Mnl.js +1 -0
- package/assets/{index-DwTAdS0U.js → index-DX5RhVmh.js} +7 -7
- package/assets/index-DqLBbxu3.js +1 -0
- package/assets/index-DwKeNLeB.js +1 -0
- package/assets/{index-D_YBuI3z.js → index-idulIG65.js} +69 -69
- package/assets/index-yJtPeY_Z.js +1 -0
- package/assets/index-zNCEv1vY.js +1 -0
- package/assets/{kbd-BUm8HPo9.js → kbd-eZWvlfcb.js} +1 -1
- package/assets/labels-DFa210V0.js +1 -0
- package/assets/{mail-yZgIYq66.js → mail-Ba7j-n-X.js} +1 -1
- package/assets/mail-lLnBwPN-.js +1 -0
- package/assets/{menu-B4mmeG34.js → menu-MXmFQ7m-.js} +1 -1
- package/assets/onboarding-BQv4jg_d.js +1 -0
- package/assets/outbox-Dye6uwnb.js +1 -0
- package/assets/{pencil-rdzjE11g.js → pencil-CFys2EU7.js} +1 -1
- package/assets/{rich-text-BKM0xPkp.js → rich-text-DUWqcHC5.js} +3 -3
- package/assets/{rich-text-spellcheck-worker-provider-Dg635-7T.js → rich-text-spellcheck-worker-provider-DTxcyJ9W.js} +1 -1
- package/assets/{rotate-ccw-5k3dg52M.js → rotate-ccw-DfGOnKhE.js} +1 -1
- package/assets/{row-actions-BGPkkIDv.js → row-actions-zVghhE3a.js} +1 -1
- package/assets/search-mirror-_pK4jqc8.js +1 -0
- package/assets/search-scope-DTcpOp3S.js +1 -0
- package/assets/search-token-index-C-cpQFN3.js +1 -0
- package/assets/senders-Gj8Yentl.js +1 -0
- package/assets/settings-D96it8Kf.js +1 -0
- package/assets/{settings-screen-D53GKsd_.js → settings-screen-B17eDLDl.js} +1 -1
- package/assets/{shield-check-BZ36Y5z_.js → shield-check-DG9twqa-.js} +1 -1
- package/assets/suggested-vips--KmGV5np.js +1 -0
- package/assets/{useDebouncedValue-4E-721vu.js → useDebouncedValue-CntZIoMR.js} +1 -1
- package/assets/{useFilters-BdPFYyLi.js → useFilters-DaiBln2b.js} +1 -1
- package/assets/useLabels-amyS-Wph.js +1 -0
- package/assets/useMessageBodyContent-5kw10g9a.js +1 -0
- package/assets/useRefreshControl-CUTMAyIA.js +1 -0
- package/assets/{useSearchTokenContext-DROeO7xw.js → useSearchTokenContext-BxDapNdu.js} +4 -4
- package/assets/useSemanticSearch-BDxoAQSc.js +1 -0
- package/assets/useSignature-osTmnWZe.js +1 -0
- package/index.html +1 -1
- package/package.json +1 -1
- package/assets/BriefPane-D4GKn4Vw.js +0 -1
- package/assets/FlaggedPane-CIICNSCS.js +0 -1
- package/assets/FullCompose-B0bbns1M.js +0 -1
- package/assets/MailListHeader-BcdPneAy.js +0 -7
- package/assets/MailboxPane-MXdO0Vz2.js +0 -1
- package/assets/OnboardingWizard-yfi2kykm.js +0 -1
- package/assets/OutboxPane-mFkq2dEJ.js +0 -1
- package/assets/_mailboxId--xq6K8vG.js +0 -1
- package/assets/_messageId-CTALYmhq.js +0 -1
- package/assets/_messageId-CmMd3Ukp.js +0 -1
- package/assets/_messageId-CtxjpTtR.js +0 -1
- package/assets/_outboxMessageId-VPhQOPhK.js +0 -1
- package/assets/_threadId-1kFdcas1.js +0 -1
- package/assets/_threadId-7ZWe-9US.js +0 -1
- package/assets/_threadId-DNmSvZSP.js +0 -1
- package/assets/accounts--GnFjtNP.js +0 -1
- package/assets/appearance-Bn-KJ5jL.js +0 -1
- package/assets/brief-DWBpwjTi.js +0 -1
- package/assets/compose._-_outboxMessageId_-Bh6SV1dn.js +0 -1
- package/assets/compose._-_outboxMessageId_-CYWE1jEd.js +0 -1
- package/assets/compose._-_outboxMessageId_-Cn0WCeO7.js +0 -1
- package/assets/compose._-_outboxMessageId_-SUbFIkQY.js +0 -1
- package/assets/filters-BYXepTJ3.js +0 -1
- package/assets/flagged-CtM4krn0.js +0 -1
- package/assets/folders-BMWrmSe-.js +0 -1
- package/assets/index-BaVdEvyR.js +0 -1
- package/assets/index-BgNbixl6.js +0 -1
- package/assets/index-C015CYKF.js +0 -1
- package/assets/index-Cf-KjbzP.js +0 -1
- package/assets/index-CmMd3Ukp.js +0 -1
- package/assets/index-CtxjpTtR.js +0 -1
- package/assets/index-TQGaXC_d.js +0 -1
- package/assets/index-zMBRTYBv.js +0 -1
- package/assets/labels-DriP01Rs.js +0 -1
- package/assets/mail-Byqd_siN.js +0 -1
- package/assets/onboarding-BbbW2CcQ.js +0 -1
- package/assets/outbox-B7YGZwez.js +0 -1
- package/assets/search-scope-MtY0zpRq.js +0 -1
- package/assets/search-token-index-nAK4hI7B.js +0 -1
- package/assets/search-view-CtInfT0I.js +0 -1
- package/assets/senders-CRCPlNSI.js +0 -1
- package/assets/settings-zuLLX00L.js +0 -1
- package/assets/suggested-vips-BZprt8nM.js +0 -1
- package/assets/useLabels-CwcqSC09.js +0 -1
- package/assets/useMediaQuery-CDMcFeIb.js +0 -1
- package/assets/useMessageBodyContent-DEOYO0s3.js +0 -1
- package/assets/useRefreshControl-h1VyXjLX.js +0 -1
- package/assets/useSearchMirror-rswuH5l3.js +0 -1
- package/assets/useSemanticSearch-RnkqtV8e.js +0 -1
- package/assets/useSignature-C3CmLf8D.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,B as N,T as B,b9 as Y,r as c,az as W,X,aI as he,ap as J,F as xe,ba as K,bb as fe,ao as pe,as as ge,aE as L,aL as be,bc as ve,x as Z,Y as ee,a5 as se,bd as ye,be as je,aJ as Ne,W as ke,bf as Ce,bg as _,bh as we,bi as Se,bj as te,bk as Ie,bl as Q,b0 as ae,b6 as re,b7 as Me,H as G,G as ne,ar as H,bm as V,bn as Ee,af as De,bo as Ae,a0 as Oe,D as ie,a1 as Te,aD as Re,aH as Pe,z as Fe,aj as U,bp as $e,bq as ze,br as Le,aP as _e,bs as Be,bt as Ge}from"./index-idulIG65.js";import{P as He}from"./pencil-CFys2EU7.js";import{S as qe}from"./settings-screen-B17eDLDl.js";import{E as oe}from"./ErrorState-B_pp6XjY.js";import"./avatar-C8lpjlQO.js";import"./menu-MXmFQ7m-.js";import"./circle-help-BAup3nOG.js";const Ke=({label:s,onRename:t,onDelete:a,deleteBlockedReason:o,renameLabel:m=u=>`Rename ${u}`,deleteLabel:r=u=>`Delete ${u}`})=>{const u=o?`${r(s)} — ${o}`:r(s);return e.jsxs("span",{className:"flex shrink-0 items-center gap-0.5 pr-2",children:[e.jsx(N,{variant:"ghost",size:"sm",icon:e.jsx(He,{className:"size-3.5"}),"aria-label":m(s),onClick:t}),e.jsx("span",{title:o,children:e.jsx(N,{variant:"ghost",size:"sm",icon:e.jsx(B,{className:"size-3.5"}),"aria-label":u,disabled:o!==void 0,onClick:a})})]})},Qe=({folders:s,onRename:t,onDelete:a,onCreateFolder:o,delimiter:m,labels:r})=>{const u=new Map(s.map(l=>[l.id,l]));return e.jsx(Y,{folders:s,onCreateFolder:o,delimiter:m,labels:{treeAriaLabel:"Your folders",optionLabel:l=>l.label,...r},rowActions:l=>{const i=u.get(l.id);return i?e.jsx(Ke,{label:i.label,deleteBlockedReason:i.deleteBlockedReason,renameLabel:r?.rename,deleteLabel:r?.remove,onRename:()=>t(i),onDelete:()=>a(i)}):null}})},Ve=({open:s,folderLabel:t,defaultLabel:a,name:o,onNameChange:m,onSubmit:r,onClose:u,pending:l=!1,error:i})=>{const d=c.useId(),g=`Rename ${t}`;return s?e.jsxs(W,{open:s,onClose:u,title:g,children:[e.jsxs("header",{className:"flex items-center gap-2 border-b border-line px-5 py-3",children:[e.jsx("span",{className:"flex-1 text-sm font-semibold text-fg",children:g}),e.jsx(N,{variant:"ghost",size:"sm",icon:e.jsx(X,{className:"size-3.5"}),onClick:u,"aria-label":"Cancel"})]}),e.jsxs("div",{className:"space-y-3 px-5 py-4",children:[e.jsxs("div",{children:[e.jsx(he,{htmlFor:d,children:"Folder name"}),e.jsx(J,{id:d,value:o,placeholder:a,onChange:p=>m(p.target.value),onKeyDown:p=>{p.key==="Enter"&&(p.preventDefault(),r())}})]}),e.jsxs("p",{className:"text-xs text-fg-muted",children:["Shown everywhere in Remit. Leave it blank to use"," ",e.jsx("span",{className:"font-medium text-fg",children:a}),"."]}),i&&e.jsx("p",{className:"text-xs text-danger",role:"alert",children:i})]}),e.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[e.jsx(N,{variant:"secondary",size:"sm",onClick:u,children:"Cancel"}),e.jsx(N,{variant:"primary",size:"sm",onClick:r,disabled:l,children:l?"Saving…":"Save name"})]})]}):null},Ue=["inbox","drafts","sent","archive","junk","trash"],q="",Ye={mailboxId:null,source:"None"};function We(s){const t=s.messageCount===1?"msg":"msgs";return`${K(s.providerPath,s.hierarchyDelimiter)} · ${s.messageCount} ${t}`}const le=s=>`${s} ${s===1?"message":"messages"}`,Xe=(s,t)=>s==="Appointed"?"Chosen by you":s==="Flagged"?`The mail server marks it as ${t}`:s==="Reserved"?"The account's own INBOX":"Matched by name, not confirmed";function Je({role:s,folders:t,appointment:a,displayName:o,onAppoint:m,onRename:r}){const[u,l]=c.useState(o),i=c.useRef(null),d=c.useRef(!1),g=c.useId(),{mailboxId:p,source:v,staleFolderPath:y}=a,h=t.find(j=>j.mailboxId===p)??null,f=be(s),O=h!=null&&u.trim()!==o.trim();c.useEffect(()=>{!d.current||v==="Proposed"||(d.current=!1,i.current?.focus())},[v]);const M=(()=>{if(v==="None"){const j=s==="trash"?" Deleting mail needs one.":"";return e.jsx("span",{id:g,className:"pl-[7.5rem] text-xs text-fg-muted",children:`Not set — pick the folder this account uses for ${f}.${j}`})}return v==="Stale"||!h?null:e.jsx("span",{id:g,className:"truncate pl-[7.5rem] text-2xs text-fg-subtle",title:h.providerPath,children:`${Xe(v,f)} · ${h.providerPath} · ${le(h.messageCount)}`})})(),w=s==="trash"?" Deleting mail is stopped until you pick another one.":h?` reader is using ${K(h.providerPath,h.hierarchyDelimiter)} instead.`:"",A=`The folder you chose for ${f}${y?` — ${y} —`:""} is gone from the mail server.${w}`;return e.jsxs("div",{className:"flex flex-col gap-1 border-b border-line px-row-inset py-2.5 last:border-b-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"flex w-28 shrink-0 items-center gap-2 text-sm font-medium text-fg",children:[fe(s),f]}),e.jsxs(pe,{ref:i,className:"w-56 shrink-0",value:p??q,"aria-label":`Folder for ${f}`,"aria-describedby":M||v==="Stale"?g:void 0,onChange:j=>m(s,j.target.value===q?null:j.target.value),children:[e.jsx("option",{value:q,children:"None"}),t.map(j=>e.jsx("option",{value:j.mailboxId,children:We(j)},j.mailboxId))]}),v==="Proposed"&&h&&e.jsx(N,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>{d.current=!0,m(s,h.mailboxId)},children:`Set as ${f}`}),h&&e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"flex-1",value:u,placeholder:f,"aria-label":`Display name for ${f}`,onChange:j=>l(j.target.value)}),O&&e.jsx(N,{variant:"ghost",size:"sm",className:"shrink-0",icon:e.jsx(ge,{className:"size-4"}),"aria-label":"Save display name",onClick:()=>r(h.mailboxId,u)})]})]}),M,v==="Stale"&&e.jsx(L,{tone:"warning",variant:"soft",className:"ml-[7.5rem]",children:e.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{id:g,className:"flex-1",children:A}),e.jsx(N,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>i.current?.focus(),children:"Pick a folder"})]})})]})}function Ze({accountEmail:s,folders:t,appointments:a,displayNames:o={},onAppoint:m,onRename:r}){const u=new Set(Object.values(a).map(i=>i.mailboxId).filter(i=>i!=null)),l=t.filter(i=>!u.has(i.mailboxId));return e.jsxs("section",{className:"space-y-3",children:[e.jsxs("header",{className:"space-y-1",children:[e.jsxs("h2",{className:"text-sm font-semibold text-fg",children:["Folder roles — ",s]}),e.jsx("p",{className:"text-xs text-fg-muted",children:"Each role points to one folder. Pick the folder that holds the mail — the counts help you tell real folders from empty look-alikes. Appointing a folder here removes it from any other role. Each row says where its answer came from — your choice, the mail server's own flag, or a name reader matched."})]}),e.jsx("div",{className:"rounded-sm border border-line bg-surface",children:Ue.map(i=>{const d=a[i]??Ye;return e.jsx(Je,{role:i,folders:t,appointment:d,displayName:d.mailboxId?o[d.mailboxId]??"":"",onAppoint:m,onRename:r},i)})}),l.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("h3",{className:"text-xs font-medium text-fg-muted",children:"Other folders"}),e.jsx("ul",{className:"rounded-sm border border-line bg-surface",children:l.map(i=>e.jsxs("li",{className:"flex items-center gap-2 border-b border-line px-row-inset py-2 text-sm text-fg last:border-b-0",children:[e.jsx(xe,{className:"size-4 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"truncate",children:K(i.providerPath,i.hierarchyDelimiter)}),e.jsx("span",{className:"ml-auto shrink-0 text-2xs text-fg-subtle",children:le(i.messageCount)})]},i.mailboxId))})]})]})}const es=12e4,ss=2e3,ts="This folder is no longer in the account's folder list, so nothing was deleted.",ce=(s,t)=>{const a=s.find(o=>o.mailboxId===t);if(!a)throw new Error(ts);return a},as=(s,t)=>ce(s,t).lastSyncedAt??0;async function rs({readMailboxes:s,mailboxId:t,since:a,signal:o,segmentMs:m=es,pollIntervalMs:r=ss,delay:u=ve,now:l=Date.now}){const i=l()+m;for(;;){o?.throwIfAborted();const d=ce(await s(),t);if((d.lastSyncedAt??0)>a)return{status:"fresh",messageCount:d.messagesTotal};if(l()>=i)return{status:"pending"};await u(r,o)}}const de=50,ns=s=>s instanceof Error?s.message:"Something went wrong.",$=s=>s.then(t=>({ok:!0,value:t}),t=>({ok:!1,error:ns(t)})),is=async(s,t,a,o)=>{const m=[];let r;for(let u=0;u<de;u+=1){if(o.aborted)return m;const{data:l}=await te({path:{mailboxId:s},query:{order:"desc",continuationToken:r},throwOnError:!0});for(const i of l.items)if(!i.isDeleted&&!t.has(i.messageId)&&!m.includes(i.messageId)&&(m.push(i.messageId),m.length>=a))return m;if(!l.continuationToken)break;r=l.continuationToken}return m},os=async(s,t)=>{let a=0,o;for(let m=0;m<de;m+=1){if(t.aborted)return a;const{data:r}=await te({path:{mailboxId:s},query:{order:"desc",continuationToken:o},throwOnError:!0});for(const u of r.items)u.isDeleted||(a+=1);if(!r.continuationToken)break;o=r.continuationToken}return a};function ls({accountId:s,mailboxId:t,onDeleted:a}){const o=Z(),[m,r]=c.useState("idle"),[u,l]=c.useState(null),[i,d]=c.useState(),[g,p]=c.useState(),v=c.useRef(null),y=c.useRef(void 0),h=c.useCallback(()=>{o.invalidateQueries({queryKey:ee({path:{accountId:s}})}),o.invalidateQueries({queryKey:se()})},[o,s]),f=c.useCallback(async()=>{r("deleting");const k=await $(ye({path:{accountId:s,mailboxId:t},throwOnError:!0}));if(!k.ok){d(k.error),r("error");return}h(),r("done"),a()},[s,t,h,a]),O=c.useCallback(()=>je({path:{accountId:s},throwOnError:!0}).then(({data:k})=>k.items.find(S=>S.mailboxId===t)?.messageCount??0),[s,t]),M=c.useCallback(()=>o.fetchQuery({...Ne({path:{accountId:s}}),staleTime:0}).then(k=>k.mailboxes??[]),[o,s]),w=c.useCallback(async()=>{const k=new AbortController;v.current=k;const{signal:S}=k;r("checking"),d(void 0);const I=y.current!==void 0,C=await $((async()=>(I||(S.throwIfAborted(),y.current=as(await M(),t),S.throwIfAborted(),p(Date.now()),await ke({path:{accountId:s},throwOnError:!0})),rs({readMailboxes:M,mailboxId:t,since:y.current??0,signal:S})))());return S.aborted?(r("idle"),y.current=void 0,{status:"failed"}):C.ok?C.value.status==="pending"?(r("check-stalled"),{status:"pending"}):(y.current=void 0,C.value.messageCount>0?(r("idle"),h(),{status:"blocked",messageCount:C.value.messageCount}):(await f(),{status:"deleted"})):(y.current=void 0,d(C.error),r("error"),{status:"failed"})},[s,t,M,f,h]),A=c.useCallback(()=>{v.current?.abort()},[]),j=c.useCallback(async k=>{const S=new AbortController;v.current=S;const{signal:I}=S;r("moving"),d(void 0);const C=await $(O());if(I.aborted)return;if(!C.ok){d(C.error),r("error");return}let x=Ce(C.value);l(x);const E=new Set;for(;;){if(I.aborted)return;const n=await $(is(t,E,Ie,I));if(I.aborted)return;if(!n.ok){x=_(x,n.error),l(x),d(n.error),r("error");return}const b=n.value;if(b.length===0)break;const T=await $(we({body:{messageIds:b,destinationMailboxId:k},throwOnError:!0}));if(I.aborted)return;if(!T.ok){x=_(x,T.error),l(x),d(T.error),r("error");return}for(const F of b)E.add(F);x=Se(x,b.length),l(x)}const D=await $(os(t,I));if(!I.aborted){if(!D.ok){x=_(x,D.error),l(x),d(D.error),r("error");return}if(D.value>0){const n=`${D.value} ${D.value===1?"email is":"emails are"} still syncing. Re-open delete to finish removing this folder.`;x=_(x,n),l(x),d(n),r("error"),h();return}await f()}},[t,O,f,h]),R=c.useCallback(()=>{v.current?.abort(),v.current=null,y.current=void 0,r("idle"),l(null),d(void 0),p(void 0)},[]);return{phase:m,progress:u,errorMessage:i,checkStartedAt:g,deleteMailbox:f,deleteIfEmpty:w,moveThenDelete:j,cancel:A,reset:R}}const z=s=>`${s} ${s===1?"email":"emails"}`;function cs({open:s,accountId:t,folder:a,mailboxes:o,appointments:m,onClose:r}){const[u,l]=c.useState(()=>Q(a.messageCount)),[i,d]=c.useState(),[g,p]=c.useState(),{createFolderIn:v}=ae(t),y=re(),{phase:h,progress:f,errorMessage:O,checkStartedAt:M,deleteMailbox:w,deleteIfEmpty:A,moveThenDelete:j,cancel:R,reset:k}=ls({accountId:t,mailboxId:a.mailboxId,onDeleted:r}),[S,I]=c.useState("0:00"),C=h==="checking"||h==="check-stalled";c.useEffect(()=>{if(!C||M===void 0)return;const P=()=>I(Ae(Date.now()-M));P();const ue=setInterval(P,1e3);return()=>clearInterval(ue)},[C,M]),c.useEffect(()=>{s&&(l(Q(a.messageCount)),d(void 0),k())},[s,k]),c.useEffect(()=>{s&&p(void 0)},[s]),c.useEffect(()=>R,[R]);const x=c.useCallback(()=>{R(),r()},[R,r]),E=c.useCallback(async()=>{const P=await A();P.status==="blocked"&&(d(P.messageCount),l("choose-fate"))},[A]),D=c.useMemo(()=>Me({mailboxes:o,folderAppointments:m,excludeMailboxId:a.mailboxId,translator:y}),[o,m,a.mailboxId,y]),n=D.find(P=>P.id===g),b=c.useMemo(()=>G(a,ne(m).get(a.mailboxId),y),[a,m,y]);if(!s)return null;const T=`Delete ${b}`,F=i??a.messageCount,me=h==="moving"?e.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[e.jsx(H,{className:"size-8 animate-spin text-accent-2"}),e.jsx("p",{className:"text-sm font-medium text-fg",children:"Moving emails…"}),e.jsx("p",{className:"text-xs text-fg-muted",role:"status","aria-live":"polite",children:f?V(f):"Moved 0 of 0"})]}):h==="checking"?e.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[e.jsx(H,{className:"size-8 animate-spin text-accent-2"}),e.jsx("p",{className:"text-sm font-medium text-fg",children:"Checking the folder on the mail server…"}),e.jsx("p",{className:"text-xs text-fg-muted",role:"status","aria-live":"polite",children:`Waiting ${S}. Nothing is deleted until the server answers.`})]}):h==="check-stalled"?e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[e.jsx(L,{tone:"warning",variant:"soft",children:`The mail server hasn't reported back on this folder yet — ${S} so far. Nothing has been deleted.`}),e.jsx("p",{className:"text-xs text-fg-muted",children:"A sync covers the whole account, so a busy mailbox can take a while to come round to this folder."}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(N,{variant:"secondary",size:"sm",onClick:x,children:"Cancel"}),e.jsx(N,{size:"sm",onClick:()=>E(),children:"Keep waiting"})]})]}):h==="deleting"||h==="done"?e.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[e.jsx(H,{className:"size-8 animate-spin text-accent-2"}),e.jsx("p",{className:"text-sm font-medium text-fg",children:"Deleting folder…"})]}):h==="error"?e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[e.jsx(L,{tone:"danger",variant:"soft",children:O??"Something went wrong. Please try again."}),f&&e.jsxs("p",{className:"text-xs text-fg-muted",children:[V(f),". Already-moved emails stay moved — re-open delete to continue with the rest."]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(N,{variant:"secondary",size:"sm",onClick:x,children:"Close"})})]}):u==="confirm-empty"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-3 px-5 py-4 text-sm text-fg-muted",children:e.jsxs("p",{children:["Delete ",e.jsx("strong",{className:"text-fg",children:b}),"? This folder is empty and will be removed from the server."]})}),e.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[e.jsx(N,{variant:"secondary",size:"sm",onClick:x,children:"Cancel"}),e.jsx(N,{variant:"danger",size:"sm",icon:e.jsx(B,{className:"size-3.5"}),onClick:()=>E(),children:"Delete folder"})]})]}):u==="choose-fate"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-3 px-5 py-4 text-sm text-fg-muted",children:[i!==void 0&&e.jsx(L,{tone:"warning",variant:"soft",children:`This folder is not empty: the mail server reports ${z(i)} in it. Nothing was deleted.`}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:b})," holds"," ",z(F),". What should happen to them?"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("button",{type:"button",onClick:()=>l("confirm-delete-all"),className:"flex w-full items-center gap-3 rounded-sm border border-line px-3 py-2.5 text-left hover:bg-surface-raised",children:[e.jsx(B,{className:"size-4 shrink-0 text-danger"}),e.jsxs("span",{className:"flex-1",children:[e.jsx("span",{className:"block text-sm font-medium text-fg",children:"Delete them with the folder"}),e.jsx("span",{className:"block text-xs text-fg-muted",children:"The emails are removed from the server and can't be recovered."})]})]}),e.jsxs("button",{type:"button",onClick:()=>l("pick-destination"),className:"flex w-full items-center gap-3 rounded-sm border border-line px-3 py-2.5 text-left hover:bg-surface-raised",children:[e.jsx(Ee,{className:"size-4 shrink-0 text-accent-2"}),e.jsxs("span",{className:"flex-1",children:[e.jsx("span",{className:"block text-sm font-medium text-fg",children:"Move them to another folder"}),e.jsx("span",{className:"block text-xs text-fg-muted",children:"Keep the emails, then delete the emptied folder."})]})]})]})]}),e.jsx("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:e.jsx(N,{variant:"secondary",size:"sm",onClick:x,children:"Cancel"})})]}):u==="confirm-delete-all"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-3 px-5 py-4 text-sm text-fg-muted",children:e.jsxs("p",{children:["Delete ",e.jsx("strong",{className:"text-fg",children:b})," and its"," ",z(F),"? The messages are removed from the server with the folder and can't be recovered."]})}),e.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[e.jsx(N,{variant:"secondary",size:"sm",onClick:()=>l("choose-fate"),children:"Back"}),e.jsx(N,{variant:"danger",size:"sm",icon:e.jsx(B,{className:"size-3.5"}),onClick:()=>w(),children:"Delete folder and emails"})]})]}):e.jsxs("div",{className:"flex h-[26rem] flex-col",children:[e.jsxs("p",{className:"px-5 pt-4 text-sm text-fg-muted",children:["Move the ",z(F)," in"," ",e.jsx("strong",{className:"text-fg",children:b})," to:"]}),e.jsx("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:e.jsx(Y,{folders:D,selectedId:g,delimiter:o[0]?.hierarchyDelimiter??"/",onSelect:p,onCreateFolder:v,onCancel:()=>{p(void 0),l("choose-fate")},labels:{filterPlaceholder:"Move emails to…"}})}),n&&e.jsx("footer",{className:"shrink-0 border-t border-line p-2",children:e.jsx(N,{variant:"danger",onClick:()=>j(n.id),className:"h-11 w-full font-semibold",children:e.jsx("span",{className:"truncate",children:`Move ${z(F)} to ${n.label}`})})})]});return e.jsxs(W,{open:s,onClose:x,title:T,children:[e.jsxs("header",{className:"flex items-center gap-2 border-b border-line px-5 py-3",children:[e.jsx(De,{className:"size-4 shrink-0 text-danger"}),e.jsx("span",{className:"flex-1 text-sm font-semibold text-fg",children:T}),e.jsx(N,{variant:"ghost",size:"sm",icon:e.jsx(X,{className:"size-3.5"}),onClick:x,"aria-label":"Cancel"})]}),me]})}const ds=e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Each canonical role — Inbox, Drafts, Sent, Archive, Spam, Trash — points at one of your account's real folders. Pick the one that actually holds the mail; the message counts tell real folders from empty look-alikes."}),e.jsx("p",{children:`Appointing a folder to a role here doesn't touch any other role, and doesn't move or rename anything on the server — it just tells Remit which folder to treat as e.g. "Drafts" everywhere (sidebar, unread badges, the compose flow).`}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Your folders"})," is the account's real hierarchy. Open a folder to see what's inside it, make a new one where you're looking, and rename or delete any of them from its row."]})]});function ms({account:s}){const t=Z(),a=s.accountId,o=re(),{data:m,isPending:r,isError:u,error:l,refetch:i}=ie(Fe({path:{accountId:a}})),{createFolderIn:d}=ae(a),g=U({...$e(),onSuccess:()=>{t.invalidateQueries({queryKey:se()})}}),p=U({...ze(),onSuccess:()=>{t.invalidateQueries({queryKey:ee({path:{accountId:a}})})}}),[v,y]=c.useState(),[h,f]=c.useState(),[O,M]=c.useState(""),w=c.useMemo(()=>m?.items??[],[m]),A=c.useMemo(()=>ne(s.folderAppointments),[s.folderAppointments]),j=c.useMemo(()=>w.map(n=>({id:n.mailboxId,label:G(n,A.get(n.mailboxId),o),path:n.fullPath,deleteBlockedReason:Le(n,w,s.folderAppointments).message})),[w,A,o,s.folderAppointments]),R=(n,b)=>{g.mutate({path:{accountId:a,role:Ge[n]},body:{mailboxId:b}})},k=(n,b)=>{const T=b.trim();p.mutate({path:{accountId:a,mailboxId:n},body:{displayNameOverride:T===""?null:T}})};if(r)return e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":`Loading folders for ${s.email}`});if(u)return e.jsx(oe,{variant:"inline",title:`Couldn't load folders for ${s.email}`,error:l,onRetry:()=>{i()}});const S=w.map(n=>({mailboxId:n.mailboxId,providerPath:n.fullPath,hierarchyDelimiter:n.hierarchyDelimiter,messageCount:n.messageCount})),I={};for(const n of s.folderAppointments){const b=_e[n.role];b&&(I[b]={mailboxId:n.mailboxId??null,source:n.source,staleFolderPath:n.staleAppointmentPath})}const C={};for(const n of w)n.displayNameOverride&&(C[n.mailboxId]=n.displayNameOverride);const x=n=>w.find(b=>b.mailboxId===n),E=x(h),D=x(v);return e.jsxs("div",{className:"space-y-4",children:[(g.isError||p.isError)&&e.jsx(L,{tone:"danger",variant:"soft",children:Be(g.error)?"That folder is still being created on the mail server — wait for it to finish, then try again.":"Couldn't save that change. Please try again."}),e.jsx(Ze,{accountEmail:s.email,folders:S,appointments:I,displayNames:C,onAppoint:R,onRename:k}),e.jsxs("section",{className:"space-y-1.5",children:[e.jsxs("h3",{className:"text-sm font-semibold text-fg",children:["Your folders — ",s.email]}),e.jsx("div",{className:"flex h-[28rem] flex-col overflow-hidden rounded-sm border border-line bg-surface",children:e.jsx(Qe,{folders:j,delimiter:w[0]?.hierarchyDelimiter??"/",onCreateFolder:d,onRename:n=>{f(n.id),M(x(n.id)?.displayNameOverride?.trim()??"")},onDelete:n=>y(n.id),labels:{treeAriaLabel:`All folders for ${s.email}`}})})]}),E&&e.jsx(Ve,{open:!0,folderLabel:G(E,A.get(E.mailboxId),o),defaultLabel:G({fullPath:E.fullPath,hierarchyDelimiter:E.hierarchyDelimiter},A.get(E.mailboxId),o),name:O,onNameChange:M,pending:p.isPending,error:p.isError?"Couldn't save that name. Please try again.":void 0,onSubmit:()=>{const n=O.trim();p.mutate({path:{accountId:a,mailboxId:E.mailboxId},body:{displayNameOverride:n===""?null:n}},{onSuccess:()=>f(void 0)})},onClose:()=>f(void 0)}),D&&e.jsx(cs,{open:!0,accountId:a,folder:D,mailboxes:w,appointments:s.folderAppointments,onClose:()=>y(void 0)})]})}function vs(){const s=Oe(),[t,a]=c.useState(!0),{data:o,isPending:m,isError:r,error:u,refetch:l}=ie(Te()),i=d=>{const g=Pe[d];g&&s({to:g})};return e.jsx(qe,{items:Re,activeId:"folders",title:"Folder roles",description:"Appoint which real folder fills each canonical role, per account.",help:ds,helpOpen:t,onToggleHelp:()=>a(d=>!d),onSelect:i,onBackToMail:()=>{s({to:"/mail"})},children:m?e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading accounts"}):r?e.jsx(oe,{title:"Couldn't load accounts",error:u,onRetry:()=>{l()}}):o.accounts.length===0?e.jsx("p",{className:"py-12 text-sm text-fg-muted",children:"No accounts configured."}):e.jsx("div",{className:"space-y-8",children:o.accounts.map(d=>e.jsx(ms,{account:d},d.accountId))})})}export{vs as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./index-
|
|
1
|
+
import{j as e}from"./index-idulIG65.js";import{K as s}from"./kbd-eZWvlfcb.js";const a=e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"VIP"})," senders get priority surface in the daily brief and notification escalation, even when an account is quiet."]}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Muted"})," senders never notify and stay out of the brief. Their mail still syncs and stays searchable."]}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Blocked"})," senders never load images and go straight to junk."]}),e.jsxs("p",{children:["Tip: flag from the keyboard on any message — ",e.jsx(s,{children:"v"})," VIP,"," ",e.jsx(s,{children:"m"})," mute, ",e.jsx(s,{children:"b"})," block. Every rule an automation creates shows up here and can be removed."]})]}),r=e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Sync health"})," shows the IMAP connection state and the last successful sync per account."]}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Error"})," means the last connection attempt failed — the raw server response is shown on the card. Reconnect re-runs the connection test from the add-account wizard."]}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Muted"})," accounts keep syncing but stay out of the daily brief and unified counts."]})]}),c=e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Density"})," controls how much information fits on screen. Compact is great on smaller displays; Comfortable gives each item more breathing room."]}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Theme"})," switches between light, dark, and system-preference modes instantly. The change takes effect across the whole app immediately."]}),e.jsx("p",{className:"text-2xs text-fg-subtle",children:"Preferences are stored locally in this browser. Server-side sync is coming soon."})]}),i=e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Notification rules"})," and data export are coming in a future release."]}),e.jsxs("p",{children:["A message Remit cannot read is"," ",e.jsx("strong",{className:"text-fg",children:"set aside"})," rather than skipped, and the folder keeps syncing. Setting one aside is a defect in Remit, so every entry can be reported with the diagnostics already attached."]})]});export{r as a,i as b,c,a as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r}from"./index-idulIG65.js";import{B as o}from"./BriefPane-CytP3J7O.js";import"./useSearchTokenContext-BxDapNdu.js";import"./kbd-eZWvlfcb.js";import"./useMessageBodyContent-5kw10g9a.js";import"./search-scope-DTcpOp3S.js";import"./MailListHeader-BjsRsJYI.js";import"./search-token-index-C-cpQFN3.js";import"./attachment-file-CLrI3kMw.js";import"./mail-Ba7j-n-X.js";import"./avatar-C8lpjlQO.js";import"./index-DX5RhVmh.js";import"./useSignature-osTmnWZe.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-CntZIoMR.js";import"./ErrorState-B_pp6XjY.js";import"./format-23Av07Go.js";import"./download-Br1uSntK.js";import"./shield-check-DG9twqa-.js";import"./useFilters-DaiBln2b.js";import"./confirm-dialog-BxXd7BDT.js";import"./clock-DCdX5E4T.js";import"./menu-MXmFQ7m-.js";import"./useRefreshControl-CUTMAyIA.js";import"./circle-check-big-5NMrNFUI.js";import"./useLabels-amyS-Wph.js";import"./useSemanticSearch-BDxoAQSc.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-B1bng5Jq.js";function C(){return r.jsx(o.Reading,{})}export{C as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-idulIG65.js";import{O as t}from"./OutboxPane-3nlNVjx6.js";import"./useSearchTokenContext-BxDapNdu.js";import"./kbd-eZWvlfcb.js";import"./useMessageBodyContent-5kw10g9a.js";import"./search-scope-DTcpOp3S.js";import"./circle-check-big-5NMrNFUI.js";import"./clock-DCdX5E4T.js";import"./row-actions-zVghhE3a.js";import"./rotate-ccw-DfGOnKhE.js";import"./NavMenuButton-_aiK1QXb.js";import"./menu-MXmFQ7m-.js";import"./format-23Av07Go.js";import"./outbox-status-BlKn6P0x.js";import"./search-query-Cr_ZXBCp.js";function c(){return o.jsx(t.Reading,{})}export{c as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-idulIG65.js";import{M as r}from"./MailboxPane-Bca57rKs.js";import"./useSearchTokenContext-BxDapNdu.js";import"./kbd-eZWvlfcb.js";import"./useMessageBodyContent-5kw10g9a.js";import"./search-scope-DTcpOp3S.js";import"./useRefreshControl-CUTMAyIA.js";import"./circle-check-big-5NMrNFUI.js";import"./search-token-index-C-cpQFN3.js";import"./MailListHeader-BjsRsJYI.js";import"./attachment-file-CLrI3kMw.js";import"./mail-Ba7j-n-X.js";import"./avatar-C8lpjlQO.js";import"./index-DX5RhVmh.js";import"./useSignature-osTmnWZe.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-CntZIoMR.js";import"./ErrorState-B_pp6XjY.js";import"./format-23Av07Go.js";import"./download-Br1uSntK.js";import"./shield-check-DG9twqa-.js";import"./useFilters-DaiBln2b.js";import"./confirm-dialog-BxXd7BDT.js";import"./clock-DCdX5E4T.js";import"./menu-MXmFQ7m-.js";import"./MailViewChrome-ZN5UsScT.js";import"./NavMenuButton-_aiK1QXb.js";import"./useLabels-amyS-Wph.js";import"./useSemanticSearch-BDxoAQSc.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-BuEgZWXh.js";import"./circle-help-BAup3nOG.js";import"./circle-check-BhMyR8BA.js";function F(){return o.jsx(r.Reading,{})}export{F as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-idulIG65.js";import{F as r}from"./FlaggedPane-BTGAqs21.js";import"./useSearchTokenContext-BxDapNdu.js";import"./kbd-eZWvlfcb.js";import"./useMessageBodyContent-5kw10g9a.js";import"./search-scope-DTcpOp3S.js";import"./MailListHeader-BjsRsJYI.js";import"./search-token-index-C-cpQFN3.js";import"./attachment-file-CLrI3kMw.js";import"./mail-Ba7j-n-X.js";import"./avatar-C8lpjlQO.js";import"./index-DX5RhVmh.js";import"./useSignature-osTmnWZe.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-CntZIoMR.js";import"./ErrorState-B_pp6XjY.js";import"./format-23Av07Go.js";import"./download-Br1uSntK.js";import"./shield-check-DG9twqa-.js";import"./useFilters-DaiBln2b.js";import"./confirm-dialog-BxXd7BDT.js";import"./clock-DCdX5E4T.js";import"./menu-MXmFQ7m-.js";import"./MailViewChrome-ZN5UsScT.js";import"./wizard-selection-B1bng5Jq.js";function v(){return o.jsx(r.Reading,{})}export{v as component};
|