ocean-brain 0.3.1 → 0.3.3
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 +6 -6
- package/package.json +1 -1
- package/server/client/dist/assets/Calendar-DyXzs5M3.js +25 -0
- package/server/client/dist/assets/Graph-C8K4PJOn.js +1 -0
- package/server/client/dist/assets/{Image.es-Dnn4SMzG.js → Image.es-CFTbON7k.js} +1 -1
- package/server/client/dist/assets/{ModalActionRow-B3vNjcDc.js → ModalActionRow-Hg6MY61u.js} +1 -1
- package/server/client/dist/assets/Note-BbgZvrC3.js +1 -0
- package/server/client/dist/assets/Reminders-jFhljND4.js +1 -0
- package/server/client/dist/assets/Search-X6QIR_m2.js +1 -0
- package/server/client/dist/assets/SurfaceCard-BV6y4bCo.js +1 -0
- package/server/client/dist/assets/Tag-Ba2Dw4gH.js +1 -0
- package/server/client/dist/assets/TagNotes-BRJv6sDI.js +1 -0
- package/server/client/dist/assets/{Trash.es-DLiHgjNo.js → Trash.es-CPtRLE0y.js} +1 -1
- package/server/client/dist/assets/{image.api-CjJgNbC0.js → image.api-Dsrx9S-G.js} +1 -1
- package/server/client/dist/assets/index-BglnLSet.js +205 -0
- package/server/client/dist/assets/index-CD2bFEqK.css +1 -0
- package/server/client/dist/assets/index-DpqKngJz.js +1 -0
- package/server/client/dist/assets/manage-image-C6Y_0M5H.js +1 -0
- package/server/client/dist/assets/manage-image-detail-Dv3xofpe.js +1 -0
- package/server/client/dist/assets/mcp-BijQkpfY.js +1 -0
- package/server/client/dist/assets/placeholder-MNsco0AT.js +34 -0
- package/server/client/dist/assets/trash-CiFJm_PK.js +1 -0
- package/server/client/dist/assets/useReminderMutate-yJak8FzP.js +82 -0
- package/server/client/dist/index.html +2 -2
- package/server/dist/modules/blocknote.js +106 -31
- package/server/dist/modules/blocknote.js.map +1 -1
- package/server/client/dist/assets/Calendar-DynpmB3D.js +0 -25
- package/server/client/dist/assets/Callout-tNHgPhLM.js +0 -1
- package/server/client/dist/assets/Graph-DMXLUfCv.js +0 -1
- package/server/client/dist/assets/Note-PDMuj62M.js +0 -1
- package/server/client/dist/assets/Reminders-ComtTLuN.js +0 -1
- package/server/client/dist/assets/Search-BJeZTbVu.js +0 -1
- package/server/client/dist/assets/SurfaceCard-DAcVMY4f.js +0 -1
- package/server/client/dist/assets/Tag-BuNCDGD5.js +0 -1
- package/server/client/dist/assets/TagNotes-ajFOP5pZ.js +0 -1
- package/server/client/dist/assets/index-CDrZmLC2.js +0 -1
- package/server/client/dist/assets/index-DAZMX8bQ.css +0 -1
- package/server/client/dist/assets/index-DqFkOWbi.js +0 -205
- package/server/client/dist/assets/manage-image-CVyZTDT_.js +0 -1
- package/server/client/dist/assets/manage-image-detail-Bp17tylS.js +0 -1
- package/server/client/dist/assets/mcp-BpD7VH-d.js +0 -1
- package/server/client/dist/assets/placeholder-DSf4QF4v.js +0 -34
- package/server/client/dist/assets/trash-Ceb17h_s.js +0 -1
- package/server/client/dist/assets/useReminderMutate-CzyOQ_VB.js +0 -82
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./note-vendor-BofYbzmZ.js";import{p as h,r as p,P as f,T as t,L as i,ac as M,g as o,a7 as u,ad as j,ae as v,af as E}from"./index-BglnLSet.js";import{a}from"./graph-vendor-CUxe67Lr.js";import{c as N,n as w}from"./Trash.es-CPtRLE0y.js";import{I as y}from"./Image.es-CFTbON7k.js";import"./note-core-BCgMq5QA.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"}))]]),T=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 F=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:T}));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(f,{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(F,{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:M,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:j,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: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(E,{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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./note-vendor-BofYbzmZ.js";import{t as v,q as x,ak as w,K as E,A,U as b,Q as T,P as o,E as _,L as G,al as M,T as R,B as S,l as P,i as l,j as k,ad as q}from"./index-BglnLSet.js";import"./graph-vendor-CUxe67Lr.js";import{I as K}from"./Image-ZxF459sC.js";import{S as f}from"./SurfaceCard-BV6y4bCo.js";import{f as L,d as Q}from"./image.api-Dsrx9S-G.js";import{c as C,n as D}from"./Trash.es-CPtRLE0y.js";import"./note-core-BCgMq5QA.js";const U=r=>{const{data:d}=v({queryKey:x.images.list(r.searchParams),async queryFn(){const i=await L({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,F=4,m=192,g=k(q),Z=()=>{const r=w(),d=E(),i=g.useNavigate(),{page:c}=g.useSearch(),{containerRef:p,limit:n}=A({minItemWidth:W,gap:B,rows:F}),j=b({mutationFn:Q,onSuccess:s=>{if(s.type==="error")throw s;d.invalidateQueries({queryKey:x.images.listAll(),exact:!1})}}),y=async s=>{await r("Are you really sure?")&&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(U,{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(K,{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(C,{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(D,{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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./note-vendor-BofYbzmZ.js";import{p as F,T as r,am as D,L as p,N as R,G as _,an as Z,ad as E,f as q,Q as B,j as G,al as L,ak as z,J as H,K,t as b,q as x,ao as O,U as v,ap as Q,aq as U,B as w,i as l}from"./index-BglnLSet.js";import{a as t}from"./graph-vendor-CUxe67Lr.js";import{I as P}from"./Image-ZxF459sC.js";import{S as g}from"./SurfaceCard-BV6y4bCo.js";import{a as $,d as J}from"./image.api-Dsrx9S-G.js";import{c as V,n as W}from"./Trash.es-CPtRLE0y.js";import{I as X}from"./Image.es-CFTbON7k.js";import"./note-core-BCgMq5QA.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=D(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=z(),i=H(),u=I.useNavigate(),d=K(),{data:o}=b({queryKey:x.images.detail(a),queryFn:async()=>{const s=await $(a);if(s.type==="error")throw s;return s.image}}),{data:m}=b({queryKey:x.images.notes(a),queryFn:async()=>{const s=await O(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 J(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 Q("heroBanner",o.url);if(s.type==="error")throw s;return s.cache.value},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"))}}),k=async()=>{!h||f.isPending||await n("Are you really sure?")&&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(P,{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(U,{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:k,children:[e.jsx(W,{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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./note-vendor-BofYbzmZ.js";import{ag as r,J as R,K as B,u as E,U as p,P as G,T as t,ah as J,B as M,_ as T,a0 as K,$ as U,a1 as O,a2 as w}from"./index-BglnLSet.js";import{a as h}from"./graph-vendor-CUxe67Lr.js";import{S as x}from"./SurfaceCard-BV6y4bCo.js";import"./note-core-BCgMq5QA.js";const D=async()=>{const{data:s}=await r.get("/api/mcp-admin/status");return s},z=async s=>{const{data:n}=await r.post("/api/mcp-admin/enabled",{enabled:s});return n},V=async()=>{const{data:s}=await r.post("/api/mcp-admin/token/rotate");return s},_=async()=>{const{data:s}=await r.post("/api/mcp-admin/token/revoke");return s},o=["mcp-admin","status"],$=s=>JSON.stringify({mcpServers:{"ocean-brain":{command:"npx",args:["-y","ocean-brain","mcp","--server",s,"--token-file","/path/to/token.txt"]}}},null,2),H=s=>JSON.stringify({mcpServers:{"ocean-brain":{command:"npx",args:["-y","ocean-brain","mcp","--server",s,"--token","your-token-here"]}}},null,2),se=()=>{const s=R(),n=B(),[c,S]=h.useState(()=>window.location.origin),[v,g]=h.useState(""),[k,P]=h.useState("token-file"),{data:y,isLoading:A}=E({queryKey:o,queryFn:D}),b=p({mutationFn:z,onSuccess:a=>{n.setQueryData(o,a),s(a.enabled?"MCP access enabled.":"MCP access disabled.")}}),j=p({mutationFn:V,onSuccess:async({token:a})=>{g(a),s("A new MCP token has been issued."),await n.invalidateQueries({queryKey:o})}}),f=p({mutationFn:_,onSuccess:a=>{g(""),n.setQueryData(o,a),s("The active MCP token has been revoked.")}}),l=y?.enabled??!1,d=y?.hasActiveToken??!1,F=!A&&!b.isPending,i="space-y-1",N="space-y-4.5",I="inline-flex items-center gap-3 rounded-[14px] border border-border-subtle bg-muted px-3 py-2",L="rounded-full border border-border-subtle bg-hover-subtle px-2.5 py-1",q="space-y-3 rounded-[16px] border border-border-subtle bg-surface px-4 py-3",Q="overflow-x-auto rounded-[14px] border border-border-subtle bg-surface px-4 py-3 text-xs text-fg-secondary",u={variant:"subheading",weight:"medium",tracking:"tight"},C="font-medium text-fg-tertiary",m=k==="token-file"?{title:"Token file",description:"Recommended. Keeps the token out of config.",snippet:$(c)}:{title:"Inline token",description:"Useful for quick local testing.",snippet:H(c)};return e.jsx(G,{title:"MCP",variant:"default",description:"Manage MCP access, tokens, and connection details",children:e.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[e.jsx(x,{tone:"elevated",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[e.jsxs("div",{className:i,children:[e.jsx(t,{as:"h2",...u,children:"MCP Access"}),e.jsx(t,{as:"p",variant:"meta",tone:"secondary",children:"Allow or block MCP requests at the server level."})]}),e.jsxs("div",{className:I,children:[e.jsx(t,{as:"span",variant:"meta",weight:"medium",tone:"secondary",children:l?"Enabled":"Disabled"}),e.jsx(J,{"aria-label":"Allow MCP access",checked:l,disabled:!F,onCheckedChange:()=>{b.mutate(!l)}})]})]})}),e.jsx(x,{tone:"elevated",children:e.jsxs("div",{className:N,children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:i,children:[e.jsx(t,{as:"h2",...u,children:"Token Management"}),e.jsx(t,{as:"p",variant:"meta",tone:"secondary",className:"max-w-[64ch]",children:"Ocean Brain supports one active MCP token at a time. Rotating immediately invalidates the previous one."})]}),e.jsx(t,{as:"span",variant:"meta",weight:"medium",tone:d?"secondary":"tertiary",className:L,children:d?"1 active token":"No active token"})]}),e.jsxs("div",{className:"flex flex-wrap gap-2.5",children:[e.jsx(M,{onClick:()=>j.mutate(void 0),isLoading:j.isPending,children:"Rotate token"}),e.jsx(M,{variant:"soft-danger",onClick:()=>f.mutate(),isLoading:f.isPending,disabled:!d,children:"Revoke token"})]}),v&&e.jsxs("div",{className:"space-y-2.5",children:[e.jsx(T,{htmlFor:"issued-mcp-token",className:C,children:"Issued token"}),e.jsx(K,{id:"issued-mcp-token",rows:3,readOnly:!0,value:v})]})]})}),e.jsx(x,{tone:"elevated",children:e.jsxs("div",{className:N,children:[e.jsxs("div",{className:i,children:[e.jsx(t,{as:"h2",...u,children:"Connection Guide"}),e.jsx(t,{as:"p",variant:"meta",tone:"secondary",children:"Connect your MCP client with either a token file or an inline token."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"mcp-server-url",className:C,children:"Server URL"}),e.jsx(U,{id:"mcp-server-url",value:c,onChange:a=>S(a.target.value)})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs(O,{type:"single",variant:"pills",size:"sm",value:k,onValueChange:a=>{(a==="token-file"||a==="inline-token")&&P(a)},children:[e.jsx(w,{value:"token-file",children:"Token file"}),e.jsx(w,{value:"inline-token",children:"Inline token"})]}),e.jsxs("div",{className:q,children:[e.jsxs("div",{className:i,children:[e.jsx(t,{as:"p",variant:"meta",weight:"semibold",children:m.title}),e.jsx(t,{as:"p",variant:"meta",tone:"secondary",children:m.description})]}),e.jsx("pre",{className:Q,children:m.snippet})]})]})]})})]})})};export{se as default};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import{j as e}from"./note-vendor-BofYbzmZ.js";import{p as Y,h as E,J as V,K as W,q as v,ar as ee,u as ae,U as M,P as te,T as s,a3 as se,as as j,at as N,B as C,w as le,M as m,_ as w,$ as b,F as ne,l as re,i as $,j as ce,ae as ie}from"./index-BglnLSet.js";import{a}from"./graph-vendor-CUxe67Lr.js";import{n as oe,M as de}from"./ModalActionRow-Hg6MY61u.js";import{S as D}from"./SurfaceCard-BV6y4bCo.js";import"./note-core-BCgMq5QA.js";const me=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M208,160H48l80-80Z",opacity:"0.2"}),a.createElement("path",{d:"M213.66,154.34l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,48,168H208a8,8,0,0,0,5.66-13.66ZM67.31,152,128,91.31,188.69,152Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M215.39,163.06A8,8,0,0,1,208,168H48a8,8,0,0,1-5.66-13.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,215.39,163.06Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M210.83,162.83a4,4,0,0,1-5.66,0L128,85.66,50.83,162.83a4,4,0,0,1-5.66-5.66l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,210.83,162.83Z"}))]]),O=a.forwardRef((l,c)=>a.createElement(Y,{ref:c,...l,weights:me}));O.displayName="CaretUpIcon";const he=O,k=["id","name","template","replacement","createdAt","updatedAt"],ue=new Set(k),pe=`query FetchPlaceholders(
|
|
2
|
+
$searchFilter: SearchFilterInput,
|
|
3
|
+
$pagination: PaginationInput
|
|
4
|
+
) {
|
|
5
|
+
allPlaceholders(
|
|
6
|
+
searchFilter: $searchFilter,
|
|
7
|
+
pagination: $pagination
|
|
8
|
+
) {
|
|
9
|
+
totalCount
|
|
10
|
+
placeholders {
|
|
11
|
+
__PLACEHOLDER_FIELDS__ }
|
|
12
|
+
}
|
|
13
|
+
}`,xe=l=>{const c=l&&l.length>0?l.filter(r=>ue.has(r)):k;return Array.from(new Set(c)).map(r=>" "+r).join(`
|
|
14
|
+
`)+`
|
|
15
|
+
`},ge=async({limit:l=25,offset:c=0,query:h="",fields:r}={})=>{const g=xe(r),i=pe.replace("__PLACEHOLDER_FIELDS__",g);return E(i,{searchFilter:{query:h},pagination:{limit:l,offset:c}})},ye=l=>E(`mutation CreatePlaceholder(
|
|
16
|
+
$name: String!,
|
|
17
|
+
$template: String!,
|
|
18
|
+
$replacement: String!
|
|
19
|
+
) {
|
|
20
|
+
createPlaceholder(
|
|
21
|
+
name: $name,
|
|
22
|
+
template: $template,
|
|
23
|
+
replacement: $replacement
|
|
24
|
+
) {
|
|
25
|
+
id
|
|
26
|
+
name
|
|
27
|
+
template
|
|
28
|
+
replacement
|
|
29
|
+
createdAt
|
|
30
|
+
updatedAt
|
|
31
|
+
}
|
|
32
|
+
}`,l),fe=l=>E(`mutation DeletePlaceholder($id: ID!) {
|
|
33
|
+
deletePlaceholder(id: $id)
|
|
34
|
+
}`,{id:l}),I=ce(ie),Pe=()=>{const l=V(),c=W(),h=I.useNavigate(),{page:r}=I.useSearch(),[g,i]=a.useState(!1),[y,H]=a.useState(!0),[n,u]=a.useState({name:"",template:"",replacement:""}),o=25,T=v.placeholders.list({limit:o,offset:(r-1)*o}),[P]=a.useState(ee),{data:d,isLoading:p}=ae({queryKey:T,queryFn:async()=>{const t=await ge({offset:(r-1)*o,limit:o});if(t.type==="error")throw t;return t.allPlaceholders}}),F=M({mutationFn:ye,onSuccess:async()=>{l("Placeholder added successfully"),i(!1),u({name:"",template:"",replacement:""}),await c.invalidateQueries({queryKey:v.placeholders.listAll(),exact:!1})}}),q=M({mutationFn:fe,onSuccess:async()=>{l("Placeholder deleted successfully"),await c.invalidateQueries({queryKey:v.placeholders.listAll(),exact:!1})}}),B=P.length,x=d?.totalCount??0,Z=d?.placeholders??[],f="font-medium text-fg-tertiary",L="leading-[1.2]",A="break-all leading-[1.2]",S="leading-[1.2]",_="flex flex-col gap-px",R="space-y-px",Q="focus-ring-soft inline-flex items-center gap-2 rounded-[12px] border border-transparent px-2.5 py-1.5 text-fg-tertiary outline-none transition-colors hover:bg-hover-subtle hover:text-fg-default",K="relative",U="absolute right-2 top-2",G="focus-ring-soft surface-base group flex flex-col items-center justify-center gap-0.5 px-4 py-4 text-center text-fg-secondary outline-none transition-colors hover:bg-hover-subtle hover:text-fg-default",X="inline-flex h-[34px] w-[34px] items-center justify-center rounded-full border border-border-subtle bg-surface text-current transition-colors group-hover:border-border-secondary/70",z=x>0?`Placeholders (${x})`:void 0;return e.jsxs(te,{title:"Placeholders",variant:"default",heading:p?e.jsx($,{width:244,height:24,className:"rounded-full"}):z,description:p?e.jsx($,{width:260,height:16,className:"rounded-full"}):"Create tokens that get replaced with values when you clone a note",children:[e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsxs("section",{className:"space-y-3 border-b border-border-subtle/80 pb-5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(s,{as:"p",variant:"body",weight:"medium",children:"System placeholders"}),e.jsx(s,{as:"p",variant:"meta",tone:"secondary",children:"Built-in tokens for date and time that are always available when cloning notes"})]}),e.jsxs("button",{type:"button",onClick:()=>H(!y),className:Q,children:[e.jsxs(s,{as:"span",variant:"meta",weight:"medium",tone:"secondary",children:[B," items"]}),y?e.jsx(he,{className:"h-4 w-4"}):e.jsx(se,{className:"h-4 w-4"})]})]}),y&&e.jsx("div",{className:"grid-auto-cards grid gap-5",children:P.map(t=>e.jsx(D,{children:e.jsxs("div",{className:_,children:[e.jsx(s,{as:"div",variant:"body",weight:"medium",className:L,children:t.name}),e.jsxs("div",{className:R,children:[e.jsxs(s,{as:"div",variant:"meta",weight:"medium",tone:"secondary",className:A,children:[j,t.template,N]}),e.jsxs(s,{as:"div",variant:"label",weight:"medium",tone:"tertiary",className:S,children:["Current value: ",t.replacement]})]})]})},t.name))})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(s,{as:"p",variant:"body",weight:"medium",children:"Custom placeholders"}),e.jsx(s,{as:"p",variant:"meta",tone:"secondary",children:"Custom tokens you define once and reuse whenever you clone a note"})]}),!p&&e.jsx(s,{as:"span",variant:"meta",weight:"medium",tone:"secondary",children:x===1?"1 item":`${x} items`})]}),!p&&e.jsxs("div",{className:"grid-auto-cards grid gap-5",children:[Z.map(t=>e.jsxs(D,{className:K,children:[e.jsx(C,{variant:"ghost",size:"icon-sm",className:U,onClick:()=>q.mutate(t.id.toString()),children:e.jsx(le,{className:"h-4 w-4"})}),e.jsxs("div",{className:_,children:[e.jsx(s,{as:"div",variant:"body",weight:"medium",className:`min-w-0 pr-8 ${L}`,children:t.name}),e.jsxs("div",{className:R,children:[e.jsxs(s,{as:"div",variant:"meta",weight:"medium",tone:"secondary",className:A,children:[j,t.template,N]}),e.jsxs(s,{as:"div",variant:"label",weight:"medium",tone:"tertiary",className:S,children:["Replaces with: ",t.replacement]})]})]})]},t.id)),e.jsxs("button",{type:"button",onClick:()=>i(!0),className:G,children:[e.jsx("span",{className:X,children:e.jsx(oe,{className:"h-4.5 w-4.5"})}),e.jsx(s,{as:"div",variant:"meta",weight:"medium",tone:"secondary",className:"text-current",children:"New custom"})]})]})]})]}),e.jsxs(m,{isOpen:g,onClose:()=>i(!1),children:[e.jsx(m.Header,{title:"Add Placeholder",onClose:()=>i(!1)}),e.jsxs(m.Body,{children:[e.jsx(m.Description,{className:"mb-4",children:"Create a token that swaps in a value when you clone a note"}),e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{htmlFor:"name",className:f,children:"Name"}),e.jsx(b,{id:"name",type:"text",value:n.name,onChange:t=>u({...n,name:t.target.value}),placeholder:"Description of this placeholder"}),e.jsx(s,{as:"p",variant:"meta",tone:"secondary",children:"A readable label so you can find this placeholder later"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{htmlFor:"template",className:f,children:"Placeholder"}),e.jsx(b,{id:"template",type:"text",value:n.template,onChange:t=>u({...n,template:t.target.value}),placeholder:"note_app"}),e.jsxs(s,{as:"p",variant:"meta",tone:"secondary",children:["Use it in a note as ",j,"your_placeholder",N]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{htmlFor:"replacement",className:f,children:"Replacement"}),e.jsx(b,{id:"replacement",type:"text",value:n.replacement,onChange:t=>u({...n,replacement:t.target.value}),placeholder:"Ocean Brain"}),e.jsx(s,{as:"p",variant:"meta",tone:"secondary",children:"This value is inserted when the placeholder is replaced during cloning"})]})]})]}),e.jsx(m.Footer,{children:e.jsxs(de,{children:[e.jsx(C,{variant:"ghost",onClick:()=>i(!1),children:"Cancel"}),e.jsx(C,{variant:"primary",isLoading:F.isPending,onClick:()=>{if(!n.name||!n.template||!n.replacement){l("All fields are required");return}F.mutate({name:n.name,template:n.template,replacement:n.replacement})},children:"Add"})]})})]}),e.jsx(ne,{fallback:null,children:d?.totalCount&&o<d.totalCount&&e.jsx(re,{page:r,last:Math.ceil(d.totalCount/o),onChange:t=>{h({search:J=>({...J,page:t})})}})})]})};export{Pe as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./note-vendor-BofYbzmZ.js";import{Q as j,j as N,a7 as v,K as w,J as T,t as b,ai as S,q as n,U as E,aj as C,N as R,P as m,E as q,T as h,a8 as D,B as K,l as P,i as t,d as Q}from"./index-BglnLSet.js";import"./graph-vendor-CUxe67Lr.js";import{S as g}from"./SurfaceCard-BV6y4bCo.js";import"./note-core-BCgMq5QA.js";const i=25,u=N(v),y=30,p=`Deleted notes stay here for ${y} days before permanent removal`,A=a=>Q(a).format("YYYY-MM-DD HH:mm"),_=()=>e.jsx(m,{title:"Trash",variant:"default",heading:e.jsx(t,{width:118,height:24,className:"rounded-full"}),description:e.jsx(t,{width:352,height:16,className:"rounded-full"}),children:e.jsx("div",{className:"grid gap-3",children:Array.from({length:3},(a,d)=>e.jsx(g,{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(t,{width:"40%",height:18,className:"rounded-full"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(t,{width:168,height:14,className:"rounded-full"}),e.jsx(t,{width:176,height:14,className:"rounded-full"})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(t,{width:56,height:24,className:"rounded-full"}),e.jsx(t,{width:72,height:24,className:"rounded-full"})]})]}),e.jsx(t,{width:92,height:32,className:"rounded-[12px]"})]})},d))})}),k=()=>{const{page:a}=u.useSearch(),d=u.useNavigate(),l=w(),x=T(),{data:r}=b({queryKey:n.notes.trash({limit:i,offset:(a-1)*i}),queryFn:async()=>{const s=await S({limit:i,offset:(a-1)*i});if(s.type==="error")throw s;return s.trashedNotes}}),c=E({mutationFn:C,onSuccess:async s=>{if(s.type==="error")throw s;await Promise.all([l.invalidateQueries({queryKey:n.notes.all(),exact:!1}),l.invalidateQueries({queryKey:n.tags.all(),exact:!1}),l.invalidateQueries({queryKey:n.reminders.all(),exact:!1}),l.invalidateQueries({queryKey:n.images.all(),exact:!1}),l.invalidateQueries({queryKey:["calendar"],exact:!1})]),x("The note has been restored."),d({to:R,params:{id:s.restoreTrashedNote.id}})},onError:()=>{x("Failed to restore the note.")}}),f=r.totalCount>0?`Trash (${r.totalCount})`:void 0;return r.notes.length===0?e.jsx(m,{title:"Trash",variant:"default",heading:f,description:p,children:e.jsx(q,{title:"Trash is empty",description:`Delete a note and you can restore it here for ${y} days before permanent removal`})}):e.jsx(m,{title:"Trash",variant:"default",heading:f,description:p,children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"grid gap-3",children:r.notes.map(s=>e.jsx(g,{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(h,{as:"h2",variant:"body",weight:"medium",className:"min-w-0 flex-1 break-words leading-[1.25]",children:s.title||"Untitled note"}),s.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(D,{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(h,{as:"div",variant:"meta",weight:"medium",tone:"secondary",children:["Deleted ",A(s.deletedAt)]})}),s.tagNames.length>0&&e.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:s.tagNames.map(o=>e.jsx(h,{as:"span",variant:"label",weight:"medium",tone:"tertiary",className:"rounded-full border border-border-subtle bg-hover-subtle px-2 py-0.5",children:o},`${s.id}-${o}`))})]}),e.jsx(K,{variant:"subtle",size:"sm",className:"self-start",isLoading:c.isPending&&c.variables===s.id,onClick:()=>c.mutate(s.id),children:"Restore"})]})},s.id))}),r.totalCount>i&&e.jsx(P,{page:a,last:Math.ceil(r.totalCount/i),onChange:s=>{d({search:o=>({...o,page:s})})}})]})})},F=()=>{const{page:a}=u.useSearch();return e.jsx(j,{fallback:e.jsx(_,{}),errorTitle:"Failed to load trash",errorDescription:"Retry loading deleted notes",resetKeys:[a],children:e.jsx(k,{})})};export{F as default};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import{j as y}from"./note-vendor-BofYbzmZ.js";import{h as u,t as f,q as n,J as R,K as $}from"./index-BglnLSet.js";import{a as l}from"./graph-vendor-CUxe67Lr.js";const g=(e={})=>({limit:e.limit??10,offset:e.offset??0}),D=async(e,t)=>u(`
|
|
2
|
+
query FetchNoteReminders($noteId: ID!, $pagination: PaginationInput) {
|
|
3
|
+
noteReminders(noteId: $noteId, pagination: $pagination) {
|
|
4
|
+
totalCount
|
|
5
|
+
reminders {
|
|
6
|
+
id
|
|
7
|
+
noteId
|
|
8
|
+
reminderDate
|
|
9
|
+
priority
|
|
10
|
+
content
|
|
11
|
+
completed
|
|
12
|
+
createdAt
|
|
13
|
+
updatedAt
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
`,{noteId:e,pagination:g(t)}),A=async e=>u(`
|
|
18
|
+
query FetchUpcomingReminders($pagination: PaginationInput) {
|
|
19
|
+
upcomingReminders(pagination: $pagination) {
|
|
20
|
+
totalCount
|
|
21
|
+
reminders {
|
|
22
|
+
id
|
|
23
|
+
noteId
|
|
24
|
+
reminderDate
|
|
25
|
+
priority
|
|
26
|
+
content
|
|
27
|
+
completed
|
|
28
|
+
createdAt
|
|
29
|
+
updatedAt
|
|
30
|
+
note {
|
|
31
|
+
id
|
|
32
|
+
title
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
`,{pagination:g(e)}),q=async e=>{const{noteId:t,reminderDate:a,priority:o="medium",content:i}=e;return u(`
|
|
38
|
+
mutation CreateReminder($noteId: ID!, $reminderDate: String!, $priority: ReminderPriority, $content: String) {
|
|
39
|
+
createReminder(
|
|
40
|
+
noteId: $noteId,
|
|
41
|
+
reminderDate: $reminderDate,
|
|
42
|
+
priority: $priority,
|
|
43
|
+
content: $content
|
|
44
|
+
) {
|
|
45
|
+
id
|
|
46
|
+
noteId
|
|
47
|
+
reminderDate
|
|
48
|
+
completed
|
|
49
|
+
priority
|
|
50
|
+
createdAt
|
|
51
|
+
updatedAt
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
`,{noteId:t,reminderDate:a.toISOString(),priority:o,content:i})},I=async({id:e,reminderDate:t,completed:a,priority:o,content:i})=>{const r={id:e};return t&&(r.reminderDate=t.toISOString()),a!==void 0&&(r.completed=a),o&&(r.priority=o),i!==void 0&&(r.content=i),u(`
|
|
55
|
+
mutation UpdateReminder(
|
|
56
|
+
$id: ID!,
|
|
57
|
+
$reminderDate: String,
|
|
58
|
+
$completed: Boolean,
|
|
59
|
+
$priority: ReminderPriority,
|
|
60
|
+
$content: String
|
|
61
|
+
) {
|
|
62
|
+
updateReminder(
|
|
63
|
+
id: $id,
|
|
64
|
+
reminderDate: $reminderDate,
|
|
65
|
+
completed: $completed,
|
|
66
|
+
priority: $priority,
|
|
67
|
+
content: $content
|
|
68
|
+
) {
|
|
69
|
+
id
|
|
70
|
+
noteId
|
|
71
|
+
reminderDate
|
|
72
|
+
completed
|
|
73
|
+
priority
|
|
74
|
+
createdAt
|
|
75
|
+
updatedAt
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
`,r)},x=async e=>u(`
|
|
79
|
+
mutation DeleteReminder($id: ID!) {
|
|
80
|
+
deleteReminder(id: $id)
|
|
81
|
+
}
|
|
82
|
+
`,{id:e});function P({noteId:e,searchParams:t,render:a}){const{data:o}=f({queryKey:e?n.reminders.note(e,t):n.reminders.upcoming(t),queryFn:async()=>{if(e){const r=await D(e,t);if(r.type==="error")throw r;return r.noteReminders}const i=await A(t);if(i.type==="error")throw i;return i.upcomingReminders}});return y.jsx(y.Fragment,{children:a(o)})}function w(){const e=R(),t=$(),a=l.useCallback(async(r,m,d="medium",s,c)=>{const p=await q({noteId:r,reminderDate:m,priority:d,content:c});if(p.type==="error"){e(p.errors[0].message);return}await Promise.all([t.invalidateQueries({queryKey:n.reminders.noteAllPages(r),exact:!1}),t.invalidateQueries({queryKey:n.reminders.upcomingAllPages(),exact:!1}),t.invalidateQueries({queryKey:n.reminders.inDateRangeAll(),exact:!1})]),s&&s()},[t,e]),o=l.useCallback(async(r,m,d,s)=>{const c=await I({id:r,...d});if(c.type==="error"){e(c.errors[0].message);return}await Promise.all([t.invalidateQueries({queryKey:n.reminders.noteAllPages(m),exact:!1}),t.invalidateQueries({queryKey:n.reminders.upcomingAllPages(),exact:!1}),t.invalidateQueries({queryKey:n.reminders.inDateRangeAll(),exact:!1})]),s&&s()},[t,e]),i=l.useCallback(async(r,m,d)=>{const s=await x(r);if(s.type==="error"){e(s.errors[0].message);return}await Promise.all([t.invalidateQueries({queryKey:n.reminders.noteAllPages(m),exact:!1}),t.invalidateQueries({queryKey:n.reminders.upcomingAllPages(),exact:!1}),t.invalidateQueries({queryKey:n.reminders.inDateRangeAll(),exact:!1})]),d&&d()},[t,e]);return{onCreate:a,onUpdate:o,onDelete:i}}export{P as R,w as u};
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
<link rel="icon" type="image/png" href="/icon.png" />
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
8
|
<title>Ocean Brain</title>
|
|
9
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-BglnLSet.js"></script>
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/graph-vendor-CUxe67Lr.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/note-core-BCgMq5QA.js">
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/note-vendor-BofYbzmZ.js">
|
|
13
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
13
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CD2bFEqK.css">
|
|
14
14
|
</head>
|
|
15
15
|
|
|
16
16
|
<body>
|
|
@@ -4,6 +4,8 @@ import { ensureTagByName } from "./tag-organization.js";
|
|
|
4
4
|
const UNSUPPORTED_MARKDOWN_BLOCK_TYPES = /* @__PURE__ */ new Set([
|
|
5
5
|
"tableOfContents"
|
|
6
6
|
]);
|
|
7
|
+
const TAG_PLACEHOLDER_PREFIX = "OCEAN_BRAIN_TAG_";
|
|
8
|
+
const TAG_PLACEHOLDER_SUFFIX = "_TOKEN";
|
|
7
9
|
const defaultMarkdownImportDeps = {
|
|
8
10
|
ensureTag: async (name) => ensureTagByName(name),
|
|
9
11
|
findNotesByTitle: async (title) => {
|
|
@@ -28,10 +30,13 @@ function stripUnsupportedMarkdownBlocks(blocks) {
|
|
|
28
30
|
children: block.children?.length ? stripUnsupportedMarkdownBlocks(block.children) : []
|
|
29
31
|
}));
|
|
30
32
|
}
|
|
31
|
-
function
|
|
33
|
+
function createTagPlaceholder(index) {
|
|
34
|
+
return `${TAG_PLACEHOLDER_PREFIX}${index}${TAG_PLACEHOLDER_SUFFIX}`;
|
|
35
|
+
}
|
|
36
|
+
function preprocessCustomInlineContent(blocks, placeholderToTag, nextPlaceholderIndex) {
|
|
32
37
|
return blocks.map((block) => ({
|
|
33
38
|
...block,
|
|
34
|
-
content: block.content
|
|
39
|
+
content: Array.isArray(block.content) ? block.content.map((inline) => {
|
|
35
40
|
if (inline.type === "reference") {
|
|
36
41
|
return {
|
|
37
42
|
type: "text",
|
|
@@ -40,16 +45,68 @@ function preprocessCustomInlineContent(blocks) {
|
|
|
40
45
|
};
|
|
41
46
|
}
|
|
42
47
|
if (inline.type === "tag") {
|
|
43
|
-
const tag = inline.props?.tag
|
|
48
|
+
const tag = inline.props?.tag || "";
|
|
49
|
+
const placeholder = createTagPlaceholder(nextPlaceholderIndex.value++);
|
|
50
|
+
placeholderToTag.set(placeholder, tag);
|
|
44
51
|
return {
|
|
45
52
|
type: "text",
|
|
46
|
-
text:
|
|
53
|
+
text: placeholder,
|
|
47
54
|
styles: {}
|
|
48
55
|
};
|
|
49
56
|
}
|
|
50
57
|
return inline;
|
|
51
|
-
}),
|
|
52
|
-
children: block.children?.length ? preprocessCustomInlineContent(block.children) : []
|
|
58
|
+
}) : block.content,
|
|
59
|
+
children: block.children?.length ? preprocessCustomInlineContent(block.children, placeholderToTag, nextPlaceholderIndex) : []
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
62
|
+
function restoreTagPlaceholdersInMarkdown(markdown, placeholderToTag) {
|
|
63
|
+
let restoredMarkdown = markdown;
|
|
64
|
+
for (const [placeholder, tag] of placeholderToTag.entries()) {
|
|
65
|
+
restoredMarkdown = restoredMarkdown.split(placeholder).join(`[${tag}]`);
|
|
66
|
+
}
|
|
67
|
+
return restoredMarkdown;
|
|
68
|
+
}
|
|
69
|
+
function preprocessMarkdownExplicitTags(markdown) {
|
|
70
|
+
const placeholderToTag = /* @__PURE__ */ new Map();
|
|
71
|
+
let nextPlaceholderIndex = 0;
|
|
72
|
+
const preprocessedMarkdown = markdown.replace(/\[([@#][^\s[\]]+)\]/g, (_match, tagToken) => {
|
|
73
|
+
const placeholder = createTagPlaceholder(nextPlaceholderIndex++);
|
|
74
|
+
placeholderToTag.set(placeholder, tagToken);
|
|
75
|
+
return placeholder;
|
|
76
|
+
});
|
|
77
|
+
return {
|
|
78
|
+
markdown: preprocessedMarkdown,
|
|
79
|
+
placeholderToTag
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function findTagPlaceholderAtCursor(text, cursor, placeholderToTag) {
|
|
83
|
+
for (const [placeholder, tagToken] of placeholderToTag.entries()) {
|
|
84
|
+
if (text.startsWith(placeholder, cursor)) {
|
|
85
|
+
return {
|
|
86
|
+
placeholder,
|
|
87
|
+
tagToken
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
function restoreRemainingTagPlaceholders(blocks, placeholderToTag) {
|
|
94
|
+
return blocks.map((block) => ({
|
|
95
|
+
...block,
|
|
96
|
+
content: Array.isArray(block.content) ? block.content.map((inline) => {
|
|
97
|
+
if (inline.type !== "text" || typeof inline.text !== "string") {
|
|
98
|
+
return inline;
|
|
99
|
+
}
|
|
100
|
+
let text = inline.text;
|
|
101
|
+
for (const [placeholder, tagToken] of placeholderToTag.entries()) {
|
|
102
|
+
text = text.split(placeholder).join(`[${tagToken}]`);
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
...inline,
|
|
106
|
+
text
|
|
107
|
+
};
|
|
108
|
+
}) : block.content,
|
|
109
|
+
children: block.children?.length ? restoreRemainingTagPlaceholders(block.children, placeholderToTag) : []
|
|
53
110
|
}));
|
|
54
111
|
}
|
|
55
112
|
function createTextInline(text, styles = {}) {
|
|
@@ -67,17 +124,18 @@ function appendInline(target, inline) {
|
|
|
67
124
|
}
|
|
68
125
|
target.push(inline);
|
|
69
126
|
}
|
|
70
|
-
async function restoreCustomInlineContent(blocks, deps) {
|
|
127
|
+
async function restoreCustomInlineContent(blocks, deps, placeholderToTag) {
|
|
71
128
|
const tagCache = /* @__PURE__ */ new Map();
|
|
72
129
|
const noteCache = /* @__PURE__ */ new Map();
|
|
73
130
|
const getTag = (token) => {
|
|
74
|
-
|
|
131
|
+
const normalizedToken = token.startsWith("#") ? `@${token.slice(1)}` : token;
|
|
132
|
+
let existing = tagCache.get(normalizedToken);
|
|
75
133
|
if (!existing) {
|
|
76
|
-
existing = deps.ensureTag(
|
|
134
|
+
existing = deps.ensureTag(normalizedToken.slice(1)).then((result) => ({
|
|
77
135
|
id: "tag" in result ? result.tag.id : result.id,
|
|
78
136
|
tag: "tag" in result ? result.tag.name : result.name
|
|
79
137
|
}));
|
|
80
|
-
tagCache.set(
|
|
138
|
+
tagCache.set(normalizedToken, existing);
|
|
81
139
|
}
|
|
82
140
|
return existing;
|
|
83
141
|
};
|
|
@@ -115,22 +173,26 @@ async function restoreCustomInlineContent(blocks, deps) {
|
|
|
115
173
|
}
|
|
116
174
|
}
|
|
117
175
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
176
|
+
const tagPlaceholderMatch = findTagPlaceholderAtCursor(inline.text, cursor, placeholderToTag);
|
|
177
|
+
if (tagPlaceholderMatch) {
|
|
178
|
+
const tag = await getTag(tagPlaceholderMatch.tagToken);
|
|
179
|
+
appendInline(restored, {
|
|
180
|
+
type: "tag",
|
|
181
|
+
props: tag
|
|
182
|
+
});
|
|
183
|
+
cursor += tagPlaceholderMatch.placeholder.length;
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
let nextCursor = inline.text.length;
|
|
187
|
+
const nextReferenceCursor = inline.text.indexOf("[[", cursor + 1);
|
|
188
|
+
if (nextReferenceCursor !== -1) {
|
|
189
|
+
nextCursor = Math.min(nextCursor, nextReferenceCursor);
|
|
130
190
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
191
|
+
for (const placeholder of placeholderToTag.keys()) {
|
|
192
|
+
const nextPlaceholderCursor = inline.text.indexOf(placeholder, cursor + 1);
|
|
193
|
+
if (nextPlaceholderCursor !== -1) {
|
|
194
|
+
nextCursor = Math.min(nextCursor, nextPlaceholderCursor);
|
|
195
|
+
}
|
|
134
196
|
}
|
|
135
197
|
appendInline(restored, createTextInline(inline.text.slice(cursor, nextCursor), styles));
|
|
136
198
|
cursor = nextCursor;
|
|
@@ -141,7 +203,7 @@ async function restoreCustomInlineContent(blocks, deps) {
|
|
|
141
203
|
blocks.map(async (block) => ({
|
|
142
204
|
...block,
|
|
143
205
|
content: block.content ? (await Promise.all(block.content.map((inline) => restoreTextInline(inline)))).flat() : void 0,
|
|
144
|
-
children: block.children?.length ? await restoreCustomInlineContent(block.children, deps) : []
|
|
206
|
+
children: block.children?.length ? await restoreCustomInlineContent(block.children, deps, placeholderToTag) : []
|
|
145
207
|
}))
|
|
146
208
|
);
|
|
147
209
|
}
|
|
@@ -173,18 +235,31 @@ async function blocksToMarkdown(contentJson) {
|
|
|
173
235
|
try {
|
|
174
236
|
const blocks = JSON.parse(contentJson);
|
|
175
237
|
const supportedBlocks = stripUnsupportedMarkdownBlocks(blocks);
|
|
176
|
-
const
|
|
238
|
+
const placeholderToTag = /* @__PURE__ */ new Map();
|
|
239
|
+
const processed = preprocessCustomInlineContent(
|
|
240
|
+
supportedBlocks,
|
|
241
|
+
placeholderToTag,
|
|
242
|
+
{ value: 0 }
|
|
243
|
+
);
|
|
177
244
|
const editor = getEditor();
|
|
178
|
-
|
|
245
|
+
const markdown = await editor.blocksToMarkdownLossy(processed);
|
|
246
|
+
return restoreTagPlaceholdersInMarkdown(markdown, placeholderToTag);
|
|
179
247
|
} catch {
|
|
180
248
|
return "";
|
|
181
249
|
}
|
|
182
250
|
}
|
|
183
251
|
async function markdownToBlocksJson(markdown, deps = defaultMarkdownImportDeps) {
|
|
184
252
|
const editor = getEditor();
|
|
185
|
-
const
|
|
186
|
-
const
|
|
187
|
-
|
|
253
|
+
const preprocessedMarkdown = preprocessMarkdownExplicitTags(markdown);
|
|
254
|
+
const blocks = await editor.tryParseMarkdownToBlocks(preprocessedMarkdown.markdown);
|
|
255
|
+
const restoredBlocks = await restoreCustomInlineContent(
|
|
256
|
+
blocks,
|
|
257
|
+
deps,
|
|
258
|
+
preprocessedMarkdown.placeholderToTag
|
|
259
|
+
);
|
|
260
|
+
return JSON.stringify(
|
|
261
|
+
restoreRemainingTagPlaceholders(restoredBlocks, preprocessedMarkdown.placeholderToTag)
|
|
262
|
+
);
|
|
188
263
|
}
|
|
189
264
|
function extractTagIdsFromContentJson(contentJson) {
|
|
190
265
|
const blocks = JSON.parse(contentJson);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/modules/blocknote.ts"],"sourcesContent":["import { ServerBlockNoteEditor } from '@blocknote/server-util';\n\nimport models from '~/models.js';\nimport { ensureTagByName } from './tag-organization.js';\n\ninterface BlockNote {\n id?: string;\n type: string;\n props?: Record<string, unknown>;\n content?: BlockNoteInline[];\n children?: BlockNote[];\n text?: string;\n styles?: Record<string, unknown>;\n}\n\ninterface BlockNoteInline {\n type: string;\n props?: Record<string, unknown>;\n text?: string;\n styles?: Record<string, unknown>;\n}\n\ninterface MarkdownImportDeps {\n ensureTag: (name: string) => Promise<\n | {\n id: string;\n name: string;\n }\n | {\n tag: {\n id: string;\n name: string;\n };\n }\n >;\n findNotesByTitle: (title: string) => Promise<Array<{\n id: string;\n title: string;\n }>>;\n}\n\nconst UNSUPPORTED_MARKDOWN_BLOCK_TYPES = new Set([\n 'tableOfContents'\n]);\n\nconst defaultMarkdownImportDeps: MarkdownImportDeps = {\n ensureTag: async (name) => ensureTagByName(name),\n findNotesByTitle: async (title) => {\n const notes = await models.note.findMany({\n select: {\n id: true,\n title: true\n },\n where: { title },\n orderBy: { createdAt: 'asc' },\n take: 2\n });\n\n return notes.map((note) => ({\n id: String(note.id),\n title: note.title\n }));\n }\n};\n\nfunction stripUnsupportedMarkdownBlocks(blocks: BlockNote[]): BlockNote[] {\n return blocks\n .filter((block) => !UNSUPPORTED_MARKDOWN_BLOCK_TYPES.has(block.type))\n .map((block) => ({\n ...block,\n children: block.children?.length\n ? stripUnsupportedMarkdownBlocks(block.children)\n : []\n }));\n}\n\nfunction preprocessCustomInlineContent(blocks: BlockNote[]): BlockNote[] {\n return blocks.map((block) => ({\n ...block,\n content: block.content?.map((inline) => {\n if (inline.type === 'reference') {\n return {\n type: 'text',\n text: `[[${inline.props?.title || inline.props?.id || ''}]]`,\n styles: {}\n };\n }\n if (inline.type === 'tag') {\n const tag = (inline.props?.tag as string)?.replace(/^@/, '') || '';\n return {\n type: 'text',\n text: `#${tag}`,\n styles: {}\n };\n }\n return inline;\n }),\n children: block.children?.length\n ? preprocessCustomInlineContent(block.children)\n : []\n }));\n}\n\nfunction createTextInline(text: string, styles: Record<string, unknown> = {}): BlockNoteInline {\n return {\n type: 'text',\n text,\n styles\n };\n}\n\nfunction appendInline(target: BlockNoteInline[], inline: BlockNoteInline) {\n const previous = target.at(-1);\n\n if (\n previous?.type === 'text' &&\n inline.type === 'text' &&\n previous.text !== undefined &&\n inline.text !== undefined &&\n JSON.stringify(previous.styles ?? {}) === JSON.stringify(inline.styles ?? {})\n ) {\n previous.text += inline.text;\n return;\n }\n\n target.push(inline);\n}\n\nasync function restoreCustomInlineContent(\n blocks: BlockNote[],\n deps: MarkdownImportDeps\n): Promise<BlockNote[]> {\n const tagCache = new Map<string, Promise<{ id: string; tag: string }>>();\n const noteCache = new Map<string, Promise<Array<{ id: string; title: string }>>>();\n\n const getTag = (token: string) => {\n let existing = tagCache.get(token);\n\n if (!existing) {\n existing = deps.ensureTag(token.slice(1)).then((result) => ({\n id: 'tag' in result ? result.tag.id : result.id,\n tag: 'tag' in result ? result.tag.name : result.name\n }));\n tagCache.set(token, existing);\n }\n\n return existing;\n };\n\n const getNotesByTitle = (title: string) => {\n let existing = noteCache.get(title);\n\n if (!existing) {\n existing = deps.findNotesByTitle(title);\n noteCache.set(title, existing);\n }\n\n return existing;\n };\n\n const restoreTextInline = async (inline: BlockNoteInline): Promise<BlockNoteInline[]> => {\n if (\n inline.type !== 'text' ||\n typeof inline.text !== 'string' ||\n !inline.text ||\n inline.styles?.code === true\n ) {\n return [inline];\n }\n\n const restored: BlockNoteInline[] = [];\n const styles = inline.styles ?? {};\n let cursor = 0;\n\n while (cursor < inline.text.length) {\n if (\n inline.text.startsWith('[[', cursor)\n ) {\n const closeIndex = inline.text.indexOf(']]', cursor + 2);\n\n if (closeIndex !== -1) {\n const title = inline.text.slice(cursor + 2, closeIndex);\n const matchingNotes = await getNotesByTitle(title);\n\n if (matchingNotes.length === 1) {\n appendInline(restored, {\n type: 'reference',\n props: {\n id: matchingNotes[0].id,\n title: matchingNotes[0].title\n }\n });\n cursor = closeIndex + 2;\n continue;\n }\n }\n }\n\n if (\n inline.text[cursor] === '#' &&\n (cursor === 0 || /\\s/.test(inline.text[cursor - 1]))\n ) {\n const remainder = inline.text.slice(cursor);\n const tagMatch = remainder.match(/^#[^\\s[\\]]+/);\n\n if (tagMatch) {\n const tag = await getTag(tagMatch[0]);\n appendInline(restored, {\n type: 'tag',\n props: tag\n });\n cursor += tagMatch[0].length;\n continue;\n }\n }\n\n let nextCursor = cursor + 1;\n\n while (\n nextCursor < inline.text.length &&\n !inline.text.startsWith('[[', nextCursor) &&\n !(\n inline.text[nextCursor] === '#' &&\n /\\s/.test(inline.text[nextCursor - 1] ?? '')\n )\n ) {\n nextCursor += 1;\n }\n\n appendInline(restored, createTextInline(inline.text.slice(cursor, nextCursor), styles));\n cursor = nextCursor;\n }\n\n return restored;\n };\n\n return Promise.all(\n blocks.map(async (block) => ({\n ...block,\n content: block.content\n ? (await Promise.all(block.content.map((inline) => restoreTextInline(inline)))).flat()\n : undefined,\n children: block.children?.length\n ? await restoreCustomInlineContent(block.children, deps)\n : []\n }))\n );\n}\n\nfunction collectTagIds(blocks: BlockNote[]): string[] {\n const tagIds = new Set<string>();\n\n const visit = (items: BlockNote[]) => {\n for (const block of items) {\n for (const inline of block.content ?? []) {\n if (inline.type === 'tag' && typeof inline.props?.id === 'string') {\n tagIds.add(inline.props.id);\n }\n }\n\n if (block.children?.length) {\n visit(block.children);\n }\n }\n };\n\n visit(blocks);\n return [...tagIds];\n}\n\nlet editorInstance: ServerBlockNoteEditor | null = null;\n\nfunction getEditor(): ServerBlockNoteEditor {\n if (!editorInstance) {\n editorInstance = ServerBlockNoteEditor.create();\n }\n return editorInstance;\n}\n\nexport async function blocksToMarkdown(contentJson: string): Promise<string> {\n try {\n const blocks = JSON.parse(contentJson);\n const supportedBlocks = stripUnsupportedMarkdownBlocks(blocks);\n const processed = preprocessCustomInlineContent(supportedBlocks);\n const editor = getEditor();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return await editor.blocksToMarkdownLossy(processed as any);\n } catch {\n return '';\n }\n}\n\nexport async function markdownToBlocksJson(\n markdown: string,\n deps: MarkdownImportDeps = defaultMarkdownImportDeps\n): Promise<string> {\n const editor = getEditor();\n const blocks = await editor.tryParseMarkdownToBlocks(markdown);\n const restoredBlocks = await restoreCustomInlineContent(blocks as BlockNote[], deps);\n return JSON.stringify(restoredBlocks);\n}\n\nexport function extractTagIdsFromContentJson(contentJson: string): string[] {\n const blocks = JSON.parse(contentJson) as BlockNote[];\n return collectTagIds(blocks);\n}\n"],"mappings":"AAAA,SAAS,6BAA6B;AAEtC,OAAO,YAAY;AACnB,SAAS,uBAAuB;AAsChC,MAAM,mCAAmC,oBAAI,IAAI;AAAA,EAC7C;AACJ,CAAC;AAED,MAAM,4BAAgD;AAAA,EAClD,WAAW,OAAO,SAAS,gBAAgB,IAAI;AAAA,EAC/C,kBAAkB,OAAO,UAAU;AAC/B,UAAM,QAAQ,MAAM,OAAO,KAAK,SAAS;AAAA,MACrC,QAAQ;AAAA,QACJ,IAAI;AAAA,QACJ,OAAO;AAAA,MACX;AAAA,MACA,OAAO,EAAE,MAAM;AAAA,MACf,SAAS,EAAE,WAAW,MAAM;AAAA,MAC5B,MAAM;AAAA,IACV,CAAC;AAED,WAAO,MAAM,IAAI,CAAC,UAAU;AAAA,MACxB,IAAI,OAAO,KAAK,EAAE;AAAA,MAClB,OAAO,KAAK;AAAA,IAChB,EAAE;AAAA,EACN;AACJ;AAEA,SAAS,+BAA+B,QAAkC;AACtE,SAAO,OACF,OAAO,CAAC,UAAU,CAAC,i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;AAE/B,QAAM,QAAQ,CAAC,UAAuB;AAClC,eAAW,SAAS,OAAO;AACvB,iBAAW,UAAU,MAAM,WAAW,CAAC,GAAG;AACtC,YAAI,OAAO,SAAS,SAAS,OAAO,OAAO,OAAO,OAAO,UAAU;AAC/D,iBAAO,IAAI,OAAO,MAAM,EAAE;AAAA,QAC9B;AAAA,MACJ;AAEA,UAAI,MAAM,UAAU,QAAQ;AACxB,cAAM,MAAM,QAAQ;AAAA,MACxB;AAAA,IACJ;AAAA,EACJ;AAEA,QAAM,MAAM;AACZ,SAAO,CAAC,GAAG,MAAM;AACrB;AAEA,IAAI,iBAA+C;AAEnD,SAAS,YAAmC;AACxC,MAAI,CAAC,gBAAgB;AACjB,qBAAiB,sBAAsB,OAAO;AAAA,EAClD;AACA,SAAO;AACX;AAEA,eAAsB,iBAAiB,aAAsC;AACzE,MAAI;AACA,UAAM,SAAS,KAAK,MAAM,WAAW;AACrC,UAAM,kBAAkB,+BAA+B,MAAM;AAC7D,UAAM,YAAY,8BAA8B,eAAe;AAC/D,UAAM,SAAS,UAAU;AAEzB,WAAO,MAAM,OAAO,sBAAsB,SAAgB;AAAA,EAC9D,QAAQ;AACJ,WAAO;AAAA,EACX;AACJ;AAEA,eAAsB,qBAClB,UACA,OAA2B,2BACZ;AACf,QAAM,SAAS,UAAU;AACzB,QAAM,SAAS,MAAM,OAAO,yBAAyB,QAAQ;AAC7D,QAAM,iBAAiB,MAAM,2BAA2B,QAAuB,IAAI;AACnF,SAAO,KAAK,UAAU,cAAc;AACxC;AAEO,SAAS,6BAA6B,aAA+B;AACxE,QAAM,SAAS,KAAK,MAAM,WAAW;AACrC,SAAO,cAAc,MAAM;AAC/B;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/modules/blocknote.ts"],"sourcesContent":["import { ServerBlockNoteEditor } from '@blocknote/server-util';\n\nimport models from '~/models.js';\nimport { ensureTagByName } from './tag-organization.js';\n\ninterface BlockNote {\n id?: string;\n type: string;\n props?: Record<string, unknown>;\n content?: BlockNoteInline[];\n children?: BlockNote[];\n text?: string;\n styles?: Record<string, unknown>;\n}\n\ninterface BlockNoteInline {\n type: string;\n props?: Record<string, unknown>;\n text?: string;\n styles?: Record<string, unknown>;\n}\n\ninterface MarkdownImportDeps {\n ensureTag: (name: string) => Promise<\n | {\n id: string;\n name: string;\n }\n | {\n tag: {\n id: string;\n name: string;\n };\n }\n >;\n findNotesByTitle: (title: string) => Promise<Array<{\n id: string;\n title: string;\n }>>;\n}\n\nconst UNSUPPORTED_MARKDOWN_BLOCK_TYPES = new Set([\n 'tableOfContents'\n]);\nconst TAG_PLACEHOLDER_PREFIX = 'OCEAN_BRAIN_TAG_';\nconst TAG_PLACEHOLDER_SUFFIX = '_TOKEN';\n\nconst defaultMarkdownImportDeps: MarkdownImportDeps = {\n ensureTag: async (name) => ensureTagByName(name),\n findNotesByTitle: async (title) => {\n const notes = await models.note.findMany({\n select: {\n id: true,\n title: true\n },\n where: { title },\n orderBy: { createdAt: 'asc' },\n take: 2\n });\n\n return notes.map((note) => ({\n id: String(note.id),\n title: note.title\n }));\n }\n};\n\nfunction stripUnsupportedMarkdownBlocks(blocks: BlockNote[]): BlockNote[] {\n return blocks\n .filter((block) => !UNSUPPORTED_MARKDOWN_BLOCK_TYPES.has(block.type))\n .map((block) => ({\n ...block,\n children: block.children?.length\n ? stripUnsupportedMarkdownBlocks(block.children)\n : []\n }));\n}\n\nfunction createTagPlaceholder(index: number) {\n return `${TAG_PLACEHOLDER_PREFIX}${index}${TAG_PLACEHOLDER_SUFFIX}`;\n}\n\nfunction preprocessCustomInlineContent(\n blocks: BlockNote[],\n placeholderToTag: Map<string, string>,\n nextPlaceholderIndex: { value: number }\n): BlockNote[] {\n return blocks.map((block) => ({\n ...block,\n content: Array.isArray(block.content)\n ? block.content.map((inline) => {\n if (inline.type === 'reference') {\n return {\n type: 'text',\n text: `[[${inline.props?.title || inline.props?.id || ''}]]`,\n styles: {}\n };\n }\n if (inline.type === 'tag') {\n const tag = (inline.props?.tag as string) || '';\n const placeholder = createTagPlaceholder(nextPlaceholderIndex.value++);\n placeholderToTag.set(placeholder, tag);\n return {\n type: 'text',\n text: placeholder,\n styles: {}\n };\n }\n return inline;\n })\n : block.content,\n children: block.children?.length\n ? preprocessCustomInlineContent(block.children, placeholderToTag, nextPlaceholderIndex)\n : []\n }));\n}\n\nfunction restoreTagPlaceholdersInMarkdown(markdown: string, placeholderToTag: Map<string, string>) {\n let restoredMarkdown = markdown;\n\n for (const [placeholder, tag] of placeholderToTag.entries()) {\n restoredMarkdown = restoredMarkdown.split(placeholder).join(`[${tag}]`);\n }\n\n return restoredMarkdown;\n}\n\nfunction preprocessMarkdownExplicitTags(markdown: string) {\n const placeholderToTag = new Map<string, string>();\n let nextPlaceholderIndex = 0;\n const preprocessedMarkdown = markdown.replace(/\\[([@#][^\\s[\\]]+)\\]/g, (_match, tagToken: string) => {\n const placeholder = createTagPlaceholder(nextPlaceholderIndex++);\n placeholderToTag.set(placeholder, tagToken);\n return placeholder;\n });\n\n return {\n markdown: preprocessedMarkdown,\n placeholderToTag\n };\n}\n\nfunction findTagPlaceholderAtCursor(\n text: string,\n cursor: number,\n placeholderToTag: Map<string, string>\n) {\n for (const [placeholder, tagToken] of placeholderToTag.entries()) {\n if (text.startsWith(placeholder, cursor)) {\n return {\n placeholder,\n tagToken\n };\n }\n }\n\n return null;\n}\n\nfunction restoreRemainingTagPlaceholders(\n blocks: BlockNote[],\n placeholderToTag: Map<string, string>\n): BlockNote[] {\n return blocks.map((block) => ({\n ...block,\n content: Array.isArray(block.content)\n ? block.content.map((inline) => {\n if (inline.type !== 'text' || typeof inline.text !== 'string') {\n return inline;\n }\n\n let text = inline.text;\n\n for (const [placeholder, tagToken] of placeholderToTag.entries()) {\n text = text.split(placeholder).join(`[${tagToken}]`);\n }\n\n return {\n ...inline,\n text\n };\n })\n : block.content,\n children: block.children?.length\n ? restoreRemainingTagPlaceholders(block.children, placeholderToTag)\n : []\n }));\n}\n\nfunction createTextInline(text: string, styles: Record<string, unknown> = {}): BlockNoteInline {\n return {\n type: 'text',\n text,\n styles\n };\n}\n\nfunction appendInline(target: BlockNoteInline[], inline: BlockNoteInline) {\n const previous = target.at(-1);\n\n if (\n previous?.type === 'text' &&\n inline.type === 'text' &&\n previous.text !== undefined &&\n inline.text !== undefined &&\n JSON.stringify(previous.styles ?? {}) === JSON.stringify(inline.styles ?? {})\n ) {\n previous.text += inline.text;\n return;\n }\n\n target.push(inline);\n}\n\nasync function restoreCustomInlineContent(\n blocks: BlockNote[],\n deps: MarkdownImportDeps,\n placeholderToTag: Map<string, string>\n): Promise<BlockNote[]> {\n const tagCache = new Map<string, Promise<{ id: string; tag: string }>>();\n const noteCache = new Map<string, Promise<Array<{ id: string; title: string }>>>();\n\n const getTag = (token: string) => {\n const normalizedToken = token.startsWith('#')\n ? `@${token.slice(1)}`\n : token;\n let existing = tagCache.get(normalizedToken);\n\n if (!existing) {\n existing = deps.ensureTag(normalizedToken.slice(1)).then((result) => ({\n id: 'tag' in result ? result.tag.id : result.id,\n tag: 'tag' in result ? result.tag.name : result.name\n }));\n tagCache.set(normalizedToken, existing);\n }\n\n return existing;\n };\n\n const getNotesByTitle = (title: string) => {\n let existing = noteCache.get(title);\n\n if (!existing) {\n existing = deps.findNotesByTitle(title);\n noteCache.set(title, existing);\n }\n\n return existing;\n };\n\n const restoreTextInline = async (inline: BlockNoteInline): Promise<BlockNoteInline[]> => {\n if (\n inline.type !== 'text' ||\n typeof inline.text !== 'string' ||\n !inline.text ||\n inline.styles?.code === true\n ) {\n return [inline];\n }\n\n const restored: BlockNoteInline[] = [];\n const styles = inline.styles ?? {};\n let cursor = 0;\n\n while (cursor < inline.text.length) {\n if (inline.text.startsWith('[[', cursor)) {\n const closeIndex = inline.text.indexOf(']]', cursor + 2);\n\n if (closeIndex !== -1) {\n const title = inline.text.slice(cursor + 2, closeIndex);\n const matchingNotes = await getNotesByTitle(title);\n\n if (matchingNotes.length === 1) {\n appendInline(restored, {\n type: 'reference',\n props: {\n id: matchingNotes[0].id,\n title: matchingNotes[0].title\n }\n });\n cursor = closeIndex + 2;\n continue;\n }\n }\n }\n\n const tagPlaceholderMatch = findTagPlaceholderAtCursor(inline.text, cursor, placeholderToTag);\n\n if (tagPlaceholderMatch) {\n const tag = await getTag(tagPlaceholderMatch.tagToken);\n appendInline(restored, {\n type: 'tag',\n props: tag\n });\n cursor += tagPlaceholderMatch.placeholder.length;\n continue;\n }\n\n let nextCursor = inline.text.length;\n\n const nextReferenceCursor = inline.text.indexOf('[[', cursor + 1);\n\n if (nextReferenceCursor !== -1) {\n nextCursor = Math.min(nextCursor, nextReferenceCursor);\n }\n\n for (const placeholder of placeholderToTag.keys()) {\n const nextPlaceholderCursor = inline.text.indexOf(placeholder, cursor + 1);\n\n if (nextPlaceholderCursor !== -1) {\n nextCursor = Math.min(nextCursor, nextPlaceholderCursor);\n }\n }\n\n appendInline(restored, createTextInline(inline.text.slice(cursor, nextCursor), styles));\n cursor = nextCursor;\n }\n\n return restored;\n };\n\n return Promise.all(\n blocks.map(async (block) => ({\n ...block,\n content: block.content\n ? (await Promise.all(block.content.map((inline) => restoreTextInline(inline)))).flat()\n : undefined,\n children: block.children?.length\n ? await restoreCustomInlineContent(block.children, deps, placeholderToTag)\n : []\n }))\n );\n}\n\nfunction collectTagIds(blocks: BlockNote[]): string[] {\n const tagIds = new Set<string>();\n\n const visit = (items: BlockNote[]) => {\n for (const block of items) {\n for (const inline of block.content ?? []) {\n if (inline.type === 'tag' && typeof inline.props?.id === 'string') {\n tagIds.add(inline.props.id);\n }\n }\n\n if (block.children?.length) {\n visit(block.children);\n }\n }\n };\n\n visit(blocks);\n return [...tagIds];\n}\n\nlet editorInstance: ServerBlockNoteEditor | null = null;\n\nfunction getEditor(): ServerBlockNoteEditor {\n if (!editorInstance) {\n editorInstance = ServerBlockNoteEditor.create();\n }\n return editorInstance;\n}\n\nexport async function blocksToMarkdown(contentJson: string): Promise<string> {\n try {\n const blocks = JSON.parse(contentJson);\n const supportedBlocks = stripUnsupportedMarkdownBlocks(blocks);\n const placeholderToTag = new Map<string, string>();\n const processed = preprocessCustomInlineContent(\n supportedBlocks,\n placeholderToTag,\n { value: 0 }\n );\n const editor = getEditor();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const markdown = await editor.blocksToMarkdownLossy(processed as any);\n return restoreTagPlaceholdersInMarkdown(markdown, placeholderToTag);\n } catch {\n return '';\n }\n}\n\nexport async function markdownToBlocksJson(\n markdown: string,\n deps: MarkdownImportDeps = defaultMarkdownImportDeps\n): Promise<string> {\n const editor = getEditor();\n const preprocessedMarkdown = preprocessMarkdownExplicitTags(markdown);\n const blocks = await editor.tryParseMarkdownToBlocks(preprocessedMarkdown.markdown);\n const restoredBlocks = await restoreCustomInlineContent(\n blocks as BlockNote[],\n deps,\n preprocessedMarkdown.placeholderToTag\n );\n return JSON.stringify(\n restoreRemainingTagPlaceholders(restoredBlocks, preprocessedMarkdown.placeholderToTag)\n );\n}\n\nexport function extractTagIdsFromContentJson(contentJson: string): string[] {\n const blocks = JSON.parse(contentJson) as BlockNote[];\n return collectTagIds(blocks);\n}\n"],"mappings":"AAAA,SAAS,6BAA6B;AAEtC,OAAO,YAAY;AACnB,SAAS,uBAAuB;AAsChC,MAAM,mCAAmC,oBAAI,IAAI;AAAA,EAC7C;AACJ,CAAC;AACD,MAAM,yBAAyB;AAC/B,MAAM,yBAAyB;AAE/B,MAAM,4BAAgD;AAAA,EAClD,WAAW,OAAO,SAAS,gBAAgB,IAAI;AAAA,EAC/C,kBAAkB,OAAO,UAAU;AAC/B,UAAM,QAAQ,MAAM,OAAO,KAAK,SAAS;AAAA,MACrC,QAAQ;AAAA,QACJ,IAAI;AAAA,QACJ,OAAO;AAAA,MACX;AAAA,MACA,OAAO,EAAE,MAAM;AAAA,MACf,SAAS,EAAE,WAAW,MAAM;AAAA,MAC5B,MAAM;AAAA,IACV,CAAC;AAED,WAAO,MAAM,IAAI,CAAC,UAAU;AAAA,MACxB,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EAAE,OAAO,EAAE;AAAA,IACf;AACA,UAAM,SAAS,UAAU;AAEzB,UAAM,WAAW,MAAM,OAAO,sBAAsB,SAAgB;AACpE,WAAO,iCAAiC,UAAU,gBAAgB;AAAA,EACtE,QAAQ;AACJ,WAAO;AAAA,EACX;AACJ;AAEA,eAAsB,qBAClB,UACA,OAA2B,2BACZ;AACf,QAAM,SAAS,UAAU;AACzB,QAAM,uBAAuB,+BAA+B,QAAQ;AACpE,QAAM,SAAS,MAAM,OAAO,yBAAyB,qBAAqB,QAAQ;AAClF,QAAM,iBAAiB,MAAM;AAAA,IACzB;AAAA,IACA;AAAA,IACA,qBAAqB;AAAA,EACzB;AACA,SAAO,KAAK;AAAA,IACR,gCAAgC,gBAAgB,qBAAqB,gBAAgB;AAAA,EACzF;AACJ;AAEO,SAAS,6BAA6B,aAA+B;AACxE,QAAM,SAAS,KAAK,MAAM,WAAW;AACrC,SAAO,cAAc,MAAM;AAC/B;","names":[]}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./note-vendor-BofYbzmZ.js";import{L as Z,N as ee,d as y,s as te,M as R,T as se,a as P,B as w,b as ne,c as re,u as q,q as F,g as z,P as ae,S as oe,e as le,C as ce}from"./index-DqFkOWbi.js";import{a as d}from"./graph-vendor-CUxe67Lr.js";import{C as ie}from"./Callout-tNHgPhLM.js";import"./note-core-BCgMq5QA.js";const de=({day:n,cellClassName:t,dayNumberClassName:s,isCurrentMonth:l,items:o,overflowCount:c,onOpenOverflow:m})=>e.jsxs("div",{className:`min-h-[200px] rounded-[14px] border p-2 ${t}`.trim(),children:[e.jsx("div",{className:"mb-2 flex justify-end",children:e.jsx("span",{className:`flex h-6 w-6 items-center justify-center rounded-[8px] text-label ${s}`.trim(),children:n})}),l&&o.length>0?e.jsxs("div",{className:"flex flex-col gap-1",children:[o,c>0?e.jsxs("button",{type:"button",onClick:m,className:"text-micro rounded-[10px] py-1 text-center font-semibold text-fg-tertiary transition-colors hover:bg-hover-subtle hover:text-fg-muted",children:["+",c," more"]}):null]}):null]}),B=({params:n,toneClassName:t="",header:s,title:l,meta:o,titleClassName:c=""})=>e.jsx(Z,{to:ee,params:n,className:"group block",children:e.jsxs("div",{className:`rounded-[6px] bg-emphasis flex h-full flex-col justify-center px-1.5 py-0.5 transition-colors group-hover:bg-hover-subtle ${t}`.trim(),children:[e.jsxs("div",{className:`flex items-center gap-1 text-label line-clamp-1 font-semibold text-fg-default ${c}`.trim(),children:[s?e.jsx("span",{className:"shrink-0 text-fg-muted",children:s}):null,l]}),o?e.jsx("div",{className:"text-micro font-medium text-fg-secondary",children:o}):null]})}),ue=({note:n,type:t})=>e.jsx(B,{params:{id:n.id},title:n.title,meta:y(Number(t==="create"?n.createdAt:n.updatedAt)).format("HH:mm")}),me=({reminder:n})=>e.jsx(B,{params:{id:String(n.note?.id??n.noteId)},header:e.jsx(te,{size:12}),title:n.content||n.note?.title||"No title",titleClassName:n.completed?"line-through":"",meta:y(Number(n.reminderDate)).format("HH:mm")}),O=3,H=(n,t)=>n.map(s=>s.type==="note"?e.jsx(ue,{note:s.item,type:t},`note-${s.item.id}`):e.jsx(me,{reminder:s.item},`reminder-${s.item.id}`)),ge=({year:n,month:t,day:s,isCurrentMonth:l,isSunday:o,isToday:c,isPast:m,notes:g,reminders:f,type:j})=>{const[M,N]=d.useState(!1),x=d.useMemo(()=>{const r=g.map(u=>({type:"note",item:u})),i=f.map(u=>({type:"reminder",item:u}));return m?[...r,...i]:[...i,...r]},[m,g,f]),D=x.length>O,S=d.useMemo(()=>H(x.slice(0,O),j),[x,j]),$=d.useMemo(()=>H(x,j),[x,j]),E=d.useCallback(()=>N(!0),[]),v=d.useCallback(()=>N(!1),[]),k=()=>l?c?"border-border-secondary/70 bg-[color:color-mix(in_srgb,var(--surface)_88%,var(--accent-soft-primary)_12%)]":"bg-surface border-border-subtle":"bg-muted/18 border-border-subtle/70",I=()=>c?"bg-cta text-fg-on-filled font-semibold":l?o?"text-fg-weekend font-bold":"text-fg-secondary font-bold":"text-fg-disabled opacity-55";return e.jsxs(e.Fragment,{children:[e.jsx(de,{day:s,cellClassName:k(),dayNumberClassName:I(),isCurrentMonth:l,items:S,overflowCount:D?x.length-O:0,onOpenOverflow:E}),D&&e.jsxs(R,{isOpen:M,onClose:v,children:[e.jsx(R.Header,{title:`${n}/${String(t).padStart(2,"0")}/${String(s).padStart(2,"0")}`,onClose:v}),e.jsxs(R.Body,{children:[e.jsxs(R.Description,{className:"sr-only",children:["View all notes and reminders scheduled for day ",s,"."]}),e.jsx("div",{className:"flex max-h-[60vh] flex-col gap-2 overflow-y-auto",children:$})]})]})]})},he=d.memo(ge),xe=["January","February","March","April","May","June","July","August","September","October","November","December"],pe=({month:n,year:t,type:s,onPrevMonth:l,onNextMonth:o,onToday:c,onTypeChange:m})=>e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-baseline gap-2.5",children:[e.jsx("span",{className:"text-2xl sm:text-3xl font-bold tracking-tight text-fg-default",children:xe[n-1]}),e.jsx("span",{className:"text-lg sm:text-xl font-medium text-fg-placeholder",children:t})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(se,{type:"single",variant:"pills",size:"sm",value:s,onValueChange:g=>g&&m(g),children:[e.jsx(P,{value:"create",children:"Create date"}),e.jsx(P,{value:"update",children:"Update date"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(w,{variant:"ghost",size:"sm",onClick:c,children:"Today"}),e.jsx(w,{variant:"ghost",size:"icon-sm",onClick:l,children:e.jsx(ne,{width:18,height:18})}),e.jsx(w,{variant:"ghost",size:"icon-sm",onClick:o,children:e.jsx(re,{width:18,height:18})})]})]})]}),ye=`
|
|
2
|
-
query NotesInDateRange($dateRange: DateRangeInput) {
|
|
3
|
-
notesInDateRange(dateRange: $dateRange) {
|
|
4
|
-
id
|
|
5
|
-
title
|
|
6
|
-
createdAt
|
|
7
|
-
updatedAt
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
`,fe=`
|
|
11
|
-
query RemindersInDateRange($dateRange: DateRangeInput) {
|
|
12
|
-
remindersInDateRange(dateRange: $dateRange) {
|
|
13
|
-
id
|
|
14
|
-
noteId
|
|
15
|
-
reminderDate
|
|
16
|
-
completed
|
|
17
|
-
priority
|
|
18
|
-
content
|
|
19
|
-
note {
|
|
20
|
-
id
|
|
21
|
-
title
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
`,be=async n=>{const t=await z(ye,{dateRange:n});if(t.type==="error")throw t;return t.notesInDateRange},je=async n=>{const t=await z(fe,{dateRange:n});if(t.type==="error")throw t;return t.remindersInDateRange},Ne=({year:n,month:t})=>{const s=`${n}-${String(t).padStart(2,"0")}-01`,l=t===12?1:t+1,c=`${t===12?n+1:n}-${String(l).padStart(2,"0")}-01`,m={start:s,end:c},g=q({queryKey:F.calendar.notesInDateRange(n,t),queryFn:()=>be(m)}),f=q({queryKey:F.reminders.inDateRange(n,t),queryFn:()=>je(m)});return{notes:g.data??[],reminders:f.data??[],isLoading:g.isLoading||f.isLoading,isError:g.isError||f.isError}},Me=["SUN","MON","TUE","WED","THU","FRI","SAT"],De=[],ve=[],Q=le(ce);function ke(){const n=Q.useNavigate(),{year:t,month:s,type:l}=Q.useSearch(),o=d.useRef(null),c=d.useRef(!1),m=d.useRef(0),g=d.useRef(0),f=d.useCallback(r=>{c.current=!0,m.current=r.pageX-(o.current?.offsetLeft??0),g.current=o.current?.scrollLeft??0,o.current&&(o.current.style.cursor="grabbing",o.current.style.userSelect="none")},[]),j=d.useCallback(r=>{if(!c.current||!o.current)return;r.preventDefault();const u=(r.pageX-o.current.offsetLeft-m.current)*1.2;o.current.scrollLeft=g.current-u},[]),M=d.useCallback(()=>{c.current=!1,o.current&&(o.current.style.cursor="grab",o.current.style.userSelect="")},[]),{notes:N,reminders:x,isLoading:D,isError:S}=Ne({year:t,month:s}),$=d.useMemo(()=>{const r=y(),i=`${r.year()}-${r.month()+1}-${r.date()}`,u=new Map;for(const a of N){const p=l==="create"?y(Number(a.createdAt)):y(Number(a.updatedAt)),h=`${p.year()}-${p.month()+1}-${p.date()}`,b=u.get(h)||[];b.push(a),u.set(h,b)}const T=new Map;for(const a of x){const p=y(Number(a.reminderDate)),h=`${p.year()}-${p.month()+1}-${p.date()}`,b=T.get(h)||[];b.push(a),T.set(h,b)}const K=new Date(t,s-1,1),V=new Date(t,s,0),L=K.getDay(),A=V.getDate(),C=[],_=s===1?12:s-1,Y=s===1?t-1:t,W=new Date(Y,_,0).getDate();for(let a=L-1;a>=0;a--)C.push({day:W-a,isCurrentMonth:!1,year:Y,month:_});for(let a=1;a<=A;a++)C.push({day:a,isCurrentMonth:!0,year:t,month:s});const U=(L+A)%7,X=U===0?0:7-U,J=s===12?1:s+1,G=s===12?t+1:t;for(let a=1;a<=X;a++)C.push({day:a,isCurrentMonth:!1,year:G,month:J});return C.map((a,p)=>{const h=`${a.year}-${a.month}-${a.day}`,b=y(`${a.year}-${String(a.month).padStart(2,"0")}-${String(a.day).padStart(2,"0")}`);return{key:h,year:a.year,month:a.month,day:a.day,isCurrentMonth:a.isCurrentMonth,isSunday:p%7===0,isToday:h===i,isPast:b.isBefore(r,"day"),notes:u.get(h)||De,reminders:T.get(h)||ve}})},[t,s,N,x,l]),E=()=>{const r=s===1?12:s-1,i=s===1?t-1:t;n({search:u=>({...u,month:r,year:i})})},v=()=>{const r=s===12?1:s+1,i=s===12?t+1:t;n({search:u=>({...u,month:r,year:i})})},k=()=>{n({search:r=>({...r,month:y().month()+1,year:y().year()})})},I=r=>{r&&n({search:i=>({...i,type:r})})};return e.jsx(ae,{title:"Calendar",variant:"none",children:S?e.jsx(ie,{children:"Failed to load calendar data. Please try again later."}):e.jsxs("div",{className:"surface-base",children:[e.jsx("div",{className:"border-b border-border-subtle px-3 py-3",children:e.jsx(pe,{month:s,year:t,type:l,onPrevMonth:E,onNextMonth:v,onToday:k,onTypeChange:I})}),e.jsx("div",{ref:o,className:"overflow-x-auto cursor-grab px-3 pb-3 pt-2",onMouseDown:f,onMouseMove:j,onMouseUp:M,onMouseLeave:M,children:e.jsxs("div",{className:"min-w-[1260px]",children:[e.jsx("div",{className:"grid grid-cols-7 gap-1.5 mb-2",children:Me.map((r,i)=>e.jsx("div",{className:`py-2 text-center text-label font-semibold uppercase tracking-[0.12em] ${i===0?"text-fg-weekend":"text-fg-tertiary"}`,children:r},r))}),D?e.jsx("div",{className:"grid grid-cols-7 gap-1.5",children:Array.from({length:35}).map((r,i)=>e.jsx(oe,{height:180},i))}):e.jsx("div",{className:"grid grid-cols-7 gap-1.5",children:$.map(r=>e.jsx(he,{year:r.year,month:r.month,day:r.day,isCurrentMonth:r.isCurrentMonth,isSunday:r.isSunday,isToday:r.isToday,isPast:r.isPast,notes:r.notes,reminders:r.reminders,type:l},r.key))})]})})]})})}export{ke as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./note-vendor-BofYbzmZ.js";import{a as e}from"./graph-vendor-CUxe67Lr.js";import{p as n}from"./index-DqFkOWbi.js";const l=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z"}))],["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:"M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z"}))],["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,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,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,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),m=e.forwardRef((a,t)=>e.createElement(n,{ref:t,...a,weights:l}));m.displayName="InfoIcon";const s=m,A=({children:a,className:t=""})=>r.jsxs("div",{className:`flex items-start gap-2.5 rounded-[12px] border border-border-subtle bg-hover-subtle/50 px-4 py-3 ${t}`,children:[r.jsx(s,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary"}),r.jsx("div",{className:"text-sm font-medium text-fg-secondary",children:a})]});export{A as C};
|