@remit/web-client-dist 0.0.46 → 0.0.47

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.
Files changed (45) hide show
  1. package/assets/{ComposeBody-Bc6JAYVe.js → ComposeBody-CjEYWN03.js} +1 -1
  2. package/assets/{ErrorState-CXmTpadx.js → ErrorState-DzlaE2zU.js} +1 -1
  3. package/assets/{OnboardingWizard-CWJA1SOY.js → OnboardingWizard-DwzKPcON.js} +1 -1
  4. package/assets/{account-form-helpers-CFwieItK.js → account-form-helpers-D_VdsYt3.js} +1 -1
  5. package/assets/{accounts-Byf4m66S.js → accounts-Ben9cF8Q.js} +1 -1
  6. package/assets/advanced-stUllole.js +1 -0
  7. package/assets/appearance-CZSND6xz.js +1 -0
  8. package/assets/{avatar-Bka6ToFz.js → avatar-BP5Rucds.js} +1 -1
  9. package/assets/{browser-ponyfill-CzdkSWXS.js → browser-ponyfill-IYvGi2_I.js} +2 -2
  10. package/assets/{filter-status-CKpIu7_D.js → filter-status-B_YdgTVp.js} +1 -1
  11. package/assets/filters-_PhypoHA.js +1 -0
  12. package/assets/{flagged-CktArMNh.js → flagged-DluQFeiz.js} +1 -1
  13. package/assets/{folder-role-3iNrG1Or.js → folder-role-BO4bNRxa.js} +1 -1
  14. package/assets/folders-CCxHmsU2.js +1 -0
  15. package/assets/index-BRKGAKgn.js +1 -0
  16. package/assets/{index-667BTMN2.js → index-CNM7t9fF.js} +1 -1
  17. package/assets/{index-xy2Bk49C.js → index-DDydRbxW.js} +26 -26
  18. package/assets/{index-aToiseR7.css → index-DgIMsJfP.css} +1 -1
  19. package/assets/{kbd-CQJpBdzn.js → kbd-C1S1P_DE.js} +1 -1
  20. package/assets/mail-xYbADmcZ.js +118 -0
  21. package/assets/onboarding-ClHGp9nQ.js +1 -0
  22. package/assets/select-adCOd9gf.js +1 -0
  23. package/assets/senders-BEqTfgOa.js +1 -0
  24. package/assets/settings-Cmqlbfr_.js +1 -0
  25. package/assets/{settings-screen-BD9X_mr_.js → settings-screen-DI2bht2t.js} +1 -1
  26. package/assets/star-Cp4cKLnf.js +1 -0
  27. package/assets/{suggested-vips-D3Yoxho4.js → suggested-vips-Bb-DQFC2.js} +1 -1
  28. package/assets/{trash-2-CLLYEKQU.js → trash-2-BNYBuPCa.js} +1 -1
  29. package/assets/useDebouncedValue-DEQ9m6Kw.js +1 -0
  30. package/assets/{useMutation-BQP3G0ud.js → useMutation-DpmMoKbP.js} +1 -1
  31. package/assets/{useSignature-DwXuEi5J.js → useSignature-PBQSvQ1-.js} +1 -1
  32. package/index.html +2 -2
  33. package/package.json +1 -1
  34. package/assets/advanced-k1XUo3QY.js +0 -1
  35. package/assets/appearance-CgWbmJNL.js +0 -1
  36. package/assets/filters-8zzmPox8.js +0 -1
  37. package/assets/folders-BgxQp-QZ.js +0 -1
  38. package/assets/index-BcouPEHR.js +0 -1
  39. package/assets/mail-B0USOkXK.js +0 -112
  40. package/assets/onboarding-BT33O_rl.js +0 -1
  41. package/assets/select-C6XBuFrO.js +0 -1
  42. package/assets/senders-DR73Xpw3.js +0 -1
  43. package/assets/settings-BRnaba4m.js +0 -1
  44. package/assets/star-DJ4mMik6.js +0 -1
  45. package/assets/useDebouncedValue-Ce9nqlbE.js +0 -1
