@openparachute/notes-ui 0.1.7 → 0.1.8

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 (36) hide show
  1. package/dist/.parachute/info +1 -1
  2. package/dist/assets/{Activity-bT-4Y6Hc.js → Activity-1x_gPzIq.js} +1 -1
  3. package/dist/assets/{AddVault-D-ahv-KW.js → AddVault-BFUfH1A-.js} +1 -1
  4. package/dist/assets/Calendar-DKvWPoOn.js +1 -0
  5. package/dist/assets/{Import-CZCd6DVe.js → Import-gYrPbftC.js} +4 -4
  6. package/dist/assets/NoteEditor-BNTbbQiq.js +1 -0
  7. package/dist/assets/NoteNew-DCWZJOnG.js +9 -0
  8. package/dist/assets/{NoteRenderer-B-t3iR2x.js → NoteRenderer-D2nj176-.js} +1 -1
  9. package/dist/assets/NoteView-CyhpDII4.js +3 -0
  10. package/dist/assets/OAuthCallback-C1TfZ2M_.js +1 -0
  11. package/dist/assets/PinArchiveButtons-BuU8vG74.js +1 -0
  12. package/dist/assets/Settings-CZVcMAE6.js +1 -0
  13. package/dist/assets/Tags-DWFKRTXQ.js +1 -0
  14. package/dist/assets/VaultGraph-C8wDjZmL.js +3 -0
  15. package/dist/assets/{Vaults-BfdAmD22.js → Vaults-CqhMGcCD.js} +1 -1
  16. package/dist/assets/{attachment-upload-DELsFKqW.js → attachment-upload-BMjVTZmk.js} +1 -1
  17. package/dist/assets/index-BdyNnuNw.js +70 -0
  18. package/dist/assets/index-C9Y7w-_L.css +1 -0
  19. package/dist/assets/{react-force-graph-2d-BD6TQ9hX.js → react-force-graph-2d-DF72c1gy.js} +1 -1
  20. package/dist/assets/{useAttachmentUploader-TbRdZxIB.js → useAttachmentUploader-DO981Zm0.js} +13 -13
  21. package/dist/index.html +2 -2
  22. package/dist/sw.js +1 -1
  23. package/package.json +2 -2
  24. package/dist/assets/Calendar-CYvQrwCA.js +0 -1
  25. package/dist/assets/NoteEditor-DejkUizg.js +0 -1
  26. package/dist/assets/NoteNew-BgEB8Ff1.js +0 -9
  27. package/dist/assets/NoteView-B0i46Tpn.js +0 -3
  28. package/dist/assets/OAuthCallback-C-st38Zr.js +0 -1
  29. package/dist/assets/PinArchiveButtons-BEmrCa2u.js +0 -1
  30. package/dist/assets/Settings-C04VDzuq.js +0 -1
  31. package/dist/assets/Tags-BcEIUux1.js +0 -1
  32. package/dist/assets/Today-Cz-OTXJ7.js +0 -1
  33. package/dist/assets/VaultGraph-D42L0Y2e.js +0 -3
  34. package/dist/assets/dates-BGZoWpL2.js +0 -1
  35. package/dist/assets/index--Z5j3NQq.css +0 -1
  36. package/dist/assets/index-DQ3LtJxh.js +0 -67
@@ -2,7 +2,7 @@
2
2
  "name": "parachute-notes",
3
3
  "displayName": "Notes",
4
4
  "tagline": "Web client for your Parachute Vault",
5
- "version": "0.1.7",
5
+ "version": "0.1.8",
6
6
  "iconUrl": "/notes/icon.svg",
7
7
  "kind": "frontend"
8
8
  }
