ocean-brain 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mcp.js +660 -31
- package/package.json +2 -1
- package/server/client/dist/assets/{Calendar-BU9XgX2N.js → Calendar-BytW4PeT.js} +1 -1
- package/server/client/dist/assets/{Callout-C6tVCxOT.js → Callout-9sJgGNRb.js} +1 -1
- package/server/client/dist/assets/Graph-o5u-NzrA.js +1 -0
- package/server/client/dist/assets/{Image.es-BjGK7y6Y.js → Image.es-B0LL3pb7.js} +1 -1
- package/server/client/dist/assets/Note-CYoYzZNu.js +21 -0
- package/server/client/dist/assets/{Plus.es-EcmtS_uw.js → Plus.es-DpxzgRtY.js} +1 -1
- package/server/client/dist/assets/Reminders-DAepTZg1.js +1 -0
- package/server/client/dist/assets/Search-6KH7An44.js +1 -0
- package/server/client/dist/assets/{SurfaceCard-CO0oVxeL.js → SurfaceCard-EMs50xSF.js} +1 -1
- package/server/client/dist/assets/Tag-C89j8x56.js +1 -0
- package/server/client/dist/assets/TagNotes-BTbu-f6v.js +1 -0
- package/server/client/dist/assets/{Trash.es-DmwfSy3l.js → Trash.es-C5x35NKF.js} +1 -1
- package/server/client/dist/assets/ViewNotes-DPEuki3y.js +1 -0
- package/server/client/dist/assets/Views-BGkuNhVd.js +1 -0
- package/server/client/dist/assets/{image.api-DeF9ck7g.js → image.api-DRhRQ0Gf.js} +1 -1
- package/server/client/dist/assets/{index-BZUGWdOU.css → index-Cd81UxEh.css} +1 -1
- package/server/client/dist/assets/{index-BvKBTjQq.js → index-DYlYUrjH.js} +118 -37
- package/server/client/dist/assets/index-DswSFFMb.js +1 -0
- package/server/client/dist/assets/manage-image-C6sHhWnI.js +1 -0
- package/server/client/dist/assets/manage-image-detail-CJkfybR9.js +1 -0
- package/server/client/dist/assets/{mcp-Bh743HBz.js → mcp-piouFDNm.js} +1 -1
- package/server/client/dist/assets/{placeholder-XQqo1Fvr.js → placeholder-DGz3CHej.js} +5 -5
- package/server/client/dist/assets/properties-CM4khczg.js +1 -0
- package/server/client/dist/assets/trash-C2lItz-b.js +1 -0
- package/server/client/dist/assets/{useReminderMutate-D21PurIS.js → useReminderMutate-DHjDDHKg.js} +1 -1
- package/server/client/dist/assets/view-dashboard-C17WsdL7.js +99 -0
- package/server/client/dist/index.html +2 -2
- package/server/dist/features/note/graphql/note.field.resolver.js +2 -0
- package/server/dist/features/note/graphql/note.field.resolver.js.map +1 -1
- package/server/dist/features/note/graphql/note.mutation.resolver.js +119 -0
- package/server/dist/features/note/graphql/note.mutation.resolver.js.map +1 -1
- package/server/dist/features/note/graphql/note.query.resolver.js +14 -0
- package/server/dist/features/note/graphql/note.query.resolver.js.map +1 -1
- package/server/dist/features/note/graphql/note.type-defs.js +100 -0
- package/server/dist/features/note/graphql/note.type-defs.js.map +1 -1
- package/server/dist/features/note/http/mcp.js +394 -1
- package/server/dist/features/note/http/mcp.js.map +1 -1
- package/server/dist/features/note/services/markdown-intent-write.js +478 -0
- package/server/dist/features/note/services/markdown-intent-write.js.map +1 -0
- package/server/dist/features/note/services/markdown-patch.js +601 -0
- package/server/dist/features/note/services/markdown-patch.js.map +1 -0
- package/server/dist/features/note/services/properties.js +874 -0
- package/server/dist/features/note/services/properties.js.map +1 -0
- package/server/dist/features/note/services/snapshot.js +94 -12
- package/server/dist/features/note/services/snapshot.js.map +1 -1
- package/server/dist/features/note/services/trash.js +70 -2
- package/server/dist/features/note/services/trash.js.map +1 -1
- package/server/dist/features/note/services/write.js +21 -7
- package/server/dist/features/note/services/write.js.map +1 -1
- package/server/dist/features/view/graphql/view.query.resolver.js +31 -1
- package/server/dist/features/view/graphql/view.query.resolver.js.map +1 -1
- package/server/dist/features/view/graphql/view.type-defs.js +57 -1
- package/server/dist/features/view/graphql/view.type-defs.js.map +1 -1
- package/server/dist/features/view/services/workspace.js +367 -43
- package/server/dist/features/view/services/workspace.js.map +1 -1
- package/server/dist/modules/blocknote.js +47 -2
- package/server/dist/modules/blocknote.js.map +1 -1
- package/server/dist/routes/mcp.js +21 -1
- package/server/dist/routes/mcp.js.map +1 -1
- package/server/prisma/migrations/20260527073000_0017_note_properties/migration.sql +105 -0
- package/server/prisma/migrations/20260531073000_0018_view_query/migration.sql +3 -0
- package/server/prisma/schema.prisma +226 -130
- package/server/client/dist/assets/Graph-Dond2hGK.js +0 -1
- package/server/client/dist/assets/Note-Cr6GtXUM.js +0 -21
- package/server/client/dist/assets/Reminders-BlLLT_x0.js +0 -1
- package/server/client/dist/assets/Search-CrZ0ap8x.js +0 -1
- package/server/client/dist/assets/Tag-vws5AfNW.js +0 -1
- package/server/client/dist/assets/TagNotes-Fmf1Kgim.js +0 -1
- package/server/client/dist/assets/ViewNotes-BALN7IfH.js +0 -1
- package/server/client/dist/assets/Views-Ccc_Ml5U.js +0 -1
- package/server/client/dist/assets/index-BSVE2cGd.js +0 -1
- package/server/client/dist/assets/manage-image-IoTXaMBP.js +0 -1
- package/server/client/dist/assets/manage-image-detail-BRTXwOsh.js +0 -1
- package/server/client/dist/assets/trash-hiJIg6-c.js +0 -1
- package/server/client/dist/assets/view-dashboard-BuaZ4MvI.js +0 -90
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./note-vendor-i1M2FSI2.js";import{P as m,F as f,$ as N,a8 as b,T as h,L as w,N as S,a0 as k,j as E,a9 as $,i as d}from"./index-BvKBTjQq.js";import{a as R}from"./graph-vendor-CUxe67Lr.js";import"./note-core-Z6kqulGB.js";const L=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),g=({children:t,match:s})=>{const r=s.trim();if(!r)return e.jsx("span",{children:t});const a=L(r),n=new RegExp(`(${a})`,"gi"),c=new RegExp(`^${a}$`,"i"),l=t.split(n);return e.jsx("span",{children:l.map((i,o)=>c.test(i)?e.jsx("mark",{children:i},o):e.jsx(R.Fragment,{children:i},o))})},j=E($),v=180,x=t=>t.replace(/\s+/g," ").trim(),T=(t,s)=>{const r=x(t),a=x(s).toLowerCase();if(!a)return r;const n=r.toLowerCase().indexOf(a);if(n===-1)return r.length>v?`${r.slice(0,v-1).trimEnd()}…`:r;const c=Math.max(0,n-56),l=Math.min(r.length,n+a.length+84);let i=r.slice(c,l).trim();return c>0&&(i=`…${i}`),l<r.length&&(i=`${i}…`),i},A=t=>Array.isArray(t)?t.map(s=>{if(!s||typeof s!="object")return"";const r=s.text;return typeof r=="string"?r:""}).join(""):"",B=(t,s)=>t==="heading"?`Heading ${typeof s?.level=="number"?s.level:1}`:t==="bulletListItem"?"Bullet":t==="numberedListItem"?"Numbered":t==="checkListItem"?"Checklist":t==="quote"?"Quote":t==="codeBlock"?"Code":"Content",y=(t,s)=>{Array.isArray(t)&&t.forEach(r=>{if(!r||typeof r!="object")return;const a=typeof r.type=="string"?r.type:void 0,n=typeof r.props=="object"&&r.props?r.props:void 0,c=x(A(r.content));c&&s.push({label:B(a,n),text:c});const l=r.children;Array.isArray(l)&&y(l,s)})},C=(t,s)=>{try{const r=JSON.parse(t),a=[];if(y(r,a),a.length===0)return[];const n=x(s).toLowerCase(),c=n?a.filter(i=>i.text.toLowerCase().includes(n)):a;return(c.length>0?c:a).slice(0,2).map(i=>({...i,text:T(i.text,s)}))}catch{return[]}},P=t=>t===1?"1 result":`${t} results`,M=()=>"Open the note to inspect matching content.",z=(t,s)=>`${P(s)} for "${t}"`,I=()=>e.jsx(m,{title:"Search",variant:"default",description:e.jsx(d,{width:208,height:16,className:"rounded-full"}),children:e.jsx("main",{className:"flex flex-col gap-3",children:Array.from({length:2},(t,s)=>e.jsxs("div",{className:"surface-base flex flex-col gap-3 p-4",children:[e.jsx(d,{width:"34%",height:18,className:"rounded-full"}),e.jsx("div",{className:"rounded-[14px] bg-muted px-3 py-3",children:e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx(d,{width:84,height:12,className:"rounded-full"}),e.jsx(d,{width:"100%",height:14,className:"mt-2 rounded-full"}),e.jsx(d,{width:"82%",height:14,className:"mt-1.5 rounded-full"})]}),e.jsxs("div",{className:"border-t border-border-subtle pt-2",children:[e.jsx(d,{width:72,height:12,className:"rounded-full"}),e.jsx(d,{width:"94%",height:14,className:"mt-2 rounded-full"})]})]})})]},s))})});function F(){const t=j.useNavigate(),{page:s,query:r}=j.useSearch(),a=r.trim(),n=10;return a?e.jsx(N,{fallback:e.jsx(I,{}),errorTitle:"Failed to load search results",errorDescription:`Retry loading results for "${a}".`,resetKeys:[a,s],children:e.jsx(b,{searchParams:{query:a,limit:n,offset:(s-1)*n,fields:["content"]},render:({notes:c,totalCount:l})=>e.jsx(m,{title:"Search",description:z(a,l),variant:"default",children:e.jsxs("main",{className:"flex flex-col gap-4",children:[c.length>0?e.jsx("div",{className:"flex flex-col gap-3",children:c.map(i=>{const o=C(i.content,a);return e.jsxs("article",{className:"surface-base flex flex-col gap-3 p-4",children:[e.jsx(h,{as:"h2",variant:"body",weight:"semibold",tracking:"tight",children:e.jsx(w,{to:S,params:{id:i.id},className:"transition-colors hover:text-fg-default/85",children:e.jsx(g,{match:a,children:i.title||"Untitled"})})}),o.length>0?e.jsx("div",{className:"rounded-[14px] bg-muted px-3 py-3",children:e.jsx("div",{className:"flex flex-col gap-2",children:o.map((u,p)=>e.jsxs("div",{className:p>0?"border-t border-border-subtle pt-2":void 0,children:[e.jsx(h,{as:"div",variant:"micro",weight:"semibold",tracking:"wider",transform:"uppercase",tone:"tertiary",children:u.label}),e.jsx(h,{as:"p",variant:"meta",tone:"secondary",className:"mt-1 leading-[1.65]",children:e.jsx(g,{match:a,children:u.text})})]},`${i.id}:${u.label}:${p}`))})}):e.jsx(h,{as:"p",variant:"meta",tone:"secondary",className:"leading-[1.65]",children:M()})]},i.id)})}):e.jsx(f,{title:"No results found",description:"Try searching for a different word or phrase"}),l>n&&e.jsx(k,{page:s,last:Math.ceil(l/n),onChange:i=>{t({search:o=>({...o,page:i})})}})]})})})}):e.jsx(m,{title:"Search",description:"Search note titles and matching sections across your workspace",variant:"default",children:e.jsx("main",{children:e.jsx(f,{title:"Start searching",description:"Enter a keyword to look through note titles and matching content"})})})}export{F as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./note-vendor-i1M2FSI2.js";import{a5 as p,x as m,q as u,aa as f,$ as j,P as h,ab as o,L as y,ac as T,T as c,a0 as w,F as b,i as a,j as v,ad as N}from"./index-BvKBTjQq.js";import"./graph-vendor-CUxe67Lr.js";import"./note-core-Z6kqulGB.js";const R=s=>{const{data:t}=p({queryKey:u.tags.list(s.searchParams),async queryFn(){const i=await m({offset:s.searchParams.offset,limit:s.searchParams.limit});if(i.type==="error")throw i;return i.allTags}});return s.render(t)},A=100,P=8,G=12,x=v(N);function q(){const s=x.useNavigate(),{page:t}=x.useSearch(),{containerRef:i,limit:n}=f({minItemWidth:A,gap:P,rows:G});return e.jsx("div",{ref:i,children:e.jsx(j,{fallback:e.jsx(h,{title:"Tags",heading:e.jsx(a,{width:120,height:24,className:"rounded-full"}),description:e.jsx(a,{width:188,height:16,className:"rounded-full"}),children:e.jsxs("div",{className:"flex flex-wrap gap-2.5",children:[e.jsx(a,{width:"90px",height:"36px"}),e.jsx(a,{width:"120px",height:"36px"}),e.jsx(a,{width:"80px",height:"36px"}),e.jsx(a,{width:"100px",height:"36px"}),e.jsx(a,{width:"110px",height:"36px"}),e.jsx(a,{width:"70px",height:"36px"})]})}),errorTitle:"Failed to load tags",errorDescription:"Retry loading the tag catalog",resetKeys:[t,n],children:e.jsx(R,{searchParams:{offset:(t-1)*n,limit:n},render:({tags:l,totalCount:d})=>e.jsx(h,{title:"Tags",heading:d>0?`Tags (${d})`:void 0,description:"Browse the tags you added with @ across your notes",children:e.jsx(o,{fallback:e.jsx(b,{title:"No tags yet",description:"Add @tags inside notes and they will appear here"}),children:l.length>0&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"flex flex-wrap gap-2.5",children:l.map(r=>e.jsxs(y,{to:T,params:{id:r.id},search:{page:1},className:"inline-flex items-center gap-1.5 rounded-full border border-border-subtle bg-hover-subtle px-3 py-1.5 text-fg-secondary transition-colors hover:border-border-secondary hover:bg-hover hover:text-fg-default",children:[e.jsx(c,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:r.name}),e.jsx(c,{as:"span",variant:"label",weight:"medium",tone:"tertiary",className:"text-current/70",children:r.referenceCount})]},r.id))}),e.jsx(o,{fallback:null,children:d&&n<d&&e.jsx(w,{page:t,last:Math.ceil(d/n),onChange:r=>{s({search:g=>({...g,page:r})})}})})]})})})})})})}export{q as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./note-vendor-i1M2FSI2.js";import{a5 as j,aA as p,q as y,au as N,$ as P,P as c,ab as h,aB as T,a0 as v,F as q,i as d,j as w,ac as b}from"./index-BvKBTjQq.js";import"./graph-vendor-CUxe67Lr.js";import"./note-core-Z6kqulGB.js";const k=s=>{const{data:r}=j({queryKey:y.notes.tagList(s.searchParams),async queryFn(){const t=await p({query:s.searchParams.query,offset:s.searchParams.offset,limit:s.searchParams.limit});if(t.type==="error")throw t;return t.tagNotes}});return s.render(r)},g=w(b);function S(){const s=g.useNavigate(),{id:r}=g.useParams(),{page:t}=g.useSearch(),i=25,{onDelete:u,onPinned:m,deleteWarningDialog:x}=N();return e.jsxs(P,{fallback:e.jsx(c,{title:"Tagged Notes",heading:e.jsx(d,{width:148,height:24,className:"rounded-full"}),description:e.jsx(d,{width:196,height:16,className:"rounded-full"}),variant:"default",children:e.jsxs("div",{className:"grid-auto-cards grid gap-5",children:[e.jsx(d,{height:"112px"}),e.jsx(d,{height:"112px"}),e.jsx(d,{height:"112px"})]})}),errorTitle:"Failed to load tagged notes",errorDescription:"Retry loading notes for this tag",resetKeys:[r,t,i],children:[e.jsx(k,{searchParams:{query:r,offset:(t-1)*i,limit:i},render:({notes:o,totalCount:n})=>{const l=o.flatMap(a=>a.tags).find(a=>a.id===r)?.name;return e.jsx(c,{title:l??"Tagged Notes",heading:l?n>0?`${l} (${n})`:l:"Tagged Notes",description:"Browse every note linked to this tag",variant:"default",children:e.jsx(h,{fallback:e.jsx(q,{title:"No tagged notes yet",description:"Notes tagged with this label will appear here"}),children:o.length>0&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"grid-auto-cards grid gap-5",children:o.map(a=>e.jsx(T,{...a,onPinned:()=>m(a.id,a.pinned),onDelete:()=>u(a.id)},a.id))}),e.jsx(h,{fallback:null,children:n&&i<n&&e.jsx(v,{page:t,last:Math.ceil(n/i),onChange:a=>{s({search:f=>({...f,page:a})})}})})]})})})}}),x]})}export{S as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./note-vendor-i1M2FSI2.js";import{P as d,F as x,$ as N,i as n,j as v,V as b,au as V,u as S,q as h,a5 as q,ab as p,aB as C,a0 as R,T as k}from"./index-BvKBTjQq.js";import{q as T,f as D,a as E}from"./view-dashboard-BuaZ4MvI.js";import"./graph-vendor-CUxe67Lr.js";import"./note-core-Z6kqulGB.js";const u=v(b);function F(){const o=u.useNavigate(),{page:i,sectionId:r}=u.useSearch(),{onDelete:g,onPinned:f,deleteWarningDialog:m}=V(),a=25,{data:c}=S({queryKey:h.views.section(r),async queryFn(){const t=await T(r);if(t.type==="error")throw t;return t.viewSection}}),{data:s}=q({queryKey:h.views.sectionNotes(r,{limit:a,offset:(i-1)*a}),async queryFn(){const t=await D(r,{limit:a,offset:(i-1)*a});if(t.type==="error")throw t;return t.viewSectionNotes}}),l=c?.title||"View Notes",j=c?.tagNames??[],w=c?.mode??"and";return e.jsxs(d,{title:l,heading:s.totalCount>0?`${l} (${s.totalCount})`:l,description:e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(k,{as:"span",variant:"meta",tone:"tertiary",children:E(w)}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:j.map(t=>e.jsx("span",{className:"inline-flex items-center rounded-full border border-border-subtle bg-hover-subtle px-2.5 py-1 text-xs font-medium text-fg-secondary",children:t},t))})]}),children:[e.jsx(p,{fallback:e.jsx(x,{title:"No notes match this saved view",description:"Adjust the section tags or keep writing until matching notes appear."}),children:s.notes.length>0&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"grid-auto-cards grid gap-5",children:s.notes.map(t=>e.jsx(C,{...t,onPinned:()=>f(t.id,t.pinned),onDelete:()=>g(t.id)},t.id))}),e.jsx(p,{fallback:null,children:s.totalCount&&a<s.totalCount&&e.jsx(R,{page:i,last:Math.ceil(s.totalCount/a),onChange:t=>{o({search:y=>({...y,page:t})})}})})]})}),m]})}function Q(){const{sectionId:o,page:i}=u.useSearch();return o?e.jsx(N,{fallback:e.jsx(d,{title:"View Notes",heading:e.jsx(n,{width:180,height:24,className:"rounded-full"}),description:e.jsx(n,{width:220,height:16,className:"rounded-full"}),children:e.jsxs("div",{className:"grid-auto-cards grid gap-5",children:[e.jsx(n,{height:"112px"}),e.jsx(n,{height:"112px"}),e.jsx(n,{height:"112px"})]})}),errorTitle:"Failed to load view notes",errorDescription:"Retry loading notes for this saved view section",resetKeys:[i,o],children:e.jsx(F,{})}):e.jsx(d,{title:"View Notes",description:"Saved view note lists require a section id.",children:e.jsx(x,{title:"No section selected",description:"Return to Views and open a section from there."})})}export{Q as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./note-vendor-i1M2FSI2.js";import{p as ue,u as O,q as N,T as u,L as H,V as P,D as te,k as se,B as w,N as pe,t as ge,M as S,l as D,I as ae,S as fe,e as F,m as be,n as ve,o as _,r as re,v as je,w as we,x as ye,y as Ne,z as K,A as Se,K as ke,E as Te,P as Ce,i as I,F as Z,G as Q,H as Ve,J as $,O as U,Q as Ee,R as De,U as Ae,W as ze,X as ie,Y as ne,c as R,Z as oe}from"./index-BvKBTjQq.js";import{a as r}from"./graph-vendor-CUxe67Lr.js";import{b as Me,f as Fe,g as Le,n as B,a as G,c as Re,d as We,E as He,s as Ie,e as qe,r as Oe,h as Pe,i as _e,j as Ke,k as Ze,u as Qe,l as $e,m as Ue,o as Be,p as Ge}from"./view-dashboard-BuaZ4MvI.js";import{S as A}from"./SurfaceCard-CO0oVxeL.js";import{n as q}from"./Plus.es-EcmtS_uw.js";import"./note-core-Z6kqulGB.js";const Ye=new Map([["bold",r.createElement(r.Fragment,null,r.createElement("path",{d:"M224.49,136.49l-72,72a12,12,0,0,1-17-17L187,140H40a12,12,0,0,1,0-24H187L135.51,64.48a12,12,0,0,1,17-17l72,72A12,12,0,0,1,224.49,136.49Z"}))],["duotone",r.createElement(r.Fragment,null,r.createElement("path",{d:"M216,128l-72,72V56Z",opacity:"0.2"}),r.createElement("path",{d:"M221.66,122.34l-72-72A8,8,0,0,0,136,56v64H40a8,8,0,0,0,0,16h96v64a8,8,0,0,0,13.66,5.66l72-72A8,8,0,0,0,221.66,122.34ZM152,180.69V75.31L204.69,128Z"}))],["fill",r.createElement(r.Fragment,null,r.createElement("path",{d:"M221.66,133.66l-72,72A8,8,0,0,1,136,200V136H40a8,8,0,0,1,0-16h96V56a8,8,0,0,1,13.66-5.66l72,72A8,8,0,0,1,221.66,133.66Z"}))],["light",r.createElement(r.Fragment,null,r.createElement("path",{d:"M220.24,132.24l-72,72a6,6,0,0,1-8.48-8.48L201.51,134H40a6,6,0,0,1,0-12H201.51L139.76,60.24a6,6,0,0,1,8.48-8.48l72,72A6,6,0,0,1,220.24,132.24Z"}))],["regular",r.createElement(r.Fragment,null,r.createElement("path",{d:"M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z"}))],["thin",r.createElement(r.Fragment,null,r.createElement("path",{d:"M218.83,130.83l-72,72a4,4,0,0,1-5.66-5.66L206.34,132H40a4,4,0,0,1,0-8H206.34L141.17,58.83a4,4,0,0,1,5.66-5.66l72,72A4,4,0,0,1,218.83,130.83Z"}))]]),le=r.forwardRef((s,i)=>r.createElement(ue,{ref:i,...s,weights:Ye}));le.displayName="ArrowRightIcon";const Je=le,Xe="flex items-start justify-between gap-3 rounded-[14px] border border-border-subtle/70 px-3 py-2.5 transition-colors hover:border-border-secondary hover:bg-hover-subtle";function et({section:s,onEdit:i,onDelete:n,dragHandle:c}){const x=Me(s),{data:l,isPending:m,isError:h,refetch:b}=O({queryKey:N.views.sectionNotes(s.id,{limit:s.limit,offset:0}),async queryFn(){const a=await Fe(s.id,{limit:s.limit,offset:0});if(a.type==="error")throw a;return a.viewSectionNotes}}),p=l?.notes??[],k=l?.totalCount??0,g=Le(s.mode);return e.jsxs(A,{className:"flex h-full flex-col gap-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[c&&e.jsx("div",{className:"-mr-1 shrink-0 self-center",children:c}),e.jsx("div",{className:"min-w-0",children:e.jsx(u,{as:"h2",variant:"subheading",weight:"semibold",tracking:"tight",className:"min-w-0",children:e.jsx(H,{to:P,search:x,className:"truncate hover:text-fg-default/85",children:s.title})})})]}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5",children:s.tagNames.map((a,C)=>e.jsxs("div",{className:"flex items-center gap-1.5",children:[C>0&&e.jsx("span",{className:"px-0.5 text-[10px] font-semibold tracking-[0.08em] text-fg-tertiary/85",children:g}),e.jsx("span",{className:"inline-flex items-center rounded-full border border-border-subtle/80 bg-transparent px-2.5 py-1 text-xs font-medium text-fg-secondary",children:a})]},a))})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(te,{button:e.jsx(se,{label:"Section actions"}),items:[{name:"Edit section",onClick:i},{type:"separator"},{name:"Delete section",onClick:n}]})})]}),e.jsxs("div",{className:"flex flex-1 flex-col gap-2.5",children:[m&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-14 animate-pulse rounded-[14px] bg-hover-subtle"}),e.jsx("div",{className:"h-14 animate-pulse rounded-[14px] bg-hover-subtle"}),e.jsx("div",{className:"h-14 animate-pulse rounded-[14px] bg-hover-subtle"})]}),h&&e.jsxs("div",{className:"rounded-[16px] border border-border-subtle bg-hover-subtle/70 p-4",children:[e.jsx(u,{as:"p",variant:"body",weight:"semibold",children:"Failed to load this section"}),e.jsx(u,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Retry to refresh the tag-based note block."}),e.jsx("div",{className:"mt-3",children:e.jsx(w,{type:"button",variant:"ghost",size:"sm",onClick:()=>b(),children:"Retry"})})]}),!m&&!h&&p.length===0&&e.jsxs("div",{className:"rounded-[16px] border border-dashed border-border-subtle px-4 py-5",children:[e.jsx(u,{as:"p",variant:"body",weight:"semibold",children:"No notes match yet"}),e.jsx(u,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Add more notes with these tags, or edit the section filter."})]}),!m&&!h&&p.map(a=>e.jsxs(H,{to:pe,params:{id:a.id},className:Xe,children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx(u,{as:"div",variant:"body",weight:"semibold",className:"line-clamp-1",children:a.title||"Untitled"}),e.jsxs(u,{as:"div",variant:"meta",tone:"tertiary",className:"mt-1",children:["Updated ",ge(Number(a.updatedAt))]})]}),e.jsx(Je,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary"})]},a.id))]}),e.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-border-subtle/70 pt-4",children:[e.jsx(u,{as:"p",variant:"meta",tone:"tertiary",children:m?"Loading notes...":`Showing ${p.length} of ${k} notes`}),e.jsx(w,{asChild:!0,variant:"subtle",size:"sm",children:e.jsx(H,{to:P,search:x,children:"Open list"})})]})]})}const Y=s=>String(s?.limit??5),J=s=>s?.mode??"and",X=s=>s?s.tagNames.join(", "):"",ee=s=>s?.title??"";function tt({open:s,mode:i,initialSection:n=null,availableTags:c,isTagsLoading:x=!1,onClose:l,onSubmit:m}){const[h,b]=r.useState(ee(n)),[p,k]=r.useState(X(n)),[g,a]=r.useState(J(n)),[C,L]=r.useState(Y(n)),[V,E]=r.useState("");r.useEffect(()=>{s&&(b(ee(n)),k(X(n)),a(J(n)),L(Y(n)),E(""))},[n,s]);const f=B([p]),v=d=>{const y=f.includes(d)?f.filter(W=>W!==d):[...f,d];k(y.join(", ")),E("")};return e.jsxs(S,{isOpen:s,onClose:l,variant:"form",className:"sm:max-w-[640px]",children:[e.jsx(S.Header,{title:i==="create"?"Create section":"Edit section",onClose:l}),e.jsx(S.Body,{children:e.jsxs("form",{id:"view-section-form",className:"flex flex-col gap-5",onSubmit:d=>{d.preventDefault();const y=B([p]);if(y.length===0){E("Add at least one tag for this section.");return}m({title:h,tagNames:y,mode:g,limit:Number(C)})},children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-[minmax(0,1fr)_180px]",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(D,{htmlFor:"view-section-title",size:"md",children:"Section title"}),e.jsx(ae,{id:"view-section-title",value:h,onChange:d=>b(d.target.value),placeholder:"Agent work",autoFocus:!0})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(D,{htmlFor:"view-section-limit",size:"md",children:"Max notes"}),e.jsxs(fe,{value:C,onValueChange:L,children:[e.jsx(F,{value:"3",children:"3 notes"}),e.jsx(F,{value:"5",children:"5 notes"}),e.jsx(F,{value:"8",children:"8 notes"}),e.jsx(F,{value:"10",children:"10 notes"}),e.jsx(F,{value:"12",children:"12 notes"})]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(D,{htmlFor:"view-section-tags",size:"md",children:"Tags"}),e.jsx(be,{id:"view-section-tags",value:p,onChange:d=>{k(d.target.value),E("")},placeholder:"@OceanBrain, @todo",size:"sm"}),e.jsx(u,{as:"p",variant:"meta",tone:V?"default":"tertiary",className:V?"text-fg-error":void 0,children:V||"Separate tags with commas. Plain words become @tags automatically."})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(D,{size:"md",children:"Tag match"}),e.jsxs(ve,{type:"single",value:g,onValueChange:d=>{(d==="and"||d==="or")&&a(d)},variant:"quiet",size:"sm",className:"self-start",children:[e.jsx(_,{value:"and","aria-label":G("and"),children:"Match all"}),e.jsx(_,{value:"or","aria-label":G("or"),children:"Match any"})]})]}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(D,{size:"md",children:"Existing tags"}),e.jsx(u,{as:"span",variant:"meta",tone:"tertiary",children:x?"Loading tag catalog...":`${c.length} tags available`})]}),c.length>0?e.jsx("div",{className:"max-h-44 overflow-y-auto rounded-[18px] border border-border-subtle bg-hover-subtle/60 p-3",children:e.jsx("div",{className:"flex flex-wrap gap-2",children:c.map(d=>{const y=f.includes(d.name);return e.jsx("button",{type:"button",className:`inline-flex items-center rounded-full border px-3 py-1.5 text-sm font-medium transition-colors ${y?"border-border-secondary bg-elevated text-fg-default":"border-border-subtle bg-transparent text-fg-secondary hover:border-border-secondary hover:bg-elevated hover:text-fg-default"}`,onClick:()=>v(d.name),children:d.name},d.id)})})}):e.jsx(u,{as:"p",variant:"meta",tone:"tertiary",children:"No tags yet. You can still type tag names manually."})]})]})}),e.jsx(S.Footer,{children:e.jsxs(re,{children:[e.jsx(w,{type:"button",variant:"ghost",size:"sm",onClick:l,children:"Cancel"}),e.jsx(w,{type:"submit",size:"sm",form:"view-section-form",children:i==="create"?"Create section":"Save section"})]})})]})}function st({open:s,mode:i,initialTitle:n="",onClose:c,onSubmit:x}){const[l,m]=r.useState(n);return r.useEffect(()=>{s&&m(n)},[n,s]),e.jsxs(S,{isOpen:s,onClose:c,variant:"form",className:"sm:max-w-[480px]",children:[e.jsx(S.Header,{title:i==="create"?"Create view tab":"Rename view tab",onClose:c}),e.jsx(S.Body,{children:e.jsxs("form",{id:"view-tab-form",className:"flex flex-col gap-4",onSubmit:h=>{h.preventDefault(),x(l)},children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(D,{htmlFor:"view-tab-title",size:"md",children:"Tab name"}),e.jsx(ae,{id:"view-tab-title",value:l,onChange:h=>m(h.target.value),placeholder:"Now",autoFocus:!0})]}),e.jsx(u,{as:"p",variant:"meta",tone:"tertiary",children:"Each tab is one saved view inside the Views page."})]})}),e.jsx(S.Footer,{children:e.jsxs(re,{children:[e.jsx(w,{type:"button",variant:"ghost",size:"sm",onClick:c,children:"Cancel"}),e.jsx(w,{type:"submit",size:"sm",form:"view-tab-form",children:i==="create"?"Create tab":"Save tab"})]})})]})}const at="Save tag-based views and switch between them without leaving your notes.",rt="focus-ring-soft inline-flex h-8 w-8 items-center justify-center rounded-[10px] text-fg-default/70 outline-none transition-colors hover:bg-hover-subtle hover:text-fg-default touch-none",it="group relative -mb-px flex h-10 min-w-[92px] max-w-[118px] shrink-0 items-center gap-0.5 rounded-t-[12px] border border-b-0 px-1.5 transition-[background-color,border-color,color,box-shadow]",nt="focus-ring-soft inline-flex min-w-0 flex-1 items-center gap-1 rounded-[9px] px-0.5 py-1.5 text-[13px] font-medium outline-none",ot="focus-ring-soft inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-[8px] text-current/55 outline-none transition-[background-color,color,opacity] hover:bg-hover-subtle hover:text-current touch-none",lt="focus-ring-soft relative mb-0.5 inline-flex h-9 shrink-0 items-center gap-1 rounded-[10px] px-2.5 text-[13px] font-medium text-fg-secondary outline-none transition-colors hover:bg-hover-subtle/85 hover:text-fg-default",ct=({tab:s,isActive:i,onSelect:n})=>{const{attributes:c,listeners:x,setNodeRef:l,setActivatorNodeRef:m,transform:h,transition:b,isDragging:p}=ie({id:s.id});return e.jsxs("div",{ref:l,style:{transform:oe.Transform.toString(h),transition:b,opacity:p?.6:1},className:R(it,i?"z-10 border-border-secondary/75 bg-elevated text-fg-default shadow-[0_10px_18px_-20px_rgba(15,18,24,0.24)]":"border-transparent bg-hover-subtle/45 text-fg-secondary hover:bg-hover-subtle/75 hover:text-fg-default"),children:[e.jsx("button",{type:"button",ref:m,"aria-label":`Reorder view tab ${s.title}`,...c,...x,className:R(ot,p?"cursor-grabbing opacity-100":"cursor-grab opacity-70 group-hover:opacity-100"),children:e.jsx(ne,{className:"size-4"})}),e.jsxs("button",{type:"button",role:"tab","aria-selected":i,className:R(nt,i?"text-fg-default":"text-fg-secondary group-hover:text-fg-default"),onClick:n,children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:s.title}),e.jsx("span",{className:"inline-flex min-w-4 shrink-0 items-center justify-center rounded-full bg-hover-subtle/75 px-1 py-0 text-[10px] leading-4 text-current/70",children:s.sections.length})]})]})},dt=({section:s,onEdit:i,onDelete:n})=>{const{attributes:c,listeners:x,setNodeRef:l,setActivatorNodeRef:m,transform:h,transition:b,isDragging:p}=ie({id:s.id});return e.jsx("div",{ref:l,style:{transform:oe.Transform.toString(h),transition:b,opacity:p?.6:1},children:e.jsx(et,{section:s,onEdit:i,onDelete:n,dragHandle:e.jsx("button",{type:"button",ref:m,"aria-label":`Reorder section ${s.title}`,...c,...x,className:R(rt,p?"cursor-grabbing":"cursor-grab"),children:e.jsx(ne,{className:"size-4"})})})})};function bt(){const s=je(),i=ze(),n=we(),[c,x]=r.useState(null),[l,m]=r.useState(null),{data:h,isPending:b,isError:p,refetch:k}=O({queryKey:N.views.workspace(),async queryFn(){const t=await Re();if(t.type==="error")throw t;return t.viewWorkspace}}),g=h??He,a=We(g),{data:C,isPending:L}=O({queryKey:N.tags.list({limit:200}),async queryFn(){const t=await ye({limit:200});if(t.type==="error")throw t;return t.allTags}}),V=Ne(K(Te,{activationConstraint:{distance:8}}),K(ke,{coordinateGetter:Se})),E=C?.tags??[],f=t=>{n.setQueryData(N.views.workspace(),t)},v=async()=>{await n.invalidateQueries({queryKey:N.views.all(),exact:!1})},d=async({active:t,over:o})=>{if(!o||t.id===o.id)return;const T=n.getQueryData(N.views.workspace())??g,j=Oe(T,String(t.id),String(o.id));f(j);const z=await Pe(j.tabs.map(M=>M.id));if(z.type==="error"){f(T),i(z.errors[0].message);return}await v()},y=async({active:t,over:o})=>{if(!a||!o||t.id===o.id)return;const T=n.getQueryData(N.views.workspace())??g,j=_e(T,a.id,String(t.id),String(o.id));f(j);const z=await Ke(a.id,j.tabs.find(M=>M.id===a.id)?.sections.map(M=>M.id)??[]);if(z.type==="error"){f(T),i(z.errors[0].message);return}await v()},W=async t=>{const o=await Ze(t);if(o.type==="error"){i(o.errors[0].message);return}await v(),x(null)},ce=async t=>{if(!a)return;const o=await Qe(a.id,t);if(o.type==="error"){i(o.errors[0].message);return}await v(),x(null)},de=async()=>{if(!a||!await s("Delete this view tab and all of its sections?"))return;const t=await $e(a.id);if(t.type==="error"){i(t.errors[0].message);return}await v()},me=async t=>{if(!a)return;const o=await Ue(a.id,t);if(o.type==="error"){i(o.errors[0].message);return}await v(),m(null)},xe=async t=>{if(!a||!l||l.mode!=="edit")return;const o=await Be(l.section.id,t);if(o.type==="error"){i(o.errors[0].message);return}await v(),m(null)},he=async t=>{if(!a||!await s("Delete this section from the current view tab?"))return;const o=await Ge(t);if(o.type==="error"){i(o.errors[0].message);return}await v()};return e.jsxs(e.Fragment,{children:[e.jsx(Ce,{title:"Views",description:at,children:b&&!h?e.jsx(A,{className:"px-6 py-8 sm:px-8 sm:py-10",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{height:20,width:180,className:"rounded-full"}),e.jsx(I,{height:16,width:260,className:"rounded-full"}),e.jsx(I,{height:44,width:140,className:"rounded-[12px]"})]})}):p?e.jsxs(A,{className:"px-6 py-8 sm:px-8 sm:py-10",children:[e.jsx(u,{as:"p",variant:"body",weight:"semibold",children:"Failed to load saved views"}),e.jsx(u,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Retry loading your saved view tabs."}),e.jsx("div",{className:"mt-4",children:e.jsx(w,{type:"button",variant:"ghost",size:"sm",onClick:()=>{k()},children:"Retry"})})]}):g.tabs.length===0?e.jsxs(A,{className:"px-6 py-8 sm:px-8 sm:py-10",children:[e.jsx(Z,{title:"Create your first view tab",description:"Start with a saved view tab, then add tag-based sections inside it."}),e.jsx("div",{className:"mt-6 flex justify-center",children:e.jsxs(w,{type:"button",onClick:()=>x({mode:"create"}),children:[e.jsx(q,{className:"h-4 w-4"}),"Create first tab"]})})]}):e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx("div",{className:"border-b border-border-secondary/75",children:e.jsx(Q,{sensors:V,collisionDetection:$,modifiers:[Ve],onDragEnd:d,children:e.jsxs("div",{className:"flex items-end gap-1 overflow-x-auto overflow-y-hidden pb-px",children:[e.jsx(U,{items:g.tabs.map(t=>t.id),strategy:Ee,children:e.jsx("div",{role:"tablist","aria-label":"Views tab list",className:"flex min-w-0 items-end gap-1",children:g.tabs.map(t=>e.jsx(ct,{tab:t,isActive:t.id===a?.id,onSelect:async()=>{const o=n.getQueryData(N.views.workspace())??g,T=Ie(o,t.id);f(T);const j=await qe(t.id);if(j.type==="error"){f(o),i(j.errors[0].message);return}f(j.setActiveViewTab)}},t.id))})}),e.jsxs("button",{type:"button",className:lt,onClick:()=>x({mode:"create"}),children:[e.jsx(q,{className:"size-4"}),"Add tab"]})]})})}),a&&e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsxs(A,{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{children:[e.jsx(u,{as:"h2",variant:"heading",weight:"bold",tracking:"tight",children:a.title}),e.jsx(u,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:a.sections.length>0?`${a.sections.length} section${a.sections.length===1?"":"s"} in this view`:"Add sections to build this view"})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsxs(w,{type:"button",size:"sm",onClick:()=>m({mode:"create"}),children:[e.jsx(q,{className:"h-4 w-4"}),"Add section"]}),e.jsx(te,{button:e.jsx(se,{label:"View tab actions"}),items:[{name:"Rename",onClick:()=>x({mode:"edit",tab:a})},{type:"separator"},{name:"Delete tab",onClick:()=>{de()}}]})]})]}),a.sections.length===0?e.jsx(A,{className:"px-6 py-8 sm:px-8 sm:py-10",children:e.jsx(Z,{title:"Add the first section to this tab",description:"Sections pull notes by tag."})}):e.jsx("div",{className:"flex flex-col",children:e.jsx(Q,{sensors:V,collisionDetection:$,modifiers:[De],onDragEnd:y,children:e.jsx(U,{items:a.sections.map(t=>t.id),strategy:Ae,children:e.jsx("div",{className:"flex flex-col gap-4",children:a.sections.map(t=>e.jsx(dt,{section:t,onEdit:()=>m({mode:"edit",section:t}),onDelete:()=>{he(t.id)}},t.id))})})})})]})]})}),e.jsx(st,{open:c!==null,mode:c?.mode??"create",initialTitle:c?.mode==="edit"?c.tab.title:"",onClose:()=>x(null),onSubmit:t=>{if(c?.mode==="edit"){ce(t);return}W(t)}}),e.jsx(tt,{open:l!==null,mode:l?.mode??"create",initialSection:l?.mode==="edit"?l.section:null,availableTags:E,isTagsLoading:L,onClose:()=>m(null),onSubmit:t=>{if(l?.mode==="edit"){xe(t);return}me(t)}})]})}export{bt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./note-vendor-i1M2FSI2.js";import{p as h,a4 as p,P as M,T as t,L as i,aC as f,g as o,av as u,aD as v,aE as E,aF as j}from"./index-BvKBTjQq.js";import{a}from"./graph-vendor-CUxe67Lr.js";import{c as N,n as w}from"./Trash.es-DmwfSy3l.js";import{I as y}from"./Image.es-BjGK7y6Y.js";import"./note-core-Z6kqulGB.js";const H=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.86,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z",opacity:"0.2"}),a.createElement("path",{d:"M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M235.54,150.21a104.84,104.84,0,0,1-37,52.91A104,104,0,0,1,32,120,103.09,103.09,0,0,1,52.88,57.48a104.84,104.84,0,0,1,52.91-37,8,8,0,0,1,10,10,88.08,88.08,0,0,0,109.8,109.8,8,8,0,0,1,10,10Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M232.13,143.64a6,6,0,0,0-6-1.49A90.07,90.07,0,0,1,113.86,29.85a6,6,0,0,0-7.49-7.48A102.88,102.88,0,0,0,54.48,58.68,102,102,0,0,0,197.32,201.52a102.88,102.88,0,0,0,36.31-51.89A6,6,0,0,0,232.13,143.64Zm-42,48.29a90,90,0,0,1-126-126A90.9,90.9,0,0,1,99.65,37.66,102.06,102.06,0,0,0,218.34,156.35,90.9,90.9,0,0,1,190.1,191.93Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M230.72,145.06a4,4,0,0,0-4-1A92.08,92.08,0,0,1,111.94,29.27a4,4,0,0,0-5-5A100.78,100.78,0,0,0,56.08,59.88a100,100,0,0,0,140,140,100.78,100.78,0,0,0,35.59-50.87A4,4,0,0,0,230.72,145.06ZM191.3,193.53A92,92,0,0,1,62.47,64.7a93,93,0,0,1,39.88-30.35,100.09,100.09,0,0,0,119.3,119.3A93,93,0,0,1,191.3,193.53Z"}))]]),b=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M203.57,51A107.9,107.9,0,0,0,20,128c0,44.72,27.6,82.25,72,97.94A36,36,0,0,0,140,192a12,12,0,0,1,12-12h46.21a35.79,35.79,0,0,0,35.1-28A108.6,108.6,0,0,0,236,127.09,107.23,107.23,0,0,0,203.57,51Zm6.34,95.67a11.91,11.91,0,0,1-11.7,9.3H152a36,36,0,0,0-36,36,12,12,0,0,1-16,11.3c-16.65-5.88-30.65-15.76-40.48-28.56A76,76,0,0,1,44,128a84,84,0,0,1,83.13-84H128a84.35,84.35,0,0,1,84,83.29A84.72,84.72,0,0,1,209.91,146.71ZM144,76a16,16,0,1,1-16-16A16,16,0,0,1,144,76Zm-44,24A16,16,0,1,1,84,84,16,16,0,0,1,100,100Zm0,56a16,16,0,1,1-16-16A16,16,0,0,1,100,156Zm88-56a16,16,0,1,1-16-16A16,16,0,0,1,188,100Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M224,127.17a96.48,96.48,0,0,1-2.39,22.18A24,24,0,0,1,198.21,168H152a24,24,0,0,0-24,24,24,24,0,0,1-32,22.61C58.73,201.44,32,169.81,32,128a96,96,0,0,1,95-96C179.84,31.47,223.55,74.35,224,127.17Z",opacity:"0.2"}),a.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89ZM84,168a12,12,0,1,1,12-12A12,12,0,0,1,84,168Zm0-56a12,12,0,1,1,12-12A12,12,0,0,1,84,112Zm44-24a12,12,0,1,1,12-12A12,12,0,0,1,128,88Zm44,24a12,12,0,1,1,12-12A12,12,0,0,1,172,112Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M199.37,55.31A101.32,101.32,0,0,0,128,26h-1A102,102,0,0,0,26,128c0,42.09,26.07,77.44,68,92.26A30.21,30.21,0,0,0,104.11,222,30.06,30.06,0,0,0,134,192a18,18,0,0,1,18-18h46.21a29.82,29.82,0,0,0,29.25-23.31A102.71,102.71,0,0,0,230,127.11,101.25,101.25,0,0,0,199.37,55.31ZM215.76,148a17.89,17.89,0,0,1-17.55,14H152a30,30,0,0,0-30,30,18,18,0,0,1-24,17C61,195.86,38,164.85,38,128a90,90,0,0,1,89.07-90H128a90.34,90.34,0,0,1,90,89.22A90.46,90.46,0,0,1,215.76,148ZM138,76a10,10,0,1,1-10-10A10,10,0,0,1,138,76ZM94,100A10,10,0,1,1,84,90,10,10,0,0,1,94,100Zm0,56a10,10,0,1,1-10-10A10,10,0,0,1,94,156Zm88-56a10,10,0,1,1-10-10A10,10,0,0,1,182,100Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M198,56.74A99.31,99.31,0,0,0,128,28h-1A100,100,0,0,0,28,128c0,41.22,25.55,75.85,66.69,90.38a28.34,28.34,0,0,0,9.42,1.63A28,28,0,0,0,132,192a20,20,0,0,1,20-20h46.21a27.84,27.84,0,0,0,27.3-21.76,100.37,100.37,0,0,0,2.49-23.1A99.26,99.26,0,0,0,198,56.74Zm19.74,91.72A19.89,19.89,0,0,1,198.21,164H152a28,28,0,0,0-28,28,20,20,0,0,1-26.64,18.83C59.51,197.46,36,165.72,36,128a92,92,0,0,1,91.05-92H128a92,92,0,0,1,89.72,112.46ZM136,76a8,8,0,1,1-8-8A8,8,0,0,1,136,76ZM92,100a8,8,0,1,1-8-8A8,8,0,0,1,92,100Zm0,56a8,8,0,1,1-8-8A8,8,0,0,1,92,156Zm88-56a8,8,0,1,1-8-8A8,8,0,0,1,180,100Z"}))]]),F=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z",opacity:"0.2"}),a.createElement("path",{d:"M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M122,40V16a6,6,0,0,1,12,0V40a6,6,0,0,1-12,0Zm68,88a62,62,0,1,1-62-62A62.07,62.07,0,0,1,190,128Zm-12,0a50,50,0,1,0-50,50A50.06,50.06,0,0,0,178,128ZM59.76,68.24a6,6,0,1,0,8.48-8.48l-16-16a6,6,0,0,0-8.48,8.48Zm0,119.52-16,16a6,6,0,1,0,8.48,8.48l16-16a6,6,0,1,0-8.48-8.48ZM192,70a6,6,0,0,0,4.24-1.76l16-16a6,6,0,0,0-8.48-8.48l-16,16A6,6,0,0,0,192,70Zm4.24,117.76a6,6,0,0,0-8.48,8.48l16,16a6,6,0,0,0,8.48-8.48ZM46,128a6,6,0,0,0-6-6H16a6,6,0,0,0,0,12H40A6,6,0,0,0,46,128Zm82,82a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V216A6,6,0,0,0,128,210Zm112-88H216a6,6,0,0,0,0,12h24a6,6,0,0,0,0-12Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M124,40V16a4,4,0,0,1,8,0V40a4,4,0,0,1-8,0Zm64,88a60,60,0,1,1-60-60A60.07,60.07,0,0,1,188,128Zm-8,0a52,52,0,1,0-52,52A52.06,52.06,0,0,0,180,128ZM61.17,66.83a4,4,0,0,0,5.66-5.66l-16-16a4,4,0,0,0-5.66,5.66Zm0,122.34-16,16a4,4,0,0,0,5.66,5.66l16-16a4,4,0,0,0-5.66-5.66ZM192,68a4,4,0,0,0,2.83-1.17l16-16a4,4,0,1,0-5.66-5.66l-16,16A4,4,0,0,0,192,68Zm2.83,121.17a4,4,0,0,0-5.66,5.66l16,16a4,4,0,0,0,5.66-5.66ZM40,124H16a4,4,0,0,0,0,8H40a4,4,0,0,0,0-8Zm88,88a4,4,0,0,0-4,4v24a4,4,0,0,0,8,0V216A4,4,0,0,0,128,212Zm112-88H216a4,4,0,0,0,0,8h24a4,4,0,0,0,0-8Z"}))]]),A=a.forwardRef((s,l)=>a.createElement(h,{ref:l,...s,weights:H}));A.displayName="MoonIcon";const T=A,Z=a.forwardRef((s,l)=>a.createElement(h,{ref:l,...s,weights:b}));Z.displayName="PaletteIcon";const V=Z,g=a.forwardRef((s,l)=>a.createElement(h,{ref:l,...s,weights:F}));g.displayName="SunIcon";const C=g,P=()=>{const{theme:s,toggleTheme:l}=p(x=>x),n="focus-ring-soft surface-base group flex items-start justify-between gap-3.5 px-4 py-3.5 text-left text-fg-default outline-none transition-colors hover:bg-hover-subtle",r="inline-flex h-12 w-12 shrink-0 items-center justify-center rounded-[15px] border border-border-subtle bg-muted text-fg-secondary transition-colors group-hover:border-border-secondary/70 group-hover:text-fg-default",m="h-6 w-6",d="text-fg-tertiary",c="min-w-0 flex flex-col gap-0.5 pt-0.5";return e.jsx(M,{title:"Settings",description:"Manage appearance, integrations, and workspace tools",children:e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsxs("section",{className:"flex flex-col gap-3",children:[e.jsx(t,{as:"p",variant:"label",weight:"medium",className:d,children:"Appearance"}),e.jsxs("button",{type:"button",className:n,onClick:l,children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[e.jsx("span",{className:r,children:e.jsx(V,{className:m})}),e.jsxs("div",{className:c,children:[e.jsx(t,{as:"div",variant:"body",weight:"medium",children:"Theme"}),e.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Switch between light and dark mode."})]})]}),e.jsxs("div",{className:"mt-0.5 flex shrink-0 items-center gap-2 text-fg-tertiary",children:[e.jsx(t,{as:"span",variant:"meta",weight:"medium",tone:"secondary",children:s==="dark"?"Dark":"Light"}),s==="dark"?e.jsx(T,{className:"h-4 w-4",weight:"fill"}):e.jsx(C,{className:"h-4 w-4",weight:"fill"})]})]})]}),e.jsxs("section",{className:"flex flex-col gap-3",children:[e.jsx(t,{as:"p",variant:"label",weight:"medium",className:d,children:"Integrations"}),e.jsxs(i,{to:f,className:n,children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[e.jsx("span",{className:r,children:e.jsx(N,{className:m})}),e.jsxs("div",{className:c,children:[e.jsx(t,{as:"div",variant:"body",weight:"medium",children:"MCP"}),e.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Manage AI integration access."})]})]}),e.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5 group-hover:text-fg-secondary"})]})]}),e.jsxs("section",{className:"flex flex-col gap-3",children:[e.jsx(t,{as:"p",variant:"label",weight:"medium",className:d,children:"Workspace"}),e.jsxs("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:[e.jsxs(i,{to:u,search:{page:1},className:n,children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[e.jsx("span",{className:r,children:e.jsx(w,{className:m})}),e.jsxs("div",{className:c,children:[e.jsx(t,{as:"div",variant:"body",weight:"medium",children:"Trash"}),e.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Restore deleted notes."})]})]}),e.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5 group-hover:text-fg-secondary"})]}),e.jsxs(i,{to:v,search:{page:1},className:n,children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[e.jsx("span",{className:r,children:e.jsx(y,{className:m})}),e.jsxs("div",{className:c,children:[e.jsx(t,{as:"div",variant:"body",weight:"medium",children:"Images"}),e.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Upload and organize images."})]})]}),e.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5 group-hover:text-fg-secondary"})]}),e.jsxs(i,{to:E,search:{page:1},className:n,children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[e.jsx("span",{className:r,children:e.jsx(j,{className:m})}),e.jsxs("div",{className:c,children:[e.jsx(t,{as:"div",variant:"body",weight:"medium",children:"Placeholders"}),e.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Manage template variables."})]})]}),e.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5 group-hover:text-fg-secondary"})]})]})]})]})})};export{P as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./note-vendor-i1M2FSI2.js";import{a5 as v,q as x,v as w,w as E,aa as b,ag as A,$ as T,P as o,F as _,L as G,aN as M,T as R,B as S,a0 as P,i as l,j as k,aD as q}from"./index-BvKBTjQq.js";import{f as D,d as L}from"./image.api-DeF9ck7g.js";import"./graph-vendor-CUxe67Lr.js";import{I as C}from"./Image-DxWhlIDG.js";import{S as f}from"./SurfaceCard-CO0oVxeL.js";import{c as F,n as K}from"./Trash.es-DmwfSy3l.js";import"./note-core-Z6kqulGB.js";const Q=r=>{const{data:d}=v({queryKey:x.images.list(r.searchParams),async queryFn(){const i=await D({offset:r.searchParams.offset,limit:r.searchParams.limit});if(i.type==="error")throw i;return i.allImages}});return r.render(d)},W=240,B=20,H=4,m=192,g=k(q),Z=()=>{const r=w(),d=E(),i=g.useNavigate(),{page:c}=g.useSearch(),{containerRef:p,limit:n}=b({minItemWidth:W,gap:B,rows:H}),j=A({mutationFn:L,onSuccess:s=>{if(s.type==="error")throw s;d.invalidateQueries({queryKey:x.images.listAll(),exact:!1})}}),y=async s=>{await r("Delete this image? It is not referenced by any notes.")&&j.mutate(s)},I=s=>s===1?"1 reference":`${s} references`;return e.jsx("div",{ref:p,children:e.jsx(T,{fallback:e.jsx(o,{title:"Images",variant:"default",heading:e.jsx(l,{width:136,height:24,className:"rounded-full"}),description:e.jsx(l,{width:232,height:16,className:"rounded-full"}),children:e.jsx("div",{className:"flex flex-col gap-4",children:e.jsx("div",{className:"grid-auto-cards grid gap-4",children:Array.from({length:3},(s,t)=>e.jsxs(f,{flush:!0,children:[e.jsx("div",{className:"flex items-center justify-center bg-muted/25 p-3",style:{height:m},children:e.jsx(l,{width:"100%",height:m-24,className:"rounded-[12px]"})}),e.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-border-subtle px-3 py-2.5",children:[e.jsx(l,{width:92,height:14,className:"rounded-full"}),e.jsx(l,{width:32,height:32,className:"rounded-[12px]"})]})]},t))})})}),errorTitle:"Failed to load images",errorDescription:"Retry loading uploaded image metadata",resetKeys:[c,n],children:e.jsx(Q,{searchParams:{offset:(c-1)*n,limit:n},render:({images:s,totalCount:t})=>{const u=t>0?`Images (${t})`:void 0,h="Review and manage the images you uploaded inside notes";return s.length===0?e.jsx(o,{title:"Images",variant:"default",heading:u,description:h,children:e.jsx(_,{title:"There are no images",description:"Upload an image in any note and it will appear here"})}):e.jsx(o,{title:"Images",variant:"default",heading:u,description:h,children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"grid-auto-cards grid gap-4",children:s.map(a=>e.jsxs(f,{flush:!0,children:[e.jsx(G,{to:M,params:{id:a.id},className:"focus-ring-soft block overflow-hidden rounded-t-[18px] outline-none",children:e.jsx("div",{className:"flex items-center justify-center bg-muted/25 p-3",style:{height:m},children:e.jsx(C,{className:"h-full w-full rounded-[12px] object-contain transition-transform duration-200 hover:scale-[1.02]",src:a.url,alt:a.id})})}),e.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-border-subtle px-3 py-2.5",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-fg-secondary",children:[e.jsx(F,{className:"h-3.5 w-3.5 shrink-0 text-fg-tertiary"}),e.jsx(R,{as:"span",variant:"meta",weight:"medium",tone:"secondary",className:"truncate",children:I(a.referenceCount)})]}),e.jsx(S,{variant:"ghost",size:"icon-sm",disabled:a.referenceCount>0,onClick:()=>y(a.id),children:e.jsx(K,{className:"h-4 w-4"})})]})]},a.id))}),t&&n<t&&e.jsx(P,{page:c,last:Math.ceil(t/n),onChange:a=>{i({search:N=>({...N,page:a})})}})]})})}})})})};export{Z as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./note-vendor-i1M2FSI2.js";import{p as F,T as r,t as k,L as p,N as R,ac as _,aO as Z,aD as E,f as q,$ as B,j as G,aN as L,v as O,w as z,a5 as b,q as x,aP as H,ag as v,aQ as K,aR as P,B as w,i as l,W as Q}from"./index-BvKBTjQq.js";import{a as U,d as $}from"./image.api-DeF9ck7g.js";import{a as t}from"./graph-vendor-CUxe67Lr.js";import{I as W}from"./Image-DxWhlIDG.js";import{S as g}from"./SurfaceCard-CO0oVxeL.js";import{c as V,n as J}from"./Trash.es-DmwfSy3l.js";import{I as X}from"./Image.es-BjGK7y6Y.js";import"./note-core-Z6kqulGB.js";const Y=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M178,36c-20.09,0-37.92,7.93-50,21.56C115.92,43.93,98.09,36,78,36a66.08,66.08,0,0,0-66,66c0,72.34,105.81,130.14,110.31,132.57a12,12,0,0,0,11.38,0C138.19,232.14,244,174.34,244,102A66.08,66.08,0,0,0,178,36Zm-5.49,142.36A328.69,328.69,0,0,1,128,210.16a328.69,328.69,0,0,1-44.51-31.8C61.82,159.77,36,131.42,36,102A42,42,0,0,1,78,60c17.8,0,32.7,9.4,38.89,24.54a12,12,0,0,0,22.22,0C145.3,69.4,160.2,60,178,60a42,42,0,0,1,42,42C220,131.42,194.18,159.77,172.51,178.36Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M232,102c0,66-104,122-104,122S24,168,24,102A54,54,0,0,1,78,48c22.59,0,41.94,12.31,50,32,8.06-19.69,27.41-32,50-32A54,54,0,0,1,232,102Z",opacity:"0.2"}),t.createElement("path",{d:"M178,40c-20.65,0-38.73,8.88-50,23.89C116.73,48.88,98.65,40,78,40a62.07,62.07,0,0,0-62,62c0,70,103.79,126.66,108.21,129a8,8,0,0,0,7.58,0C136.21,228.66,240,172,240,102A62.07,62.07,0,0,0,178,40ZM128,214.8C109.74,204.16,32,155.69,32,102A46.06,46.06,0,0,1,78,56c19.45,0,35.78,10.36,42.6,27a8,8,0,0,0,14.8,0c6.82-16.67,23.15-27,42.6-27a46.06,46.06,0,0,1,46,46C224,155.61,146.24,204.15,128,214.8Z"}))],["fill",t.createElement(t.Fragment,null,t.createElement("path",{d:"M240,102c0,70-103.79,126.66-108.21,129a8,8,0,0,1-7.58,0C119.79,228.66,16,172,16,102A62.07,62.07,0,0,1,78,40c20.65,0,38.73,8.88,50,23.89C139.27,48.88,157.35,40,178,40A62.07,62.07,0,0,1,240,102Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M178,42c-21,0-39.26,9.47-50,25.34C117.26,51.47,99,42,78,42a60.07,60.07,0,0,0-60,60c0,29.2,18.2,59.59,54.1,90.31a334.68,334.68,0,0,0,53.06,37,6,6,0,0,0,5.68,0,334.68,334.68,0,0,0,53.06-37C219.8,161.59,238,131.2,238,102A60.07,60.07,0,0,0,178,42ZM128,217.11C111.59,207.64,30,157.72,30,102A48.05,48.05,0,0,1,78,54c20.28,0,37.31,10.83,44.45,28.27a6,6,0,0,0,11.1,0C140.69,64.83,157.72,54,178,54a48.05,48.05,0,0,1,48,48C226,157.72,144.41,207.64,128,217.11Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M178,40c-20.65,0-38.73,8.88-50,23.89C116.73,48.88,98.65,40,78,40a62.07,62.07,0,0,0-62,62c0,70,103.79,126.66,108.21,129a8,8,0,0,0,7.58,0C136.21,228.66,240,172,240,102A62.07,62.07,0,0,0,178,40ZM128,214.8C109.74,204.16,32,155.69,32,102A46.06,46.06,0,0,1,78,56c19.45,0,35.78,10.36,42.6,27a8,8,0,0,0,14.8,0c6.82-16.67,23.15-27,42.6-27a46.06,46.06,0,0,1,46,46C224,155.61,146.24,204.15,128,214.8Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M178,44c-21.44,0-39.92,10.19-50,27.07C117.92,54.19,99.44,44,78,44a58.07,58.07,0,0,0-58,58c0,28.59,18,58.47,53.4,88.79a333.81,333.81,0,0,0,52.7,36.73,4,4,0,0,0,3.8,0,333.81,333.81,0,0,0,52.7-36.73C218,160.47,236,130.59,236,102A58.07,58.07,0,0,0,178,44ZM128,219.42c-14-8-100-59.35-100-117.42A50.06,50.06,0,0,1,78,52c21.11,0,38.85,11.31,46.3,29.51a4,4,0,0,0,7.4,0C139.15,63.31,156.89,52,178,52a50.06,50.06,0,0,1,50,50C228,160,142,211.46,128,219.42Z"}))]]),A=t.forwardRef((a,n)=>t.createElement(F,{ref:n,...a,weights:Y}));A.displayName="HeartIcon";const ee=A;function ae({name:a}){return e.jsx(r,{as:"div",variant:"label",weight:"medium",tone:"secondary",className:"inline-flex items-center rounded-full border border-border-subtle bg-hover-subtle px-2.5 py-1",children:a})}function se({id:a,title:n,tags:i,createdAt:u,updatedAt:d}){const o=new Date(Number(u)),m=k(Number(d));return e.jsx("div",{className:"border-b-2 border-dashed border-border-subtle last:border-b-0",children:e.jsxs("div",{className:"py-4 flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(r,{variant:"label",weight:"medium",tone:"tertiary",children:m}),e.jsxs(r,{variant:"label",tone:"placeholder",children:["(",o.toDateString(),")"]})]}),e.jsx(r,{as:"div",variant:"body",weight:"bold",tracking:"tight",children:e.jsx(p,{className:"transition-colors hover:text-accent-primary",to:R,params:{id:a},children:n||"Untitled"})}),i&&i.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:i.map(c=>e.jsx(p,{to:_,params:{id:c.id},search:{page:1},children:e.jsx(ae,{name:c.name})},c.id))})]})})}const I=G(L),j=352,te="mb-4 inline-flex items-center gap-1 text-fg-secondary transition-colors hover:text-fg-default",T="flex items-center justify-center bg-muted/25 p-3",re="h-full w-full rounded-[12px] object-contain",M="mb-3 flex flex-wrap items-start justify-between gap-3 border-b border-border-subtle pb-3",S="space-y-1",ne=a=>a===1?"1 reference":`${a} references`,C=(a,n)=>typeof a=="object"&&a!==null&&"errors"in a&&Array.isArray(a.errors)&&typeof a.errors[0]?.message=="string"?a.errors[0].message:a instanceof Error&&a.message?a.message:n,ie=()=>e.jsxs("div",{className:"flex flex-col gap-6 lg:flex-row",children:[e.jsx("div",{className:"w-full lg:w-[400px] lg:flex-shrink-0",children:e.jsxs(g,{flush:!0,children:[e.jsx("div",{className:T,style:{height:j},children:e.jsx(l,{width:"100%",height:j-24,className:"rounded-[12px]"})}),e.jsxs("div",{className:"flex flex-col gap-4 border-t border-border-subtle p-4",children:[e.jsx(l,{width:96,height:14,className:"rounded-full"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(l,{height:32,className:"flex-1 rounded-[12px]"}),e.jsx(l,{height:32,className:"flex-1 rounded-[12px]"})]})]})]})}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs(g,{children:[e.jsxs("div",{className:M,children:[e.jsxs("div",{className:S,children:[e.jsx(l,{width:140,height:18}),e.jsx(l,{width:220,height:14,className:"rounded-full"})]}),e.jsx(l,{width:84,height:14,className:"rounded-full"})]}),e.jsx("div",{className:"flex flex-col gap-3",children:Array.from({length:3},(a,n)=>e.jsx(l,{height:72,className:"rounded-[16px]"},n))})]})})]}),le=({id:a})=>{const n=O(),i=Q(),u=I.useNavigate(),d=z(),{data:o}=b({queryKey:x.images.detail(a),queryFn:async()=>{const s=await U(a);if(s.type==="error")throw s;return s.image}}),{data:m}=b({queryKey:x.images.notes(a),queryFn:async()=>{const s=await H(o.url);if(s.type==="error")throw s;return s.imageNotes}}),c=m.length,y=ne(c),h=c===0,f=v({mutationFn:async()=>{const s=await $(a);if(s.type==="error")throw s;if(!s.deleteImage)throw new Error("Failed to delete image");return s.deleteImage},onSuccess:async()=>{await d.invalidateQueries({queryKey:x.images.listAll(),exact:!1}),i("Image deleted"),u({to:E,search:{page:1}})},onError:s=>{i(C(s,"Failed to delete image"))}}),N=v({mutationFn:async()=>{const s=await K("heroBanner",o.url);if(s.type==="error")throw s},onSuccess:async()=>{await d.invalidateQueries({queryKey:x.ui.heroBanner(),exact:!0}),i("Hero banner updated")},onError:s=>{i(C(s,"Failed to update hero banner"))}}),D=async()=>{!h||f.isPending||await n("Delete this image? It is not referenced by any notes.")&&f.mutate()};return e.jsxs("div",{className:"flex flex-col gap-6 lg:flex-row",children:[e.jsx("div",{className:"w-full lg:w-[400px] lg:flex-shrink-0",children:e.jsxs(g,{flush:!0,children:[e.jsx("div",{className:T,style:{height:j},children:e.jsx(W,{className:re,src:o.url,alt:`Image ${o.id}`})}),e.jsxs("div",{className:"flex flex-col gap-4 border-t border-border-subtle p-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(V,{size:14,className:"text-fg-tertiary"}),e.jsx(r,{as:"span",variant:"meta",weight:"medium",tone:"secondary",children:y})]}),e.jsx(r,{as:"p",variant:"meta",tone:"tertiary",children:h?"Delete is available because no notes reference this image":"Remove this image from notes before deleting it"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(P,{content:h?"Delete this image":"Cannot delete while referenced by notes",side:"bottom",children:e.jsxs(w,{variant:"soft-danger",size:"sm",className:"flex-1",disabled:!h,isLoading:f.isPending,onClick:D,children:[e.jsx(J,{size:16}),"Delete"]})}),e.jsxs(w,{variant:"primary",size:"sm",className:"flex-1",isLoading:N.isPending,onClick:()=>N.mutate(),children:[e.jsx(ee,{size:16}),"Set hero banner"]})]})]})]})}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs(g,{children:[e.jsxs("div",{className:M,children:[e.jsxs("div",{className:S,children:[e.jsx(r,{as:"h2",variant:"subheading",weight:"medium",tracking:"tight",children:"Referenced Notes"}),e.jsx(r,{as:"p",variant:"meta",tone:"secondary",children:"Notes currently using this image"})]}),e.jsx(r,{as:"span",variant:"meta",weight:"medium",tone:"secondary",children:y})]}),c>0?e.jsx("ul",{className:"flex flex-col",children:m.map(s=>e.jsx("li",{children:e.jsx(se,{...s})},s.id))}):e.jsxs("div",{className:"flex items-start gap-3 py-1",children:[e.jsx("div",{className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-[10px] bg-muted/25 text-fg-disabled",children:e.jsx(X,{size:18})}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(r,{as:"p",variant:"body",weight:"medium",tone:"secondary",children:"No notes reference this image"}),e.jsx(r,{as:"p",variant:"meta",tone:"secondary",children:"This image can be deleted or reused in another note"})]})]})]})})]})},pe=()=>{const{id:a}=I.useParams();return e.jsxs(e.Fragment,{children:[e.jsx(Z,{children:e.jsx("title",{children:"Image Detail | Ocean Brain"})}),e.jsxs(p,{to:E,search:{page:1},className:te,children:[e.jsx(q,{size:16}),e.jsx(r,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:"Back to Images"})]}),e.jsx(r,{as:"h1",variant:"heading",weight:"bold",tracking:"tighter",className:"sr-only",children:"Image Detail"}),e.jsx(B,{fallback:e.jsx(ie,{}),errorTitle:"Failed to load image detail",errorDescription:"Retry loading the image preview and its referenced notes",resetKeys:[a],children:e.jsx(le,{id:a})})]})};export{pe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./note-vendor-i1M2FSI2.js";import{$ as M,j as F,av as L,w as Q,v as I,a5 as K,aI as _,q as i,ag as E,aJ as B,N as O,aK as W,P as N,F as $,T as d,aw as H,B as j,a0 as Y,aL as z,i as l,W as G,d as U,aj as V,u as J,aM as Z,M as y}from"./index-BvKBTjQq.js";import{a as k}from"./graph-vendor-CUxe67Lr.js";import{S as C}from"./SurfaceCard-CO0oVxeL.js";import"./note-core-Z6kqulGB.js";const m=25,v=F(L),S=30,R=`Deleted notes stay here for ${S} days before permanent removal`,g={title:"Permanently delete note?",description:"This note is referenced by the notes below. If you permanently delete it, those links will stay broken. Other notes will not be edited automatically.",confirmLabel:"Delete now",confirmVariant:"danger"},P=a=>U(a).format("YYYY-MM-DD HH:mm"),X=({note:a,onClose:o})=>{const s=a?.id??"",c=a?.title||"Untitled note",r=J({queryKey:i.notes.trashDetail(s),enabled:!!a,queryFn:async()=>{const h=await Z(s);if(h.type==="error")throw h;if(!h.trashedNote)throw new Error("Trashed note not found");return h.trashedNote}}),f=r.data?.contentAsMarkdown.trim()??"";return e.jsxs(y,{isOpen:!!a,onClose:o,variant:"inspect",children:[e.jsx(y.Header,{title:c,onClose:o}),e.jsx(y.Body,{children:e.jsxs("div",{className:"flex flex-col gap-3",children:[a&&e.jsxs(d,{as:"p",variant:"meta",tone:"secondary",children:["Deleted ",P(a.deletedAt)]}),r.isLoading&&e.jsx(d,{as:"p",variant:"meta",tone:"secondary",children:"Loading deleted note content..."}),r.isError&&e.jsx(d,{as:"p",variant:"meta",tone:"error",children:"Failed to load deleted note content."}),!r.isLoading&&!r.isError&&f&&e.jsx("pre",{className:"max-h-[60vh] overflow-auto whitespace-pre-wrap break-words rounded-[14px] border border-border-subtle bg-hover-subtle/50 px-4 py-3 text-sm leading-6 text-fg-secondary",children:f}),!r.isLoading&&!r.isError&&!f&&e.jsx(d,{as:"p",variant:"meta",tone:"secondary",className:"rounded-[14px] border border-border-subtle bg-hover-subtle/50 px-4 py-3",children:"No readable content was found for this deleted note."})]})}),e.jsx(y.Footer,{children:e.jsx(j,{variant:"ghost",size:"sm",onClick:o,children:"Close"})})]})},ee=()=>e.jsx(N,{title:"Trash",variant:"default",heading:e.jsx(l,{width:118,height:24,className:"rounded-full"}),description:e.jsx(l,{width:352,height:16,className:"rounded-full"}),children:e.jsx("div",{className:"grid gap-3",children:Array.from({length:3},(a,o)=>e.jsx(C,{padding:"compact",children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[e.jsx(l,{width:"40%",height:18,className:"rounded-full"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(l,{width:168,height:14,className:"rounded-full"}),e.jsx(l,{width:176,height:14,className:"rounded-full"})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(l,{width:56,height:24,className:"rounded-full"}),e.jsx(l,{width:72,height:24,className:"rounded-full"})]})]}),e.jsx(l,{width:92,height:32,className:"rounded-[12px]"})]})},o))})}),te=()=>{const{page:a}=v.useSearch(),o=v.useNavigate(),s=Q(),c=G(),r=I(),[f,h]=k.useState(null),[x,b]=k.useState(null),{data:u}=K({queryKey:i.notes.trash({limit:m,offset:(a-1)*m}),queryFn:async()=>{const t=await _({limit:m,offset:(a-1)*m});if(t.type==="error")throw t;return t.trashedNotes}}),w=E({mutationFn:B,onSuccess:async t=>{if(t.type==="error")throw t;await Promise.all([s.invalidateQueries({queryKey:i.notes.all(),exact:!1}),s.invalidateQueries({queryKey:i.tags.all(),exact:!1}),s.invalidateQueries({queryKey:i.reminders.all(),exact:!1}),s.invalidateQueries({queryKey:i.images.all(),exact:!1}),s.invalidateQueries({queryKey:i.calendar.all(),exact:!1})]),c("The note has been restored."),o({to:O,params:{id:t.restoreTrashedNote.id}})},onError:()=>{c("Failed to restore the note.")}}),p=E({mutationFn:W,onSuccess:async t=>{if(t.type==="error")throw t;await s.invalidateQueries({queryKey:i.notes.trashAll(),exact:!1}),c("The note has been permanently deleted.")},onError:()=>{c("Failed to permanently delete the note.")}}),D=()=>{if(!x)return;const{id:t}=x;b(null),p.mutate(t)},q=async t=>{const n=await V(t);if(n.type==="error"){c("Failed to check linked notes before permanently deleting this note.");return}if(s.setQueryData(i.notes.backReferences(t),n.backReferences),n.backReferences.length>0){b({id:t,backReferences:n.backReferences});return}await r("Permanently delete this note? This cannot be undone.")&&p.mutate(t)},T=u.totalCount>0?`Trash (${u.totalCount})`:void 0,A=u.notes.find(t=>t.id===f)??null;return u.notes.length===0?e.jsx(N,{title:"Trash",variant:"default",heading:T,description:R,children:e.jsx($,{title:"Trash is empty",description:`Delete a note and you can restore it here for ${S} days before permanent removal`})}):e.jsxs(N,{title:"Trash",variant:"default",heading:T,description:R,children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"grid gap-3",children:u.notes.map(t=>e.jsx(C,{padding:"compact",children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-1.5",children:[e.jsx(d,{as:"h2",variant:"body",weight:"medium",className:"min-w-0 flex-1 break-words leading-[1.25]",children:t.title||"Untitled note"}),t.pinned&&e.jsx("span",{title:"Pinned",className:"inline-flex h-5 w-5 shrink-0 items-center justify-center text-fg-tertiary",children:e.jsx(H,{className:"h-3.5 w-3.5"})})]}),e.jsx("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1",children:e.jsxs(d,{as:"div",variant:"meta",weight:"medium",tone:"secondary",children:["Deleted ",P(t.deletedAt)]})}),t.tagNames.length>0&&e.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:t.tagNames.map(n=>e.jsx(d,{as:"span",variant:"label",weight:"medium",tone:"tertiary",className:"rounded-full border border-border-subtle bg-hover-subtle px-2 py-0.5",children:n},`${t.id}-${n}`))}),t.contentPreview&&e.jsx("div",{className:"mt-3 rounded-[14px] border border-border-subtle bg-hover-subtle/50 px-3 py-2",children:e.jsx(d,{as:"p",variant:"meta",tone:"secondary",className:"line-clamp-3 whitespace-pre-wrap break-words",children:t.contentPreview})})]}),e.jsxs("div",{className:"flex shrink-0 flex-wrap gap-2 sm:justify-end",children:[e.jsx(j,{variant:"subtle",size:"sm",onClick:()=>h(t.id),children:"View content"}),e.jsx(j,{variant:"subtle",size:"sm",isLoading:w.isPending&&w.variables===t.id,onClick:()=>w.mutate(t.id),children:"Restore"}),e.jsx(j,{variant:"soft-danger",size:"sm",isLoading:p.isPending&&p.variables===t.id,onClick:()=>q(t.id),children:"Delete now"})]})]})},t.id))}),u.totalCount>m&&e.jsx(Y,{page:a,last:Math.ceil(u.totalCount/m),onChange:t=>{o({search:n=>({...n,page:t})})}})]}),e.jsx(X,{note:A,onClose:()=>h(null)}),e.jsx(z,{isOpen:!!x,title:g.title,description:g.description,references:x?.backReferences??[],confirmLabel:g.confirmLabel,confirmVariant:g.confirmVariant,onClose:()=>b(null),onConfirm:D})]})},oe=()=>{const{page:a}=v.useSearch();return e.jsx(M,{fallback:e.jsx(ee,{}),errorTitle:"Failed to load trash",errorDescription:"Retry loading deleted notes",resetKeys:[a],children:e.jsx(te,{})})};export{oe as default};
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import{h as n}from"./index-BvKBTjQq.js";function b(){return n(`query FetchViewWorkspace {
|
|
2
|
-
viewWorkspace {
|
|
3
|
-
activeTabId
|
|
4
|
-
tabs {
|
|
5
|
-
id
|
|
6
|
-
title
|
|
7
|
-
order
|
|
8
|
-
sections {
|
|
9
|
-
id
|
|
10
|
-
tabId
|
|
11
|
-
title
|
|
12
|
-
tagNames
|
|
13
|
-
mode
|
|
14
|
-
limit
|
|
15
|
-
order
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}`)}function V(e){return n(`query FetchViewSection($id: ID!) {
|
|
20
|
-
viewSection(id: $id) {
|
|
21
|
-
id
|
|
22
|
-
tabId
|
|
23
|
-
title
|
|
24
|
-
tagNames
|
|
25
|
-
mode
|
|
26
|
-
limit
|
|
27
|
-
order
|
|
28
|
-
}
|
|
29
|
-
}`,{id:e})}function I(e,{limit:t=25,offset:i=0}={}){return n(`query FetchViewSectionNotes($id: ID!, $pagination: PaginationInput) {
|
|
30
|
-
viewSectionNotes(id: $id, pagination: $pagination) {
|
|
31
|
-
totalCount
|
|
32
|
-
notes {
|
|
33
|
-
id
|
|
34
|
-
title
|
|
35
|
-
pinned
|
|
36
|
-
tags {
|
|
37
|
-
id
|
|
38
|
-
name
|
|
39
|
-
}
|
|
40
|
-
createdAt
|
|
41
|
-
updatedAt
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}`,{id:e,pagination:{limit:t,offset:i}})}function w(e){return n(`mutation CreateViewTab($title: String!) {
|
|
45
|
-
createViewTab(title: $title) {
|
|
46
|
-
id
|
|
47
|
-
}
|
|
48
|
-
}`,{title:e})}function m(e,t){return n(`mutation UpdateViewTab($id: ID!, $title: String!) {
|
|
49
|
-
updateViewTab(id: $id, title: $title) {
|
|
50
|
-
id
|
|
51
|
-
}
|
|
52
|
-
}`,{id:e,title:t})}function $(e){return n(`mutation DeleteViewTab($id: ID!) {
|
|
53
|
-
deleteViewTab(id: $id)
|
|
54
|
-
}`,{id:e})}function f(e){return n(`mutation SetActiveViewTab($id: ID!) {
|
|
55
|
-
setActiveViewTab(id: $id) {
|
|
56
|
-
activeTabId
|
|
57
|
-
tabs {
|
|
58
|
-
id
|
|
59
|
-
title
|
|
60
|
-
order
|
|
61
|
-
sections {
|
|
62
|
-
id
|
|
63
|
-
tabId
|
|
64
|
-
title
|
|
65
|
-
tagNames
|
|
66
|
-
mode
|
|
67
|
-
limit
|
|
68
|
-
order
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}`,{id:e})}function T(e){return n(`mutation ReorderViewTabs($tabIds: [ID!]!) {
|
|
73
|
-
reorderViewTabs(tabIds: $tabIds) {
|
|
74
|
-
id
|
|
75
|
-
}
|
|
76
|
-
}`,{tabIds:e})}function p(e,t){return n(`mutation CreateViewSection($tabId: ID!, $input: ViewSectionInput!) {
|
|
77
|
-
createViewSection(tabId: $tabId, input: $input) {
|
|
78
|
-
id
|
|
79
|
-
}
|
|
80
|
-
}`,{tabId:e,input:t})}function S(e,t){return n(`mutation UpdateViewSection($id: ID!, $input: ViewSectionInput!) {
|
|
81
|
-
updateViewSection(id: $id, input: $input) {
|
|
82
|
-
id
|
|
83
|
-
}
|
|
84
|
-
}`,{id:e,input:t})}function g(e){return n(`mutation DeleteViewSection($id: ID!) {
|
|
85
|
-
deleteViewSection(id: $id)
|
|
86
|
-
}`,{id:e})}function h(e,t){return n(`mutation ReorderViewSections($tabId: ID!, $sectionIds: [ID!]!) {
|
|
87
|
-
reorderViewSections(tabId: $tabId, sectionIds: $sectionIds) {
|
|
88
|
-
id
|
|
89
|
-
}
|
|
90
|
-
}`,{tabId:e,sectionIds:t})}const D={activeTabId:null,tabs:[]},u=e=>{const t=e.trim();return t?t.startsWith("@")?t:t.startsWith("#")?`@${t.slice(1)}`:`@${t}`:""},s=(e,t,i)=>{if(t===i)return e;const r=e.findIndex(d=>d.id===t),a=e.findIndex(d=>d.id===i);if(r<0||a<0)return e;const o=[...e],[c]=o.splice(r,1);return o.splice(a,0,c),o},v=e=>{const t=e.flatMap(i=>typeof i=="string"?i.split(","):[]);return Array.from(new Set(t.map(u).filter(Boolean)))},A=e=>e.tabs.length===0?null:e.activeTabId?e.tabs.find(t=>t.id===e.activeTabId)??e.tabs[0]??null:e.tabs[0]??null,N=(e,t)=>e.tabs.some(i=>i.id===t)?{...e,activeTabId:t}:e,W=(e,t,i)=>({...e,tabs:s(e.tabs,t,i)}),y=(e,t,i,r)=>({...e,tabs:e.tabs.map(a=>a.id===t?{...a,sections:s(a.sections,i,r)}:a)}),x=e=>e==="or"?"Matches any selected tag":"Matches all selected tags",M=e=>e==="or"?"OR":"AND",q=e=>({page:1,sectionId:e.id});export{D as E,x as a,q as b,b as c,A as d,f as e,I as f,M as g,T as h,y as i,h as j,w as k,$ as l,p as m,v as n,S as o,g as p,V as q,W as r,N as s,m as u};
|