@openparachute/app 0.22.15-rc.1 → 0.22.15-rc.11

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 (64) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/.parachute/info +1 -1
  3. package/dist/assets/Account-DEYVoMoJ.js +1 -0
  4. package/dist/assets/{Activity-BVb4U7Q5.js → Activity-mwytxPNJ.js} +1 -1
  5. package/dist/assets/AddVault-BC71qUe3.js +1 -0
  6. package/dist/assets/AddVaultChooser-D-LzqkAN.js +1 -0
  7. package/dist/assets/AddVaultCreate-cUJzJon_.js +1 -0
  8. package/dist/assets/AttachmentDropZone-r67Wn9ZU.js +1 -0
  9. package/dist/assets/Calendar-BZiRxWki.js +1 -0
  10. package/dist/assets/CheckEmail-Bw9wXkVS.js +1 -0
  11. package/dist/assets/{useAttachmentUploader-C6cRUDu9.js → CodeMirrorEditor-_eWRBxXN.js} +18 -18
  12. package/dist/assets/ConnectAI-BmhVusz5.js +1 -0
  13. package/dist/assets/DayView-GPiVliec.js +1 -0
  14. package/dist/assets/Export-9D1zURrv.js +1 -0
  15. package/dist/assets/{Import-QNeO2DQf.js → Import-BDTtRgEn.js} +2 -2
  16. package/dist/assets/NoteEditor-ASh32-CL.js +1 -0
  17. package/dist/assets/NoteNew-BaOqPDVW.js +8 -0
  18. package/dist/assets/NoteView-g7deWvHN.js +9 -0
  19. package/dist/assets/OAuthCallback-urWNIti8.js +1 -0
  20. package/dist/assets/{PinArchiveButtons-BF2h5sd6.js → PinArchiveButtons-DTlqcgy0.js} +1 -1
  21. package/dist/assets/Settings-dg5_eEea.js +1 -0
  22. package/dist/assets/{TagPage-grfoxRFE.js → TagPage-Bnv4e0W-.js} +1 -1
  23. package/dist/assets/{TagSchemaEditor-CU4gNacV.js → TagSchemaEditor-C8BTBwE4.js} +1 -1
  24. package/dist/assets/{Tags-Cal8aFjP.js → Tags-D04DnSWr.js} +1 -1
  25. package/dist/assets/{VaultGraph-CcjU0j55.js → VaultGraph-BF7wEVTJ.js} +3 -3
  26. package/dist/assets/Vaults-DV9IgHfW.js +1 -0
  27. package/dist/assets/{ViewNew-CDGzQ2XL.js → ViewNew-CZg-wYOy.js} +1 -1
  28. package/dist/assets/ViewSurface-DDodj1af.js +1 -0
  29. package/dist/assets/Welcome-pAh2PeSb.js +1 -0
  30. package/dist/assets/{WizardShell-ChHegb5x.js → WizardShell-BBYxknp4.js} +1 -1
  31. package/dist/assets/attachment-upload-DmLh-U0Q.js +2 -0
  32. package/dist/assets/history-B0uaXgK5.js +1 -0
  33. package/dist/assets/index-DFrgKlHJ.js +66 -0
  34. package/dist/assets/index-yvGc9ccv.css +1 -0
  35. package/dist/assets/{provenance-CGjK9ygs.js → provenance-D3sV-zhJ.js} +1 -1
  36. package/dist/assets/{react-force-graph-2d-paet-_dA.js → react-force-graph-2d-f0d26obG.js} +1 -1
  37. package/dist/assets/{transcribe-default-DHfppjp6.js → transcribe-default-hcnFAy9n.js} +1 -1
  38. package/dist/assets/useAttachmentUploader-t93QVRf6.js +37 -0
  39. package/dist/index.html +2 -2
  40. package/dist/sw.js +1 -1
  41. package/meta.json +1 -1
  42. package/package.json +1 -1
  43. package/dist/assets/Account-1h--sI0S.js +0 -1
  44. package/dist/assets/AddVault-D8P9dBJm.js +0 -1
  45. package/dist/assets/AddVaultChooser-C89SvcNh.js +0 -1
  46. package/dist/assets/AddVaultCreate-B7qRsdyk.js +0 -1
  47. package/dist/assets/Calendar-COG9eJSc.js +0 -1
  48. package/dist/assets/CheckEmail-vx8tm7yG.js +0 -1
  49. package/dist/assets/ConnectAI-CGyo0f67.js +0 -1
  50. package/dist/assets/DayView-BcF__L7N.js +0 -1
  51. package/dist/assets/Export-CzdWUi2Z.js +0 -1
  52. package/dist/assets/NoteEditor-BTrIsrgU.js +0 -1
  53. package/dist/assets/NoteNew-74SE2SgY.js +0 -8
  54. package/dist/assets/NoteRenderer-Bhc2r4Wr.js +0 -37
  55. package/dist/assets/NoteView-DtN55Tvh.js +0 -3
  56. package/dist/assets/OAuthCallback-BqnfK5Gj.js +0 -1
  57. package/dist/assets/Settings-xArE7jTO.js +0 -1
  58. package/dist/assets/Vaults-H0i0ppW2.js +0 -1
  59. package/dist/assets/ViewSurface-C9hEJCXI.js +0 -1
  60. package/dist/assets/Welcome-B6Da4JFX.js +0 -1
  61. package/dist/assets/attachment-upload-Ddcp_juS.js +0 -2
  62. package/dist/assets/history-CCMaZ2ZP.js +0 -1
  63. package/dist/assets/index-BBWRhmyM.css +0 -1
  64. package/dist/assets/index-C5VzvNUc.js +0 -66
