ocean-brain 0.3.0 → 0.3.2
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 +2 -2
- package/package.json +1 -1
- package/server/client/dist/assets/Calendar-DynpmB3D.js +25 -0
- package/server/client/dist/assets/{Callout-B2kPcDrq.js → Callout-tNHgPhLM.js} +1 -1
- package/server/client/dist/assets/Graph-DMXLUfCv.js +1 -0
- package/server/client/dist/assets/Image-ZxF459sC.js +1 -0
- package/server/client/dist/assets/{Image.es-Dld9r9MJ.js → Image.es-Dnn4SMzG.js} +1 -1
- package/server/client/dist/assets/{ModalActionRow-CES9L_Gy.js → ModalActionRow-B3vNjcDc.js} +1 -1
- package/server/client/dist/assets/Note-PDMuj62M.js +1 -0
- package/server/client/dist/assets/{Note-SK4hDhEM.css → Note-PEevDKBh.css} +1 -1
- package/server/client/dist/assets/Reminders-ComtTLuN.js +1 -0
- package/server/client/dist/assets/{Search-Cp17DGR6.js → Search-BJeZTbVu.js} +1 -1
- package/server/client/dist/assets/SurfaceCard-DAcVMY4f.js +1 -0
- package/server/client/dist/assets/{Tag-CwmuMPmo.js → Tag-BuNCDGD5.js} +1 -1
- package/server/client/dist/assets/TagNotes-ajFOP5pZ.js +1 -0
- package/server/client/dist/assets/{Trash.es-B3KWD8_C.js → Trash.es-DLiHgjNo.js} +1 -1
- package/server/client/dist/assets/{image.api-DJgOBt8S.js → image.api-CjJgNbC0.js} +1 -1
- package/server/client/dist/assets/{index-DYUg2N-6.js → index-CDrZmLC2.js} +1 -1
- package/server/client/dist/assets/index-DAZMX8bQ.css +1 -0
- package/server/client/dist/assets/index-DqFkOWbi.js +205 -0
- package/server/client/dist/assets/manage-image-CVyZTDT_.js +1 -0
- package/server/client/dist/assets/{manage-image-detail-BVaDZHRu.js → manage-image-detail-Bp17tylS.js} +1 -1
- package/server/client/dist/assets/mcp-BpD7VH-d.js +1 -0
- package/server/client/dist/assets/placeholder-DSf4QF4v.js +34 -0
- package/server/client/dist/assets/trash-Ceb17h_s.js +1 -0
- package/server/client/dist/assets/useReminderMutate-CzyOQ_VB.js +82 -0
- package/server/client/dist/index.html +2 -2
- package/server/dist/modules/blocknote.js +154 -7
- package/server/dist/modules/blocknote.js.map +1 -1
- package/server/dist/modules/note-authoring.js +16 -3
- package/server/dist/modules/note-authoring.js.map +1 -1
- package/server/client/dist/assets/Calendar-DRv2aEl8.js +0 -28
- package/server/client/dist/assets/Graph-DotbTrZR.js +0 -1
- package/server/client/dist/assets/Image-B5R7gF2P.js +0 -1
- package/server/client/dist/assets/Note-cIbXJc1v.js +0 -1
- package/server/client/dist/assets/Reminders-4LunlZRb.js +0 -1
- package/server/client/dist/assets/SurfaceCard-yzVU4Qkx.js +0 -1
- package/server/client/dist/assets/TagNotes-gGroWMtT.js +0 -1
- package/server/client/dist/assets/color-wpu7wT_s.js +0 -1
- package/server/client/dist/assets/index-40Y2UsVr.js +0 -205
- package/server/client/dist/assets/index-BnxpTwtL.css +0 -1
- package/server/client/dist/assets/manage-image-ByY1mRZx.js +0 -1
- package/server/client/dist/assets/mcp-Jj3061aI.js +0 -1
- package/server/client/dist/assets/placeholder-4P_GK7fV.js +0 -34
- package/server/client/dist/assets/trash-CPBwY07S.js +0 -1
- package/server/client/dist/assets/useReminderMutate-1YVndM2T.js +0 -82
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./note-vendor-BofYbzmZ.js";import{a as i,F as Q}from"./graph-vendor-CUxe67Lr.js";import{Q as V,P as C,h as W,S as _,i as U,j as Y,k as J,l as X,q as ee,N as te,E as ne}from"./index-40Y2UsVr.js";import"./note-core-BCgMq5QA.js";const re=s=>{let a=0;for(let n=0;n<s.length;n++)a+=s.charCodeAt(n);return a},oe={background:"#f4f6f8",nodeHub:"#2c2f36",nodeSelected:"#111318",nodeConnected:"#636b76",nodeDefault:["#d6dbe1","#c8ced6","#b7bec7","#a7afb9"],nodeDimmed:["rgba(214,219,225,0.28)","rgba(200,206,214,0.24)","rgba(183,190,199,0.24)","rgba(167,175,185,0.2)"],nodeHubDimmed:"rgba(44,47,54,0.16)",nodeStroke:"#eef1f4",nodeSelectedStroke:"#a6b0bc",labelBackground:"rgba(246,248,250,0.92)",labelText:"#222831",labelFontFamily:"Pretendard Variable, Pretendard, system-ui, sans-serif",linkIdle:"rgba(99, 107, 117, 0.34)",linkConnected:"#68717c",linkDimmed:"rgba(127, 136, 146, 0.12)",legendHub:"#2c2f36"},se={background:"#121316",nodeHub:"#d6dce3",nodeSelected:"#eef1f5",nodeConnected:"#9099a4",nodeDefault:["#343a43","#2d333c","#262c35","#20262f"],nodeDimmed:["rgba(52,58,67,0.28)","rgba(45,51,60,0.24)","rgba(38,44,53,0.22)","rgba(32,38,47,0.2)"],nodeHubDimmed:"rgba(214,220,227,0.16)",nodeStroke:"#171c23",nodeSelectedStroke:"#7f8a97",labelBackground:"rgba(16,18,22,0.9)",labelText:"#eef2f6",labelFontFamily:"Pretendard Variable, Pretendard, system-ui, sans-serif",linkIdle:"rgba(118, 127, 138, 0.42)",linkConnected:"#a2abb6",linkDimmed:"rgba(118, 127, 138, 0.1)",legendHub:"#d6dce3"};function D(s){return s==="dark"?se:oe}function ae(s,a){const n=D(s),{connections:g,colorIndex:y,selectedNodeId:l,nodeId:b,isConnected:c}=a,h=l===b;return l!==null&&!h&&!c?g>3?n.nodeHubDimmed:n.nodeDimmed[y%n.nodeDimmed.length]:h?n.nodeSelected:c?n.nodeConnected:g>3?n.nodeHub:n.nodeDefault[y%n.nodeDefault.length]}function ie(s,a){const n=D(s);return a.selectedNodeId!==null&&!a.isConnected?n.linkDimmed:a.isConnected?n.linkConnected:n.linkIdle}function de(s,a){const n=D(s);return`${a.emphasize?"700":"400"} ${a.fontSize}px ${n.labelFontFamily}`}function F(s){return s<=1?3:s<=3?4:s<=5?5:Math.min(8,5+Math.sqrt(s)*.8)}const le=r.jsx(C,{title:"Knowledge Graph",children:r.jsx("div",{className:"flex items-center justify-center",style:{height:"600px"},children:r.jsx(_,{width:"100%",height:"100%"})})});function ce(){const s=U(),a=i.useRef(null),n=i.useRef(null),[g,y]=i.useState({width:800,height:600}),[l,b]=i.useState(null),{theme:c}=Y(e=>e),h=D(c),I=i.useRef(h);I.current=h;const{data:w}=J({queryKey:ee.notes.graph(),queryFn:async()=>{const e=await X();if(e.type==="error")throw e;return e.noteGraph}}),d=i.useMemo(()=>{if(w.nodes.length===0)return null;const e=w.nodes.filter(o=>o.connections>0);if(e.length===0)return null;const t=new Set(e.map(o=>o.id));return{nodes:e,links:w.links.filter(o=>t.has(o.source)&&t.has(o.target))}},[w]);i.useEffect(()=>{if(!d)return;const e=()=>{if(!a.current)return;const t=a.current.getBoundingClientRect();y({width:t.width,height:Math.max(600,window.innerHeight-150)})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[d]),i.useEffect(()=>{if(!d||!n.current)return;const e=window.setTimeout(()=>{n.current?.zoomToFit(400,50)},500);return()=>window.clearTimeout(e)},[d]);const T=i.useRef(l);T.current=l;const G=i.useCallback(e=>{if(T.current===e.id){s({to:te,params:{id:e.id}});return}b(e.id)},[s]),z=i.useCallback(()=>{b(null)},[]),B=i.useCallback(e=>{a.current&&(a.current.style.cursor=e?"pointer":"default")},[]),S=i.useRef(!1),L=i.useCallback(()=>{S.current||(S.current=!0,n.current?.enableZoomInteraction(!1))},[]),K=i.useCallback(()=>{S.current=!1,n.current?.enableZoomInteraction(!0)},[]),R=i.useRef(new Map),q=i.useMemo(()=>{const e=new Map;if(d)for(const t of d.links)e.has(t.source)||e.set(t.source,new Set),e.has(t.target)||e.set(t.target,new Set),e.get(t.source)?.add(t.target),e.get(t.target)?.add(t.source);return e},[d]);R.current=q;const A=i.useCallback((e,t,o)=>{const u=I.current,f=l,p=R.current,m=F(e.connections),x=e.x||0,v=e.y||0,k=f===e.id,N=f?p.get(f)?.has(e.id)??!1:!1,Z=f!==null&&!k&&!N,$=re(e.id);if(t.beginPath(),t.arc(x,v,m,0,Math.PI*2),t.fillStyle=ae(c,{connections:e.connections,colorIndex:$,selectedNodeId:f,nodeId:e.id,isConnected:N}),t.fill(),!Z&&(t.strokeStyle=u.nodeStroke,t.lineWidth=(k?2:1)/o,t.stroke(),k&&(t.beginPath(),t.arc(x,v,m+2/o,0,Math.PI*2),t.strokeStyle=u.nodeSelectedStroke,t.lineWidth=1.5/o,t.stroke()),k||N||o>2.5)){const E=e.title||"Untitled",P=Math.max(10/o,2.5);t.font=de(c,{fontSize:P,emphasize:k||N}),t.textAlign="center",t.textBaseline="top";const H=t.measureText(E).width,j=2/o,M=v+m+3/o;t.fillStyle=u.labelBackground,t.fillRect(x-H/2-j,M,H+j*2,P+j*2),t.fillStyle=u.labelText,t.fillText(E,x,M+j)}},[l,c]),O=i.useCallback((e,t,o)=>{const u=l,f=e.source,p=e.target,m=u?f.id===u||p.id===u:!1;t.beginPath(),t.moveTo(f.x||0,f.y||0),t.lineTo(p.x||0,p.y||0),t.strokeStyle=ie(c,{selectedNodeId:u,isConnected:m}),t.lineWidth=m?2/o:.5/o,t.stroke()},[l,c]);return d?r.jsxs(C,{title:"Knowledge Graph",description:`${d.nodes.length} linked notes, ${d.links.length} connections`,children:[r.jsxs("div",{ref:a,className:"surface-base relative overflow-hidden",style:{background:h.background},children:[l&&(()=>{const e=d.nodes.find(t=>t.id===l);return e?r.jsxs("div",{className:"surface-floating absolute top-3 left-3 z-10 flex items-center gap-2 px-3 py-2 text-sm",children:[r.jsx("span",{className:"max-w-48 truncate font-semibold text-fg-default",children:e.title}),r.jsxs("span",{className:"text-fg-tertiary",children:[e.connections," links"]}),r.jsx("button",{onClick:()=>b(null),className:"focus-ring-soft ml-1 flex h-7 w-7 cursor-pointer items-center justify-center rounded-[12px] text-fg-tertiary transition-colors hover:bg-hover-subtle hover:text-fg-default","aria-label":"Deselect node",children:"x"})]}):null})(),r.jsx(Q,{ref:n,graphData:d,width:g.width,height:g.height,nodeId:"id",nodeLabel:"",nodeCanvasObject:A,nodePointerAreaPaint:(e,t,o)=>{o.beginPath(),o.arc(e.x||0,e.y||0,Math.max(F(e.connections)+4,10),0,2*Math.PI),o.fillStyle=t,o.fill()},linkCanvasObject:O,linkCanvasObjectMode:()=>"replace",linkDirectionalParticles:0,onNodeClick:G,onNodeHover:B,onBackgroundClick:z,onNodeDrag:L,onNodeDragEnd:K,warmupTicks:30,cooldownTicks:80,d3AlphaDecay:.05,d3VelocityDecay:.3,enableZoomInteraction:!0,enablePanInteraction:!0,minZoom:.3,maxZoom:5})]}),r.jsxs("div",{className:"mt-4 flex flex-wrap gap-4 text-sm",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"h-4 w-4 rounded-full border border-border-subtle",style:{background:h.legendHub}}),r.jsx("span",{className:"text-fg-tertiary font-medium",children:"Hub notes (4+ connections)"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"h-4 w-4 rounded-full border border-border-subtle",style:{background:h.nodeConnected}}),r.jsx("span",{className:"text-fg-tertiary font-medium",children:"Connected notes"})]})]})]}):r.jsx(C,{title:"Knowledge Graph",children:r.jsx(ne,{title:"No constellations yet",description:"Link your notes together and watch your own starry sky unfold."})})}function me(){return r.jsx(V,{fallback:le,errorTitle:"Failed to load graph",errorDescription:"Retry loading your linked note constellation.",renderError:({error:s,retry:a})=>r.jsx(C,{title:"Knowledge Graph",children:r.jsx(W,{title:"Failed to load graph",description:"Retry loading your linked note constellation.",error:s,onRetry:a})}),children:r.jsx(ce,{})})}export{me as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t}from"./note-vendor-BofYbzmZ.js";import{a as f}from"./graph-vendor-CUxe67Lr.js";import{j as m}from"./index-40Y2UsVr.js";function E({src:r,alt:i,loading:s="lazy",className:a}){const A=f.useRef(null),{theme:g}=m(e=>e),o=g==="dark"?"brightness(0.85) saturate(0.9)":void 0;return f.useEffect(()=>{if(!A.current||s!=="lazy"||!r)return;const e=new IntersectionObserver(([c])=>{if(c.isIntersecting){const n=c.target;n.src=n.dataset.src,e.unobserve(n)}});return e.observe(A.current),()=>{e.disconnect()}},[s,r]),t.jsx(t.Fragment,{children:s!=="lazy"?t.jsx("img",{src:r,alt:i,className:a,style:{filter:o}}):t.jsx("img",{ref:A,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQIW2O4evXqfwAIgQN/QHwrfwAAAABJRU5ErkJggg==",alt:i,"data-src":r,className:a,style:{filter:o}})})}export{E as I};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,U as J,y as le,v as ce,i as z,k as de,X as me,F as ue}from"./note-vendor-BofYbzmZ.js";import{k as X,y as xe,q as w,M as j,B as R,z as Z,A as fe,u as pe,G as he,H as ge,I as be,d as N,J as ee,L as U,N as q,w as ye,K as P,O as je,t as ve,U as Ne,j as we,V as E,W as Ce,X as Se,T as Re,c as O,b as ke,Y as Te,Z as Me,D as te,m as se,Q as Y,P as B,h as F,e as De,S as T,_ as Ae,$ as $e,a0 as He,a1 as Ee,a2 as Oe,a3 as Q}from"./index-40Y2UsVr.js";import{a as m,g as Le}from"./graph-vendor-CUxe67Lr.js";import{u as Ie}from"./image.api-DJgOBt8S.js";import{V as Pe,a2 as Ye,a3 as Fe,A as ze}from"./note-core-BCgMq5QA.js";import{M as ne,n as Ue}from"./ModalActionRow-CES9L_Gy.js";import{u as qe,R as Be}from"./useReminderMutate-1YVndM2T.js";function _e({title:t,description:a,selected:o=!1,onClick:i,children:r}){return e.jsxs("button",{type:"button","aria-pressed":o,className:`focus-ring-soft flex w-full items-start justify-between gap-3 p-3 text-left transition-colors sm:p-4 ${o?"surface-floating bg-elevated":"rounded-[14px] border border-border-subtle bg-transparent hover:border-border-secondary hover:bg-hover-subtle"}`,onClick:i,children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:`text-sm font-semibold sm:text-base ${o?"text-fg-default":"text-fg-secondary"}`,children:t}),e.jsx("div",{className:`mt-1 text-xs font-medium sm:text-sm ${o?"text-fg-tertiary":"text-fg-placeholder"}`,children:a})]}),r?e.jsx("div",{className:"shrink-0",children:r}):null]})}const Qe=t=>{const{data:a}=X({queryKey:w.notes.backReferences(t.noteId),async queryFn(){const o=await xe(t.noteId);if(o.type==="error")throw o;return o.backReferences}});return t.render(a)},Ke=[{value:"narrow",label:"Narrow",description:"Optimized for reading long-form content"},{value:"wide",label:"Wide",description:"Balanced width suitable for most content"},{value:"full",label:"Full Width",description:"Maximize screen space utilization"}];function Ve({isOpen:t,onClose:a,onSave:o,currentLayout:i="wide"}){const[r,n]=m.useState(i);m.useEffect(()=>{t&&n(i)},[t,i]);const s=()=>{o(r),a()};return e.jsxs(j,{isOpen:t,onClose:a,children:[e.jsx(j.Header,{title:"Layout Settings",onClose:a}),e.jsx(j.Body,{children:e.jsx("div",{className:"flex flex-col gap-3 sm:gap-4",children:e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("label",{className:"text-sm font-semibold text-fg-secondary",children:"Note Layout"}),e.jsx("div",{className:"flex flex-col gap-2",children:Ke.map(l=>e.jsx(_e,{title:l.label,description:l.description,selected:r===l.value,onClick:()=>n(l.value)},l.value))})]})})}),e.jsx(j.Footer,{children:e.jsxs(ne,{children:[e.jsx(R,{variant:"ghost",size:"sm",onClick:a,children:"Cancel"}),e.jsx(R,{variant:"primary",size:"sm",onClick:s,children:"Apply"})]})})]})}const Ge=(t,a)=>t||(a==="mobile"?"Mobile browser":a==="mcp"?"MCP":"Web browser");function We({isOpen:t,noteId:a,onClose:o,onRestored:i}){const r=Z(),n=fe(),s=pe({queryKey:w.notes.snapshots(a),queryFn:async()=>{const c=await he(a);if(c.type==="error")throw c;return c.noteSnapshots},enabled:t}),l=ge({mutationFn:be,onSuccess:async c=>{if(c.type==="error"){r(c.errors[0].message);return}await Promise.all([n.invalidateQueries({queryKey:w.notes.detail(a),exact:!0}),n.invalidateQueries({queryKey:w.notes.listAll(),exact:!1}),n.invalidateQueries({queryKey:w.notes.tagListAll(),exact:!1}),n.invalidateQueries({queryKey:w.notes.pinned(),exact:!0}),n.invalidateQueries({queryKey:w.notes.backReferences(a),exact:!0}),n.invalidateQueries({queryKey:w.notes.snapshots(a),exact:!1})]),r("Previous version restored."),i?.(c.restoreNoteSnapshot),o()}});return e.jsxs(j,{isOpen:t,onClose:o,children:[e.jsx(j.Header,{title:"Restore Previous Version",onClose:o}),e.jsx(j.Body,{children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("p",{className:"text-sm text-fg-secondary",children:"Choose a previous snapshot to restore this note back to that state."}),s.isLoading&&e.jsx("div",{className:"text-sm text-fg-secondary",children:"Loading previous versions..."}),!s.isLoading&&s.data?.length===0&&e.jsx("div",{className:"rounded-[14px] border border-border-subtle bg-hover-subtle/50 px-4 py-3 text-sm text-fg-secondary",children:"A recovery snapshot will appear after the first edit in a session and older ones are cleaned up automatically."}),!s.isLoading&&s.data&&s.data.length>0&&e.jsx("div",{className:"flex flex-col gap-2",children:s.data.map(c=>e.jsx("div",{className:"surface-base p-3",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("p",{className:"text-sm font-semibold",children:["Before ",Ge(c.meta.label,c.meta.entrypoint)," edit"]}),e.jsx("p",{className:"truncate text-sm text-fg-secondary",children:c.title}),e.jsx("p",{className:"text-xs text-fg-placeholder",children:N(c.createdAt).format("YYYY-MM-DD HH:mm:ss")})]}),e.jsx(R,{size:"sm",isLoading:l.isPending,onClick:()=>l.mutate(c.id),children:"Restore"})]})},c.id))})]})})]})}var L={exports:{}};var K;function Je(){return K||(K=1,(function(t){(function(){var a={}.hasOwnProperty;function o(){for(var n="",s=0;s<arguments.length;s++){var l=arguments[s];l&&(n=r(n,i(l)))}return n}function i(n){if(typeof n=="string"||typeof n=="number")return n;if(typeof n!="object")return"";if(Array.isArray(n))return o.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var s="";for(var l in n)a.call(n,l)&&n[l]&&(s=r(s,l));return s}function r(n,s){return s?n?n+" "+s:n+s:n}t.exports?(o.default=o,t.exports=o):window.classNames=o})()})(L)),L.exports}var Xe=Je();const Ze=Le(Xe),et="_Reference_6yru9_1",tt={Reference:et},st=ee.bind(tt),nt=J({type:"reference",propSchema:{id:{default:""},title:{default:"Unknown"}},content:"none"},{render:t=>e.jsx("span",{className:st("Reference"),children:e.jsx(U,{to:q,params:{id:t.inlineContent.props.id},children:e.jsxs("span",{children:["[",t.inlineContent.props.title,"]"]})})})}),at="_Tag_eqfjc_1",rt={Tag:at},ot=ee.bind(rt),it=J({type:"tag",propSchema:{id:{default:""},tag:{default:"@Unknown"}},content:"none"},{render:t=>e.jsx("span",{className:ot("Tag"),children:e.jsx(U,{to:ye,params:{id:t.inlineContent.props.id},search:{page:1},children:e.jsx("span",{children:t.inlineContent.props.tag})})})}),lt=()=>{const t=ce(),[a,o]=m.useState([]);m.useEffect(()=>{const r=()=>{const s=t.document,l=[],c=C=>{for(const h of C){if(h.type==="heading"){const y=h,v=y.props.level||1,x=y.content?.map(k=>k.text||"").join("")||"";x.trim()&&l.push({id:h.id,level:v,text:x})}h.children&&Array.isArray(h.children)&&c(h.children)}};c(s),o(l)};r();const n=t.onChange?.(r);return()=>{n&&n()}},[t]);const i=r=>{t.setTextCursorPosition(r);const n=document.querySelector(`[data-id="${r}"]`);n&&n.scrollIntoView({behavior:"smooth",block:"center"})};return a.length===0?e.jsx("div",{className:"surface-base w-full p-5",children:e.jsxs("div",{className:"flex items-start gap-3 text-fg-tertiary",children:[e.jsx(P,{className:"mt-0.5 text-xl flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"mb-1 text-sm font-semibold text-fg-default",children:"Table of Contents"}),e.jsx("div",{className:"text-sm text-fg-tertiary",children:"Add headings to your document to generate a table of contents"})]})]})}):e.jsxs("div",{className:"surface-base w-full p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center gap-2 border-b border-border-subtle pb-3",children:[e.jsx(P,{className:"text-lg text-fg-tertiary"}),e.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.1em] text-fg-tertiary",children:"Table of Contents"})]}),e.jsx("nav",{className:"space-y-1",children:a.map(r=>{const n=(r.level-1)*14,s=r.level===1;return e.jsxs("button",{type:"button",onClick:()=>i(r.id),className:["focus-ring-soft","flex","w-full","items-start","gap-3","rounded-[14px]","px-3","py-2.5","text-left","transition-colors","hover:bg-hover-subtle",s?"text-fg-default":"text-fg-secondary"].join(" "),style:{paddingLeft:`${12+n}px`},children:[e.jsxs("span",{className:"mt-[1px] min-w-[1.75rem] text-[0.625rem] font-semibold uppercase tracking-[0.12em] text-fg-tertiary",children:["H",r.level]}),e.jsx("span",{className:`line-clamp-2 text-sm ${s?"font-semibold":"font-medium"}`,children:r.text})]},r.id)})})]})},ct=le({type:"tableOfContents",propSchema:{},content:"none"},{render:()=>e.jsx(lt,{})})(),dt=Pe.create({inlineContentSpecs:{...Fe,tag:it,reference:nt},blockSpecs:{...Ye,tableOfContents:ct}}),mt=({editor:t})=>e.jsx(z,{triggerCharacter:"/",getItems:async a=>ze([...de(t).filter(o=>o.title!=="Audio"&&o.title!=="Video"&&o.title!=="File"),{title:"Table of Contents",subtext:"Insert a table of contents based on headings",onItemClick:()=>{t.insertBlocks([{type:"tableOfContents"}],t.getTextCursorPosition().block,"after")},aliases:["toc","table of contents","contents","outline","index"],group:"Other",icon:e.jsx(P,{})}],a)}),ut=({onClick:t})=>e.jsx(z,{triggerCharacter:"[",getItems:async a=>{const o=await je({query:a,limit:5});if(o.type==="error")return[];const{notes:i}=o.allNotes;return i.map(r=>({title:r.title,onItemClick:()=>t({type:"reference",props:{id:r.id,title:r.title}})}))}}),xt=({onClick:t})=>e.jsx(z,{triggerCharacter:"@",getItems:async a=>{const o=await ve({query:a,limit:5});if(o.type==="error")return[];const{tags:i}=o.allTags,r=i.some(s=>s.name!==`@${a}`),n=[{title:"Add a new tag",onItemClick:async()=>{const s=await Ne({name:"@"+a});if(s.type==="error")return;const{id:l,name:c}=s.createTag;t({type:"tag",props:{id:l,tag:c}})}}];return i.length===0?n:i.map(s=>({title:s.name,onItemClick:()=>t({type:"tag",props:{id:s.id,tag:s.name}})})).concat(a&&r?n:[])}});async function ft(t){return new Promise((a,o)=>{const i=new FileReader;i.readAsDataURL(t),i.onload=()=>a(i.result),i.onerror=r=>o(r)})}const pt=m.forwardRef(({content:t,editable:a,onChange:o},i)=>{const{theme:r}=we(s=>s),n=me({schema:dt,initialContent:t&&JSON.parse(t)||void 0,uploadFile:async s=>Ie({base64:await ft(s)})},[]);return m.useImperativeHandle(i,()=>({getContent:()=>JSON.stringify(n.document)})),e.jsxs(ue,{slashMenu:!1,theme:r,editor:n,editable:a,onChange:o,children:[e.jsx(mt,{editor:n}),e.jsx(ut,{onClick:s=>{n.insertInlineContent([s," "])}}),e.jsx(xt,{onClick:s=>{n.insertInlineContent([s," "])}})]})}),V={low:{active:"border-border-secondary bg-elevated text-fg-default",inactive:"border-transparent bg-transparent text-fg-muted hover:bg-hover-subtle"},medium:{active:"border-border-secondary bg-elevated text-fg-default",inactive:"border-transparent bg-transparent text-fg-muted hover:bg-hover-subtle"},high:{active:"border-border-secondary bg-elevated text-fg-default",inactive:"border-transparent bg-transparent text-fg-muted hover:bg-hover-subtle"}};function ht({isOpen:t,onClose:a,onSave:o,reminder:i,mode:r}){const[n,s]=m.useState(new Date),[l,c]=m.useState("medium"),[C,h]=m.useState("");m.useEffect(()=>{t&&r==="edit"&&i?(s(new Date(Number(i.reminderDate))),c(i.priority||"medium"),h(i.content||"")):t&&r==="create"&&(s(new Date),c("medium"),h(""))},[t,r,i]);const y=()=>{o(n,l,C||void 0),a()},v=x=>l===x?V[x].active:V[x].inactive;return e.jsxs(j,{isOpen:t,onClose:a,children:[e.jsx(j.Header,{title:r==="create"?"Create Reminder":"Edit Reminder",onClose:a}),e.jsx(j.Body,{children:e.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(E,{children:"Date & Time"}),e.jsx(Ce,{type:"datetime-local",size:"sm",value:N(n).format("YYYY-MM-DDTHH:mm"),onChange:x=>s(new Date(x.target.value))})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(E,{children:"Content"}),e.jsx(Se,{size:"sm",placeholder:"Enter reminder content (optional)",value:C,onChange:x=>h(x.target.value)})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(E,{children:"Priority"}),e.jsxs(Re,{type:"single",value:l,onValueChange:x=>x&&c(x),className:"gap-1.5 border-none rounded-[14px] bg-muted/70 p-1 sm:gap-2",children:[e.jsx(O,{value:"low",className:`flex-1 rounded-[10px] border text-sm font-medium ${v("low")}`,children:"Low"}),e.jsx(O,{value:"medium",className:`flex-1 rounded-[10px] border text-sm font-medium ${v("medium")}`,children:"Medium"}),e.jsx(O,{value:"high",className:`flex-1 rounded-[10px] border text-sm font-medium ${v("high")}`,children:"High"})]})]})]})}),e.jsx(j.Footer,{children:e.jsxs(ne,{children:[e.jsx(R,{variant:"ghost",size:"sm",onClick:a,children:"Cancel"}),e.jsx(R,{variant:"primary",size:"sm",onClick:y,children:r==="create"?"Create":"Save"})]})})]})}function gt({noteId:t}){const[a,o]=m.useState(!1),[i,r]=m.useState(!1),[n,s]=m.useState("create"),[l,c]=m.useState(void 0),{onCreate:C,onUpdate:h,onDelete:y}=qe(),v=()=>{s("create"),c(void 0),r(!0)},x=f=>{s("edit"),c(f),r(!0)},k=(f,p,d)=>{n==="create"?C(t,f,p,()=>{r(!1)},d):n==="edit"&&l&&h(l.id,t,{reminderDate:f,priority:p,content:d},()=>{r(!1)})},A=f=>{h(f.id,t,{completed:!f.completed})},M=f=>{const p=N(Number(f)),d=N();return p.isSame(d,"day")?`Today at ${p.format("HH:mm")}`:p.isSame(d.add(1,"day"),"day")?`Tomorrow at ${p.format("HH:mm")}`:p.format("YYYY-MM-DD HH:mm")},$=f=>{const p=N(Number(f)),d=N(),g=p.diff(d,"hour");return g<=6?"high":g<=24?"medium":"low"},D=f=>{const p=N(Number(f)),d=N(),g=p.diff(d,"hour"),S=p.diff(d,"minute")%60;return g<0||S<0?"Overdue":g===0?`${S}m remaining`:`${g}h ${S}m remaining`};return e.jsxs("div",{className:"surface-base mb-5 p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsxs("button",{type:"button",onClick:()=>o(!a),className:"focus-ring-soft flex items-center gap-2 rounded-[10px] px-2 py-1.5 text-fg-default transition-colors hover:bg-hover-subtle",children:[a?e.jsx(ke,{size:14}):e.jsx(Te,{size:14}),e.jsx("p",{className:"text-sm font-medium",children:"Reminders"})]}),!a&&e.jsxs(R,{size:"sm",variant:"ghost",onClick:v,children:[e.jsx(Ue,{className:"w-3 h-3"}),e.jsx("span",{className:"hidden sm:inline text-xs",children:"Add"})]})]}),!a&&e.jsx(Be,{noteId:t,searchParams:{offset:0,limit:9999},render:({reminders:f,totalCount:p})=>e.jsx("div",{className:"flex flex-col gap-2",children:f.length===0?e.jsx("p",{className:"py-3 text-center text-sm text-fg-tertiary",children:p===0?"No reminders yet":"All reminders complete"}):e.jsx("div",{className:"flex flex-col gap-1.5",children:f.map(d=>{const g=d.priority||$(d.reminderDate),S=D(d.reminderDate),H=g==="high"?"High":g==="medium"?"Medium":"Low";return e.jsxs("div",{className:`flex items-start gap-2 rounded-[16px] border border-border-subtle p-3 transition-colors ${d.completed?"bg-muted/60":"bg-surface hover:bg-hover-subtle"}`,children:[e.jsx(Me,{checked:d.completed,onChange:()=>A(d),size:"sm"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[e.jsx("div",{className:`font-semibold text-sm text-fg-secondary ${d.completed?"line-through opacity-50":""}`,children:M(d.reminderDate)}),!d.completed&&e.jsx("span",{className:"inline-flex items-center rounded-full border border-border-subtle bg-hover-subtle px-2 py-0.5 text-[0.625rem] font-medium uppercase tracking-[0.08em] text-fg-tertiary",children:H})]}),d.content&&e.jsx("div",{className:`text-sm text-fg-tertiary ${d.completed?"line-through opacity-50":""} truncate`,children:d.content}),!d.completed&&e.jsx("span",{className:`mt-1 inline-flex text-xs font-medium ${g==="high"?"text-fg-error":"text-fg-placeholder"}`,children:S})]}),e.jsx(te,{button:e.jsxs("button",{type:"button",className:"focus-ring-soft inline-flex h-8 w-8 items-center justify-center rounded-[10px] text-fg-tertiary outline-none transition-colors hover:bg-hover-subtle hover:text-fg-default",children:[e.jsx(se,{size:14,className:"text-current"}),e.jsx("span",{className:"sr-only",children:"Reminder actions"})]}),items:[{name:"Edit",onClick:()=>x(d)},{name:"Delete",onClick:()=>y(d.id,t)}]})]},d.id)})})})}),e.jsx(ht,{isOpen:i,onClose:()=>r(!1),onSave:k,reminder:l,mode:n})]})}const ae=De(q),G=t=>N(Number(t)).format("YYYY-MM-DD HH:mm:ss"),I=()=>typeof globalThis.crypto?.randomUUID=="function"?globalThis.crypto.randomUUID():`${Date.now()}-${Math.random().toString(16).slice(2)}`,bt={narrow:"max-w-[640px]",wide:"max-w-[896px]",full:"max-w-full px-4"},yt=e.jsx(B,{title:"Loading note",variant:"none",children:e.jsxs("main",{className:"mx-auto max-w-[896px]",children:[e.jsx(T,{className:"mb-8",height:"66px"}),e.jsx(T,{className:"ml-12 mb-8",height:"150px"}),e.jsx(T,{className:"mb-5",height:"80px"}),e.jsx(T,{height:"80px"})]})}),W="text-[0.6875rem] font-medium uppercase tracking-[0.12em] text-fg-tertiary";function jt({id:t}){const a=Z(),o=ae.useNavigate(),i=m.useRef(null),r=m.useRef(null),n=m.useRef(I()),{data:s}=X({queryKey:w.notes.detail(t),queryFn:async()=>{const u=await Ae(t);if(u.type==="error")throw u;return u.note},gcTime:0}),[l,c]=m.useState(s.title),[C,h]=m.useState(()=>G(s.updatedAt)),[y,v]=m.useState(s.pinned),[x,k]=m.useState(s.layout||"wide"),[A,M]=m.useState(!1),[$,D]=m.useState(!1),[f,p]=$e(1e3);m.useEffect(()=>{c(s.title),v(s.pinned),k(s.layout||"wide"),h(G(s.updatedAt))},[s.layout,s.pinned,s.title,s.updatedAt]),m.useEffect(()=>{n.current=I()},[t]);const d=async({title:u="",content:b=""})=>{p(async()=>{const _=await Q({id:t,title:u,content:b,editSessionId:n.current});if(_.type==="error"){a(_.errors[0].message);return}c(u),h(N().format("YYYY-MM-DD HH:mm:ss"))})},g=()=>{d({title:l,content:i.current?.getContent()})},S=u=>{c(u),d({title:u,content:i.current?.getContent()})},H=async u=>{const b=await Q({id:t,layout:u,editSessionId:n.current});if(b.type==="error"){a(b.errors[0].message);return}k(u),a("Layout has been updated.")},{onCreate:re,onDelete:oe,onPinned:ie}=He();return e.jsx(B,{title:l,variant:"none",children:e.jsxs("main",{className:`mx-auto ${bt[x]}`,children:[e.jsxs("div",{style:{zIndex:"1001"},className:"surface-floating sticky top-20 mb-8 px-5 py-4",children:[e.jsxs("div",{className:"mb-3 flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"mb-1 text-[0.625rem] font-semibold uppercase tracking-[0.16em] text-fg-tertiary",children:"Thought in progress"}),e.jsx("input",{ref:r,placeholder:"Title",className:"w-full bg-transparent text-[1.4rem] font-semibold tracking-[-0.02em] outline-none",type:"text",value:l,onChange:u=>S(u.target.value)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(te,{button:e.jsxs("button",{type:"button",className:"focus-ring-soft inline-flex h-9 w-9 items-center justify-center rounded-[12px] border border-transparent bg-transparent text-fg-tertiary outline-none transition-colors hover:border-border-subtle hover:bg-hover-subtle hover:text-fg-default",children:[e.jsx(se,{className:"h-5 w-5"}),e.jsx("span",{className:"sr-only",children:"Note actions"})]}),items:[{name:y?"Unpin":"Pin",onClick:()=>ie(t,y,()=>{v(u=>!u)})},{name:"Change layout",onClick:()=>M(!0)},{type:"separator"},{name:"Clone this note",onClick:()=>re(r.current?.value||"untitled",i.current?.getContent()||"",x)},{name:"Restore previous version",onClick:()=>D(!0)},{type:"separator"},{name:"Delete",onClick:()=>oe(t,()=>{o({to:Ee,search:{page:1}})})}]}),e.jsx(R,{size:"sm",variant:"ghost",isLoading:f,onClick:g,children:"Save"})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[y&&e.jsxs("span",{className:`inline-flex items-center gap-1.5 ${W}`,children:[e.jsx(Oe,{className:"h-3 w-3",weight:"fill"}),"Pinned"]}),y&&e.jsx("span",{className:Ze("h-1 w-1 rounded-full bg-border-secondary")}),e.jsxs("span",{className:W,children:["Saved ",C]})]})]}),e.jsx(pt,{ref:i,content:s.content,onChange:g},`${t}:${s.updatedAt}`),e.jsx(Y,{fallback:e.jsx(T,{className:"mb-5",height:"80px"}),errorTitle:"Failed to load reminders",errorDescription:"Retry loading reminder details for this note.",renderError:({error:u,retry:b})=>e.jsx(F,{title:"Failed to load reminders",description:"Retry loading reminder details for this note.",error:u,onRetry:b,showBackAction:!1,showHomeAction:!1}),children:e.jsx(gt,{noteId:t})}),e.jsx(Y,{fallback:e.jsx(T,{height:"80px"}),errorTitle:"Failed to load back references",errorDescription:"Retry loading notes that link back here.",renderError:({error:u,retry:b})=>e.jsx(F,{title:"Failed to load back references",description:"Retry loading notes that link back here.",error:u,onRetry:b,showBackAction:!1,showHomeAction:!1}),children:e.jsx(Qe,{noteId:t,render:u=>u&&u.length>0&&e.jsxs("div",{className:"surface-base p-4",children:[e.jsx("p",{className:"mb-2 text-sm font-semibold",children:"Back References"}),e.jsx("ul",{className:"flex flex-col gap-1 text-sm",children:u.map(b=>e.jsx("li",{children:e.jsxs(U,{to:q,params:{id:b.id},className:"block rounded-[10px] px-2.5 py-1.5 text-fg-secondary transition-colors hover:bg-hover-subtle hover:text-fg-default",children:["- ",b.title]})},b.id))})]})})}),e.jsx(Ve,{isOpen:A,onClose:()=>M(!1),onSave:H,currentLayout:x}),e.jsx(We,{isOpen:$,noteId:t,onClose:()=>D(!1),onRestored:()=>{n.current=I()}})]})})}function Tt(){const{id:t}=ae.useParams();if(!t)throw new Error("Note id is required.");return e.jsx(Y,{fallback:yt,errorTitle:"Failed to load note",errorDescription:"Retry loading the note editor.",resetKeys:[t],renderError:({error:a,retry:o})=>e.jsx(B,{title:"Note",variant:"none",children:e.jsx(F,{title:"Failed to load note",description:"Retry loading the note editor.",error:a,onRetry:o})}),children:e.jsx(jt,{id:t},t)})}export{Tt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t}from"./note-vendor-BofYbzmZ.js";import{p as E,D as b,m as N,L as v,N as w,B as R,n as F,d as c,P as D,Q as T,E as $,f as S,S as d,e as k,R as C}from"./index-40Y2UsVr.js";import{a as e}from"./graph-vendor-CUxe67Lr.js";import{u as I,R as O}from"./useReminderMutate-1YVndM2T.js";import{p as L}from"./color-wpu7wT_s.js";import"./note-core-BCgMq5QA.js";const U=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm68-84a12,12,0,0,1-12,12H128a12,12,0,0,1-12-12V72a12,12,0,0,1,24,0v44h44A12,12,0,0,1,196,128Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),e.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm56,112H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm62-90a6,6,0,0,1-6,6H128a6,6,0,0,1-6-6V72a6,6,0,0,1,12,0v50h50A6,6,0,0,1,190,128Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm60-92a4,4,0,0,1-4,4H128a4,4,0,0,1-4-4V72a4,4,0,0,1,8,0v52h52A4,4,0,0,1,188,128Z"}))]]),z=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M216.49,79.52l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40V216a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V88A12,12,0,0,0,216.49,79.52ZM160,57l23,23H160ZM60,212V44h76V92a12,12,0,0,0,12,12h48V212Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),e.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM152,88V44l44,44Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40V216a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM200,220H56a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52V216A4,4,0,0,1,200,220Z"}))]]),H=e.forwardRef((a,n)=>e.createElement(E,{ref:n,...a,weights:U}));H.displayName="ClockIcon";const P=H,Z=e.forwardRef((a,n)=>e.createElement(E,{ref:n,...a,weights:z}));Z.displayName="FileIcon";const Y=Z;function B({reminder:a,onUpdate:n,onDelete:h}){const u=g=>{const s=c(Number(g)),o=c();return s.isSame(o,"day")?`Today at ${s.format("HH:mm")}`:s.isSame(o.add(1,"day"),"day")?`Tomorrow at ${s.format("HH:mm")}`:s.format("YYYY-MM-DD HH:mm")},r=g=>{const s=c(Number(g)),o=c(),f=s.diff(o,"hour"),x=s.diff(o,"minute")%60;return f<0||x<0?"Overdue":f===0?`${x}m remaining`:`${f}h ${x}m remaining`},m=r(a.reminderDate)==="Overdue",l=a.priority||"low",i=l==="high"?"High":l==="medium"?"Medium":"Low",p=`${L[l]} text-fg-default`,j=a.noteId.toString(),M=m?"text-fg-error":"text-fg-tertiary",V=a.content?.trim()||a.note?.title||"Untitled reminder",y=a.note?.title||"Untitled note";return t.jsxs("div",{className:"surface-base flex flex-col gap-4 p-4",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsx("div",{className:"min-w-0 flex-1",children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5 text-xs font-medium text-fg-tertiary",children:[t.jsx("span",{className:`h-2.5 w-2.5 rounded-full border border-border-subtle ${p}`}),i]}),t.jsx("p",{className:"min-w-0 line-clamp-2 text-base font-semibold leading-6 text-fg-default",children:V})]})}),t.jsx(b,{button:t.jsxs("button",{type:"button",className:"focus-ring-soft inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-[10px] border border-transparent bg-transparent text-fg-tertiary outline-none transition-colors hover:border-border-subtle hover:bg-hover-subtle hover:text-fg-default",children:[t.jsx(N,{className:"h-5 w-5 text-current"}),t.jsx("span",{className:"sr-only",children:"Reminder actions"})]}),items:[{name:"Delete",onClick:()=>h(a.id,j)}]})]}),t.jsxs("div",{className:"flex items-center gap-2 text-sm text-fg-secondary",children:[t.jsx(Y,{size:14}),t.jsx(v,{to:w,params:{id:String(a.note?.id??a.noteId)},className:"truncate transition-colors hover:text-fg-default hover:underline",children:y})]}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm text-fg-secondary",children:[t.jsx(P,{size:14}),t.jsx("span",{className:"font-medium",children:u(a.reminderDate)}),t.jsx("span",{className:"h-1 w-1 rounded-full bg-border-secondary"}),t.jsx("span",{className:`text-xs font-medium ${M}`,children:r(a.reminderDate)})]}),t.jsxs(R,{variant:"subtle",size:"sm",onClick:()=>n(a.id,j,{completed:!0}),children:[t.jsx(F,{size:14}),"Complete"]})]})]})}const A=k(C);function W(){const a=A.useNavigate(),{page:n}=A.useSearch(),{onUpdate:h,onDelete:u}=I(),r=25;return t.jsx(D,{title:"Reminders",description:"Manage all your note reminders in one place",children:t.jsx(T,{fallback:t.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[t.jsx(d,{height:"60px"}),t.jsx(d,{height:"60px"}),t.jsx(d,{height:"60px"}),t.jsx(d,{height:"60px"})]}),errorTitle:"Failed to load reminders",errorDescription:"Retry loading the upcoming reminder list.",resetKeys:[n,r],children:t.jsx(O,{searchParams:{offset:(n-1)*r,limit:r},render:({reminders:m,totalCount:l})=>m.length===0?t.jsx($,{title:"No upcoming reminders",description:"Add reminders to your notes to see them here"}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:m.map(i=>t.jsx(B,{reminder:i,onUpdate:h,onDelete:u},i.id))}),l&&r<l&&t.jsx(S,{page:n,last:Math.ceil(l/r),onChange:i=>{a({search:p=>({...p,page:i})})}})]})})})})}export{W as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as a}from"./note-vendor-BofYbzmZ.js";function t({children:r,className:s=""}){return a.jsx("div",{className:`surface-base ${s}`.trim(),children:r})}export{t as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./note-vendor-BofYbzmZ.js";import{k as h,a4 as x,q as f,a0 as p,P as y,Q as j,F as d,a5 as P,f as N,E as T,S as l,e as k,w as q}from"./index-40Y2UsVr.js";import"./graph-vendor-CUxe67Lr.js";import"./note-core-BCgMq5QA.js";const v=a=>{const{data:i}=h({queryKey:f.notes.tagList(a.searchParams),async queryFn(){const s=await x({query:a.searchParams.query,offset:a.searchParams.offset,limit:a.searchParams.limit});if(s.type==="error")throw s;return s.tagNotes}});return a.render(i)},o=k(q);function S(){const a=o.useNavigate(),{id:i}=o.useParams(),{page:s}=o.useSearch(),r=25,{onDelete:m,onPinned:g}=p();return e.jsx(y,{title:"Tag",variant:"subtle",children:e.jsx(j,{fallback:e.jsxs("div",{className:"grid gap-6 mt-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))"},children:[e.jsx(l,{height:"112px"}),e.jsx(l,{height:"112px"}),e.jsx(l,{height:"112px"})]}),errorTitle:"Failed to load tagged notes",errorDescription:"Retry loading notes for this tag.",resetKeys:[i,s,r],children:e.jsx(v,{searchParams:{query:i,offset:(s-1)*r,limit:r},render:({notes:c,totalCount:n})=>e.jsx(d,{fallback:e.jsx(T,{title:"Ocean is calm",description:"Capture anything and make waves in the ocean!"}),children:c.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid gap-6 mt-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))"},children:c.map(t=>e.jsx(P,{...t,onPinned:()=>g(t.id,t.pinned),onDelete:()=>m(t.id)},t.id))}),e.jsx(d,{fallback:null,children:n&&r<n&&e.jsx(N,{page:s,last:Math.ceil(n/r),onChange:t=>{a({search:u=>({...u,page:t})})}})})]})})})})})}export{S as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const s={high:"bg-accent-soft-danger",medium:"bg-accent-soft-primary dark:bg-emphasis/70",low:"bg-accent-soft-success"};export{s as p};
|