@@ -1 +1 @@
1
- import{ai as h,a0 as g,B as l,v as e,N as f,L as m,F as b,V as y}from"./index-DQ3LtJxh.js";const p=1440*60*1e3,j=5e3;function N(n,r=30,s=new Date){const d=s.getTime()-r*p,a=[];for(const t of n){const c=t.path??t.id,o=Date.parse(t.createdAt);if(Number.isFinite(o)&&o>=d&&a.push({id:`${t.id}:created`,noteId:t.id,noteName:c,kind:"created",at:t.createdAt,preview:t.preview,tags:t.tags}),t.updatedAt){const i=Date.parse(t.updatedAt);Number.isFinite(i)&&i>=d&&Number.isFinite(o)&&i-o>j&&a.push({id:`${t.id}:updated`,noteId:t.id,noteName:c,kind:"updated",at:t.updatedAt,preview:t.preview,tags:t.tags})}}return a.sort((t,c)=>Date.parse(c.at)-Date.parse(t.at)),a}const v=["today","yesterday","thisWeek","older"],k={today:"Today",yesterday:"Yesterday",thisWeek:"This week",older:"Older"};function w(n,r=new Date){const s=Date.parse(n);if(!Number.isFinite(s))return null;const d=u(r),a=u(new Date(s)),t=Math.round((d.getTime()-a.getTime())/p);return t<0||t===0?"today":t===1?"yesterday":t<7?"thisWeek":"older"}function u(n){return new Date(n.getFullYear(),n.getMonth(),n.getDate())}function D(n,r=new Date){const s={today:[],yesterday:[],thisWeek:[],older:[]};for(const d of n){const a=w(d.at,r);a&&s[a].push(d)}return s}const x=50;function F(){const n=h(i=>i.getActiveVault()),r=g(),[s,d]=l.useState(x),a=l.useMemo(()=>r.data?N(r.data):[],[r.data]),t=l.useMemo(()=>a.slice(0,s),[a,s]),c=l.useMemo(()=>D(t),[t]),o=a.length-t.length;return n?e.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-6 md:px-6 md:py-10",children:[e.jsxs("header",{className:"mb-5 md:mb-6",children:[e.jsx("p",{className:"text-xs uppercase tracking-wider text-fg-dim",children:"Activity"}),e.jsx("h1",{className:"font-serif text-2xl tracking-tight md:text-3xl",children:"Recent changes"}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:"Last 30 days, newest first. Deletions aren't tracked yet."})]}),r.isPending?e.jsx(T,{}):r.isError?e.jsx(B,{error:r.error}):a.length===0?e.jsx(S,{}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-8",children:v.map(i=>c[i].length>0?e.jsx(E,{title:k[i],events:c[i]},i):null)}),o>0?e.jsx("div",{className:"mt-8 flex justify-center",children:e.jsxs("button",{type:"button",onClick:()=>d(i=>i+x),className:"rounded-md border border-border bg-card px-4 py-2 text-sm text-fg-muted hover:text-accent",children:["Load more (",o," remaining)"]})}):null]})]}):e.jsx(f,{to:"/",replace:!0})}function E({title:n,events:r}){return e.jsxs("section",{children:[e.jsxs("h2",{className:"mb-2 text-xs uppercase tracking-wider text-fg-dim",children:[n," (",r.length,")"]}),e.jsx("ol",{className:"divide-y divide-border rounded-md border border-border bg-card",children:r.map(s=>e.jsx("li",{children:e.jsxs(m,{to:`/n/${encodeURIComponent(s.noteId)}`,className:"block px-4 py-3 hover:bg-bg/60 focus:bg-bg/60 focus:outline-none",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[e.jsxs("div",{className:"flex min-w-0 items-baseline gap-2",children:[e.jsx(A,{kind:s.kind}),e.jsx("span",{className:"truncate font-mono text-sm text-fg",children:s.noteName})]}),e.jsx("span",{className:"shrink-0 text-xs text-fg-dim",children:b(s.at)})]}),s.preview?e.jsx("p",{className:"mt-1 truncate text-sm text-fg-muted",children:s.preview}):null,s.tags&&s.tags.length>0?e.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:s.tags.map(d=>e.jsxs("span",{className:"rounded-md bg-border/40 px-1.5 py-0.5 text-xs text-fg-dim",children:["#",d]},d))}):null]})},s.id))})]})}function A({kind:n}){return n==="created"?e.jsx("span",{className:"shrink-0 rounded-md bg-accent/10 px-1.5 py-0.5 text-xs text-accent",children:"Created"}):e.jsx("span",{className:"shrink-0 rounded-md bg-border/40 px-1.5 py-0.5 text-xs text-fg-muted",children:"Edited"})}function S(){return e.jsxs("div",{className:"rounded-md border border-border bg-card p-10 text-center",children:[e.jsx("p",{className:"mb-4 text-fg-muted",children:"No activity in the last 30 days."}),e.jsx(m,{to:"/new",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-[--color-on-accent] hover:bg-accent-hover",children:"New note"})]})}function T(){return e.jsx("div",{className:"space-y-3","aria-busy":"true",children:[0,1,2,3,4].map(n=>e.jsx("div",{className:"h-16 animate-pulse rounded-md bg-border/30"},n))})}function B({error:n}){const r=n instanceof y;return e.jsxs("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-6",children:[e.jsx("p",{className:"mb-2 font-medium text-red-400",children:r?"Session expired":"Could not load activity"}),e.jsx("p",{className:"mb-4 text-sm text-fg-muted",children:n.message}),r?e.jsx(m,{to:"/add",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-[--color-on-accent] hover:bg-accent-hover",children:"Reconnect vault"}):null]})}export{F as Activity};
1
+ import{at as h,ab as g,M as l,x as e,N as f,L as m,Q as b,V as y}from"./index-BdyNnuNw.js";const p=1440*60*1e3,j=5e3;function N(n,r=30,s=new Date){const d=s.getTime()-r*p,a=[];for(const t of n){const c=t.path??t.id,o=Date.parse(t.createdAt);if(Number.isFinite(o)&&o>=d&&a.push({id:`${t.id}:created`,noteId:t.id,noteName:c,kind:"created",at:t.createdAt,preview:t.preview,tags:t.tags}),t.updatedAt){const i=Date.parse(t.updatedAt);Number.isFinite(i)&&i>=d&&Number.isFinite(o)&&i-o>j&&a.push({id:`${t.id}:updated`,noteId:t.id,noteName:c,kind:"updated",at:t.updatedAt,preview:t.preview,tags:t.tags})}}return a.sort((t,c)=>Date.parse(c.at)-Date.parse(t.at)),a}const v=["today","yesterday","thisWeek","older"],k={today:"Today",yesterday:"Yesterday",thisWeek:"This week",older:"Older"};function w(n,r=new Date){const s=Date.parse(n);if(!Number.isFinite(s))return null;const d=u(r),a=u(new Date(s)),t=Math.round((d.getTime()-a.getTime())/p);return t<0||t===0?"today":t===1?"yesterday":t<7?"thisWeek":"older"}function u(n){return new Date(n.getFullYear(),n.getMonth(),n.getDate())}function D(n,r=new Date){const s={today:[],yesterday:[],thisWeek:[],older:[]};for(const d of n){const a=w(d.at,r);a&&s[a].push(d)}return s}const x=50;function M(){const n=h(i=>i.getActiveVault()),r=g(),[s,d]=l.useState(x),a=l.useMemo(()=>r.data?N(r.data):[],[r.data]),t=l.useMemo(()=>a.slice(0,s),[a,s]),c=l.useMemo(()=>D(t),[t]),o=a.length-t.length;return n?e.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-6 md:px-6 md:py-10",children:[e.jsxs("header",{className:"mb-5 md:mb-6",children:[e.jsx("p",{className:"text-xs uppercase tracking-wider text-fg-dim",children:"Activity"}),e.jsx("h1",{className:"font-serif text-2xl tracking-tight md:text-3xl",children:"Recent changes"}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:"Last 30 days, newest first. Deletions aren't tracked yet."})]}),r.isPending?e.jsx(T,{}):r.isError?e.jsx(B,{error:r.error}):a.length===0?e.jsx(S,{}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-8",children:v.map(i=>c[i].length>0?e.jsx(E,{title:k[i],events:c[i]},i):null)}),o>0?e.jsx("div",{className:"mt-8 flex justify-center",children:e.jsxs("button",{type:"button",onClick:()=>d(i=>i+x),className:"rounded-md border border-border bg-card px-4 py-2 text-sm text-fg-muted hover:text-accent",children:["Load more (",o," remaining)"]})}):null]})]}):e.jsx(f,{to:"/",replace:!0})}function E({title:n,events:r}){return e.jsxs("section",{children:[e.jsxs("h2",{className:"mb-2 text-xs uppercase tracking-wider text-fg-dim",children:[n," (",r.length,")"]}),e.jsx("ol",{className:"divide-y divide-border rounded-md border border-border bg-card",children:r.map(s=>e.jsx("li",{children:e.jsxs(m,{to:`/n/${encodeURIComponent(s.noteId)}`,className:"block px-4 py-3 hover:bg-bg/60 focus:bg-bg/60 focus:outline-none",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[e.jsxs("div",{className:"flex min-w-0 items-baseline gap-2",children:[e.jsx(A,{kind:s.kind}),e.jsx("span",{className:"truncate font-mono text-sm text-fg",children:s.noteName})]}),e.jsx("span",{className:"shrink-0 text-xs text-fg-dim",children:b(s.at)})]}),s.preview?e.jsx("p",{className:"mt-1 truncate text-sm text-fg-muted",children:s.preview}):null,s.tags&&s.tags.length>0?e.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:s.tags.map(d=>e.jsxs("span",{className:"rounded-md bg-border/40 px-1.5 py-0.5 text-xs text-fg-dim",children:["#",d]},d))}):null]})},s.id))})]})}function A({kind:n}){return n==="created"?e.jsx("span",{className:"shrink-0 rounded-md bg-accent/10 px-1.5 py-0.5 text-xs text-accent",children:"Created"}):e.jsx("span",{className:"shrink-0 rounded-md bg-border/40 px-1.5 py-0.5 text-xs text-fg-muted",children:"Edited"})}function S(){return e.jsxs("div",{className:"rounded-md border border-border bg-card p-10 text-center",children:[e.jsx("p",{className:"mb-4 text-fg-muted",children:"No activity in the last 30 days."}),e.jsx(m,{to:"/new",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-[--color-on-accent] hover:bg-accent-hover",children:"New note"})]})}function T(){return e.jsx("div",{className:"space-y-3","aria-busy":"true",children:[0,1,2,3,4].map(n=>e.jsx("div",{className:"h-16 animate-pulse rounded-md bg-border/30"},n))})}function B({error:n}){const r=n instanceof y;return e.jsxs("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-6",children:[e.jsx("p",{className:"mb-2 font-medium text-red-400",children:r?"Session expired":"Could not load activity"}),e.jsx("p",{className:"mb-4 text-sm text-fg-muted",children:n.message}),r?e.jsx(m,{to:"/add",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-[--color-on-accent] hover:bg-accent-hover",children:"Reconnect vault"}):null]})}export{M as Activity};
@@ -1 +1 @@
1
- import{a8 as j,B as t,a1 as y,v as e,I as w,z as N,m as R,b as S}from"./index-DQ3LtJxh.js";import{s as C}from"./url-QSQwrjSV.js";function P(){const[u]=j(),c=u.get("url")??"",i=C(u.get("redirect")),[a,d]=t.useState(c),[m,o]=t.useState(null),[p,x]=t.useState(!1),[l,h]=t.useState(!1),f=t.useRef(null),b=t.useRef(c.length>0),n=y();t.useEffect(()=>{var s;(s=f.current)==null||s.focus()},[]),t.useEffect(()=>{b.current||n.status==="found"&&n.origin&&a===""&&(d(n.origin),b.current=!0)},[n.status,n.origin,a]);async function v(s){s.preventDefault(),o(null),x(!1);let g;try{g=N(a)}catch(r){o(r.message);return}h(!0);try{const{authorizeUrl:r}=await R(g,void 0,void 0,{...i?{redirect:i}:{}});window.location.assign(r)}catch(r){r instanceof S?x(!0):o(r.message),h(!1)}}return e.jsxs("div",{className:"mx-auto max-w-xl px-6 py-16",children:[e.jsx("h1",{className:"mb-2 font-serif text-4xl tracking-tight",children:"Connect a vault"}),e.jsx("p",{className:"mb-8 text-fg-muted",children:"Paste your Parachute hub URL. You'll be taken to its consent page to authorize Parachute Notes."}),e.jsxs("form",{onSubmit:v,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"vault-url",className:"mb-1.5 block text-sm font-medium text-fg",children:"Hub URL"}),e.jsx("input",{id:"vault-url",ref:f,type:"url",required:!0,placeholder:"http://localhost:1939",value:a,onChange:s=>d(s.target.value),disabled:l,className:"w-full rounded-md border border-border bg-card px-3 py-2 font-mono text-sm text-fg focus:border-accent focus:outline-none"}),e.jsxs("p",{className:"mt-1.5 text-xs text-fg-dim",children:["For a local install the hub lives at ",e.jsx("code",{children:"http://localhost:1939"}),". A standalone vault URL (e.g. ",e.jsx("code",{children:"https://host/vault/default"}),") also works — Notes will OAuth against whichever issuer answers."]})]}),p?e.jsx(w,{}):null,m?e.jsx("div",{className:"rounded-md border border-red-400/30 bg-red-400/5 px-3 py-2 text-sm text-red-400",children:m}):null,e.jsx("button",{type:"submit",disabled:l||!a,className:"w-full rounded-md bg-accent px-4 py-2.5 text-sm font-medium text-[--color-on-accent] hover:bg-accent-hover disabled:cursor-not-allowed disabled:opacity-60",children:l?"Starting OAuth…":"Continue"})]})]})}export{P as AddVault};
1
+ import{aj as j,M as t,ac as y,x as e,I as w,F as N,m as R,b as S}from"./index-BdyNnuNw.js";import{s as C}from"./url-QSQwrjSV.js";function P(){const[u]=j(),c=u.get("url")??"",i=C(u.get("redirect")),[a,d]=t.useState(c),[m,o]=t.useState(null),[p,x]=t.useState(!1),[l,h]=t.useState(!1),f=t.useRef(null),b=t.useRef(c.length>0),n=y();t.useEffect(()=>{var s;(s=f.current)==null||s.focus()},[]),t.useEffect(()=>{b.current||n.status==="found"&&n.origin&&a===""&&(d(n.origin),b.current=!0)},[n.status,n.origin,a]);async function v(s){s.preventDefault(),o(null),x(!1);let g;try{g=N(a)}catch(r){o(r.message);return}h(!0);try{const{authorizeUrl:r}=await R(g,void 0,void 0,{...i?{redirect:i}:{}});window.location.assign(r)}catch(r){r instanceof S?x(!0):o(r.message),h(!1)}}return e.jsxs("div",{className:"mx-auto max-w-xl px-6 py-16",children:[e.jsx("h1",{className:"mb-2 font-serif text-4xl tracking-tight",children:"Connect a vault"}),e.jsx("p",{className:"mb-8 text-fg-muted",children:"Paste your Parachute hub URL. You'll be taken to its consent page to authorize Parachute Notes."}),e.jsxs("form",{onSubmit:v,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"vault-url",className:"mb-1.5 block text-sm font-medium text-fg",children:"Hub URL"}),e.jsx("input",{id:"vault-url",ref:f,type:"url",required:!0,placeholder:"http://localhost:1939",value:a,onChange:s=>d(s.target.value),disabled:l,className:"w-full rounded-md border border-border bg-card px-3 py-2 font-mono text-sm text-fg focus:border-accent focus:outline-none"}),e.jsxs("p",{className:"mt-1.5 text-xs text-fg-dim",children:["For a local install the hub lives at ",e.jsx("code",{children:"http://localhost:1939"}),". A standalone vault URL (e.g. ",e.jsx("code",{children:"https://host/vault/default"}),") also works — Notes will OAuth against whichever issuer answers."]})]}),p?e.jsx(w,{}):null,m?e.jsx("div",{className:"rounded-md border border-red-400/30 bg-red-400/5 px-3 py-2 text-sm text-red-400",children:m}):null,e.jsx("button",{type:"submit",disabled:l||!a,className:"w-full rounded-md bg-accent px-4 py-2.5 text-sm font-medium text-[--color-on-accent] hover:bg-accent-hover disabled:cursor-not-allowed disabled:opacity-60",children:l?"Starting OAuth…":"Continue"})]})]})}export{P as AddVault};
@@ -0,0 +1 @@
1
+ import{at as k,aj as E,H as y,q as f,ab as A,a0 as K,M as j,z as S,$ as P,x as e,N as T,W as N,G as l,u as V,L as c,V as C}from"./index-BdyNnuNw.js";const _=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],x=5;function W(){const a=k(t=>t.getActiveVault()),[o]=E(),i=o.get("month"),r=y(i)??y(f()),s=A(),h=K(),v=j.useMemo(()=>S(r.year,r.month),[r.year,r.month]),$=j.useMemo(()=>{const t=new Map;if(!s.data)return t;for(const n of s.data){const d=P(n.createdAt);d&&t.set(d,(t.get(d)??0)+1)}return t},[s.data]);if(!a)return e.jsx(T,{to:"/",replace:!0});const u=N(r.year,r.month,-1),p=N(r.year,r.month,1),b=`${u.year}-${l(u.month)}`,g=`${p.year}-${l(p.month)}`,M=f(),w=`${r.year}-${l(r.month)}`===M;return e.jsxs("div",{className:"mx-auto max-w-4xl px-4 py-6 md:px-6 md:py-10",children:[e.jsxs("header",{className:"mb-6 flex flex-wrap items-baseline justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-wider text-fg-dim",children:"Calendar"}),e.jsx("h1",{className:"font-serif text-3xl tracking-tight",children:V(r.year,r.month)})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[e.jsxs(c,{to:`/calendar?month=${b}`,className:"rounded-md border border-border bg-card px-3 py-1.5 text-fg-muted hover:text-accent","aria-label":"Previous month",children:["← ",b]}),w?null:e.jsx(c,{to:"/calendar",className:"rounded-md border border-border bg-card px-3 py-1.5 text-fg-muted hover:text-accent",children:"This month"}),e.jsxs(c,{to:`/calendar?month=${g}`,className:"rounded-md border border-border bg-card px-3 py-1.5 text-fg-muted hover:text-accent","aria-label":"Next month",children:[g," →"]}),e.jsx(c,{to:`/today?date=${h}`,className:"rounded-md border border-border bg-card px-3 py-1.5 text-fg-muted hover:text-accent",children:"Today"})]})]}),s.isError?e.jsx(L,{error:s.error}):e.jsxs("div",{className:"rounded-md border border-border bg-card","aria-busy":s.isPending,children:[e.jsx("div",{className:"grid grid-cols-7 border-b border-border text-xs uppercase tracking-wider text-fg-dim",children:_.map(t=>e.jsx("div",{className:"px-2 py-2 text-center",children:t},t))}),e.jsx("div",{className:"grid grid-cols-7",children:v.map(t=>{const n=`${t.getFullYear()}-${l(t.getMonth()+1)}-${l(t.getDate())}`,d=t.getMonth()+1===r.month,m=$.get(n)??0,D=n===h;return e.jsxs(c,{to:`/today?date=${n}`,className:`flex min-h-20 flex-col border-b border-r border-border p-1.5 text-xs hover:bg-bg/60 focus:bg-bg/60 focus:outline-none ${d?"":"opacity-40"}`,"aria-label":`${n} — ${m} notes`,children:[e.jsx("span",{className:`mb-1 inline-flex h-6 w-6 items-center justify-center rounded-full ${D?"bg-accent text-[--color-on-accent]":"text-fg"}`,children:t.getDate()}),m>0?e.jsx(F,{count:m}):e.jsx("span",{className:"sr-only",children:"no notes"})]},n)})})]}),e.jsx("p",{className:"mt-3 text-xs text-fg-dim",children:"Each dot is a note created on that day. Click any day to open /today."})]})}function F({count:a}){const o=Math.min(a,x),i=a>x?a-x:0;return e.jsxs("span",{className:"flex flex-wrap items-center gap-0.5",children:[Array.from({length:o}).map((r,s)=>e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-accent","aria-hidden":"true"},s)),i>0?e.jsxs("span",{className:"ml-0.5 text-[10px] text-fg-dim",children:["+",i]}):null]})}function L({error:a}){const o=a instanceof C;return e.jsxs("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-6",children:[e.jsx("p",{className:"mb-2 font-medium text-red-400",children:o?"Session expired":"Could not load notes"}),e.jsx("p",{className:"mb-4 text-sm text-fg-muted",children:a.message}),o?e.jsx(c,{to:"/add",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-[--color-on-accent] hover:bg-accent-hover",children:"Reconnect vault"}):null]})}export{W as Calendar};