package/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ ## [0.22.15-rc.5] - 2026-10-30
2
+
3
+ **What a brand-new person tripped on (T-318 production walk).** Four PRs on `next`.
4
+
5
+ - **An attached image shows in the read view (#221).** An embed above the title was cut with the title line; stored attachments (rows carry `path`, no `filename`/`url`) showed "Processing…" forever; Save replaced the cached note with a PATCH response that has no attachments.
6
+ - **The vault's address is its app page, not the API root (#222).** The first-vault form, Vaults, Account and the Welcome picker showed `…/vault/<name>`, which answers raw JSON in a browser; they show `<origin>/v/<name>` now. The naming hint shows once, spaces become one hyphen, and the Export page says where attachments really go.
7
+ - **No "Your sign-in ended" banner right after closing the account (#223).** A deliberate close suppresses the session-lost banner until a later signed-in session; the undo deadline shows its time zone.
8
+ - **No "via API" on notes typed in the app; plain-text previews (#224).** List and card previews drop markdown and the repeated title.
9
+
10
+ ## [0.22.15-rc.3] - 2026-09-17
11
+
12
+ - Note version history: browse retained native and imported snapshots, compare content and metadata, and explicitly confirm a restore using the current note timestamp you reviewed. Newer edits block restore. Recovery is online-only and never queued for reconnect; unavailable history is distinct from an empty list. Restore keeps current paths and tags, and does not replace attachment/link caches with a partial response. Requires a history-capable vault; deleted-note recovery remains an API operation.
13
+
14
+ ## [0.22.15-rc.2] - 2026-09-12
15
+
16
+ **`/v/<vault>/…` is the canonical in-app address.** Two PRs on `next` after 0.22.15-rc.1.
17
+
18
+ - **The vault-scoped address stays in the address bar, and in-app navigation keeps it (#208, closes #207).** Arriving at `/v/<vault>/n/<id>` used to switch the vault and then redirect to bare `/n/<id>`, so the address bar and "Copy link" disagreed and a copied URL only opened on a device already sitting in that vault. The vault prefix now lives in React Router's `basename`, computed from the location the router is rendering (a local copy of RR 7.18.1's `BrowserRouter` body with one edit), so the route table, every `useParams`, every pathname reader and all ~193 `Link`/`navigate` sites keep working on the un-prefixed path unchanged. A `VaultPrefixGate` above `<Routes>` resolves the vault (slug, local name or id), switches with the one toast, normalises the spelling to the server slug, replaces bare `/n/<id>` and `/` INTO the active vault's prefix, and keeps account and ceremony pages bare. Vault switching from the sidebar and the vault list is now a navigation, so the URL stays the single source of truth; the three channels that could double a prefix (note content, `?redirect=`, the not-connected card) go through an absolute navigator. Review caught two spec errors before merge, both fixed on the PR: note-body `/v/` links carry the deployment mount, and the gate reads the router's rendered location rather than `window.location`, which runs ahead of a transition. 22 new pins; the existing not-connected, toast and `/v`→`/vaults` controls are unchanged.
19
+ - **Docs follow the canonical model (#210, closes #209).** `deep-link.ts`'s header and the NAVIGATION.md not-connected-card row describe the prefix-in-basename model and the card's absolute anchor instead of the old redirect.
20
+
1
21
  ## [0.22.15-rc.1] - 2026-09-05
2
22
 
3
23
  **Vault-scoped addressing finished, and a note deep link that survives login.** Nine PRs on `next` after 0.22.14. First cut of the 0.22.15 line: 0.22.14 went stable on 2026-08-30, so a further `0.22.14-rc.N` would sort BELOW the released 0.22.14 and leave npm `@rc` older than `@latest`.
@@ -2,7 +2,7 @@
2
2
  "name": "parachute-app",
3
3
  "displayName": "Parachute",
4
4
  "tagline": "The super-surface for your Parachute",
5
- "version": "0.22.15-rc.1",
5
+ "version": "0.22.15-rc.11",
6
6
  "iconUrl": "/icon.svg",
7
7
  "kind": "frontend"
8
8
  }
@@ -0,0 +1 @@
1
+ import{j as e,r as d,L as j,d as G,u as N,c as C,a as H,l as _,b as E,v as W,i as J,e as A,g as Q,f as z,s as K,m as X,h as Z,I as D,k as ee,n as te,o as ne,p as L,q as se,t as T,O as ae,w as re,x as le,y as ie,z as O,S as R,A as oe,B as ce}from"./index-DFrgKlHJ.js";import{f as ue,a as $}from"./provenance-D3sV-zhJ.js";function de(t,n){return t.trim().toLowerCase()===n.trim().toLowerCase()}const me={year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"};function B(t){const n=new Date(t);return Number.isNaN(n.getTime())?t:n.toLocaleString(void 0,me)}const he={byCode:{confirm_mismatch:"That doesn't match your account email.",already_deleting:"This account is already being deleted. Check your email for the undo link."},sessionEnded:"Your sign-in has ended. Sign in again, then come back here to delete your account.",fallback:"Couldn't delete your account. Nothing has changed. Try again."};function xe(t){return typeof t=="string"&&(/^https?:\/\//i.test(t)||t.startsWith("/"))}function fe(t){const{vaults:n,removeVault:s}=E.getState();for(const a of Object.values(n)){const r=W(a.url)??a.name;J(a)&&t.has(r)&&s(a.id)}}async function ge(){try{const t=await _();return new Set((Array.isArray(t==null?void 0:t.vaults)?t.vaults:[]).map(n=>n.name))}catch{return new Set}}function pe({email:t,descriptor:n,onDeleted:s}){var a;return((a=n==null?void 0:n.capabilities)==null?void 0:a.account_delete)!==!0||!t?null:e.jsx(ye,{email:t,onDeleted:s})}function ye({email:t,onDeleted:n}){const s=d.useId(),[a,r]=d.useState(""),[l,u]=d.useState(!1),[i,m]=d.useState(null),x=de(a,t);async function y(o){if(o.preventDefault(),!(!x||l)){u(!0),m(null);try{const c=await ge(),g=await G(a.trim());N.getState().markClosed(),C(),fe(c),n(g)}catch(c){m(H(c,he))}finally{u(!1)}}}return e.jsxs("section",{"aria-label":"Delete account",className:"card p-6 shadow-soft",children:[e.jsx("h2",{className:"font-serif text-xl text-fg",children:"Delete account"}),e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"mt-2 text-sm text-fg-muted",children:["Your account closes now and you're signed out everywhere. Everything is erased after 24 hours: your vaults, notes, files, snapshots and exports. Until then the email we send has an undo link."," ",e.jsx(j,{to:"/export",className:"focus-ring text-accent underline",children:"Export first"})," ","if you want a copy."]}),e.jsxs("form",{onSubmit:y,className:"mt-4 space-y-3",children:[e.jsx("label",{htmlFor:s,className:"block text-sm font-medium text-fg",children:"Type your account email to confirm"}),e.jsx("input",{id:s,type:"email",value:a,onChange:o=>r(o.target.value),autoComplete:"off",spellCheck:!1,placeholder:t,className:"input"}),e.jsx("button",{type:"submit",disabled:!x||l,className:"btn btn-danger-solid btn-touch",children:l?"Deleting…":"Delete my account"})]}),i?e.jsx("p",{role:"alert",className:"mt-4 rounded-lg border border-danger-border bg-danger-soft px-3 py-2 text-sm text-danger",children:i}):null]})]})}function be({done:t,onDone:n}){return e.jsxs("section",{"aria-label":"Account closed",className:"card p-6 shadow-soft",children:[e.jsx("h2",{className:"font-serif text-xl text-fg",children:"Account closed"}),e.jsxs("div",{className:"mt-2 space-y-4",children:[t.notice_sent===!1&&xe(t.undo_url)?e.jsxs("output",{className:"block text-sm text-fg-muted",children:["Your account is closed. We couldn't send the email with the undo link, so here it is:"," ",e.jsx("a",{href:t.undo_url,className:"focus-ring text-accent underline",children:"undo the deletion"}),". It works for 24 hours, until ",B(t.undo_expires_at),"."]}):e.jsxs("output",{className:"block text-sm text-fg-muted",children:["Your account is closed. We sent an email with an undo link; it works for 24 hours, until"," ",B(t.undo_expires_at),"."]}),e.jsx("button",{type:"button",onClick:n,className:"btn btn-primary btn-touch",children:"Done"})]})]})}const S="lens:account_deleted";function je(){try{const t=sessionStorage.getItem(S),n=t?JSON.parse(t):null;return n&&typeof n.undo_expires_at=="string"?n:null}catch{return null}}function ve(t){try{if(t){const{undo_token:n,...s}=t;sessionStorage.setItem(S,JSON.stringify(s))}else sessionStorage.removeItem(S)}catch{}}function Ye(){const[t,n]=d.useState({kind:"loading"}),[s,a]=d.useState(je),r=d.useCallback(i=>{ve(i),a(i)},[]),l=A(),u=N(i=>i.identityEpoch);return d.useEffect(()=>{let i=!0;return(async()=>{let m;try{m=await Q()}catch{i&&n({kind:"device"});return}i&&n(m.signed_in?{kind:"manager",email:m.email,username:m.username,csrf:m.csrf}:{kind:"device"})})(),()=>{i=!1}},[u]),e.jsxs("div",{className:"page-prose",children:[e.jsxs("header",{className:"mb-8",children:[e.jsx("h1",{className:"page-title",children:"Your parachute"}),e.jsx("p",{className:"mt-2 max-w-prose text-fg-muted",children:"Your account, plan, vaults, and connections — managed here."})]}),s?e.jsx(be,{done:s,onDone:()=>{r(null),C(),l("/",{replace:!0})}}):t.kind==="loading"?e.jsx("output",{"aria-live":"polite",className:"block py-10 text-center text-sm text-fg-dim",children:e.jsx("span",{className:"animate-pulse",children:"Loading your account…"})}):t.kind==="device"?e.jsx(Re,{}):e.jsx(Ne,{email:t.email,username:t.username,csrf:t.csrf,onDeleted:r})]})}function Ne({email:t,username:n,csrf:s,onDeleted:a}){const r=A(),l=E(f=>f.getActiveVault()),u=N(f=>f.identityEpoch),i=z(),m=i.isPending?"loading":i.data??null,x=K(i.data),y=d.useCallback(()=>i.refetch(),[i.refetch]),[o,c]=d.useState("loading"),[g,h]=d.useState(null);d.useEffect(()=>{let f=!0;return _().then(v=>{f&&c(v.vaults)}).catch(v=>{X(v),f&&c("error")}),Z().then(v=>{f&&h(v)}),()=>{f=!1}},[u]);const p=d.useCallback(async()=>{try{const{vaults:f}=await _();c(f)}catch{c("error")}},[]);async function b(){try{await ne(s)}finally{C(),r("/",{replace:!0})}}return e.jsxs("div",{className:"space-y-6",children:[e.jsx(we,{email:t,username:n,summary:x,onSignOut:b}),e.jsx(_e,{state:m,descriptor:g,onRetry:y,retrying:i.isFetching}),e.jsx(Le,{vaults:o,summary:x,onReload:p}),e.jsx(U,{hasActiveVault:!!l}),e.jsx(pe,{email:t,descriptor:g,onDeleted:a})]})}function we({email:t,username:n,summary:s,onSignOut:a}){return e.jsx("section",{"aria-label":"Account",className:"card p-6 shadow-soft",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"eyebrow mb-1",children:"Signed in as"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[e.jsx("p",{className:"break-words font-serif text-xl text-fg",children:t??n??"your account"}),e.jsx(ke,{summary:s})]})]}),e.jsx("button",{type:"button",onClick:a,className:"focus-ring shrink-0 text-sm text-fg-dim hover:text-accent",children:"Sign out"})]})})}function ke({summary:t}){if(!t)return null;const n=T(t);return typeof n=="number"?e.jsxs("span",{className:"chip border-transparent bg-sun-soft font-medium text-sun-ink",children:["Free trial · ",n===0?"ends today":`${n} day${n===1?"":"s"} left`]}):e.jsx("span",{className:"chip",children:t.plan.label})}function _e({state:t,descriptor:n,onRetry:s,retrying:a}){if(t===null)return null;const r=t!=="loading"&&t!=="error"&&L(t);if(t!=="loading"&&t!=="error"&&!t.billing_enabled&&!r)return null;const u=t!=="loading"&&t!=="error"&&(r?P(t):t.billing_enabled)?"Plan & billing":"Your plan";return e.jsxs("section",{"aria-label":u,className:"card p-6 shadow-soft",children:[e.jsx("h2",{className:"font-serif text-xl text-fg",children:u}),t==="loading"?e.jsxs("div",{"aria-busy":"true",className:"mt-4 space-y-2.5",children:[e.jsx("div",{className:"skeleton h-4 w-3/5 rounded-md"}),e.jsx("div",{className:"skeleton h-4 w-2/5 rounded-md"})]}):t==="error"?e.jsxs("div",{className:"mt-4 text-center",children:[e.jsx("p",{className:"mb-1 font-serif text-lg text-fg",children:"Couldn't load your plan."}),e.jsx("p",{className:"mb-5 text-sm text-fg-muted",children:"A hiccup reaching your account — your plan hasn't changed."}),e.jsx("button",{type:"button",onClick:s,disabled:a,className:"btn btn-primary btn-touch",children:a?"Retrying…":"Retry"})]}):r?e.jsx(Se,{summary:t}):t.has_billing_customer?e.jsx(Ee,{summary:t}):e.jsx(Ve,{summary:t,plans:(n==null?void 0:n.plans)??[]})]})}function Se({summary:t}){const n=P(t);return e.jsxs("div",{className:"mt-4","data-testid":"open-beta-plan",children:[e.jsx("p",{className:"text-sm text-fg-muted",children:I(t)}),e.jsx("p",{className:"mt-3 text-sm text-fg",children:ae}),n?e.jsx(M,{}):null]})}const Ce=new Set(["entry","standard","plus","power"]);function P(t){return t.has_billing_customer&&Ce.has(t.plan.tier)}function Ee({summary:t}){return e.jsxs("div",{className:"mt-4",children:[e.jsx("p",{className:"text-sm text-fg-muted",children:I(t)}),e.jsx(M,{})]})}function M(){const[t,n]=d.useState(!1),[s,a]=d.useState(null);async function r(){n(!0),a(null);try{const{url:l}=await oe();window.location.assign(l)}catch(l){if(n(!1),l instanceof R){N.getState().markExpired();return}a("Billing isn't available right now.")}}return e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:r,disabled:t,className:"btn btn-primary btn-touch mt-4",children:t?"Opening…":"Manage plan & billing ↗"}),s?e.jsx(F,{text:s}):null]})}const w=["monthly","quarterly","yearly"],V={monthly:"Monthly",quarterly:"Quarterly",yearly:"Yearly"},Ae={monthly:"/mo",quarterly:"/quarter",yearly:"/yr"},Ie={monthly:1,quarterly:3,yearly:12};function De(t){var s,a;const n=new Set;for(const r of t)for(const l of w)(a=(s=r.intervals)==null?void 0:s[l])!=null&&a.available&&n.add(l);return w.filter(r=>n.has(r))}function Y(t,n){return t.label?t.label:typeof t.price=="number"?`$${t.price}${Ae[n]}`:null}function Oe(t){var n;for(const s of w){const a=(n=t.intervals)==null?void 0:n[s];if(a!=null&&a.available)return{interval:s,entry:a}}return null}function $e(t,n){if(!n||!t.intervals)return typeof t.price_month=="number"?`$${t.price_month}/mo`:null;const s=[];let a=!1,r=null;for(const u of w){const i=t.intervals[u];if(!(i!=null&&i.available))continue;u==="monthly"&&(a=!0);const m=Y(i,u);if(m&&s.push(m),typeof i.price=="number"){const x=i.price/Ie[u];r=r===null?x:Math.min(r,x)}}if(s.length===0)return null;const l=s.join(" · ");return a||r===null?l:`${l} — about $${Math.max(1,Math.round(r))}/mo`}function Be(t){if(t instanceof ce)switch(t.code){case"already_subscribed":return"You're already subscribed — refresh to see your plan.";case"invalid_plan":case"invalid_interval":case"invalid_tier":return"That plan isn't offered on this cycle — pick another."}return"Billing isn't available right now."}function F({text:t}){return e.jsx("p",{className:"mt-3 rounded-lg border border-danger-border bg-danger-soft px-3 py-2 text-sm text-danger",children:t})}function Ve({summary:t,plans:n}){const s=De(n),[a,r]=d.useState(null),l=a!==null&&s.includes(a)?a:s[0]??null,[u,i]=d.useState(null),[m,x]=d.useState(null);async function y(o){if(!u){i(o),x(null);try{const{url:c}=l?await O(o,l):await O(o);window.location.assign(c)}catch(c){if(i(null),c instanceof R){N.getState().markExpired();return}x(Be(c))}}}return e.jsxs("div",{className:"mt-4",children:[e.jsx("p",{className:"text-sm text-fg-muted",children:I(t)}),l&&s.length>1?e.jsxs("fieldset",{className:"mt-4 flex flex-wrap items-center gap-1.5",children:[e.jsx("legend",{className:"sr-only",children:"Billing interval"}),s.map(o=>{const c=o===l;return e.jsx("button",{type:"button",onClick:()=>r(o),"aria-pressed":c,className:`chip focus-ring ${c?"chip-tag-active font-medium":"chip-tag"}`,children:V[o]},o)})]}):null,n.length>0?e.jsx("ul",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:n.map(o=>{var f;const c=o.id===t.plan.tier,g=l?(f=o.intervals)==null?void 0:f[l]:void 0,h=s.length===0||(g==null?void 0:g.available)===!0,p=$e(o,s.length>0),b=h?null:Oe(o);return e.jsxs("li",{className:"rounded-xl border border-border bg-bg p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"font-serif text-lg text-fg",children:o.name}),c?e.jsx("span",{className:"chip",children:"Current"}):null]}),p?e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:p}):null,typeof o.vaults=="number"?e.jsxs("p",{className:"mt-0.5 text-xs text-fg-dim",children:[o.vaults," vault",o.vaults===1?"":"s"]}):null,c?null:h?e.jsx("button",{type:"button",onClick:()=>y(o.id),disabled:u!==null,className:"btn btn-primary btn-sm btn-touch mt-3 w-full",children:u===o.id?"Starting…":`Upgrade to ${o.name}`}):e.jsxs("div",{className:"mt-3",children:[e.jsxs("button",{type:"button",disabled:!0,className:"btn btn-secondary btn-sm btn-touch w-full",children:["Not available"," ",V[l].toLowerCase()]}),b?e.jsxs("p",{className:"mt-1 text-xs text-fg-dim",children:["Available from ",Y(b.entry,b.interval)]}):null]})]},o.id)})}):null,m?e.jsx(F,{text:m}):null]})}function I(t){const{plan:n}=t,s=[n.label],a=T(t);a!==null?s.push(`${a} day${a===1?"":"s"} left`):typeof n.price_monthly_usd=="number"&&n.price_monthly_usd>0&&s.push(`$${n.price_monthly_usd}/mo`),typeof n.vault_limit=="number"&&typeof n.vaults_used=="number"&&s.push(`${n.vaults_used} of ${n.vault_limit} vaults`);const r=$(n.storage_used_bytes??0);if(r){const l=n.storage_limit_bytes?$(n.storage_limit_bytes):null;s.push(l?`${r} of ${l}`:r)}return s.join(" · ")}function Le({vaults:t,summary:n,onReload:s}){const a=A(),[r,l]=d.useState(null),[u,i]=d.useState(null),[m,x]=d.useState(!1);async function y(h){if(!r){l(h.name),i(null);try{await re(h.name),le(h.name),a("/")}catch(p){l(null),i(ie(p,"Couldn't open that vault."))}}}async function o(){x(!0);try{await s()}finally{x(!1)}}const c=n==null?void 0:n.plan,g=c&&typeof c.vault_limit=="number"&&typeof c.vaults_used=="number"?`${c.vaults_used} of ${c.vault_limit} ${L(n)?"in the open beta":"on your plan"}`:null;return e.jsxs("section",{"aria-label":"Your vaults",className:"card p-6 shadow-soft",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1",children:[e.jsx("h2",{className:"font-serif text-xl text-fg",children:"Your vaults"}),g?e.jsx("span",{className:"text-xs text-fg-muted",children:g}):null]}),t==="loading"?e.jsxs("div",{"aria-busy":"true",className:"mt-4 space-y-2.5",children:[e.jsx("div",{className:"skeleton h-9 rounded-lg"}),e.jsx("div",{className:"skeleton h-9 w-4/5 rounded-lg"})]}):t==="error"?e.jsxs("div",{className:"mt-4 text-center",children:[e.jsx("p",{className:"mb-1 font-serif text-lg text-fg",children:"Couldn't load your vaults."}),e.jsx("p",{className:"mb-5 text-sm text-fg-muted",children:"A hiccup reaching your account — nothing's lost, your vaults are safe."}),e.jsx("button",{type:"button",onClick:o,disabled:m,className:"btn btn-primary btn-touch",children:m?"Retrying…":"Retry"})]}):t.length===0?e.jsxs("div",{className:"mt-4 text-center",children:[e.jsx("p",{className:"mb-1 font-serif text-lg text-fg",children:"No vaults yet."}),e.jsx("p",{className:"mb-5 text-sm text-fg-muted",children:"Create your first — a private home for your notes, always yours to export."}),e.jsx(j,{to:"/add-vault/create",className:"btn btn-primary btn-touch",children:"Create a vault"})]}):e.jsxs(e.Fragment,{children:[e.jsx("ul",{className:"mt-3 divide-y divide-border-light",children:t.map(h=>{const p=ue(h.usage),b=se(h.name).replace(/^https?:\/\//,"");return e.jsxs("li",{className:"flex items-center gap-3 py-3",children:[e.jsx(Te,{name:h.name}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate font-serif text-lg leading-snug text-fg",children:h.name}),e.jsx("p",{className:"mt-0.5 truncate note-id",children:b}),p?e.jsx("p",{className:"mt-0.5 text-xs text-fg-muted",children:p}):null]}),e.jsx("button",{type:"button",onClick:()=>y(h),disabled:r===h.name,className:"btn btn-primary btn-sm btn-touch shrink-0",children:r===h.name?"Opening…":"Open →"})]},h.name)})}),e.jsx("p",{className:"mt-3 border-t border-border-light pt-3 text-sm",children:e.jsx(j,{to:"/add-vault",className:"focus-ring font-semibold text-accent hover:underline",children:"+ Add a vault"})})]}),u?e.jsx("p",{className:"mt-4 rounded-lg border border-danger-border bg-danger-soft px-3 py-2 text-sm text-danger",children:u}):null]})}function Te({name:t}){const n=(t.trim()[0]??"?").toUpperCase();return e.jsx("span",{"aria-hidden":!0,className:"grid h-9 w-9 shrink-0 place-items-center rounded-full bg-grass-soft text-sm font-semibold text-grass-ink",children:n})}function U({hasActiveVault:t}){return e.jsxs("section",{"aria-label":"Connections",className:"card p-6 shadow-soft",children:[e.jsx("h2",{className:"font-serif text-xl text-fg",children:"Connections"}),e.jsxs("div",{className:"mt-2 divide-y divide-border-light",children:[t?e.jsx(k,{to:"/connect",tone:"sky",icon:e.jsx(D,{width:18,height:18}),title:"Connect your AI",description:"Claude, ChatGPT, or any MCP client — one memory, shared."}):e.jsxs("div",{className:"-mx-2 flex items-center gap-3 px-2 py-3 opacity-60",children:[e.jsx(q,{tone:"sky",children:e.jsx(D,{width:18,height:18})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"font-medium text-fg",children:"Connect your AI"}),e.jsx("p",{className:"mt-0.5 text-sm text-fg-muted",children:"Open a vault above to connect an AI to it."})]})]}),e.jsx(k,{to:"/import",tone:"grass",icon:e.jsx(ee,{width:18,height:18}),title:"Import notes",description:"Bring your notes over from anywhere markdown lives."}),e.jsx(k,{to:"/export",tone:"sun",icon:e.jsx(te,{width:18,height:18}),title:"Export notes",description:"Download your vault as open Markdown — yours to keep."})]})]})}function k({to:t,tone:n,icon:s,title:a,description:r}){return e.jsxs(j,{to:t,className:"focus-ring -mx-2 flex items-center gap-3 rounded-lg px-2 py-3 hover:bg-bg-soft",children:[e.jsx(q,{tone:n,children:s}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block font-medium text-fg",children:a}),e.jsx("span",{className:"mt-0.5 block text-sm text-fg-muted",children:r})]}),e.jsx("span",{"aria-hidden":!0,className:"shrink-0 text-lg text-fg-dim",children:"›"})]})}function q({tone:t,children:n}){const s=t==="grass"?"bg-grass-soft text-grass-ink":t==="sun"?"bg-sun-soft text-sun-ink":"bg-bg-soft";return e.jsx("span",{"aria-hidden":!0,className:`grid h-10 w-10 shrink-0 place-items-center rounded-full ${s}`,style:t==="sky"?{color:"var(--color-sky)"}:void 0,children:n})}function Re(){const t=E(s=>s.vaults),n=Object.values(t);return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"card p-6 shadow-soft",children:[e.jsx("h2",{className:"font-serif text-xl text-fg",children:"This device"}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:"You're managing the vaults connected on this device. Sign in to your account to manage your plan and hosted vaults from anywhere."}),e.jsxs("div",{className:"mt-4 flex flex-wrap gap-3",children:[e.jsx(j,{to:"/",className:"btn btn-primary btn-touch",children:"Sign in"}),e.jsx(j,{to:"/vaults",className:"btn btn-ghost btn-touch",children:n.length>0?`${n.length} connected`:"Connect a vault"})]})]}),e.jsx(U,{hasActiveVault:n.length>0})]})}export{Ye as Account};
@@ -1 +1 @@
1
- import{a as y,t as f,v as g,w as j,x as N,r as u,j as e,N as b,D as v,y as w,E as D,L as m,z as E,A as k,V as A}from"./index-C5VzvNUc.js";const x=1440*60*1e3,S=5e3;function T(a,i=30,t=new Date){const n=t.getTime()-i*x,r=[];for(const s of a){const o=s.path??s.id,d=Date.parse(s.createdAt);if(Number.isFinite(d)&&d>=n&&r.push({id:`${s.id}:created`,noteId:s.id,noteName:o,kind:"created",at:s.createdAt,preview:s.preview,tags:s.tags}),s.updatedAt){const l=Date.parse(s.updatedAt);Number.isFinite(l)&&l>=n&&Number.isFinite(d)&&l-d>S&&r.push({id:`${s.id}:updated`,noteId:s.id,noteName:o,kind:"updated",at:s.updatedAt,preview:s.preview,tags:s.tags})}}return r.sort((s,o)=>Date.parse(o.at)-Date.parse(s.at)),r}const _=["today","yesterday","thisWeek","older"],B={today:"Today",yesterday:"Yesterday",thisWeek:"This week",older:"Older"};function C(a,i=new Date){const t=Date.parse(a);if(!Number.isFinite(t))return null;const n=p(i),r=p(new Date(t)),s=Math.round((n.getTime()-r.getTime())/x);return s<0||s===0?"today":s===1?"yesterday":s<7?"thisWeek":"older"}function p(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate())}function I(a,i=new Date){const t={today:[],yesterday:[],thisWeek:[],older:[]};for(const n of a){const r=C(n.at,i);r&&t[r].push(n)}return t}const h=50;function O(){const a=y(c=>c.getActiveVault()),i=f(g(),-29),t=j({field:"updated_at",from:N(i),limit:v}),[n,r]=u.useState(h),s=u.useMemo(()=>t.data?T(t.data):[],[t.data]),o=u.useMemo(()=>s.slice(0,n),[s,n]),d=u.useMemo(()=>I(o),[o]),l=s.length-o.length;return a?e.jsxs("div",{className:"page-prose",children:[e.jsxs("header",{className:"mb-8",children:[e.jsx("p",{className:"eyebrow mb-1",children:"Activity"}),e.jsx("h1",{className:"page-title",children:"Recent changes"}),e.jsx("p",{className:"mt-2 text-fg-muted",children:"Last 30 days, newest first. Deletions aren't tracked yet."})]}),t.isPending?e.jsx(V,{}):t.isError?e.jsx(F,{error:t.error,retry:()=>t.refetch()}):s.length===0?e.jsx(M,{}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-8",children:_.map(c=>d[c].length>0?e.jsx(R,{title:B[c],events:d[c]},c):null)}),l>0?e.jsx("div",{className:"mt-8 flex justify-center",children:e.jsxs("button",{type:"button",onClick:()=>r(c=>c+h),className:"btn btn-secondary btn-touch",children:["Load more (",l," remaining)"]})}):null]})]}):e.jsx(b,{to:"/",replace:!0})}function R({title:a,events:i}){return e.jsxs("section",{children:[e.jsxs("h2",{className:"eyebrow mb-3",children:[a," (",i.length,")"]}),e.jsx("ol",{className:"card shadow-soft divide-y divide-border rounded-xl",children:i.map(t=>e.jsx("li",{children:e.jsxs(m,{to:`/n/${encodeURIComponent(t.noteId)}`,className:"focus-ring block px-5 py-4 transition-colors hover:bg-bg-soft",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(L,{kind:t.kind}),e.jsx("span",{className:"truncate font-mono text-sm text-fg",children:t.noteName})]}),e.jsx("span",{className:"shrink-0 text-xs text-fg-dim",children:k(t.at)})]}),t.preview?e.jsx("p",{className:"mt-1 truncate text-sm text-fg-muted",children:t.preview}):null,t.tags&&t.tags.length>0?e.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:t.tags.map(n=>e.jsxs("span",{className:"chip chip-tag max-w-full break-all",children:["#",n]},n))}):null]})},t.id))})]})}function L({kind:a}){return a==="created"?e.jsx("span",{className:"chip chip-tag shrink-0",children:"Created"}):e.jsx("span",{className:"chip shrink-0",children:"Edited"})}function M(){return e.jsx(E,{title:"No activity in the last 30 days.",action:e.jsx(m,{to:"/new",className:"btn btn-primary",children:"New note"})})}function V(){return e.jsx("div",{className:"space-y-3","aria-busy":"true",children:[0,1,2,3,4].map(a=>e.jsx(w,{className:"h-16 rounded-xl"},a))})}function F({error:a,retry:i}){const t=a instanceof A;return e.jsx(D,{title:t?"Session expired":"Could not load activity",message:a.message,action:t?e.jsx(m,{to:"/add",className:"btn btn-primary",children:"Reconnect vault"}):e.jsx("button",{type:"button",onClick:i,className:"btn btn-secondary",children:"Retry"})})}export{O as Activity};
1
+ import{b as f,C as y,D as g,E as j,F as N,r as u,j as e,N as b,G as v,H as D,J as E,L as m,K as w,M as k,V as A}from"./index-DFrgKlHJ.js";const x=1440*60*1e3,S=5e3;function T(a,i=30,t=new Date){const n=t.getTime()-i*x,r=[];for(const s of a){const o=s.path??s.id,d=Date.parse(s.createdAt);if(Number.isFinite(d)&&d>=n&&r.push({id:`${s.id}:created`,noteId:s.id,noteName:o,kind:"created",at:s.createdAt,preview:s.preview,tags:s.tags}),s.updatedAt){const l=Date.parse(s.updatedAt);Number.isFinite(l)&&l>=n&&Number.isFinite(d)&&l-d>S&&r.push({id:`${s.id}:updated`,noteId:s.id,noteName:o,kind:"updated",at:s.updatedAt,preview:s.preview,tags:s.tags})}}return r.sort((s,o)=>Date.parse(o.at)-Date.parse(s.at)),r}const C=["today","yesterday","thisWeek","older"],_={today:"Today",yesterday:"Yesterday",thisWeek:"This week",older:"Older"};function B(a,i=new Date){const t=Date.parse(a);if(!Number.isFinite(t))return null;const n=p(i),r=p(new Date(t)),s=Math.round((n.getTime()-r.getTime())/x);return s<0||s===0?"today":s===1?"yesterday":s<7?"thisWeek":"older"}function p(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate())}function I(a,i=new Date){const t={today:[],yesterday:[],thisWeek:[],older:[]};for(const n of a){const r=B(n.at,i);r&&t[r].push(n)}return t}const h=50;function O(){const a=f(c=>c.getActiveVault()),i=y(g(),-29),t=j({field:"updated_at",from:N(i),limit:v}),[n,r]=u.useState(h),s=u.useMemo(()=>t.data?T(t.data):[],[t.data]),o=u.useMemo(()=>s.slice(0,n),[s,n]),d=u.useMemo(()=>I(o),[o]),l=s.length-o.length;return a?e.jsxs("div",{className:"page-prose",children:[e.jsxs("header",{className:"mb-8",children:[e.jsx("p",{className:"eyebrow mb-1",children:"Activity"}),e.jsx("h1",{className:"page-title",children:"Recent changes"}),e.jsx("p",{className:"mt-2 text-fg-muted",children:"Last 30 days, newest first. Deletions aren't tracked yet."})]}),t.isPending?e.jsx(L,{}):t.isError?e.jsx(V,{error:t.error,retry:()=>t.refetch()}):s.length===0?e.jsx(F,{}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-8",children:C.map(c=>d[c].length>0?e.jsx(M,{title:_[c],events:d[c]},c):null)}),l>0?e.jsx("div",{className:"mt-8 flex justify-center",children:e.jsxs("button",{type:"button",onClick:()=>r(c=>c+h),className:"btn btn-secondary btn-touch",children:["Load more (",l," remaining)"]})}):null]})]}):e.jsx(b,{to:"/",replace:!0})}function M({title:a,events:i}){return e.jsxs("section",{children:[e.jsxs("h2",{className:"eyebrow mb-3",children:[a," (",i.length,")"]}),e.jsx("ol",{className:"card shadow-soft divide-y divide-border rounded-xl",children:i.map(t=>e.jsx("li",{children:e.jsxs(m,{to:`/n/${encodeURIComponent(t.noteId)}`,className:"focus-ring block px-5 py-4 transition-colors hover:bg-bg-soft",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(R,{kind:t.kind}),e.jsx("span",{className:"truncate font-mono text-sm text-fg",children:t.noteName})]}),e.jsx("span",{className:"shrink-0 text-xs text-fg-dim",children:k(t.at)})]}),t.preview?e.jsx("p",{className:"mt-1 truncate text-sm text-fg-muted",children:t.preview}):null,t.tags&&t.tags.length>0?e.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:t.tags.map(n=>e.jsxs("span",{className:"chip chip-tag max-w-full break-all",children:["#",n]},n))}):null]})},t.id))})]})}function R({kind:a}){return a==="created"?e.jsx("span",{className:"chip chip-tag shrink-0",children:"Created"}):e.jsx("span",{className:"chip shrink-0",children:"Edited"})}function F(){return e.jsx(w,{title:"No activity in the last 30 days.",action:e.jsx(m,{to:"/new",className:"btn btn-primary",children:"New note"})})}function L(){return e.jsx("div",{className:"space-y-3","aria-busy":"true",children:[0,1,2,3,4].map(a=>e.jsx(D,{className:"h-16 rounded-xl"},a))})}function V({error:a,retry:i}){const t=a instanceof A;return e.jsx(E,{title:t?"Session expired":"Could not load activity",message:a.message,action:t?e.jsx(m,{to:"/add",className:"btn btn-primary",children:"Reconnect vault"}):e.jsx("button",{type:"button",onClick:i,className:"btn btn-secondary",children:"Retry"})})}export{O as Activity};
@@ -0,0 +1 @@
1
+ import{P as E,Q as I,R as z,r as s,T as V,U as g,W as A,X as F,b as H,Y as W,Z as q,_ as B,j as e,$ as L,a0 as M}from"./index-DFrgKlHJ.js";import{W as O}from"./WizardShell-BBYxknp4.js";import"./history-B0uaXgK5.js";function T(r){const o=r.trim();if(!o)return null;try{return new URL(g(o)).host}catch{return null}}function X(){const[r,o]=E(),p=I(),m=r.get("url")??"",u=r.get("add")??"",f=/^https?:\/\//i.test(u),v=m||(f?u:""),i=z(r.get("redirect")),[a,j]=s.useState(v),[y,x]=s.useState(null),[P,w]=s.useState(!1),[h,N]=s.useState(!1),S=s.useRef(null),U=s.useRef(v.length>0),C=s.useRef(!1),c=V();s.useEffect(()=>{var t;(t=S.current)==null||t.focus()},[]),s.useEffect(()=>{U.current||c.status==="found"&&c.origin&&a===""&&(j(c.origin),U.current=!0)},[c.status,c.origin,a]);const b=s.useCallback(async t=>{x(null),w(!1);let l;try{l=g(t)}catch(n){x(n.message);return}N(!0);try{const{authorizeUrl:n}=await A(l,void 0,void 0,{...i?{redirect:i}:{}});window.location.assign(n)}catch(n){n instanceof F?w(!0):x(n.message),N(!1)}},[i]);s.useEffect(()=>{if(C.current||!u)return;C.current=!0;const t=new URLSearchParams(r);if(t.delete("add"),o(t,{replace:!0}),m||!f)return;let l;try{l=g(u)}catch{return}const R=H.getState().vaults[W(l)];if(R){q(R.id,{toast:!0}),p(B(i??"/"),{replace:!0});return}b(l)},[u,f,m,i,r,o,p,b]);function k(t){t.preventDefault(),b(a)}const d=T(a);return e.jsxs(O,{escape:{kind:"back",to:"/"},children:[e.jsx(L,{size:60,className:"mx-auto mb-6 drop-in"}),e.jsx("p",{className:"eyebrow mb-3",children:"Self-hosted"}),e.jsxs("h1",{className:"hero-title mb-4",children:["Connect your ",e.jsx("span",{className:"accent-word",children:"own"})," vault."]}),e.jsx("p",{className:"mx-auto mb-8 max-w-sm text-lg leading-relaxed text-fg-muted",children:"Point Parachute at a vault running on your own server."}),e.jsxs("form",{onSubmit:k,className:"mx-auto w-full max-w-sm text-left",children:[e.jsx("label",{htmlFor:"vault-url",className:"eyebrow mb-2 block",children:"Vault address"}),e.jsx("input",{id:"vault-url",ref:S,type:"url",required:!0,placeholder:"hub.your-domain.com",value:a,onChange:t=>j(t.target.value),disabled:h,className:"input input-on-bg font-mono"}),e.jsxs("p",{className:"mt-1.5 text-xs text-fg-dim",children:["A local install lives at ",e.jsx("code",{className:"note-id",children:"http://localhost:1939"}),"."]}),P?e.jsx("div",{className:"mt-3",children:e.jsx(M,{})}):null,y?e.jsx("p",{className:"mt-3 rounded-xl border border-danger-border bg-danger-soft px-3 py-2 text-sm text-danger",children:y}):null,d?e.jsxs("div",{className:"mt-5 rounded-2xl border border-sun bg-sun-soft px-4 py-3 text-left font-round text-sm leading-relaxed text-sun-ink",children:["Next, ",e.jsx("b",{className:"font-semibold text-fg",children:d})," — your server, not ours — will ask you to sign in and approve this app. Then you land right back here."]}):null,e.jsx("button",{type:"submit",disabled:h||!a,className:"btn btn-primary btn-lg mt-5 w-full justify-center rounded-full shadow-soft",children:h?"Continuing…":d?`Continue to ${d} →`:"Continue"})]})]})}export{X as AddVault};
@@ -0,0 +1 @@
1
+ import{e as o,a1 as c,b as d,j as e,$ as m}from"./index-DFrgKlHJ.js";import{W as x}from"./WizardShell-BBYxknp4.js";import"./history-B0uaXgK5.js";function f(){const s=o(),a=c(),t=d(l=>l.getActiveVault()),n=null,r=t?"/vaults":"/";return e.jsxs(x,{wide:!0,escape:{kind:"back",to:r},children:[e.jsx(m,{size:56,className:"mx-auto mb-6"}),a?e.jsxs("p",{className:"chip mb-4 inline-flex border-grass/40 bg-grass-soft text-grass-ink",children:[e.jsx("span",{"aria-hidden":"true",children:"✓"})," Signed in as ",a]}):null,e.jsx("p",{className:"eyebrow mb-3",children:"Add a vault"}),e.jsxs("h1",{className:"hero-title mb-8",style:{fontSize:"clamp(1.8rem, 4vw, 2.4rem)"},children:["Bring another ",e.jsx("span",{className:"accent-word",children:"vault"})," in."]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[e.jsx(i,{icon:"📂",verb:"Open",description:"One of your account's vaults not on this device.",onClick:()=>s("/welcome?pick=1")}),e.jsx(i,{icon:"✦",verb:"Create",description:t?e.jsxs(e.Fragment,{children:["Brand-new and empty — separate from"," ",e.jsx("b",{className:"font-semibold text-fg",children:t.name}),"."]}):"Brand-new and empty — its own private space, nothing shared.",foot:n,onClick:()=>s("/add-vault/create")}),e.jsx(i,{icon:"⌂",verb:"Connect",description:"A self-hosted vault on your own server.",onClick:()=>s("/add")})]})]})}function i({icon:s,verb:a,description:t,foot:n,onClick:r}){return e.jsxs("button",{type:"button",onClick:r,"aria-label":a,className:"tile flex flex-col items-center gap-2 p-6 text-center",children:[e.jsx("span",{"aria-hidden":"true",className:"text-xl",children:s}),e.jsx("span",{"aria-hidden":"true",className:"font-round text-base font-bold text-fg",children:a}),e.jsx("span",{className:"font-round text-xs leading-relaxed text-fg-muted",children:t}),n?e.jsx("span",{className:"mt-1 font-round text-xs text-fg-dim",children:n}):null]})}export{f as AddVaultChooser};
@@ -0,0 +1 @@
1
+ import{e as y,P as j,r as u,a2 as v,y as N,j as e,N as w,$ as f,a1 as k,b as S,q as C,w as E,x as A}from"./index-DFrgKlHJ.js";import{W as p}from"./WizardShell-BBYxknp4.js";import"./history-B0uaXgK5.js";const g=["Name","Making it","Ready"];function b(t){return t.toLowerCase().replace(/[^a-z0-9\s-]/g,"")}function R(t){return t.trim().replace(/[\s-]*\s[\s-]*/g,"-")}function O(){const t=y(),[l]=j(),a=l.get("first")==="1",[s,r]=u.useState({kind:"naming"}),i=u.useRef(null);return u.useEffect(()=>{if(s.kind!=="creating"||i.current===s.name)return;i.current=s.name;const{name:o}=s;(async()=>{try{const c=await v(o),n=new URLSearchParams({vault:c});a&&n.set("first","1"),t(`/add-vault/ready?${n.toString()}`,{replace:!0})}catch(c){i.current=null,r({kind:"naming",attemptedName:o,error:N(c,"Couldn't create your vault. Try a different name.")})}})()},[s,t,a]),s.kind==="creating"?e.jsx(p,{escape:{kind:"none"},progress:{labels:g,current:1},children:e.jsx(z,{name:s.name})}):e.jsx(p,{escape:{kind:"back",to:a?"/":"/add-vault"},progress:{labels:g,current:0},children:e.jsx(V,{first:a,initialName:s.attemptedName,error:s.error,onCreate:o=>r({kind:"creating",name:o})})})}function T({email:t}){return t?e.jsxs("p",{className:"chip mb-4 inline-flex border-grass/40 bg-grass-soft text-grass-ink",children:[e.jsx("span",{"aria-hidden":"true",children:"✓"})," Signed in as ",t]}):null}function V({first:t,initialName:l,error:a,onCreate:s}){const[r,i]=u.useState(()=>b(l??"")),o=k(),c=S(m=>{var h;return((h=m.getActiveVault())==null?void 0:h.name)??null}),n=R(r);function d(m){m.preventDefault(),n&&s(n)}return e.jsxs(e.Fragment,{children:[e.jsx(f,{size:60,className:"mx-auto mb-6 drop-in"}),e.jsx(T,{email:o}),e.jsx("p",{className:"eyebrow mb-3",children:t?"Account created ✓":"Adding a vault"}),e.jsxs("h1",{className:"hero-title mb-4",children:[t?"Let's make your first":"Let's make your new"," ",e.jsx("span",{className:"accent-word",children:"vault."})]}),e.jsx("p",{className:"mx-auto mb-8 max-w-md text-lg leading-relaxed text-fg-muted",children:t?e.jsxs(e.Fragment,{children:["A vault is the private home for your notes — any AI you invite can read it, always yours to export. ",e.jsx("b",{className:"font-semibold text-fg",children:"This creates a brand-new, empty one."})]}):e.jsxs(e.Fragment,{children:["This one's separate from"," ",e.jsx("b",{className:"font-semibold text-fg",children:c??"your other vault"})," — its own private space, nothing shared."]})}),e.jsxs("form",{onSubmit:d,children:[e.jsx("input",{autoFocus:!0,value:r,onChange:m=>i(b(m.target.value)),placeholder:"moss",autoComplete:"off",spellCheck:!1,"aria-label":"Vault name",className:"mx-auto mb-2 block w-full max-w-sm border-0 border-b-2 border-border bg-transparent pb-2 text-center font-serif text-3xl text-fg outline-none transition-colors focus:border-accent-light"}),e.jsx("p",{className:"mb-6 min-h-6 font-round text-sm text-fg-muted",children:n?e.jsxs("span",{children:["Your vault:"," ",e.jsx("b",{className:"rounded-md bg-grass-soft px-2 py-0.5 text-grass-ink",children:n})," — you'll find it at ",e.jsx("span",{className:"font-mono text-xs",children:C(n)})]}):null}),e.jsxs("p",{className:"mx-auto mb-8 max-w-sm font-round text-xs text-fg-dim",children:[e.jsx("span",{className:"font-semibold text-fg-muted",children:"The address is permanent"}),", so pick a word you like. Letters, numbers, hyphens."]}),a?e.jsx("p",{className:"mx-auto mb-6 max-w-sm rounded-lg border border-danger-border bg-danger-soft px-3 py-2 text-sm text-danger",children:a}):null,e.jsx("button",{type:"submit",disabled:!n,className:"btn btn-primary btn-lg justify-center rounded-full px-6 shadow-soft",children:n?`Create ${n} →`:"Create →"})]})]})}const x=["Setting up your vault…","Preparing your keys…","Almost there…"];function P(){const[t,l]=u.useState(0);return u.useEffect(()=>{if(t>=x.length-1)return;const a=setTimeout(()=>l(s=>Math.min(s+1,x.length-1)),650);return()=>clearTimeout(a)},[t]),e.jsx("output",{"aria-live":"polite",className:"font-round text-sm text-fg-muted",children:x[t]})}function z({name:t}){return e.jsxs(e.Fragment,{children:[e.jsx(f,{size:96,className:"mx-auto mb-6 animate-pulse"}),e.jsxs("h1",{className:"hero-title mb-3",style:{fontSize:"clamp(1.6rem, 3.5vw, 1.9rem)"},children:["Making a place for ",e.jsxs("span",{className:"accent-word",children:[t,"…"]})]}),e.jsx(P,{})]})}function M(){const t=y(),[l]=j(),a=l.get("vault")??"",s=l.get("first")==="1",[r,i]=u.useState(!1),[o,c]=u.useState(null);if(!a)return e.jsx(w,{to:"/add-vault",replace:!0});async function n(){if(!r){i(!0),c(null);try{await E(a),A(a),t("/")}catch(d){i(!1),c(N(d,"Couldn't open your vault. Try again."))}}}return e.jsxs(p,{escape:s?{kind:"none"}:{kind:"maybe-later",to:"/"},progress:{labels:g,current:2},children:[e.jsx(f,{size:90,className:"mx-auto mb-6 fade-up"}),e.jsx("p",{className:"eyebrow mb-3",children:"Ready"}),e.jsxs("h1",{className:"hero-title mb-3",style:{fontSize:"clamp(1.8rem, 4vw, 2.3rem)"},children:[a," is ",e.jsx("span",{className:"accent-word",children:"ready."})]}),e.jsx("p",{className:"mx-auto mb-8 max-w-sm text-fg-muted",children:"Everything inside is yours. Open format. Export anytime."}),o?e.jsx("p",{className:"mx-auto mb-6 max-w-sm rounded-lg border border-danger-border bg-danger-soft px-3 py-2 text-sm text-danger",children:o}):null,e.jsx("button",{type:"button",onClick:n,disabled:r,className:"btn btn-primary btn-lg justify-center rounded-full px-6 shadow-soft",children:r?"Opening…":`Open ${a} →`})]})}export{O as AddVaultCreate,M as AddVaultReady};
@@ -0,0 +1 @@
1
+ import{r,j as c}from"./index-DFrgKlHJ.js";function v({onDropFiles:t,children:s,className:a,hint:o}){const[i,f]=r.useState(!1),n=r.useRef(0),d=r.useCallback(e=>{l(e.dataTransfer)&&(e.preventDefault(),n.current+=1,f(!0))},[]),p=r.useCallback(e=>{l(e.dataTransfer)&&(e.preventDefault(),n.current=Math.max(0,n.current-1),n.current===0&&f(!1))},[]),m=r.useCallback(e=>{l(e.dataTransfer)&&(e.preventDefault(),e.dataTransfer.dropEffect="copy")},[]),x=r.useCallback(e=>{if(!l(e.dataTransfer))return;e.preventDefault(),f(!1),n.current=0;const u=Array.from(e.dataTransfer.files);u.length>0&&t(u)},[t]);return c.jsxs("div",{className:`relative ${a??""}`,onDragEnter:d,onDragLeave:p,onDragOver:m,onDrop:x,children:[s,i?c.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-20 flex items-center justify-center rounded-md border-2 border-dashed border-accent bg-accent/10 text-sm text-accent",children:c.jsxs("div",{className:"rounded-md bg-bg/80 px-4 py-2 font-medium shadow",children:["Drop to attach",o?c.jsxs("span",{className:"ml-2 text-fg-dim",children:["— ",o]}):null]})}):null]})}function l(t){if(!t)return!1;const s=t.types;for(let a=0;a<s.length;a++)if(s[a]==="Files")return!0;return!1}export{v as A};
@@ -0,0 +1 @@
1
+ import{b as S,P as k,a3 as j,a4 as N,D as A,r as u,a5 as K,E as T,a6 as _,j as e,N as P,a7 as v,a8 as m,a9 as V,L as c,G as C,V as I}from"./index-DFrgKlHJ.js";const R=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],g=5;function O(){const s=S(t=>t.getActiveVault()),[d]=k(),n=d.get("month"),r=j(n)??j(N()),x=A(),l=u.useMemo(()=>K(r.year,r.month),[r.year,r.month]),$=u.useMemo(()=>{const t=l[0],a=l[l.length-1];return{from:t.toISOString(),to:new Date(a.getFullYear(),a.getMonth(),a.getDate()+1).toISOString()}},[l]),o=T({field:"created_at",...$,limit:C}),M=u.useMemo(()=>{const t=new Map;if(!o.data)return t;for(const a of o.data){const i=_(a.createdAt);i&&t.set(i,(t.get(i)??0)+1)}return t},[o.data]);if(!s)return e.jsx(P,{to:"/",replace:!0});const b=v(r.year,r.month,-1),p=v(r.year,r.month,1),y=`${b.year}-${m(b.month)}`,f=`${p.year}-${m(p.month)}`,D=N(),E=`${r.year}-${m(r.month)}`===D;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=${y}`,className:"rounded-lg border border-border bg-card px-3 py-1.5 text-fg-muted hover:text-accent","aria-label":"Previous month",children:["← ",y]}),E?null:e.jsx(c,{to:"/calendar",className:"rounded-lg 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=${f}`,className:"rounded-lg border border-border bg-card px-3 py-1.5 text-fg-muted hover:text-accent","aria-label":"Next month",children:[f," →"]}),e.jsx(c,{to:`/today?date=${x}`,className:"rounded-lg border border-border bg-card px-3 py-1.5 text-fg-muted hover:text-accent",children:"Today"})]})]}),o.isError?e.jsx(F,{error:o.error,retry:()=>o.refetch()}):e.jsxs("div",{className:"rounded-md border border-border bg-card","aria-busy":o.isPending,children:[e.jsx("div",{className:"grid grid-cols-7 border-b border-border text-xs uppercase tracking-wider text-fg-dim",children:R.map(t=>e.jsx("div",{className:"px-2 py-2 text-center",children:t},t))}),e.jsx("div",{className:"grid grid-cols-7",children:l.map(t=>{const a=`${t.getFullYear()}-${m(t.getMonth()+1)}-${m(t.getDate())}`,i=t.getMonth()+1===r.month,h=M.get(a)??0,w=a===x;return e.jsxs(c,{to:`/today?date=${a}`,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 ${i?"":"opacity-40"}`,"aria-label":`${a} — ${h} notes`,children:[e.jsx("span",{className:`mb-1 inline-flex h-6 w-6 items-center justify-center rounded-full tabular-nums ${w?"bg-accent text-(--color-on-accent)":"text-fg"}`,children:t.getDate()}),h>0?e.jsx(Y,{count:h}):e.jsx("span",{className:"sr-only",children:"no notes"})]},a)})})]}),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 Y({count:s}){const d=Math.min(s,g),n=s>g?s-g:0;return e.jsxs("span",{className:"flex flex-wrap items-center gap-0.5",children:[Array.from({length:d}).map((r,x)=>e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-accent","aria-hidden":"true"},x)),n>0?e.jsxs("span",{className:"ml-0.5 text-[10px] text-fg-dim",children:["+",n]}):null]})}function F({error:s,retry:d}){const n=s instanceof I;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:n?"Session expired":"Could not load notes"}),e.jsx("p",{className:"mb-4 text-sm text-fg-muted",children:s.message}),n?e.jsx(c,{to:"/add",className:"inline-block rounded-lg bg-accent px-4 py-2 text-sm font-medium text-(--color-on-accent) hover:bg-accent-hover",children:"Reconnect vault"}):e.jsx("button",{type:"button",onClick:d,className:"btn btn-secondary",children:"Retry"})]})}export{O as Calendar};
@@ -0,0 +1 @@
1
+ import{e as R,P as I,bd as v,r as s,a1 as L,j as e,N as M,$ as O,g as h,c4 as P,c5 as T,c6 as W}from"./index-DFrgKlHJ.js";import{W as _}from"./WizardShell-BBYxknp4.js";import"./history-B0uaXgK5.js";const z="/welcome",D=3e3,j="That code didn't work — check it and try again.";function G(){const o=R(),[g]=I(),c=v(z,g.get("redirect")),[n,w]=s.useState(()=>L()??""),[r,i]=s.useState("idle"),[p,C]=s.useState(""),[S,d]=s.useState(""),[l,u]=s.useState(null),[b,y]=s.useState(!1),m=s.useRef(!1),x=s.useRef(!1);if(s.useEffect(()=>{let t=!1;const f=setInterval(async()=>{try{const N=await h();!t&&N.signed_in&&o(c,{replace:!0})}catch{}},D);return()=>{t=!0,clearInterval(f)}},[o,c]),!n)return e.jsx(M,{to:v("/",g.get("redirect")),replace:!0});async function k(t=n){if(!m.current){m.current=!0;try{const a=await h();await P(t,a.csrf,c),t!==n&&(T(t),w(t)),i("resent")}catch{i("idle")}finally{m.current=!1}}}async function E(t){const a=t.replace(/\D/g,"").slice(0,6);if(d(a),u(null),!(a.length<6||x.current)){x.current=!0,y(!0);try{const f=await h();if(await W(n,a,f.csrf)){o(c,{replace:!0});return}u(j),d("")}catch{u(j),d("")}finally{x.current=!1,y(!1)}}}return e.jsxs(_,{escape:{kind:"back",to:"/",label:"← Back to sign in"},children:[e.jsx(O,{size:56,className:"mx-auto mb-6"}),e.jsx("p",{className:"eyebrow mb-3",children:"Check your email"}),e.jsxs("h1",{className:"hero-title mb-3",style:{fontSize:"clamp(1.6rem, 3.5vw, 2.1rem)"},children:["We sent a sign-in link to ",e.jsx("span",{className:"accent-word",children:n})]}),e.jsx("p",{className:"text-fg-muted",children:"Works once, expires in 10 min."}),e.jsx("p",{className:"mx-auto mt-3 mb-6 max-w-sm font-round text-sm text-fg-muted",children:"New here? That same link creates your account — the email says which."}),e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[e.jsx("button",{type:"button",onClick:()=>k(),className:"btn btn-secondary btn-touch rounded-full",children:"Resend the link"}),e.jsx("button",{type:"button",onClick:()=>i(r==="code"?"idle":"code"),className:"font-round text-sm font-semibold text-link hover:underline",style:{color:"var(--color-sky)"},children:r==="code"?"Hide the code field":"Or type the code from the email"}),e.jsx("button",{type:"button",onClick:()=>i("changeemail"),className:"font-round text-sm font-semibold text-link hover:underline",style:{color:"var(--color-sky)"},children:"Use a different email"})]}),r==="resent"?e.jsx("p",{className:"mx-auto mt-4 max-w-sm rounded-xl border border-grass bg-grass-soft px-4 py-3 text-sm text-grass-ink",children:"✓ Sent again — check your inbox."}):null,r==="code"?e.jsxs("div",{className:"mx-auto mt-4 max-w-xs",children:[e.jsx("label",{htmlFor:"signin-code",className:"mb-2 block font-round text-sm text-fg-muted",children:"6-digit code"}),e.jsx("input",{id:"signin-code",value:S,onChange:t=>{E(t.target.value)},inputMode:"numeric",autoComplete:"one-time-code",pattern:"[0-9]*",placeholder:"123456",disabled:b,"aria-invalid":l?!0:void 0,"aria-describedby":l?"signin-code-error":void 0,autoFocus:!0,className:"input w-full text-center text-2xl tracking-[0.4em]"}),e.jsx("output",{"aria-live":"polite",className:"mt-2 block text-center text-xs text-fg-dim",children:b?"Checking…":" "}),l?e.jsx("p",{id:"signin-code-error",role:"alert",className:"rounded-lg border border-danger-border bg-danger-soft px-3 py-2 text-center text-sm text-danger",children:l}):null]}):null,r==="changeemail"?e.jsxs("div",{className:"mx-auto mt-4 max-w-sm",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:p,onChange:t=>C(t.target.value),placeholder:"you@example.com","aria-label":"Email address",type:"email",className:"input"}),e.jsx("button",{type:"button",onClick:()=>{const t=p.trim();/.+@.+\..+/.test(t)&&k(t)},className:"btn btn-primary btn-touch shrink-0 rounded-full",children:"Send link"})]}),e.jsx("button",{type:"button",onClick:()=>i("idle"),className:"mt-2 font-round text-sm text-fg-dim hover:text-accent",children:"Cancel"})]}):null]})}export{G as CheckEmail};