@@ -0,0 +1 @@
1
+ import{b2 as r,a0 as a,a9 as i,A as s,r as c,j as m}from"./index-DDydRbxW.js";import{O as l}from"./OnboardingWizard-DwzKPcON.js";import"./kbd-C1S1P_DE.js";import"./select-adCOd9gf.js";import"./useMutation-DpmMoKbP.js";import"./account-form-helpers-D_VdsYt3.js";async function p(e){e.recordCompleted(),await e.queryClient.refetchQueries({queryKey:r()}),e.navigateToInbox()}function v(){const e=a(),o=i(),t=s(),n=c.useCallback(u=>{p({queryClient:t,recordCompleted:()=>o.recordEvent("onboarding.completed"),navigateToInbox:()=>{e({to:"/mail"})}})},[e,o,t]);return m.jsx(l,{skipWelcome:!1,onComplete:n})}export{v as component};
@@ -0,0 +1 @@
1
+ import{a,j as e,C as i,b as o}from"./index-DDydRbxW.js";const l=a("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);function u({icon:s,className:n,children:t,...r}){return e.jsxs("div",{className:o("relative flex h-9 items-center gap-2 rounded-md border border-line bg-surface-sunken pl-3 text-sm","focus-within:border-line-strong focus-within:ring-2 focus-within:ring-ring/30 transition-colors",n),children:[s&&e.jsx("span",{className:"shrink-0 text-fg-subtle",children:s}),e.jsx("select",{className:"min-w-0 flex-1 appearance-none bg-transparent py-0 pr-8 text-fg outline-none",...r,children:t}),e.jsx(i,{className:"pointer-events-none absolute right-2.5 size-4 text-fg-subtle"})]})}export{l as C,u as S};
@@ -0,0 +1 @@
1
+ import{j as e,b as N,a0 as z,r as c,bg as A,m as L,bh as O,aa as I,bu as $,A as k,bv as q,ay as C,B as S,ag as M,X as R}from"./index-DDydRbxW.js";import{K as m}from"./kbd-C1S1P_DE.js";import{S as B,a as P}from"./settings-screen-DI2bht2t.js";import{u as E}from"./useMutation-DpmMoKbP.js";import{E as V}from"./ErrorState-DzlaE2zU.js";import{S as G,u as Q}from"./useDebouncedValue-DEQ9m6Kw.js";import{b as K}from"./format-QyUYNmWo.js";import{S as _}from"./star-Cp4cKLnf.js";import"./avatar-BP5Rucds.js";function D({options:t,active:r,onSelect:x}){return e.jsx("div",{role:"tablist",className:N("flex shrink-0 gap-1 overflow-x-auto border-b border-line p-2","lg:w-44 lg:flex-col lg:gap-0 lg:overflow-visible lg:border-r lg:border-b-0 lg:py-2 lg:pr-2 lg:pl-3"),children:t.map(a=>{const d=a.id===r;return e.jsxs("button",{type:"button",role:"tab","aria-selected":d,onClick:()=>x(a.id),className:N("flex min-h-11 shrink-0 items-center gap-2 rounded-md px-3 text-left text-sm transition-colors lg:min-h-0 lg:px-2 lg:py-1",d?"bg-accent-2-soft font-medium text-accent-2":"text-fg-muted hover:bg-surface-sunken hover:text-fg"),children:[e.jsx("span",{className:"flex-1 truncate",children:a.label}),e.jsx("span",{className:N("text-2xs tabular-nums",d?"text-accent-2":"text-fg-subtle"),children:a.count??"—"})]},a.id)})})}const v={vip:"VIPs",muted:"Muted",blocked:"Blocked"},F=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(m,{children:"v"})," VIP,"," ",e.jsx(m,{children:"m"})," mute, ",e.jsx(m,{children:"b"})," block. Every rule an automation creates shows up here and can be removed."]})]});function H({query:t,onCount:r}){const{data:x,isPending:a,isError:d,error:b}=I($()),h=k(),i=E({...C(),onSettled:()=>{h.invalidateQueries({queryKey:q()})}}),l=x?.suggestions??[],p=t.trim().toLowerCase(),u=p?l.filter(n=>(n.displayName??"").toLowerCase().includes(p)||n.normalizedEmail.toLowerCase().includes(p)):l;return c.useEffect(()=>{r?.(u.length,l.length)},[r,u.length,l.length]),a?e.jsx("div",{className:"px-row-inset py-3 text-sm text-fg-subtle animate-pulse",children:"Loading VIP suggestions…"}):d?e.jsx("div",{className:"px-row-inset py-3",children:e.jsx(V,{variant:"inline",title:"Couldn't load VIP suggestions",error:b})}):l.length===0?e.jsxs("div",{className:"px-row-inset py-5 text-sm text-fg-subtle",children:["No VIP suggestions yet. As you reply to senders, they'll appear here. Press ",e.jsx(m,{children:"v"})," on any message to promote a sender to VIP."]}):u.length===0?e.jsxs("p",{className:"px-row-inset py-5 text-sm text-fg-subtle",children:["No VIPs match “",t,"”."]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-row-inset py-1 text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:"Suggested — promote to VIP"}),u.map(n=>e.jsx(P,{name:n.displayName??n.normalizedEmail,email:n.normalizedEmail,meta:n.replyCount>0?`${n.inboundCount} received · you replied ${n.replyCount}×`:`${n.inboundCount} received · you've never replied`,trailing:e.jsx(S,{variant:"ghost",size:"sm",icon:e.jsx(_,{className:"size-3.5"}),"aria-busy":i.isPending,onClick:()=>{i.isPending||i.mutate({path:{addressId:n.addressId},body:{flags:{vip:{value:!0,setAt:Date.now(),setBy:"user"}}}})},children:"Add VIP"})},n.addressId))]})}function U({group:t,query:r,onCount:x}){const a=Q(r.trim(),300),d=k(),[b,h]=c.useState(null),i=a.length>=2,l=M({query:{q:a,limit:50}}),{data:p,isPending:u,isError:n,error:j}=I({...l,enabled:i}),g=E({...C(),onSuccess:()=>{d.invalidateQueries({queryKey:l.queryKey})}}),f=(p?.items??[]).filter(s=>t==="muted"?s.flags?.muted?.value??!1:s.flags?.blocked?.value??!1);return c.useEffect(()=>{x?.(i?f.length:0,null)},[x,i,f.length]),i?u?e.jsx("div",{className:"px-row-inset py-3 text-sm text-fg-subtle animate-pulse",children:"Searching…"}):n?e.jsx("div",{className:"px-row-inset py-3",children:e.jsx(V,{variant:"inline",title:"Search failed",error:j})}):f.length===0?e.jsxs("p",{className:"px-row-inset py-5 text-sm text-fg-subtle",children:["No ",v[t].toLowerCase()," senders matching “",a,"”."]}):e.jsx(e.Fragment,{children:f.map(s=>{const o=t==="muted"?s.flags?.muted:s.flags?.blocked,y=o?[`${t}`,o.setAt&&K(o.setAt,{month:"short",year:"numeric"})||null,o.reason?`— ${o.reason}`:null].filter(Boolean).join(" "):t,w=g.isPending&&g.variables?.path.addressId===s.addressId,T=g.isError&&b===s.addressId;return e.jsx(P,{name:s.displayName??s.normalizedEmail,email:s.normalizedEmail,danger:t==="blocked",meta:y,trailing:T?e.jsx(S,{variant:"secondary",size:"sm",onClick:()=>{h(s.addressId),g.mutate({path:{addressId:s.addressId},body:{flags:{[t]:null}}})},children:"Retry"}):e.jsx(S,{variant:"ghost",size:"sm",icon:e.jsx(R,{className:"size-3.5"}),"aria-busy":w,"aria-label":`Remove ${t} flag`,onClick:()=>{w||(h(s.addressId),g.mutate({path:{addressId:s.addressId},body:{flags:{[t]:null}}}))}})},s.addressId)})}):e.jsxs("div",{className:"px-row-inset py-5 text-sm text-fg-subtle space-y-2",children:[e.jsxs("p",{children:["Type 2+ characters to search ",v[t].toLowerCase()," ","senders by name or address."]}),e.jsxs("p",{className:"text-2xs text-fg-subtle",children:["Note: a dedicated flagged-address list endpoint is in the backlog. Press ",e.jsx(m,{children:"m"})," on any message to mute its sender; ",e.jsx(m,{children:"b"})," to block."]})]})}function ae(){const t=z(),[r,x]=c.useState("vip"),[a,d]=c.useState(""),[b,h]=c.useState(!0),[i,l]=c.useState(0),[p,u]=c.useState({vip:0,muted:null,blocked:null}),n=c.useCallback((s,o)=>{l(s),u(y=>({...y,vip:o}))},[]),j=c.useCallback((s,o)=>{l(s),u(y=>({...y,[r]:s}))},[r]),g=p[r],f=s=>{const o=O[s];o&&t({to:o})};return e.jsx(B,{items:A,activeId:"senders",title:"Senders & Rules",description:"Per-sender preferences — set with one key from any message, managed here.",flush:!0,help:F,helpOpen:b,onToggleHelp:()=>h(s=>!s),onSelect:f,onBackToMail:()=>{t({to:"/mail"})},children:e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col lg:flex-row",children:[e.jsx(D,{active:r,onSelect:s=>{x(s),d("")},options:["vip","muted","blocked"].map(s=>({id:s,label:v[s],count:p[s]}))}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsx("div",{className:"border-b border-line px-row-inset py-2",children:e.jsx(L,{icon:e.jsx(G,{className:"size-4"}),placeholder:`Filter ${v[r].toLowerCase()} by name or address`,className:"h-8 max-w-sm",value:a,onChange:s=>d(s.target.value)})}),e.jsx("div",{className:"min-h-0 flex-1 divide-y divide-line overflow-y-auto",children:r==="vip"?e.jsx(H,{query:a,onCount:n}):e.jsx(U,{group:r,query:a,onCount:j})}),e.jsxs("footer",{className:"flex items-center justify-between border-t border-line px-row-inset py-1 text-2xs text-fg-subtle",children:[e.jsx("span",{children:g!=null?`${i} of ${g} flagged senders`:`${i} flagged senders`}),e.jsxs("span",{children:[e.jsx(m,{children:"j"})," ",e.jsx(m,{children:"k"})," navigate · ",e.jsx(m,{children:"⌫"})," remove flag"]})]})]})]})})}export{ae as component};
@@ -0,0 +1 @@
1
+ import{j as t,b1 as o}from"./index-DDydRbxW.js";const n=()=>t.jsx(o,{});export{n as component};
@@ -1 +1 @@
1
- import{c as z,r as g,j as e,a as m,B as x,X as j,b as S}from"./index-xy2Bk49C.js";import{M as B,C as N,A as w}from"./avatar-Bka6ToFz.js";const v=z("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);function L({items:l,activeId:t,title:i,description:n,children:r,help:s,helpOpen:d=!0,flush:o,onSelect:k,onToggleHelp:f,onBackToMail:h}){const[y,c]=g.useState(!1),[u,C]=g.useState(!1),b=!!s&&d,p=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-3 pt-3 pb-1 text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:"Settings"}),e.jsx("nav",{className:"flex-1 overflow-y-auto px-2 py-1",children:l.map(a=>e.jsxs("button",{type:"button",onClick:()=>{k?.(a.id),c(!1)},className:m("flex min-h-11 w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm transition-colors lg:min-h-0",a.id===t?"bg-accent-2-soft font-medium text-accent-2":"text-fg-muted hover:bg-surface hover:text-fg"),children:[a.icon&&e.jsx("span",{className:m("shrink-0",a.id===t?"text-accent-2":"text-fg-subtle"),children:a.icon}),a.label]},a.id))})]});return e.jsxs("div",{className:"flex h-dvh w-full overflow-hidden bg-canvas font-sans text-fg",children:[e.jsxs("aside",{className:"hidden w-60 shrink-0 flex-col border-r border-line bg-surface-sunken lg:flex",children:[e.jsx("div",{className:"flex h-pane-header shrink-0 items-center border-b border-line px-2",children:e.jsxs("button",{type:"button",onClick:h,className:"flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm text-fg-muted hover:bg-surface hover:text-fg",children:[e.jsx(v,{className:"size-4 text-fg-subtle"}),"Back to mail"]})}),p]}),y&&e.jsxs("div",{className:"fixed inset-0 z-50 flex lg:hidden",children:[e.jsx("button",{type:"button","aria-label":"Close menu",className:"absolute inset-0 bg-canvas/60",onClick:()=>c(!1)}),e.jsxs("aside",{className:"relative flex w-72 max-w-[85%] flex-col border-r border-line bg-surface-sunken",children:[e.jsxs("div",{className:"flex h-pane-header shrink-0 items-center justify-between border-b border-line px-2",children:[e.jsxs("button",{type:"button",onClick:()=>{h?.(),c(!1)},className:"flex items-center gap-2 rounded-md px-2 py-1 text-left text-sm text-fg-muted hover:bg-surface hover:text-fg",children:[e.jsx(v,{className:"size-4 text-fg-subtle"}),"Back to mail"]}),e.jsx(x,{variant:"ghost",size:"sm",icon:e.jsx(j,{className:"size-4"}),onClick:()=>c(!1),"aria-label":"Close menu"})]}),p]})]}),e.jsxs("main",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-3 border-b border-line px-3 lg:px-5",children:[e.jsx(x,{variant:"ghost",size:"sm",icon:e.jsx(B,{className:"size-4"}),className:"lg:hidden",onClick:()=>c(!0),"aria-label":"Open settings menu"}),e.jsx("h1",{className:"text-md font-semibold text-fg",children:i}),n&&e.jsx("p",{className:"hidden min-w-0 truncate text-xs text-fg-subtle lg:block",children:n}),s&&e.jsx(x,{variant:"ghost",size:"sm",icon:e.jsx(N,{className:"size-4"}),className:"ml-auto lg:hidden",onClick:()=>C(a=>!a),"aria-label":"Tips","aria-expanded":u}),s&&!b&&e.jsx(x,{variant:"ghost",size:"sm",icon:e.jsx(N,{className:"size-4"}),className:"hidden ml-auto lg:inline-flex",onClick:f,"aria-label":"Show tips"})]}),s&&u&&e.jsx("div",{className:"border-b border-line bg-surface-sunken px-row-inset py-3 text-xs leading-relaxed text-fg-muted lg:hidden",children:s}),o?e.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:r}):e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e.jsx("div",{className:"max-w-2xl px-3 py-5 lg:px-5",children:e.jsx("div",{className:"space-y-5",children:r})})})]}),b&&e.jsxs("aside",{className:"hidden w-64 shrink-0 flex-col border-l border-line bg-surface-sunken lg:flex",children:[e.jsxs("header",{className:"flex h-pane-header shrink-0 items-center justify-between border-b border-line px-row-inset",children:[e.jsx("span",{className:"text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:"Tips & tricks"}),e.jsx(x,{variant:"ghost",size:"sm",icon:e.jsx(j,{className:"size-3.5"}),onClick:f,"aria-label":"Collapse tips"})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-row-inset py-3 text-xs leading-relaxed text-fg-muted",children:s})]})]})}function E({name:l,email:t,meta:i,caption:n,danger:r,trailing:s}){return e.jsxs("div",{className:"flex items-center gap-3 px-row-inset py-2 hover:bg-surface-sunken",children:[e.jsx("span",{className:m(r&&"rounded-full ring-2 ring-danger/40"),children:e.jsx(w,{name:l,email:t,size:"sm"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-col gap-0 sm:flex-row sm:items-baseline sm:gap-2",children:[e.jsx("span",{className:"truncate text-sm font-medium text-fg",children:l}),e.jsx("span",{className:"truncate text-2xs text-fg-subtle",children:t})]}),e.jsxs("div",{className:"text-xs text-fg-subtle",children:[i,n&&e.jsxs("span",{className:"text-fg-muted",children:[" · ",n]})]})]}),s&&e.jsx("div",{className:"shrink-0",children:s})]})}const O={healthy:{tone:"positive",label:"healthy"},error:{tone:"danger",label:"error"},muted:{tone:"neutral",label:"muted"}};function F({label:l,email:t,connector:i,syncLabel:n,state:r,errorDetail:s,trailing:d}){const o=O[r];return e.jsxs("div",{className:m("rounded-sm border border-line bg-surface",r==="muted"&&"opacity-65"),children:[e.jsxs("div",{className:"flex flex-col gap-3 px-row-inset py-3 sm:flex-row sm:items-center",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[e.jsx(w,{name:l,email:t,size:"md"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate text-sm font-semibold text-fg",children:l}),e.jsx(S,{tone:o.tone,dot:!0,children:o.label})]}),e.jsxs("div",{className:"truncate text-xs text-fg-subtle",children:[t," · ",i," · ",n]})]})]}),d&&e.jsx("div",{className:"shrink-0",children:d})]}),s&&e.jsx("div",{className:"border-t border-line px-row-inset py-2",children:e.jsx("code",{className:"block rounded-xs bg-danger-soft px-2 py-1 text-2xs text-danger",children:s})})]})}export{F as A,L as S,E as a};
1
+ import{a as z,r as g,j as e,b as m,B as x,X as j,d as S}from"./index-DDydRbxW.js";import{M as B,C as N,A as w}from"./avatar-BP5Rucds.js";const v=z("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);function L({items:l,activeId:t,title:i,description:n,children:r,help:s,helpOpen:d=!0,flush:o,onSelect:k,onToggleHelp:f,onBackToMail:h}){const[y,c]=g.useState(!1),[u,C]=g.useState(!1),b=!!s&&d,p=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-3 pt-3 pb-1 text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:"Settings"}),e.jsx("nav",{className:"flex-1 overflow-y-auto px-2 py-1",children:l.map(a=>e.jsxs("button",{type:"button",onClick:()=>{k?.(a.id),c(!1)},className:m("flex min-h-11 w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm transition-colors lg:min-h-0",a.id===t?"bg-accent-2-soft font-medium text-accent-2":"text-fg-muted hover:bg-surface hover:text-fg"),children:[a.icon&&e.jsx("span",{className:m("shrink-0",a.id===t?"text-accent-2":"text-fg-subtle"),children:a.icon}),a.label]},a.id))})]});return e.jsxs("div",{className:"flex h-dvh w-full overflow-hidden bg-canvas font-sans text-fg",children:[e.jsxs("aside",{className:"hidden w-60 shrink-0 flex-col border-r border-line bg-surface-sunken lg:flex",children:[e.jsx("div",{className:"flex h-pane-header shrink-0 items-center border-b border-line px-2",children:e.jsxs("button",{type:"button",onClick:h,className:"flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm text-fg-muted hover:bg-surface hover:text-fg",children:[e.jsx(v,{className:"size-4 text-fg-subtle"}),"Back to mail"]})}),p]}),y&&e.jsxs("div",{className:"fixed inset-0 z-50 flex lg:hidden",children:[e.jsx("button",{type:"button","aria-label":"Close menu",className:"absolute inset-0 bg-canvas/60",onClick:()=>c(!1)}),e.jsxs("aside",{className:"relative flex w-72 max-w-[85%] flex-col border-r border-line bg-surface-sunken",children:[e.jsxs("div",{className:"flex h-pane-header shrink-0 items-center justify-between border-b border-line px-2",children:[e.jsxs("button",{type:"button",onClick:()=>{h?.(),c(!1)},className:"flex items-center gap-2 rounded-md px-2 py-1 text-left text-sm text-fg-muted hover:bg-surface hover:text-fg",children:[e.jsx(v,{className:"size-4 text-fg-subtle"}),"Back to mail"]}),e.jsx(x,{variant:"ghost",size:"sm",icon:e.jsx(j,{className:"size-4"}),onClick:()=>c(!1),"aria-label":"Close menu"})]}),p]})]}),e.jsxs("main",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-3 border-b border-line px-3 lg:px-5",children:[e.jsx(x,{variant:"ghost",size:"sm",icon:e.jsx(B,{className:"size-4"}),className:"lg:hidden",onClick:()=>c(!0),"aria-label":"Open settings menu"}),e.jsx("h1",{className:"text-md font-semibold text-fg",children:i}),n&&e.jsx("p",{className:"hidden min-w-0 truncate text-xs text-fg-subtle lg:block",children:n}),s&&e.jsx(x,{variant:"ghost",size:"sm",icon:e.jsx(N,{className:"size-4"}),className:"ml-auto lg:hidden",onClick:()=>C(a=>!a),"aria-label":"Tips","aria-expanded":u}),s&&!b&&e.jsx(x,{variant:"ghost",size:"sm",icon:e.jsx(N,{className:"size-4"}),className:"hidden ml-auto lg:inline-flex",onClick:f,"aria-label":"Show tips"})]}),s&&u&&e.jsx("div",{className:"border-b border-line bg-surface-sunken px-row-inset py-3 text-xs leading-relaxed text-fg-muted lg:hidden",children:s}),o?e.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:r}):e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e.jsx("div",{className:"max-w-2xl px-3 py-5 lg:px-5",children:e.jsx("div",{className:"space-y-5",children:r})})})]}),b&&e.jsxs("aside",{className:"hidden w-64 shrink-0 flex-col border-l border-line bg-surface-sunken lg:flex",children:[e.jsxs("header",{className:"flex h-pane-header shrink-0 items-center justify-between border-b border-line px-row-inset",children:[e.jsx("span",{className:"text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:"Tips & tricks"}),e.jsx(x,{variant:"ghost",size:"sm",icon:e.jsx(j,{className:"size-3.5"}),onClick:f,"aria-label":"Collapse tips"})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-row-inset py-3 text-xs leading-relaxed text-fg-muted",children:s})]})]})}function E({name:l,email:t,meta:i,caption:n,danger:r,trailing:s}){return e.jsxs("div",{className:"flex items-center gap-3 px-row-inset py-2 hover:bg-surface-sunken",children:[e.jsx("span",{className:m(r&&"rounded-full ring-2 ring-danger/40"),children:e.jsx(w,{name:l,email:t,size:"sm"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-col gap-0 sm:flex-row sm:items-baseline sm:gap-2",children:[e.jsx("span",{className:"truncate text-sm font-medium text-fg",children:l}),e.jsx("span",{className:"truncate text-2xs text-fg-subtle",children:t})]}),e.jsxs("div",{className:"text-xs text-fg-subtle",children:[i,n&&e.jsxs("span",{className:"text-fg-muted",children:[" · ",n]})]})]}),s&&e.jsx("div",{className:"shrink-0",children:s})]})}const O={healthy:{tone:"positive",label:"healthy"},error:{tone:"danger",label:"error"},muted:{tone:"neutral",label:"muted"}};function F({label:l,email:t,connector:i,syncLabel:n,state:r,errorDetail:s,trailing:d}){const o=O[r];return e.jsxs("div",{className:m("rounded-sm border border-line bg-surface",r==="muted"&&"opacity-65"),children:[e.jsxs("div",{className:"flex flex-col gap-3 px-row-inset py-3 sm:flex-row sm:items-center",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[e.jsx(w,{name:l,email:t,size:"md"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate text-sm font-semibold text-fg",children:l}),e.jsx(S,{tone:o.tone,dot:!0,children:o.label})]}),e.jsxs("div",{className:"truncate text-xs text-fg-subtle",children:[t," · ",i," · ",n]})]})]}),d&&e.jsx("div",{className:"shrink-0",children:d})]}),s&&e.jsx("div",{className:"border-t border-line px-row-inset py-2",children:e.jsx("code",{className:"block rounded-xs bg-danger-soft px-2 py-1 text-2xs text-danger",children:s})})]})}export{F as A,L as S,E as a};
@@ -0,0 +1 @@
1
+ import{a}from"./index-DDydRbxW.js";const r=a("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"}]]);export{r as S};
@@ -1 +1 @@
1
- import{j as t,b2 as e}from"./index-xy2Bk49C.js";const o=()=>t.jsx(e,{to:"/settings/senders",replace:!0});export{o as component};
1
+ import{j as t,b3 as e}from"./index-DDydRbxW.js";const o=()=>t.jsx(e,{to:"/settings/senders",replace:!0});export{o as component};
@@ -1 +1 @@
1
- import{c as e}from"./index-xy2Bk49C.js";const c=e("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);export{c as T};
1
+ import{a as e}from"./index-DDydRbxW.js";const t=e("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);export{t as T};
@@ -0,0 +1 @@
1
+ import{a as u,r as c}from"./index-DDydRbxW.js";const n=u("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),i=(e,t)=>{const[r,o]=c.useState(e);return c.useEffect(()=>{const s=setTimeout(()=>o(e),t);return()=>clearTimeout(s)},[e,t]),r};export{n as S,i as u};
@@ -1 +1 @@
1
- import{u as l,w as d,bv as a,bw as b,v as h,y as p,r as o,J as m,bx as v}from"./index-xy2Bk49C.js";var y=class extends l{#s;#i=void 0;#t;#e;constructor(t,s){super(),this.#s=t,this.setOptions(s),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const s=this.options;this.options=this.#s.defaultMutationOptions(t),d(this.options,s)||this.#s.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),s?.mutationKey&&this.options.mutationKey&&a(s.mutationKey)!==a(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#o(t)}getCurrentResult(){return this.#i}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#o()}mutate(t,s){return this.#e=s,this.#t?.removeObserver(this),this.#t=this.#s.getMutationCache().build(this.#s,this.options),this.#t.addObserver(this),this.#t.execute(t)}#r(){const t=this.#t?.state??b();this.#i={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){h.batch(()=>{if(this.#e&&this.hasListeners()){const s=this.#i.variables,r=this.#i.context,e={client:this.#s,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#e.onSuccess?.(t.data,s,r,e)}catch(i){Promise.reject(i)}try{this.#e.onSettled?.(t.data,null,s,r,e)}catch(i){Promise.reject(i)}}else if(t?.type==="error"){try{this.#e.onError?.(t.error,s,r,e)}catch(i){Promise.reject(i)}try{this.#e.onSettled?.(void 0,t.error,s,r,e)}catch(i){Promise.reject(i)}}}this.listeners.forEach(s=>{s(this.#i)})})}};function O(t,s){const r=p(),[e]=o.useState(()=>new y(r,t));o.useEffect(()=>{e.setOptions(t)},[e,t]);const i=o.useSyncExternalStore(o.useCallback(n=>e.subscribe(h.batchCalls(n)),[e]),()=>e.getCurrentResult(),()=>e.getCurrentResult()),u=o.useCallback((n,c)=>{e.mutate(n,c).catch(m)},[e]);if(i.error&&v(e.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:u,mutateAsync:i.mutate}}export{O as u};
1
+ import{w as l,y as d,bw as a,bx as b,x as h,A as p,r as o,L as m,by as y}from"./index-DDydRbxW.js";var v=class extends l{#s;#i=void 0;#t;#e;constructor(t,s){super(),this.#s=t,this.setOptions(s),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const s=this.options;this.options=this.#s.defaultMutationOptions(t),d(this.options,s)||this.#s.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),s?.mutationKey&&this.options.mutationKey&&a(s.mutationKey)!==a(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#o(t)}getCurrentResult(){return this.#i}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#o()}mutate(t,s){return this.#e=s,this.#t?.removeObserver(this),this.#t=this.#s.getMutationCache().build(this.#s,this.options),this.#t.addObserver(this),this.#t.execute(t)}#r(){const t=this.#t?.state??b();this.#i={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){h.batch(()=>{if(this.#e&&this.hasListeners()){const s=this.#i.variables,r=this.#i.context,e={client:this.#s,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#e.onSuccess?.(t.data,s,r,e)}catch(i){Promise.reject(i)}try{this.#e.onSettled?.(t.data,null,s,r,e)}catch(i){Promise.reject(i)}}else if(t?.type==="error"){try{this.#e.onError?.(t.error,s,r,e)}catch(i){Promise.reject(i)}try{this.#e.onSettled?.(void 0,t.error,s,r,e)}catch(i){Promise.reject(i)}}}this.listeners.forEach(s=>{s(this.#i)})})}};function O(t,s){const r=p(),[e]=o.useState(()=>new v(r,t));o.useEffect(()=>{e.setOptions(t)},[e,t]);const i=o.useSyncExternalStore(o.useCallback(n=>e.subscribe(h.batchCalls(n)),[e]),()=>e.getCurrentResult(),()=>e.getCurrentResult()),u=o.useCallback((n,c)=>{e.mutate(n,c).catch(m)},[e]);if(i.error&&y(e.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:u,mutateAsync:i.mutate}}export{O as u};
@@ -1 +1 @@
1
- import{r as m,j as i,B as u,a as y,y as p,ag as x,a8 as C,af as h,ak as j,b1 as k,b5 as L}from"./index-xy2Bk49C.js";import{L as E}from"./account-form-helpers-CFwieItK.js";import{u as O}from"./useMutation-BQP3G0ud.js";const b=()=>i.jsx(E,{className:"size-3.5 animate-spin"}),f=(s,n)=>n?i.jsx("span",{className:"sr-only",children:s}):s;function M({actions:s=[],destructive:n,className:l}){const[e,o]=m.useState(!1);return e&&n?.confirm?i.jsxs("div",{className:y("flex items-center gap-2",l),children:[i.jsx("span",{className:"text-xs text-fg-muted",children:n.confirm.prompt}),i.jsx(u,{variant:"secondary",size:"sm",onClick:()=>o(!1),children:n.confirm.cancelLabel??"Cancel"}),i.jsx(u,{variant:"danger",size:"sm","aria-busy":n.busy,icon:n.busy?b():void 0,onClick:()=>{n.busy||n.onClick()},children:n.busy?n.busyLabel??"Working…":n.confirm.confirmLabel??n.label})]}):i.jsxs("div",{className:y("flex items-center gap-2",l),children:[s.map(a=>i.jsx(u,{variant:a.variant??"ghost",size:"sm","aria-busy":a.busy,"aria-label":a.iconOnly?a.label:void 0,icon:a.busy?b():a.icon,onClick:()=>{a.busy||a.onClick()},children:a.busy&&a.busyLabel?a.busyLabel:f(a.label,a.iconOnly)},a.label)),n&&i.jsx(u,{variant:"ghost",size:"sm","aria-busy":n.busy,"aria-label":n.iconOnly?n.label:void 0,icon:n.busy?b():n.icon,onClick:()=>{if(!n.busy){if(n.confirm){o(!0);return}n.onClick()}},children:n.busy&&n.busyLabel?n.busyLabel:f(n.label,n.iconOnly)})]})}const c={html:"",plainText:""},N=s=>{const n=p(),{pushError:l}=x(),{data:e}=C({...h(),staleTime:1/0}),o=m.useMemo(()=>{if(!s||!e)return c;const r=e.accounts.find(t=>t.accountId===s);return r?{html:r.signatureHtml??"",plainText:r.signaturePlainText??""}:c},[s,e]),a=O({...L(),onSuccess:()=>{n.invalidateQueries({queryKey:k()})},onError:r=>{l(j("Couldn't save signature","The signature wasn't saved.",r))}}),g=m.useCallback((r,t)=>{s&&a.mutate({path:{accountId:s},body:{signatureHtml:r,signaturePlainText:t}})},[s,a]);return{signature:o,setSignature:g,isSaving:a.isPending}};export{M as R,N as u};
1
+ import{r as m,j as i,B as u,b as y,A as p,ai as x,aa as h,ah as C,am as j,b2 as L,b6 as k}from"./index-DDydRbxW.js";import{L as E}from"./account-form-helpers-D_VdsYt3.js";import{u as O}from"./useMutation-DpmMoKbP.js";const b=()=>i.jsx(E,{className:"size-3.5 animate-spin"}),f=(s,n)=>n?i.jsx("span",{className:"sr-only",children:s}):s;function M({actions:s=[],destructive:n,className:l}){const[e,o]=m.useState(!1);return e&&n?.confirm?i.jsxs("div",{className:y("flex items-center gap-2",l),children:[i.jsx("span",{className:"text-xs text-fg-muted",children:n.confirm.prompt}),i.jsx(u,{variant:"secondary",size:"sm",onClick:()=>o(!1),children:n.confirm.cancelLabel??"Cancel"}),i.jsx(u,{variant:"danger",size:"sm","aria-busy":n.busy,icon:n.busy?b():void 0,onClick:()=>{n.busy||n.onClick()},children:n.busy?n.busyLabel??"Working…":n.confirm.confirmLabel??n.label})]}):i.jsxs("div",{className:y("flex items-center gap-2",l),children:[s.map(a=>i.jsx(u,{variant:a.variant??"ghost",size:"sm","aria-busy":a.busy,"aria-label":a.iconOnly?a.label:void 0,icon:a.busy?b():a.icon,onClick:()=>{a.busy||a.onClick()},children:a.busy&&a.busyLabel?a.busyLabel:f(a.label,a.iconOnly)},a.label)),n&&i.jsx(u,{variant:"ghost",size:"sm","aria-busy":n.busy,"aria-label":n.iconOnly?n.label:void 0,icon:n.busy?b():n.icon,onClick:()=>{if(!n.busy){if(n.confirm){o(!0);return}n.onClick()}},children:n.busy&&n.busyLabel?n.busyLabel:f(n.label,n.iconOnly)})]})}const c={html:"",plainText:""},N=s=>{const n=p(),{pushError:l}=x(),{data:e}=h({...C(),staleTime:1/0}),o=m.useMemo(()=>{if(!s||!e)return c;const r=e.accounts.find(t=>t.accountId===s);return r?{html:r.signatureHtml??"",plainText:r.signaturePlainText??""}:c},[s,e]),a=O({...k(),onSuccess:()=>{n.invalidateQueries({queryKey:L()})},onError:r=>{l(j("Couldn't save signature","The signature wasn't saved.",r))}}),g=m.useCallback((r,t)=>{s&&a.mutate({path:{accountId:s},body:{signatureHtml:r,signaturePlainText:t}})},[s,a]);return{signature:o,setSignature:g,isSaving:a.isPending}};export{M as R,N as u};
package/index.html CHANGED
@@ -31,8 +31,8 @@
31
31
  } catch (_) {}
32
32
  })();
33
33
  </script>
34
- <script type="module" crossorigin src="/assets/index-xy2Bk49C.js"></script>
35
- <link rel="stylesheet" crossorigin href="/assets/index-aToiseR7.css">
34
+ <script type="module" crossorigin src="/assets/index-DDydRbxW.js"></script>
35
+ <link rel="stylesheet" crossorigin href="/assets/index-DgIMsJfP.css">
36
36
  </head>
37
37
  <body>
38
38
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/web-client-dist",
3
- "version": "0.0.46",
3
+ "version": "0.0.47",
4
4
  "description": "Built Remit web client — static assets and the default runtime config.",
5
5
  "files": [
6
6
  "**/*"
@@ -1 +0,0 @@
1
- import{j as e,bi as o,bj as c,bk as d,Z as l,r as m,bf as p,bg as u}from"./index-xy2Bk49C.js";import{S as x}from"./settings-screen-BD9X_mr_.js";import"./avatar-Bka6ToFz.js";function f(t){try{return new Date(t).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return t}}function g({sha:t=o,commitUrl:n=c,buildTime:s=d}){return e.jsxs("p",{className:"text-xs text-fg-subtle",children:["Version"," ",e.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"font-mono hover:text-fg-muted hover:underline",children:t})," · ",e.jsxs("span",{children:["Built ",f(s)]})]})}const h=e.jsx("div",{className:"space-y-3",children:e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Notification rules"}),", data export, and per-account diagnostics are coming in a future release."]})});function N(){const t=l(),[n,s]=m.useState(!0),r=a=>{const i=u[a];i&&t({to:i})};return e.jsxs(x,{items:p,activeId:"advanced",title:"Advanced",description:"Notification rules, export, and diagnostics.",help:h,helpOpen:n,onToggleHelp:()=>s(a=>!a),onSelect:r,onBackToMail:()=>{t({to:"/mail"})},children:[e.jsx("p",{className:"text-sm text-fg-muted",children:"Advanced options — notification rules, data export, and raw sync diagnostics — are coming in a future release."}),e.jsxs("div",{className:"border-t border-line pt-4 mt-4",children:[e.jsx("p",{className:"text-sm font-medium text-fg mb-1",children:"About"}),e.jsx(g,{})]})]})}export{N as component};
@@ -1 +0,0 @@
1
- import{j as e,a as u,Z as g,r as h,bl as b,bf as y,bg as v,bm as S}from"./index-xy2Bk49C.js";import{S as j}from"./settings-screen-BD9X_mr_.js";import"./avatar-Bka6ToFz.js";const N={sm:"min-h-9 px-3 text-xs",md:"min-h-11 px-4 text-sm"};function f({name:l,options:a,value:r,onChange:i,size:c="md","aria-label":m}){const d=a.findIndex(s=>s.value===r);return e.jsx("div",{role:"radiogroup","aria-label":m,className:"inline-flex rounded-md border border-line bg-surface-sunken p-0.5",children:a.map((s,o)=>{const n=s.value===r,t=!n&&o<a.length-1&&d!==o+1;return e.jsxs("label",{className:u("relative flex cursor-pointer items-center justify-center rounded-[5px] font-medium transition-colors",N[c],n?"bg-surface text-fg shadow":"text-fg-muted hover:text-fg",t&&"after:pointer-events-none after:absolute after:right-0 after:top-1/4 after:h-1/2 after:w-px after:bg-line"),children:[e.jsx("input",{type:"radio",name:l,value:s.value,checked:n,onChange:()=>i(s.value),className:"sr-only"}),s.label]},s.value)})})}const x="remit.density";function T(){return typeof localStorage>"u"?"comfortable":localStorage.getItem(x)??"comfortable"}const D=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."})]});function k(){const l=g(),[a,r]=h.useState(!0),[i,c]=h.useState(T),[m,d]=h.useState(b),s=t=>{c(t),typeof localStorage<"u"&&localStorage.setItem(x,t)},o=t=>{d(t),S(t)},n=t=>{const p=v[t];p&&l({to:p})};return e.jsx(j,{items:y,activeId:"appearance",title:"Appearance",description:"Display density and colour theme — instant-apply.",help:D,helpOpen:a,onToggleHelp:()=>r(t=>!t),onSelect:n,onBackToMail:()=>{l({to:"/mail"})},children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:"Density"}),e.jsx(f,{name:"density","aria-label":"Density",value:i,onChange:s,options:[{value:"comfortable",label:"Comfortable"},{value:"compact",label:"Compact"}]}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Controls the spacing of message rows in the mail list."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:"Theme"}),e.jsx(f,{name:"theme","aria-label":"Theme",value:m,onChange:o,options:[{value:"system",label:"System"},{value:"light",label:"Light"},{value:"dark",label:"Dark"}]}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Applies immediately. System default follows your OS preference."})]})]})})}export{k as component};
@@ -1 +0,0 @@
1
- import{j as e,b,B as j,Z as N,r as x,a8 as u,af as y,bf as v,bg as S,$ as I}from"./index-xy2Bk49C.js";import{S as T}from"./settings-screen-BD9X_mr_.js";import{f as E,N as O,a as w,c as F,d as k}from"./filter-status-CKpIu7_D.js";import{T as A}from"./trash-2-CLLYEKQU.js";import{E as g}from"./ErrorState-CXmTpadx.js";import{g as D}from"./folder-roles-XnseeyyD.js";import"./avatar-Bka6ToFz.js";import"./useMutation-BQP3G0ud.js";function $({filters:a,mailboxName:i,onDelete:d,deletingFilterId:r,now:c=Date.now()}){return a.length===0?e.jsx("p",{className:"py-6 text-sm text-fg-muted",children:"No filters yet. Select a few messages in the inbox and choose Organize to make one."}):e.jsx("ul",{className:"divide-y divide-line rounded-md border border-line",children:a.map(t=>{const o=E(t,c),n=o==="Expired",l=t.actionMailboxId!==O?i(t.actionMailboxId):void 0,s=w(t.expiresAt);return e.jsxs("li",{className:"flex items-start gap-3 px-3 py-2.5",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`truncate text-sm font-medium ${n?"text-fg-muted":"text-fg"}`,children:t.name}),e.jsx(b,{tone:n?"neutral":"positive",dot:!0,children:o})]}),e.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[l?`Moves matches to ${l}`:"No move action",t.scope==="Temporary"&&s?n?` · expired ${s}`:` · until ${s}`:t.scope==="Standing"?" · always":""]})]}),e.jsx(j,{variant:"ghost",size:"sm",icon:e.jsx(A,{className:"size-4 text-danger"}),onClick:()=>d(t.filterId),disabled:r===t.filterId,"aria-label":`Delete filter ${t.name}`})]},t.filterId)})})}const M=e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["Filters are the standing rules Organize creates. A"," ",e.jsx("strong",{children:"Standing"})," filter keeps working on new mail; a"," ",e.jsx("strong",{children:"Temporary"})," one stops on its own at the date you picked."]}),e.jsx("p",{children:"An expired filter isn't deleted the instant it lapses — it stays here, marked Expired, so you can see what it did and when it stopped."})]});function C({account:a}){const i=a.accountId,{filters:d,isPending:r,isError:c,error:t,refetch:o}=F(i),{deleteFilter:n,deletingFilterId:l}=k(i),{data:s}=u({...I({path:{accountId:i}}),staleTime:1/0}),m=x.useCallback(f=>{const p=s?.items.find(h=>h.mailboxId===f);return p?D(p.fullPath):void 0},[s?.items]);return e.jsxs("section",{className:"space-y-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:a.email}),r?e.jsx("div",{className:"h-16 animate-pulse rounded-md border border-line bg-surface","aria-busy":"true","aria-label":`Loading filters for ${a.email}`}):c?e.jsx(g,{variant:"inline",title:`Couldn't load filters for ${a.email}`,error:t,onRetry:()=>{o()}}):e.jsx($,{filters:d,mailboxName:m,onDelete:n,deletingFilterId:l})]})}function Q(){const a=N(),[i,d]=x.useState(!0),{data:r,isPending:c,isError:t,error:o,refetch:n}=u(y()),l=s=>{const m=S[s];m&&a({to:m})};return e.jsx(T,{items:v,activeId:"filters",title:"Filters",description:"Standing and temporary rules created by Organize, per account.",help:M,helpOpen:i,onToggleHelp:()=>d(s=>!s),onSelect:l,onBackToMail:()=>{a({to:"/mail"})},children:c?e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading accounts"}):t?e.jsx(g,{title:"Couldn't load accounts",error:o,onRetry:()=>{n()}}):r.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:r.accounts.map(s=>e.jsx(C,{account:s},s.accountId))})})}export{Q as component};
@@ -1 +0,0 @@
1
- import{j as e,r as v,l as I,B as S,Z as A,a8 as j,af as E,bf as R,bg as k,y as L,$ as P,b1 as T,br as _,ap as w,bs as M,f as F}from"./index-xy2Bk49C.js";import{F as D,b as y,r as $,c as Q}from"./folder-role-3iNrG1Or.js";import{S as B,C as G}from"./select-C6XBuFrO.js";import{S as H}from"./settings-screen-BD9X_mr_.js";import{u as N}from"./useMutation-BQP3G0ud.js";import{E as O}from"./ErrorState-CXmTpadx.js";import{C as K,N as q}from"./folder-roles-XnseeyyD.js";import"./trash-2-CLLYEKQU.js";import"./star-DJ4mMik6.js";import"./avatar-Bka6ToFz.js";const z=["inbox","drafts","sent","archive","junk","trash"],x="";function V(a){const r=a.messageCount===1?"msg":"msgs";return`${y(a.providerPath)} · ${a.messageCount} ${r}`}function Z({role:a,folders:r,appointedId:n,displayName:i,onAppoint:m,onRename:p}){const[c,d]=v.useState(i),s=r.find(l=>l.mailboxId===n)??null,t=Q(a),u=s!=null&&c.trim()!==i.trim();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:[$(a),t]}),e.jsxs(B,{className:"w-56 shrink-0",value:n??x,"aria-label":`Folder for ${t}`,onChange:l=>m(a,l.target.value===x?null:l.target.value),children:[e.jsx("option",{value:x,children:"None"}),r.map(l=>e.jsx("option",{value:l.mailboxId,children:V(l)},l.mailboxId))]}),s&&e.jsxs(e.Fragment,{children:[e.jsx(I,{className:"flex-1",value:c,placeholder:t,"aria-label":`Display name for ${t}`,onChange:l=>d(l.target.value)}),u&&e.jsx(S,{variant:"ghost",size:"sm",className:"shrink-0",icon:e.jsx(G,{className:"size-4"}),"aria-label":"Save display name",onClick:()=>p(s.mailboxId,c)})]})]}),s&&e.jsxs("span",{className:"truncate pl-[7.5rem] text-2xs text-fg-subtle",title:s.providerPath,children:[s.providerPath," · ",s.messageCount," ",s.messageCount===1?"message":"messages"]})]})}function J({accountEmail:a,folders:r,appointments:n,displayNames:i={},onAppoint:m,onRename:p}){const c=new Set(Object.values(n).filter(s=>s!=null)),d=r.filter(s=>!c.has(s.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 — ",a]}),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."})]}),e.jsx("div",{className:"rounded-sm border border-line bg-surface",children:z.map(s=>{const t=n[s]??null;return e.jsx(Z,{role:s,folders:r,appointedId:t,displayName:t?i[t]??"":"",onAppoint:m,onRename:p},s)})}),d.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:d.map(s=>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(D,{className:"size-4 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"truncate",children:y(s.providerPath)}),e.jsxs("span",{className:"ml-auto shrink-0 text-2xs text-fg-subtle",children:[s.messageCount," ",s.messageCount===1?"message":"messages"]})]},s.mailboxId))})]})]})}const U=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:"Display name"})," renames the appointed folder for the sidebar. Leave it blank to use the role's canonical name."]})]});function W({account:a}){const r=L(),n=a.accountId,{data:i,isPending:m,isError:p,error:c,refetch:d}=j(P({path:{accountId:n}})),s=N({..._(),onSuccess:()=>{r.invalidateQueries({queryKey:T()})}}),t=N({...M(),onSuccess:()=>{r.invalidateQueries({queryKey:w({path:{accountId:n}})})}}),u=(o,h)=>{s.mutate({path:{accountId:n,role:q[o]},body:{mailboxId:h}})},l=(o,h)=>{const b=h.trim();t.mutate({path:{accountId:n,mailboxId:o},body:{displayNameOverride:b===""?null:b}})};if(m)return e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":`Loading folders for ${a.email}`});if(p)return e.jsx(O,{variant:"inline",title:`Couldn't load folders for ${a.email}`,error:c,onRetry:()=>{d()}});const C=i.items.map(o=>({mailboxId:o.mailboxId,providerPath:o.fullPath,messageCount:o.messageCount})),f={};for(const o of a.folderAppointments){const h=K[o.role];h&&(f[h]=o.mailboxId??null)}const g={};for(const o of i.items)o.displayNameOverride&&(g[o.mailboxId]=o.displayNameOverride);return e.jsxs("div",{className:"space-y-2",children:[(s.isError||t.isError)&&e.jsx(F,{tone:"danger",variant:"soft",children:"Couldn't save that change. Please try again."}),e.jsx(J,{accountEmail:a.email,folders:C,appointments:f,displayNames:g,onAppoint:u,onRename:l})]})}function ie(){const a=A(),[r,n]=v.useState(!0),{data:i,isPending:m,isError:p,error:c,refetch:d}=j(E()),s=t=>{const u=k[t];u&&a({to:u})};return e.jsx(H,{items:R,activeId:"folders",title:"Folder roles",description:"Appoint which real folder fills each canonical role, per account.",help:U,helpOpen:r,onToggleHelp:()=>n(t=>!t),onSelect:s,onBackToMail:()=>{a({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"}):p?e.jsx(O,{title:"Couldn't load accounts",error:c,onRetry:()=>{d()}}):i.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:i.accounts.map(t=>e.jsx(W,{account:t},t.accountId))})})}export{ie as component};
@@ -1 +0,0 @@
1
- import{j as t,b2 as o}from"./index-xy2Bk49C.js";const n=()=>t.jsx(o,{to:"/settings/accounts"});export{n as component};