ocean-brain 0.8.2 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/mcp.js +47 -75
- package/package.json +3 -2
- package/server/client/dist/assets/{ArrowRight.es-g2YZTklZ.js → ArrowRight.es-Bm-ZXpEC.js} +1 -1
- package/server/client/dist/assets/Calendar-BsNs3NzO.js +25 -0
- package/server/client/dist/assets/{Callout-B_IPSF_5.js → Callout-CviyPHKO.js} +1 -1
- package/server/client/dist/assets/{Copy.es-CNxe4ujr.js → Copy.es-BPreRnP9.js} +1 -1
- package/server/client/dist/assets/{Graph-D9GeO71k.js → Graph-vXQQ0a-Q.js} +1 -1
- package/server/client/dist/assets/Graph-yPE3ljW0.js +46 -0
- package/server/client/dist/assets/{Image.es-DnON8cv2.js → Image.es-DnR3qc_c.js} +1 -1
- package/server/client/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/server/client/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/server/client/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/server/client/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/server/client/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/server/client/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/server/client/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/server/client/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/server/client/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/server/client/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/server/client/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/server/client/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/server/client/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/server/client/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/server/client/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/server/client/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/server/client/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/server/client/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/server/client/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/server/client/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/server/client/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/server/client/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/server/client/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/server/client/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/server/client/dist/assets/Note-CmreVzvQ.js +25 -0
- package/server/client/dist/assets/{NotePropertiesPanel-2DgXEM4B.js → NotePropertiesPanel-DXYgE8h2.js} +2 -2
- package/server/client/dist/assets/PencilLine.es-B9V6u64t.js +1 -0
- package/server/client/dist/assets/{Plus.es-CQ8wn2is.js → Plus.es-CRRp2u5J.js} +1 -1
- package/server/client/dist/assets/Reminders-BOtfNeYD.js +1 -0
- package/server/client/dist/assets/Search-C-FB3pKf.js +1 -0
- package/server/client/dist/assets/SurfaceCard-GMt5xM7v.js +1 -0
- package/server/client/dist/assets/Tag-lBxDRE77.js +1 -0
- package/server/client/dist/assets/TagNotes-Bgorp_rC.js +1 -0
- package/server/client/dist/assets/{Trash.es-0aPpA-3S.js → Trash.es-svHOb5LN.js} +1 -1
- package/server/client/dist/assets/ViewNotes-C7d10VFf.js +1 -0
- package/server/client/dist/assets/ViewSectionDialog-Bhw-ILop.js +102 -0
- package/server/client/dist/assets/Views-C7V3saUo.js +1 -0
- package/server/client/dist/assets/abnfDiagram-VRR7QNED-CWlV5dXw.js +1 -0
- package/server/client/dist/assets/app-DQBV36r_.js +50 -0
- package/server/client/dist/assets/app-ZgwR5t_I.css +1 -0
- package/server/client/dist/assets/arc-BV-n6RUX.js +1 -0
- package/server/client/dist/assets/architectureDiagram-ZJ3FMSHR-CekzMXdu.js +36 -0
- package/server/client/dist/assets/blockDiagram-677ZJIJ3-B49yHoxq.js +132 -0
- package/server/client/dist/assets/c4Diagram-LMCZKHZV-0AfB9NBC.js +10 -0
- package/server/client/dist/assets/channel-CigOulR-.js +1 -0
- package/server/client/dist/assets/chunk-2Q5K7J3B-DaPQAU1q.js +1 -0
- package/server/client/dist/assets/chunk-32BRIVSS-CfL3kZAg.js +1 -0
- package/server/client/dist/assets/chunk-5VM5RSS4-DeOwWPE_.js +15 -0
- package/server/client/dist/assets/chunk-EX3LRPZG-C3W1oc9y.js +231 -0
- package/server/client/dist/assets/chunk-JWPE2WC7-_Oqh79OY.js +1 -0
- package/server/client/dist/assets/chunk-MOJQB5TN-DDKNNzI6.js +88 -0
- package/server/client/dist/assets/chunk-RYQCIY6F-DCHah7CC.js +1 -0
- package/server/client/dist/assets/chunk-V7JOEXUC-uUOIzgxj.js +206 -0
- package/server/client/dist/assets/chunk-VR4S4FIN-DDVw2WPs.js +1 -0
- package/server/client/dist/assets/chunk-XXDRQBXY-Coo4UFm2.js +1 -0
- package/server/client/dist/assets/classDiagram-OUVF2IWQ-D13ISIOW.js +1 -0
- package/server/client/dist/assets/classDiagram-v2-EOCWNBFH-D13ISIOW.js +1 -0
- package/server/client/dist/assets/colors-Cc3OSVma.js +1 -0
- package/server/client/dist/assets/cose-bilkent-JH36ORCC-C3pHmHpD.js +1 -0
- package/server/client/dist/assets/cynefin-VYW2F7L2-DU_G4Atc.js +166 -0
- package/server/client/dist/assets/cynefinDiagram-TSTJHNR4-DZ6iiJFo.js +62 -0
- package/server/client/dist/assets/cytoscape.esm-D3_iZ_3b.js +321 -0
- package/server/client/dist/assets/dagre-VKFMJZFB-DNELbhwC.js +4 -0
- package/server/client/dist/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/server/client/dist/assets/diagram-FQU43EPY-CMEvZJ61.js +3 -0
- package/server/client/dist/assets/diagram-G47NLZAW-BYDtf6j9.js +24 -0
- package/server/client/dist/assets/diagram-NH7WQ7WH-CmXfcCQA.js +24 -0
- package/server/client/dist/assets/diagram-OA4YK3LP-BflTKJxU.js +30 -0
- package/server/client/dist/assets/diagram-WEI45ONY-KW3fKqna.js +41 -0
- package/server/client/dist/assets/ebnfDiagram-CCIWWBDH-CbyhY5Nj.js +1 -0
- package/server/client/dist/assets/erDiagram-Q63AITRT-CC2eZV8g.js +85 -0
- package/server/client/dist/assets/{floating-ui.react-dom-wWLZ1CdM.js → floating-ui.react-dom-BWTnA00G.js} +1 -1
- package/server/client/dist/assets/flowDiagram-23GEKE2U-unplo7Qm.js +156 -0
- package/server/client/dist/assets/ganttDiagram-NO4QXBWP-BcBK5HcZ.js +292 -0
- package/server/client/dist/assets/gitGraphDiagram-IHSO6WYX-DgVbbb5k.js +106 -0
- package/server/client/dist/assets/graph-C5DFNLrC.js +1 -0
- package/server/client/dist/assets/image-delete-confirmation-D7xrODQV.js +1 -0
- package/server/client/dist/assets/image.api-QmHYjp3z.js +17 -0
- package/server/client/dist/assets/index-CaF9d-zG.js +1 -0
- package/server/client/dist/assets/infoDiagram-FWYZ7A6U-N_D9RdfG.js +2 -0
- package/server/client/dist/assets/init-Gi6I4Gst.js +1 -0
- package/server/client/dist/assets/isObject-U9U2HXiq.js +1 -0
- package/server/client/dist/assets/ishikawaDiagram-FXEZZL3T-BBKrzmB2.js +70 -0
- package/server/client/dist/assets/journeyDiagram-5HDEW3XC-NdCxLmQB.js +139 -0
- package/server/client/dist/assets/kanban-definition-HUTT4EX6-Ck7t4-tt.js +89 -0
- package/server/client/dist/assets/katex-DywYRkvg.css +1 -0
- package/server/client/dist/assets/katex-HP8lGamR.js +257 -0
- package/server/client/dist/assets/katex-x288kqHd.js +257 -0
- package/server/client/dist/assets/layout-Cz0MDlGi.js +1 -0
- package/server/client/dist/assets/linear-D6yRgDLq.js +1 -0
- package/server/client/dist/assets/manage-image-DCDF8AM9.js +1 -0
- package/server/client/dist/assets/manage-image-detail-e0ViRAj-.js +1 -0
- package/server/client/dist/assets/map-Mm1V-_Na.js +1 -0
- package/server/client/dist/assets/mcp-admin-adapter-D39G3udJ.js +1 -0
- package/server/client/dist/assets/{mcp-CT_9IV2c.js → mcp-uFZkdhCi.js} +4 -4
- package/server/client/dist/assets/mermaid.core-B14ZAmWA.js +308 -0
- package/server/client/dist/assets/min-tv6RD-6E.js +1 -0
- package/server/client/dist/assets/mindmap-definition-LN4V7U3C-BTUqSdcP.js +96 -0
- package/server/client/dist/assets/{note-core-Buwzyxi7.js → note-core-DUTqUh5N.js} +2 -2
- package/server/client/dist/assets/{note-runtime-CPDVOFEo.js → note-runtime-zN5ddTba.js} +1 -1
- package/server/client/dist/assets/{note-ui-CHI-tzj-.js → note-ui-CxK8ymUc.js} +1 -1
- package/server/client/dist/assets/{note.api-D_00ZzJC.js → note.api-BQovzEzd.js} +6 -6
- package/server/client/dist/assets/ordinal-Cboi1Yqb.js +1 -0
- package/server/client/dist/assets/pegDiagram-2B236MQR-Cjcu3mVz.js +1 -0
- package/server/client/dist/assets/pieDiagram-ENE6RG2P-BxI_c22Z.js +39 -0
- package/server/client/dist/assets/{placeholder-DbdGiYGL.js → placeholder-D3b8lZGE.js} +4 -4
- package/server/client/dist/assets/properties-M-yWq1D7.js +1 -0
- package/server/client/dist/assets/quadrantDiagram-ABIIQ3AL-DGm0a-yR.js +7 -0
- package/server/client/dist/assets/railroadDiagram-RFXS5EU6-DmCDu89O.js +1 -0
- package/server/client/dist/assets/requirementDiagram-TGXJPOKE-CBpUt7Ig.js +84 -0
- package/server/client/dist/assets/route-preload.js +2 -2
- package/server/client/dist/assets/sankeyDiagram-HTMAVEWB-BjGnDZlp.js +40 -0
- package/server/client/dist/assets/search-DFnzZKLd.js +1 -0
- package/server/client/dist/assets/sequenceDiagram-DBY2YBRQ-B7rpCfS6.js +162 -0
- package/server/client/dist/assets/sizeCapture-X5ZJPWSS-CUJhD0uW.js +1 -0
- package/server/client/dist/assets/stateDiagram-2N3HPSRC-Y9-3XqRX.js +1 -0
- package/server/client/dist/assets/stateDiagram-v2-6OUMAXLB-DbHXhT02.js +1 -0
- package/server/client/dist/assets/swimlanes-5IMT3BWC-Cs1NO9ng.js +2 -0
- package/server/client/dist/assets/swimlanesDiagram-G3AALYLV-DQnrq2ZC.js +8 -0
- package/server/client/dist/assets/{tag.api-CX0SE06J.js → tag.api-DUfjr8bg.js} +3 -3
- package/server/client/dist/assets/time-CfAYZipR.js +9 -0
- package/server/client/dist/assets/timeline-definition-FHXFAJF6-8fqD4WNL.js +120 -0
- package/server/client/dist/assets/toNumber-DE3J3kMD.js +1 -0
- package/server/client/dist/assets/transform-BUB79_za.js +1 -0
- package/server/client/dist/assets/trash-CClKfP1x.js +1 -0
- package/server/client/dist/assets/url-9nrbQs7Z.js +1 -0
- package/server/client/dist/assets/{useReminderMutate-CLK1tHvT.js → useReminderMutate--omDLmBV.js} +4 -4
- package/server/client/dist/assets/vennDiagram-L72KCM5P-BPqKkd5a.js +34 -0
- package/server/client/dist/assets/wardleyDiagram-EHGQE667-Cq11kU2M.js +78 -0
- package/server/client/dist/assets/xychartDiagram-FW5EYKEG-DJ6UzFj-.js +7 -0
- package/server/client/dist/index.html +7 -7
- package/server/dist/features/image/services/delete.js +25 -1
- package/server/dist/features/note/graphql/note.mutation.resolver.js +38 -12
- package/server/dist/features/note/graphql/note.type-defs.js +1 -1
- package/server/dist/features/note/http/mcp.js +1 -60
- package/server/dist/features/note/services/authoring.js +2 -70
- package/server/dist/features/note/services/markdown-patch.js +80 -8
- package/server/dist/features/note/services/properties.js +21 -1
- package/server/dist/features/note/services/property-restore.js +26 -0
- package/server/dist/features/note/services/snapshot.js +79 -59
- package/server/dist/features/note/services/trash.js +16 -31
- package/server/dist/features/search/embedding-api-key-store.js +57 -0
- package/server/dist/features/search/embedding-client.js +179 -0
- package/server/dist/features/search/graphql/index.js +6 -0
- package/server/dist/features/search/graphql/resolver.js +20 -0
- package/server/dist/features/search/graphql/type-defs.js +30 -0
- package/server/dist/features/search/http/handlers.js +108 -0
- package/server/dist/features/search/hybrid-ranking.js +55 -0
- package/server/dist/features/search/hybrid-search.js +174 -0
- package/server/dist/features/search/note-change.js +16 -0
- package/server/dist/features/search/note-chunking.js +75 -0
- package/server/dist/features/search/search-config.js +150 -0
- package/server/dist/features/search/search-manager.js +431 -0
- package/server/dist/features/search/semantic-indexer.js +138 -0
- package/server/dist/features/search/sqlite-vector-index.js +636 -0
- package/server/dist/features/search/url-normalization.js +10 -0
- package/server/dist/features/tag/services/organization.js +3 -0
- package/server/dist/features/view/services/workspace.js +1 -1
- package/server/dist/main.js +2 -0
- package/server/dist/modules/blocknote.js +4 -5
- package/server/dist/paths.js +7 -2
- package/server/dist/routes/api.js +37 -0
- package/server/dist/routes/mcp.js +0 -5
- package/server/dist/schema/index.js +3 -0
- package/server/client/dist/assets/Calendar-BP6HTuSn.js +0 -25
- package/server/client/dist/assets/Graph-Xha3fwhp.js +0 -46
- package/server/client/dist/assets/Image-BLEjLUqd.js +0 -1
- package/server/client/dist/assets/Note-DjrCYtat.js +0 -24
- package/server/client/dist/assets/Reminders-B4l3KdlK.js +0 -1
- package/server/client/dist/assets/Search-BN5sf7bE.js +0 -1
- package/server/client/dist/assets/SurfaceCard-BZm73nyS.js +0 -1
- package/server/client/dist/assets/Tag-oSnmViVp.js +0 -1
- package/server/client/dist/assets/TagNotes-BDTCcJcL.js +0 -1
- package/server/client/dist/assets/ViewNotes-CiZtGJNE.js +0 -1
- package/server/client/dist/assets/ViewSectionDialog-Ctl_694Y.js +0 -102
- package/server/client/dist/assets/Views-D-zlatYD.js +0 -1
- package/server/client/dist/assets/app-DmqIOMWF.css +0 -1
- package/server/client/dist/assets/app-cTRcKMGc.js +0 -26
- package/server/client/dist/assets/image.api-CVuuvTBk.js +0 -17
- package/server/client/dist/assets/index-DKJChPr4.js +0 -1
- package/server/client/dist/assets/manage-image-BZjaxp-f.js +0 -1
- package/server/client/dist/assets/manage-image-detail-DPv0FQ2m.js +0 -1
- package/server/client/dist/assets/mcp-admin-adapter-xAuyZc_M.js +0 -1
- package/server/client/dist/assets/properties-D447wsWk.js +0 -1
- package/server/client/dist/assets/time-B3pt8vt4.js +0 -9
- package/server/client/dist/assets/trash-8sH7EZgc.js +0 -1
- package/server/client/dist/assets/url-BSnWpmJx.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./floating-ui.react-dom-BWTnA00G.js";import{z as n}from"./note.api-BQovzEzd.js";const m=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M230.15,70.54,185.46,25.86a20,20,0,0,0-28.28,0L33.86,149.17A19.86,19.86,0,0,0,28,163.31V208a20,20,0,0,0,20,20H216a12,12,0,0,0,0-24H125L230.15,98.83A20,20,0,0,0,230.15,70.54ZM136,81l11,11L76,163,65,152ZM52,204V173l15.52,15.51h0L83,204Zm52-13L93,180l71-71,11,11Zm88-88L153,64l18.34-18.34,39,39Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),e.createElement("path",{d:"M227.32,73.37,182.63,28.69a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H216a8,8,0,0,0,0-16H115.32l112-112A16,16,0,0,0,227.32,73.37ZM79.32,188,164,103.31,180.69,120,96,204.69ZM68,176.69,51.31,160,136,75.31,152.69,92Zm-20,2.62L76.69,208H48Zm144-70.62L147.32,64l24-24L216,84.69Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M227.32,73.37,182.63,28.69a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H216a8,8,0,0,0,0-16H115.32l112-112A16,16,0,0,0,227.32,73.37ZM79.32,188l90.34-90.34,16.69,16.68L96,204.69Zm79-101.66h0L68,176.69,51.31,160l90.35-90.34ZM48,179.31,76.69,208H48Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M225.91,74.79,181.22,30.1a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H216a6,6,0,0,0,0-12H110.49L225.91,94.59A14,14,0,0,0,225.91,74.79ZM76.49,188,164,100.48,183.52,120,96,207.51ZM68,179.52,48.49,160,136,72.49,155.52,92ZM46,208V174.48L81.52,210H48A2,2,0,0,1,46,208ZM217.42,86.1,192,111.52,144.49,64,169.9,38.59a2,2,0,0,1,2.83,0l44.69,44.68A2,2,0,0,1,217.42,86.1Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M227.32,73.37,182.63,28.69a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H216a8,8,0,0,0,0-16H115.32l112-112A16,16,0,0,0,227.32,73.37ZM136,75.31,152.69,92,68,176.69,51.31,160ZM48,208V179.31L76.69,208Zm48-3.31L79.32,188,164,103.31,180.69,120Zm96-96L147.32,64l24-24L216,84.69Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L39.51,154.83A12,12,0,0,0,36,163.31V208a12,12,0,0,0,12,12H216a4,4,0,0,0,0-8H105.66L224.49,93.17A12,12,0,0,0,224.49,76.2ZM73.66,188,164,97.66,186.35,120,96,210.34ZM68,182.34,45.66,160,136,69.66,158.35,92ZM44,208V169.66l21.17,21.17h0L86.34,212H48A4,4,0,0,1,44,208ZM218.83,87.51,192,114.34,141.66,64l26.83-26.83a4,4,0,0,1,5.66,0l44.68,44.69A4,4,0,0,1,218.83,87.51Z"}))]]),a=e.forwardRef((t,l)=>e.createElement(n,{ref:l,...t,weights:m}));a.displayName="PencilLineIcon";const L=a;export{L as m};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./floating-ui.react-dom-
|
|
1
|
+
import{r as e}from"./floating-ui.react-dom-BWTnA00G.js";import{z as l}from"./note.api-BQovzEzd.js";const r=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),e.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z"}))]]),a=e.forwardRef((t,n)=>e.createElement(l,{ref:n,...t,weights:r}));a.displayName="PlusIcon";const c=a;export{c as n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./floating-ui.react-dom-BWTnA00G.js";import{F as k,T as h,C as H,G as M,Q as E,P as w,E as S,j as C,k as o,f as L}from"./note.api-BQovzEzd.js";import{N as O,R as U}from"./url-9nrbQs7Z.js";import{u as I,R as P}from"./useReminderMutate--omDLmBV.js";import{f as Y,d as u}from"./time-CfAYZipR.js";const g={high:"bg-priority-high",medium:"bg-priority-medium",low:"bg-priority-low"};function B({reminder:t,onUpdate:l,onDelete:f}){const j=y=>{const r=u(Number(y)),m=u();return r.isSame(m,"day")?`Today at ${r.format("HH:mm")}`:r.isSame(m.add(1,"day"),"day")?`Tomorrow at ${r.format("HH:mm")}`:r.format("YYYY-MM-DD HH:mm")},a=y=>{const r=u(Number(y)),m=u(),N=r.diff(m,"hour"),b=r.diff(m,"minute")%60;return N<0||b<0?"Overdue":N===0?`${b}m remaining`:`${N}h ${b}m remaining`},d=a(t.reminderDate)==="Overdue",i=t.priority||"low",s=i==="high"?"High":i==="medium"?"Medium":"Low",p=g[i],c=t.noteId.toString(),n=d?"text-fg-error":"text-fg-tertiary",x=t.content?.trim()||t.note?.title||"Untitled reminder",v=t.note?.title||"Untitled note",T=!!(t.content?.trim()&&t.note?.title),D=a(t.reminderDate),$=j(t.reminderDate);return e.jsxs("div",{className:"surface-base flex flex-col gap-2.5 px-4 py-3 sm:flex-row sm:items-center sm:gap-4",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-2.5 sm:items-center",children:[e.jsx(k,{checked:t.completed,onChange:()=>l(t.id,c,{completed:!t.completed}),size:"sm","aria-label":`Reminder: ${x}`}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx(h,{as:"p",variant:"body",weight:"semibold",className:t.completed?"truncate line-through opacity-45":"truncate",children:x}),T&&e.jsx(h,{as:"div",variant:"meta",tone:"secondary",className:t.completed?"mt-0.5 truncate opacity-45":"mt-0.5 truncate",children:e.jsx(H,{to:O,params:{id:String(t.note?.id??t.noteId)},className:"transition-colors hover:text-fg-default hover:underline",children:v})})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 sm:shrink-0",children:[e.jsx("span",{className:`h-3 w-3 shrink-0 rounded-full border border-border-subtle ${p}`,"aria-label":`${s} priority`,title:`${s} priority`}),e.jsx(h,{as:"span",variant:"meta",weight:"medium",tone:"secondary",className:t.completed?"opacity-45":void 0,children:$}),e.jsx("span",{className:"h-1 w-1 rounded-full bg-border-secondary"}),e.jsx(h,{as:"span",variant:"label",weight:"medium",className:t.completed?"opacity-45":n,children:D})]}),e.jsx("div",{className:"flex items-center justify-end gap-1.5 sm:shrink-0",children:e.jsx(M,{button:e.jsx(Y,{label:"Reminder actions",iconClassName:"h-5 w-5 text-current"}),items:[{name:"Delete",onClick:()=>f(t.id,c)}]})})]})}const R=L(U),A=[{label:"High",className:g.high},{label:"Medium",className:g.medium},{label:"Low",className:g.low}];function K(){const t=R.useNavigate(),{page:l}=R.useSearch(),{onUpdate:f,onDelete:j}=I(),a=25,d=e.jsx("div",{className:"flex flex-wrap items-center gap-3",children:A.map(({label:i,className:s})=>e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`h-2.5 w-2.5 rounded-full border border-border-subtle ${s}`,"aria-hidden":"true"}),e.jsx(h,{as:"span",variant:"label",weight:"medium",tone:"tertiary",children:i})]},i))});return e.jsx(E,{fallback:e.jsx(w,{title:"Reminders",heading:e.jsx(o,{width:164,height:24,className:"rounded-full"}),description:e.jsx(o,{width:224,height:16,className:"rounded-full"}),headerRight:d,children:e.jsxs("div",{className:"flex flex-col gap-2.5",children:[e.jsx(o,{height:"60px"}),e.jsx(o,{height:"60px"}),e.jsx(o,{height:"60px"}),e.jsx(o,{height:"60px"})]})}),errorTitle:"Failed to load reminders",errorDescription:"Retry loading the upcoming reminder list",resetKeys:[l,a],children:e.jsx(P,{searchParams:{offset:(l-1)*a,limit:a},render:({reminders:i,totalCount:s})=>{const p=s>0?`Reminders (${s})`:void 0,c="Review reminders created from notes and mark them complete here";return i.length===0?e.jsx(w,{title:"Reminders",heading:p,description:c,headerRight:d,children:e.jsx(S,{title:"No upcoming reminders",description:"Add a reminder inside any note to see it here"})}):e.jsx(w,{title:"Reminders",heading:p,description:c,headerRight:d,children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"flex flex-col gap-2.5",children:i.map(n=>e.jsx(B,{reminder:n,onUpdate:f,onDelete:j},n.id))}),s&&a<s&&e.jsx(C,{page:l,last:Math.ceil(s/a),onChange:n=>{t({search:x=>({...x,page:n})})}})]})})}})})}export{K as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,r as f}from"./floating-ui.react-dom-BWTnA00G.js";import{A as O,B as P,T as p,H,P as z,E as A,Q,C as q,j as D,f as K,k as w,h as F,q as U}from"./note.api-BQovzEzd.js";import{h as G,j as J}from"./app-DQBV36r_.js";import{N as X,g as V}from"./url-9nrbQs7Z.js";import{f as W}from"./Graph-vXQQ0a-Q.js";import"./time-CfAYZipR.js";import"./preload-helper-BXl3LOEh.js";const Y=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),T=({children:t,match:s})=>{const r=s.trim();if(!r)return e.jsx("span",{children:t});const a=Y(r),i=new RegExp(`(${a})`,"gi"),n=new RegExp(`^${a}$`,"i"),o=t.split(i);return e.jsx("span",{children:o.map((d,l)=>n.test(d)?e.jsx("mark",{children:d},l):e.jsx(f.Fragment,{children:d},l))})},Z=({value:t,onChange:s,onSubmit:r,onClear:a,onCompositionChange:i,autoFocus:n=!1,placeholder:o="Describe what you remember"})=>{const d=l=>{l.preventDefault(),r()};return e.jsxs("form",{role:"search",className:"flex items-stretch gap-2",onSubmit:d,children:[e.jsxs("div",{className:"grid-search-bar grid min-h-12 min-w-0 flex-1 items-center rounded-[15px] border border-border-subtle bg-elevated px-2.5 transition-colors focus-within:border-border-focus focus-within:shadow-[0_0_0_4px_color-mix(in_srgb,var(--accent-soft-primary)_90%,transparent)]",children:[e.jsx("span",{className:"flex h-10 items-center justify-center text-fg-tertiary","aria-hidden":"true",children:e.jsx(W,{className:"h-[18px] w-[18px]",weight:"bold"})}),e.jsx("input",{type:"text",role:"searchbox","aria-label":"Search notes",autoFocus:n,autoComplete:"off",placeholder:o,value:t,onChange:l=>s(l.target.value),onCompositionStart:()=>i?.(!0),onCompositionEnd:l=>{s(l.currentTarget.value),i?.(!1)},className:"h-11 min-w-0 bg-transparent px-1 text-base text-fg-default outline-none placeholder:text-fg-placeholder"}),t&&e.jsx("button",{type:"button","aria-label":"Clear search",className:"focus-ring-soft flex h-10 items-center justify-center rounded-[10px] text-fg-tertiary transition-colors hover:text-fg-default",onClick:()=>{s(""),a?.()},children:e.jsx(O,{className:"h-4 w-4",weight:"bold"})})]}),e.jsx(P,{type:"submit",size:"lg",disabled:!t.trim(),className:"h-12 shrink-0 rounded-[15px] px-4 sm:px-5",children:"Search"})]})},ee=t=>t?.lexical&&t.semantic?"Keyword + meaning":t?.semantic?"Meaning match":t?.lexical?"Keyword match":null,te=({match:t})=>{const s=ee(t);return s?e.jsx(p,{as:"span",variant:"micro",weight:"semibold",tone:"tertiary",className:"shrink-0 rounded-full bg-muted px-2 py-1",children:s}):null},E=[{value:"hybrid",label:"All",description:"Combines keyword matches with notes that have a similar meaning."},{value:"lexical",label:"Keywords",description:"Looks only for the words you typed. No embedding request is made."},{value:"semantic",label:"Meaning",description:"Finds related ideas even when your note uses different words."}],re=({value:t,onChange:s,showDescription:r=!0,className:a})=>{const i=E.find(n=>n.value===t)??E[0];return e.jsxs("div",{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-3 ${a??""}`,children:[e.jsx("div",{role:"radiogroup","aria-label":"Search method",className:"inline-flex max-w-full self-start gap-1 rounded-[12px] bg-muted p-1",children:E.map(n=>{const o=n.value===t;return e.jsx("button",{type:"button",role:"radio","aria-checked":o,className:H("focus-ring-soft min-h-8 rounded-[9px] border px-3 text-sm font-semibold outline-none transition-colors",o?"border-border-subtle bg-elevated text-fg-default":"border-transparent text-fg-secondary hover:bg-hover-subtle hover:text-fg-default"),onClick:()=>s(n.value),children:n.label},n.value)})}),r&&e.jsx(p,{as:"p",variant:"micro",tone:"tertiary",className:"min-w-0 leading-relaxed",children:i.description})]})},M=180,C=t=>t.replace(/\s+/g," ").trim(),L=t=>C(t).toLowerCase().split(" ").filter(Boolean),se=(t,s)=>{const r=C(t),a=C(s).toLowerCase();if(!a)return r;const i=r.toLowerCase();let n=a,o=i.indexOf(a);if(o===-1){const g=L(s).map(h=>({term:h,index:i.indexOf(h)})).filter(h=>h.index>=0).sort((h,u)=>h.index-u.index||u.term.length-h.term.length)[0];g&&(n=g.term,o=g.index)}if(o===-1)return r.length>M?`${r.slice(0,M-1).trimEnd()}…`:r;const d=Math.max(0,o-56),l=Math.min(r.length,o+n.length+84);let c=r.slice(d,l).trim();return d>0&&(c=`…${c}`),l<r.length&&(c=`${c}…`),c},ae=t=>Array.isArray(t)?t.map(s=>{if(!s||typeof s!="object")return"";const r=s.text;return typeof r=="string"?r:""}).join(""):"",ne=(t,s)=>t==="heading"?`Heading ${typeof s?.level=="number"?s.level:1}`:t==="bulletListItem"?"Bullet":t==="numberedListItem"?"Numbered":t==="checkListItem"?"Checklist":t==="quote"?"Quote":t==="codeBlock"?"Code":"Content",B=(t,s)=>{Array.isArray(t)&&t.forEach(r=>{if(!r||typeof r!="object")return;const a=typeof r.type=="string"?r.type:void 0,i=typeof r.props=="object"&&r.props?r.props:void 0,n=C(ae(r.content));n&&s.push({label:ne(a,i),text:n});const o=r.children;Array.isArray(o)&&B(o,s)})},ie=(t,s)=>{try{const r=JSON.parse(t),a=[];if(B(r,a),a.length===0)return[];const i=L(s),n=i.length>0?a.filter(d=>i.some(l=>d.text.toLowerCase().includes(l))):a;return(n.length>0?n:a).slice(0,2).map(d=>({...d,text:se(d.text,s)}))}catch{return[]}},R=K(V),S=10,oe=400,le=t=>t===1?"1 result":`${t} results`,ce=({searchParams:t,render:s})=>{const{data:r}=F({queryKey:U.search.results(t),async queryFn(){const a=await J(t);if(a.type==="error")throw a;return a.searchNotes}});return s(r)},_=()=>e.jsx("main",{className:"mt-5 flex flex-col gap-3","aria-label":"Searching notes",children:Array.from({length:2},(t,s)=>e.jsxs("div",{className:"surface-base flex flex-col gap-3 p-4",children:[e.jsx(w,{width:"34%",height:18,className:"rounded-full"}),e.jsx("div",{className:"rounded-[14px] bg-muted px-3 py-3",children:e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(w,{width:84,height:12,className:"rounded-full"}),e.jsx(w,{width:"100%",height:14,className:"rounded-full"}),e.jsx(w,{width:"82%",height:14,className:"rounded-full"})]})})]},s))}),de=({result:t,mode:s})=>s==="lexical"||t.semanticAvailable&&!t.semanticError?null:e.jsx(p,{as:"p",variant:"meta",tone:"tertiary",className:"rounded-[14px] border border-border-subtle bg-muted px-3.5 py-2.5",children:s==="semantic"?"Meaning search is not ready. Configure an embedding API and build the index in Search settings.":"Meaning search is not ready, so these results use keyword search only."});function be(){const t=R.useNavigate(),{page:s,query:r,mode:a}=R.useSearch(),[i,n]=f.useState(r),[o,d]=f.useState(!1),l=f.useRef(null),c=r.trim(),{isLoading:g,isSemanticSearchEnabled:h}=G(),u=g||h?a:"lexical";f.useEffect(()=>{n(r)},[r]);const b=f.useCallback(()=>{l.current&&(clearTimeout(l.current),l.current=null)},[]),j=f.useCallback((m,x=u,y=!1)=>{const N={query:m.trim(),page:1,mode:x};if(y){t({search:N,replace:!0});return}t({search:N})},[u,t]);f.useEffect(()=>{if(b(),!(o||i.trim()===c))return l.current=setTimeout(()=>{l.current=null,j(i,u,!0)},oe),b},[u,b,i,o,c,j]);const $=()=>{o||(b(),j(i))},I=m=>{b(),j(i,m)};return e.jsx(z,{title:"Search",description:"Use exact words or describe a half-remembered note",variant:"default",children:e.jsxs("main",{children:[e.jsxs("section",{"aria-label":"Search controls",className:"border-b border-border-subtle pb-5",children:[e.jsx(Z,{value:i,onChange:n,onCompositionChange:d,onSubmit:$,onClear:()=>{b(),j("")},autoFocus:!c}),h&&e.jsx(re,{value:u,onChange:I,className:"mt-2.5"})]}),c?g?e.jsx(_,{}):e.jsx(Q,{fallback:e.jsx(_,{}),errorTitle:"Failed to load search results",errorDescription:`Retry loading results for "${c}".`,resetKeys:[c,s,u],children:e.jsx(ce,{searchParams:{query:c,limit:S,offset:(s-1)*S,mode:u},render:m=>e.jsxs("div",{className:"mt-5 flex flex-col gap-3",children:[e.jsx("div",{className:"flex min-h-7 items-center justify-between gap-3",children:e.jsx(p,{as:"p",variant:"meta",weight:"semibold",tone:"secondary",children:le(m.totalCount)})}),e.jsx(de,{result:m,mode:u}),m.notes.length>0?e.jsx("div",{className:"surface-base divide-y divide-border-subtle overflow-hidden",children:m.notes.map(x=>{const y=ie(x.content,c),N=m.matches.find(v=>v.noteId===x.id);return e.jsxs("article",{className:"flex flex-col gap-2.5 px-4 py-4 transition-colors hover:bg-hover-subtle/40 sm:px-5",children:[e.jsxs("div",{className:"flex min-w-0 items-start justify-between gap-3",children:[e.jsx(p,{as:"h2",variant:"body",weight:"semibold",tracking:"tight",className:"min-w-0",children:e.jsx(q,{to:X,params:{id:x.id},className:"transition-colors hover:text-fg-default/85",children:e.jsx(T,{match:c,children:x.title||"Untitled"})})}),e.jsx(te,{match:N})]}),y.length>0?e.jsx("div",{className:"border-l-2 border-border-subtle pl-3",children:y.map((v,k)=>e.jsxs("div",{className:k>0?"mt-2 border-t border-border-subtle pt-2":void 0,children:[e.jsx(p,{as:"div",variant:"micro",weight:"semibold",tracking:"wider",transform:"uppercase",tone:"tertiary",children:v.label}),e.jsx(p,{as:"p",variant:"meta",tone:"secondary",className:"mt-1 leading-[1.65]",children:e.jsx(T,{match:c,children:v.text})})]},`${x.id}:${v.label}:${k}`))}):e.jsx(p,{as:"p",variant:"meta",tone:"secondary",className:"leading-[1.65]",children:"Open the note to inspect matching content."})]},x.id)})}):e.jsx(A,{title:"No results found",description:u==="semantic"&&!m.semanticAvailable?"Meaning search must be configured before it can find related notes.":"Try another phrase or a different search method."}),m.totalCount>S&&e.jsx(D,{page:s,last:Math.ceil(m.totalCount/S),onChange:x=>{t({search:y=>({...y,page:x,mode:u})})}})]})})}):e.jsx("div",{className:"py-10",children:e.jsx(A,{title:"Start with anything you remember",description:"A name, phrase, rough date, or description all work."})})]})})}export{be as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as f}from"./floating-ui.react-dom-BWTnA00G.js";import{y as o}from"./note.api-BQovzEzd.js";const n=o("surface-base",{variants:{tone:{default:"",elevated:"surface-elevated"},padding:{default:"p-4",compact:"px-3 py-2.5",roomy:"p-6",flush:"overflow-hidden"}},defaultVariants:{tone:"default",padding:"default"}});function i({children:a,className:e,flush:t=!1,padding:d="default",tone:s="default"}){const r=t?"flush":d;return f.jsx("div",{className:n({tone:s,padding:r,className:e}),children:a})}export{i as S};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as p,j as e}from"./floating-ui.react-dom-BWTnA00G.js";import{h as T,q as S,P as k,T as d,A as P,w as y,x,Q as q,C as E,j as A,E as C,k as o,f as O}from"./note.api-BQovzEzd.js";import{u as L,s as I,T as Q,a as R,i as _,b as F,F as v}from"./app-DQBV36r_.js";import{T as B,b as D}from"./url-9nrbQs7Z.js";import{f as z}from"./tag.api-DUfjr8bg.js";import{f as G}from"./Graph-vXQQ0a-Q.js";import"./time-CfAYZipR.js";import"./preload-helper-BXl3LOEh.js";const M=s=>{const{data:h}=T({queryKey:S.tags.list(s.searchParams),async queryFn(){const t=await z({query:s.searchParams.query,offset:s.searchParams.offset,limit:s.searchParams.limit,sortBy:s.searchParams.sortBy,sortOrder:s.searchParams.sortOrder});if(t.type==="error")throw t;return t.allTags}});return s.render(h)},b=O(D);function X(){const s=b.useNavigate(),{page:h,query:t,limit:n,sortBy:l,sortOrder:m}=b.useSearch(),[u,f]=p.useState(t),[,j]=L(350),i=t.trim();p.useEffect(()=>{f(t)},[t]),p.useEffect(()=>{const a=u.trim();a!==i&&j(()=>{s({search:r=>({...r,page:1,query:a})})})},[u,s,i,j]);const g=a=>{s({search:r=>({...r,...a})})},w=()=>{f(""),g({page:1,query:""})};return e.jsxs(k,{title:"Tags",description:"Find tags you added with @ across your notes",children:[e.jsxs("div",{className:"mb-5 flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",children:[e.jsxs("div",{className:"surface-base flex min-w-0 items-center gap-2 rounded-[16px] px-3.5 py-2.5 lg:w-72",children:[e.jsx(G,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),e.jsx(d,{as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Search"}),e.jsx("div",{className:"h-5 w-px bg-divider"}),e.jsx("input",{"aria-label":"Search tags",placeholder:"Search tags",value:u,onChange:a=>f(a.target.value),className:"h-8 min-w-0 flex-1 bg-transparent text-sm font-medium text-fg-default outline-none placeholder:text-xs placeholder:font-medium placeholder:text-fg-placeholder"}),(u||i)&&e.jsx("button",{type:"button","aria-label":"Clear tag search",className:"focus-ring-soft flex h-7 w-7 shrink-0 items-center justify-center rounded-[10px] text-fg-tertiary outline-none transition-colors hover:bg-hover-subtle hover:text-fg-default",onClick:w,children:e.jsx(P,{className:"h-3.5 w-3.5",weight:"bold"})})]}),e.jsxs("div",{className:"surface-base inline-flex flex-wrap items-center gap-3 rounded-[16px] px-3.5 py-2.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(I,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),e.jsx(d,{as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Items"}),e.jsx(y,{value:String(n),onValueChange:a=>{const r=Number(a);_(r)&&g({limit:r,page:1})},variant:"ghost",size:"sm",children:Q.map(a=>e.jsx(x,{value:String(a),children:a===R?`Default (${a})`:a},a))})]}),e.jsx("div",{className:"h-5 w-px bg-divider"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(F,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),e.jsx(d,{as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Sort"}),e.jsxs(y,{value:l,onValueChange:a=>g({sortBy:a,page:1}),variant:"ghost",size:"sm",children:[e.jsx(x,{value:"referenceCount",children:"Usage"}),e.jsx(x,{value:"name",children:"Name"})]}),e.jsxs(y,{value:m,onValueChange:a=>g({sortOrder:a,page:1}),variant:"ghost",size:"sm",children:[e.jsx(x,{value:"desc",children:l==="name"?"Z to A":"Most used"}),e.jsx(x,{value:"asc",children:l==="name"?"A to Z":"Least used"})]})]})]})]}),e.jsx(q,{fallback:e.jsxs("div",{className:"flex flex-wrap gap-2.5",children:[e.jsx(o,{width:"90px",height:"36px"}),e.jsx(o,{width:"120px",height:"36px"}),e.jsx(o,{width:"80px",height:"36px"}),e.jsx(o,{width:"100px",height:"36px"}),e.jsx(o,{width:"110px",height:"36px"}),e.jsx(o,{width:"70px",height:"36px"})]}),errorTitle:"Failed to load tags",errorDescription:"Retry loading the tag catalog",resetKeys:[h,n,i,l,m],children:e.jsx(M,{searchParams:{query:i,offset:(h-1)*n,limit:n,sortBy:l,sortOrder:m},render:({tags:a,totalCount:r})=>e.jsx(v,{fallback:e.jsx(C,{title:i?"No matching tags":"No tags yet",description:i?"Try another tag name":"Add @tags inside notes and they will appear here"}),children:a.length>0&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"flex flex-wrap gap-2.5",children:a.map(c=>e.jsxs(E,{to:B,params:{id:c.id},search:{page:1},className:"inline-flex items-center gap-1.5 rounded-full border border-border-subtle bg-hover-subtle px-3 py-1.5 text-fg-secondary transition-colors hover:border-border-secondary hover:bg-hover hover:text-fg-default",children:[e.jsx(d,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:c.name}),e.jsx(d,{as:"span",variant:"label",weight:"medium",tone:"tertiary",className:"text-current/70",children:c.referenceCount})]},c.id))}),e.jsx(v,{fallback:null,children:r&&n<r&&e.jsx(A,{page:h,last:Math.ceil(r/n),onChange:c=>{s({search:N=>({...N,page:c,query:i,limit:n,sortBy:l,sortOrder:m})})}})})]})})})})]})}export{X as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./floating-ui.react-dom-BWTnA00G.js";import{h as x,D as j,q as N,Q as y,P as c,j as P,E as T,k as o,f as v}from"./note.api-BQovzEzd.js";import{F as h,N as k}from"./app-DQBV36r_.js";import{T as q}from"./url-9nrbQs7Z.js";import"./NotePropertiesPanel-DXYgE8h2.js";import{e as w}from"./time-CfAYZipR.js";import"./preload-helper-BXl3LOEh.js";import"./Graph-vXQQ0a-Q.js";import"./Plus.es-CRRp2u5J.js";const R=s=>{const{data:r}=x({queryKey:N.notes.tagList(s.searchParams),async queryFn(){const t=await j({query:s.searchParams.query,offset:s.searchParams.offset,limit:s.searchParams.limit});if(t.type==="error")throw t;return t.tagNotes}});return s.render(r)},g=v(q);function $(){const s=g.useNavigate(),{id:r}=g.useParams(),{page:t}=g.useSearch(),i=25,{onDelete:m,onPinned:u,deleteWarningDialog:f}=w();return e.jsxs(y,{fallback:e.jsx(c,{title:"Tagged Notes",heading:e.jsx(o,{width:148,height:24,className:"rounded-full"}),description:e.jsx(o,{width:196,height:16,className:"rounded-full"}),variant:"default",children:e.jsxs("div",{className:"grid-auto-cards grid gap-5",children:[e.jsx(o,{height:"112px"}),e.jsx(o,{height:"112px"}),e.jsx(o,{height:"112px"})]})}),errorTitle:"Failed to load tagged notes",errorDescription:"Retry loading notes for this tag",resetKeys:[r,t,i],children:[e.jsx(R,{searchParams:{query:r,offset:(t-1)*i,limit:i},render:({notes:l,totalCount:n})=>{const d=l.flatMap(a=>a.tags).find(a=>a.id===r)?.name;return e.jsx(c,{title:d??"Tagged Notes",heading:d?n>0?`${d} (${n})`:d:"Tagged Notes",description:"Browse every note linked to this tag",variant:"default",children:e.jsx(h,{fallback:e.jsx(T,{title:"No tagged notes yet",description:"Notes tagged with this label will appear here"}),children:l.length>0&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"grid-auto-cards grid gap-5",children:l.map(a=>e.jsx(k,{...a,onPinned:()=>u(a.id,a.pinned),onDelete:()=>m(a.id)},a.id))}),e.jsx(h,{fallback:null,children:n&&i<n&&e.jsx(P,{page:t,last:Math.ceil(n/i),onChange:a=>{s({search:p=>({...p,page:a})})}})})]})})})}}),f]})}export{$ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a}from"./floating-ui.react-dom-
|
|
1
|
+
import{r as a}from"./floating-ui.react-dom-BWTnA00G.js";import{z as l}from"./note.api-BQovzEzd.js";const r=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M117.18,188.74a12,12,0,0,1,0,17l-5.12,5.12A58.26,58.26,0,0,1,70.6,228h0A58.62,58.62,0,0,1,29.14,127.92L63.89,93.17a58.64,58.64,0,0,1,98.56,28.11,12,12,0,1,1-23.37,5.44,34.65,34.65,0,0,0-58.22-16.58L46.11,144.89A34.62,34.62,0,0,0,70.57,204h0a34.41,34.41,0,0,0,24.49-10.14l5.11-5.12A12,12,0,0,1,117.18,188.74ZM226.83,45.17a58.65,58.65,0,0,0-82.93,0l-5.11,5.11a12,12,0,0,0,17,17l5.12-5.12a34.63,34.63,0,1,1,49,49L175.1,145.86A34.39,34.39,0,0,1,150.61,156h0a34.63,34.63,0,0,1-33.69-26.72,12,12,0,0,0-23.38,5.44A58.64,58.64,0,0,0,150.56,180h.05a58.28,58.28,0,0,0,41.47-17.17l34.75-34.75a58.62,58.62,0,0,0,0-82.91Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M218.34,119.6,183.6,154.34a46.58,46.58,0,0,1-44.31,12.26c-.31.34-.62.67-.95,1L103.6,202.34A46.63,46.63,0,1,1,37.66,136.4L72.4,101.66A46.6,46.6,0,0,1,116.71,89.4c.31-.34.62-.67,1-1L152.4,53.66a46.63,46.63,0,0,1,65.94,65.94Z",opacity:"0.2"}),a.createElement("path",{d:"M240,88.23a54.43,54.43,0,0,1-16,37L189.25,160a54.27,54.27,0,0,1-38.63,16h-.05A54.63,54.63,0,0,1,96,119.84a8,8,0,0,1,16,.45A38.62,38.62,0,0,0,150.58,160h0a38.39,38.39,0,0,0,27.31-11.31l34.75-34.75a38.63,38.63,0,0,0-54.63-54.63l-11,11A8,8,0,0,1,135.7,59l11-11A54.65,54.65,0,0,1,224,48,54.86,54.86,0,0,1,240,88.23ZM109,185.66l-11,11A38.41,38.41,0,0,1,70.6,208h0a38.63,38.63,0,0,1-27.29-65.94L78,107.31A38.63,38.63,0,0,1,144,135.71a8,8,0,0,0,7.78,8.22H152a8,8,0,0,0,8-7.78A54.86,54.86,0,0,0,144,96a54.65,54.65,0,0,0-77.27,0L32,130.75A54.62,54.62,0,0,0,70.56,224h0a54.28,54.28,0,0,0,38.64-16l11-11A8,8,0,0,0,109,185.66Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM115.7,192.49a43.31,43.31,0,0,1-55-66.43l25.37-25.37a43.35,43.35,0,0,1,61.25,0,42.9,42.9,0,0,1,9.95,15.43,8,8,0,1,1-15,5.6A27.33,27.33,0,0,0,97.37,112L72,137.37a27.32,27.32,0,0,0,34.68,41.91,8,8,0,1,1,9,13.21Zm79.61-62.55-25.37,25.37A43,43,0,0,1,139.32,168h0a43.35,43.35,0,0,1-40.53-28.12,8,8,0,1,1,15-5.6A27.35,27.35,0,0,0,139.28,152h0a27.14,27.14,0,0,0,19.32-8L184,118.63a27.32,27.32,0,0,0-34.68-41.91,8,8,0,1,1-9-13.21,43.32,43.32,0,0,1,55,66.43Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M238,88.18a52.42,52.42,0,0,1-15.4,35.66l-34.75,34.75A52.28,52.28,0,0,1,150.62,174h-.05A52.63,52.63,0,0,1,98,119.9a6,6,0,0,1,6-5.84h.17a6,6,0,0,1,5.83,6.16A40.62,40.62,0,0,0,150.58,162h0a40.4,40.4,0,0,0,28.73-11.9l34.75-34.74A40.63,40.63,0,0,0,156.63,57.9l-11,11a6,6,0,0,1-8.49-8.49l11-11a52.62,52.62,0,0,1,74.43,0A52.83,52.83,0,0,1,238,88.18Zm-127.62,98.9-11,11A40.36,40.36,0,0,1,70.6,210h0a40.63,40.63,0,0,1-28.7-69.36L76.62,105.9A40.63,40.63,0,0,1,146,135.77a6,6,0,0,0,5.83,6.16H152a6,6,0,0,0,6-5.84A52.63,52.63,0,0,0,68.14,97.42L33.38,132.16A52.63,52.63,0,0,0,70.56,222h0a52.26,52.26,0,0,0,37.22-15.42l11-11a6,6,0,1,0-8.49-8.48Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M240,88.23a54.43,54.43,0,0,1-16,37L189.25,160a54.27,54.27,0,0,1-38.63,16h-.05A54.63,54.63,0,0,1,96,119.84a8,8,0,0,1,16,.45A38.62,38.62,0,0,0,150.58,160h0a38.39,38.39,0,0,0,27.31-11.31l34.75-34.75a38.63,38.63,0,0,0-54.63-54.63l-11,11A8,8,0,0,1,135.7,59l11-11A54.65,54.65,0,0,1,224,48,54.86,54.86,0,0,1,240,88.23ZM109,185.66l-11,11A38.41,38.41,0,0,1,70.6,208h0a38.63,38.63,0,0,1-27.29-65.94L78,107.31A38.63,38.63,0,0,1,144,135.71a8,8,0,0,0,16,.45A54.86,54.86,0,0,0,144,96a54.65,54.65,0,0,0-77.27,0L32,130.75A54.62,54.62,0,0,0,70.56,224h0a54.28,54.28,0,0,0,38.64-16l11-11A8,8,0,0,0,109,185.66Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M236,88.12a50.44,50.44,0,0,1-14.81,34.31l-34.75,34.74A50.33,50.33,0,0,1,150.62,172h-.05A50.63,50.63,0,0,1,100,120a4,4,0,0,1,4-3.89h.11a4,4,0,0,1,3.89,4.11A42.64,42.64,0,0,0,150.58,164h0a42.32,42.32,0,0,0,30.14-12.49l34.75-34.74a42.63,42.63,0,1,0-60.29-60.28l-11,11a4,4,0,0,1-5.66-5.65l11-11A50.64,50.64,0,0,1,236,88.12ZM111.78,188.49l-11,11A42.33,42.33,0,0,1,70.6,212h0a42.63,42.63,0,0,1-30.11-72.77l34.75-34.74A42.63,42.63,0,0,1,148,135.82a4,4,0,0,0,8,.23A50.64,50.64,0,0,0,69.55,98.83L34.8,133.57A50.63,50.63,0,0,0,70.56,220h0a50.33,50.33,0,0,0,35.81-14.83l11-11a4,4,0,1,0-5.65-5.66Z"}))]]),m=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),a.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z"}))]]),n=a.forwardRef((e,t)=>a.createElement(l,{ref:t,...e,weights:r}));n.displayName="LinkIcon";const V=n,h=a.forwardRef((e,t)=>a.createElement(l,{ref:t,...e,weights:m}));h.displayName="TrashIcon";const Z=h;export{V as c,Z as n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,j as t}from"./floating-ui.react-dom-BWTnA00G.js";import{e as _,a as P}from"./time-CfAYZipR.js";import{z as G,P as j,E as M,Q as J,k as u,f as X,u as Y,h as C,q as l,n as ee,j as te,B as T,C as se,T as ae,d as re}from"./note.api-BQovzEzd.js";import{f as ne}from"./tag.api-DUfjr8bg.js";import{f as ie,a as oe,g as le,V as ce,b as v,c as de,d as ue,u as q,e as pe}from"./ViewSectionDialog-Bhw-ILop.js";import{F as K,N as he}from"./app-DQBV36r_.js";import{V as me,c as ge}from"./url-9nrbQs7Z.js";import"./NotePropertiesPanel-DXYgE8h2.js";import{m as fe}from"./PencilLine.es-B9V6u64t.js";import"./preload-helper-BXl3LOEh.js";import"./Graph-vXQQ0a-Q.js";import"./Plus.es-CRRp2u5J.js";const ye=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),s.createElement("path",{d:"M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z"}))]]),k=s.forwardRef((i,o)=>s.createElement(G,{ref:o,...i,weights:ye}));k.displayName="ArrowLeftIcon";const xe=k,b=X(me);function we(){const i=b.useNavigate(),o=Y(),N=re(),{page:p,sectionId:d}=b.useSearch(),{onDelete:A,onPinned:L,deleteWarningDialog:R}=_(),[S,g]=s.useState(!1),[f,y]=s.useState(!1),n=25,{data:a}=C({queryKey:l.views.section(d),async queryFn(){const e=await ie(d);if(e.type==="error")throw e;if(!e.viewSection)throw new Error("View section not found.");return e.viewSection}}),{data:r}=C({queryKey:l.views.sectionNotes(d,{limit:n,offset:(p-1)*n}),async queryFn(){const e=await oe(d,{limit:n,offset:(p-1)*n});if(e.type==="error")throw e;return e.viewSectionNotes}}),{data:D,isPending:H}=P({queryKey:l.tags.list({limit:200}),enabled:f,async queryFn(){const e=await ne({limit:200});if(e.type==="error")throw e;return e.allTags}}),{data:I,isPending:O}=P({queryKey:l.notes.propertyKeys({limit:100}),enabled:f,async queryFn(){const e=await ee({limit:100});if(e.type==="error")throw e;return e.notePropertyKeys}}),x=a.title,h=a.tagNames,Q=a.mode,w=a.propertyFilters,Z=h.length>0,E=w.length>0,V=h.length>1?` · ${le(Q)}`:"",$=Z?E?`Property and tag filters${V}`:`Tag filters${V}`:E?"Property filters":"All notes",F=t.jsx(K,{fallback:null,children:r.totalCount&&n<r.totalCount&&t.jsx(te,{page:p,last:Math.ceil(r.totalCount/n),onChange:e=>{i({search:c=>({...c,page:e})})}})}),z=D?.tags??[],B=I?.keys??[],U=async e=>{if(S)return;const c=a.sortBy===e?a.sortOrder==="asc"?"desc":"asc":e==="title"?"asc":"desc";g(!0);const m=await q(a.id,pe(a,{sortBy:e,sortOrder:c}));if(m.type==="error"){N(m.errors[0]?.message??"Failed to update table sort."),g(!1);return}await o.invalidateQueries({queryKey:l.views.all(),exact:!1}),g(!1)},W=async e=>{const c=await q(a.id,e);if(c.type==="error"){N(c.errors[0]?.message??"Failed to update section.");return}await o.invalidateQueries({queryKey:l.views.all(),exact:!1}),i({search:m=>({...m,page:1})}),y(!1)};return t.jsxs(t.Fragment,{children:[t.jsxs(j,{title:x,heading:r.totalCount>0?`${x} (${r.totalCount})`:x,description:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(ae,{as:"span",variant:"meta",tone:"tertiary",children:$}),t.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[h.map(e=>t.jsx(v,{className:"max-w-full border-border-subtle bg-hover-subtle text-fg-secondary",children:e},e)),w.map(e=>t.jsx(v,{className:"max-w-full border-border-subtle bg-hover-subtle text-fg-secondary",children:de(e)},`${e.key}-${e.operator}-${e.value??""}`)),h.length===0&&w.length===0&&t.jsx(v,{className:"max-w-full border-border-subtle bg-hover-subtle text-fg-secondary",children:"All notes"})]})]}),headerRight:t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx(T,{asChild:!0,variant:"ghost",size:"sm",children:t.jsxs(se,{to:ge,children:[t.jsx(xe,{className:"h-4 w-4"}),"Back to Views"]})}),t.jsxs(T,{type:"button",variant:"subtle",size:"sm",onClick:()=>y(!0),children:[t.jsx(fe,{className:"h-4 w-4"}),"Edit section"]})]}),children:[t.jsx(K,{fallback:t.jsx(M,{title:"No notes match this saved view",description:"Adjust this view's filters or keep writing until matching notes appear."}),children:r.notes.length>0&&a.displayType==="table"?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(ce,{section:a,notes:r.notes,isPending:!1,isError:!1,surface:"card",onRetry:()=>{o.invalidateQueries({queryKey:l.views.sectionNotes(d,{limit:n,offset:(p-1)*n})})},onSortChange:U,isSortPending:S}),F]}):r.notes.length>0?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx("div",{className:"grid-auto-cards grid gap-5",children:r.notes.map(e=>t.jsx(he,{...e,onPinned:()=>L(e.id,e.pinned),onDelete:()=>A(e.id)},e.id))}),F]}):null}),R]}),t.jsx(ue,{open:f,mode:"edit",initialSection:a,availableTags:z,availableProperties:B,isTagsLoading:H,isPropertiesLoading:O,onClose:()=>y(!1),onSubmit:W})]})}function Ke(){const{sectionId:i,page:o}=b.useSearch();return i?t.jsx(J,{fallback:t.jsx(j,{title:"View Notes",heading:t.jsx(u,{width:180,height:24,className:"rounded-full"}),description:t.jsx(u,{width:220,height:16,className:"rounded-full"}),children:t.jsxs("div",{className:"grid-auto-cards grid gap-5",children:[t.jsx(u,{height:"112px"}),t.jsx(u,{height:"112px"}),t.jsx(u,{height:"112px"})]})}),errorTitle:"Failed to load view notes",errorDescription:"Retry loading notes for this saved view section",resetKeys:[o,i],children:t.jsx(we,{})}):t.jsx(j,{title:"View Notes",description:"Saved view note lists require a section id.",children:t.jsx(M,{title:"No section selected",description:"Return to Views and open a section from there."})})}export{Ke as default};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import{g as v,H as ae,T as d,B as V,C as _e,M as P,L as f,I as re,a as ne,b as R,F as Me,w as T,x as p,c as qe}from"./note.api-BQovzEzd.js";import{j as t,r as g}from"./floating-ui.react-dom-BWTnA00G.js";import{t as ie,M as Be}from"./time-CfAYZipR.js";import{N as Pe}from"./url-9nrbQs7Z.js";const Z=`
|
|
2
|
+
id
|
|
3
|
+
tabId
|
|
4
|
+
title
|
|
5
|
+
displayType
|
|
6
|
+
displayOptions {
|
|
7
|
+
tableColumns
|
|
8
|
+
}
|
|
9
|
+
tagNames
|
|
10
|
+
mode
|
|
11
|
+
propertyFilters {
|
|
12
|
+
key
|
|
13
|
+
name
|
|
14
|
+
valueType
|
|
15
|
+
operator
|
|
16
|
+
value
|
|
17
|
+
}
|
|
18
|
+
sortBy
|
|
19
|
+
sortOrder
|
|
20
|
+
limit
|
|
21
|
+
order
|
|
22
|
+
`;function ot(){return v(`query FetchViewWorkspace {
|
|
23
|
+
viewWorkspace {
|
|
24
|
+
activeTabId
|
|
25
|
+
tabs {
|
|
26
|
+
id
|
|
27
|
+
title
|
|
28
|
+
order
|
|
29
|
+
sections {
|
|
30
|
+
${Z}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}`)}function dt(e){return v(`query FetchViewSection($id: ID!) {
|
|
35
|
+
viewSection(id: $id) {
|
|
36
|
+
${Z}
|
|
37
|
+
}
|
|
38
|
+
}`,{id:e})}function ct(e,{limit:a=25,offset:s=0}={}){return v(`query FetchViewSectionNotes($id: ID!, $pagination: PaginationInput) {
|
|
39
|
+
viewSectionNotes(id: $id, pagination: $pagination) {
|
|
40
|
+
totalCount
|
|
41
|
+
notes {
|
|
42
|
+
id
|
|
43
|
+
title
|
|
44
|
+
pinned
|
|
45
|
+
tags {
|
|
46
|
+
id
|
|
47
|
+
name
|
|
48
|
+
}
|
|
49
|
+
createdAt
|
|
50
|
+
updatedAt
|
|
51
|
+
properties {
|
|
52
|
+
key
|
|
53
|
+
name
|
|
54
|
+
value
|
|
55
|
+
valueType
|
|
56
|
+
option { id label value color order }
|
|
57
|
+
createdAt
|
|
58
|
+
updatedAt
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}`,{id:e,pagination:{limit:a,offset:s}})}function ut(e){return v(`mutation CreateViewTab($title: String!) {
|
|
63
|
+
createViewTab(title: $title) {
|
|
64
|
+
id
|
|
65
|
+
}
|
|
66
|
+
}`,{title:e})}function mt(e,a){return v(`mutation UpdateViewTab($id: ID!, $title: String!) {
|
|
67
|
+
updateViewTab(id: $id, title: $title) {
|
|
68
|
+
id
|
|
69
|
+
}
|
|
70
|
+
}`,{id:e,title:a})}function pt(e){return v(`mutation DeleteViewTab($id: ID!) {
|
|
71
|
+
deleteViewTab(id: $id)
|
|
72
|
+
}`,{id:e})}function xt(e){return v(`mutation SetActiveViewTab($id: ID!) {
|
|
73
|
+
setActiveViewTab(id: $id) {
|
|
74
|
+
activeTabId
|
|
75
|
+
tabs {
|
|
76
|
+
id
|
|
77
|
+
title
|
|
78
|
+
order
|
|
79
|
+
sections {
|
|
80
|
+
${Z}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}`,{id:e})}function bt(e){return v(`mutation ReorderViewTabs($tabIds: [ID!]!) {
|
|
85
|
+
reorderViewTabs(tabIds: $tabIds) {
|
|
86
|
+
id
|
|
87
|
+
}
|
|
88
|
+
}`,{tabIds:e})}function ht(e,a){return v(`mutation CreateViewSection($tabId: ID!, $input: ViewSectionInput!) {
|
|
89
|
+
createViewSection(tabId: $tabId, input: $input) {
|
|
90
|
+
id
|
|
91
|
+
}
|
|
92
|
+
}`,{tabId:e,input:a})}function gt(e,a){return v(`mutation UpdateViewSection($id: ID!, $input: ViewSectionInput!) {
|
|
93
|
+
updateViewSection(id: $id, input: $input) {
|
|
94
|
+
id
|
|
95
|
+
}
|
|
96
|
+
}`,{id:e,input:a})}function vt(e){return v(`mutation DeleteViewSection($id: ID!) {
|
|
97
|
+
deleteViewSection(id: $id)
|
|
98
|
+
}`,{id:e})}function yt(e,a){return v(`mutation ReorderViewSections($tabId: ID!, $sectionIds: [ID!]!) {
|
|
99
|
+
reorderViewSections(tabId: $tabId, sectionIds: $sectionIds) {
|
|
100
|
+
id
|
|
101
|
+
}
|
|
102
|
+
}`,{tabId:e,sectionIds:a})}const Re={compact:"h-[22px] px-2",regular:"h-7 px-2.5"};function W({children:e,className:a,contentClassName:s,size:n="regular",truncateContent:i=!0,...x}){return t.jsx("span",{className:ae("inline-flex min-w-0 items-center overflow-hidden whitespace-nowrap rounded-full border text-xs font-medium leading-none",Re[n],a),...x,children:i?t.jsx("span",{className:ae("min-w-0 truncate",s),children:e}):e})}const X=["title","tags","properties","createdAt","updatedAt"],ft={activeTabId:null,tabs:[]},We=e=>{const a=e.trim();return a?a.startsWith("@")?a:a.startsWith("#")?"":`@${a}`:""},fe=(e,a,s)=>{if(a===s)return e;const n=e.findIndex(b=>b.id===a),i=e.findIndex(b=>b.id===s);if(n<0||i<0)return e;const x=[...e],[j]=x.splice(n,1);return x.splice(i,0,j),x},je=(e,a,s)=>{const n=e.findIndex(x=>x.id===a),i=n+(s==="previous"?-1:1);return n>=0&&i>=0&&i<e.length?e[i]?.id:void 0},le=e=>{const a=e.flatMap(s=>typeof s=="string"?s.split(","):[]);return Array.from(new Set(a.map(We).filter(Boolean)))},jt=e=>e.tabs.length===0?null:e.activeTabId?e.tabs.find(a=>a.id===e.activeTabId)??e.tabs[0]??null:e.tabs[0]??null,wt=(e,a)=>e.tabs.some(s=>s.id===a)?{...e,activeTabId:a}:e,Ue=(e,a,s)=>({...e,tabs:fe(e.tabs,a,s)}),He=(e,a,s,n)=>({...e,tabs:e.tabs.map(i=>i.id===a?{...i,sections:fe(i.sections,s,n)}:i)}),Nt=(e,a,s)=>{const n=je(e.tabs,a,s);return n?Ue(e,a,n):e},Tt=(e,a,s,n)=>{const i=e.tabs.find(j=>j.id===a)?.sections??[],x=je(i,s,n);return x?He(e,a,s,x):e},oe=e=>e==="or"?"OR — any selected tag":"AND — all selected tags",Vt=e=>e==="or"?"OR":"AND",we=e=>{switch(e){case"notEquals":return"is not";case"contains":return"contains";case"notContains":return"does not contain";case"before":return"before";case"after":return"after";case"exists":return"is set";case"notExists":return"is empty";default:return"is"}},Ye=e=>{switch(e){case"table":return"Table";case"calendar":return"Unavailable";default:return"List"}},Ne=e=>{switch(e){case"tags":return"Tags";case"properties":return"Properties";case"createdAt":return"Created";case"updatedAt":return"Updated";default:return"Title"}},U=e=>{const a=new Set(X),s=(e??[]).filter(i=>a.has(i)),n=Array.from(new Set(s));return n.length===0?[...X]:n.includes("title")?n:["title",...n]},Te=e=>({tableColumns:U(e?.tableColumns)}),It=e=>{const a=we(e.operator);return e.operator==="exists"||e.operator==="notExists"?`${e.name} ${a}`:`${e.name} ${a} ${e.value??""}`.trim()},Ct=(e,a={})=>{const s={...e,...a};return{title:s.title,displayType:s.displayType,displayOptions:Te(s.displayOptions),tagNames:s.tagNames,mode:s.mode,propertyFilters:s.propertyFilters.map(n=>({key:n.key,valueType:n.valueType,operator:n.operator,value:n.value})),sortBy:s.sortBy,sortOrder:s.sortOrder,limit:s.limit}},St=e=>({page:1,sectionId:e.id}),Ge=e=>e.valueType==="select"?e.option?.label??e.value:e.valueType==="boolean"?e.value==="true"?"True":"False":e.value,Ke=e=>(e.properties??[]).slice(0,3),Ve={title:280,tags:190,properties:260,createdAt:132,updatedAt:132},Qe={title:"title",createdAt:"createdAt",updatedAt:"updatedAt"},Ie="flex h-[22px] min-w-0 max-w-full items-center gap-1.5 overflow-hidden whitespace-nowrap",Ce="text-xs leading-5 text-fg-tertiary",Je=e=>{const a=e.reduce((s,n)=>s+Ve[n],0);return Math.max(520,a)},Xe=(e,a={})=>{if(e.tags.length===0)return a.hideEmpty?null:t.jsx("span",{className:Ce,children:"—"});const s=e.tags.slice(0,3),n=e.tags.length-s.length;return t.jsxs("div",{className:Ie,children:[s.map(i=>t.jsx(W,{size:"compact",className:"max-w-[132px] shrink-0 border-border-subtle bg-transparent text-fg-secondary",children:i.name},i.id)),n>0&&t.jsxs(W,{size:"compact",className:"shrink-0 border-border-subtle bg-subtle text-fg-tertiary",children:["+",n]})]})},Ze=(e,a={})=>{const s=Ke(e);if(s.length===0)return a.hideEmpty?null:t.jsx("span",{className:Ce,children:"—"});const n=(e.properties?.length??0)-s.length;return t.jsxs("div",{className:Ie,children:[s.map(i=>t.jsxs(W,{size:"compact",truncateContent:!1,className:"max-w-[190px] shrink-0 gap-1 border-border-subtle bg-subtle text-fg-secondary",children:[t.jsx("span",{className:"min-w-0 max-w-[76px] shrink truncate text-fg-tertiary",children:i.name}),t.jsx("span",{className:"min-w-0 truncate",children:Ge(i)||"—"})]},i.key)),n>0&&t.jsxs(W,{size:"compact",className:"shrink-0 border-border-subtle bg-subtle text-fg-tertiary",children:["+",n]})]})};function At({section:e,notes:a,isPending:s,isError:n,onRetry:i,onSortChange:x,isSortPending:j,surface:b="flush"}){const I=U(e.displayOptions?.tableColumns),z=Je(I),L=b==="card"?"overflow-x-auto rounded-[16px] border border-border-subtle bg-elevated":"overflow-x-auto bg-transparent",C=b==="card"?"overflow-hidden rounded-[16px] border border-border-subtle bg-elevated":"overflow-hidden bg-transparent",S=b==="card"?"bg-elevated":"bg-transparent",F=b==="card"?"bg-subtle/65":"bg-subtle/45",_=b==="card"?"bg-elevated":"bg-transparent",E=c=>{const u=Qe[c],O=Ne(c),k=u?e.sortBy===u:!1;return t.jsx("th",{"aria-sort":k?e.sortOrder==="asc"?"ascending":"descending":void 0,className:"px-3 py-2.5 text-xs font-semibold text-fg-tertiary",children:u?t.jsxs("button",{type:"button",className:"focus-ring-soft -ml-1 inline-flex items-center gap-1 rounded-[8px] px-1 py-0.5 outline-none transition-colors hover:bg-hover-subtle hover:text-fg-secondary disabled:cursor-wait disabled:opacity-60",disabled:j,onClick:()=>x(u),children:[t.jsx("span",{children:O}),t.jsx("span",{"aria-hidden":"true",className:"text-[10px] text-fg-tertiary",children:k?e.sortOrder==="asc"?"↑":"↓":"↕"})]}):O},c)},A=(c,u)=>{switch(u){case"tags":return t.jsx("td",{className:"overflow-hidden px-3 py-2.5 align-middle",children:Xe(c)},u);case"properties":return t.jsx("td",{className:"overflow-hidden px-3 py-2.5 align-middle",children:Ze(c)},u);case"createdAt":return t.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 align-middle",children:t.jsx(d,{as:"span",variant:"meta",tone:"tertiary",children:ie(Number(c.createdAt))})},u);case"updatedAt":return t.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 align-middle",children:t.jsx(d,{as:"span",variant:"meta",tone:"tertiary",children:ie(Number(c.updatedAt))})},u);default:return t.jsx("td",{className:"px-3 py-2.5 align-middle",children:t.jsx(d,{as:"div",variant:"body",weight:"semibold",className:"line-clamp-1",children:t.jsx(_e,{to:Pe,params:{id:c.id},className:"focus-ring-soft rounded-[6px] outline-none transition-colors hover:text-fg-default/85",children:c.title||"Untitled"})})},u)}};return s?t.jsxs("div",{className:C,children:[t.jsx("div",{className:"h-11 animate-pulse bg-subtle/50"}),t.jsx("div",{className:`h-14 animate-pulse border-t border-border-subtle ${S}`}),t.jsx("div",{className:`h-14 animate-pulse border-t border-border-subtle ${S}`}),t.jsx("div",{className:`h-14 animate-pulse border-t border-border-subtle ${S}`})]}):n?t.jsxs("div",{className:"rounded-[16px] border border-border-subtle bg-subtle/30 p-4",children:[t.jsx(d,{as:"p",variant:"body",weight:"semibold",children:"Failed to load this table"}),t.jsx(d,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Retry to refresh this saved query."}),t.jsx("div",{className:"mt-3",children:t.jsx(V,{type:"button",variant:"ghost",size:"sm",onClick:i,children:"Retry"})})]}):a.length===0?t.jsxs("div",{className:"rounded-[16px] border border-dashed border-border-subtle px-4 py-5",children:[t.jsx(d,{as:"p",variant:"body",weight:"semibold",children:"No rows yet"}),t.jsx(d,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Add matching notes, or edit this view query."})]}):t.jsx("div",{className:L,children:t.jsxs("table",{className:"w-full table-fixed border-collapse text-left",style:{minWidth:z},children:[t.jsx("caption",{className:"sr-only",children:"View query results as a table"}),t.jsx("colgroup",{children:I.map(c=>t.jsx("col",{style:{width:Ve[c]}},c))}),t.jsx("thead",{className:F,children:t.jsx("tr",{className:"border-b border-border-subtle",children:I.map(E)})}),t.jsx("tbody",{className:_,children:a.map(c=>t.jsx("tr",{className:"h-12 border-b border-border-subtle/70 last:border-b-0",children:I.map(u=>A(c,u))},c.id))})]})})}const Q="__choose_property__",et=["title","tags","properties","createdAt","updatedAt"],de=e=>String(e?.limit??5),ce=e=>e?.displayType==="table"?"table":"list",ue=e=>U(e?.displayOptions?.tableColumns??X),me=e=>e?.mode??"and",pe=e=>e?e.tagNames.join(", "):"",xe=e=>e?.title??"",be=e=>e?.sortBy??"updatedAt",he=e=>e?.sortOrder??"desc",Se=e=>`property-filter-${Date.now()}-${e}`,ge=e=>(e?.propertyFilters??[]).map((a,s)=>({id:Se(s),key:a.key,operator:a.operator,value:a.value??""})),ve=e=>e?e.valueType==="date"||e.valueType==="number"?["equals","notEquals","before","after","exists","notExists"]:e.valueType==="text"||e.valueType==="url"?["equals","notEquals","contains","notContains","exists","notExists"]:["equals","notEquals","exists","notExists"]:["exists","notExists"],ye=e=>e?"equals":"exists",tt=e=>e?e.valueType==="boolean"?"true":e.valueType==="select"?e.options[0]?.value??"":"":"",J=e=>e!=="exists"&&e!=="notExists",Ae=e=>e==="contains"||e==="notContains",st=(e,a)=>e.valueType==="date"?"date":e.valueType==="number"?"number":e.valueType==="url"&&!Ae(a)?"url":"text",at=(e,a)=>{if(e.valueType==="url")return Ae(a)?"example.com":"https://example.com";if(e.valueType==="text")return"Value"};function $t({open:e,mode:a,initialSection:s=null,availableTags:n,availableProperties:i,isTagsLoading:x=!1,isPropertiesLoading:j=!1,onClose:b,onSubmit:I}){const[z,L]=g.useState(xe(s)),[C,S]=g.useState(ce(s)),[F,_]=g.useState(ue(s)),[E,A]=g.useState(pe(s)),[c,u]=g.useState(me(s)),[O,k]=g.useState(be(s)),[ee,te]=g.useState(he(s)),[H,se]=g.useState(de(s)),[$,M]=g.useState(ge(s)),[$e,Y]=g.useState((s?.tagNames.length??0)>0),[G,h]=g.useState(""),q=g.useMemo(()=>new Map(i.map(r=>[r.key,r])),[i]);g.useEffect(()=>{e&&(L(xe(s)),S(ce(s)),_(ue(s)),A(pe(s)),u(me(s)),k(be(s)),te(he(s)),se(de(s)),M(ge(s)),Y((s?.tagNames.length??0)>0),h(""))},[s,e]);const w=le([E]),B=$e||w.length>0,Fe=w.length===0&&$.length===0,Ee=r=>{r!=="title"&&(_(o=>{if(o.includes(r)){const y=o.filter(l=>l!==r);return y.length>0?y:o}return U([...o,r])}),h(""))},Oe=r=>{const o=w.includes(r)?w.filter(y=>y!==r):[...w,r];A(o.join(", ")),h("")},ke=()=>{Y(!0),h("")},De=()=>{A(""),u("and"),Y(!1),h("")},ze=()=>{if(i.length===0){h("Create a shared property before adding a filter.");return}M(r=>[...r,{id:Se(r.length),key:"",operator:"exists",value:""}]),h("")},D=(r,o)=>{M(y=>y.map(l=>{if(l.id!==r)return l;const N={...l,...o},m=q.get(N.key);return ve(m).includes(N.operator)||(N.operator=ye(m)),"key"in o&&(N.value=tt(m),N.operator=ye(m)),N})),h("")},Le=r=>{M(o=>o.filter(y=>y.id!==r)),h("")};return t.jsxs(P,{isOpen:e,onClose:b,variant:"form",className:"sm:max-w-[720px]",children:[t.jsx(P.Header,{title:a==="create"?"Create section":"Edit section",onClose:b}),t.jsx(P.Body,{children:t.jsxs("form",{id:"view-section-form",className:"flex flex-col gap-5",onSubmit:r=>{r.preventDefault();const o=le([E]);if(B&&o.length===0){h("Choose at least one tag, or remove this tag filter.");return}if($.find(m=>!m.key||!q.has(m.key))){h("Choose a property for every filter.");return}const l=$.map(m=>{const K=q.get(m.key);return{key:K?.key??m.key,valueType:K?.valueType??"text",operator:m.operator,value:J(m.operator)?m.value:null}});if(l.some(m=>J(m.operator)&&!m.value?.trim())){h("Fill every filter value, or switch it to is set / is empty.");return}I({title:z,displayType:C,displayOptions:Te({tableColumns:F}),tagNames:o,mode:c,propertyFilters:l,sortBy:O,sortOrder:ee,limit:Number(H)})},children:[t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(f,{htmlFor:"view-section-title",size:"md",children:"Section name"}),t.jsx(re,{id:"view-section-title",value:z,onChange:r=>L(r.target.value),placeholder:"Doing notes",autoFocus:!0})]}),t.jsxs("section",{className:"flex flex-col gap-3 rounded-[18px] border border-border-subtle bg-elevated px-4 py-3",children:[t.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx(f,{size:"md",children:"Display"}),t.jsx(d,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Show the same query as a compact list or a table."})]}),t.jsx(d,{as:"span",variant:"meta",tone:"tertiary",children:Ye(C)})]}),t.jsxs(ne,{type:"single",value:C,onValueChange:r=>{(r==="list"||r==="table")&&S(r)},variant:"quiet",size:"sm",className:"self-start",children:[t.jsx(R,{value:"list","aria-label":"Show as list",children:"List"}),t.jsx(R,{value:"table","aria-label":"Show as table",children:"Table"})]}),C==="table"?t.jsxs("div",{className:"rounded-[16px] border border-border-subtle bg-subtle/45 p-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t.jsx(f,{size:"sm",children:"Table columns"}),t.jsxs(d,{as:"span",variant:"meta",tone:"tertiary",children:[F.length," shown"]})]}),t.jsx("div",{className:"mt-3 grid gap-2 sm:grid-cols-2",children:et.map(r=>{const o=Ne(r);return t.jsxs("div",{className:"flex items-center gap-2 rounded-[12px] border border-border-subtle bg-elevated px-3 py-2",children:[t.jsx(Me,{size:"sm",checked:F.includes(r),disabled:r==="title","aria-label":`Show ${o} column`,onChange:()=>Ee(r)}),t.jsx(d,{as:"span",variant:"label",tone:"secondary",children:o})]},r)})}),t.jsx(d,{as:"p",variant:"meta",tone:"tertiary",className:"mt-2",children:"Title is always shown because it opens the note."})]}):null]}),t.jsxs("section",{className:"flex flex-col gap-3 rounded-[20px] border border-border-subtle bg-subtle/40 p-4",children:[t.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx(f,{size:"md",children:"Filters"}),t.jsx(d,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Use properties for structured fields, and tags for loose topics or context."})]}),t.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.jsx(V,{type:"button",variant:"subtle",size:"sm",onClick:ze,children:"Add property filter"}),!B&&t.jsx(V,{type:"button",variant:"subtle",size:"sm",onClick:ke,children:"Add tag filter"})]})]}),$.length===0&&!B?t.jsxs("div",{className:"rounded-[16px] border border-dashed border-border-subtle bg-elevated/60 px-4 py-3",children:[t.jsx(d,{as:"p",variant:"label",tone:"default",children:Fe?"All notes":"No filters"}),t.jsx(d,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Add a property filter, a tag filter, or leave this view open to all notes."})]}):null,$.length>0?t.jsx("div",{className:"flex flex-col gap-2.5",children:$.map(r=>{const o=q.get(r.key),y=ve(o);return t.jsxs("div",{className:"grid gap-2 rounded-[16px] border border-border-subtle bg-elevated p-3 md:grid-cols-[minmax(0,1fr)_minmax(10.5rem,12rem)_minmax(0,1fr)_auto] md:items-center",children:[t.jsxs(T,{value:r.key||Q,ariaLabel:"Property filter property",className:"w-full min-w-0",onValueChange:l=>{l!==Q&&D(r.id,{key:l})},children:[t.jsx(p,{value:Q,disabled:!0,children:"Choose property"}),i.map(l=>t.jsx(p,{value:l.key,children:l.name},l.key))]}),t.jsx(T,{value:r.operator,disabled:!o,ariaLabel:"Property filter operator",className:"w-full min-w-0",onValueChange:l=>D(r.id,{operator:l}),children:y.map(l=>t.jsx(p,{value:l,children:we(l)},l))}),J(r.operator)&&o?o.valueType==="select"?t.jsx(T,{value:r.value,ariaLabel:"Property filter value",className:"w-full min-w-0",onValueChange:l=>D(r.id,{value:l}),children:o.options.map(l=>t.jsx(p,{value:l.value,children:l.label},l.value))}):o.valueType==="boolean"?t.jsxs(T,{value:r.value||"true",ariaLabel:"Property filter value",className:"w-full min-w-0",onValueChange:l=>D(r.id,{value:l}),children:[t.jsx(p,{value:"true",children:"True"}),t.jsx(p,{value:"false",children:"False"})]}):t.jsx(re,{type:st(o,r.operator),value:r.value,onChange:l=>D(r.id,{value:l.target.value}),placeholder:at(o,r.operator),"aria-label":"Property filter value"}):t.jsx(d,{as:"span",variant:"label",tone:"tertiary",children:o?"No value needed":"Choose a property first"}),t.jsx(V,{type:"button",variant:"ghost",size:"sm",onClick:()=>Le(r.id),children:"Remove"})]},r.id)})}):null,B?t.jsxs("div",{className:"flex flex-col gap-3 rounded-[16px] border border-border-subtle bg-elevated p-3",children:[t.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx(d,{as:"p",variant:"label",tone:"default",children:"Tag filter"}),t.jsx(d,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Match notes by selected tags."})]}),t.jsx(V,{type:"button",variant:"ghost",size:"sm",onClick:De,children:"Remove"})]}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(f,{htmlFor:"view-section-tags",size:"sm",children:"Tag names"}),t.jsx(qe,{id:"view-section-tags",value:E,onChange:r=>{A(r.target.value),h("")},placeholder:"@OceanBrain, @todo",size:"sm"}),t.jsx(d,{as:"p",variant:"meta",tone:"tertiary",children:"You can use tags only, properties only, both together, or no filters."})]}),w.length>1?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(f,{size:"sm",children:"Tag match"}),t.jsxs(ne,{type:"single",value:c,onValueChange:r=>{(r==="and"||r==="or")&&u(r)},variant:"quiet",size:"sm",className:"self-start",children:[t.jsx(R,{value:"and","aria-label":oe("and"),children:"AND"}),t.jsx(R,{value:"or","aria-label":oe("or"),children:"OR"})]}),t.jsx(d,{as:"p",variant:"meta",tone:"tertiary",children:"AND requires every selected tag. OR accepts any selected tag."})]}):null,t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(f,{size:"sm",children:"Existing tags"}),t.jsx(d,{as:"span",variant:"meta",tone:"tertiary",children:x?"Loading...":`${n.length} available`})]}),n.length>0?t.jsx("div",{className:"max-h-44 overflow-y-auto rounded-[16px] border border-border-subtle bg-hover-subtle/60 p-3",children:t.jsx("div",{className:"flex flex-wrap gap-2",children:n.map(r=>{const o=w.includes(r.name);return t.jsx("button",{type:"button",className:`inline-flex items-center rounded-full border px-3 py-1.5 text-sm font-medium transition-colors ${o?"border-border-secondary bg-elevated text-fg-default":"border-border-subtle bg-transparent text-fg-secondary hover:border-border-secondary hover:bg-elevated hover:text-fg-default"}`,"aria-pressed":o,onClick:()=>Oe(r.name),children:r.name},r.id)})})}):t.jsx(d,{as:"p",variant:"meta",tone:"tertiary",children:"No tags yet. You can still type tag names manually."})]}):null,t.jsx(d,{as:"p",variant:"meta",tone:G?"default":"tertiary",className:G?"text-fg-error":void 0,children:G||(j||x?"Loading filter options...":`${i.length} properties · ${n.length} tags available`)})]}),t.jsxs("details",{className:"group rounded-[18px] border border-border-subtle bg-elevated px-4 py-3",children:[t.jsx("summary",{className:"cursor-pointer list-none",children:t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsxs("div",{children:[t.jsx(d,{as:"span",variant:"label",tone:"default",children:"Sort and limit"}),t.jsx(d,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Controls how many matching notes appear on the Views page preview."})]}),t.jsxs(d,{as:"span",variant:"meta",tone:"tertiary",children:[H," notes"]})]})}),t.jsxs("div",{className:"mt-4 grid gap-4 md:grid-cols-3",children:[t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(f,{id:"view-section-sort-by-label",htmlFor:"view-section-sort-by",size:"sm",children:"Sort by"}),t.jsxs(T,{id:"view-section-sort-by",value:O,"aria-labelledby":"view-section-sort-by-label",onValueChange:r=>k(r),children:[t.jsx(p,{value:"updatedAt",children:"Updated time"}),t.jsx(p,{value:"createdAt",children:"Created time"}),t.jsx(p,{value:"title",children:"Title"})]})]}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(f,{id:"view-section-sort-order-label",htmlFor:"view-section-sort-order",size:"sm",children:"Order"}),t.jsxs(T,{id:"view-section-sort-order",value:ee,"aria-labelledby":"view-section-sort-order-label",onValueChange:r=>te(r),children:[t.jsx(p,{value:"desc",children:"Descending"}),t.jsx(p,{value:"asc",children:"Ascending"})]})]}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(f,{id:"view-section-limit-label",htmlFor:"view-section-limit",size:"sm",children:"Preview rows"}),t.jsxs(T,{id:"view-section-limit",value:H,"aria-labelledby":"view-section-limit-label",onValueChange:se,children:[t.jsx(p,{value:"3",children:"3 rows"}),t.jsx(p,{value:"5",children:"5 rows"}),t.jsx(p,{value:"8",children:"8 rows"}),t.jsx(p,{value:"10",children:"10 rows"}),t.jsx(p,{value:"12",children:"12 rows"})]})]})]})]})]})}),t.jsx(P.Footer,{children:t.jsxs(Be,{children:[t.jsx(V,{type:"button",variant:"ghost",size:"sm",onClick:b,children:"Cancel"}),t.jsx(V,{type:"submit",size:"sm",form:"view-section-form",children:a==="create"?"Create section":"Save section"})]})})]})}export{ft as E,At as V,ct as a,W as b,It as c,$t as d,Ct as e,dt as f,oe as g,St as h,Vt as i,Ye as j,ot as k,jt as l,Nt as m,xt as n,He as o,Tt as p,ut as q,Ue as r,wt as s,mt as t,gt as u,pt as v,ht as w,vt as x,bt as y,yt as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,r as T}from"./floating-ui.react-dom-BWTnA00G.js";import{k as H,l as E,m as G,K as Y,M as ge,D as J,r as we,n as X,S as Z,o as ye,p as ee,C as te,P as ve,q as je,v as Ne,w as Se}from"./app-DQBV36r_.js";import{t as ke,a as D,f as se,M as Te,u as Ce}from"./time-CfAYZipR.js";import{T as h,B as y,C as I,u as ae,q as g,G as re,d as ie,H as K,M as V,L as Ve,I as De,n as Ee,P as Re,k as z,E as _}from"./note.api-BQovzEzd.js";import{f as We}from"./tag.api-DUfjr8bg.js";import{b as S,V as qe,h as Ae,a as Pe,i as Fe,j as ze,c as Ie,u as ne,e as oe,k as Ke,l as Me,E as Le,d as Oe,r as Qe,m as $e,s as _e,n as Ue,o as Be,p as He,q as Ge,t as Ye,v as Je,w as U,x as Xe,y as Ze,z as et}from"./ViewSectionDialog-Bhw-ILop.js";import{S as M}from"./SurfaceCard-GMt5xM7v.js";import{N as tt,V as B}from"./url-9nrbQs7Z.js";import{s as st}from"./ArrowRight.es-Bm-ZXpEC.js";import{n as L}from"./Plus.es-CRRp2u5J.js";import"./preload-helper-BXl3LOEh.js";import"./Graph-vXQQ0a-Q.js";const at="group flex min-h-[64px] items-start justify-between gap-3 px-3 py-2.5 transition-colors hover:bg-hover-subtle",rt=s=>{const i=s.tags.slice(0,2),n=s.tags.length-i.length;return i.length===0?null:e.jsxs(e.Fragment,{children:[i.map(c=>e.jsx(S,{size:"compact",className:"max-w-[116px] shrink-0 border-border-subtle bg-transparent text-fg-secondary",children:c.name},c.id)),n>0&&e.jsxs(S,{size:"compact",className:"shrink-0 border-border-subtle bg-subtle text-fg-tertiary",children:["+",n]})]})};function it({notes:s,isPending:i,isError:n,onRetry:c}){return i?e.jsxs("div",{className:"overflow-hidden bg-transparent",children:[e.jsx("div",{className:"h-[64px] animate-pulse bg-subtle/35"}),e.jsx("div",{className:"h-[64px] animate-pulse border-t border-border-subtle/70 bg-subtle/35"}),e.jsx("div",{className:"h-[64px] animate-pulse border-t border-border-subtle/70 bg-subtle/35"})]}):n?e.jsxs("div",{className:"rounded-[16px] border border-border-subtle bg-subtle/30 p-4",children:[e.jsx(h,{as:"p",variant:"body",weight:"semibold",children:"Failed to load this section"}),e.jsx(h,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Retry to refresh this saved query."}),e.jsx("div",{className:"mt-3",children:e.jsx(y,{type:"button",variant:"ghost",size:"sm",onClick:c,children:"Retry"})})]}):s.length===0?e.jsxs("div",{className:"rounded-[16px] border border-dashed border-border-subtle px-4 py-5",children:[e.jsx(h,{as:"p",variant:"body",weight:"semibold",children:"No notes match yet"}),e.jsx(h,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Add matching notes, or edit this view query."})]}):e.jsx("div",{className:"divide-y divide-border-subtle/70 bg-transparent",children:s.map(o=>e.jsxs(I,{to:tt,params:{id:o.id},className:at,children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx(h,{as:"div",variant:"body",weight:"semibold",className:"line-clamp-1",children:o.title||"Untitled"}),e.jsxs("div",{className:"mt-1.5 flex min-w-0 flex-wrap items-center gap-1.5",children:[e.jsxs(h,{as:"span",variant:"label",weight:"medium",tone:"secondary",className:"mr-0.5",children:["Updated ",ke(Number(o.updatedAt))]}),rt(o)]})]}),e.jsx(st,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5"})]},o.id))})}function nt({onEdit:s}){return e.jsxs("div",{className:"rounded-[16px] border border-dashed border-border-subtle bg-subtle/40 px-4 py-5",children:[e.jsx(h,{as:"p",variant:"body",weight:"semibold",children:"This display type is unavailable"}),e.jsx(h,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Switch this section to List or Table to preview the saved query here."}),e.jsx("div",{className:"mt-3",children:e.jsx(y,{type:"button",variant:"ghost",size:"sm",onClick:s,children:"Change display"})})]})}function ot({section:s,notes:i,isPending:n,isError:c,onRetry:o,onEdit:d,onSortChange:l,isSortPending:b}){return s.displayType==="table"?e.jsx(qe,{section:s,notes:i,isPending:n,isError:c,onRetry:o,onSortChange:l,isSortPending:b}):s.displayType==="calendar"?e.jsx(nt,{onEdit:d}):e.jsx(it,{notes:i,isPending:n,isError:c,onRetry:o})}function lt({section:s,onEdit:i,onDuplicate:n,onDelete:c,onMoveUp:o,onMoveDown:d,dragHandle:l}){const b=ae(),v=ie(),[w,j]=T.useState(!1),u=Ae(s),{data:r,isPending:N,isError:R,refetch:W}=D({queryKey:g.views.sectionNotes(s.id,{limit:s.limit,offset:0}),async queryFn(){const m=await Pe(s.id,{limit:s.limit,offset:0});if(m.type==="error")throw m;return m.viewSectionNotes}}),C=r?.notes??[],q=r?.totalCount??0,A=Fe(s.mode),P=s.tagNames.length>0||s.propertyFilters.length>0,F=async m=>{if(w)return;const f=s.sortBy===m?s.sortOrder==="asc"?"desc":"asc":m==="title"?"asc":"desc";j(!0);const k=await ne(s.id,oe(s,{sortBy:m,sortOrder:f}));if(k.type==="error"){v(k.errors[0]?.message??"Failed to update table sort."),j(!1);return}await b.invalidateQueries({queryKey:g.views.all(),exact:!1}),j(!1)};return e.jsxs(M,{flush:!0,className:"flex h-full flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-border-subtle/75 px-4 py-3.5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[l&&e.jsx("div",{className:"-mr-1 shrink-0 self-center",children:l}),e.jsx("div",{className:"min-w-0",children:e.jsx(h,{as:"h2",variant:"subheading",weight:"semibold",tracking:"tight",className:"min-w-0",children:e.jsx(I,{to:B,search:u,className:"truncate hover:text-fg-default/85",children:s.title})})})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-1.5",children:[e.jsx(S,{className:"max-w-full border-border-subtle/80 bg-elevated text-fg-secondary",children:ze(s.displayType)}),s.tagNames.map((m,f)=>e.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[f>0&&e.jsx("span",{className:"px-0.5 text-[10px] font-semibold tracking-[0.08em] text-fg-tertiary/85",children:A}),e.jsx(S,{className:"max-w-full border-border-subtle/80 bg-transparent text-fg-secondary",children:m})]},m)),s.propertyFilters.map(m=>e.jsx(S,{className:"max-w-full border-border-subtle/80 bg-subtle text-fg-secondary",children:Ie(m)},`${m.key}-${m.operator}-${m.value??""}`)),!P&&e.jsx(S,{className:"max-w-full border-border-subtle/80 bg-transparent text-fg-tertiary",children:"All notes"})]})]}),e.jsx(re,{button:e.jsx(se,{label:"Section actions"}),items:[...o?[{name:"Move up",onClick:o}]:[],...d?[{name:"Move down",onClick:d}]:[],...o||d?[{type:"separator"}]:[],{name:"Edit section",onClick:i},{name:"Duplicate section",onClick:n},{type:"separator"},{name:"Delete section",onClick:c}]})]}),e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsx(ot,{section:s,notes:C,isPending:N,isError:R,onRetry:()=>{W()},onEdit:i,onSortChange:F,isSortPending:w})}),e.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-border-subtle/75 px-4 py-3",children:[e.jsx(h,{as:"p",variant:"meta",tone:"tertiary",children:N?"Loading notes...":`Showing ${C.length} of ${q} notes`}),e.jsx(y,{asChild:!0,variant:"subtle",size:"sm",children:e.jsx(I,{to:B,search:u,children:"Open results"})})]})]})}const ct="group flex h-10 max-w-[72vw] shrink-0 items-center rounded-[12px] border transition-[background-color,border-color,color,box-shadow] sm:max-w-[176px]",dt="focus-ring-soft inline-flex h-full min-w-0 flex-1 touch-pan-x items-center gap-1 rounded-[11px] px-3 text-[13px] font-medium outline-none transition-colors";function mt({tab:s,isActive:i,onSelect:n}){const{attributes:c,listeners:o,setNodeRef:d,setActivatorNodeRef:l,transform:b,transition:v,isDragging:w}=ee({id:s.id});return e.jsx("div",{ref:d,style:{transform:te.Translate.toString(b),transition:v,opacity:w?.6:1},className:K(ct,i?"border-border-secondary/80 bg-elevated text-fg-default shadow-[0_8px_18px_-18px_rgba(15,18,24,0.28)]":"border-transparent bg-transparent text-fg-secondary hover:border-border-subtle/80 hover:bg-hover-subtle hover:text-fg-default"),children:e.jsxs("button",{type:"button",ref:l,...c,...o,role:"tab","aria-selected":i,title:`${s.title}. Drag to reorder.`,className:K(dt,i?"text-fg-default":"text-fg-secondary group-hover:text-fg-default",w?"cursor-grabbing":"cursor-pointer"),onClick:n,children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:s.title}),e.jsx("span",{className:"inline-flex min-w-4 shrink-0 items-center justify-center rounded-full bg-hover-subtle/75 px-1 py-0 text-[10px] leading-4 text-current/70",children:s.sections.length})]})})}function pt({tabs:s,activeTabId:i,onSelectTab:n,onReorderTabs:c,onCreateTab:o}){const d=H(E(ge,{activationConstraint:{distance:8}}),E(Y,{coordinateGetter:G}));return e.jsx("div",{className:"-mx-1 rounded-[16px] border border-border-subtle/75 bg-subtle/50 p-1 sm:mx-0",children:e.jsx(J,{sensors:d,collisionDetection:X,modifiers:[we],autoScroll:!1,onDragEnd:l=>{c(l)},children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Z,{items:s.map(l=>l.id),strategy:ye,children:e.jsx("div",{role:"tablist","aria-label":"Views tab list",className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto overflow-y-hidden",children:s.map(l=>e.jsx(mt,{tab:l,isActive:l.id===i,onSelect:()=>{n(l)}},l.id))})}),e.jsxs(y,{type:"button","aria-label":"New view tab",variant:"ghost",size:"sm",className:"h-10 w-10 shrink-0 rounded-[12px] border-transparent bg-transparent px-0 text-[13px] text-fg-secondary hover:border-border-subtle/80 hover:bg-hover-subtle hover:text-fg-default sm:w-auto sm:px-2.5",onClick:o,children:[e.jsx(L,{className:"h-5 w-5 shrink-0"}),e.jsx("span",{className:"hidden sm:inline",children:"New view tab"})]})]})})})}function ut({open:s,mode:i,initialTitle:n="",onClose:c,onSubmit:o}){const[d,l]=T.useState(n);return T.useEffect(()=>{s&&l(n)},[n,s]),e.jsxs(V,{isOpen:s,onClose:c,variant:"form",className:"sm:max-w-[480px]",children:[e.jsx(V.Header,{title:i==="create"?"Create view tab":"Rename view tab",onClose:c}),e.jsx(V.Body,{children:e.jsxs("form",{id:"view-tab-form",className:"flex flex-col gap-4",onSubmit:b=>{b.preventDefault(),o(d)},children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(Ve,{htmlFor:"view-tab-title",size:"md",children:"Tab name"}),e.jsx(De,{id:"view-tab-title",value:d,onChange:b=>l(b.target.value),placeholder:"Now",autoFocus:!0})]}),e.jsx(h,{as:"p",variant:"meta",tone:"tertiary",children:"Each tab is one saved view inside the Views page."})]})}),e.jsx(V.Footer,{children:e.jsxs(Te,{children:[e.jsx(y,{type:"button",variant:"ghost",size:"sm",onClick:c,children:"Cancel"}),e.jsx(y,{type:"submit",size:"sm",form:"view-tab-form",children:i==="create"?"Create tab":"Save tab"})]})})]})}const xt="Save reusable note queries with tags, shared properties, and sorting.",ht="focus-ring-soft hidden h-8 w-8 items-center justify-center rounded-[10px] text-fg-default/70 outline-none transition-colors hover:bg-hover-subtle hover:text-fg-default sm:inline-flex touch-none",bt=({section:s,onEdit:i,onDuplicate:n,onDelete:c,onMoveUp:o,onMoveDown:d})=>{const{attributes:l,listeners:b,setNodeRef:v,setActivatorNodeRef:w,transform:j,transition:u,isDragging:r}=ee({id:s.id});return e.jsx("div",{ref:v,style:{transform:te.Translate.toString(j),transition:u,opacity:r?.6:1},children:e.jsx(lt,{section:s,onEdit:i,onDuplicate:n,onDelete:c,onMoveUp:o,onMoveDown:d,dragHandle:e.jsx("button",{type:"button",ref:w,"aria-label":`Reorder section ${s.title}`,...l,...b,className:K(ht,r?"cursor-grabbing":"cursor-grab"),children:e.jsx(Se,{className:"size-4"})})})})};function Dt(){const s=Ce(),i=ie(),n=ae(),[c,o]=T.useState(null),[d,l]=T.useState(null),{data:b,isPending:v,isError:w,refetch:j}=D({queryKey:g.views.workspace(),async queryFn(){const t=await Ke();if(t.type==="error")throw t;return t.viewWorkspace}}),u=b??Le,r=Me(u),N=r?u.tabs.findIndex(t=>t.id===r.id):-1,{data:R,isPending:W}=D({queryKey:g.tags.list({limit:200}),async queryFn(){const t=await We({limit:200});if(t.type==="error")throw t;return t.allTags}}),C=H(E(ve,{activationConstraint:{distance:8}}),E(Y,{coordinateGetter:G})),q=R?.tags??[],{data:A,isPending:P}=D({queryKey:g.notes.propertyKeys({limit:100}),async queryFn(){const t=await Ee({limit:100});if(t.type==="error")throw t;return t.notePropertyKeys}}),F=A?.keys??[],m=t=>{n.setQueryData(g.views.workspace(),t)},f=async()=>{await n.invalidateQueries({queryKey:g.views.all(),exact:!1})},k=async(t,a)=>{m(a);const p=await Ze(a.tabs.map(x=>x.id));if(p.type==="error"){m(t),i(p.errors[0].message);return}await f()},le=async({active:t,over:a})=>{if(!a||t.id===a.id)return;const p=n.getQueryData(g.views.workspace())??u,x=Qe(p,String(t.id),String(a.id));await k(p,x)},O=async t=>{if(!r)return;const a=n.getQueryData(g.views.workspace())??u,p=$e(a,r.id,t);p!==a&&await k(a,p)},ce=async t=>{const a=n.getQueryData(g.views.workspace())??u,p=_e(a,t.id);m(p);const x=await Ue(t.id);if(x.type==="error"){m(a),i(x.errors[0].message);return}m(x.setActiveViewTab)},Q=async(t,a)=>{if(!r)return;m(a);const p=await et(r.id,a.tabs.find(x=>x.id===r.id)?.sections.map(x=>x.id)??[]);if(p.type==="error"){m(t),i(p.errors[0].message);return}await f()},de=async({active:t,over:a})=>{if(!r||!a||t.id===a.id)return;const p=n.getQueryData(g.views.workspace())??u,x=Be(p,r.id,String(t.id),String(a.id));await Q(p,x)},$=async(t,a)=>{if(!r)return;const p=n.getQueryData(g.views.workspace())??u,x=He(p,r.id,t,a);x!==p&&await Q(p,x)},me=async t=>{const a=await Ge(t);if(a.type==="error"){i(a.errors[0].message);return}await f(),o(null)},pe=async t=>{if(!r)return;const a=await Ye(r.id,t);if(a.type==="error"){i(a.errors[0].message);return}await f(),o(null)},ue=async()=>{if(!r||!await s("Delete this view tab and all of its sections?"))return;const t=await Je(r.id);if(t.type==="error"){i(t.errors[0].message);return}await f()},xe=async t=>{if(!r)return;const a=await U(r.id,t);if(a.type==="error"){i(a.errors[0].message);return}await f(),l(null)},he=async t=>{if(!r||!d||d.mode!=="edit")return;const a=await ne(d.section.id,t);if(a.type==="error"){i(a.errors[0].message);return}await f(),l(null)},be=async t=>{const a=await U(t.tabId,{...oe(t),title:`${t.title} copy`});if(a.type==="error"){i(a.errors[0].message);return}await f(),i("Section duplicated.")},fe=async t=>{if(!r||!await s("Delete this section from the current view tab?"))return;const a=await Xe(t);if(a.type==="error"){i(a.errors[0].message);return}await f()};return e.jsxs(e.Fragment,{children:[e.jsx(Re,{title:"Views",description:xt,children:v&&!b?e.jsx(M,{className:"px-6 py-8 sm:px-8 sm:py-10",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(z,{height:20,width:180,className:"rounded-full"}),e.jsx(z,{height:16,width:260,className:"rounded-full"}),e.jsx(z,{height:44,width:140,className:"rounded-[12px]"})]})}):w?e.jsxs(M,{className:"px-6 py-8 sm:px-8 sm:py-10",children:[e.jsx(h,{as:"p",variant:"body",weight:"semibold",children:"Failed to load saved views"}),e.jsx(h,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Retry loading your saved view tabs."}),e.jsx("div",{className:"mt-4",children:e.jsx(y,{type:"button",variant:"ghost",size:"sm",onClick:()=>{j()},children:"Retry"})})]}):u.tabs.length===0?e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(_,{title:"Create your first view tab",description:"Start with a saved view tab, then add sections that query notes by tags, properties, or both.",className:"h-[320px]"}),e.jsx("div",{className:"flex justify-center",children:e.jsxs(y,{type:"button",onClick:()=>o({mode:"create"}),children:[e.jsx(L,{className:"h-4 w-4"}),"Create first tab"]})})]}):e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsx(pt,{tabs:u.tabs,activeTabId:r?.id??null,onSelectTab:ce,onReorderTabs:le,onCreateTab:()=>o({mode:"create"})}),r&&e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsxs("div",{className:"flex flex-col gap-3 border-b border-border-subtle/80 px-1 pb-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx(h,{as:"h2",variant:"subheading",weight:"semibold",tracking:"tight",truncate:!0,children:r.title}),e.jsx(h,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:r.sections.length>0?`${r.sections.length} section${r.sections.length===1?"":"s"} in this view`:"Add sections to build this view"})]}),e.jsxs("div",{className:"inline-flex flex-wrap items-center gap-2 self-start sm:self-center",children:[e.jsxs(y,{type:"button",size:"sm",onClick:()=>l({mode:"create"}),children:[e.jsx(L,{className:"h-4 w-4"}),"Add section"]}),e.jsx(re,{button:e.jsx(se,{label:"View tab actions"}),items:[...N>0?[{name:"Move tab left",onClick:()=>{O("previous")}}]:[],...N>=0&&N<u.tabs.length-1?[{name:"Move tab right",onClick:()=>{O("next")}}]:[],...u.tabs.length>1?[{type:"separator"}]:[],{name:"Rename tab",onClick:()=>o({mode:"edit",tab:r})},{type:"separator"},{name:"Delete tab",onClick:()=>{ue()}}]})]})]}),r.sections.length===0?e.jsx(_,{title:"Add the first section to this tab",description:"Sections can pull notes by tags, properties, or both.",className:"h-[300px]"}):e.jsx("div",{className:"flex flex-col",children:e.jsx(J,{sensors:C,collisionDetection:X,modifiers:[je],onDragEnd:de,children:e.jsx(Z,{items:r.sections.map(t=>t.id),strategy:Ne,children:e.jsx("div",{className:"flex flex-col gap-4",children:r.sections.map((t,a)=>e.jsx(bt,{section:t,onEdit:()=>l({mode:"edit",section:t}),onDuplicate:()=>{be(t)},onDelete:()=>{fe(t.id)},onMoveUp:a>0?()=>{$(t.id,"previous")}:void 0,onMoveDown:a<r.sections.length-1?()=>{$(t.id,"next")}:void 0},t.id))})})})})]})]})}),e.jsx(ut,{open:c!==null,mode:c?.mode??"create",initialTitle:c?.mode==="edit"?c.tab.title:"",onClose:()=>o(null),onSubmit:t=>{if(c?.mode==="edit"){pe(t);return}me(t)}}),e.jsx(Oe,{open:d!==null,mode:d?.mode??"create",initialSection:d?.mode==="edit"?d.section:null,availableTags:q,availableProperties:F,isTagsLoading:W,isPropertiesLoading:P,onClose:()=>l(null),onSubmit:t=>{if(d?.mode==="edit"){he(t);return}xe(t)}})]})}export{Dt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-DDKNNzI6.js";import{p as f}from"./chunk-JWPE2WC7-_Oqh79OY.js";import{_ as n,l as o}from"./mermaid.core-B14ZAmWA.js";import"./transform-BUB79_za.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-DU_G4Atc.js";import"./preload-helper-BXl3LOEh.js";import"./floating-ui.react-dom-BWTnA00G.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},I={parser:R,db:a,renderer:u,styles:p};export{I as diagram};
|